Project:SPARQL/examples: Difference between revisions

Line 1: Line 1:
==Examples==
==Examples==


===People in the wiki, excluding the project team===
===Women in the wiki, excluding the project team===


<sparql tryit="1">
<sparql tryit="1">
Line 12: Line 12:
PREFIX bnpq: <http://beyond-notability.wiki.opencura.com/prop/qualifier/>
PREFIX bnpq: <http://beyond-notability.wiki.opencura.com/prop/qualifier/>


SELECT ?id ?name
SELECT ?person ?personLabel
WHERE {   
WHERE {   
   ?id rdfs:label ?name .
   ?person bnwdt:P3 bnwd:Q3 .
  ?id bnwdt:P3 ?idGender . #this line assumes that items for people have a gender value
   FILTER NOT EXISTS {?id bnwdt:P4 bnwd:Q12 .}
   FILTER NOT EXISTS {?id bnwdt:P4 bnwd:Q12 .}
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". }  
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". }  
6,317

edits