query-3723a9c487f3114161dd6142f9180395
Road connections
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Graph
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
select ?road ?roadLabel ?image ?connected_road ?connected_roadLabel where {
service gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ;
gas:in wd:Q3429049, wd:Q12325236;
gas:traversalDirection "Undirected" ;
gas:out ?connected_road ;
gas:out1 ?depth ;
gas:out2 ?road ;
gas:linkType wdt:P2789 ;
gas:maxIterations 7;
gas:maxVisited 200 .
}
?road wdt:P2789 ?connected_road .
OPTIONAL {?road wdt:P18 ?image }
SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en" . }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?connected_road"):::projected
v2("?depth")
v4("?image"):::projected
v3("?road"):::projected
c2(["gas:program"]):::iri
c7(["wd:Q12325236"]):::iri
c6(["wd:Q3429049"]):::iri
c14(["wdt:P2789"]):::iri
c18(["200^^xsd:integer"]):::literal
c4(["com.bigdata.rdf.graph.analytics.BFS"]):::literal
c21(["bd:serviceParam"]):::iri
c9(["Undirected"]):::literal
c23(["da,en"]):::literal
c16(["7^^xsd:integer"]):::literal
subgraph s1["http://www.bigdata.com/rdf/gas#service"]
style s1 stroke-width:4px;
c2 --"gas:gasClass"--> c4
c2 --"gas:in"--> c6
c2 --"gas:in"--> c7
c2 --"gas:traversalDirection"--> c9
c2 --"gas:out"--> v1
c2 --"gas:out1"--> v2
c2 --"gas:out2"--> v3
c2 --"gas:linkType"--> c14
c2 --"gas:maxIterations"--> c16
c2 --"gas:maxVisited"--> c18
end
v3 -->c14--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P18".-> v4
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c21 --"wikibase:language"--> c23
end