© 2006 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Publishing data on the Web (with SPARQL) Andy Seaborne, Semantic and Adaptive Systems Dept
Publishing on the Web Making information available −without knowing the eventual use −reuse, collaboration −reproduction of results This talk −About SPARQL and RDF −Not covered (but important) Economic issues DRM, copyright and licensing issues...
3 Publishing on the Semantic Web SPARQL OWL, RDFS, SKOS RDF URIs XML Data Access Information organisation Information format Identification Serialization Publishing via a query service on the web
RDF/OWL Why using RDF/OWL? −natural representation for graphs of relationships −extensibility, facilities an open eco-system −ease of model integration composing data from multiple sources ontology not schema ease of transformation variable levels of abstraction −support for partial models −inference
5 SPARQL SPARQL = Query Language + Protocol + XML Results Format Access and query RDF graphs Product of the RDF Data Access Working Group Status: W3C Candidate Recommendation
6 SPARQL Query PREFIX dc: SELECT ?title2 WHERE { ?doc dc:title "SPARQL at speed". ?doc dc:creator ?c. ?docOther dc:creator ?c. ?docOther dc:title ?title2 } On an abstracts/papers database: “Find other papers by the authors of a given paper.”
7 SPARQL Query PREFIX dc: PREFIX foaf: PREFIX shop: SELECT ?title2 WHERE { ?doc dc:title ?title. FILTER regex(?title, "SPARQL"). ?doc dc:creator ?c. ?c foaf:name ?name. OPTIONAL { ?doc shop:price ?price } } “Find books with ‘SPARQL’ in the title. Get the authors’ name and the price (if available).” Multiple vocabularies
8 Inference An RDF graph may be backed by inference −OWL, RDFS, application, rules PREFIX rdf: SELECT ?type WHERE { ?x rdf:type ?type. } :x rdf:type :C. :C rdfs:subClassOf :D | type | ======== | :C | | :D |
SPARQL : Data Virtualization SPARQL as integrator −Data remains where it is −Existing applications untouched −data appears as RDF, remap query to native form SPARQL to SQL Direct mapping of tables −Semi-automatic generation of mapping −SquirrelRDF (also does LDAP) Modelled: D2RQ −High-quality mapping, manually developed
10 Federated Query Single Point of Access Inputs: – Service Description – Information Directory – Request Outputs: – Unified results Query Broker SPARQL => SPARQL Doc DB Corp LDAP RDF SPARQL Query
11 Access Multiple Sources PREFIX dc: PREFIX ldap: PREFIX foaf: SELECT ?name ?name2 { ?doc dc:title ?title. FILTER regex(?title, “SPARQL”). ?doc dc:creator ?reseacher. ?researcher ldap: ? . ?researcher ldap:name ?name } “Find the name and addresses of authors of a paper” Query tech reports first, then go to LDAP for more information. SQL database; LDAP server
12 Access Multiple Sources PREFIX dc: PREFIX ldap: PREFIX foaf: SELECT ?name ?name2 { ?doc dc:title ?title. ?doc dc:creator ?reseacher. ?researcher ldap: . } “Find the reports written by the person with address Go to LDAP first, then the reports database
13 SPARQL : Protocol SPARQL = Query Language + Protocol + XML Results Format One request type expressed in WSDL HTTP and SOAP Results: fixed XML form for further transformation
14 Links Jena: Java and.Net Semantic Web Framework − −RDF, SPARQL, OWL, Rules −Open source: BSD-license Commercial and non-commercial use SPARQL Query − SPARQL Protocol − SquirrelRDF: Access legacy SQL: −
15
16 SPARQL Update INSERT { book:newBook dc:title “More about SPARQL”. book:newBook dc:creator [ foaf:mbox ; foaf:name “Alex Author” ] } DELETE { ?book dc:title ?title ; dc:creator ?c } WHERE { ?book dc:title ?title ; dc:creator ?c FILTER regex(?title, “first edition”) } Future HP proposal to W3C