query-811a83bca2929a2a9dde1ba0e7c34d01

rq turtle/ttl

Straßen mit/ohne physische Verbindung (P2789)

Use at

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#>
#-------------------------------------------------------------------------------
# Straßen mit/ohne physische Verbindung
# Quelle: https://www.wikidata.org/wiki/User:Stefan_Kühn/Dresden
#-------------------------------------------------------------------------------
#defaultView:Map
SELECT  ?item ?itemLabel ?coord (count (?connect) as ?anzahl) ?rgb
WHERE {
  ?item wdt:P8138 wd:Q97612386.
  FILTER NOT EXISTS{ ?item wdt:P5816 wd:Q63065035. }
  VALUES ?instance_of
         {
           wd:Q34442      # Straße
           wd:Q79007      # Innerortstraße
           wd:Q21000333   # Einkaufsstraße 
           wd:Q174782     # Platz
           wd:Q537127     # Straßenbrücke
           wd:Q3397519    # Spannbetonbrücke 
           wd:Q1055465    # Balkenbrücke
           wd:Q57577442   # Feldweg
           wd:Q207934     # Allee
           wd:Q628179     # Weg
           wd:Q5004679    # Weg
           wd:Q221722     # Radweg
           wd:Q787113     # Promenade
           wd:Q1320830    # Ladenpassage
         }
  ?item wdt:P31 ?instance_of.
  OPTIONAL { ?item wdt:P2789 ?connect. }
  OPTIONAL { ?item wdt:P625 ?coord. }
  BIND( IF( BOUND(?connect) , "008800", "ff2d00") AS ?rgb).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de,en". }
}
GROUP BY ?item ?itemLabel ?coord ?rgb

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?anzahl") v3("?connect"):::projected v4("?coord"):::projected v2("?instance_of") v1("?item"):::projected v5("?rgb"):::projected c9(["bd:serviceParam"]):::iri c4(["wd:Q97612386"]):::iri c11(["#91;AUTO_LANGUAGE#93;,de,en"]):::literal c2(["wd:Q63065035"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P5816"--> e0c2 e0v1("?item"):::projected e0c2(["wd:Q63065035"]):::iri end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> c2 v1 --"wdt:P5816"--> c2 v1 --"wdt:P8138"--> c4 bind1[/VALUES ?instance_of/] bind1-->v2 bind10(["wd:Q34442"]) bind10 --> bind1 bind11(["wd:Q79007"]) bind11 --> bind1 bind12(["wd:Q21000333"]) bind12 --> bind1 bind13(["wd:Q174782"]) bind13 --> bind1 bind14(["wd:Q537127"]) bind14 --> bind1 bind15(["wd:Q3397519"]) bind15 --> bind1 bind16(["wd:Q1055465"]) bind16 --> bind1 bind17(["wd:Q57577442"]) bind17 --> bind1 bind18(["wd:Q207934"]) bind18 --> bind1 bind19(["wd:Q628179"]) bind19 --> bind1 bind110(["wd:Q5004679"]) bind110 --> bind1 bind111(["wd:Q221722"]) bind111 --> bind1 bind112(["wd:Q787113"]) bind112 --> bind1 bind113(["wd:Q1320830"]) bind113 --> bind1 v1 --"wdt:P31"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P2789".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P625".-> v4 end bind2[/"if(bound(?connect),'008800','ff2d00')"/] v3 --o bind2 bind2 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind4[/"count(?connect)"/] v3 --o bind4 bind4 --as--o v6