Project:SPARQL/examples

SAL and RAI

People who signed nomination for SAL elections based on personal knowledge, sorted by frequency of signatures

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 ?SALsignatoryLabel ?SALsignatory (count(*) as ?count) WHERE {
  ?person bnp:P16 ?SALstatement .
  ?SALstatement bnps:P16 ?SALproposed .
  ?SALstatement bnpq:P32 ?SALsignatory .
    SERVICE wikibase:label {
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
    }
}
GROUP BY ?SALsignatoryLabel ?SALsignatory
ORDER BY DESC(?count)

Try it!


People whose elections were proposed to SAL or RAI, including who proposed, seconded, or signed (excluding 'general knowledge' signatures) their proposal for election, seperated by type, and including the date the proposals were made

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 ?person ?personLabel ?SALproposedLabel ?SALsignatorypersonalLabel ?SALsignatorygeneralLabel ?RAIproposedLabel ?RAIsecondedLabel ?date WHERE
{
  {
  ?person bnwdt:P3 bnwd:Q3 .
  ?person bnp:P16 ?SALstatement .
  ?SALstatement bnps:P16 ?SALproposed .
  ?SALstatement bnpq:P32 ?SALsignatorypersonal .
  ?SALstatement bnpq:P1 ?date .
  }
  UNION
  {
  ?person bnwdt:P3 bnwd:Q3 .
  ?person bnp:P7 ?RAIstatement .
  ?RAIstatement bnps:P7 ?RAIproposed .
  OPTIONAL {?RAIstatement bnpq:P8 ?RAIseconded .}
  ?RAIstatement bnpq:P1 ?date .
  }
    SERVICE wikibase:label {
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
    }
}
ORDER BY ?date
# I only got how to do this when I read https://wdqs-tutorial.toolforge.org/index.php/category/simple-queries/qualifiers/ Huge thanks to @Tagishsimon for pointing out my error and forcing me to do it properly :)

Try it!


People whose elections were proposed to SAL linked in a graph to those who signed their nomination for election based on personal knowledge

#People whose elections were proposed to SAL linked in a graph to those who signed their nomination for election based on personal knowledge

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:Graph
SELECT ?person ?personLabel ?rgb ?SALsignatory ?SALsignatoryLabel WHERE {
  ?person bnp:P16 ?SALstatement .
  ?SALstatement bnps:P16 ?SALproposed .
  ?SALstatement bnpq:P32 ?SALsignatory .
    SERVICE wikibase:label {
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
    }
  BIND( "7C4DCD" AS ?rgb ) .
}
# I don't know how to use 'edgeLabel' to show the types of interaction, but if you have an idea suggest an edit!

Try it!


People whose elections were proposed to RAI linked in a graph to those who proposed and seconded their nomination for election

# People whose elections were proposed to RAI linked in a graph to those who proposed and seconded their nomination for election

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:Graph
SELECT ?person ?personLabel ?rgb ?RAIproposed ?RAIproposedLabel ?RAIseconded ?RAIsecondedLabel WHERE
{
  ?person bnwdt:P3 bnwd:Q3 .
  ?person bnp:P7 ?RAIstatement .
  ?RAIstatement bnps:P7 ?RAIproposed .
  OPTIONAL {?RAIstatement bnpq:P8 ?RAIseconded .}
    SERVICE wikibase:label {
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
    }
BIND( "7C4DCD" AS ?rgb ) .
}

Try it!


People whose election to SAL was proposed and the person who proposed them, with - where known - date of proposal, gender of proposed FSA and proposer, and if elected

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd:  <http://www.wikidata.org/entity/>

