RDF development in PHP with a PostGreSQL triple store thanks to the LibRDF OO wrapper for redland/librdf

Redland/librdf offers powerful features like being able to persist an RDF model to a relational database (only PostGreSQL seems to work on my setup with 1.0.16, but I may have misconfigured it). You can then do SPARQL queries over the model, and lots of other nice things.

Unfortunately, the default PHP bindings are not really object-oriented, so the code isn’t looking so good.

But thanks to a gentleman named David Shea, there is an object-oriented library named LibRDF (case is sensitive), that helps write nice looking PHP.

I discovered it via the blog post of Felix Ostrowski, who took over the maintenance of the LibRDF library (still the docs live on the original author’s site).

In his post, Felix illustrates how you may use it to parse Richard Cyganiak’s FOAF profile.

But the examples he gives don’t illustrate the full potential of persistence of the RDF graph into the DB.

Here’s my contribution in 2 examples that will hopefully help : first, one that load Richard’s FOAF to the DB, and one, that later retrieve the saved model and perform the same query (both pushed to my github clone of the library).

There may be some problems with the use of librdf, including its availability, as it is not full PHP of course… and I’ve heard of memory management problems, but, depening on your needs, this may be quite handy for writing Linked Data applications.

First release (0.1) of a far from complete OSLC-CM V1 demo server

We’re working on implementing a demo/test server for the OSLC-CM V1 protocol, in order to help test client tools.

We’ve released (under a BSD license) a first 0.1 preliminary version that only supports GET queries, that’ll lead the way to an expected complete demo server of OSLC-CM V1 when the 1.0 version will be finished.

At the moment, it will only provide a minimal REST implementation of a PHP server using zend, and will produce JSON or XML/RDF views of fictionnal bugs contructed out of contents of a CSV file.

More details may be found at : https://picoforge.int-evry.fr/cgi-bin/twiki/view/Oslc/Web/, whereas the code is in the Download page there.