query-218b4bd7dc414b89a50dc6f3d8929922

rq turtle/ttl

Map of accused witches in Scotland colour coded by gender. The results are displayed as a map with a colour coded layer for the gender split. (P625)coordinate location has a (P551)residence and a place of (P21)sex or gender and (P4478)Survey of Scottish Witchcraft - Accused witch ID The query displays all items with a

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#>
#added 2023-06
#Map of places of residence of accused witches.
#defaultView:Map
#You need to use the name ?layer as the variable you are colour coding by 
#It's much easier to change later if you do this in the SELECT area, using e.g. (?Gender as ?layer)
SELECT ?person ?personLabel ?accusedwitch ?precision ?coords ?Occupation ?Residence ?image (?Gender as ?layer) 
WHERE {
  ?person wdt:P4478 ?accusedwitch .
  ?person wdt:P31 wd:Q5.
  ?person wdt:P21 ?gender .
  ?person wdt:P551 ?residence .
  ?residence wdt:P625 ?coords.
  OPTIONAL { ?article schema:about ?person. }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en".
    ?person rdfs:label ?personLabel.
    ?residence rdfs:label ?Residence .
    ?occupation rdfs:label ?Occupation.
    ?gender rdfs:label ?Gender.
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v11("?Gender"):::projected v10("?Occupation"):::projected v8("?Residence"):::projected v2("?accusedwitch"):::projected v6("?article") v5("?coords"):::projected v3("?gender") v12("?layer") v9("?occupation") v1("?person"):::projected v7("?personLabel"):::projected v4("?residence") c9(["bd:serviceParam"]):::iri c3(["wd:Q5"]):::iri c11(["en"]):::literal v1 --"wdt:P4478"--> v2 v1 --"wdt:P31"--> c3 v1 --"wdt:P21"--> v3 v1 --"wdt:P551"--> v4 v4 --"wdt:P625"--> v5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -."schema:about".-> v1 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 v1 --"rdfs:label"--> v7 v4 --"rdfs:label"--> v8 v9 --"rdfs:label"--> v10 v3 --"rdfs:label"--> v11 end bind0[/"?Gender"/] v11 --o bind0 bind0 --as--o v12