Project:SPARQL/examples

From Beyond Notability
Revision as of 09:47, 14 September 2021 by Jwbaker (talk | contribs) (improve labelling of query based on https://beyond-notability.wiki.opencura.com/query/#SELECT%20%3Fa%20%3FaLabel%20%3Fb%20%3Fc%20WHERE%20%7B%0A%20%20%20%20%3Fa%20%3Fb%20%3Fc%0A%20%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen-gb%22.%20%7D%0A%7D%0ALIMIT%20500)

Examples

People whose elections were proposed by men

PREFIX a: <http://beyond-notability.wiki.opencura.com/entity/>
PREFIX b: <http://beyond-notability.wiki.opencura.com/prop/direct/>
SELECT ?personLabel ?persongenderLabel ?electorLabel ?Date
WHERE {  
  ?person b:P7 ?elector ;
          b:P3 ?persongender .
  ?elector b:P3 a:Q10 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". }
}

Try it!