Project:SPARQL/examples: Difference between revisions

reorder queries by theme
No edit summary
(reorder queries by theme)
Line 1: Line 1:
=Examples=
==SAL==


===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===
===People whose signed nomination for SAL elections based on personal knowledge, sorted by frequency of signatures===


<sparql tryit="1">
<sparql tryit="1">
Line 11: Line 11:
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 ?person ?personLabel ?wikidata_ID ?viaf_ID ?ads_ID ?worldcat_ID
SELECT ?SALsignatoryLabel ?SALsignatory (count(*) as ?count) WHERE {
WHERE {
   ?person bnp:P16 ?SALstatement .
   ?person bnwdt:P3 bnwd:Q3 .                                 #select women
   ?SALstatement bnps:P16 ?SALproposed .
   FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .}            #filter out project team
  ?SALstatement bnpq:P32 ?SALsignatory .
    OPTIONAL {?person bnwdt:P117 ?wikidata_ID .}            #return wikidata ID
     SERVICE wikibase:label {
    OPTIONAL {?person bnwdt:P119 ?viaf_ID .}                #return VIAF ID
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
    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
GROUP BY ?SALsignatoryLabel ?SALsignatory
ORDER BY DESC(?count)
</sparql>
</sparql>


===Women about whom we have recorded fewer than 3 pieces of information===
===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===


<sparql tryit="1">
<sparql tryit="1">
Line 38: Line 35:
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>


SELECT ?person ?personLabel ?statements WHERE {
SELECT ?person ?personLabel ?SALproposedLabel ?SALsignatorypersonalLabel ?SALsignatorygeneralLabel ?RAIproposedLabel ?RAIsecondedLabel ?date WHERE
  ?person bnwdt:P3 bnwd:Q3 ;
{
        wikibase:statements ?statements .
  {
   FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .}
  ?person bnwdt:P3 bnwd:Q3 .
   FILTER (?statements <3)
  ?person bnp:P16 ?SALstatement .
   SERVICE wikibase:label {
   ?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".
       bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
  }
    }
}
</sparql>
 
===People for whom their item records is given as 'Mrs'===
 
<sparql tryit="1">
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". }  
}
}
</sparql>
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 :)
===All triples in the wiki, limited to 1000===
 
<sparql tryit="1">
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!
</sparql>
 
===All triples in the wiki, represented as a crude graph===
 
<sparql tryit="1">
#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!
</sparql>
</sparql>


Line 104: Line 83:
</sparql>
</sparql>


===People whose signed nomination for SAL elections based on personal knowledge, sorted by frequency of signatures===
===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===


<sparql tryit="1">
<sparql tryit="1">
Line 114: Line 93:
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 ?SALsignatoryLabel ?SALsignatory (count(*) as ?count) WHERE {
SELECT ?FSA ?date ?FSALabel ?FSAgenderLabel ?proposer ?proposerLabel ?proposergenderLabel ?electedLabel
   ?person bnp:P16 ?SALstatement .
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 .
   ?SALstatement bnps:P16 ?SALproposed .
  ?SALstatement bnpq:P32 ?SALsignatory .
    OPTIONAL {?SALstatement bnpq:P1 ?date .}                #option select date of proposal
     SERVICE wikibase:label {
     OPTIONAL {?SALstatement bnpq:P22 ?elected .}            #option select if elected
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". }  
    }
}
}
GROUP BY ?SALsignatoryLabel ?SALsignatory
ORDER BY ?date
ORDER BY DESC(?count)
</sparql>
</sparql>


===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===
===People who proposed elections to SAL, sorted by the frequency of individual co-signatories===


<sparql tryit="1">
<sparql tryit="1">
# 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 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 138: Line 124:
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>


