HSA Test User c16dcac362 User import | 7 years ago | |
---|---|---|
.. | ||
lib | 7 years ago | |
scripts | 7 years ago | |
CHANGELOG.md | 7 years ago | |
DEVELOPER.md | 7 years ago | |
LICENSE.md | 7 years ago | |
README.md | 7 years ago | |
composer.json | 7 years ago | |
doap.php | 7 years ago |
EasyRdf is a PHP library designed to make it easy to consume and produce RDF. It was designed for use in mixed teams of experienced and inexperienced RDF developers. It is written in Object Oriented PHP and has been tested extensively using PHPUnit.
After parsing EasyRdf builds up a graph of PHP objects that can then be walked around to get the data to be placed on the page. Dump methods are available to inspect what data is available during development.
Data is typically loaded into a EasyRdf_Graph object from source RDF documents, loaded from the web via HTTP. The EasyRdf_GraphStore class simplifies loading and saving data to a SPARQL 1.1 Graph Store.
SPARQL queries can be made over HTTP to a Triplestore using the EasyRdf_Sparql_Client class. SELECT and ASK queries will return an EasyRdf_Sparql_Result object and CONSTRUCT and DESCRIBE queries will return an EasyRdf_Graph object.
$foaf = new EasyRdf_Graph("http://njh.me/foaf.rdf");
$foaf->load();
$me = $foaf->primaryTopic();
echo "My name is: ".$me->get('foaf:name')."\n";
The latest stable version of EasyRdf can be downloaded from the EasyRdf website.
The EasyRdf library and tests are licensed under the BSD-3-Clause license. The examples are in the public domain, for more information see UNLICENSE.