Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does slash mean in a SPARQL property path?

In one of the samples for querying Wikidata, I found the following query, which includes p:P6/v:P6 in the line after SELECT. What does it mean?

PREFIX wd: <http://www.wikidata.org/entity/> 
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>

SELECT ?p ?w ?l ?wl WHERE {
   wd:Q30 p:P6/v:P6 ?p .       #-- This line
   ?p wdt:P26 ?w .
   OPTIONAL  {  
     ?p rdfs:label ?l filter (lang(?l) = "en") . 
   }
   OPTIONAL {
     ?w rdfs:label ?wl filter (lang(?wl) = "en"). 
   }
 }
like image 672
Suzan Cioc Avatar asked Aug 08 '15 19:08

Suzan Cioc


1 Answers

It's the SequencePath flavour of a SPARQL 1.1 property path.

wd:Q30 p:P6/v:P6 ?p .

means that there is a triple (wd:Q30, p:P6, ?x), and another triple (?x, v:P6, ?p), without an explicit need to write (or name) the intermediate node ?x. In other words, it says: "?p can be found by starting at wd:Q30, following property p:P6, and then property v:P6.

like image 53
O. R. Mapper Avatar answered Nov 16 '22 04:11

O. R. Mapper