SELECT ?person ?personLabel ?SALproposedLabel ?SALsignatorypersonalLabel ?SALsignatorygeneralLabel ?RAIproposedLabel ?RAIsecondedLabel ?date WHERE
SELECT ?SALproposerLabel ?SALproposer ?co_signatoryLabel ?co_signatory (count(?co_signatory) as ?co_signatory_count) WHERE {
{
  {
  ?person bnwdt:P3 bnwd:Q3 .
   ?person bnp:P16 ?SALstatement .
   ?person bnp:P16 ?SALstatement .
   ?SALstatement bnps:P16 ?SALproposed .
   ?SALstatement bnps:P16 ?SALproposer .
   ?SALstatement bnpq:P32 ?SALsignatorypersonal .
   ?SALstatement bnpq:P32 ?co_signatory .
  ?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 {
     SERVICE wikibase:label {
       bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
       bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
     }
     }
}
}
ORDER BY ?date
GROUP BY ?SALproposerLabel ?SALproposer ?co_signatoryLabel ?co_signatory
# 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 :)
ORDER BY DESC(?co_signatory_count)
</sparql>
</sparql>
==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===
Line 210: Line 185:
</sparql>
</sparql>


===Where women in our data are in wikidata, their spouses, fathers, and mothers according to wikidata===
===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">
Line 220: Line 195:
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 ?person ?personLabel ?item ?WD_spouse ?WD_father ?WD_mother
SELECT ?resident ?residentLabel ?district ?districtLabel ?county ?countyLabel ?region ?regionLabel
WHERE {   
WHERE {   
   ?person bnwdt:P3 bnwd:Q3 . #select women
   ?resident bnwdt:P29 ?residence .
  FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q39 .}  
   ?person bnp:P117 ?wikidata_ID . #look for wikidata ID on person page
   ?residence bnwdt:P33 ?district .
   ?wikidata_ID bnpq:P14 ?wikidata_url .
   ?district bnwdt:P33 ?county .
   BIND(IRI(REPLACE(?wikidata_url,"https://www.wikidata.org/wiki/","http://www.wikidata.org/entity/")) as ?item )
   ?county bnwdt:P33 ?region .
 
  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". }  
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". }  
}
}
ORDER BY ?personLabel
ORDER BY ?regionLabel
# with thanks to @tagishsimon for writing this one initially!
</sparql>
</sparql>


===People whose assigned gender we have been unable to determine and/or confirm===
===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">
Line 254: Line 218:
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 ?person ?personLabel
SELECT ?person ?personLabel (count(?resided) as ?residence_count) (count(distinct ?resided) as ?residence_distinct) WHERE {
WHERE {
  ?person bnwdt:P3 bnwd:Q3 ;
  ?person bnwdt:P3 ?gender .                              
        wikibase:statements ?statements .
   FILTER NOT EXISTS {?person bnwdt:P3 bnwd:Q3 .}         #filter out people identified as women
   FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team
   FILTER NOT EXISTS {?person bnwdt:P3 bnwd:Q10 .}          #filter out people identified as men
   ?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".
ORDER BY ?personLabel
  }
} group by ?person ?personLabel ?statements order by desc(?residence_count)
# Credit to @Tagishsimon for helping me figure out the counting logic here
</sparql>
</sparql>


===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===
==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">
Line 280: Line 246:
PREFIX wd:  <http://www.wikidata.org/entity/>
PREFIX wd:  <http://www.wikidata.org/entity/>


SELECT ?FSA ?date ?FSALabel ?FSAgenderLabel ?proposer ?proposerLabel ?proposergenderLabel ?electedLabel
SELECT ?person ?personLabel ?wikidata_ID ?viaf_ID ?ads_ID ?worldcat_ID
WHERE {   
WHERE {   
   ?FSA bnwdt:P16 ?proposer .                               #select proposed FSA and their proposed
   ?person bnwdt:P3 bnwd:Q3 .                                 #select women
    OPTIONAL {?FSA bnwdt:P3 ?FSAgender .}                   #option select gender of proposed FSA
  FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .}           #filter out project team
     OPTIONAL {?proposer bnwdt:P3 ?proposergender}           #option select gender of proposer
     OPTIONAL {?person bnwdt:P117 ?wikidata_ID .}             #return wikidata ID
  ?FSA bnp:P16 ?SALstatement .
    OPTIONAL {?person bnwdt:P119 ?viaf_ID .}                #return VIAF ID
  ?SALstatement bnps:P16 ?SALproposed .
     OPTIONAL {?person bnwdt:P34 ?ads_ID .}                   #return Archaeological Data Service ID
     OPTIONAL {?SALstatement bnpq:P1 ?date .}               #option select date of proposal
     OPTIONAL {?person bnwdt:P118 ?worldcat_ID .}             #return WorldCat Identities ID
     OPTIONAL {?SALstatement bnpq:P22 ?elected .}           #option select if elected
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". }  
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". }  
}
}
ORDER BY ?date
ORDER BY ?personLabel
</sparql>
</sparql>