SELECT ?FSA ?date ?FSALabel ?FSAgenderLabel ?proposer ?proposerLabel ?proposergenderLabel ?electedLabel
WHERE {  
  ?FSA bnwdt:P16 ?proposer .                                #select proposed FSA and their proposed
    OPTIONAL {?FSA bnwdt:P3 ?FSAgender .}                   #option select gender of proposed FSA
    OPTIONAL {?proposer bnwdt:P3 ?proposergender}           #option select gender of proposer
  ?FSA bnp:P16 ?SALstatement .
  ?SALstatement bnps:P16 ?SALproposed .
    OPTIONAL {?SALstatement bnpq:P1 ?date .}                #option select date of proposal
    OPTIONAL {?SALstatement bnpq:P22 ?elected .}            #option select if elected
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
ORDER BY ?date

Try it!


People who proposed elections to SAL, sorted by the frequency of individual co-signatories

# people who proposed elections to SAL, sorted by the frequency of individual co-signatories
# e.g. Q137 co-signed proposals from Q136 on the number of occasions recorded in the 'co-signatory_count' column

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 ?SALproposerLabel ?SALproposer ?co_signatoryLabel ?co_signatory (count(?co_signatory) as ?co_signatory_count) WHERE {
  ?person bnp:P16 ?SALstatement .
  ?SALstatement bnps:P16 ?SALproposer .
  ?SALstatement bnpq:P32 ?co_signatory .
    SERVICE wikibase:label {
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
    }
}
GROUP BY ?SALproposerLabel ?SALproposer ?co_signatoryLabel ?co_signatory 
ORDER BY DESC(?co_signatory_count)

Try it!


Women who are listed as Fellows of the Society of Antiquaries of London (FSAs) on our wikibase and who are on Wikidata, but are not listed as FSAs on Wikidata

# Women who are listed as Fellows of the Society of Antiquaries of London (FSAs) on our wikibase and who are on Wikidata, but are not listed as FSAs on Wikidata

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd:  <http://www.wikidata.org/entity/>

SELECT ?person ?personLabel
WHERE {  
  ?person bnwdt:P3 bnwd:Q3 . #select women
  FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team
  
  ?person bnwdt:P75 bnwd:Q8. # find only BN subjects having a FSA (h/t @Tagishsimon)

  ?person bnp:P117 ?wikidata_ID . #look for wikidata ID on person page
  ?wikidata_ID bnpq:P14 ?wikidata_url .
  BIND(IRI(REPLACE(?wikidata_url,"https://www.wikidata.org/wiki/","http://www.wikidata.org/entity/")) as ?item ) 
  
  SERVICE <https://query.wikidata.org/sparql> {
        ?item wdt:P21 ?WD_gender. #get gender of person
        FILTER NOT EXISTS {?item wdt:P166 wd:Q26196499 . } #not FSA on Wikidata
      }
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
ORDER BY ?personLabel

Try it!


Work

People, the positions that they held, and when they held them (if known)

# People, the positions that they held, and when they held them (if known)

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 ?person ?personLabel ?position ?positionLabel ?date ?startdate ?enddate
WHERE {  
  ?person bnp:P17 ?hadposition . #using 'held position' for roles not at institutions that typically employed people on a formal, longstanding basis.
  ?hadposition bnps:P17 ?position
  OPTIONAL {?hadposition bnpq:P1 ?date .}
  OPTIONAL {?hadposition bnpq:P27 ?startdate .}
  OPTIONAL {?hadposition bnpq:P28 ?enddate .}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
ORDER BY ?positionLabel ?dateLabel

Try it!


People, the positions that they held, the institution that employed them (if known), and date information (if known)

# People, the positions that they held, the institution that employed them (if known), and date information (if known)

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 ?person ?personLabel ?position ?positionLabel ?employer ?employerLabel ?date ?startdate ?enddate
WHERE {  
  ?person bnp:P105 ?hadposition . #using 'employed as' for roles at institutions that typically employed people on a formal, longstanding basis.
  ?hadposition bnps:P105 ?position
  OPTIONAL {?hadposition bnpq:P18 ?employer .}
  OPTIONAL {?hadposition bnpq:P1 ?date .}
  OPTIONAL {?hadposition bnpq:P27 ?startdate .}
  OPTIONAL {?hadposition bnpq:P28 ?enddate .}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
ORDER BY ?positionLabel ?employerLabel

Try it!


Women and their work activities, with employers/organisations and dates

# query for women's different kinds of work activity, with employer/organisation and dates where available

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 ?personLabel ?work_label ?positionLabel ?date_label ?date 
?employerLabel ?organisedLabel ?ofLabel 
?s ?person ?work ?position ?employer ?organised ?of 

WHERE {
    
  ?person bnwdt:P3 bnwd:Q3 . # women
  
  # get 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;       
         rdfs:label ?work_label. filter(lang(?work_label)="en-gb") .  
    
    # more about the position
    ?s ( bnps:P17|bnps:P48|bnps:P105 ) ?position .  
    # employer / organised by / of (incl free text). TODO: check whether these are mutually exclusive; could make this a union.
    # for position held, employer>of [ontology day discussion 13/9/23]
    OPTIONAL { ?s bnpq:P18 ?employer .}  
    OPTIONAL { ?s bnpq:P109 ?organised .}
    OPTIONAL { ?s ( bnpq:P78 | bnpq:P66 ) ?of .}
 
   # optional { ?s bnpq:P2 ?location . } # sometimes there is location and no employer/org/of 
    
  # dates
    optional {
    ?s ?pq ?date . 
      
      ?qual_prop wikibase:qualifier ?pq;      
              #wikibase:propertyType ?date_prop_type; # can check date property types if needed
              wikibase:propertyType wikibase:Time ; # nb *does not* include edtf dates but AFAICT there are none in qualifiers.
              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". } 
  
} # /where

ORDER BY ?person

Try it!


Women with publications listed in indexes of archaeological papers circa 1870 - 1907

# Women with publications listed in indexes of archaeological papers circa 1870 - 1907 

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 ?person ?personLabel
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 . # select people with publications listed in indexes of archaeological papers
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
ORDER BY ?personLabel

Try it!


Place

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

# 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 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:Graph
SELECT ?resident ?residentLabel ?region ?regionLabel
WHERE {  
  ?resident bnwdt:P29 ?residence .
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2035 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2036 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2037 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2038 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2039 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2040 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2041 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2042 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q39.}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2534.} 
  ?residence bnwdt:P33 ?district .
  ?district bnwdt:P33 ?county .
  ?county bnwdt:P33 ?region .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}

Try it!


People whose residence was at one time in the east or south east of England, excluding London

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 ?resident ?residentLabel ?residenceLabel ?districtLabel ?countyLabel ?regionLabel
WHERE {  
  ?resident bnwdt:P29 ?residence .
  ?residence bnwdt:P33 ?district .
  ?district bnwdt:P33 ?county .
  ?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

Try it!


People whose residence was at one time in North East England or Yorkshire and the Humber

# 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 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 ?resident ?residentLabel ?residenceLabel ?districtLabel ?countyLabel ?regionLabel
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". } 
}
ORDER BY ?regionLabel ?countyLabel ?districtLabel ?residenceLabel

Try it!


People not in London with the district, county, and region at which they were once resident (in the UK) listed

# 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 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 ?resident ?residentLabel ?district ?districtLabel ?county ?countyLabel ?region ?regionLabel
WHERE {  
  ?resident bnwdt:P29 ?residence .
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2035 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2036 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2037 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2038 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2039 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2040 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2041 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2042 .}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q39.}
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q2534.} 
  ?residence bnwdt:P33 ?district .
  ?district bnwdt:P33 ?county .
  ?county bnwdt:P33 ?region .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
