Project:SPARQL/examples: Difference between revisions

From Beyond Notability
(Created page with "==Examples== ===People whose elections were proposed by men=== <sparql tryit="1"> PREFIX a: <http://beyond-notability.wiki.opencura.com/entity/> PREFIX b: <http://beyond-not...")
 
(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)
Line 11: Line 11:
           b:P3 ?persongender .
           b:P3 ?persongender .
   ?elector b:P3 a:Q10 .
   ?elector b:P3 a:Q10 .
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb" .}  
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". }
}
}
</sparql>
</sparql>

Revision as of 09:47, 14 September 2021

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!