===People sorted by the number of places they lived, including the number of cites/towns/villages they lived in===
===Where women in our data are in wikidata, their spouses, fathers, and mothers according to wikidata===


<sparql tryit="1">
<sparql tryit="1">
Line 304: Line 269:
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 ?person ?personLabel (count(?resided) as ?residence_count) (count(distinct ?resided) as ?residence_distinct) WHERE {
SELECT ?person ?personLabel ?item ?WD_spouse ?WD_father ?WD_mother
  ?person bnwdt:P3 bnwd:Q3 ;
WHERE {
        wikibase:statements ?statements .
  ?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 bnp:P29/bnps:P29 ?resided.
   ?person bnp:P117 ?wikidata_ID . #look for wikidata ID on person page
   SERVICE wikibase:label {
  ?wikidata_ID bnpq:P14 ?wikidata_url .
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
  BIND(IRI(REPLACE(?wikidata_url,"https://www.wikidata.org/wiki/","http://www.wikidata.org/entity/")) as ?item )
  }
 
} group by ?person ?personLabel ?statements order by desc(?residence_count)
  SERVICE <https://query.wikidata.org/sparql> {
# Credit to @Tagishsimon for helping me figure out the counting logic here
        ?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!
</sparql>
</sparql>


Line 364: Line 340:
</sparql>
</sparql>


===People not in London with the district, county, and region at which they were once resident (in the UK) listed===
==Admin==
 
===Women about whom we have recorded fewer than 3 pieces of information===


<sparql tryit="1">
<sparql tryit="1">
Line 375: Line 353:
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>


SELECT ?resident ?residentLabel ?district ?districtLabel ?county ?countyLabel ?region ?regionLabel
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".
  }
}
</sparql>
 
===People for whom their item records is given as 'Mrs'===
 
<sparql tryit="1">
SELECT ?id ?name
WHERE {   
WHERE {   
   ?resident bnwdt:P29 ?residence .
   ?id rdfs:label ?name .
    FILTER NOT EXISTS {?resident bnwdt:P29 bnwd:Q39 .}
  FILTER regex(?name, "mrs *", "i") #this line uses regular expression syntax, described at https://regexper.com/#mrs%5Cs*
  ?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
</sparql>
</sparql>


===People who proposed elections to SAL, sorted by the frequency of individual co-signatories===
===All triples in the wiki, limited to 1000===
 
<sparql tryit="1">
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!
</sparql>
 
===All triples in the wiki, represented as a crude graph===


<sparql tryit="1">
<sparql tryit="1">
# people who proposed elections to SAL, sorted by the frequency of individual co-signatories
#defaultView:Graph
# e.g. Q137 co-signed proposals from Q136 on the number of occasions recorded in the 'co-signatory_count' column
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!
</sparql>
 
===People whose assigned gender we have been unable to determine and/or confirm===


<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 400: Line 406:
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 ?SALproposerLabel ?SALproposer ?co_signatoryLabel ?co_signatory (count(?co_signatory) as ?co_signatory_count) WHERE {
SELECT ?person ?personLabel
   ?person bnp:P16 ?SALstatement .
WHERE {
   ?SALstatement bnps:P16 ?SALproposer .
   ?person bnwdt:P3 ?gender .                              
   ?SALstatement bnpq:P32 ?co_signatory .
   FILTER NOT EXISTS {?person bnwdt:P3 bnwd:Q3 .}          #filter out people identified as women
    SERVICE wikibase:label {
   FILTER NOT EXISTS {?person bnwdt:P3 bnwd:Q10 .}          #filter out people identified as men
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". }  
    }
}
}
GROUP BY ?SALproposerLabel ?SALproposer ?co_signatoryLabel ?co_signatory
ORDER BY ?personLabel
ORDER BY DESC(?co_signatory_count)
</sparql>
</sparql>