ORDER BY ?regionLabel ?countyLabel ?districtLabel ?residentLabel

Try it!


People sorted by the number of places they lived, including the number of cites/towns/villages they lived in

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 ?person ?personLabel (count(?resided) as ?residence_count) (count(distinct ?resided) as ?residence_distinct) WHERE {
   ?person bnwdt:P3 bnwd:Q3 ;
         wikibase:statements ?statements .
  FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team
  ?person bnp:P29/bnps:P29 ?resided.
  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

Try it!


Places at which women resided, sorted by how many residences all women had at a given village/town/city/London area

# 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 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 ?residence ?residenceLabel (count(?residence) as ?residence_count) #count number of places at which women lived 
WHERE {  
  ?person bnwdt:P3 bnwd:Q3 . # select women
  FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team
  ?person bnwdt:P29 ?residence . # select residences
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
GROUP BY ?residence ?residenceLabel
ORDER BY DESC(?residence_count)

Try it!


Districts in which women resided, sorted by how many residences all women had in that district (or equivalent sub-level for non-UK residences)

# 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 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 ?district ?districtLabel (count(?district) as ?district_count) #count number of districts in which women lived 
WHERE {  
  ?person bnwdt:P3 bnwd:Q3 . # select women
  FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team
  ?person bnwdt:P29 ?residence . # select residences
  ?residence bnwdt:P33 ?district . #select districts
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
GROUP BY ?district ?districtLabel
ORDER BY DESC(?district_count)

Try it!


Counties in which women resided, sorted by how many residences all women had in that county

# 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 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
  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". } 
}
GROUP BY ?county ?countyLabel
ORDER BY DESC(?county_count)

Try it!


Counties of residence for women recorded in CAS Indexes of Archaeological Papers, sorted by how many residences all women had in that county

# 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 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:P76 bnwd:Q419 . #select women recorded in CAS Indexes of Archaeological Papers
  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". } 
}
GROUP BY ?county ?countyLabel
ORDER BY DESC(?county_count)

Try it!


Counties of residence for women nominated as FSAs, sorted by how many residences all women had in that county

# 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 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:P16 ?signatory . #select women who were nominated for election to FSA
  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". } 
}
GROUP BY ?county ?countyLabel
ORDER BY DESC(?county_count)

Try it!


Counties of residence for women nominated to RAI, sorted by how many residences all women had in that county

# 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 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:P7 ?signatory . #select women who were nominated for election to RAI
  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". } 
}
GROUP BY ?county ?countyLabel
ORDER BY DESC(?county_count)

Try it!


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 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 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:P23 bnwd:Q29 . #select women who spoke 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". } 
}
GROUP BY ?county ?countyLabel
ORDER BY DESC(?county_count)

Try it!


Counties of residence for women who exhibited at RAI meetings, sorted by how many residences all women had in that county

# 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". } 
}
GROUP BY ?county ?countyLabel
ORDER BY DESC(?county_count)

