Project:SPARQL/examples: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 247: Line 247:
}
}
ORDER BY ?personLabel
ORDER BY ?personLabel
</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===
<sparql tryit="1">
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd:  <http://www.wikidata.org/entity/>
SELECT ?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
</sparql>
</sparql>
6,317

edits