query-8807c4fce79ba349ab302b18870e30dc

rq turtle/ttl

Verkehrsobjekte in Dresden ohne physische Verbindung zu zweiter Straße

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#>
PREFIX schema: <http://schema.org/>
#-------------------------------------------------------------------------------
# Verkehrsobjekte in Dresden ohne physische Verbindung zu zweiter Straße
#-------------------------------------------------------------------------------
#defaultView:Map
SELECT  distinct ?itemA ?itemALabel ?itemB  ?itemBLabel ?coordinate
WHERE {
    ?itemA wdt:P131 wd:Q1731.
    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  
    } 
    ?itemA wdt:P31 ?instance_of.                       # Straße A ist Verkehrsobjekt
    ?itemA wdt:P2789 ?itemB.                           # Straße A ist verbunden mit Straße B

    FILTER NOT EXISTS { ?itemB wdt:P2789 ?itemA }      # Straße B ist nicht verbunden mit Straße A 
    OPTIONAL{ ?itemB wdt:P2789 ?strassen. }            # Straße B hat Eigenschaft "physisch verbunden"
    FILTER(BOUND(?strassen))                           # Straße B hat Eigenschaft "physisch verbunden" ist nicht leer
    OPTIONAL { ?itemA wdt:P625 ?coordinate. }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en". }
}
order by ?itemALabel ?itemBLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?coordinate"):::projected v6("?instance_of") v5("?itemA"):::projected v1("?itemALabel"):::projected v4("?itemB"):::projected v2("?itemBLabel"):::projected v3("?strassen") c7(["bd:serviceParam"]):::iri c9(["de,en"]):::literal c3(["wd:Q1731"]):::iri f0[["bound(?strassen)"]] f0 --> v3 f1[["not "]] subgraph f1e0["Exists Clause"] e0v1 --"wdt:P2789"--> e0v2 e0v2("?itemA"):::projected e0v1("?itemB"):::projected end f1--EXISTS--> f1e0 f1 --> v4 f1 --> c1 f1 --> v5 v4 --"wdt:P2789"--> v5 v5 --"wdt:P131"--> c3 bind2[/VALUES ?instance_of/] bind2-->v6 bind20(["wd:Q34442"]) bind20 --> bind2 bind21(["wd:Q79007"]) bind21 --> bind2 bind22(["wd:Q21000333"]) bind22 --> bind2 bind23(["wd:Q174782"]) bind23 --> bind2 bind24(["wd:Q537127"]) bind24 --> bind2 bind25(["wd:Q3397519"]) bind25 --> bind2 bind26(["wd:Q1055465"]) bind26 --> bind2 v5 --"wdt:P31"--> v6 v5 --"wdt:P2789"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P2789".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P625".-> v7 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end