Try it!


Regions in which women resided, sorted by how many residences all women had in that region

# 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 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 ?region ?regionLabel (count(?region) as ?region_count) #count number of regions in which women lived 
WHERE {  
  ?person bnwdt:P3 bnwd:Q3 . # select women
  FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team
  ?person bnwdt:P29 ?residence . # select residences
  ?residence bnwdt:P33 ?district . #select districts
  ?district bnwdt:P33 ?county . #select counties
  ?county bnwdt:P33 ?region . #select region
  FILTER NOT EXISTS {?region bnwdt:P117 "Q145" .} #filter out UK (where UK is sub-region of NI)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
GROUP BY ?region ?regionLabel
ORDER BY DESC(?region_count)

Try it!


People

Women with their family name at birth and family name after marriage

# Women with their family name at birth and family name after marriage

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 ?person ?personLabel ?birthname ?marriedname
WHERE {  
  ?person bnwdt:P3 bnwd:Q3 . #select women
  FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team
  OPTIONAL {?person bnwdt:P140 ?birthname .} #look for birth name
  OPTIONAL {?person bnwdt:P141 ?marriedname .} #look for married name
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } 
}
ORDER BY ?personLabel

Try it!


Women with family name at birth, married name and count of married names

# 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 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 ?person ?personLabel ?birthname   
        (GROUP_CONCAT(DISTINCT ?marriedname; SEPARATOR=", ") AS ?marriednames) 
        (COUNT(?marriedname) AS ?marriedcount)

WHERE {  
  ?person bnwdt:P3 bnwd:Q3 . #select women
  FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team
  
  OPTIONAL {?person bnwdt:P140 ?birthname .} #look for birth name
  OPTIONAL {?person bnwdt:P141 ?marriedname .} #look for married name
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } 
}
group by ?person ?personLabel ?birthname
ORDER BY ?personLabel

Try it!


Where women in our data are in wikidata, their spouses, fathers, and mothers according to wikidata

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd:  <http://www.wikidata.org/entity/>

SELECT ?person ?personLabel ?item ?WD_spouse ?WD_father ?WD_mother
WHERE {  
  ?person bnwdt:P3 bnwd:Q3 . #select women
  FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team
  ?person bnp:P117 ?wikidata_ID . #look for wikidata ID on person page
  ?wikidata_ID bnpq:P14 ?wikidata_url .
  BIND(IRI(REPLACE(?wikidata_url,"https://www.wikidata.org/wiki/","http://www.wikidata.org/entity/")) as ?item ) 
  
  SERVICE <https://query.wikidata.org/sparql> {
        ?item wdt:P21 ?WD_gender. #get gender of person
        OPTIONAL {?item wdt:P22 ?WD_father . } #recall father
        OPTIONAL {?item wdt:P25 ?WD_mother . } #recall mother
        OPTIONAL {?item wdt:P26 ?WD_spouse . } #recall spouse
      }
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
ORDER BY ?personLabel
# with thanks to @tagishsimon for writing this one initially!

Try it!


Women in our data alongside counts of their public and professional activities, sorted by total

## 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 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 ?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". }
}
group by ?person ?personLabel
ORDER BY DESC (?PPA_total)

Try it!


Women in our data arranged as a network graph by the organisations they were members of

## Women in our data arranged as a network graph by the organisations they were members of
#defaultView:Graph
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
SELECT  ?org ?orgLabel ?rgb ?linkTo ?linkToLabel 
WHERE {  
  ?linkTo bnwdt:P3 bnwd:Q3 .                                #select women
  FILTER NOT EXISTS {?linkTo bnwdt:P4 bnwd:Q12 .}          #filter out project team
  ?linkTo bnwdt:P67 ?org
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en". } 
  BIND( "7C4DCD" AS ?rgb ) .

}
ORDER BY ?personLabel

Try it!


Membership of organisations by women, sorted by how many women were members of a given organisation

