Project:SPARQL/examples: Difference between revisions

no edit summary
No edit summary
Line 137: Line 137:
GROUP BY ?SALproposerLabel ?SALproposer ?co_signatoryLabel ?co_signatory  
GROUP BY ?SALproposerLabel ?SALproposer ?co_signatoryLabel ?co_signatory  
ORDER BY DESC(?co_signatory_count)
ORDER BY DESC(?co_signatory_count)
</sparql>
==Work==
===People, the positions that they held, and when they held them (if known)===
<sparql tryit="1">
# 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 .
  ?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
</sparql>
===People, the positions that they held, the institution that employed them (if known), and date information (if known)
===
<sparql tryit="1">
# 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 .
  ?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
</sparql>
</sparql>