query-dcdcbddce6bdd00065bee72508846bd7

rq turtle/ttl

SPARQL query

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?accusedid ?genderLabel 
WHERE  
{ 
  ?item wdt:P31 wd:Q5. # must be a human 
  ?item wdt:P4478 ?accusedid . #must have Survey accused id 
  OPTIONAL 
{ 
   ?item wdt:P21 ?gender . 
   } 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Helps get the label in your language, if not, then en language 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?accusedid"):::projected v3("?gender") v1("?item"):::projected c6(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"wdt:P31"--> c2 v1 --"wdt:P4478"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P21".-> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end