Re: [Dbpedia-discussion] DBpedia SPARQL Endpoint and Transitive Queries

Bernard Vatant wrote:
> Antoine, all
>
> No time to follow this thread now, but can at least answer to 
> Antoine's request, for the record.
>
>             BTW, do you have a link to Bernard's post ?
>
>
>     That would be handy!
>
>
> http://lists.w3.org/Archives/Public/public-esw-thes/2008Oct/0037.html
And you now get the closure when you execute the query against the 
SPARQL endpoint as a result of:

#Making a inference rule based on the following, assuming you don't want 
to load entire SKOS ontology into your Quad Store

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
INSERT INTO GRAPH <urn:rules.skos> {  skos:broader rdfs:subPropertyOf 
skos:broaderTransitive .
                                      skos:narrower rdfs:subPropertyOf 
skos:narrowerTransitive};

## OR                            
## by loading SKOS ontology into Quad Store
## via iSQL interface (commandline or HTML based Conductor)

DB.DBA.RDF_LOAD_RDFXML (http_get 
('http://www.w3.org/2009/08/skos-reference/skos-owl1-dl.rdf'), 'no', 
'urn:rules.skos');
                                   
## Make Context Rule and associate with Graph IRI
                                  
rdfs_rule_set ('skos-trans', 'urn:rules.skos');

## Via SPARQL endpoint
## Use inference rule pragma to set context rule for SPARQL query

DEFINE input:inference "skos-trans"                               
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:broaderTransitive category:Churches_in_Paris option (transitive) .
  ?m p:abstract ?d.
  ?m geo:point ?p
 FILTER ( lang(?n) = "fr" )
 FILTER ( lang(?d) = "fr" )
    };

Note: based on the data in DBpedia, if you don't have an inference rule 
and pragma use in SPARQL query, as prescribed above, you only other 
route to the full closure is via:

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" )
    };

As you can see, this is an interesting example of how SPARQL + Inference 
Rules aid the process of cleansing data while remaining sensitive to 
context i.e., many people see the same thing differently, because as 
cognitive beings we are fundamentally wired that way.

Data Integration is still ultimately about dealing with:

1. Dirty Data
2. Units of Measurement
3. Context Halo around #1 & #2

HTTP + RDF Data Model + SPARQL provide the most powerful middleware 
infrastructure components to date, for seriously tackling the age-old 
problem of heterogeneous data integration [1].

Links:

1. 
http://virtuoso.openlinksw.com/presentations/Linked_Data_Virtualization/Linked_Data_Virtualization.html#(1)

Kingsley
>
> Bernard
>
> PS : there is a nice research field on SKOS mailing list archives ;-)
> http://www.w3.org/Search/Mail/Public/search?type-index=public-esw-thes&index-type=t&keywords=dbpedia+churches&search=Search 
> <http://www.w3.org/Search/Mail/Public/search?type-index=public-esw-thes&index-type=t&keywords=dbpedia+churches&search=Search>
>
> -- 
> Bernard Vatant
> Senior Consultant
> Vocabulary & Data Engineering
> Tel:       +33 (0) 971 488 459
> Mail:     bernard.vatant@mondeca.com <mailto:bernard.vatant@mondeca.com>
> ----------------------------------------------------
> Mondeca
> 3, cité Nollez 75018 Paris France
> Web:    http://www.mondeca.com
> Blog:    http://mondeca.wordpress.com
> ----------------------------------------------------


-- 


Regards,

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

Received on Friday, 9 October 2009 17:03:56 UTC