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.

The Debian Package Tracking System now publishes Turtle RDF meta-data

The Debian PTS now speaks the Turtle representation format for the export of RDF meta-data about Debian source packages.

Alongside HTML pages for humans, and the RDF/XML that had already been added to it this means that a new flavour of RDF is now available.

The Turtle format offers the benefits of both machine-readable meta-data, and a somehow human readable textual format too.

For instance, you may check the apache2 Turtle meta-data from the command-line with :
$ curl -L -s -H "Accept: text/turtle" http://packages.qa.debian.org/apache2

Here’s a link to a colorized HTML preview of http://packages.qa.debian.org/a/apache2.ttl.

Under the hood, the XSLT stylesheets of the PTS have been reworked to produce the Turtle format by default, and later convert them to RDF/XML.

Every Debian source package then has a reference URI in the Linked Data word, in the form http://packages.qa.debian.org/PACKAGE_NAME, that redirects, through proper content-negociation (the HTTP Accept header) to the HTML, RDF/XML or Turtle documents. For apache2, these are, resp. at http://packages.qa.debian.org/a/apache2.html, http://packages.qa.debian.org/a/apache2.rdf and http://packages.qa.debian.org/a/apache2.ttl.

The meta-data uses the model of the ADMS.SW ontology (1.0), and the content has also been slightly updated to make it more conformant to the ADMS.SW specifications (checks done with the ADMS.SW validator).

Let’s hope this makes RDF more familiar to Debian folks, and allows more Linked Data interlinking with other resources about FLOSS packages.

A 30 minutes introduction to git

I’ve been looking for a set of slides that I could have reused to make a 30 minutes introduction to my colleagues at the computer science department.

Finding none that would be suitable (i.e. including graphical examples and not only being the canvas for a workshop), I tried to proceed with making one of my own.

I’ve reused the document git concepts simplified, whose content seemed quite good, and have converted it to a set of slides.

Here’s the result, which has been reworked a bit vs. the original “git concepts simplified” :

Here’s the PDF version.

Note that if you prefer a version that aligns more with the original, here’s also an older version, in : https://github.com/olberger/git-notes/tree/master/gcs

Update: For the lone reader that cannot attend my presentation, I should recommend to read first the HTML version by Sitaram at git concepts simplified, as the slides miss some details (which I’ve kept in the beamer notes only), then only refer to my slides in a second time, for some additions.

If you want the org-mode source (containing the dot source of the diagrams), contact me. I’ll maybe upload the source into some Git repo whan I have enough demand/time 😉

Presented “Generating Linked Data descriptions of Debian packages in the Debian PTS” at the Paris Mini DebConf

I have made a presentation at the Paris MinDebconf 2012 about the work I’ve done to bring more semantic meta-data to the Debian PTS (see previous posts).

Here are my slides :

Also available here as PDF.

Debian Package Tracking System now produces RDF description of source packages

Here’s a second post on the subject of RDF descriptions for Debian source packages (see the previous post for some context).

From now on, the Debian Package Tracking System (PTS) will produce, alongside HTML pages meant for humans, RDF pages meant for Linked Data / Semantic Web aware applications.

Every Debian source package, which used to have an HTML page like http://packages.qa.debian.org/packagename now has a corresponding RDF/XML document available provided that the application/rdf+xml content-type is required (the HTTP client being redirected to the proper HTML or RDF document).
Continue reading “Debian Package Tracking System now produces RDF description of source packages”