query-5242f6a9cb1aa4eaca0762dde0545e70

rq turtle/ttl

Map of accused witches in Scotland accused of shapeshifting. The results are displayed as a map with a colour coded layer for the what they were accused of shapeshifting into. (P4675)appears in the form of where there is a qualifier statement of (Q30172593)shapeshifting of (P1595)charge but combined with a (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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added 2023-06
#Accused witches in Scotland accused of shapeshifting
#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. (?Appears as ?layer)
SELECT DISTINCT ?item ?itemLabel ?accusedurl ?chargeLabel ?residenceLabel ?coords ?image (?Appears as ?layer) 
WHERE 
{
  ?item wdt:P31 wd:Q5.
  ?item wdt:P4478 ?accused .
  wd:P4478 wdt:P1630 ?formatterurl .
   BIND(IRI(REPLACE(?accused, '^(.+)$', ?formatterurl)) AS ?accusedurl).

  ?item wdt:P1595 wd:Q30172593   . 
  ?item wdt:P551 ?residence .
  ?residence wdt:P625 ?coords.
   {?item p:P1595 ?ChargeStatement . 
              ?ChargeStatement ps:P1595 ?charge ; 
                 pq:P4675 ?appears .
            OPTIONAL { ?appears wdt:P18 ?image }  #end time qualifier value .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".  
                          ?appears rdfs:label ?Appears .
                          ?charge rdfs:label ?chargeLabel .
                          ?residence rdfs:label ?residenceLabel .
                          ?item rdfs:label ?itemLabel .
                          ?accused rdfs:label ?accusedLabel .}
}
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v11("?Appears"):::projected v7("?ChargeStatement") v2("?accused") v15("?accusedLabel") v4("?accusedurl"):::projected v9("?appears") v8("?charge") v12("?chargeLabel"):::projected v6("?coords"):::projected v3("?formatterurl") v10("?image"):::projected v1("?item"):::projected v14("?itemLabel"):::projected v16("?layer") v5("?residence") v13("?residenceLabel"):::projected c7(["wd:Q30172593"]):::iri c4(["wd:P4478"]):::iri c15(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c17(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"p:direct/P31"--> c2 v1 --"p:direct/P4478"--> v2 c4 --"p:direct/P1630"--> v3 bind0[/"replace(?accused,'^(.+)$',?formatterurl)"/] v2 --o bind0 v3 --o bind0 bind0 --as--o v4 v1 --"p:direct/P1595"--> c7 v1 --"p:direct/P551"--> v5 v5 --"p:direct/P625"--> v6 v1 --"p:P1595"--> v7 v7 --"p:statement/P1595"--> v8 v7 --"p:qualifier/P4675"--> v9 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:direct/P18".-> v10 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c15 --"wikibase:language"--> c17 v9 --"rdfs:label"--> v11 v8 --"rdfs:label"--> v12 v5 --"rdfs:label"--> v13 v1 --"rdfs:label"--> v14 v2 --"rdfs:label"--> v15 end bind1[/"?Appears"/] v11 --o bind1 bind1 --as--o v16