W3C home > Mailing lists > Public > www-rdf-interest@w3.org > November 2001

Re: ODBC driver for RDF?

From: Libby Miller <Libby.Miller@bristol.ac.uk>
Date: Wed, 21 Nov 2001 11:27:05 +0000 (GMT)
To: Pierre-Antoine CHAMPIN <champin@bat710.univ-lyon1.fr>
cc: Sandro Hawke <sandro@w3.org>, "Thomas B. Passin" <tpassin@home.com>, www-rdf-interest@w3.org
Message-ID: <Pine.GSO.4.21.0111211115260.26110-100000@mail.ilrt.bris.ac.uk>


At the suggestion of Dan Brickley, I've implemented something similar, a
JDBC (Java's ODBC) driver for RDF databases over the top of a generic
getTriples(s,p,o) interface for my implementation of the SquishQL RDF
query language[1]. So you ask a query and get a set of bindings for the
variables you ask for, e.g.   

SELECT ?sal, ?t 
FROM
      http://ilrt.org/discovery/2000/11/rss-query/jobs-rss.rdf,
      http://ilrt.org/discovery/2000/11/rss-query/jobs.rss 
WHERE
  (job::advertises ?x ?y)
  (job::salary ?y ?sal)
  (job::title ?y ?t) 
USING job for http://ilrt.org/discovery/2000/11/rss-query/jobvocab.rdf# 

and you get back something like


     ?sal           ?t
     100000         Job title for job1 
     150000         Job title for job2 
     60000          Job title for job33 
     100000         Job title for job22 
     50000          Job title for job11 

as a JDBC resultset, basically an arraylist of hashes. JDBC is nice and
familiar to Java programmers, so this makes for a friendly interface to
RDF databases. The reliance on getTriples(s,p,o) means it can be
inefficient, but you can couple the query and resultset more tightly if
you like, for example using an SquishQl to SQL rewriter for a particular
table structure.

Anonymous nodes are an interesting case. My implementation currently
brings back the internal identifiers for them, but really you want to
have some notion that they are anonymous, while allowing repeated
queries of the same database using them (maybe), and also retaining
the information that one is the same as another, as Andy Seaborne has
pointed out to me. Additionally, you need to retain information about
whether a result is a resource or a literal, which could be done through
resultSetMetadata in JDBC. You might also want to return provenance
information somehow.

cheers

Libby


[1] http://swordfish.rdfweb.org/rdfquery



On 21 Nov 2001, Pierre-Antoine CHAMPIN wrote:

> On Wed, 2001-11-21 at 06:25, Sandro Hawke wrote:
> >      SQL      RDF
> >      ===      ===
> >      table    Class
> >      column   Property
> >      row      object ("Resource")
> 
> Does not look very RDFish to me...
> The only general purpose RDF-into-DB schema I can imagine is a
> Subject/Predicate/Object table...
> 
> Ok, some people will need more "natural" views of the data, but then you
> could use Views, rather than Tables, like the one above.
> 
> And may be some additionnal columns may be useful, like a StatementID of
> RDFSource column, when the DB gathers statements from different
> sources...
> 
>   Pierre-Antoine
> 
> 
Received on Wednesday, 21 November 2001 06:29:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:52 GMT