# 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 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 ?organisation ?organisationLabel (count(?organisation) as ?organisation_count) #count number of organisations that women were members of
WHERE {  
  ?person bnwdt:P3 bnwd:Q3 . # select women
  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
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
GROUP BY ?organisation ?organisationLabel
ORDER BY DESC(?organisation_count)

Try it!



Education

Women educated at a tertiary educational institution located in Oxford or Cambridge

# Women educated at a tertiary educational institution located in Oxford or Cambridge

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>

SELECT ?woman ?womanLabel ?educationalinstitution ?educationalinstitutionLabel ?location ?locationLabel
WHERE {  
  {?woman bnwdt:P3 bnwd:Q3 . #filter women
  ?woman bnwdt:P94 ?educationalinstitution . #find 'educated at' statement
  ?educationalinstitution bnwdt:P12 bnwd:Q2914 . #filter to tertiary educational institutions
  ?educationalinstitution bnwdt:P2 ?location . #find location of educational institution
  ?location rdfs:label ?locationLabel . 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } 
  FILTER(LANG(?locationLabel) = "en") .
  FILTER(regex(?locationLabel, "oxford", "i")) .}
  UNION
  {?woman bnwdt:P3 bnwd:Q3 . #filter women
  ?woman bnwdt: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". }
}
ORDER BY ?womanLabel

Try it!


Women who were FSAs who went to Oxford or Cambridge colleges

#how many women who were FSAs went to Oxford or Cambridge colleges?

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX bnpsv: <https://beyond-notability.wikibase.cloud/prop/statement/value/>

SELECT ?person ?personLabel ?college ?collegeLabel ?universityLabel
WHERE {  
  ?person bnwdt:P3 bnwd:Q3 . #select women
  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) 

  ?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

Try it!


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

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd:  <http://www.wikidata.org/entity/>

SELECT ?person ?personLabel ?wikidata_ID ?viaf_ID ?ads_ID ?worldcat_ID 
WHERE {  
  ?person bnwdt:P3 bnwd:Q3 .                                 #select women
  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". } 
}
ORDER BY ?personLabel

Try it!


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

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd:  <http://www.wikidata.org/entity/>

SELECT ?person ?personLabel ?wikidata_ID ?viaf_ID ?ads_ID ?worldcat_ID 
WHERE {  
  ?person bnwdt:P3 bnwd:Q3 .                                 #select women
  ?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". } 
}
ORDER BY ?personLabel

Try it!


People with IDs on wikidata, their date of birth on wikidata, and the source(s) of that information

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd:  <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>

SELECT ?woman ?womanLabel ?WDitem ?WDdateOfBirth (GROUP_CONCAT(?BirthStatedInEnglish;separator=" | ") AS ?sources)
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> {
        #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". } 
}
GROUP BY ?woman ?womanLabel ?WDitem ?WDdateOfBirth
ORDER BY ?womanLabel
# Credit to Maarten Zeinstra for developing this query

Try it!


Which women in the wikibase have Wikipedia articles, according to Wikidata?

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd:  <http://www.wikidata.org/entity/>

SELECT ?person ?personLabel ?wikidata ?wikipedia
WHERE {  
  ?person bnwdt:P3 bnwd:Q3 . #select women
  FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team

  ?person bnp:P117 ?wikidata_ID . #look for wikidata ID on person page
  ?wikidata_ID bnpq:P14 ?wikidata_url .
  BIND(IRI(REPLACE(?wikidata_url,"https://www.wikidata.org/wiki/","http://www.wikidata.org/entity/")) as ?wikidata ) 
  
  SERVICE <https://query.wikidata.org/sparql> {
      # get 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/')
        }  
      }  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
ORDER BY ?personLabel

Try it!


Women with no date of death in our wikibase who have a date of death on Wikidata

# 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 bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd:  <http://www.wikidata.org/entity/>

SELECT ?person ?personLabel  ?wd_dod
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:P15 ?bn_dod . } # *don't* have P15 date of death
  
  ?person bnp:P117 ?wikidata_ID . #look for wikidata ID on person page
  ?wikidata_ID bnpq:P14 ?wikidata_url .
  BIND(IRI(REPLACE(?wikidata_url,"https://www.wikidata.org/wiki/","http://www.wikidata.org/entity/")) as ?item ) 
  
  SERVICE <https://query.wikidata.org/sparql> {
        ?item wdt:P21 ?WD_gender. #get gender of person
        ?item wdt:P570 ?wd_dod .  #date of death on Wikidata P570
      }
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
ORDER BY ?personLabel

Try it!


Women with no date of birth in our wikibase who have a date of birth in Wikidata

# 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 bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd:  <http://www.wikidata.org/entity/>

SELECT ?person ?personLabel  ?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 bnp:P117 ?wikidata_ID . #look for wikidata ID on person page
  ?wikidata_ID bnpq:P14 ?wikidata_url .
  BIND(IRI(REPLACE(?wikidata_url,"https://www.wikidata.org/wiki/","http://www.wikidata.org/entity/")) as ?item ) 
  
  SERVICE <https://query.wikidata.org/sparql> {
        ?item wdt:P21 ?WD_gender. #get gender of person
        ?item wdt:P569 ?wd_dob .  #date of birth on Wikidata P569
      }
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
ORDER BY ?personLabel

Try it!


Fishing Expeditions

All properties in use in the wikibase with property type, label and description (if present)

# 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 . } 

  # add description if present
  OPTIONAL { 
        SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en".
          ?property schema:description ?propertyDescription .
        }
   } 
  
  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

Try it!


All the Things for Organisations

