query-14d27744efccd02d4d6bdba518895143
Query by Yurik modified to display the P131 (unità amministrativa in cui è situato tree in Italy
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
SELECT ?item ?itemLabel ?itemDescription ?linkTo ?linkToLabel ?depth WHERE
{
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.SSSP" ;
gas:in wd:Q38 ;
gas:traversalDirection "Reverse" ;
gas:out ?item ;
gas:out1 ?depth ;
gas:out2 ?linkTo ;
gas:maxIterations 2 ;
gas:linkType wdt:P131 .
}
FILTER EXISTS { ?item wdt:P31/wdt:P279* wd:Q56061 }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "it" .
}
}
ORDER BY ?depth
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?depth"):::projected
v2("?item"):::projected
v3("?linkTo"):::projected
a1((" "))
c5(["gas:program"]):::iri
c7(["com.bigdata.rdf.graph.analytics.SSSP"]):::literal
c11(["Reverse"]):::literal
c22(["it"]):::literal
c3(["wd:Q56061"]):::iri
c18(["wdt:P131"]):::iri
c9(["wd:Q38"]):::iri
c16(["2^^xsd:integer"]):::literal
c20(["bd:serviceParam"]):::iri
f0[[" "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P31"--> e0a1
e0a1 --"wdt:P279"--> e0c3
e0v1("?item"):::projected
e0a1((" ")):::projected
e0c3(["wd:Q56061"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> a1
f0 --> c2
f0 --> c3
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
subgraph s1["http://www.bigdata.com/rdf/gas#service"]
style s1 stroke-width:4px;
c5 --"gas:gasClass"--> c7
c5 --"gas:in"--> c9
c5 --"gas:traversalDirection"--> c11
c5 --"gas:out"--> v2
c5 --"gas:out1"--> v1
c5 --"gas:out2"--> v3
c5 --"gas:maxIterations"--> c16
c5 --"gas:linkType"--> c18
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c20 --"wikibase:language"--> c22
end