query-159d5ea0e59065d10f123364e4abd9ee

rq turtle/ttl

Locations of hillforts that are in the Atlas

Use at

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#>
#defaultView:Map
SELECT ?label (SAMPLE(?coord) AS ?where) ?subj (?typeLabel AS ?layer) ?image (URI(CONCAT("https://hillforts.arch.ox.ac.uk/?query=Atlas_of_Hillforts_4166_0%2CMain_Atlas_Number%2C",?atlas)) AS ?atlaslink) WHERE
{  ?subj wdt:P31/wdt:P279? ?type ;
      wdt:P625 ?coord ;
      wdt:P31 ?type ;
      wdt:P4102  ?atlas ;
      rdfs:label ?label filter (lang(?label) = "en").
OPTIONAL{ ?subj wdt:P18 ?image } 
?type wdt:P279? wd:Q744099 ;
    rdfs:label ?typeLabel filter (lang(?typeLabel) = "en")
} GROUP BY ?label ?subj ?typeLabel ?image ?atlas

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?atlas"):::projected v10("?atlaslink") v5("?coord"):::projected v7("?image"):::projected v2("?label"):::projected v9("?layer") v3("?subj"):::projected v4("?type") v1("?typeLabel"):::projected v8("?where") a1((" ")) c8(["wd:Q744099"]):::iri f0[["?typeLabel = 'en'"]] f0 --> v1 f1[["?label = 'en'"]] f1 --> v2 v3 --"wdt:P31"--> a1 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; a1 --"wdt:P279"--> v4 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; end union0r <== or ==> union0l end v3 --"wdt:P625"--> v5 v3 --"wdt:P31"--> v4 v3 --"wdt:P4102"--> v6 v3 --"rdfs:label"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P18".-> v7 end subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P279"--> c8 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; end union1r <== or ==> union1l end v4 --"rdfs:label"--> v1 bind3[/"sample(?coord)"/] v5 --o bind3 bind3 --as--o v8 bind4[/"?typeLabel"/] v1 --o bind4 bind4 --as--o v9 bind5[/"concat('https://hillforts.arch.ox.ac.uk/?query=Atlas_of_Hillforts_4166_0%2CMain_Atlas_Number%2C',?atlas)"/] v6 --o bind5 bind5 --as--o v10