query-39200f9bc6ad023622197850e86aa5a7
end time (P582), start time (P580), point in time (P585), head of state (P35), significant event (P793), country (P17), coordinate location (P625), historic county (P7959), residence (P551), place of death (P20), date of death (P570), cause of death (P509), Survey of Scottish Witchcraft - Accused witch ID (P4478): Properties shortcut linkA useful way to roll dates up, in lieu of a DECADE command: BIND( CONCAT(str(FLOOR(YEAR(?dateDied)/10)*10),"s") as ?dateDiedYr).FV map by settlement (secondary query to avoid timeout):
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT DISTINCT (?lBand AS ?layer) ?loc ?accper ?accperLabel ?dateDied ?placeDied ?causeDied ?locatorLabel ?accusedURI WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
{
SELECT DISTINCT ?accper ?accused ?loc ?dateDied ?locator ?locatorLabel ?coord ?dYr WHERE
{
VALUES ?place {wd:Q1009725 wd:Q1009891 wd:Q1010098 wd:Q1010266 wd:Q1010422 wd:Q1011221 wd:Q1011521 wd:Q1012069 wd:Q1012257 wd:Q1012333 wd:Q1016911 wd:Q1018540 wd:Q1235672 wd:Q1249896 wd:Q1625364 wd:Q1984807 wd:Q201149 wd:Q2014221 wd:Q211950 wd:Q2188248 wd:Q239193 wd:Q2424554 wd:Q3304653 wd:Q3307907 wd:Q3640797 wd:Q3752621 wd:Q3785636 wd:Q3995788 wd:Q4019090 wd:Q4251125 wd:Q5173194 wd:Q5211552 wd:Q59244052 wd:Q64735066 wd:Q64828012 wd:Q64934564 wd:Q64947484 wd:Q64947494 wd:Q64947496 wd:Q64947498 wd:Q64947526 wd:Q64947529 wd:Q64947545 wd:Q64947575 wd:Q64947581 wd:Q64947596 wd:Q65515723 wd:Q65561359 wd:Q691685 wd:Q758623 wd:Q758624 wd:Q781885 wd:Q896424 wd:Q23436}
?accper wdt:P4478 ?accused.
{?accper wdt:P551 ?place.} #UNION {?accper wdt:P20 ?place}.
OPTIONAL {?accper wdt:P570 ?dateDied.}.
OPTIONAL {?accper p:P793 / pq:P585 ?accdate. BIND (?accdate AS ?dateDied).}.
OPTIONAL {?accper p:P793 / pq:P580 ?accdate2. BIND (?accdate2 AS ?dateDied).}.
BIND(YEAR(?dateDied) AS ?dYr).
OPTIONAL {?accper wdt:P20 ?placeDiedQ. }
OPTIONAL {?accper wdt:P551 ?res}.
BIND(COALESCE(?res, ?placeDiedQ, wd:Q22) AS ?locator).
OPTIONAL {?locator wdt:P625 ?loc; p:P625/psv:P625 ?coord. }
} LIMIT 4500
}
BIND(URI (CONCAT ("https://witches.shca.ed.ac.uk/index.cfm?fuseaction=home.accusedrecord&accusedref=", ?accused, "&search_string=lastname") ) AS ?accusedURI).
BIND(IF (?dYr < 1600,"1 pre 1600",IF (?dYr < 1660,"2 1600-1660",IF (?dYr < 1700,"3 1660-1699",IF (?dYr < 1760,"4 1700 on","5 Unknown date")))) AS ?lBand).
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?accdate")
v6("?accdate2")
v2("?accper"):::projected
v3("?accused")
v13("?accusedURI"):::projected
v12("?coord")
v7("?dYr")
v7("?dateDied"):::projected
v14("?lBand"):::projected
v15("?layer")
v11("?loc"):::projected
v10("?locator")
v1("?place")
v8("?placeDiedQ")
v9("?res")
a1((" "))
a2((" "))
a3((" "))
c2(["bd:serviceParam"]):::iri
c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
bind0[/VALUES ?place/]
bind0-->v1
bind00(["wd:Q1009725"])
bind00 --> bind0
bind01(["wd:Q1009891"])
bind01 --> bind0
bind02(["wd:Q1010098"])
bind02 --> bind0
bind03(["wd:Q1010266"])
bind03 --> bind0
bind04(["wd:Q1010422"])
bind04 --> bind0
bind05(["wd:Q1011221"])
bind05 --> bind0
bind06(["wd:Q1011521"])
bind06 --> bind0
bind07(["wd:Q1012069"])
bind07 --> bind0
bind08(["wd:Q1012257"])
bind08 --> bind0
bind09(["wd:Q1012333"])
bind09 --> bind0
bind010(["wd:Q1016911"])
bind010 --> bind0
bind011(["wd:Q1018540"])
bind011 --> bind0
bind012(["wd:Q1235672"])
bind012 --> bind0
bind013(["wd:Q1249896"])
bind013 --> bind0
bind014(["wd:Q1625364"])
bind014 --> bind0
bind015(["wd:Q1984807"])
bind015 --> bind0
bind016(["wd:Q201149"])
bind016 --> bind0
bind017(["wd:Q2014221"])
bind017 --> bind0
bind018(["wd:Q211950"])
bind018 --> bind0
bind019(["wd:Q2188248"])
bind019 --> bind0
bind020(["wd:Q239193"])
bind020 --> bind0
bind021(["wd:Q2424554"])
bind021 --> bind0
bind022(["wd:Q3304653"])
bind022 --> bind0
bind023(["wd:Q3307907"])
bind023 --> bind0
bind024(["wd:Q3640797"])
bind024 --> bind0
bind025(["wd:Q3752621"])
bind025 --> bind0
bind026(["wd:Q3785636"])
bind026 --> bind0
bind027(["wd:Q3995788"])
bind027 --> bind0
bind028(["wd:Q4019090"])
bind028 --> bind0
bind029(["wd:Q4251125"])
bind029 --> bind0
bind030(["wd:Q5173194"])
bind030 --> bind0
bind031(["wd:Q5211552"])
bind031 --> bind0
bind032(["wd:Q59244052"])
bind032 --> bind0
bind033(["wd:Q64735066"])
bind033 --> bind0
bind034(["wd:Q64828012"])
bind034 --> bind0
bind035(["wd:Q64934564"])
bind035 --> bind0
bind036(["wd:Q64947484"])
bind036 --> bind0
bind037(["wd:Q64947494"])
bind037 --> bind0
bind038(["wd:Q64947496"])
bind038 --> bind0
bind039(["wd:Q64947498"])
bind039 --> bind0
bind040(["wd:Q64947526"])
bind040 --> bind0
bind041(["wd:Q64947529"])
bind041 --> bind0
bind042(["wd:Q64947545"])
bind042 --> bind0
bind043(["wd:Q64947575"])
bind043 --> bind0
bind044(["wd:Q64947581"])
bind044 --> bind0
bind045(["wd:Q64947596"])
bind045 --> bind0
bind046(["wd:Q65515723"])
bind046 --> bind0
bind047(["wd:Q65561359"])
bind047 --> bind0
bind048(["wd:Q691685"])
bind048 --> bind0
bind049(["wd:Q758623"])
bind049 --> bind0
bind050(["wd:Q758624"])
bind050 --> bind0
bind051(["wd:Q781885"])
bind051 --> bind0
bind052(["wd:Q896424"])
bind052 --> bind0
bind053(["wd:Q23436"])
bind053 --> bind0
v2 --"p:direct/P4478"--> v3
v2 --"p:direct/P551"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P570".-> v7
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:P793".-> a1
a1 --"p:qualifier/P585"--> v5
bind1[/"?accdate"/]
v5 --o bind1
bind1 --as--o v7
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:P793".-> a2
a2 --"p:qualifier/P580"--> v6
bind2[/"?accdate2"/]
v6 --o bind2
bind2 --as--o v7
end
bind3[/"year-from-dateTime(?dateDied)"/]
v7 --o bind3
bind3 --as--o v7
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P20".-> v8
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P551".-> v9
end
bind4[/"?res?placeDiedQ'wd:Q22'"/]
v9 --o bind4
v8 --o bind4
bind4 --as--o v10
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v10 -."p:direct/P625".-> v11
v10 --"p:P625"--> a3
a3 --"p:statement/value/P625"--> v12
end
bind5[/"concat('https://witches.shca.ed.ac.uk/index.cfm?fuseaction=home.accusedrecord&accusedref=',?accused,'&search_string=lastname')"/]
v3 --o bind5
bind5 --as--o v13
bind6[/"if(?dYr < '1600^^xsd:integer','1 pre 1600',if(?dYr < '1660^^xsd:integer','2 1600-1660',if(?dYr < '1700^^xsd:integer','3 1660-1699',if(?dYr < '1760^^xsd:integer','4 1700 on','5 Unknown date'))))"/]
v7 --o bind6
bind6 --as--o v14
bind7[/"?lBand"/]
v14 --o bind7
bind7 --as--o v15