query-f48a4084176afc516752ed988e420ba1

rq turtle/ttl

straten in HaarlemIk heb voor Haarlem links gemaakt gebaseerd op de naam. Zullen wel een paar foutjes inzitten, maar is denk ik goed om ergens uit te proberen. Deze query geeft de lijst van nog aan elkaar kan worden geplakt. Export naar TSV, regex er overheen met je favoriete editor en dan in QuickStatements om het toe te voegen. ]reply[08:16, 28 August 2019 (UTC)) talk (Denengelse: Pas op, onderstaande query geeft verkeerde matches als er in 1 gemeente meerdere straten met dezelfde naam voorkomen (dit komt vaak voor bij gemeenten die uit meerdere dorpen bestaan, ter illustratie heb ik de query aangepast naar woonplaats Doorn / gemeente Utrechtse Heuvelrug). Ik heb ?description aan de query toegevoegd, daar staat meestal iets als "straat in Doorn" in. Dan kan je daarop checken als je Quickstatements genereert. --Multichill@

Use at

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#>
SELECT ?item ?weg ?label ?description
WHERE {
   {
  SELECT DISTINCT ?item ?description (?wikilabel AS ?label) WHERE { 
    ?item rdfs:label ?wikilabel .
    ?item wdt:P131 wd:Q9920 .
    ?item wdt:P31/wdt:P279* wd:Q79007 .
    MINUS { ?item wdt:P5207 [] } . 
    ?item schema:description ?description.
    FILTER ( lang(?description) = "nl" ).
    FILTER ( lang(?wikilabel) = "nl" ).
  }
}
   {
  SELECT ?weg (?baglabel AS ?label) {
    SERVICE <http://lov.okfn.org/dataset/lov/sparql> {
      SERVICE <https://data.pdok.nl/sparql> {
        ?weg <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://bag.basisregistraties.overheid.nl/def/bag#OpenbareRuimte> .
        ?weg <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://bag.basisregistraties.overheid.nl/def/bag#Weg> .
        ?weg <http://bag.basisregistraties.overheid.nl/def/bag#status> <http://bag.basisregistraties.overheid.nl/id/begrip/NaamgevingUitgegeven> .
        MINUS { ?weg <http://bag.basisregistraties.overheid.nl/def/bag#status> <http://bag.basisregistraties.overheid.nl/id/begrip/NaamgevingIngetrokken> } .
        ?weg <http://www.w3.org/2000/01/rdf-schema#label> ?baglabel .
        ?weg <http://bag.basisregistraties.overheid.nl/def/bag#bijbehorendeWoonplaats> <http://bag.basisregistraties.overheid.nl/bag/id/woonplaats/2907>
      } 
    }
  }
}
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?baglabel") v2("?description"):::projected v3("?item"):::projected v7("?label"):::projected v5("?weg"):::projected v1("?wikilabel") a2((" ")) a1((" ")) c7(["wd:Q79007"]):::iri c17([http://bag.basisregistraties.overheid.nl/id/begrip/NaamgevingIngetrokken]):::iri c13([http://bag.basisregistraties.overheid.nl/def/bag#OpenbareRuimte]):::iri c19([http://bag.basisregistraties.overheid.nl/bag/id/woonplaats/2907]):::iri c16([http://bag.basisregistraties.overheid.nl/id/begrip/NaamgevingUitgegeven]):::iri c14([http://bag.basisregistraties.overheid.nl/def/bag#Weg]):::iri c4(["wd:Q9920"]):::iri f0[["?wikilabel = 'nl'"]] f0 --> v1 f1[["?description = 'nl'"]] f1 --> v2 v3 --"rdfs:label"--> v1 v3 --"wdt:P131"--> c4 v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c7 subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P5207"--> a2 end v3 --"schema:description"--> v2 bind3[/"?wikilabel"/] v1 --o bind3 bind3 --as--o v7 subgraph s1["http://lov.okfn.org/dataset/lov/sparql"] style s1 stroke-width:4px; subgraph s2["https://data.pdok.nl/sparql"] style s2 stroke-width:4px; v5 --"a"--> c13 v5 --"a"--> c14 v5 --http://bag.basisregistraties.overheid.nl/def/bag#status--> c16 subgraph minus4["MINUS"] style minus4 stroke-width:6px,fill:pink,stroke:red; v5 --http://bag.basisregistraties.overheid.nl/def/bag#status--> c17 end v5 --"rdfs:label"--> v6 v5 --http://bag.basisregistraties.overheid.nl/def/bag#bijbehorendeWoonplaats--> c19 end end bind5[/"?baglabel"/] v6 --o bind5 bind5 --as--o v7