W3C home > Mailing lists > Public > public-sparql-dev@w3.org > July to September 2006

Re: Suggestion to introduce baseURI property into D2RQ

From: Chris Bizer <bizer@zedat.fu-berlin.de>
Date: Thu, 10 Aug 2006 11:25:42 +0200
Message-ID: <001401c6bc5e$f3f400c0$83ec2da0@named4gc1asnuj>
To: "Holger Knublauch" <holger@topquadrant.com>, "Chris Bizer" <chris@bizer.de>, "Richard Cyganiak" <richard@cyganiak.de>
Cc: <d2rq-map-devel@lists.sourceforge.net>, <public-sparql-dev@w3.org>

Hi Holger,

> In the current d2rq namespace it does not seem to be possible to specify 
> the base URI of the database's virtual triple store.  I am looking for a 
> way to specify the URI of the database so that it can be referenced as 
> object of an owl:imports statement.
> I suggest to introduce an rdf:Property d2rq:baseURI with domain=Database 
> and range=rdf:Resource.  This value would be attached to each Database 
> object so that tools have something to reference.  If no such value is 
> present, then tools that want to resolve imports can only make a guess 
> (e.g. using the URI patterns), but this does not seem to be a real 
> alternative.
> I guess you never had this requirement in a pure RDF world, but I think 
> for OWL this is necessary.
> Background: In TBC we use file introspection to determine which local file 
> represents which base URI, so that owl:imports don't need to be resolved 
> from the Web.  In the case of D2RQ files, no local file represents the 
> database's namespace, because the database graph is virtual.  Therefore, 
> what I currently do is to look into the associated mapping file.  I think 
> I currently take the namespace of the first class object, but this is 
> wrong because the schema namespace could be different from the instance 
> namespace (and in most cases it probably should, because the schema will 
> be stored in a different file).  Then, if someone imports the declared 
> base URI, I can return the D2RQ graph from the mapping file.
> Does that make any sense or do I miss something?

Interesting proposal which overlaps with the URI dereferencing work we are 
currently doing in the context of D2R Server.

I think the question we have to answer first is: Does a database have a 
single base URI or could it have multiple base URIs?

I the process of supporting SPARQL we will add support for named graphs to 
the D2RQ mapping language. Then a database could be represented by multiple 
RDF graphs. That's why I don't think it is a good idea to have baseURI 
property directly on the database resource. An option could be to have a 
d2rq:NamedGraph resource in between the database and the classmap resources. 
See below.

We also have to take into account how D2R server could dereference baseURIs 
(graphs) over the Web.
What we are currently doing is to use relative URIs in the classmap URI 
patterns and to expand them to complete URIs using the D2R server URL, what 
makes URIs Web-retrievable.

So an option could be to have something like:

db1:Database1 rdf:type d2rq:Database;
              d2rq:jdbcDSN "jdbc:mysql://localhost/iswc";
              d2rq:jdbcDriver "com.mysql.jdbc.Driver".

db1:Graph1 rdf:type d2rq:NamedGraph;
              d2rq:name "graph1";
              d2rq:dataStorage db1:Database1 .

db1:Conference rdf:type d2rq:ClassMap ;
            d2rq:class :Conference ;
            d2rq:uriPattern "/confno@@Conferences.ConfID@@" ;
            d2rq:namedGraph db1:Graph1 .

In the D2R Server case, "graph1" could still be expanded with the server URL 
to a URI like http://serverURL/graph1 and a conference could be called for 
example http://serverURL/confno2
Dereferencing http://serverURL/graph1 would return a graph containing all 
instances of all ClassMaps that refer to db1:Graph1. Dereferencing 
http://serverURL/confno2 would return a single graph describing the 
conference. This graph could contain a rdf.seeAlso triple referring to 

In your local  (non-Web) use case, you could explicitly set a baseURI with 
the d2rq:name property, for instance d2rq:name "urn://myOntology" and a 
conference would be called  "urn://myOntology/confno2".

Does this make sense to anyone?



> Cheers,
> Holger 
Received on Thursday, 10 August 2006 09:25:52 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:15:49 UTC