726
edits
(21 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 552: | Line 554: | ||
</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> | |||
== Professional Activities and Organisations == | == Professional Activities and Organisations == | ||
Line 751: | Line 814: | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:ppa buckets (revised February 2024) | #title:ppa buckets (revised February 2024) | ||
# broad PPA grouping categories to use for overviews and analysis within categories | |||
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 767: | Line 832: | ||
?ppa wikibase:claim ?p; | ?ppa wikibase:claim ?p; | ||
wikibase:statementProperty ?ps. | wikibase:statementProperty ?ps. | ||
# note: i think you need rdfs:label (*Label won't work) for the bind() | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". | ||
?ppa rdfs:label ?ppa_label. | ?ppa rdfs:label ?ppa_label. | ||
} # /label service | } # /label service | ||
Line 778: | Line 845: | ||
?s ?ps ?ppa_value. | ?s ?ps ?ppa_value. | ||
# note: it would be possible to write this to use ppa rather than ppa_label | |||
# BUT then it would be much more opaque and difficult to edit if (when!) we make any changes to the buckets. | |||
bind( | bind( | ||
if( str(?ppa_label) in ("attended", "exhibited at", "organiser of", "performed at", "spoke at", "was delegate at (free text)", "was delegate at (item)" ), "events", | if( str(?ppa_label) in ("attended", "exhibited at", "organiser of", "performed at", "spoke at", "was delegate at (free text)", "was delegate at (item)" ), "events", | ||
Line 800: | Line 868: | ||
</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 815: | Line 882: | ||
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 { | ||
?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 | |||
{ | |||
# 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 874: | Line 956: | ||
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 not in London | ===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 not in London | # 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 901: | Line 985: | ||
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 . | ||
Line 919: | Line 1,004: | ||
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"> | ||
Line 933: | Line 1,017: | ||
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:Q67 .} | |||
UNION | |||
{?county bnwdt:P33 bnwd:Q85 .} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | |||
} | |||
ORDER BY ?regionLabel ?countyLabel ?districtLabel ?residenceLabel | |||
</sparql> | </sparql> | ||
=== | ===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/> | ||
Line 958: | Line 1,044: | ||
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 { | WHERE { | ||
? | ?resident bnwdt:P29 ?residence . | ||
?residence bnwdt:P33 ?district . | |||
?district bnwdt:P33 ?county . | |||
?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". } | 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 982: | Line 1,071: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ?district ?districtLabel | 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 .} | |||
?residence bnwdt:P33 ?district . | 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 1,007: | Line 1,103: | ||
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 { | |||
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". | |||
SERVICE wikibase:label { 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,033: | Line 1,128: | ||
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,060: | Line 1,152: | ||
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,090: | Line 1,180: | ||
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,101: | Line 1,190: | ||
</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,117: | Line 1,206: | ||
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,128: | Line 1,217: | ||
</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,144: | Line 1,233: | ||
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,155: | Line 1,244: | ||
</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 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,167: | Line 1,257: | ||
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: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 | ||
?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". } | |||
} | |||
GROUP BY ?county ?countyLabel | |||
ORDER BY DESC(?county_count) | |||
</sparql> | |||
====Counties of residence for women who spoke at RAI meetings, sorted by how many residences all women had in that county==== | |||
====Counties of residence for women | |||
<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,213: | Line 1,284: | ||
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". } | |||
} | |||
GROUP BY ?county ?countyLabel | |||
ORDER BY DESC(?county_count) | |||
</sparql> | |||
====Counties of residence for women who exhibited at RAI meetings, sorted by how many residences all women had in that county==== | |||
<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 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 ?county ?countyLabel (count(?county) as ?county_count) #count number of counties in which women lived | |||
WHERE { | |||
?person bnwdt:P3 bnwd:Q3 . # select women | |||
?person bnwdt:P13 bnwd:Q29 . #select women who exhibited at RAI Meeting | |||
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 | |||
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,257: | Line 1,338: | ||
#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 ?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:P29 ?residence . # select residences | ?person bnwdt:P29 ?residence . # select residences | ||
?residence bnwdt:P33 ?district . #select districts | ?residence bnwdt:P33 ?district . #select districts | ||
Line 1,277: | Line 1,357: | ||
SERVICE <https://query.wikidata.org/sparql> { | SERVICE <https://query.wikidata.org/sparql> { | ||
optional { ?wikidata wdt:P625 ?geo1 . } # geocoords if available | optional { | ||
} # /wikidata service | ?wikidata wdt:P625 ?geo1 . | ||
BIND(geof:longitude(?geo1) AS ?long) | |||
BIND(geof:latitude(?geo1) AS ?lat) | |||
} # geocoords if available | |||
} # /wikidata service | |||
} #/wikidata optional | } #/wikidata optional | ||
Line 1,287: | Line 1,371: | ||
</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,299: | Line 1,384: | ||
#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,327: | Line 1,412: | ||
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,344: | Line 1,427: | ||
#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,349: | Line 1,433: | ||
?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,373: | Line 1,457: | ||
</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,390: | Line 1,468: | ||
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 | |||
?residence bnwdt:P33 ?district . #select districts | |||
?district bnwdt:P33 ?county . #select counties | |||
?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 bnwdt:P153 ?geo2 . } # for geocoords added to BN | ||
Line 1,432: | Line 1,488: | ||
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,455: | Line 1,513: | ||
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,485: | Line 1,560: | ||
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( | 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,547: | Line 1,625: | ||
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 | ||
?person bnp:P29 ?s . # resided at | 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 | |||
?s bnps:P29 ?london . | ?s bnps:P29 ?london . | ||
?london bnwdt:P33+ bnwd:Q322 . # in Q322 greater london. | ?london bnwdt:P33+ bnwd:Q322 . # in Q322 greater london. | ||
Line 1,593: | Line 1,700: | ||
} | } | ||
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,607: | Line 1,717: | ||
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,660: | Line 1,776: | ||
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],en,en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | |||
group by ?person ?personLabel ?residenceLabel ?residence ?geo | |||
ORDER BY ?geo | |||
</sparql> | |||
=== BN people and other things located near Devizes === | |||
<sparql tryit="1"> | |||
## testing use of geof:distance | |||
#title:BN items located within 30 km of Devizes, Wiltshire | |||
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 | |||
SELECT distinct ?item ?itemLabel ?locationLabel ?location ?wikidata ?wd_geo ?wd_long ?wd_lat | |||
WHERE { | |||
{?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 | |||
{?item bnwdt:P2 ?location . } # item has property P2 location | |||
# any other possibles ? | |||
## limit to places in admin territory p33 england q617. (keep numbers down to avoid wikidata timing out) | |||
?location bnwdt:P33+ bnwd:Q617. | |||
?location bnwdt:P117 ?ws . # wikidata id | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?ws))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
wd:Q1026699 wdt:P625 ?start. # devizes coordinates | |||
?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". } | |||
} | } | ||
ORDER BY ?locationLabel | ORDER BY ?locationLabel | ||
Line 1,963: | Line 2,133: | ||
</sparql> | </sparql> | ||
== | === IWD 2024 Map of five women's places === | ||
<sparql tryit="1"> | <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 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,978: | Line 2,147: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | 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 { | WHERE { | ||
?person bnwdt: | |||
VALUES (?person) {(bnwd:Q894) (bnwd:Q462) (bnwd:Q549) (bnwd:Q921) (bnwd:Q1053) } # | |||
?person ( bnp:P29 | bnp:P94 | bnp:P23 | bnp:P13 | bnp:P120 ) ?s . | |||
?s ( bnps:P29 | bnps:P94 | bnps:P23 | bnps:P13 | bnps:P120 ) ?place . | |||
?person ?p ?s . | |||
?prop wikibase:claim ?p; | |||
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 . | |||
} | |||
} | |||
optional { ?s bnpq:P2 ?qp1 . # P2 qualifier location has wikidata geocoords | |||
?qp1 bnwdt:P117 ?qws . | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?qws))) as ?qwikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?qwikidata wdt:P625 ?geo5 . | |||
} | |||
} | |||
optional { ?s bnpq:P78 ?ofp1 . # 'of' (organisation) has geocoords in P2 qualifier | |||
?ofp1 bnp:P2 ?ofp1_s . | |||
?ofp1_s bnps:P2 ?ofp1_p . | |||
?ofp1_s bnpq:P153 ?geo6 . } | |||
optional { ?s bnpq:P78 ?ofp2 . # 'of' (organisation) P2 location has wikidata geocoords | |||
?ofp2 bnwdt:P2 ?ofp2_p . | |||
?ofp2_p bnwdt:P117 ?ofl2ws . | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?ofl2ws))) as ?ofl2wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?ofl2wikidata wdt:P625 ?geo7 . } | |||
} | |||
optional { ?s bnpq:P78 ?ofp3 . # 'of' (organisation) has wikidata geocoords | |||
?ofp3 bnwdt:P117 ?ofpws . # wikidata id P117 | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?ofpws))) as ?ofpwikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?ofpwikidata wdt:P625 ?geo8 . } | |||
} | |||
optional { ?place bnwdt:P153 ?geo9 . } # main geocoords (mainly london postal districts - should be last resort as v broad.) | |||
optional { ?place bnwdt:P2 ?linked_p10 . # linked place main geocoords | |||
?linked_p10 bnwdt:P153 ?geo10 . | |||
} | |||
BIND(COALESCE(?geo1, ?geo2, ?geo3, ?geo4, ?geo5, ?geo6, ?geo7, ?geo8, ?geo9, ?geo10) AS ?geo). # if geo1 available use that, then geo2, etc, in order of preference | |||
bind(coalesce(?linked_p1, ?linked_p2, ?qp1, ?ofp1, ?ofp2, ?ofp3 ) as ?loc2). # hopefully get extra context where place is just sthg like "meeting". though exactly what will be variable! | |||
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 ?personLabel ?date ?placeLabel | |||
</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,003: | Line 2,257: | ||
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 ? | group by ?wd_io ?wd_io_label | ||
order by ?wd_io_label | |||
</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,031: | Line 2,298: | ||
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,069: | Line 2,325: | ||
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 | ||
?person bnwdt:P3 bnwd:Q3 . | 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". } | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} | } | ||
group by ?person ?personLabel | group by ?person ?personLabel ?birthname | ||
ORDER BY | ORDER BY ?personLabel | ||
</sparql> | </sparql> | ||
=== | ===Where women in our data are in wikidata, their spouses, fathers, and mothers according to wikidata=== | ||
<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 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/> | ||
SELECT | 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 { | WHERE { | ||
? | ?person bnwdt:P3 bnwd:Q3 . #select women | ||
FILTER NOT EXISTS {? | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
? | ?person bnp:P117 ?wikidata_ID . #look for wikidata ID on person page | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb | ?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],en-gb". } | |||
} | } | ||
ORDER BY ?personLabel | ORDER BY ?personLabel | ||
# with thanks to @tagishsimon for writing this one initially! | |||
</sparql> | </sparql> | ||
=== | ===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 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/> | ||
Line 2,156: | Line 2,390: | ||
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) | |||
(count(distinct ?position) as ?positions) | |||
(count(distinct ?speaker) as ?spoke) | |||
(count(distinct ?attended) as ?attendance) | |||
(count(distinct ?donorof) as ?donated) | |||
(count(distinct ?wasdelegate) as ?delegate) | |||
(count(distinct ?correspondent) as ?correspondents) | |||
(count(distinct ?fellow) as ?fellowships) | |||
(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". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | ||
} | } | ||
ORDER BY ? | 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=== | |||
=== Women | |||
<sparql tryit="1"> | <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 bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | ||
SELECT ?org ?orgLabel ?rgb ?linkTo ?linkToLabel | |||
SELECT ? | |||
WHERE { | WHERE { | ||
? | ?linkTo bnwdt:P3 bnwd:Q3 . #select women | ||
FILTER NOT EXISTS {? | 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> | </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/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 2,253: | Line 2,476: | ||
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 ?organisation ?organisationLabel (count(?organisation) as ?organisation_count) #count number of organisations that women were members of | |||
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:P67 ?organisation . # selection people who were members of organisations and what those organisations were | |||
FILTER NOT EXISTS {?person bnwdt:P67 bnwd:Q35 .} # filter out Royal Archaeological Institute | |||
?person | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb | |||
} | } | ||
GROUP BY ?organisation ?organisationLabel | |||
ORDER BY DESC(?organisation_count) | |||
</sparql> | |||
==Education== | |||
=== | ===Women educated at a tertiary educational institution located in Oxford or Cambridge=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | # Women educated at a tertiary educational institution located in Oxford or Cambridge | ||
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,295: | Line 2,505: | ||
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 ?woman ?womanLabel ?educationalinstitution ?educationalinstitutionLabel ?location ?locationLabel | |||
WHERE { | 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: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, "Cambridge$", "i")) .} | |||
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 ?womanLabel | |||
</sparql> | </sparql> | ||
===Women | === Women who were FSAs who went to Oxford or Cambridge colleges === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#how many women who were FSAs went to Oxford or Cambridge colleges? | |||
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,338: | Line 2,543: | ||
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 | PREFIX bnpsv: <https://beyond-notability.wikibase.cloud/prop/statement/value/> | ||
SELECT ?person ?personLabel ? | SELECT ?person ?personLabel ?college ?collegeLabel ?universityLabel | ||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . | ?person bnwdt:P3 bnwd:Q3 . #select women | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
?person bnwdt:P75 bnwd:Q8. # only BN subjects having a FSA | |||
# educated at (P94) part of (P4) cambridge (Q1181) oxford (Q364) | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | |||
?person bnwdt:P94 ?college . | |||
?college bnwdt:P4 ?university . | |||
FILTER ( ?university in ( bnwd:Q1181 , bnwd:Q364 ) ) | |||
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en".} | |||
} | } | ||
order by ?personLabel ?collegeLabel | |||
</sparql> | </sparql> | ||
=== | === All women who went to tertiary education institutions and dates where available === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
Line 2,364: | Line 2,574: | ||
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 | PREFIX bnpsv: <https://beyond-notability.wikibase.cloud/prop/statement/value/> | ||
PREFIX | PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | ||
SELECT ?person ?personLabel ?college ?collegeLabel ?university ?universityLabel ?date ?date_label | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . | ?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 .} | |||
# note: academic degree is P59. possible extra info? | |||
?person bnp:P94 ?s . # educated at | |||
?s bnps:P94 ?college . | |||
optional {?college bnwdt:P4 ?university . } # a few ?college aren't part of (P4) a ?university | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ?college bnwdt:P12 bnwd:Q2914 . # tertiary ed inst | ||
# dates. | |||
optional { | |||
?s ?pq ?date . | |||
?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 | |||
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en".} | |||
} | } | ||
order by ?personLabel ?collegeLabel ?date | |||
</sparql> | </sparql> | ||
=== | |||
=== Academic degrees === | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# Fetch academic degrees for women, with date and conferring institution where available | |||
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,391: | Line 2,616: | ||
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 | PREFIX bnpsv: <https://beyond-notability.wikibase.cloud/prop/statement/value/> | ||
PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | |||
PREFIX | |||
SELECT distinct ?person ?personLabel ?degree ?degreeLabel ?by ?byLabel ?date ?date_label | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . #select women | |||
? | FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | ||
? | |||
# | # academic degree = P59. | ||
?person bnp:P59 ?s . | |||
?s bnps:P59 ?degree . # type of degree | |||
# optional qualifiers for degree | |||
# P61 conferred by | |||
optional { ?s bnpq:P61 ?by . } | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | # date with type | ||
optional { | |||
?s ?pq ?date . | |||
?qual_prop wikibase:qualifier ?pq; | |||
wikibase:propertyType wikibase:Time ; # nb excludes edtf dates | |||
rdfs:label ?date_label . filter(lang(?date_label)="en-gb") . # kind of date | |||
} # /dates | |||
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en".} | |||
} | } | ||
order by ?personLabel ?date ?degreeLabel | |||
</sparql> | </sparql> | ||
=== | ==IDs== | ||
===Women in the wiki (excluding the project team) and their corresponding IDs - where they exist - on wikidata, viaf, WorldCat Identities, and the Archaeology Data Service=== | |||
<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,442: | Line 2,662: | ||
PREFIX wd: <http://www.wikidata.org/entity/> | PREFIX wd: <http://www.wikidata.org/entity/> | ||
SELECT ?person ?personLabel ? | SELECT ?person ?personLabel ?wikidata_ID ?viaf_ID ?ads_ID ?worldcat_ID | ||
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 | ||
OPTIONAL {?person bnwdt:P117 ?wikidata_ID .} #return wikidata ID | |||
OPTIONAL {?person bnwdt:P119 ?viaf_ID .} #return VIAF ID | |||
OPTIONAL {?person bnwdt:P34 ?ads_ID .} #return Archaeological Data Service ID | |||
OPTIONAL {?person bnwdt:P118 ?worldcat_ID .} #return WorldCat Identities ID | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
ORDER BY ?personLabel | ORDER BY ?personLabel | ||
</sparql> | </sparql> | ||
===FSAs in the wiki (excluding the project team) and their corresponding IDs - where they exist - on wikidata, viaf, WorldCat Identities, and the Archaeology Data Service=== | |||
=== | |||
<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,481: | Line 2,688: | ||
PREFIX wd: <http://www.wikidata.org/entity/> | PREFIX wd: <http://www.wikidata.org/entity/> | ||
SELECT ?person ?personLabel | SELECT ?person ?personLabel ?wikidata_ID ?viaf_ID ?ads_ID ?worldcat_ID | ||
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 | ?person bnwdt:P16 ?FSA . #select FSA | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | |||
OPTIONAL {?person bnwdt:P117 ?wikidata_ID .} #return wikidata ID | |||
OPTIONAL {?person bnwdt:P119 ?viaf_ID .} #return VIAF ID | |||
OPTIONAL {?person bnwdt:P34 ?ads_ID .} #return Archaeological Data Service ID | |||
OPTIONAL {?person bnwdt:P118 ?worldcat_ID .} #return WorldCat Identities ID | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
Line 2,502: | Line 2,702: | ||
</sparql> | </sparql> | ||
=== | ===People with IDs on wikidata, their date of birth on wikidata, and the source(s) of that information=== | ||
<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,516: | Line 2,714: | ||
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | PREFIX wdt: <http://www.wikidata.org/prop/direct/> | ||
PREFIX wd: <http://www.wikidata.org/entity/> | PREFIX wd: <http://www.wikidata.org/entity/> | ||
PREFIX p: <http://www.wikidata.org/prop/> | |||
PREFIX pr: <http://www.wikidata.org/prop/reference/> | |||
PREFIX prov: <http://www.w3.org/ns/prov#> | |||
SELECT ? | SELECT ?woman ?womanLabel ?WDitem ?WDdateOfBirth (GROUP_CONCAT(?BirthStatedInEnglish;separator=" | ") AS ?sources) | ||
WHERE { | WHERE { | ||
? | #Select all women | ||
?woman bnwdt:P3 bnwd:Q3 . | |||
#select all women that have a Wikidata link | |||
?woman bnwdt:P117 ?Qnumber . | |||
#create reference to Wikibase entity | |||
BIND(IRI(concat("http://www.wikidata.org/entity/", ?Qnumber)) as ?WDitem ) | |||
#on Wikibase do | |||
SERVICE <https://query.wikidata.org/sparql> { | SERVICE <https://query.wikidata.org/sparql> { | ||
? | #get the date of birth | ||
? | ?WDitem wdt:P569 ?WDdateOfBirth . | ||
} | #get the statement of birth | ||
?WDitem p:P569 ?Birthstatement . | |||
#get its node | |||
?Birthstatement prov:wasDerivedFrom ?BirthRefnode. | |||
#get the value of 'Stated in' | |||
?BirthRefnode pr:P248 ?BirthStatedIn. | |||
#get the english label of the referece 'stated in' | |||
OPTIONAL {?BirthStatedIn rdfs:label ?BirthStatedInEnglish | |||
FILTER (LANG(?BirthStatedInEnglish) = "en")}. | |||
} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | ||
} | } | ||
ORDER BY ? | GROUP BY ?woman ?womanLabel ?WDitem ?WDdateOfBirth | ||
ORDER BY ?womanLabel | |||
# Credit to Maarten Zeinstra for developing this query | |||
</sparql> | </sparql> | ||
=== | === Which women in the wikibase have Wikipedia articles, according to Wikidata?=== | ||
<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,549: | Line 2,760: | ||
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 | PREFIX wdt: <http://www.wikidata.org/prop/direct/> | ||
PREFIX | PREFIX wd: <http://www.wikidata.org/entity/> | ||
SELECT | SELECT ?person ?personLabel ?wikidata ?wikipedia | ||
WHERE { | |||
?person bnwdt:P3 bnwd:Q3 . #select women | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | |||
?person bnwdt:P117 ?wikidata_ID . #look for wikidata ID on person page | |||
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> { | |||
# get English language wikipedia articles in wikidata entries, where listed | |||
OPTIONAL { | |||
?wikipedia schema:about ?wikidata . | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE] | ?wikipedia schema:inLanguage 'en' . | ||
FILTER (SUBSTR(str(?wikipedia), 1, 25) = 'https://en.wikipedia.org/') | |||
} | |||
} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | |||
} | } | ||
ORDER BY ?personLabel | |||
</sparql> | </sparql> | ||
=== | |||
=== Women with no date of death in our wikibase who have a date of death on Wikidata=== | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | # Women who have no date of death in our wikibase and have a date of death on Wikidata | ||
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,597: | Line 2,802: | ||
PREFIX wd: <http://www.wikidata.org/entity/> | PREFIX wd: <http://www.wikidata.org/entity/> | ||
SELECT ? | SELECT ?person ?personLabel ?wd_dod | ||
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 | ||
filter not exists {?person bnwdt:P15 ?bn_dod . } # *don't* have P15 date of death | |||
?person bnwdt:P117 ?wikidata_ID . #look for wikidata ID on person page | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_ID))) as ?item) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?item wdt:P21 ?WD_gender. #get gender of person | |||
?item wdt:P570 ?wd_dod . #date of death on Wikidata P570 | |||
} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE] | |||
} | } | ||
ORDER BY ?personLabel | |||
ORDER BY | |||
</sparql> | </sparql> | ||
=== Women with | === Women with no date of birth in our wikibase who have a date of birth in Wikidata=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | # Women who have no date of birth in our wikibase and have a date of birth on Wikidata | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 2,634: | Line 2,835: | ||
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 | PREFIX wdt: <http://www.wikidata.org/prop/direct/> | ||
PREFIX | PREFIX wd: <http://www.wikidata.org/entity/> | ||
SELECT | SELECT ?person ?personLabel ?wd_dob | ||
WHERE { | |||
?person bnwdt:P3 bnwd:Q3 . #select women | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | |||
filter not exists {?person bnwdt:P26 ?bn_dob . } # *don't* have P15 date of death | |||
?person bnwdt:P117 ?wikidata_ID . #look for wikidata ID on person page | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_ID))) as ?item) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?item wdt:P21 ?WD_gender. #get gender of person | |||
?item wdt:P569 ?wd_dob . #date of birth on Wikidata P569 | |||
} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE] | |||
} | } | ||
ORDER BY ?personLabel | |||
</sparql> | </sparql> | ||
=== Women | === All external IDs on Wikidata for Women === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# Query to fetch | # Query to fetch all available External IDs on Wikidata for FSAs | ||
# NB this | # NB this will take a while, but it should finish. | ||
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,676: | Line 2,873: | ||
PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | ||
SELECT distinct ?person ?personLabel ?wikidata ?id_no ? | SELECT distinct ?person ?personLabel ?wikidata ?p ?id_no ?id_label | ||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . #select women | ?person bnwdt:P3 bnwd:Q3 . #select women | ||
#?person bnwdt:P75 bnwd:Q8. # limit to FSAs if the full set times out. | |||
?person bnwdt:P117 ?wikidata_ID . #get wikidata ID | ?person bnwdt:P117 ?wikidata_ID . #get 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 ?p ?s . | ?wikidata ?p ?s . | ||
?prop wikibase:claim ?p; | ?prop wikibase:claim ?p; | ||
wikibase:statementProperty ?ps; | wikibase:statementProperty ?ps; # NB rather than statementValue | ||
wikibase:propertyType wikibase:ExternalId. | wikibase:propertyType wikibase:ExternalId. # quicker than filter. | ||
?s ps | ?prop rdfs:label ?id_label. filter(lang(?id_label)="en") . # ident name | ||
?s ?ps ?id_no . # id value | |||
# filter by property type | |||
#filter(?prop_type in (wikibase:ExternalId ) ) . | |||
} | } | ||
Line 2,699: | Line 2,900: | ||
} | } | ||
order by ?personLabel ?id_no | order by ?personLabel ?id_label ?id_no | ||
</sparql> | </sparql> | ||
=== | === What external IDs are available in Wikidata for women in the BN database? === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# All the external IDs on BN women's Wikidata pages, with counts and descriptions | |||
# | |||
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,717: | Line 2,915: | ||
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 wdt: <http://www.wikidata.org/prop/direct/> | |||
PREFIX wd: <http://www.wikidata.org/entity/> | |||
SELECT | SELECT ?p ?id_label ?id_description (count(?p) as ?count) | ||
WHERE { | WHERE { | ||
? | ?person bnwdt:P3 bnwd:Q3 . #select women | ||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | |||
?person bnwdt:P117 ?wikidata_ID . # wikidata ID | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_ID))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?wikidata ?p ?s . | |||
?prop wikibase:claim ?p; | |||
wikibase:propertyType wikibase:ExternalId; | |||
rdfs:label ?id_label. filter(lang(?id_label)="en") . | |||
?prop schema:description ?id_description . | |||
filter(lang(?id_description) = "en") . | |||
} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en, en-gb". } | |||
} | } | ||
group by ?p ?id_label ?id_description | |||
ORDER BY desc(?count) | |||
</sparql> | </sparql> | ||
=== | === Women with ODNB IDs in Wikidata === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | # BN women with ODNB biography IDs on Wikidata, with links to the bios | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 2,762: | Line 2,955: | ||
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 ?wikidata ?url | ||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . #select women | |||
?person bnwdt:P117 ?wikidata_ID . #get wikidata ID | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_ID))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
# P1415 Oxford Dictionary of National Biography ID | P6829 Dictionary of Irish Biography ID | P1648 Dictionary of Welsh Biography ID | |||
?wikidata wdt:P1415 ?id . | |||
# odnb link | |||
BIND(IRI(concat("https://doi.org/10.1093/ref:odnb/", ?id)) as ?url ) . | |||
} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en, en-gb". } | |||
} | } | ||
order by ? | |||
order by ?personLabel ?id | |||
</sparql> | </sparql> | ||
=== Women with National Portrait Gallery links via Wikidata === | |||
=== | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | # Query to fetch National Portrait Gallery IDs on Wikidata for BN women, with links | ||
# NB this may be a bit slow... | |||
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,806: | Line 2,994: | ||
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 distinct ? | SELECT distinct ?person ?personLabel ?wikidata ?id_no ?npg_url | ||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . #select women | |||
?person bnwdt:P117 ?wikidata_ID . #get wikidata ID | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_ID))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?wikidata ?p ?s . | |||
?prop wikibase:claim ?p; | |||
wikibase:statementProperty ?ps; | |||
wikibase:propertyType wikibase:ExternalId. | |||
?s ps:P1816 ?id_no . # id value | |||
# npg link | |||
BIND(IRI(concat("https://www.npg.org.uk/collections/search/person/", ?id_no)) as ?npg_url ) . | |||
} | |||
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 ? | |||
order by ?personLabel ?id_no | |||
</sparql> | </sparql> | ||
=== | === Which BN properties map on to Wikidata properties? === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | ## **NOTES** | ||
# | ## a few properties have a linked wikidata "Q" rather than "P" ID. These will unfortunately not link correctly to Wikidata so wd_label/wd_description won't be present. | ||
## a few other properties may have wikidata=yes but no wd_label and/or wd_description. This could be because the property on Wikidata has been deleted (eg performed at). | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 2,862: | Line 3,039: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT | SELECT DISTINCT ?property (if(bound(?wikidata_id), "yes", "no") as ?has_wikidata) ?bn_label ?wd_label ?bn_description | ||
?wd_description ?wikidata ?bn_propertyType | |||
WHERE { | WHERE { | ||
?property a wikibase:Property ; | |||
wikibase:propertyType ?bn_propertyType . # datatype | |||
? | service wikibase:label { | ||
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en". | |||
?property rdfs:label ?bn_label . | |||
?property schema:description ?bn_description . | |||
} | |||
# wikidata P117 | |||
optional { | |||
?property bnwdt:P117 ?wikidata_id . | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_id))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en". | |||
?wikidata schema:description ?wd_description . | |||
?wikidata rdfs:label ?wd_label . | |||
} # / label service | |||
} # /wikidata service | |||
} #/wikidata optional | |||
} | } | ||
order by ?bn_label | |||
order by ? | |||
</sparql> | </sparql> | ||
==== Of these, which are properties for public and professional activities? ==== | |||
== | |||
= | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# which properties have corresponding wikidata IDs, restricted to instance of PPA (P12 / Q151) | |||
# | ## **NOTES** | ||
# a | ## a few properties have a linked wikidata "Q" rather than "P" ID. These will unfortunately not link correctly to Wikidata so wd_label/wd_description won't be present. | ||
## a few other properties may have wikidata=yes but no wd_label and/or wd_description. This could be because the property on Wikidata has been deleted (eg performed at). | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 2,927: | Line 3,083: | ||
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 DISTINCT ?property (if(bound(?wikidata_id), "yes", "no") as ?has_wikidata) ?bn_label ?wd_label ?bn_description | ||
?wd_description ?wikidata ?bn_propertyType | |||
WHERE { | WHERE { | ||
?property a wikibase:Property ; | |||
wikibase:propertyType ?bn_propertyType . # datatype | |||
? | |||
service wikibase:label { | |||
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en". | |||
?property rdfs:label ?bn_label . | |||
?property schema:description ?bn_description . | |||
} | |||
# wikidata P117 | |||
optional { ?property bnwdt:P117 ?wikidata_id . | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_id))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en". | |||
?wikidata schema:description ?wd_description . | |||
?wikidata rdfs:label ?wd_label . | |||
} # / label service | |||
} # /wikidata service | |||
} #/wikidata optional | |||
?property bnwdt:P12 bnwd:Q151. # instance of PPA | |||
} | |||
order by ?bn_label | |||
</sparql> | |||
=== Archaeological sites/Historic houses and their owners/operators in Wikidata === | |||
<sparql tryit="1"> | |||
#title:archaeological sites/historic houses in wikidata | |||
<sparql tryit="1"> | |||
#title: | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 2,988: | Line 3,127: | ||
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 distinct ?item ?itemLabel ?instanceLabel ?wikidata ?wd_owner_label ?wd_operator_label ?wd_member_label #?wd_owner ?wd_operator | ||
WHERE { | WHERE { | ||
{ ?item bnwdt:P12 bnwd:Q86 . } # instance of archaeological site | |||
union | |||
{ ?item bnwdt:P12 bnwd:Q2961 . } # instance of historic house | |||
?item bnwdt:P12 ?instance . # which instance of is it | |||
filter ( ?instance in (bnwd:Q86, bnwd:Q2961) ) . # (need filter as a few have multiple instance of) | |||
SERVICE <https://query.wikidata.org/sparql> { | ?item bnwdt:P117 ?wikidata_id . | ||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_id))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
optional { ?wikidata wdt:P127 ?wd_owner .} # can be individuals and multiple. | |||
optional { ?wikidata wdt:P137 ?wd_operator . } | |||
optional { ?wikidata wdt:P463 ?wd_member . } | |||
## at least some had *both* owned by *and* operator, but not always the case. | |||
## owned by P127 / operator P137 | |||
## English Heritage Q936287 National Trust (Q333515) | |||
## member of P463 Historic Houses Association (Q5773523) | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en, en-gb". } | # automatic *Label doesn't work with a federated query; rdfs:label instead. | ||
SERVICE wikibase:label { | |||
bd:serviceParam wikibase:language "en". | |||
?wd_owner rdfs:label ?wd_owner_label. | |||
?wd_operator rdfs:label ?wd_operator_label. | |||
?wd_member rdfs:label ?wd_member_label. | |||
} | |||
} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} | } | ||
order by ?itemLabel | |||
order by ? | |||
</sparql> | </sparql> | ||
=== | ==== And which are owned/operated by English Heritage/National Trust or belong to Historic Houses Association ==== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | |||
# archaeological site or historic house. | |||
# pull together via Wikidata which ones are owned/operated by 1) English Heritage 2) National Trust or 3) affiliated to Historic Houses association | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 3,030: | Line 3,183: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT distinct ? | SELECT distinct ?item ?itemLabel ?instanceLabel ?wikidata ?wd_owner_label ?wd_operator_label ?wd_member_label #?wd_owner ?wd_operator | ||
WHERE { | |||
WHERE { | |||
{ ?item bnwdt:P12 bnwd:Q86 . } | |||
union | |||
{ ?item bnwdt:P12 bnwd:Q2961 . } | |||
?item bnwdt:P12 ?instance . | |||
filter ( ?instance in (bnwd:Q86, bnwd:Q2961) ) . | |||
?item bnwdt:P117 ?wikidata_id . | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_id))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
optional { ?wikidata wdt:P127 ?wd_owner .} | |||
optional { ?wikidata wdt:P137 ?wd_operator . } | |||
optional { ?wikidata wdt:P463 ?wd_member . } | |||
# filter: owner or operator = EH/NT / member of HHA | |||
filter ( ?wd_owner in (wd:Q936287, wd:Q333515) || | |||
?wd_operator in (wd:Q936287, wd:Q333515) || | |||
?wd_member = wd:Q5773523 ) . | |||
## owned by P127 / operator P137 | |||
## ENglish Heritage Q936287 National Trust (Q333515) | |||
## member of P463 Historic Houses Association (Q5773523) | |||
SERVICE wikibase:label { | |||
bd:serviceParam wikibase:language "en". | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en, en-gb". } | ?wd_owner rdfs:label ?wd_owner_label. | ||
?wd_operator rdfs:label ?wd_operator_label. | |||
?wd_member rdfs:label ?wd_member_label. | |||
} | |||
} | |||
#} # /optional for wikidata ID | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | |||
} | } | ||
order by ?itemLabel | |||
</sparql> | </sparql> | ||
==== | |||
== Men == | |||
=== BN Men in Wikidata === | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title: | |||
# | #title: BN men in Wikidata | ||
# a starting point to get the basic query set up; can easily add more variables... | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 3,080: | Line 3,248: | ||
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 distinct ?person ?personLabel ?wikidata ?whos_who ?odnb_url ?wikipedia ?wd_dob ?wd_dod ?wd_stmts | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q10 . #select men | |||
?person bnwdt:P117 ?wikidata_ID . #get 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 wikibase:statements ?wd_stmts . | |||
=== BN | optional { | ||
# P1415 Oxford Dictionary of National Biography ID | couls also add P6829 Dictionary of Irish Biography ID | P1648 Dictionary of Welsh Biography ID | |||
?wikidata wdt:P1415 ?odnb_id . | |||
# odnb link | |||
BIND(IRI(concat("https://doi.org/10.1093/ref:odnb/", ?odnb_id)) as ?odnb_url ) . | |||
} #/ odnb | |||
# English language wikipedia articles in wikidata entries, where listed | |||
OPTIONAL { | |||
?wikipedia schema:about ?wikidata . | |||
?wikipedia schema:inLanguage 'en' . | |||
FILTER (SUBSTR(str(?wikipedia), 1, 25) = 'https://en.wikipedia.org/') | |||
} | |||
optional { ?wikidata wdt:P4789 ?whos . | |||
bind(iri(concat("https://www.ukwhoswho.com/view/article/oupww/whoswho/", ?whos)) as ?whos_who) . | |||
} # P4789 Who's Who | |||
optional { ?wikidata wdt:P569 ?wd_dob . } #date of birth on Wikidata P569 | |||
optional { ?wikidata wdt:P570 ?wd_dod . } #date of death on Wikidata P570 | |||
} #/ wikidata | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en, en-gb". } | |||
} | |||
order by ?personLabel | |||
</sparql> | |||
=== What sort of info Wikidata has about BN men === | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title: BN | |||
#title: what info is there for BN men in Wikidata | |||
#counts of properties (excluding external IDs, of which there are gazillions) (Counts are overall and some people might have more than one.) | |||
#at time of writing there are 198 linked men. | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 3,120: | Line 3,309: | ||
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 ?prop_label ?prop (count(?prop) as ?count) | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q10 . #select men 211. | |||
? | ?person bnwdt:P117 ?wikidata_ID . #get 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 ?p ?s . | |||
?prop wikibase:claim ?p; | |||
wikibase:propertyType ?prop_type ; | |||
wikibase:statementProperty ?ps. | |||
?prop rdfs:label ?prop_label. filter(lang(?prop_label)="en") . | |||
filter(?prop_type in (wikibase:Time, wikibase:WikibaseItem ) ) . | |||
# also a few quantity, string, monolingualtext | |||
} #/ wikidata | |||
} #/ wikidata | |||
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 ?prop_label ?prop | |||
order by ?prop_label | |||
</sparql> | </sparql> | ||
=== BN Men in Wikidata: men who proposed elections to SAL/RAI === | |||
=== BN Men who proposed | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:Men who | #title:Men who proposed for SAL/RAI elections who are in Wikidata | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 3,172: | Line 3,351: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT distinct ?proposerLabel ?proposer ?wikidata ?odnb_url ?wikipedia ?wd_dob ?wd_dod | |||
SELECT | |||
WHERE { | WHERE { | ||
?person (bnp:P16 | bnp:P7) ?s . # proposed to either SAL or RAI | |||
? | ?s (bnps:P16 | bnps:P7) ?proposer . | ||
?proposer bnwdt:P3 bnwd:Q10 . | |||
?proposer bnwdt:P117 ?wikidata_ID . #get wikidata ID | |||
? | bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_ID))) as ?wikidata) . | ||
SERVICE <https://query.wikidata.org/sparql> { | |||
optional { | |||
# P1415 Oxford Dictionary of National Biography ID | |||
?wikidata wdt:P1415 ?odnb_id . | |||
BIND(IRI(concat("https://doi.org/10.1093/ref:odnb/", ?odnb_id)) as ?odnb_url ) . # make odnb link | |||
} #/ odnb | |||
# could also add: P6829 Dictionary of Irish Biography ID | P1648 Dictionary of Welsh Biography ID | |||
# English language wikipedia articles in wikidata entries, where listed | |||
OPTIONAL { | |||
?wikipedia schema:about ?wikidata . | |||
?wikipedia schema:inLanguage 'en' . | |||
FILTER (SUBSTR(str(?wikipedia), 1, 25) = 'https://en.wikipedia.org/') | |||
} | |||
# there will be a few duplicates here... | |||
optional { ?wikidata wdt:P569 ?wd_dob . } #date of birth on Wikidata P569 | |||
optional { ?wikidata wdt:P570 ?wd_dod . } #date of death on Wikidata P570 | |||
} #/ 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 ?proposerLabel | |||
ORDER BY | |||
</sparql> | </sparql> | ||
== | ==== Male proposers who have occupations data in Wikidata==== | ||
= | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | #title:Men who proposed for SAL/RAI elections who have occupation(s) in wikidata | ||
# with occupation labels, which was slightly trickier than expected | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | |||
PREFIX | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
PREFIX | PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | ||
PREFIX | PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | ||
PREFIX | PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | ||
PREFIX | PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | ||
PREFIX | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT | SELECT distinct ?personLabel ?proposerLabel | ||
? | (group_concat(distinct ?wd_label; SEPARATOR="; ") as ?proposer_occupations) | ||
? | ?wikidata ?person ?proposer | ||
? | WHERE { | ||
?person (bnp:P16 | bnp:P7) ?s . # proposed to either SAL or RAI | |||
? | ?s (bnps:P16 | bnps:P7) ?proposer . | ||
?proposer bnwdt:P3 bnwd:Q10 . | |||
?proposer bnwdt:P117 ?wikidata_ID . #get wikidata ID | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_ID))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?wikidata wdt:P106 ?wd_occupation . | |||
# automatic *Label doesn't work with a federated query; this works instead. | |||
SERVICE wikibase:label { | |||
bd:serviceParam wikibase:language "en". | |||
?wd_occupation rdfs:label ?wd_label. | |||
} | |||
} #/ wikidata service | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en, en-gb". } | |||
} | |||
group by ?personLabel ?proposerLabel ?wikidata ?person ?proposer | |||
ORDER BY ?proposerLabel ?person | |||
</sparql> | |||
=== BN Men in Wikidata: Spouses === | |||
<sparql tryit="1"> | |||
#title: BN spouses who are in Wikidata | |||
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,272: | Line 3,442: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT distinct ?spouse ?spouseLabel ?wikidata ?odnb_url ?wikipedia ?wd_dob ?wd_dod | |||
? | WHERE { | ||
? | ?person bnwdt:P3 bnwd:Q3. | ||
? | ?person bnwdt:P41 ?spouse . | ||
? | |||
?spouse bnwdt:P117 ?wikidata_ID . #get wikidata ID | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_ID))) as ?wikidata) . | |||
? | |||
? | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
optional { | |||
# P1415 Oxford Dictionary of National Biography ID | |||
?wikidata wdt:P1415 ?odnb_id . | |||
BIND(IRI(concat("https://doi.org/10.1093/ref:odnb/", ?odnb_id)) as ?odnb_url ) . # make odnb link | |||
} #/ odnb | |||
# couls also add: P6829 Dictionary of Irish Biography ID | P1648 Dictionary of Welsh Biography ID | |||
# English language wikipedia articles in wikidata entries, where listed | |||
OPTIONAL { | |||
?wikipedia schema:about ?wikidata . | |||
?wikipedia schema:inLanguage 'en' . | |||
FILTER (SUBSTR(str(?wikipedia), 1, 25) = 'https://en.wikipedia.org/') | |||
} | |||
optional { ?wikidata wdt:P569 ?wd_dob . } #date of birth on Wikidata P569 | |||
optional { ?wikidata wdt:P570 ?wd_dod . } #date of death on Wikidata P570 | |||
} #/ wikidata service | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en, en-gb". } | |||
} | |||
ORDER BY ?proposerLabel | |||
</sparql> | |||
=== BN Men who proposed, seconded or signed for Women in SAL/RAI/RHS elections, with counts and wikidata IDs === | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | #title:Men who supported women (at least twice) for SAL/RAI/RHS election with Wikidata IDs | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 3,333: | Line 3,493: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
# p155, p156 - signed rhs | |||
# p32, p82 - signed sal| | |||
# p8 rai seconded | |||
SELECT ?supporterLabel ?supporter ?wikidata (count(?supporter) as ?supported) | |||
WHERE { | |||
?person bnwdt:P3 bnwd:Q3 . | |||
# | |||
# | { | ||
?person ( bnp:P155 | bnp:P156 | bnp:P16 | bnp:P7 ) ?s . # | |||
?s ( bnps:P155 | bnps:P156 | bnps:P16 | bnps:P7 ) ?supporter . # proposed SAL/RAI / signed RHS | |||
#?s ?prop ?supporter . | |||
} | |||
# union for qualifiers | |||
union | |||
{ | |||
?person ?p ?s . | |||
?s ( bnpq:P156 | bnpq:P155 | bnpq:P32 | bnpq:P82 | bnpq:P8 ) ?supporter . | |||
#?s ?prop ?supporter . | |||
} | |||
?supporter bnwdt:P3 bnwd:Q10 . # male | |||
optional { | |||
?supporter bnwdt:P117 ?wikidata_ID . #get wikidata ID | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_ID))) as ?wikidata) . | |||
} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en, en-gb". } | |||
} | |||
group by ?supporterLabel ?supporter ?wikidata | |||
having (?supported>2) | |||
ORDER BY desc(?supported) desc(?wikidata) | |||
</sparql> | |||
==Fishing Expeditions== | |||
===All properties in use in the wikibase with property type, label and description (if present)=== | |||
<sparql tryit="1"> | |||
# query for information about properties that are being used in the wikibase | |||
</ | ## fyi: not actually necessary to declare these properties | ||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | |||
PREFIX wikibase: <http://wikiba.se/ontology#> | |||
PREFIX schema: <http://schema.org/> | |||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> | |||
= | SELECT DISTINCT | ||
?property | |||
?propertyType | |||
?propertyLabel | |||
(group_concat(?propertyAltLabel; separator=" | ") as ?propertyAltLabels) | |||
?propertyDescription | |||
WHERE { | |||
?property a wikibase:Property ; | |||
rdfs:label ?propertyLabel ; # label | |||
wikibase:propertyType ?propertyType . # datatype | |||
# add alternative labels if present (can be multiple) | |||
OPTIONAL { ?property skos:altLabel ?propertyAltLabel . } | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | # add description if present | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | OPTIONAL { | ||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en". | ||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | ?property schema:description ?propertyDescription . | ||
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | } | ||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | } | ||
FILTER(LANG(?propertyLabel) = 'en-gb') | |||
# fix label language dups; but Q why doesn't SERVICE work? | |||
# A: https://en.wikibooks.org/wiki/SPARQL/FILTER#FILTER_on_values_in_Labels | |||
# nb a few objects found with en-gb label missing | |||
} | |||
group by ?property ?propertyLabel ?propertyType ?propertyDescription | |||
order by ?propertyLabel | |||
</sparql> | |||
=== All the Things for Organisations === | |||
<sparql tryit="1"> | |||
# Exploratory query to get all info on an item page including qualifiers (but not references) for each organisation (Q2316) in the wikibase | |||
# Initially this *only* fetched organisations that specifically have the instance of Q2316: I didn't realise for a while how many organisations don't directly reference Q2316. | |||
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 bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
select distinct ?item ?itemLabel | |||
?prop ?propLabel ?prop_type | |||
?stmt_value ?stmt_valueLabel | |||
?qual_prop ?qual_value ?qual_label ?qual_prop_type | |||
?statement | |||
where { | |||
?item bnwdt:P12+ bnwd:Q2316 . # instance of organisation or descendants of (excluding instance of organisation itself) | |||
# get all the things about ?item | |||
?item ?p ?statement . | |||
# to get item Label without using service. couple of missing en-gb labels somewhere | |||
# ?item rdfs:label ?item_label . filter(lang(?item_label)="en-gb") . | |||
# get | |||
# get stuff about ?p | |||
?prop wikibase:claim ?p; | |||
wikibase:statementProperty ?ps; # "Links property entity to statement simple value predicate" | |||
#wikibase:statementValue ?psv; # "Links property entity to statement full value predicate" | |||
wikibase:propertyType ?prop_type. | |||
# get stuff about ?statement | |||
?statement ?ps ?stmt_value. | |||
# get | # get any qualifiers | ||
optional { | |||
?statement ?qual_p ?qual_value . | |||
?qual_prop wikibase:qualifier ?qual_p; | |||
wikibase:propertyType ?qual_prop_type ; | |||
rdfs:label ?qual_label. filter(lang(?qual_label)='en-gb') . | |||
} | |||
# OPTIONAL { ?item skos:altLabel ?alt_label . } | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | |||
} | |||
order by ?item_label ?prop_label | |||
</sparql> | |||
=== | === 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,456: | Line 3,650: | ||
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 | |||
WHERE { ?person | 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: 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? | ||
## 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 | |||
## | |||
## https:// | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 3,503: | Line 3,719: | ||
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 ?item ?itemLabel ?location ?locationLabel (count(?item) as ?distance) | ||
WHERE { | WHERE { | ||
?item | ?item bnwdt:P12 bnwd:Q2316 . # instance of organisation. | ||
? | ?item bnwdt:P2* ?tmp . | ||
? | ?tmp bnwdt:P2+ ?location . # P2=30. P2+=34 | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb, en". } | |||
} | } | ||
ORDER BY ? | group by ?item ?itemLabel ?location ?locationLabel | ||
ORDER BY ?item ?distance | |||
</sparql> | </sparql> | ||
=== | === Working with property paths: instance of [CAVEAT: experimental, probably wrong]=== | ||
<sparql tryit="1"> | <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 bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 3,530: | Line 3,746: | ||
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 ?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 | |||
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> | |||
==Dates== | |||
===All the Dates for Women FSAs=== | |||
< | <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/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 3,579: | Line 3,777: | ||
PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | ||
SELECT ?person ?personLabel | SELECT distinct ?person ?personLabel ?prop_label ?qualLabel ?qual_dateLabel ?date_value ?s | ||
#?prop ?qual | |||
WHERE { | 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 | { # main dates | ||
# get dates detail via ?s and psv | |||
# gets edtf dates in simplified std wiki date format? | |||
?s ? | # https://github.com/ProfessionalWiki/WikibaseEdtf | ||
?s ?psv ?wdv . | |||
?wdv wikibase:timeValue ?date_value . | ?wdv wikibase:timeValue ?date_value . | ||
} # /main dates | |||
UNION | UNION | ||
{ # qualifier dates | { # 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-gb | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | ||
} # /where | } # /where | ||
ORDER BY ? | ORDER BY ?person ?prop_label ?date_value | ||
</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 | ||
# 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/> | ||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | ||
Line 3,621: | Line 3,843: | ||
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 { ?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 . | |||
?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"> | |||
# query for full values to access the timeValue and timePrecision of a date, in this case a date of birth. | |||
## 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 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,679: | Line 3,891: | ||
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 bnpsv: <https://beyond-notability.wikibase.cloud/prop/statement/value/> | ||
SELECT DISTINCT ?item ?itemLabel ?date ?precision | |||
WHERE { | 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> | </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 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,734: | Line 3,917: | ||
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/> | |||
SELECT ?person ?personLabel ? | SELECT DISTINCT ?person ?personLabel ?date_label ?date ?date_prop_type ?date_prop ?link_prop | ||
WHERE { | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} | |||
?person bnwdt:P3 bnwd:Q3 . # women | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} | |||
?person ?p ?s . | |||
?date_prop wikibase:claim ?p; | |||
wikibase:statementValue ?psv ; | |||
wikibase:propertyType ?date_prop_type; # property type = wikibase:Time OR wikibase:Edtf | |||
rdfs:label ?date_label. filter(lang(?date_label)="en-gb") . # what kind of date it is | |||
# direct link to relevant section of page | |||
BIND (REPLACE(STR(?date_prop), "^.*/([^/]*)$", "$1") as ?pid). | |||
bind(iri(concat(str(?person), "#", ?pid)) as ?link_prop ) . | |||
?s ?psv ?wdv . # for the date value | |||
?wdv wikibase:timeValue ?date . #timeValue gets pit and edtf | |||
# ?wdv wikibase:timePrecision ?date_precision . # optional | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language " | |||
# nb also possible to filter either/or time/edtf by property type | |||
# filter(?date_prop_type in (wikibase:Edtf, wikibase:Time ) ) . | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } | |||
} | } | ||
ORDER BY ?personLabel ?date | |||
</sparql> | </sparql> | ||
=== | === Counting Dates=== | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# | # count distinct dates for women (who have at least one) | ||
SELECT ? | # uncomment HAVING line for women with only one | ||
? | # CAVEAT: there may be some discrepancies between dates shown on wiki pages and dates returned by sparql | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | 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 ?person ?personLabel (COUNT(DISTINCT ?date_value) as ?count) | |||
WHERE { | |||
{ # main dates | |||
?person bnwdt:P3 bnwd:Q3 . # women | |||
?person ?p ?s . | |||
?s ?date_prop ?wdv . | |||
?wdv wikibase:timeValue ?date_value . | |||
} # /main dates | |||
UNION | |||
{ # qualifier dates | |||
?person bnwdt:P3 bnwd:Q3 . | |||
?person ?p ?s . | |||
?s ?date_prop ?pqv . | |||
?pqv wikibase:timeValue ?date_value. | |||
} # /qual dates | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en". } | |||
} # /where | |||
GROUP BY ?person ?personLabel | |||
# HAVING(?count=1) | |||
ORDER BY ?count ?person | |||
</sparql> | </sparql> | ||
=== | === Start dates that might not have accompanying end dates === | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:Women with start dates that might not have accompanying end dates | |||
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,844: | Line 4,011: | ||
PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | ||
SELECT distinct ? | SELECT distinct ?personLabel ?prop_label ?start_date (if(bound(?end_date), "yes", "no") as ?has_end_date) ?person ?s | ||
#(group_concat(?other_date_label; SEPARATOR=" | ") as ?other_dates) | |||
# | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . | |||
# need to find start times anywhere and get prop label so use claim. | |||
?person ?p ?s . | |||
?claim wikibase:claim ?p; | |||
rdfs:label ?prop_label. filter(lang(?prop_label)="en") . | |||
# pretty sure start time is qualifier only... | |||
# get start dates | |||
# then optional end dates | |||
# can only see end time/pit associated, and the only pit with start time is not relevant, but can't be sure that'll always be true. | |||
# optional other that excludes both start/end but lists any other date types | |||
?s bnpq:P27 ?start_date . # get start dates | |||
optional {?s bnpq:P28 ?end_date .} # check for end dates | |||
# optional { | |||
# ?s ?pq ?other_date . # could there be any other associated dates? | |||
# ?qual_prop wikibase:qualifier ?pq; | |||
# wikibase:propertyType wikibase:Time ; # nb *does not* include edtf dates but AFAICT there are none in qualifiers. | |||
# rdfs:label ?other_date_label . filter(lang(?other_date_label)="en-gb") . # what kind of date is it. | |||
# drop both start and end this time. idk if there could be a faster way to do this? | |||
# filter not exists { ?s (bnpq:P27 | bnpq:P28) ?other_date . } | |||
# } # / optional other dates | |||
# filter(!bound(?end_date)). # to filter out rows with an end date | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en". } | |||
} | |||
ORDER BY ?personLabel ?prop_label ?start_date | |||
</sparql> | </sparql> | ||
=== | |||
=== End dates that might not accompanying start dates === | |||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:Women with end dates that might not have accompanying start dates | |||
# | |||
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,893: | Line 4,068: | ||
PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | ||
SELECT | SELECT distinct ?personLabel ?prop_label ?end_date | ||
(if(bound(?start_date), "yes", "no") as ?has_start_date) | |||
(group_concat(?other_date_label; SEPARATOR=" | ") as ?other_dates) | |||
?person ?s | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . | |||
?person ?p ?s . | |||
?claim wikibase:claim ?p; | |||
rdfs:label ?prop_label. filter(lang(?prop_label)="en") . | |||
# get end dates | |||
# then optional start dates | |||
# can only see start time/pit associated, and in fact the only pit with start time is not relevant, but can't be sure that'll always be true. | |||
# so an optional other that excludes both start/end but lists any other date types with group_concat | |||
?s bnpq:P28 ?end_date . # get end dates | |||
optional {?s bnpq:P27 ?start_date .} # check for start dates | |||
optional { | |||
?s ?pq ?other_date . # could there be any other associated dates? | |||
?qual_prop wikibase:qualifier ?pq; | |||
wikibase:propertyType wikibase:Time ; # nb *does not* include edtf dates but AFAICT there are none in qualifiers. | |||
rdfs:label ?other_date_label . filter(lang(?other_date_label)="en-gb") . # what kind of date | |||
# drop both start and end. idk if there could be a faster way to do this? | |||
filter not exists { ?s (bnpq:P27 | bnpq:P28) ?other_date . } | |||
} # / optional other dates | |||
# filter(!bound(?start_date)). # to filter out rows with a start date (77 atm) | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en". } | |||
} | |||
group by ?personLabel ?prop_label ?end_date ?start_date ?has_start_date ?person ?s | |||
ORDER BY ?personLabel ?prop_label ?end_date | |||
</sparql> | </sparql> | ||
=== | === Women having children === | ||
<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,930: | Line 4,121: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
# 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 | |||
} | |||
{ | { | ||
# 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 | |||
order by ? | |||
</sparql> | </sparql> |
edits