© 2006 Hewlett-Packard Development Company, L.P.The information contained herein is subject to change without notice
Use Case:Populating Business Objects
W3C Workshop on RDF Access to Relational Databases
Andy Seaborne (HP), Damian Steer (ILRT)
3
Business Problem• New business process• XML objects• Data in various places
4
Technical Problem
? ? ?
Geographic Production
<?xml>… <site> <location>??</location> <name>??</name> <capacity>??</capacity> <history> . . . </history> </site>…
Asset & History
5
Technical Approach
Single SPARQL Query
Translation between domains
Databases Databases Databases
SquirrelRDF
6
SquirrelRDF• http://jena.sf.net/SquirrelRDF• SPARQL to SQL
−And LDAP and IMAP
• RDB Mapper−(c.f. TimBL’s Design note)
• Simple servlet• Results in SPARQL XML Results Format,
JSON, …• … and RDF.
7
RDB Mapper
• Automatic Generation• A map is a number of mapped classes
−Not necessarily in the same database
ex:map a db:Map ; db:mapsClass ex:People , ex:Department .
8
RDB Mapper : Classes
• Tables map to classes
ex:People a rdfs:Class ;
db:primaryKey ex:propA ;
db:database <jdbc:mysql://localhost/conference> ;
db:table “People" .
CREATE TABLE People ( id int, name varchar(30), PRIMARY KEY id )
9
RDB Mapper : Properties
ex:people_id a rdf:Property ; rdfs:domain ex:people ; db:col "id" ; db:colType "int" .
ex:people_name a rdf:Property ; rdfs:domain ex:people ; db:col "name" ; db:colType "varchar" .
CREATE TABLE People ( id int, name varchar(30), PRIMARY KEY id )
10
SquirrelRDF• Hard: SPARQL patterns with a property
variable−{ <id1234> ?p “foo” }
• Hard: Query over types−{ ?s rdf:type ?type }
11
Rules• SPARQL basic graph pattern
−point at which data is accessed in SPARQL
• BGP translation−SPARQL pattern match => calculate =>
generate pattern
−Generate pattern more than a BGP (e.g. UNION)
• Applied to query coming in• Targeting databases left to SquirrelRDF
12
Rules Used • Used
−Reformat a key
−Property => property
−Join across databases by key
−Multiple places for one value
• Notes−In this use case, no rewriting the query results
was necessary, but likely needed in other situations.
13
Summary
• Domain mapping problem is not SQL specific
− SPARQL-rewrite rules encapsulate mapping
• Direct database encapsulation− Scale, maintenance
14
15
Jena extended tools family
External bridges
GlozeXML
XML Schema
RDF
OWL
GRDDLXML
with GRDDL annotation
RDF
SquirrelRDFRDF
SPARQLRDBMS
LDAP
JosekiRDF Server
DARQdistributed
SPARQL query
Access
PortalCoreFacetted browse
Brownsauce
RDF explorer
UI
Tools
EyeballConfigurable
RDF validator
Jena Ontology API
SPARQL API
query & update
RDF API
RulesExterna
lNone
Inference
Writers
RDF/XMLN3
TurtleN-triple
Readers
RDF/XMLN3
TurtleN-triple
Graph and query (Store SPI)
MemoryFile
backed SDBSPARQL
database
RDB
Command line tools
- merge RDF- convert format
- schemagen- db load
16
Example: Semantic Web Environmental Directory
www.swed.org.uk
17
Example: Seeker – an Education Portal for the Singapore Government