DBpedia SPARQL Endpoint and Transitive Queries

All,

The intersection of Leigh Dodds SPARQL extensions survey [1], imminent 
official release of Virtuoso 6.0 (DBpedia basic and Live already use 
this, ditto LOD Cache, and B3S public endpoints), and an old post by 
Bernard Vatant re. skos:broader, has lead to this simple, but powerful 
example of  Virtuoso's Transitive Option extension for SPARQL :

#Transitive Option Off

PREFIX p: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX category: <http://dbpedia.org/resource/Category:>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX geo: <http://www.georss.org/georss/>

SELECT DISTINCT ?m ?n ?p ?d
WHERE {
   ?m rdfs:label ?n.
   ?m skos:subject ?c.
   ?c skos:broader category:Churches_in_Paris.
   ?m p:abstract ?d.
   ?m geo:point ?p
  FILTER ( lang(?n) = "fr" )
  FILTER ( lang(?d) = "fr" )
}

#Transitive Option On

PREFIX p: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX category: <http://dbpedia.org/resource/Category:>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX geo: <http://www.georss.org/georss/>

SELECT DISTINCT ?m ?n ?p ?d
WHERE {
   ?m rdfs:label ?n.
   ?m skos:subject ?c.
   ?c skos:broader category:Churches_in_Paris OPTION (TRANSITIVE).
   ?m p:abstract ?d.
   ?m geo:point ?p
  FILTER ( lang(?n) = "fr" )
  FILTER ( lang(?d) = "fr" )
}



-- 


Regards,

Kingsley Idehen	      Weblog: http://www.openlinksw.com/blog/~kidehen
President & CEO 
OpenLink Software     Web: http://www.openlinksw.com

Received on Thursday, 8 October 2009 15:09:58 UTC