3,427
edits
(35 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Project:SPARQL/admin | Admin/batch tools queries]] | |||
==SAL and RAI== | ==SAL and RAI== | ||
Line 168: | Line 170: | ||
</sparql> | </sparql> | ||
=== Women's interactions with SAL (Q1 and Q8)=== | === Women's interactions with SAL (Q1 and Q8)=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:Women's interactions with SAL (Q1 and Q8) | |||
# CAVEAT: this query may overlook a significant number of interactions and should probably not be reference/archived in its current state | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 213: | Line 184: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT distinct ?person ?personLabel | SELECT distinct ?person ?personLabel ?propLabel ?qual_value ?qual_propLabel ?bnwdLabel # ?s ?prop ?qual_prop ?bnwd | ||
WHERE { | WHERE { | ||
Line 223: | Line 192: | ||
?prop wikibase:claim ?p; | ?prop wikibase:claim ?p; | ||
wikibase:statementProperty ?ps | wikibase:statementProperty ?ps. | ||
# union query to get both q8 and q1 | # union query to get both q8 and q1 | ||
{ ?s ?ps bnwd:Q8 . } union { ?s ?ps bnwd:Q1 . } | { ?s ?ps bnwd:Q8 . } union { ?s ?ps bnwd:Q1 . } | ||
?s ?ps ? | ?s ?ps ?bnwd. #which type | ||
optional { | |||
?s ?pq ? | ?s ?pq ?qual_value . | ||
?qual_prop wikibase:qualifier ?pq . | ?qual_prop wikibase:qualifier ?pq . | ||
} # /qualifiers | } # /qualifiers | ||
Line 248: | Line 213: | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:Women's interactions with RAI (Q35 and Q29) | |||
# CAVEAT: this query may overlook a significant number of interactions and should probably not be reference/archived in its current state | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 255: | Line 222: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT distinct ?person ?personLabel | SELECT distinct ?person ?personLabel ?propLabel ?qual_value ?qual_propLabel ?bnwdLabel # ?s ?prop ?qual_prop | ||
WHERE { | WHERE { | ||
Line 265: | Line 230: | ||
?prop wikibase:claim ?p; | ?prop wikibase:claim ?p; | ||
wikibase:statementProperty ?ps | wikibase:statementProperty ?ps. | ||
# to get both q35 and q29 | # to get both q35 and q29 | ||
{ ?s ?ps bnwd:Q35 . } union { ?s ?ps bnwd:Q29 . } | { ?s ?ps bnwd:Q35 . } union { ?s ?ps bnwd:Q29 . } | ||
?s ?ps ? | ?s ?ps ?bnwd. | ||
# qualifiers. | # qualifiers. | ||
optional { | optional { | ||
?s ?pq ? | ?s ?pq ?qual_value . | ||
?qual_prop wikibase:qualifier ?pq . | ?qual_prop wikibase:qualifier ?pq . | ||
} # /qualifiers | } # /qualifiers | ||
Line 294: | Line 255: | ||
#title: FSAs with no record of interacting with SAL in Q1 / Q8 | #title: FSAs with no record of interacting with SAL in Q1 / Q8 | ||
# only active engagements like spoke at, corresponded with, etc, and excluding P75 "was fellow of" and P5 "archives at". | # only active engagements like spoke at, corresponded with, etc, and excluding P75 "was fellow of" and P5 "archives at". | ||
# | # CAVEATS: I think this is not working as intended and it shouldn't be referenced or archived | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 342: | Line 303: | ||
#title: RAIs with no record of interacting with RAI in Q29/Q35 | #title: RAIs with no record of interacting with RAI in Q29/Q35 | ||
# only active engagements like spoke at, corresponded with, etc, and excluding P67 "was member of" | # only active engagements like spoke at, corresponded with, etc, and excluding P67 "was member of" | ||
# | # CAVEATS: I think this may not be working as intended and it shouldn't be referenced or archived in its current state | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 552: | Line 513: | ||
</sparql> | </sparql> | ||
=== Lecturers === | |||
= | <sparql tryit="1"> | ||
#title:lecturers | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | |||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | |||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | |||
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | |||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | |||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | |||
PREFIX bnpsv: <https://beyond-notability.wikibase.cloud/prop/statement/value/> | |||
PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | |||
SELECT distinct ?person ?personLabel ?positionLabel | |||
?organisedLabel ?ofLabel | |||
?qual_propLabel ?qualLabel | |||
#?position ?of ?work ?organised ?date_precision ?qual_prop ?date ?qual ?workLabel | |||
?s | |||
WHERE { | |||
?person bnwdt:P3 bnwd:Q3 . # women | |||
# work activities: held position / held position (free text) / employed as | |||
#?person ( bnp:P17|bnp:P48|bnp:P105 ) ?s . | |||
?person ?work_p ?s . # for activity type label | |||
?work wikibase:claim ?work_p . | |||
?s ?bnps ?position . | |||
# freelance and extension lecturing (q701 and q3021) | |||
{ ?s ?bnps bnwd:Q701 . } union { ?s ?bnps bnwd:Q3021 . } | |||
# employer / organised by / of (incl free text). | |||
OPTIONAL { ?s bnpq:P109 ?organised .} | |||
OPTIONAL { ?s ( bnpq:P78 | bnpq:P66 ) ?of .} | |||
# optional { ?s bnpq:P2 ?location . } # do locations separately. | |||
# dates with precision | |||
# optional { | |||
# ?s (bnpqv:P1 | bnpqv:P27 | bnpqv:P28 ) ?pqv. | |||
# ?s ?pqq ?pqv . # just gets the uri but doesnt seem to cause dups | |||
# ?pqv wikibase:timeValue ?date . | |||
# ?pqv wikibase:timePrecision ?date_precision . | |||
# } | |||
# qualifiers | |||
optional { | |||
?s ?pq ?qual . | |||
?qual_prop wikibase:qualifier ?pq . | |||
} # /dates | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} # /where | |||
=== | ORDER BY ?person ?s | ||
</sparql> | |||
=== Excavations === | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:BN excavations | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 567: | Line 587: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ?excavationLabel ?excavation ?locationLabel ?start ?end ?pit | |||
?partLabel ?funderLabel ?organisedLabel ?facilitatedLabel ?directorLabel ?memberLabel | |||
# ?member ?director ?location ?part ?funder ?facilitated ?organised | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | # instance of excavation 128 | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ?excavation bnwdt:P12 bnwd:Q38 . | ||
optional { ?excavation bnwdt:P2 ?location .} | |||
optional { ?excavation bnwdt:P27 ?start . } | |||
optional { ?excavation bnwdt:P28 ?end . } | |||
optional { ?excavation bnwdt:P1 ?pit. } | |||
optional { ?excavation bnwdt:P4 ?part . } | |||
optional { ?excavation bnwdt:P36 ?director . } | |||
optional { ?excavation bnwdt:P37 ?member . } | |||
optional { ?excavation bnwdt:P109 ?organised .} | |||
optional { ?excavation bnwdt:P121 ?facilitated . } | |||
optional { ?excavation bnwdt:P145 ?funder . } | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} | |||
ORDER BY ?excavationLabel | |||
</sparql> | |||
== Professional Activities and Organisations == | |||
=== Women's service on committees etc (P102) === | |||
<sparql tryit="1"> | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | |||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | |||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | |||
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | |||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | |||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | |||
SELECT distinct ?personLabel ?serviceLabel ?qual_propLabel ?qualLabel ?qual ?person ?s # ?service | |||
WHERE { | |||
?person bnwdt:P3 bnwd:Q3 . # select women | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | |||
?person bnp:P102 ?s . # served on P102 | ?person bnp:P102 ?s . # served on P102 | ||
Line 782: | Line 850: | ||
?s ?ps ?ppa_value. | ?s ?ps ?ppa_value. | ||
# note: it would be possible to write this to use ppa rather than ppa_label | # note: it would be possible to write this to use ppa rather than ppa_label. there's a slight risk that property names might change. | ||
# BUT then it would be much more opaque and difficult to edit if (when!) we make any changes to the buckets. | # BUT then it would be much more opaque and difficult to edit if (when!) we make any changes to the buckets. | ||
bind( | bind( | ||
Line 805: | Line 873: | ||
</sparql> | </sparql> | ||
== | === Suffrage-related activities === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | #title:initial query for suffrage activities | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 820: | Line 886: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
# | SELECT distinct ?person ?personLabel ?mainLabel ?sub_Label ?qualLabel ?locationLabel ?date | ||
# ?pq ?sub_ ?qual ?main | |||
?s | |||
WHERE { | WHERE { | ||
FILTER NOT EXISTS {? | ?person bnwdt:P3 bnwd:Q3 . #select women | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | |||
?person ?p ?s . | |||
?s ?sub ?sub_ . | |||
?main wikibase:claim ?p. | |||
?main wikibase:statementProperty ?sub. | |||
# sub_ i/o - some do have suffrage activity | |||
? | # optional { ?sub_ bnwdt:P12 ?sub_io . ?sub_ bnwdt:P12 bnwd:Q1166 . } | ||
? | |||
# union | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | { | ||
# a qualifier (anywhere) has i/o suffrage activity | |||
?s bnpq:P12 bnwd:Q1166. | |||
} | |||
# what about a main rather than qualifier having i/o suffrage activity? i don't think there are any atm but could be. | |||
# union | |||
# { # this might find extra linked i/o suffrage but i'm not sure it works. | |||
# ?sub_ bnwdt:P12 bnwd:Q1166 . | |||
# } | |||
union | |||
{ | |||
# does *not* have i/o suffrage activity in any qualifiers ... slows things right down and doesn't seem to make any difference to results? | |||
#filter not exists { ?s bnpq:P12 bnwd:Q1166. } | |||
# ... but a qualifier *does* have i/o suffrage activity. i think! | |||
?s ?pq ?qual . | |||
?qual bnwdt:P12 bnwd:Q1166 . | |||
} # /union | |||
optional { | |||
# date qualifiers. [assumes no edtf in quals. ] all seem to be p.i.t. | |||
?s ?dpq ?date . | |||
?qual_date wikibase:qualifier ?dpq . | |||
?qual_date wikibase:propertyType wikibase:Time. | |||
} | |||
optional { ?s bnpq:P78 ?of. } # outside the union seems much speedier | |||
optional { ?s bnpq:P2 ?location . } | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} | } | ||
order by ?personLabel ?mainLabel | |||
</sparql> | </sparql> | ||
=== | ==Place== | ||
=== All the things in BN that can be mapped === | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:map of BN locations using wikidata P625 | |||
#defaultView:Map | |||
#this will take a little while to run... | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 852: | Line 960: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ? | SELECT distinct ?locationLabel ?location ?wikidata ?wd_geo | ||
WHERE { | WHERE { | ||
? | |||
?location bnwdt:P117 ?ws . # wikidata id | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?ws))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?wikidata wdt:P625 ?wd_geo . # does the wikidata page have geocoords? | |||
} # /wikidata service | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} | } | ||
ORDER BY ? | ORDER BY ?wikidata ?locationLabel | ||
</sparql> | </sparql> | ||
===People | ===People not in London linked as a graph by a NUTS region or country (excluding England) at which they were once resident in the UK=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# People | # People not in London linked as a graph by a NUTS region or country (excluding England) at which they were once resident in the UK | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 879: | Line 989: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ?resident ?residentLabel ? | #defaultView:Graph | ||
SELECT ?resident ?residentLabel ?region ?regionLabel | |||
WHERE { | WHERE { | ||
?resident bnwdt:P29 ?residence . | ?resident bnwdt:P29 ?residence . | ||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2035 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2036 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2037 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2038 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2039 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2040 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2041 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2042 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q39.} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2534.} | |||
?residence bnwdt:P33 ?district . | ?residence bnwdt:P33 ?district . | ||
?district bnwdt:P33 ?county . | ?district bnwdt:P33 ?county . | ||
?county bnwdt:P33 ?region . | ?county bnwdt:P33 ?region . | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
</sparql> | </sparql> | ||
===People | ===People whose residence was at one time in the east or south east of England, excluding London=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 906: | Line 1,021: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ?resident ?residentLabel ? | SELECT ?resident ?residentLabel ?residenceLabel ?districtLabel ?countyLabel ?regionLabel | ||
WHERE { | WHERE { | ||
?resident bnwdt:P29 ?residence . | ?resident bnwdt:P29 ?residence . | ||
?residence bnwdt:P33 ?district . | ?residence bnwdt:P33 ?district . | ||
?district bnwdt:P33 ?county . | ?district bnwdt:P33 ?county . | ||
?county bnwdt:P33 ?region . | ?county bnwdt:P33 ?region . | ||
{?county bnwdt:P33 bnwd:Q67 .} | |||
UNION | |||
{?county bnwdt:P33 bnwd:Q85 .} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
ORDER BY ?regionLabel ?countyLabel ?districtLabel ? | ORDER BY ?regionLabel ?countyLabel ?districtLabel ?residenceLabel | ||
</sparql> | </sparql> | ||
===People | ===People whose residence was at one time in North East England or Yorkshire and the Humber=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# People whose residence was at one time in North East England or Yorkshire and the Humber | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 938: | Line 1,048: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ? | SELECT ?resident ?residentLabel ?residenceLabel ?districtLabel ?countyLabel ?regionLabel | ||
WHERE { | |||
?resident bnwdt:P29 ?residence . | |||
?residence bnwdt:P33 ?district . | |||
?district bnwdt:P33 ?county . | |||
SERVICE wikibase:label { | ?county bnwdt:P33 ?region . | ||
{?county bnwdt:P33 bnwd:Q72 .} | |||
UNION | |||
{?county bnwdt:P33 bnwd:Q200 .} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | |||
} | |||
ORDER BY ?regionLabel ?countyLabel ?districtLabel ?residenceLabel | |||
</sparql> | </sparql> | ||
=== | ===People not in London with the district, county, and region at which they were once resident (in the UK) listed=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | # People not in London with the district, county, and region at which they were once resident (in the UK) listed | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 963: | Line 1,075: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ? | SELECT ?resident ?residentLabel ?district ?districtLabel ?county ?countyLabel ?region ?regionLabel | ||
WHERE { | WHERE { | ||
? | ?resident bnwdt:P29 ?residence . | ||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2035 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2036 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2037 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2038 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2039 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2040 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2041 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2042 .} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q39.} | |||
FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2534.} | |||
?residence bnwdt:P33 ?district . | |||
?district bnwdt:P33 ?county . | |||
?county bnwdt:P33 ?region . | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
ORDER BY ?regionLabel ?countyLabel ?districtLabel ?residentLabel | |||
</sparql> | </sparql> | ||
=== | ===People sorted by the number of places they lived, including the number of cites/towns/villages they lived in=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 987: | Line 1,107: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ? | SELECT ?person ?personLabel (count(?resided) as ?residence_count) (count(distinct ?resided) as ?residence_distinct) WHERE { | ||
WHERE { | ?person bnwdt:P3 bnwd:Q3 ; | ||
wikibase:statements ?statements . | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person | ?person bnp:P29/bnps:P29 ?resided. | ||
SERVICE wikibase:label { | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". | ||
} | } | ||
} group by ?person ?personLabel ?statements order by desc(?residence_count) | |||
# Credit to @Tagishsimon for helping me figure out the counting logic here | |||
</sparql> | </sparql> | ||
=== | ===Places at which women resided, sorted by how many residences all women had at a given village/town/city/London area=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | # Places at which women resided, sorted by how many residences all women had at a given village/town/city/London area | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 1,012: | Line 1,132: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ? | SELECT ?residence ?residenceLabel (count(?residence) as ?residence_count) #count number of places at which women lived | ||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt:P29 ?residence . # select residences | ?person bnwdt:P29 ?residence . # select residences | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
GROUP BY ? | GROUP BY ?residence ?residenceLabel | ||
ORDER BY DESC(? | ORDER BY DESC(?residence_count) | ||
</sparql> | </sparql> | ||
=== | ===Districts in which women resided, sorted by how many residences all women had in that district (or equivalent sub-level for non-UK residences)=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | # Districts in which women resided, sorted by how many residences all women had in that district (or equivalent sub-level for non-UK residences) | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 1,038: | Line 1,156: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ? | SELECT ?district ?districtLabel (count(?district) as ?district_count) #count number of districts in which women lived | ||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt:P29 ?residence . # select residences | ?person bnwdt:P29 ?residence . # select residences | ||
?residence bnwdt:P33 ?district . #select districts | ?residence bnwdt:P33 ?district . #select districts | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
GROUP BY ? | GROUP BY ?district ?districtLabel | ||
ORDER BY DESC(? | ORDER BY DESC(?district_count) | ||
</sparql> | </sparql> | ||
===Counties in which women resided, sorted by how many residences all women had in that county=== | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# Counties | # Counties in which women resided, sorted by how many residences all women had in that county | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 1,068: | Line 1,184: | ||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt:P29 ?residence . # select residences | ?person bnwdt:P29 ?residence . # select residences | ||
Line 1,079: | Line 1,194: | ||
</sparql> | </sparql> | ||
====Counties of residence for women | ====Counties of residence for women recorded in CAS Indexes of Archaeological Papers, sorted by how many residences all women had in that county==== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# Counties of residence for women | # Counties of residence for women recorded in CAS Indexes of Archaeological Papers, sorted by how many residences all women had in that county | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 1,095: | Line 1,210: | ||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
?person bnwdt: | ?person bnwdt:P76 bnwd:Q419 . #select women recorded in CAS Indexes of Archaeological Papers | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt:P29 ?residence . # select residences | ?person bnwdt:P29 ?residence . # select residences | ||
Line 1,106: | Line 1,221: | ||
</sparql> | </sparql> | ||
====Counties of residence for women | ====Counties of residence for women nominated as FSAs, sorted by how many residences all women had in that county==== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# Counties of residence for women | # Counties of residence for women nominated as FSAs, sorted by how many residences all women had in that county | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 1,122: | Line 1,237: | ||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
?person bnwdt: | ?person bnwdt:P16 ?signatory . #select women who were nominated for election to FSA | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt:P29 ?residence . # select residences | ?person bnwdt:P29 ?residence . # select residences | ||
Line 1,133: | Line 1,248: | ||
</sparql> | </sparql> | ||
====Counties of residence for women | ====Counties of residence for women nominated to RAI, sorted by how many residences all women had in that county==== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# Counties of residence for women | # Counties of residence for women nominated to RAI, sorted by how many residences all women had in that county | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 1,149: | Line 1,264: | ||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
?person bnwdt: | ?person bnwdt:P7 ?signatory . #select women who were nominated for election to RAI | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt:P29 ?residence . # select residences | ?person bnwdt:P29 ?residence . # select residences | ||
Line 1,160: | Line 1,275: | ||
</sparql> | </sparql> | ||
====Counties of residence for women | ====Counties of residence for women who spoke at RAI meetings, sorted by how many residences all women had in that county==== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# Counties of residence for women who spoke at RAI meetings, sorted by how many residences all women had in that county | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 1,172: | Line 1,288: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ?county ?countyLabel (count(?county) as ?county_count) #count number of counties in which women lived | |||
SELECT | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
?person bnwdt: | ?person bnwdt:P23 bnwd:Q29 . #select women who spoke at RAI Meeting | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt:P29 ?residence . # select residences | ?person bnwdt:P29 ?residence . # select residences | ||
?residence bnwdt:P33 ?district . #select districts | ?residence bnwdt:P33 ?district . #select districts | ||
?district bnwdt:P33 ?county . #select counties | ?district bnwdt:P33 ?county . #select counties | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
GROUP BY ?county ?countyLabel | |||
ORDER BY DESC(?county_count) | |||
</sparql> | </sparql> | ||
====Counties of residence for women | ====Counties of residence for women who exhibited at RAI meetings, sorted by how many residences all women had in that county==== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# Counties of residence for women who exhibited at RAI meetings, sorted by how many residences all women had in that county | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 1,218: | Line 1,315: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ?county ?countyLabel (count(?county) as ?county_count) #count number of counties in which women lived | |||
SELECT | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
?person bnwdt: | ?person bnwdt:P13 bnwd:Q29 . #select women who exhibited at RAI Meeting | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt:P29 ?residence . # select residences | ?person bnwdt:P29 ?residence . # select residences | ||
?residence bnwdt:P33 ?district . #select districts | ?residence bnwdt:P33 ?district . #select districts | ||
?district bnwdt:P33 ?county . #select counties | ?district bnwdt:P33 ?county . #select counties | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
GROUP BY ?county ?countyLabel | |||
ORDER BY DESC(?county_count) | |||
</sparql> | </sparql> | ||
====Counties of residence for women recorded in CAS Indexes of Archaeological Papers, on a map==== | |||
= | <sparql tryit="1"> | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,262: | Line 1,342: | ||
#defaultView:Map{"hide":["?geo", "?wikidata"]} | #defaultView:Map{"hide":["?geo", "?wikidata"]} | ||
#title:Counties of residence for women | #title:Counties of residence for women recorded in CAS Indexes of Archaeological Papers | ||
SELECT distinct ?person ?personLabel ?county ?countyLabel ?wikidata ?geo | SELECT distinct ?person ?personLabel ?residence ?residenceLabel ?county ?countyLabel ?wikidata ?geo | ||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
?person bnwdt:P76 bnwd:Q419 . #select women recorded in CAS Indexes of Archaeological Papers | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt: | ?person bnwdt:P29 ?residence . # select residences | ||
?residence bnwdt:P33 ?district . #select p33 of residence | |||
?residence bnwdt:P33 ?district . #select | ?district bnwdt:P33 ?next . #select p33 of district, mostly counties but a few region/outside uk | ||
?district bnwdt:P33 ? | |||
optional { | optional { | ||
# is ?next a uk region? | |||
?next bnwdt:P12 bnwd:Q4207 . | |||
BIND(BOUND(?next) AS ?region). | |||
} | |||
optional { | |||
# is ?next in the UK? | |||
?next bnwdt:P33* bnwd:Q1741 . | |||
BIND(BOUND(?next) AS ?uk). | |||
} | |||
# if next=q4207 uk region, then use ?district for county, ifelse in uk use ?next, else not in uk use ?district. | |||
bind( | |||
if( bound(?region), ?district, # region first (because also uk) | |||
if( bound(?uk), ?next, # then rest of uk | |||
?district)) # then anything not in uk. | |||
as ?county). | |||
optional { ?county bnwdt:P153 ?geo2 . } # for geocoords added to BN | |||
optional { | |||
?county bnp:P117 ?ws . # wikidata id P117 | ?county bnp:P117 ?ws . # wikidata id P117 | ||
?ws bnpq:P14 ?wikidata_url . | ?ws bnpq:P14 ?wikidata_url . | ||
Line 1,282: | Line 1,381: | ||
SERVICE <https://query.wikidata.org/sparql> { | SERVICE <https://query.wikidata.org/sparql> { | ||
optional { ?wikidata wdt:P625 ?geo1 . } # geocoords if available | optional { | ||
?wikidata wdt:P625 ?geo1 . | |||
BIND(geof:longitude(?geo1) AS ?long) | |||
BIND(geof:latitude(?geo1) AS ?lat) | |||
} # geocoords if available | |||
} # /wikidata service | } # /wikidata service | ||
} #/wikidata optional | } #/wikidata optional | ||
Line 1,292: | Line 1,395: | ||
</sparql> | </sparql> | ||
==== Counties of residence for women | ====Counties of residence for women nominated as FSAs, on a map==== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,304: | Line 1,408: | ||
#defaultView:Map{"hide":["?geo", "?wikidata"]} | #defaultView:Map{"hide":["?geo", "?wikidata"]} | ||
#title:Counties of residence for women | #title:Counties of residence for women nominated as FSAs | ||
SELECT distinct ?person ?personLabel ?county ?countyLabel ?wikidata ?geo | SELECT distinct ?person ?personLabel ?county ?countyLabel ?wikidata ?geo | ||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
?person bnwdt:P16 ?signatory . #select women who were nominated for election to FSA | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt:P29 ?residence . # select residences | ?person bnwdt:P29 ?residence . # select residences | ||
Line 1,332: | Line 1,436: | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
</sparql> | |||
==== Counties of residence for women | ==== Counties of residence for women nominated to RAI, on a map ==== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,349: | Line 1,451: | ||
#defaultView:Map{"hide":["?geo", "?wikidata"]} | #defaultView:Map{"hide":["?geo", "?wikidata"]} | ||
#title:Counties of residence for women nominated to RAI | |||
SELECT distinct ?person ?personLabel ?county ?countyLabel ?wikidata ?geo | SELECT distinct ?person ?personLabel ?county ?countyLabel ?wikidata ?geo | ||
Line 1,354: | Line 1,457: | ||
?person bnwdt:P3 bnwd:Q3 . # select women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt: | ?person bnwdt:P7 ?signatory . #select women who were nominated for election to RAI | ||
?person bnwdt:P29 ?residence . # select residences | ?person bnwdt:P29 ?residence . # select residences | ||
Line 1,378: | Line 1,481: | ||
</sparql> | </sparql> | ||
==== Counties of residence for women | ==== Counties of residence for women who spoke at RAI meetings, on a map==== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,395: | Line 1,492: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
#defaultView:Map{"hide":["?geo", "?wikidata"]} | #defaultView:Map{"hide":["?geo", "?wikidata"]} | ||
#title:Counties of residence for women who spoke at RAI meetings | |||
SELECT distinct | SELECT distinct ?person ?personLabel ?county ?countyLabel ?wikidata ?geo | ||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt:P23 bnwd:Q29 . #select women who spoke at RAI Meeting | |||
?person bnwdt:P29 ?residence . # select residences | ?person bnwdt:P29 ?residence . # select residences | ||
?residence bnwdt:P33 ?district . #select districts | ?residence bnwdt:P33 ?district . #select districts | ||
Line 1,437: | Line 1,512: | ||
SERVICE <https://query.wikidata.org/sparql> { | SERVICE <https://query.wikidata.org/sparql> { | ||
optional { ?wikidata wdt:P625 ?geo1 . } # geocoords if available | optional { ?wikidata wdt:P625 ?geo1 . } # geocoords if available | ||
} # /wikidata service | } # /wikidata service | ||
} #/wikidata optional | } #/wikidata optional | ||
BIND(COALESCE(?geo1, ?geo2) AS ?geo). # if geo1 available use | BIND(COALESCE(?geo1, ?geo2) AS ?geo). # if geo1 available use that, then try geo2 | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
</sparql> | </sparql> | ||
=== | ==== Counties of residence for women who exhibited at RAI meetings, on a map ==== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | #title:Counties of residence for women who exhibited at RAI meetings | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 1,460: | Line 1,537: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ? | #defaultView:Map{"hide":["?geo", "?wikidata"]} | ||
SELECT distinct ?person ?personLabel ?county ?countyLabel ?wikidata ?geo | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt:P13 bnwd:Q29 . #select women who exhibited at RAI Meeting | |||
?person bnwdt:P29 ?residence . # select residences | ?person bnwdt:P29 ?residence . # select residences | ||
?residence bnwdt:P33 ?district . #select districts | ?residence bnwdt:P33 ?district . #select districts | ||
?district bnwdt:P33 ?county . #select counties | ?district bnwdt:P33 ?county . #select counties | ||
optional { ?county bnwdt:P153 ?geo2 . } # for geocoords added to BN | |||
optional { | |||
?county bnp:P117 ?ws . # wikidata id P117 | |||
?ws bnpq:P14 ?wikidata_url . | |||
BIND(IRI(REPLACE(?wikidata_url, "https://www.wikidata.org/wiki/", "http://www.wikidata.org/entity/")) as ?wikidata ) | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
optional { ?wikidata wdt:P625 ?geo1 . } # geocoords if available | |||
} # /wikidata service | |||
} #/wikidata optional | |||
BIND(COALESCE(?geo1, ?geo2) AS ?geo). # if geo1 available use that, then try geo2 | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
</sparql> | </sparql> | ||
==== Counties of residence for women in any of the above five categories, mapped==== | |||
<sparql tryit="1"> | |||
## IMPORTANT: LIMITATIONS OF THE MAP | |||
## Only the top category of activity (layer) can be seen when all are selected (the default) | |||
## To see each layer, you need to deselect all in the layers menu (diamond shaped icon, top right corner of the map) and view one layer at a time. Unfortunately this is the only way to compare them at the moment. | |||
## (But I'll look into how I might be able to improve on this) | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,490: | Line 1,584: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
#title:Counties of residence for women who were nominated for election or had publications recorded or spoke/exhibited at RAI | |||
#defaultView:Map{"hide":["?geo", "?wikidata"]} | |||
SELECT distinct ?county ?countyLabel ?wikidata ?geo ?layer #?person ?personLabel | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
?person | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
{ | |||
#women who were nominated for election to FSA | RAI | |||
# | ?person ( bnp:P16 | bnp:P7 ) ?stmt . | ||
} | |||
? | union | ||
{ | |||
# women with publications recorded in indexes of archaeological papers | |||
?person bnp:P76 ?stmt . | |||
? | ?stmt bnps:P76 bnwd:Q419 . | ||
} | |||
union | |||
{ | |||
# | # women who spoke|exhibited at RAI Meeting | ||
? | ?person (bnp:P23 | bnp:P13) ?stmt . | ||
?stmt (bnps:P23 | bnps:P13) bnwd:Q29 . | |||
} | |||
# get the p labels for layers | |||
?person ?p ?stmt . | |||
?claim wikibase:claim ?p; | |||
rdfs:label ?layer. filter(lang(?layer)="en-gb"). | |||
# get geo stuff | |||
?person bnwdt:P29 ?residence . # select residences | |||
?residence bnwdt:P33 ?district . #select districts | |||
?district bnwdt:P33 ?county . #select counties | |||
optional { ?county bnwdt:P153 ?geo2 . } # for geocoords added to BN | |||
optional { | |||
?county bnp:P117 ?ws . # wikidata id P117 | |||
?ws bnpq:P14 ?wikidata_url . | |||
BIND(IRI(REPLACE(?wikidata_url, "https://www.wikidata.org/wiki/", "http://www.wikidata.org/entity/")) as ?wikidata ) | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
optional { ?wikidata wdt:P625 ?geo1 . } # geocoords if available | |||
} # /wikidata service | |||
} #/wikidata optional | |||
BIND(COALESCE(?geo1, ?geo2) AS ?geo). # if geo1 available use it, if not try geo2 | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
order by ?layer | |||
</sparql> | </sparql> | ||
=== | ===Regions in which women resided, sorted by how many residences all women had in that region=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | # Regions in which women resided, sorted by how many residences all women had in that region | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,552: | Line 1,649: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ?region ?regionLabel (count(?region) as ?region_count) #count number of regions in which women lived | |||
SELECT | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | |||
?person bnwdt:P29 ?residence . # select residences | |||
?residence bnwdt:P33 ?district . #select districts | |||
?district bnwdt:P33 ?county . #select counties | |||
?county bnwdt:P33 ?region . #select region | |||
FILTER NOT EXISTS {?region bnwdt:P117 "Q145" .} #filter out UK (where UK is sub-region of NI) | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | |||
} | |||
GROUP BY ?region ?regionLabel | |||
ORDER BY DESC(?region_count) | |||
</sparql> | |||
=== Women living in London during the 1890s === | |||
<sparql tryit="1"> | |||
#title:Women living in 1890s London | |||
# Query for women living in (greater) london in the 1890s | |||
# 1 row per person per address per date, could be reduced to 1 row per person if preferred. | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | |||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | |||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | |||
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | |||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | |||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | |||
SELECT distinct ?personLabel ?date_label ?date ?person ?address ?address_item ?londonLabel ?geo ?long ?lat | |||
WHERE { | |||
?person bnwdt:P3 bnwd:Q3 . # women | |||
?person bnp:P29 ?s . # resided at | ?person bnp:P29 ?s . # resided at | ||
?s bnps:P29 ?london . | ?s bnps:P29 ?london . | ||
Line 1,598: | Line 1,724: | ||
} | } | ||
ORDER BY ?person ?date | ORDER BY ?person ?date | ||
</sparql> | </sparql> | ||
=== | ==== Map of Women living in 1890s London ==== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | #title:Women living in 1890s London | ||
# Query for women living in (greater) london in the 1890s | |||
# 1 row per person per address per date, could be reduced to 1 row per person if preferred. | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,612: | Line 1,741: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
#defaultView:Map | #defaultView:Map | ||
SELECT distinct ?personLabel ?date_label ?date ?person ?address ?address_item ?londonLabel ?geo ?long ?lat | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # | ?person bnwdt:P3 bnwd:Q3 . # women | ||
?person bnp:P29 ?s . # resided at | |||
?s bnps:P29 ?london . | |||
?person bnp: | ?london bnwdt:P33+ bnwd:Q322 . # in Q322 greater london. | ||
# | |||
# optional street address (text) | |||
optional { | |||
?s bnpq:P31 ?address . | |||
} | |||
# optional street address (item) | |||
optional { | |||
?s bnpq:P100 ?address_item . | |||
} | |||
# dates. About 30? not dated. | |||
#optional { | |||
?s ?pq ?date . | |||
# ?date wikibase:timeValue ?date_value. # if you don't want date label this should work instead | |||
?qual_prop wikibase:qualifier ?pq; | |||
wikibase:propertyType wikibase:Time ; # nb excludes edtf dates | |||
rdfs:label ?date_label . filter(lang(?date_label)="en-gb") . # what kind of date is it. | |||
# } # /dates | |||
# filter 1890-1899 | |||
FILTER("1890-01-01"^^xsd:dateTime <= ?date && ?date < "1899-12-31"^^xsd:dateTime). | |||
# address geocoordinates | |||
optional { | |||
?s ?pqq ?geo . | |||
?qual_geo wikibase:qualifier ?pqq; | |||
wikibase:propertyType wikibase:GlobeCoordinate. | |||
BIND(geof:longitude(?geo) AS ?long) | |||
BIND(geof:latitude(?geo) AS ?lat) | |||
} | |||
# todo booth codes | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
ORDER BY ?person ?date | |||
</sparql> | </sparql> | ||
=== Where did women who published in Folklore/Folk-lore Record live? === | |||
=== | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | # Map of all places of residence for women who had publications in Folklore/Folk-lore Record | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,665: | Line 1,800: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
#defaultView:Map | |||
SELECT | #defaultView:Map{"hide":["?geo", "?count"]} | ||
SELECT ?person ?personLabel ?residenceLabel ?residence ?geo (count( ?person) as ?count) #(concat(str(?count), " publication") as ?count_lbl) | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . # select women | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | |||
?person bnwdt:P76 bnwd:Q419 . # people with publications listed in indexes of archaeological papers. [262] | |||
?person bnp:P76 ?s . | |||
## works published in P101. folklore / folk-lore record q487 q490 | |||
?s bnpq:P101 ?in . | |||
{?s bnpq:P101 bnwd:Q487 } union { ?s bnpq:P101 bnwd:Q490 . } | |||
# why does above pick up these two journals as well? | |||
FILTER ( ?in not in ( bnwd:Q665 , bnwd:Q636 ) ) . | |||
?person bnwdt:P29 ?residence . | |||
optional { ?residence bnwdt:P153 ?geo2 . } # for geocoords added to BN | |||
optional { | |||
?residence bnp:P117 ?ws . # wikidata id P117 | |||
?ws bnpq:P14 ?wikidata_url . | |||
BIND(IRI(REPLACE(?wikidata_url, "https://www.wikidata.org/wiki/", "http://www.wikidata.org/entity/")) as ?wikidata ) | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
optional {?wikidata wdt:P625 ?geo1 . } # geocoords if available | |||
} # /wikidata service | |||
} #/wikidata optional | |||
BIND(COALESCE(?geo1, ?geo2) AS ?geo). # if geo1 available use that, then try geo2 | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE] | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
ORDER BY ? | group by ?person ?personLabel ?residenceLabel ?residence ?geo | ||
ORDER BY ?geo | |||
</sparql> | </sparql> | ||
=== BN | |||
=== BN people and other things located near Devizes === | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
## testing use of geof:distance | |||
#title: | #title:BN items located within 30 km of Devizes, Wiltshire | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,715: | Line 1,854: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
#defaultView:Map | |||
SELECT distinct ?item ?itemLabel ?locationLabel ?location ?wikidata ?wd_geo ?wd_long ?wd_lat | |||
SELECT distinct | |||
WHERE { | WHERE { | ||
{?item bnwdt:P29 ?location . } # resided at location | {?item bnwdt:P29 ?location . } # resided at location | ||
#union | |||
#{?location bnwdt:P12 bnwd:Q2147 .} # OR location has instance of locality. is there a way to get this in the same structure? | |||
union | union | ||
{?item bnwdt:P2 ?location . } # item has property P2 location | {?item bnwdt:P2 ?location . } # item has property P2 location | ||
# other possibles ? | # any other possibles ? | ||
## limit to places in admin territory p33 | ## limit to places in admin territory p33 england q617. (keep numbers down to avoid wikidata timing out) | ||
?location bnwdt:P33+ bnwd: | ?location bnwdt:P33+ bnwd:Q617. | ||
?location bnwdt:P117 ?ws . # wikidata id | ?location bnwdt:P117 ?ws . # wikidata id | ||
bind(iri(concat("http://www.wikidata.org/entity/", str(?ws))) as ?wikidata) . | bind(iri(concat("http://www.wikidata.org/entity/", str(?ws))) as ?wikidata) . | ||
SERVICE <https://query.wikidata.org/sparql> { | SERVICE <https://query.wikidata.org/sparql> { | ||
wd:Q1026699 wdt:P625 ?start. # devizes coordinates | |||
?wikidata wdt:P625 ?wd_geo . | ?wikidata wdt:P625 ?wd_geo . | ||
#BIND(geof:longitude(?wd_geo) AS ?wd_long) . | |||
#BIND(geof:latitude(?wd_geo) AS ?wd_lat) . | |||
FILTER(geof:distance(?wd_geo, ?start) < 30). # < 30 km from ?start. | |||
} # /wikidata service | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | ||
} | } | ||
ORDER BY ?locationLabel | ORDER BY ?locationLabel | ||
</sparql> | </sparql> | ||
=== | === BN items near a chosen location === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title: | |||
#title:a map of BN items near a chosen starting point in the UK | |||
#defaultView:Map | |||
## create a thingy for the start point change the Qxxx ID in the following PREFIX var_start line to chosen location. | |||
## **MUST** a) be in UK and b) have a wikidata item that has coordinate location! | |||
PREFIX var_start: <https://beyond-notability.wikibase.cloud/entity/Q5> # (Q5=sheffield) | |||
## to change the distance you can edit the filter(?distance < xx) line near the end of the query. | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,761: | Line 1,904: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
# | |||
SELECT distinct ?item ?itemLabel ?locationLabel ?location | ## TODO is there a way to get the location itemLabel and use it in the map title... | ||
SELECT distinct ?item ?itemLabel ?locationLabel ?location ?wikidata ?wd_geo ?distance #?wd_long ?wd_lat | |||
WHERE { | WHERE { | ||
var_start: bnwdt:P117 ?start_wd_id . | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?start_wd_id))) as ?start_wd) . | |||
? | |||
{?item bnwdt:P29 ?location . } # resided at location | |||
union | |||
{?item bnwdt:P2 ?location . } # item has property P2 location | |||
# other possibles ? | |||
## limit to places in admin territory p33 uk q1741 seems ok. put it back to england q617 if there are any timeout problems. (keep numbers down to avoid wikidata timing out) | |||
?location bnwdt:P33+ bnwd:Q1741. | |||
?location bnwdt:P117 ?ws . # wikidata id | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?ws))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | SERVICE <https://query.wikidata.org/sparql> { | ||
? | ?start_wd wdt:P625 ?start. # start_wd coordinates. | ||
?wikidata wdt:P625 ?wd_geo . | |||
} # /wikidata service | |||
#BIND(geof:longitude(?wd_geo) AS ?wd_long) . | |||
#BIND(geof:latitude(?wd_geo) AS ?wd_lat) . | |||
bind(geof:distance(?wd_geo, ?start) as ?distance). | |||
FILTER(?distance < 40). # < xx km from start_wd | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | ||
} | } | ||
ORDER BY ?locationLabel | ORDER BY ?locationLabel | ||
</sparql> | </sparql> | ||
=== Locations of | === Locations of BN excavations === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:Locations of BN | #title:Locations of BN excavations | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,821: | Line 1,951: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
#defaultView:Map | #defaultView:Map | ||
SELECT distinct ?item ?itemLabel ?locationLabel ?location | SELECT distinct ?item ?itemLabel ?locationLabel ?location ?adminterr ?wikidata ?wd_geo | ||
WHERE { | WHERE { | ||
?item bnwdt:P12 bnwd: | ?item bnwdt:P12 bnwd:Q38 . | ||
{ | { | ||
?item bnwdt:P2 ?location . # item has property P2 location | |||
optional { ?location bnwdt:P33 ?adminterr . | optional { ?location bnwdt:P33 ?adminterr . | ||
Line 1,842: | Line 1,972: | ||
bind(iri(concat("http://www.wikidata.org/entity/", str(?ws))) as ?wikidata) . | bind(iri(concat("http://www.wikidata.org/entity/", str(?ws))) as ?wikidata) . | ||
SERVICE <https://query.wikidata.org/sparql> { | SERVICE <https://query.wikidata.org/sparql> { | ||
?wikidata wdt:P625 ?wd_geo1 . | ?wikidata wdt:P625 ?wd_geo1 . | ||
} # /wikidata service | } # /wikidata service | ||
} | |||
} | } | ||
union | union | ||
{ | { | ||
filter not exists {?item bnwdt:P2 ?location . } # item doesn't have property P2 location | |||
optional { | |||
?item bnwdt:P117 ?wikidata_id . # but has wikidata id | ?item bnwdt:P117 ?wikidata_id . # but has wikidata id | ||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_id))) as ?wikidata) . | bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_id))) as ?wikidata) . | ||
SERVICE <https://query.wikidata.org/sparql> { | SERVICE <https://query.wikidata.org/sparql> { | ||
?wikidata wdt:P625 ?wd_geo1 . | ?wikidata wdt:P625 ?wd_geo1 . | ||
} # /wikidata service | } # /wikidata service | ||
} | |||
} | } | ||
BIND(COALESCE(?wd_geo1, ?wd_geo2) AS ?wd_geo). # if geo1 available use that, then try geo2 | BIND(COALESCE(?wd_geo1, ?wd_geo2) AS ?wd_geo). # if geo1 available use that, then try geo2 | ||
Line 1,869: | Line 1,998: | ||
</sparql> | </sparql> | ||
=== Locations of | === Locations of archaeological sites === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title: | #title:Locations of BN archaeological sites | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,881: | Line 2,010: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
#defaultView:Map | #defaultView:Map | ||
SELECT distinct ?item ?itemLabel ?locationLabel ?location ?wikidata ?wd_geo | SELECT distinct ?item ?itemLabel ?locationLabel ?location ?adminterrLabel ?adminterr ?wikidata ?wd_geo | ||
WHERE { | WHERE { | ||
?item bnwdt:P12 bnwd: | ?item bnwdt:P12 bnwd:Q86 . | ||
{ | |||
?item bnwdt:P2 ?location . # item has property P2 location | |||
optional { ?location bnwdt:P33 ?adminterr . | optional { ?location bnwdt:P33 ?adminterr . | ||
Line 1,902: | Line 2,031: | ||
bind(iri(concat("http://www.wikidata.org/entity/", str(?ws))) as ?wikidata) . | bind(iri(concat("http://www.wikidata.org/entity/", str(?ws))) as ?wikidata) . | ||
SERVICE <https://query.wikidata.org/sparql> { | SERVICE <https://query.wikidata.org/sparql> { | ||
?wikidata wdt:P625 ?wd_geo1 . | ?wikidata wdt:P625 ?wd_geo1 . | ||
} # /wikidata service | } # /wikidata service | ||
} | } | ||
} | |||
union | |||
{ | |||
filter not exists {?item bnwdt:P2 ?location . } # item doesn't have property P2 location | |||
?item bnwdt:P117 ?wikidata_id . # but has wikidata id | ?item bnwdt:P117 ?wikidata_id . # but has wikidata id | ||
Line 1,916: | Line 2,047: | ||
SERVICE <https://query.wikidata.org/sparql> { | SERVICE <https://query.wikidata.org/sparql> { | ||
?wikidata wdt:P625 ?wd_geo1 . | ?wikidata wdt:P625 ?wd_geo1 . # which has geo coords | ||
} # /wikidata service | } # /wikidata service | ||
} | } | ||
BIND(COALESCE(?wd_geo1, ?wd_geo2) AS ?wd_geo). # if geo1 available use that, then try geo2 | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | ||
} | } | ||
Line 1,930: | Line 2,058: | ||
</sparql> | </sparql> | ||
=== | === Locations of historic houses === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title: | #title:locations of BN historic houses | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,942: | Line 2,070: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
#defaultView:Map | #defaultView:Map | ||
SELECT distinct ?item ?itemLabel ?locationLabel ?location ? | SELECT distinct ?item ?itemLabel ?locationLabel ?location ?wikidata ?wd_geo | ||
WHERE { | WHERE { | ||
?item bnwdt:P12 bnwd:Q2961 . | |||
{ | |||
?item bnwdt:P12 bnwd: | |||
?item bnwdt:P2 ?location . # item has property P2 location | ?item bnwdt:P2 ?location . # item has property P2 location | ||
optional { ? | optional { ?location bnwdt:P33 ?adminterr . | ||
? | ?adminterr bnwdt:P117 ?wsa . # and has wikidata id | ||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wsa))) as ?wikidataa) . | bind(iri(concat("http://www.wikidata.org/entity/", str(?wsa))) as ?wikidataa) . | ||
SERVICE <https://query.wikidata.org/sparql> { | SERVICE <https://query.wikidata.org/sparql> { | ||
?wikidataa wdt:P625 ? | ?wikidataa wdt:P625 ?wd_geo2 . | ||
} # /wikidata service | } # /wikidata service | ||
} | } | ||
optional { | |||
?location bnwdt:P117 ?ws . # and has wikidata id | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?ws))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?wikidata wdt:P625 ?wd_geo1 . | |||
} # /wikidata service | |||
} | |||
} | |||
union | |||
{ | |||
filter not exists {?item bnwdt:P2 ?location . } # item doesn't have property P2 location | |||
?item bnwdt:P117 ?wikidata_id . # but has wikidata id | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_id))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?wikidata wdt:P625 ?wd_geo1 . | |||
} # /wikidata service | |||
} | |||
BIND(COALESCE(?wd_geo1, ?wd_geo2) AS ?wd_geo). # if geo1 available use that, then try geo2 | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | ||
} | } | ||
Line 1,968: | Line 2,119: | ||
</sparql> | </sparql> | ||
=== | === Residences of women participants in Colchester excavations === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:Excavations at Colchester: where women participants lived | |||
#title: | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 1,981: | Line 2,130: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
#defaultView:Map | |||
#defaultView:Map | SELECT distinct ?item ?itemLabel ?locationLabel ?location ?person ?personLabel ?resided ?residedLabel ?wd_geo | ||
SELECT distinct ? | |||
WHERE { | WHERE { | ||
values (?item) { (bnwd:Q90) } # q90 colchester | |||
?item bnwdt:P12 bnwd:Q38 . | |||
?item bnwdt:P2 ?location . # item has property P2 location | |||
?item (bnwdt:P36 | bnwdt:P37 ) ?person . | |||
#optional { ?item bnwdt:P36 ?director . } | |||
#optional { ?item bnwdt:P37 ?member . } | |||
# | |||
optional { ?person bnwdt:P29 ?resided . | |||
?resided bnwdt:P117 ?wsa . # and has wikidata id | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wsa))) as ?wikidataa) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?wikidataa wdt:P625 ?wd_geo . | |||
} # /wikidata service | |||
} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} | |||
ORDER BY ?locationLabel | |||
</sparql> | |||
=== IWD 2024 Map of five women's places === | |||
<sparql tryit="1"> | |||
## how many places for the five women can I get on a map? a slightly ridiculous query. | |||
#title:Four stories, five women, many places for #IWD2024 | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | |||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | |||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | |||
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | |||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | |||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | |||
#defaultView:Map{"hide":["?geo"],"layer":"?person", "markercluster":true } | |||
SELECT distinct ?person ?personLabel ?propLabel ?placeLabel ?geo ?loc2Label (year(?date) as ?year) | |||
WHERE { | |||
VALUES (?person) {(bnwd:Q894) (bnwd:Q462) (bnwd:Q549) (bnwd:Q921) (bnwd:Q1053) } # | |||
?person ( bnp:P29 | bnp:P94 | bnp:P23 | bnp:P13 | bnp:P120 ) ?s . | |||
optional { ?place bnwdt:P2 ?linked_p2 . # linked place has wikidata geocoords | ?s ( bnps:P29 | bnps:P94 | bnps:P23 | bnps:P13 | bnps:P120 ) ?place . | ||
?linked_p2 bnwdt:P117 ?lws . # wikidata id P117 | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?lws))) as ?lwikidata) . | ?person ?p ?s . | ||
SERVICE <https://query.wikidata.org/sparql> { | ?prop wikibase:claim ?p; | ||
?lwikidata wdt:P625 ?geo4 . | wikibase:statementProperty ?ps. | ||
} | |||
optional { ?s ( bnpq:P1 | bnpq:P27 ) ?date . } | |||
#optional { ?s bnpq:P31 ?street . } | |||
# LOLplaces | |||
#1 geocoords in quals for place itself - should be detailed geo added manually, cf London district geocoords which =main P153 | |||
#2 wikdiata geocoords for place | |||
#3 geocoords in quals for linked place | |||
#4 wikidata geocoords for linked place | |||
#5 wikidata geocoords in place P2 qual | |||
#6 `of` qual geocoords | |||
#7 `of` P2 wikidata geocoords | |||
#8 `of` wikidata geocoords | |||
#9 place main geocoords - likely to be broad london postal districts so should be last resort | |||
#10 linked place main geocoords | |||
optional { ?s bnpq:P153 ?geo1 . } # place has geocoords directly *in qualifier* | |||
optional { ?place bnwdt:P2 ?linked_p1 . # linked place has geocoords *in qualifier* (this is primarily for SAL?) | |||
?linked_p1 bnp:P2 ?llp_s . | |||
?llp_s bnps:P2 ?llp_p1. | |||
?llp_s bnpq:P153 ?geo2 . | |||
} | |||
optional { ?place bnwdt:P117 ?pws . # place has wikidata page that has geoocords (main P625, not anywhere else) | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?pws))) as ?pwikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?pwikidata wdt:P625 ?geo3 . | |||
} | |||
} | |||
optional { ?place bnwdt:P2 ?linked_p2 . # linked place has wikidata geocoords | |||
?linked_p2 bnwdt:P117 ?lws . # wikidata id P117 | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?lws))) as ?lwikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?lwikidata wdt:P625 ?geo4 . | |||
} | |||
} | } | ||
Line 2,082: | Line 2,271: | ||
</sparql> | </sparql> | ||
== | === Wikidata categories for BN instance of locality in the UK === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 2,096: | Line 2,281: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | |||
#title: counts of WD instance of (P31) for BN localities (instance of Q2147) in the UK | |||
select ?wd_io ?wd_io_label (count(*) as ?count) | |||
where { | |||
? | ?item bnwdt:P12 bnwd:Q2147 . # BN io locality | ||
?item bnwdt:P33* bnwd:Q1741 . # in UK | |||
?item bnwdt:P117 ?wd. | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wd))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?wikidata wdt:P31 ?wd_io. | |||
## p31 Q48091 region of england. | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". | |||
?wikidata rdfs:label ?wd_label . | |||
?wd_io rdfs:label ?wd_io_label . | |||
} | |||
} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | ||
} | } | ||
group by ?wd_io ?wd_io_label | |||
order by ?wd_io_label | |||
</sparql> | </sparql> | ||
=== | |||
=== Localities not in the UK === | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | ##admin_paths lists the linked P33 for the item. Unfortunately, they aren't reliably returned in ascending order. | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 2,122: | Line 2,320: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
#title:localities not in the UK | |||
select ?item ?itemLabel (group_concat(distinct ?admin_label; separator=", " ) as ?admin_path) | |||
where { | |||
?item bnwdt:P12 bnwd:Q2147 . # i/o locality | |||
?item bnwdt:P33* ?admin. | |||
?admin rdfs:label ?admin_label. filter(lang(?admin_label)="en") . | |||
filter not exists { ?item bnwdt:P33* bnwd:Q1741. } # filter out anything in the UK | |||
filter (?item not in (bnwd:Q619, bnwd:Q2961, bnwd:Q4207, bnwd:Q86) ). # and a few things that are not specific places | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | ||
} | } | ||
group by ? | group by ?item ?itemLabel | ||
order by ?itemLabel | |||
</sparql> | </sparql> | ||
=== | ==People== | ||
===Women with their family name at birth and family name after marriage=== | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# Women with their family name at birth and family name after marriage | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 2,150: | Line 2,351: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ?person ?personLabel ? | |||
SELECT ?person ?personLabel ?birthname ?marriedname | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . #select women | ?person bnwdt:P3 bnwd:Q3 . #select women | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person | OPTIONAL {?person bnwdt:P140 ?birthname .} #look for birth name | ||
? | OPTIONAL {?person bnwdt:P141 ?marriedname .} #look for married name | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | |||
} | } | ||
ORDER BY ?personLabel | ORDER BY ?personLabel | ||
</sparql> | </sparql> | ||
===Women | === Women with family name at birth, married name and count of married names=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# Women with their family name at birth, family name after marriage and count of married names | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 2,188: | Line 2,378: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ?person ?personLabel ?birthname | |||
(GROUP_CONCAT(DISTINCT ?marriedname; SEPARATOR=", ") AS ?marriednames) | |||
( | (COUNT(?marriedname) AS ?marriedcount) | ||
( | |||
WHERE { | |||
?person bnwdt:P3 bnwd:Q3 . #select women | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | |||
OPTIONAL {?person bnwdt:P140 ?birthname .} #look for birth name | |||
OPTIONAL {?person bnwdt:P141 ?marriedname .} #look for married name | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} | |||
group by ?person ?personLabel ?birthname | |||
ORDER BY ?personLabel | |||
</sparql> | |||
===Where women in our data are in wikidata, their spouses, fathers, and mothers according to wikidata=== | |||
<sparql tryit="1"> | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | |||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | |||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | |||
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | |||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | |||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | |||
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |||
PREFIX wd: <http://www.wikidata.org/entity/> | |||
SELECT ?person ?personLabel ?item ?WD_spouse ?WD_father ?WD_mother | |||
WHERE { | |||
?person bnwdt:P3 bnwd:Q3 . #select women | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | |||
?person bnp:P117 ?wikidata_ID . #look for wikidata ID on person page | |||
?wikidata_ID bnpq:P14 ?wikidata_url . | |||
BIND(IRI(REPLACE(?wikidata_url,"https://www.wikidata.org/wiki/","http://www.wikidata.org/entity/")) as ?item ) | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?item wdt:P21 ?WD_gender. #get gender of person | |||
OPTIONAL {?item wdt:P22 ?WD_father . } #recall father | |||
OPTIONAL {?item wdt:P25 ?WD_mother . } #recall mother | |||
OPTIONAL {?item wdt:P26 ?WD_spouse . } #recall spouse | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE] | } | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | |||
} | } | ||
ORDER BY ?personLabel | |||
# with thanks to @tagishsimon for writing this one initially! | |||
</sparql> | </sparql> | ||
===Women in our data | ===Women in our data alongside counts of their public and professional activities, sorted by total=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
## Women in our data | ## Women in our data alongside counts of their public and professional activities (https://beyond-notability.wikibase.cloud/wiki/Item:Q151) | ||
# | ## Sorted by total PPAs | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | |||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | |||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | ||
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | ||
Line 2,275: | Line 2,443: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
select ?person ?personLabel | |||
(count(distinct ?exhibitor) as ?exhibitions) | |||
?person bnwdt:P3 bnwd:Q3 . | (count(distinct ?position) as ?positions) | ||
(count(distinct ?speaker) as ?spoke) | |||
?person | (count(distinct ?attended) as ?attendance) | ||
(count(distinct ?donorof) as ?donated) | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | (count(distinct ?wasdelegate) as ?delegate) | ||
} | (count(distinct ?correspondent) as ?correspondents) | ||
(count(distinct ?fellow) as ?fellowships) | |||
ORDER BY DESC(? | (count(distinct ?collab) as ?collaborations) | ||
(count(distinct ?found) as ?founded) | |||
(count(distinct ?loaned) as ?loans) | |||
(count(distinct ?illustrated) as ?illustrations) | |||
(count(distinct ?sold) as ?sales) | |||
(count(distinct ?served) as ?service) | |||
(count(distinct ?job) as ?employed) | |||
(count(distinct ?fundraiser) as ?fundraisers) | |||
(count(distinct ?publish) as ?published) | |||
(count(distinct ?benefact) as ?benefactor) | |||
(count(distinct ?donor) as ?donor_to) | |||
(count(distinct ?collect) as ?collected) | |||
(count(distinct ?performance) as ?performances) | |||
((?exhibitions + ?positions + ?spoke + ?attendance + ?donated + ?delegate + ?correspondents + ?fellowships + ?collaborations + ?founded + ?loans + ?illustrations + ?sales | |||
+ ?service + ?employed + ?fundraisers + ?published + ?benefactor + ?donor_to + ?collected + ?performances) AS ?PPA_total) | |||
where | |||
{ | |||
?person bnwdt:P3 bnwd:Q3 . | |||
optional { ?person bnp:P13 ?exhibitor } | |||
optional { ?person bnp:P17 ?position } | |||
optional { ?person bnp:P23 ?speaker } | |||
optional { ?person bnp:P24 ?attended } | |||
optional { ?person bnp:P65 ?donorof } | |||
optional { ?person bnp:P71 ?wasdelegate } | |||
optional { ?person bnp:P73 ?correspondent } | |||
optional { ?person bnp:P75 ?fellow } | |||
optional { ?person bnp:P83 ?collab } | |||
optional { ?person bnp:P85 ?found } | |||
optional { ?person bnp:P87 ?loaned } | |||
optional { ?person bnp:P89 ?illustrated } | |||
optional { ?person bnp:P99 ?sold } | |||
optional { ?person bnp:P102 ?served } | |||
optional { ?person bnp:P105 ?job } | |||
optional { ?person bnp:P106 ?fundraiser } | |||
optional { ?person bnp:P107 ?publish } | |||
optional { ?person bnp:P110 ?benefact } | |||
optional { ?person bnp:P111 ?donor } | |||
optional { ?person bnp:P114 ?collect } | |||
optional { ?person bnp:P120 ?performance } | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} | |||
group by ?person ?personLabel | |||
ORDER BY DESC (?PPA_total) | |||
</sparql> | </sparql> | ||
===Women in our data arranged as a network graph by the organisations they were members of=== | |||
<sparql tryit="1"> | |||
## Women in our data arranged as a network graph by the organisations they were members of | |||
#defaultView:Graph | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | |||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | |||
SELECT ?org ?orgLabel ?rgb ?linkTo ?linkToLabel | |||
WHERE { | |||
?linkTo bnwdt:P3 bnwd:Q3 . #select women | |||
FILTER NOT EXISTS {?linkTo bnwdt:P4 bnwd:Q12 .} #filter out project team | |||
?linkTo bnwdt:P67 ?org | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en". } | |||
BIND( "7C4DCD" AS ?rgb ) . | |||
} | |||
ORDER BY ?personLabel | |||
</sparql> | |||
=== | ===Membership of organisations by women, sorted by how many women were members of a given organisation=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | # Membership of organisations by women, sorted by how many women were members of a given organisation | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 2,304: | Line 2,530: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ? | SELECT ?organisation ?organisationLabel (count(?organisation) as ?organisation_count) #count number of organisations that women were members of | ||
WHERE { | WHERE { | ||
{?woman bnwdt:P3 bnwd:Q3 . #filter women | ?person bnwdt:P3 bnwd:Q3 . # select women | ||
?woman bnwdt:P94 ?educationalinstitution . #find 'educated at' statement | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?educationalinstitution bnwdt:P12 bnwd:Q2914 . #filter to tertiary educational institutions | ?person bnwdt:P67 ?organisation . # selection people who were members of organisations and what those organisations were | ||
?educationalinstitution bnwdt:P2 ?location . #find location of educational institution | FILTER NOT EXISTS {?person bnwdt:P67 bnwd:Q35 .} # filter out Royal Archaeological Institute | ||
?location rdfs:label ?locationLabel . | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | } | ||
FILTER(LANG(?locationLabel) = "en") . | GROUP BY ?organisation ?organisationLabel | ||
FILTER(regex(?locationLabel, "oxford", "i")) .} | ORDER BY DESC(?organisation_count) | ||
UNION | </sparql> | ||
==Education== | |||
===Women educated at a tertiary educational institution located in Oxford or Cambridge=== | |||
<sparql tryit="1"> | |||
# Women educated at a tertiary educational institution located in Oxford or Cambridge | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | |||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | |||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | |||
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | |||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | |||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | |||
SELECT ?woman ?womanLabel ?educationalinstitution ?educationalinstitutionLabel ?location ?locationLabel | |||
WHERE { | |||
{?woman bnwdt:P3 bnwd:Q3 . #filter women | |||
?woman bnwdt:P94 ?educationalinstitution . #find 'educated at' statement | |||
?educationalinstitution bnwdt:P12 bnwd:Q2914 . #filter to tertiary educational institutions | |||
?educationalinstitution bnwdt:P2 ?location . #find location of educational institution | |||
?location rdfs:label ?locationLabel . | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
FILTER(LANG(?locationLabel) = "en") . | |||
FILTER(regex(?locationLabel, "oxford", "i")) .} | |||
UNION | |||
{?woman bnwdt:P3 bnwd:Q3 . #filter women | {?woman bnwdt:P3 bnwd:Q3 . #filter women | ||
?woman bnwdt:P94 ?educationalinstitution . #find 'educated at' statement | ?woman bnwdt:P94 ?educationalinstitution . #find 'educated at' statement | ||
Line 3,365: | Line 3,620: | ||
} | } | ||
FILTER(LANG(?propertyLabel) = 'en | FILTER(LANG(?propertyLabel) = 'en') | ||
# fix label language dups; but Q why doesn't SERVICE work? | # fix label language dups; but Q why doesn't SERVICE work? | ||
# A: https://en.wikibooks.org/wiki/SPARQL/FILTER#FILTER_on_values_in_Labels | # A: https://en.wikibooks.org/wiki/SPARQL/FILTER#FILTER_on_values_in_Labels | ||
} | } | ||
Line 3,375: | Line 3,629: | ||
</sparql> | </sparql> | ||
=== All the Things for Organisations === | === All the Things for Organisations === | ||
Line 3,436: | Line 3,689: | ||
=== | === One woman === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:All About a Woman | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 3,451: | Line 3,701: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
PREFIX bnpsv: <https://beyond-notability.wikibase.cloud/prop/statement/value/> | |||
PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | |||
SELECT | SELECT distinct ?propLabel ?spsLabel ?qual_propLabel ?pqsLabel ?link ?s | ||
# ?main_date ?main_precision ?qual_date ?qual_precision | |||
# ?prop ?sps ?pqs ?pq | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb | WHERE | ||
{ | |||
VALUES (?person) {(bnwd:Q569)} # add (bnwd:Qxxx) if you want more than one person. | |||
?person ?p ?s . | |||
?prop wikibase:claim ?p; | |||
wikibase:statementProperty ?ps; # simple value | |||
wikibase:statementValue ?psv. # full value | |||
# exclude external IDs | |||
# filter not exists { ?prop wikibase:propertyType wikibase:ExternalId . } | |||
?s ?ps ?sps. | |||
# full date via ?psv | |||
OPTIONAL { | |||
?s ?psv ?spsv . | |||
?spsv wikibase:timeValue ?main_date . | |||
?spsv wikibase:timePrecision ?main_precision . | |||
} | |||
# qualifiers. | |||
optional { | |||
?s ?pq ?pqs . | |||
?qual_prop wikibase:qualifier ?pq . | |||
?qual_prop wikibase:qualifierValue ?pqp . | |||
optional { | |||
# full date via ?pqp | |||
?s ?pqp ?qv . | |||
?qv wikibase:timeValue ?qual_date. | |||
?qv wikibase:timePrecision ?qual_precision. | |||
} | |||
} | |||
# direct link to property | |||
BIND (REPLACE(STR(?prop), "^.*/([^/]*)$", "$1") as ?pid). | |||
bind(iri(concat(str(?person), "#", ?pid)) as ?link ) . | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} | } | ||
order by ?propLabel ?s | |||
</sparql> | </sparql> | ||
=== Working with property paths: | ===Working with property paths: organisations and locations=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | ## problem: sometimes you need to follow property paths using */+ for (eg) locations. BUT this can lead to several results to choose between and they aren't necessarily returned in the "right" order. | ||
# | ## how to determine the "distance" along the path of each result? | ||
# distance | ## https://stackoverflow.com/questions/61984052/wikidata-get-the-full-subhierachy-of-one-class-as-well-as-all-nodes | ||
## > you can get the distance of a class with SELECT ?cls (count(?tmp) as ?distance) WHERE { ?cls wdt:P279* ?tmp . ?tmp wdt:P279+ wd:Q2095 . } group by ?cls order by asc(?distance) - though there might be corner cases like cycles in the hierarchy resp. multiple paths | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 3,479: | Line 3,771: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ?item ?itemLabel ? | SELECT ?item ?itemLabel ?location ?locationLabel (count(?item) as ?distance) | ||
WHERE { | WHERE { | ||
?item bnwdt:P12 | ?item bnwdt:P12 bnwd:Q2316 . # instance of organisation. | ||
?tmp bnwdt: | ?item bnwdt:P2* ?tmp . | ||
?tmp bnwdt:P2+ ?location . # P2=30. P2+=34 | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb, en". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb, en". } | ||
} | } | ||
group by ?item ?itemLabel ? | group by ?item ?itemLabel ?location ?locationLabel | ||
ORDER BY ?item ?distance | ORDER BY ?item ?distance | ||
</sparql> | </sparql> | ||
== | === Traversing instance of with GAS === | ||
<sparql tryit="1"> | |||
#title:GAS | |||
<sparql tryit="1"> | # The Gather, Apply, and Scatter (GAS) service provides graph traversal, graph mining, and similar classes of algorithms for SPARQL. | ||
#title: | # In practical terms, it enables a series of relations to be followed through the graph; for instance the chain of father, grandfather, great-grandfather &c - tracing the father (P22) line - of a subject item | ||
# | # https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/query_optimization#GAS_Service | ||
# https://github.com/blazegraph/database/wiki/RDF_GAS_API | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 3,506: | Line 3,799: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT | SELECT ?depth ?ioLabel ?itemLabel ?io ?item | ||
WHERE { | |||
SERVICE gas:service { | |||
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ; | |||
gas:in bnwd:Q3099 ; | |||
gas:linkType bnwdt:P12 ; | |||
gas:traversalDirection "Reverse"; | |||
gas:out ?item ; | |||
gas:out1 ?depth ; | |||
gas:out2 ?io . | |||
} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } | |||
} | |||
order by ?depth ?ioLabel ?itemLabel | |||
</sparql> | |||
=== Working with property paths: instance of [CAVEAT: experimental, probably wrong]=== | |||
<sparql tryit="1"> | |||
# an attempt to adapt the query above following paths for locations of organisations for (more complex) instance of | |||
# ref https://stackoverflow.com/questions/61984052/wikidata-get-the-full-subhierachy-of-one-class-as-well-as-all-nodes | |||
# distance is in the right *order* so it should be usable for some purposes, but the starting number = number of levels rather than 1. also jumps if there are siblings somewhere along the path. | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | |||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | |||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | |||
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | |||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | |||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | |||
SELECT ?item ?itemLabel ?instance_of ?instance_ofLabel (count(?item) as ?distance) | |||
WHERE { | |||
?item bnwdt:P12* ?tmp . # instance of anything. | |||
?tmp bnwdt:P12+ ?instance_of . # P2=30. P2+=34 | |||
ORDER BY ? | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb, en". } | ||
} | |||
group by ?item ?itemLabel ?instance_of ?instance_ofLabel | |||
ORDER BY ?item ?distance | |||
</sparql> | </sparql> | ||
=== | ==Dates== | ||
===All the Dates for Women FSAs=== | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | #title:fishing for dates for FSAs | ||
# | # union query to get [hopefully] every date associated with women FSAs including main dates and qualifier dates | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 3,575: | Line 3,859: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
PREFIX bnpsv: <https://beyond-notability.wikibase.cloud/prop/statement/value/> | |||
PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | |||
SELECT | SELECT distinct ?person ?personLabel ?prop_label ?qualLabel ?qual_dateLabel ?date_value ?s | ||
#?prop ?qual | |||
WHERE { ?person bnwdt:P3 bnwd:Q3 . | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . #select women | |||
?person bnwdt:P75 bnwd:Q8. # find only BN subjects having a FSA | |||
# get stuff about ?person | |||
?person ?p ?s . | |||
# get stuff about ?p . | |||
?prop wikibase:claim ?p; | |||
wikibase:statementProperty ?ps ; | |||
wikibase:statementValue ?psv . | |||
?prop wikibase:propertyType ?date_prop_type . | |||
?prop rdfs:label ?prop_label. filter(lang(?prop_label)="en-gb") . | |||
{ # main dates | |||
# get dates detail via ?s and psv | |||
# gets edtf dates in simplified std wiki date format? | |||
# https://github.com/ProfessionalWiki/WikibaseEdtf | |||
?s ?psv ?wdv . | |||
?wdv wikibase:timeValue ?date_value . | |||
} # /main dates | |||
UNION | |||
{ # qualifier dates | |||
# direct value (usually item) for the property | |||
?s ?ps ?qual. | |||
# date qualifiers. [assumes no edtf in quals. ] | |||
?s ?pq ?date_value . | |||
?qual_date wikibase:qualifier ?pq . | |||
?qual_date wikibase:propertyType wikibase:Time. | |||
?qual_date rdfs:label ?date_qual_label . filter(lang(?date_qual_label)="en") . | |||
} # /qual dates | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} # /where | |||
ORDER BY ?person ?prop_label ?date_value | |||
ORDER BY ? | |||
</sparql> | </sparql> | ||
=== | ===Fetch any of multiple kinds of EDTF date for a woman=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# a union query to fetch stuff for multiple properties, in this case dates recorded in EDTF which need slightly different handling from PIT dates | |||
# query for | # main dates only; pretty sure there are no EDTF in qualifiers. | ||
# updated to get date property labels | |||
# | |||
# | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 3,622: | Line 3,928: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT | SELECT ?person ?personLabel ?date_edtf ?date_prop ?date_label ?s | ||
WHERE { | |||
WHERE { ?person bnwdt:P3 bnwd:Q3 . | |||
FILTER NOT EXISTS { ?person bnwdt:P4 bnwd:Q12 . } | |||
## can do this union first but makes no difference to results except possibly a bit slower. | |||
#?person ( bnp:P131 | bnp:P132 | bnp:P133 ) ?s . | |||
# ?s ( bnps:P131 | bnps:P132 | bnps:P133 ) ?date_edtf . | |||
} | |||
ORDER BY ? | ?person ?p ?s . # so you can get the statement id and date prop label | ||
?claim wikibase:claim ?p; | |||
rdfs:label ?date_label. filter(lang(?date_label)="en") . | |||
?s ?date_prop ?date_edtf . | |||
## filter for edtf dates | |||
## docs: https://github.com/ProfessionalWiki/WikibaseEdtf | |||
FILTER ( datatype(?date_edtf) = xsd:edtf ) . | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en, en-gb". } | |||
} | |||
ORDER BY ?personLabel | |||
</sparql> | </sparql> | ||
=== | ===Full values: dates === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | # query for full values to access the timeValue and timePrecision of a date, in this case a date of birth. | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
## why is a more complex query needed? | |||
## simple value for a date doesn't differentiate between (eg) "1880" and "1 January 1880"; both are returned as 1 January 1880 (and SELECT DISTINCT will collapse them into a single result) | |||
## there are 14 codes for precision from billion years to second. 7: century, 8: decade, 9: year, 10: month, 11: day | |||
## NB additional bnpsv: prefix | |||
## https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format#Value_representation | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | |||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | |||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | |||
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | |||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | |||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | |||
PREFIX bnpsv: <https://beyond-notability.wikibase.cloud/prop/statement/value/> | |||
SELECT DISTINCT ?item ?itemLabel ?date ?precision | |||
WHERE { | |||
?item bnp:P26 ?statement. # date of birth (precision of these varies quite a bit) | |||
?statement bnpsv:P26 ?valueNode. | |||
?valueNode wikibase:timeValue ?date. | |||
?valueNode wikibase:timePrecision ?precision. | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } | |||
} | |||
ORDER BY ?date | |||
</sparql> | |||
=== Any main level date for women === | |||
<sparql tryit="1"> | |||
# a query to get all types of main date for women | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | |||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | ||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | ||
Line 3,712: | Line 4,065: | ||
UNION | UNION | ||
{ # qualifier dates | { # FIXME? qualifier dates. hmm... how is this different from above? I think something is missing. | ||
?person bnwdt:P3 bnwd:Q3 . | ?person bnwdt:P3 bnwd:Q3 . | ||
Line 3,841: | Line 4,194: | ||
</sparql> | </sparql> | ||
=== Women having children === | |||
===Women | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:women having children | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 3,854: | Line 4,206: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ?person ?personLabel ? | # lol defaultView:Timeline{"hide":["?s", "?date_prec", ""]} | ||
# P131 had child in / P45 child | |||
# a handful of P45 named children don't have dob though probably have dob in wikidata | |||
SELECT distinct ?person ?personLabel ?childLabel ?date_value ?date_prec ?had_child_edtf ?note | |||
?s | |||
where { | |||
?person bnwdt:P3 bnwd:Q3 . # select women | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | |||
{ | |||
# had child in (unnamed children) | |||
?person bnp:P131 ?s . | |||
?s bnps:P131 ?had_child_edtf . # keep the edtf date for reference, though i think you can just use the time value/prec with these. | |||
# get dates detail via ?s and psv | |||
# gets edtf dates in std wiki date format | |||
# https://github.com/ProfessionalWiki/WikibaseEdtf | |||
?s ?psv ?wdv . | |||
?wdv wikibase:timeValue ?date_value . | |||
?wdv wikibase:timePrecision ?date_prec . | |||
# filter edtf date. | |||
FILTER ( datatype(?had_child_edtf) = xsd:edtf ) . #shows only the raw EDTF string from the query results | |||
# interesting, when you put this after wikibase:timeValue it seems to get every timey-wimey statement for women who have had child in ? (but only one) | |||
#?person bnwdt:P131 ?had_child . | |||
# not much added in quals for had child. only maybe note P47. some have sourcing circumstances. | |||
optional { ?s bnpq:P47 ?note . } # | |||
} | |||
union | |||
{ | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | # named children (are any in both sections??? from dates looks possible a couple might be [wherry / hodgson]) | ||
?person bnp:P45 ?s. | |||
?s bnps:P45 ?child . | |||
optional { ?child bnp:P26 ?ss . | |||
?ss bnps:P26 ?dob . | |||
?ss ?psv ?wdv . | |||
?wdv wikibase:timeValue ?date_value . | |||
?wdv wikibase:timePrecision ?date_prec . | |||
} | |||
} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} | } | ||
order by ?person ?date_value | |||
</sparql> | </sparql> | ||
=== | === Women who were adults in 1911 === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:Women who were adults in 1911 and their calculated ages | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 3,907: | Line 4,271: | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT distinct ?person ?personLabel ?statements ?dob ?dod ?age1911 | |||
WHERE { | |||
?person bnwdt:P3 bnwd:Q3 ; | |||
wikibase:statements ?statements . | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} | |||
?person bnwdt:P26 ?dob . | |||
#optional { | |||
?person bnwdt:P15 ?dod . | |||
#} | |||
# | |||
# | |||
? | filter(year(?dod) > 1911 && year(?dob) <=1893 ) . | ||
#if dod is made optional a more complex filter to include some women who were likely to still be alive in 1911. but doesnt add very many. | |||
#filter( ( year(?dob) <= 1893 && year(?dod) > 1911 ) || ( year(?dob) <= 1893 && year(?dob) >1870 ) ) . | |||
#Date literals can be written by adding ^^xsd:dateTime to an ISO 8601 date string: "2012-10-29"^^xsd:dateTime | |||
bind(year("1911-07-01"^^xsd:dateTime) - year(?dob) as ?age1911 ). | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} | } | ||
ORDER BY ?personLabel | |||
</sparql> | </sparql> |
edits