oslc QUERY CAPABILITIES

and sparql



Dr. Jose María Alvarez-Rodríguez
Carlos III University of Madrid, Spain
josemaria.alvarez@uc3m.es

Can someone tell me…

“Swedish writers that were born in Stockholm before 1900”

And if you have a response…

“Places (lat. and long) far from Stockholm 200Km”

It was easy…try this one…

“Give me a list of countries and names in English and Chinese including the ISO-3 code and latitude and longitude”

sparql dbpedia query (writers)

PREFIX dbo: 

SELECT ?name ?birth ?description ?person WHERE {
     ?person dbo:birthPlace :Stockholm.
     ?person  .
     ?person dbo:birthDate ?birth .
     ?person foaf:name ?name .
     ?person rdfs:comment ?description .
     FILTER (?birth < "1900-01-01"^^xsd:date).
     FILTER (LANG(?description) = 'en') .
}
ORDER BY ?name
 http://dbpedia.org/snorql/

results


sparql query dbpedia (places)

PREFIX geo:  
PREFIX onto:  
SELECT * WHERE {
 ?s a onto:Place .
 ?s geo:lat ?lat .
 ?s geo:long ?long .
 FILTER(
  xsd:double(?lat) - xsd:double(59.3294) <= 2 && 	   xsd:double(59.3294) - xsd:double(?lat) <= 2 &&  xsd:double(?long) - xsd:double(18.0686) <= 2 && 	  xsd:double(18.0686) - xsd:double(?long) <= 2).
}
LIMIT 100

results


sparql query webindex (countries)


SELECT *
WHERE{
  ?country rdf:type wi-onto:Country.
  ?country rdfs:label ?label.
  FILTER (lang(?label) = 'en').  
  ?country skos:prefLabel ?countryLabel.
  FILTER (lang(?countryLabel) = 'zh').  
  ?country wi-onto:has-iso-alpha3-code ?id.
  ?country geo:lat ?lat.
  ?country geo:long ?long.
  }

results


If we change…

“Authors of the requirements specification version 2”

“Which subsystems are directly related to the braking system?”

“Give me the list of requirements of the Car system in English and Chinese including any other metadata…”

OSLC QUERY CAPABILITIES

  • Based on graph-patterns
  • Define the query base through the property
    • oslc.queryBase
  • Two patterns matching
    • Property Tree patterns
      • Configuration oslc.properties
    • Member List patterns
      • At least one of:
 oslc.whereoslc.searchTermsoslc.orderBy, and oslc.select

examples

...from the Specification...

  • Give me the bugs with identifier 4242

 http://example.com/bugs?oslc.where=dcterms:identifier="4242“
  • Give me the bugs with "high priority" created after April 2010  

http://example.com/bugs?oslc.where=cm:severity="high" and dcterms:created>"2010-04-01“  
  • Give me the bugs created by "Jhon Smith"  

 http://example.com/bugs?oslc.where=dcterms:creator{foaf:givenName="John" and foaf:familyName="Smith"}

preliminary evaluation

  • A restricted syntax of SPARQL
    • Triple matching in SPARQL will be automatic
    • The endpoint receives the query and returns the set of results
      • No API is required (hard-wired)
    • More intuitive (a Linked Data principle)
    • Content negotiation

Why Not SPARQL?

  • It is necessary to deploy an endpoint?
  • Security->SPARQL injection?
  • Simplicity
  • Use graph patterns but no dependency to SPARQL

KEY CONCEPT



Use SPARQL 

as 

logical interface

Q & A


Formal Semantics?


oslc query capabilities


SPARQL

Q & A


Expressivity?


oslc query capabilities


SPARQL

Q & A


Federated queries?


oslc query capabilities


SPARQL

Q & A


Protocol and query language?


oslc query capabilities


SPARQL

Q & A


CRUD Operations?


oslc query capabilities


SPARQL (1.1 INSERT AND UPDATE)

Q & A


Standard?


oslc query capabilities


SPARQL (W3C standard)

Q & A


Auto-discovery?


oslc query capabilities


SPARQL

Q & A


A RDF repository is required?


oslc query capabilities


SPARQL

(it depends on how data is published...)

Q & A


OWA operators or query modifiers?


oslc query capabilities


SPARQL

Q & A


Community and documentation?


oslc query capabilities


SPARQL

Q & A


...and so on...


oslc query capabilities


SPARQL

discusion

  • A SPARQL interface helps to query Linked Data
    • It is not mandatory to deploy a RDF repository
    • ...offer the logical interface
  • SPARQL as a language can be translated to SQL, etc.
  • More simple and intuitive
  • Key-driver for Linked Data

but...

  • Yet another query language?
  • Too complex?
  • Is there any real necessity?



Should OSLC consider the use of SPARQL?


As a logical view or interface (at least)…

Next steps



An OSLC-SPARQL WG?


...for your attention!

Q & A

CREDITS

  • Speaker: Dr. Jose María Alvarez-Rodríguez
  • Team:
    • KR group
      • Prof. Dr. Juan Llorens
      • Prof. Dr. Juan Migel Gómez, 
      • Dr. Anabel Fraga
      • Dr. Valentín Moreno
      • Ms. Manuela Alejandres
      • Mr. Jose Fuentes (The ReuseCompany Inc.)

OSLC and SPARQL

By Jose María Alvarez

OSLC and SPARQL

On the applicability of a formal query language to OSLC specifications. Implementing OSLQ query capabilities through a SPARQL interface.

  • 2,610