Project:SPARQL/examples: Difference between revisions

(add new query)
Line 78: Line 78:
</sparql>
</sparql>


===People elected to SAL or RAI, including who proposed or seconded them, seperated by type===
===People elected to SAL or RAI, including who proposed or seconded them (seperated by type) and date proposals made===


<sparql tryit="1">
<sparql tryit="1">
Line 87: Line 87:




SELECT ?personLabel ?RAIproposedLabel ?RAIsecondedLabel ?SALproposedLabel WHERE
SELECT ?personLabel ?RproposedLabel ?RsecondedLabel ?SproposedLabel ?date WHERE
{
{
     {?person b:P7 ?RAIproposed .}
  ?person ?y ?z .
  ?person b:P3 ?gender .
  ?z bpq:P1 ?date .
     {?person b:P7 ?Rproposed .}
     UNION
     UNION
     {?person b:P8 ?RAIseconded .}
     {?person b:P8 ?Rseconded .}
     UNION
     UNION
     {?person b:P16 ?SALproposed .}   
     {?person b:P16 ?Sproposed .}   
     SERVICE wikibase:label {
     SERVICE wikibase:label {
       bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
       bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
Line 99: Line 102:
}
}
ORDER BY ?person
ORDER BY ?person
# I don't know how to use bpq to give a date for each row: any suggestions appreciated!
</sparql>
</sparql>
6,317

edits