query-6b95e739b6b8db7c0a1c2ef079827384

rq turtle/ttl

Hillforts in the British Isles that are not in the Atlas, and probably need merging

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
#defaultView:Map
SELECT ?label (SAMPLE(?coord) AS ?where) ?subj (?typeLabel AS ?layer) ?image WHERE
{ ?subj wdt:P31/wdt:P279? ?type ;
      wdt:P625 ?coord ;
      wdt:P31 ?type ;
      rdfs:label ?label filter (lang(?label) = "en").
MINUS { ?subj wdt:P4102 ?atlas }
OPTIONAL{ ?subj wdt:P18 ?image } 
?type wdt:P279? wd:Q744099 ;
    rdfs:label ?typeLabel filter (lang(?typeLabel) = "en").
?subj p:P625/psv:P625 ?loc. # coordinate-location statement
  ?loc wikibase:geoLatitude ?lat .
  ?loc wikibase:geoLongitude ?long .
   FILTER (?lat > 49) FILTER (?lat < 63)
   FILTER (?long > -10.5) FILTER (?long < 2.02) 
} GROUP BY ?label ?subj ?typeLabel ?image

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?atlas") v7("?coord"):::projected v9("?image"):::projected v4("?label"):::projected v2("?lat") v12("?layer") v10("?loc") v1("?long") v5("?subj"):::projected v6("?type") v3("?typeLabel"):::projected v11("?where") a1((" ")) a2((" ")) c12(["wd:Q744099"]):::iri f0[["?long < '2.02^^xsd:decimal'"]] f0 --> v1 f1[["?long > '-10.5^^xsd:decimal'"]] f1 --> v1 f2[["?lat < '63^^xsd:integer'"]] f2 --> v2 f3[["?lat > '49^^xsd:integer'"]] f3 --> v2 f4[["?typeLabel = 'en'"]] f4 --> v3 f5[["?label = 'en'"]] f5 --> v4 v5 --"p:direct/P31"--> a1 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; a1 --"p:direct/P279"--> v6 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; end union0r <== or ==> union0l end v5 --"p:direct/P625"--> v7 v5 --"p:direct/P31"--> v6 v5 --"rdfs:label"--> v4 subgraph minus6["MINUS"] style minus6 stroke-width:6px,fill:pink,stroke:red; v5 --"p:direct/P4102"--> v8 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P18".-> v9 end subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v6 --"p:direct/P279"--> c12 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; end union1r <== or ==> union1l end v6 --"rdfs:label"--> v3 v5 --"p:P625"--> a2 a2 --"p:statement/value/P625"--> v10 v10 --"wikibase:geoLatitude"--> v2 v10 --"wikibase:geoLongitude"--> v1 bind8[/"sample(?coord)"/] v7 --o bind8 bind8 --as--o v11 bind9[/"?typeLabel"/] v3 --o bind9 bind9 --as--o v12