[4suite] Rdflib 4RDF Driver

Chimezie Ogbuji chimezie at gmail.com
Tue Oct 18 22:41:06 MDT 2005


I just checked in a 4RDF -> rdflib store API mapping implemented as a
4RDF driver.  This driver redirects 4RDF API invokations to the
current develolpment rdflib store API (http://rdflib.net/rdf_store/). 
This is meant as a first step towards the migration from 4RDF to
rdflib (http://rdflib.net/roadmap/).  Also updated test harness to
include this driver.  It currently gets through all the tests except
those that query by Statement URI (see below), a handful of the
burrowed serialization test cases, and unicode vs. string comparison.

The driver works off the latest rdflib from SVN.  The Db methods
(GetDB,CreateDb,DestroyDb,etc.. ) take two arguments:

- A connection string (which includes all the configuration data
needed by the store implementation to locate the database)
- The name of the backend to use (rdflib registers backends by name).

I ran the MySQL backend through the test suites primarily because it
includes an implementation of REGEX statement term matching required
by 4rdf but not implemented in all the rdflib backends.  The
connection string for this backend is in the form:

user=..user name ..,password= .. password ..,db=..
dbname..,host=..hostname..,port=..port..

The connection string for the SleepyCat backend, for instance, is just
the path to where the database files are stored.

(compliance) Issues:

1) the Rdflib Graph interfaces do not account for RDF reification. 
These are somewhat covered by support for Notation 3
quoted/hypothetical contexts.  The only visible difference is in the
test cases that match by statementUri

2) This driver makes use of REGEXTerm (defined in the MySQL rdflib
backend) in order to faciliate REGEX matching of statement parts.

3) This driver uses a switch to cause the MySQL rdflib backend to
produce quads instead of triples (required by the 4RDF interface)
which deviates from the current rdflib method signature.

4) When populating the underlying rdflib Graph using any of the 4RDF
syntax parsers, Literal datatypes and language tags will be lost - as
these are currently not supported by 4RDF

At the very least, this API redirect allows other rdflib backend/store
implementations to be written and tested using the full 4RDF test
suite, provides Versa querying capabilities over an rdflib store, and
documents the interface changes required to port 4Suite applications
to use rdflib instead 4rdf.

Chimezie



More information about the 4suite mailing list