query-2087b942856119427a09697b632ad04e

rq turtle/ttl

Streets in Fremantle City of Fremantle and Town of East Fremantle Street Names Index

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?street ?streetLabel ?streetDescription
  ?osmRelation
  ( GROUP_CONCAT( DISTINCT ?namedAfterLabel; SEPARATOR='; ' ) AS ?namedAfter )
  ?image
  ( GROUP_CONCAT( DISTINCT ?coordinateLocation; SEPARATOR=' ' ) AS ?coordinateLocations )
  ( GROUP_CONCAT( DISTINCT ?locationLabel; SEPARATOR='; ' ) AS ?locations )
  ( GROUP_CONCAT( DISTINCT ?connectsWithLabel; SEPARATOR='; ' ) AS ?connectsWiths )
WHERE {
  # Is a street, road, or alley
  { ?street wdt:P31 wd:Q79007 } UNION { ?street wdt:P31 wd:Q34442 } UNION { ?street wdt:P31 wd:Q1251403 } .
  # In the City of Fremantle
  ?street wdt:P131 wd:Q1455046 .
  OPTIONAL { ?street wdt:P625 ?coordinateLocation }
  OPTIONAL { ?street wdt:P2789 ?connectsWith }
  OPTIONAL { ?street wdt:P402 ?osmRelation }
  OPTIONAL { ?street wdt:P138 ?namedAfter }
  OPTIONAL { ?street wdt:P18 ?image }
  OPTIONAL { ?street wdt:P276 ?location }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
    ?street rdfs:label ?streetLabel .
    ?street schema:description ?streetDescription .
    ?namedAfter rdfs:label ?namedAfterLabel .
    ?location rdfs:label ?locationLabel .
    ?connectsWith rdfs:label ?connectsWithLabel .
  }
}
GROUP BY ?street ?streetLabel ?streetDescription ?osmRelation ?image
ORDER BY ?streetLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?connectsWith") v12("?connectsWithLabel"):::projected v15("?connectsWiths") v3("?coordinateLocation"):::projected v13("?coordinateLocations") v7("?image"):::projected v8("?location") v11("?locationLabel"):::projected v14("?locations") v13("?namedAfter") v10("?namedAfterLabel"):::projected v5("?osmRelation"):::projected v2("?street"):::projected v9("?streetDescription"):::projected v1("?streetLabel"):::projected c6(["wd:Q1455046"]):::iri c2(["wd:Q79007"]):::iri c16(["en"]):::literal c3(["wd:Q34442"]):::iri c14(["bd:serviceParam"]):::iri c4(["wd:Q1251403"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c4 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c3 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c2 end union0r <== or ==> union0l end v2 --"wdt:P131"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P625".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P2789".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P402".-> v5 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P138".-> v13 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P18".-> v7 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P276".-> v8 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 v2 --"rdfs:label"--> v1 v2 --"schema:description"--> v9 v13 --"rdfs:label"--> v10 v8 --"rdfs:label"--> v11 v4 --"rdfs:label"--> v12 end bind4[/"?namedAfterLabel"/] v10 --o bind4 bind4 --as--o v13 bind5[/"?coordinateLocation"/] v3 --o bind5 bind5 --as--o v13 bind6[/"?locationLabel"/] v11 --o bind6 bind6 --as--o v14 bind7[/"?connectsWithLabel"/] v12 --o bind7 bind7 --as--o v15