170 likes | 177 Vues
Use Case: Populating Business Objects W3C Workshop on RDF Access to Relational Databases Andy Seaborne (HP), Damian Steer (ILRT). Business Problem. New business process XML objects Data in various places. Technical Problem.
E N D
Use Case:Populating Business ObjectsW3C Workshop on RDF Access to Relational DatabasesAndy Seaborne (HP), Damian Steer (ILRT)
Business Problem • New business process • XML objects • Data in various places
Technical Problem <?xml>… <site> <location>??</location> <name>??</name> <capacity>??</capacity> <history> . . . </history> </site>… ? ? ? Production Asset & History Geographic
Databases Databases Databases Technical Approach Single SPARQL Query Translation between domains SquirrelRDF
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.
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 .
RDB Mapper : Classes • Tables map to 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" .
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" .
SquirrelRDF • Hard: SPARQL patterns with a property variable • { <id1234> ?p “foo” } • Hard: Query over types • { ?s rdf:type ?type }
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
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.
Summary • Domain mapping problem is not SQL specific • SPARQL-rewrite rules encapsulate mapping • Direct database encapsulation • Scale, maintenance
RDBMS SPARQL XML with GRDDL annotation SquirrelRDF GRDDL RDF RDF LDAP Gloze RDF XML OWL XML Schema Jena extended tools family PortalCore Facetted browse Brownsauce RDF explorer UI Joseki RDF Server DARQ distributed SPARQL query Access External bridges Tools Jena RDF API SPARQL API query & update Ontology API Eyeball Configurable RDF validator Readers RDF/XML N3 Turtle N-triple Writers RDF/XML N3 Turtle N-triple Inference None Rules External • Command line tools • merge RDF • convert format • schemagen • db load Graph and query (Store SPI) Memory File backed RDB SDB SPARQL database
Example: Semantic Web Environmental Directory www.swed.org.uk
Example: Seeker – an Education Portal for the Singapore Government