query-014bf24d76c7cec40f45eea4c119ac3d
Start at Tours and work upwards to France SELECT ?station ?stationLabel ?pred ?predLabel ?depth WHERE { SERVICE gas:service { gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ; gas:in wd:Q288 ; gas:out ?station ; gas:out1 ?depth ; gas:out2 ?pred . gas:program gas:linkType wdt:P131 . } FILTER(?station != wd:Q142)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }
Use at
- https://query.wikidata.org/sparql
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
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#>
# Start at Tours and work upwards to France
SELECT ?station ?stationLabel ?pred ?predLabel ?depth WHERE
{
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ; gas:in wd:Q288 ; gas:out ?station ; gas:out1 ?depth ; gas:out2 ?pred .
gas:program gas:linkType wdt:P131 . }
FILTER(?station != wd:Q142)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?depth"):::projected
v3("?pred"):::projected
v1("?station"):::projected
c3(["gas:program"]):::iri
c16(["en"]):::literal
c12(["wdt:P131"]):::iri
c5(["com.bigdata.rdf.graph.analytics.BFS"]):::literal
c14(["bd:serviceParam"]):::iri
c7(["wd:Q288"]):::iri
f0[["?station != 'wd:Q142'"]]
f0 --> v1
subgraph s1["http://www.bigdata.com/rdf/gas#service"]
style s1 stroke-width:4px;
c3 --"gas:gasClass"--> c5
c3 --"gas:in"--> c7
c3 --"gas:out"--> v1
c3 --"gas:out1"--> v2
c3 --"gas:out2"--> v3
c3 --"gas:linkType"--> c12
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c14 --"wikibase:language"--> c16
end