# Exploratory query to get all info on an item page including qualifiers (but not references) for each organisation in the wikibase

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>

select ?item ?itemLabel 
?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
  
  # 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 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 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

Try it!


Dates

All the Dates for Women FSAs

# union query to get [hopefully] every date associated with women FSAs including main dates and qualifier dates and date precision

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 ?date_prop_label ?date_value ?date_precision ?qual ?qualLabel  ?date_prop_type
#?s  #statement url [for grouping] 
#?date_prop  #property url/id

WHERE {
 
 {  # main dates
   
   ?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 .
      ?date_prop wikibase:claim ?p;     
         wikibase:statementProperty ?ps ;  	 
         wikibase:statementValue ?psv .    
      ?date_prop wikibase:propertyType ?date_prop_type .
      ?date_prop rdfs:label ?date_prop_label. filter(lang(?date_prop_label)="en-gb") . 
   
  # get dates detail via ?s and psv
  # TODO: I think this gets edtf dates in simplified std wiki date format. could handle them separately to keep the extra info. 
  # https://github.com/ProfessionalWiki/WikibaseEdtf
   
      ?s ?psv ?wdv .
        ?wdv wikibase:timeValue ?date_value ;
           wikibase:timePrecision ?date_precision .
  } # /main dates
  
  UNION
  
  { # qualifier dates
    
    ?person bnwdt:P3 bnwd:Q3 . # women
    ?person bnwdt:P75 bnwd:Q8. # only BN subjects having a FSA 
  
    # get stuff about ?person   
    ?person ?p ?s .   
  
      # get stuff about ?p . 
      ?prop wikibase:claim ?p;      
         #wikibase:propertyType ?prop_type ;
         wikibase:statementProperty ?ps.     
      ?prop rdfs:label ?prop_label. filter(lang(?prop_label)="en-gb") . 

      # get stuff about ?s. 
      ?s ?ps ?qual.
   
        # get stuff about qual if you want
        # optional {   
         # what sort of thing is qual
         #  ?qual bnwdt:P12 ?inst .  # instance of can be multiple so could get some dups
         #} # /qual optional

   
      # get qualifier dates  [are there any Edtf in qualifier dates?]  
      ?s ?pq ?pqs .  
      
      # this needs to be limited to dates... I think
      FILTER(DATATYPE(?pqs) = xsd:dateTime). 
   
        # get stuff about pq 
        ?qual_prop wikibase:qualifier ?pq;      
             wikibase:propertyType ?date_prop_type. 
        ?qual_prop rdfs:label ?date_prop_label . filter(lang(?date_prop_label)="en-gb") . # what sort of date is it.
  
      # get dates detail. TODO: how to get the /entity/ url for date_prop?
      ?s ?date_prop ?pqv .
         ?pqv wikibase:timeValue ?date_value.
         ?pqv wikibase:timePrecision ?date_precision.
    
  }  # /qual dates
  
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
  
} # /where

ORDER BY ?person ?date_value

Try it!


Fetch any of multiple kinds of EDTF date for a woman

# a union query to fetch stuff for multiple properties, in this case dates recorded in EDTF which need slightly different handling from PIT dates
# TODO: this excludes any EDTF dates in qualifiers; not sure if there are any. 

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  ?person ?personLabel ?date_edtf ?date_type

