Transcript Slide
Use Case:
Populating Business Objects
W3C Workshop on RDF Access to
Relational Databases
Andy Seaborne (HP), Damian Steer
(ILRT)
© 2006 Hewlett-Packard Development Company, L.P.
The information contained herein is subject to change without notice
Business Problem
•
New business process
•
XML objects
•
Data in various places
3
Technical Problem
<?xml>
…
<site>
<location>??</location>
<name>??</name>
<capacity>??</capacity>
<history>
. . .
</history>
</site>
…
???
4
Geographic
Production
Asset & History
Technical Approach
Single SPARQL Query
Translation between domains
SquirrelRDF
Databases
5
Databases
Databases
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.
6
RDB Mapper
ex:map
a
db:Map ;
db:mapsClass ex:People , ex:Department .
•
Automatic Generation
•
A map is a number of mapped classes
− Not necessarily in the same database
7
RDB Mapper : Classes
CREATE TABLE People (
id int,
name varchar(30),
PRIMARY KEY id )
ex:People a
rdfs:Class ;
db:primaryKey ex:propA ;
db:database <jdbc:mysql://localhost/conference> ;
db:table “People" .
•
8
Tables map to classes
RDB Mapper : Properties
CREATE TABLE People (
id int,
name varchar(30),
PRIMARY KEY id )
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" .
9
SquirrelRDF
•
Hard: SPARQL patterns with a property variable
− { <id1234> ?p “foo” }
•
Hard: Query over types
− { ?s rdf:type ?type }
10
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
11
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.
12
Summary
•
Domain mapping problem is not SQL specific
− SPARQL-rewrite rules encapsulate mapping
•
Direct database encapsulation
− Scale, maintenance
13
14
Jena extended tools family
UI
PortalCore
Brownsauce
Facetted browse
RDF explorer
Access
DARQ
Joseki
distributed
SPARQL
query
RDF Server
External bridges
XML
Gloze
Tools
RDF
OWL
XML Schema
GRDDL
RDBMS
15
query & update
Ontology
API
RDF
RDF/XML
N3
Turtle
N-triple
RDF
Eyeball
Writers
Inference
None
Rules
External
Graph and query (Store SPI)
SPARQL
SquirrelRDF
LDAP
SPARQL
API
RDF API
Readers
XML
with GRDDL
annotation
Jena
Memory
File
backed
RDB
RDF/XML
N3
Turtle
N-triple
SDB
SPARQL
database
Configurable
RDF validator
Command
line tools
- merge RDF
- convert format
- schemagen
- db load
Example: Semantic Web Environmental
Directory
www.swed.org.uk
16
Example: Seeker – an Education Portal for
the Singapore Government
17