query-9b72575189af310e407914436f023d16
Propertiesinstance of (P31)country (P17)route number (P1671)located in the administrative territorial entity (P131)
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#>
SELECT
?item
?itemLabel
(GROUP_CONCAT(DISTINCT ?stecke; SEPARATOR = ", ") AS ?stecke_)
WHERE
{
?item wdt:P31 wd:Q728937.
?item wdt:P17 wd:Q183.
OPTIONAL { ?item wdt:P1671 ?stecke. }
FILTER NOT EXISTS { ?item wdt:P131 ?admin. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "de,nl". }
}
GROUP BY ?item ?itemLabel
ORDER BY ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?admin")
v2("?item"):::projected
v1("?itemLabel"):::projected
v4("?stecke"):::projected
v5("?stecke_")
c8(["bd:serviceParam"]):::iri
c10(["de,nl"]):::literal
c5(["wd:Q183"]):::iri
c3(["wd:Q728937"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P131"--> e0v2
e0v2("?admin"):::projected
e0v1("?item"):::projected
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> v3
v2 --"wdt:P131"--> v3
v2 --"wdt:P31"--> c3
v2 --"wdt:P17"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P1671".-> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind2[/"?stecke"/]
v4 --o bind2
bind2 --as--o v5