query-4ece174b71fbcc4064610c044b0b2516

rq turtle/ttl

Map of streets in the Netherlands that might be named after a painter). link to a map of already linked streets (also includes a Wikidata:WikiProject sum of all paintings/Dutch streets named after paintersSome time ago someone imported all Dutch streets. I wasn't really sure what to do with these. A lot of these streets are named after someone or some place. I figured it would be fun to connect streets named after painters to the relevant painters, see These kind of streets often are clustered so I figured I could get all the streets named after painters and return the nearby surrounding streets. I managed to produce a query for this, but it times out when I try to run it without the municipality.

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT ?streetwithout ?streetwithoutLabel ?withoutcoords (COUNT(?streetwithout) as ?count)  {
  ?street wdt:P138 ?painter .
  ?painter wdt:P106 wd:Q1028181 .
  ?street wdt:P31 wd:Q79007 .
  ?street wdt:P17 wd:Q55 .
  ?street wdt:P131 wd:Q36600 . # I want to remove this line to work on the Netherlands as a whole
  ?street wdt:P131 ?municipality .
  ?street p:P625 ?coords .
  ?coords psv:P625 ?coordinate_node .
  ?coordinate_node wikibase:geoLatitude ?lat .
  ?coordinate_node wikibase:geoLongitude ?lon .
  ?streetwithout wdt:P131 ?municipality .
  ?streetwithout wdt:P31 wd:Q79007 .
  ?streetwithout wdt:P17 wd:Q55 . 
  MINUS { ?streetwithout wdt:P138 [] }
  ?streetwithout p:P625 ?withoutcoordsstatement .
  ?withoutcoordsstatement ps:P625 ?withoutcoords . 
  ?withoutcoordsstatement psv:P625 ?withoutcoordinate_node .
  ?withoutcoordinate_node wikibase:geoLatitude ?withoutlat .
  ?withoutcoordinate_node wikibase:geoLongitude ?withoutlon .
  FILTER(?lat + 0.003>?withoutlat && ?withoutlat > ?lat - 0.003 && ?lon + 0.003>?withoutlon && ?withoutlon > ?lon - 0.003 ) .
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "nl" .
  }
} GROUP BY ?streetwithout ?streetwithoutLabel ?withoutcoords
LIMIT 500

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?coordinate_node") v8("?coords") v14("?count") v1("?lat") v3("?lon") v7("?municipality") v6("?painter") v5("?street") v10("?streetwithout"):::projected v13("?withoutcoordinate_node") v12("?withoutcoords"):::projected v11("?withoutcoordsstatement") v2("?withoutlat") v4("?withoutlon") a1((" ")) c6(["wd:Q79007"]):::iri c8(["wd:Q55"]):::iri c4(["wd:Q1028181"]):::iri c17(["bd:serviceParam"]):::iri c10(["wd:Q36600"]):::iri c19(["nl"]):::literal f0[["?lat + '0.003^^xsd:decimal' > ?withoutlat?withoutlat > ?lat - '0.003^^xsd:decimal'?lon + '0.003^^xsd:decimal' > ?withoutlon?withoutlon > ?lon - '0.003^^xsd:decimal'"]] f0 --> v1 f0 --> v2 f0 --> v3 f0 --> v4 v5 --"p:direct/P138"--> v6 v6 --"p:direct/P106"--> c4 v5 --"p:direct/P31"--> c6 v5 --"p:direct/P17"--> c8 v5 --"p:direct/P131"--> c10 v5 --"p:direct/P131"--> v7 v5 --"p:P625"--> v8 v8 --"p:statement/value/P625"--> v9 v9 --"wikibase:geoLatitude"--> v1 v9 --"wikibase:geoLongitude"--> v3 v10 --"p:direct/P131"--> v7 v10 --"p:direct/P31"--> c6 v10 --"p:direct/P17"--> c8 subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v10 --"p:direct/P138"--> a1 end v10 --"p:P625"--> v11 v11 --"p:statement/P625"--> v12 v11 --"p:statement/value/P625"--> v13 v13 --"wikibase:geoLatitude"--> v2 v13 --"wikibase:geoLongitude"--> v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c17 --"wikibase:language"--> c19 end bind3[/"count(?streetwithout)"/] v10 --o bind3 bind3 --as--o v14