WHERE { ?person bnwdt:P3 bnwd:Q3 . 
       FILTER NOT EXISTS { ?person bnwdt:P4 bnwd:Q12 . } 
       
    ## short form of UNION using |  
       ?person ( bnwdt:P131 | bnwdt:P132 | bnwdt:P133  ) ?date_edtf .
 
## cf. full length UNION 
## {?person bnwdt:P131 ?date_edtf } union {?person bnwdt:P132 ?date_edtf } union {?person bnwdt:P133 ?date_edtf }   
     
    ## need to know what kind of date it is
     ?person ?date_type ?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

Try it!


Full values: dates

# 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 bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX bnpsv: <https://beyond-notability.wikibase.cloud/prop/statement/value/>

SELECT DISTINCT ?item ?itemLabel ?date ?precision 
WHERE {
  ?item bnp:P26  ?statement. # date of birth (precision of these varies quite a bit)
  ?statement bnpsv:P26 ?valueNode.
  ?valueNode wikibase:timeValue ?date.
  ?valueNode wikibase:timePrecision ?precision.
  
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ?date

Try it!


Any main level date for women

# a query to get all types of main date for women

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX bnpsv: <https://beyond-notability.wikibase.cloud/prop/statement/value/>

SELECT DISTINCT ?person ?personLabel ?date_label  ?date ?date_prop_type ?date_prop
WHERE {
  
  ?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

      
      ?s ?psv ?wdv . # for the date value
        ?wdv wikibase:timeValue ?date .  #timeValue gets pit and edtf
     #  ?wdv wikibase:timePrecision ?date_precision .  # optional
  
  # 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

Try it!


Counting Dates

# count distinct dates for women (who have at least one)
# 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
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

Try it!


Admin

Women about whom we have recorded fewer than 3 pieces of information

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 ?person ?personLabel ?statements WHERE {
   ?person bnwdt:P3 bnwd:Q3 ;
         wikibase:statements ?statements .
  FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .}
  FILTER (?statements <3)
  SERVICE wikibase:label {
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
  }
}

Try it!


People for whom their item records is given as 'Mrs'

SELECT ?id ?name
WHERE {  
  ?id rdfs:label ?name .
  FILTER regex(?name, "mrs *", "i") #this line uses regular expression syntax, described at https://regexper.com/#mrs%5Cs*
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}

Try it!


All triples in the wiki, limited to 1000

SELECT ?a ?aLabel ?b ?c WHERE {
    ?a ?b ?c
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". }
}
LIMIT 1000 #please don't make this number too big as it will slow down the site!

Try it!


All triples in the wiki, represented as a crude graph

#defaultView:Graph
SELECT ?a ?aLabel ?c ?cLabel WHERE {
    ?a ?b ?c
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". }
}
#note query returns every connection in the wikibase so it may fall over!

Try it!


People whose assigned gender we have been unable to determine and/or confirm

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd:  <http://www.wikidata.org/entity/>

SELECT ?person ?personLabel
WHERE {  
  ?person bnwdt:P3 ?gender .                               
  FILTER NOT EXISTS {?person bnwdt:P3 bnwd:Q3 .}          #filter out people identified as women
  FILTER NOT EXISTS {?person bnwdt:P3 bnwd:Q10 .}          #filter out people identified as men
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
ORDER BY ?personLabel

Try it!


People who have a spouse statement and - optionally - marriage date statements for checking if there is any misalignment with 'Spouse not in wikibase' statements

# people who have a spouse statement and - optionally - marriage date statements for checking if there is any misalignment with 'Spouse not in wikibase' statements

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 ?person ?personLabel ?spouse ?spouseLabel ?edtfmarriagespouse ?edtfmarriagespouseLabel ?PITmarriagespouse ?PITmarriagespouseLabel WHERE {
  ?person bnwdt:P41 ?spouse .
  OPTIONAL {?person bnp:P132 ?edtfmarriagestatement .
  ?edtfmarriagestatement bnps:P132 ?edtfmarriagedate .
  ?edtfmarriagestatement bnpq:P41 ?edtfmarriagespouse .}
  OPTIONAL {?person bnp:P130 ?PITmarriagestatement .
  ?PITmarriagestatement bnps:P130 ?PITmarriagedate .
  ?PITmarriagestatement bnpq:P41 ?PITmarriagespouse .}
    SERVICE wikibase:label {
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
    }
}
ORDER BY DESC(?edtfmarriagespouseLabel) DESC(?PITmarriagespouseLabel)

Try it!


Compare uses of item v free text

# A number of properties have "item" and "free text" versions; a query to fetches both versions in each case to facilitate comparison of their uses.

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 ?itemLabel ?prop_label ?qual_label ?qual_value ?qual_valueLabel ?item ?qual_prop 

# most of these are used in qualifiers - only P72, P71 and P88 found in main (and only a handful of uses of free text?)
#?item (  bnp:P88|bnp:P91 | bnp:P72|bnp:P71) ?s . 

## the pairs
#P21 evidence (free text) / P20 evidence (item)
#P79 item exhibited / P80 item exhibited (free text)
#P78 of / P66 of (free text)
#P91 specific reference information / P88 specific reference information (free text)
#P31 street address (free text) / P100 street address (item)
#P72 was delegate at (free text) / P71 was delegate at (item)

WHERE {
  
  ?item ?p ?s . 
  
  ?prop wikibase:claim ?p;       
         rdfs:label ?prop_label. filter(lang(?prop_label)="en-gb") .  
    
  ?s ( bnpq:P21|bnpq:P20 | bnpq:P80|bnpq:P79	| bnpq:P66|bnpq:P78 | bnpq:P88|bnpq:P91	| bnpq:P31|bnpq:P100 | bnpq:P72|bnpq:P71	 ) ?qual_value .
  
  ?s ?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') .
  
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
order by ?qual_label ?prop_label ?itemLabel

Try it!


Missing language labels

# query to find small number of items/properties which don't have en-gb labels
# this causes problems when needing to get labels without using SERVICE, or can't rely on AUTO_LANGUAGE

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 
  ?item ?engb ?itemLabel
  (group_concat(distinct ?language) as ?languages) 
  (count(distinct ?rdfs_label) as ?count) # TIL: where you put distinct matters!  

WHERE {
  
  ?item bnwdt:P12 ?s. # limit to items with instance of. speeds up the query a lot cf. fetching anything. 
  
  #?item ?p ?s. #  anything. takes a while, adds ~20 not found in the instance of version
  #filter not exists { ?item bnwdt:P12 ?s   . } # errrm why doesn't this do anything?
  
  ?item rdfs:label ?rdfs_label .  # rdfs item label (1 per language). 
  
  BIND(LANG(?rdfs_label) as ?language) .  # get 2 letter language codes

  # optional to fetch en-gb (and/or) en separately
  optional { ?item rdfs:label ?engb . filter(lang(?engb)="en-gb").  } # blank if item only has en label  
  #optional { ?item rdfs:label ?en . filter(lang(?en)="en").  } 
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en". } 
}
group by ?item ?engb ?itemLabel
HAVING (?count<2) 
order by ?item

Try it!


Tools for batch processing and quality assurance work

All people (by assigned gender), filtering out those already listed as instance of human

# All people (by assigned gender), filtering out those already listed as instance of human

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd:  <http://www.wikidata.org/entity/>

SELECT ?person ?personLabel ?assigned_genderLabel
WHERE {  
  ?person bnwdt:P3 ?assigned_gender .                        #select person
  FILTER NOT EXISTS {?person bnwdt:P12 bnwd:Q2137 .}         #filter out people already listed as instance of human
  FILTER NOT EXISTS {?person bnwdt:P12 bnwd:Q12 .}            #filter out project team
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
ORDER BY ?personLabel

Try it!


All places (by coordinate location on wikidata), filtering out places already listed as instance of locality

# All places (by coordinate location on wikidata), filtering out places already listed as instance of locality

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd:  <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>

SELECT ?place ?placeLabel ?WDitem ?WDcoordinate_location

WHERE {  
  ?place bnwdt:P33 ?admin_area .  #select items with 'located in the administrative territorial entity' statements
  ?place bnwdt:P117 ?Qnumber .    #get wikidata ID
  FILTER NOT EXISTS {?place bnwdt:P12 bnwd:Q2147 .}       #filter out places already listed as instance of locality
  
  #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> {
        ?WDitem wdt:P625 ?WDcoordinate_location . #get coordinate location on wikidata
      } 
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } 
}
GROUP BY ?place ?placeLabel ?WDitem ?WDcoordinate_location
ORDER BY ?placeLabel

Try it!


All items without a P12 (instance of) triple

# All items without a P12 (instance of) triple

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 ?item ?itemLabel WHERE {
   ?item ?b ?c ;
  FILTER NOT EXISTS {?item bnwdt:P12 ?anything .}

## FILTER(STRSTARTS(STR(?item), "https://beyond-notability.wikibase.cloud/entity/Q")) .  # limit results to "Q" entities
## FILTER(REGEX(STR(?item), "^https://beyond-notability.wikibase.cloud/entity/[PQ]")) . # or to Ps and Qs

  SERVICE wikibase:label {
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
  }
}

Try it!


Counts of items for each value of the property "instance of" (P12)

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  ?value ?valueLabel  (count(*) as ?count)
WHERE {  

  VALUES (?p) { (bnwdt:P12) }  
  
  ?s ?p ?value.
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

GROUP BY ?value ?valueLabel

ORDER BY lcase(?valueLabel) # order by is case sensitive
# or to order by count
# order by ?count

Try it!


Get all items (with 'instance of' statement) for duplicate checking in OpenRefine

# Get all items (with 'instance of' statement) for duplicate checking in OpenRefine

PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>

SELECT ?item ?itemLabel WHERE {
  ?item bnwdt:P12 ?anything .
  SERVICE wikibase:label {
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
  }
}

ORDER BY ?itemLabel

Try it!


All uses of <unknown value>

# Query to look for uses of <unknown value> (now including qualifiers)

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  ?item ?itemLabel  ?stmtLabel ?sub_Label ?unknown_value_forLabel  ?unknown_value_for
WHERE
{
 { 
   # qualifiers
  ?item ?p ?s.	
  ?s ?sub ?sub_ .
  ?stmt wikibase:claim ?p.
  ?stmt wikibase:statementProperty ?sub.  
  ?s ?pq ?pq_ .

  ?unknown_value_for wikibase:qualifier ?pq .  
  FILTER( isBLANK(?pq_)  ) . # filter for <unknown value>
  }
  UNION
  {
   # top level
  ?item ?p ?s.	
  ?s ?ps ?ps_ .

  ?unknown_value_for wikibase:claim ?p.
  ?unknown_value_for wikibase:statementProperty ?ps.
  FILTER( isBLANK(?ps_) ) .
  }
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }

}
ORDER BY ?itemLabel ?unknown_value_forLabel

Try it!