EasyRdf
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.
Example
$foaf = new EasyRdf_Graph("www.aelius.com/njh/foaf.rdf");
$foaf->load();
$me = $foaf->primaryTopic();
echo "My name is: ".$me->get('foaf:name')."\n";
Downloads
- easyrdf-0.6.2.tar.gz
- easyrdf-0.6.0.tar.gz
- easyrdf-0.5.2.tar.gz
- easyrdf-0.5.1.tar.gz
- easyrdf-0.5.0.tar.gz
- easyrdf-0.4.tar.gz
- easyrdf-0.3.tar.gz
- easyrdf-0.2.tar.gz
- easyrdf-0.1.tar.gz
Links
- EasyRdf Homepage
- API documentation
- Change Log
- Source Code: github.com/njh/easyrdf
- Issue Tracker: github.com/njh/easyrdf/issues
Requirements
Features
- API documentation written in phpdoc
- Unit tests written using phpunit
- Choice of RDF parser:
- Built-in: RDF/JSON, N-Triples, RDF/XML
- ARC2: RDF/XML, Turtle, RSS, microformats, eRDF, RDFa, ...
- Redland Bindings: RDF/XML, N-Triples, Turtle, TriG, RSS Tag Soup, ...
- rapper: RDF/XML, N-Triples, Turtle, TriG, RSS Tag Soup, ...
- Choice of RDF serialiser:
- Built-in: RDF/JSON, N-Triples, RDF/XML, Turtle
- ARC2: RDF/JSON, RDF/XML, N-Triples, Turtle, POSHRDF
- rapper: RDF/JSON, N-Triples, RDF/XML, Turtle, RSS, Atom, Dot, ...
- Optional support for Zend_Http_Client
- No required external dependancies upon other libraries (PEAR, Zend, etc...)
- Complies with Zend Framework coding style.
- Type mapper - resources of type foaf:Person can be mapped into PHP object of class Foaf_Person
- Comes with a number of examples
Licensing
The EasyRdf library and tests are licensed under a BSD-3-Clause license.
The examples are in the public domain, for more information see UNLICENSE.
More Examples
- artistinfo.php - Example of mapping an RDF class type to a PHP Class
- basic.php - Basic "Hello World" type example
- basic_sparql.php - Example of making a SPARQL SELECT query
- converter.php - Convert RDF from one format to another
- dbpedia_village.php - Fetch and information about villages in Fife from dbpedia.org
- dump.php - Display the contents of a graph
- foafinfo.php - Display the basic information in a FOAF document
- foafmaker.php - Construct a FOAF document with a choice of serialisations
- graph_direct.php - Example of using EasyRdf_Graph directly without EasyRdf_Resource
- graphstore.php - Store and retrieve data from a SPARQL 1.1 Graph Store
- html_tag_helpers.php - Rails Style html tag helpers to make the EasyRdf examples simplier
- httpget.php - No RDF, just test EasyRdf_Http_Client
- review_extract.php - Extract a review from a page containing Google Review RDFa
- serialise.php - Basic serialisation example
- sparql_queryform.php - Form to submit SPARQL queries and display the result
- uk_postcode.php - Example of resolving UK postcodes using uk-postcodes.com
- zend_framework.php - Example of using Zend_Http_Client and Zend_Loader_Autoloader with EasyRdf
Nicholas J Humfrey <njh@aelius.com>
gipoco.com
is neither affiliated with the authors of this page or responsible
for its contents. This is a safe-cache copy of the original web site.
gipoco.com
is neither affiliated with the authors of this page nor responsible
for its contents. This is a safe-cache copy of the original web site.