query-b56ac361a759af616e6ddb1077d96ddc

rq turtle/ttl

Limit the domain of both the object and the target

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 DISTINCT ?item ?itemLabel ?value ?valueLabel ?asObject ?asObjectLabel
WHERE
{
  wd:P767 wikibase:claim ?p .
  wd:P794 wikibase:qualifier ?q .
  ?item ?p ?prop . 
  ?prop ?q ?asObject .
  ?property wikibase:statementProperty ?ps .
  ?prop ?ps ?value .
  ?value wdt:P31/wdt:P279* wd:Q5 . #object is a human
  ?asObject wdt:P31/wdt:P279* wd:Q12737077 . #target is an occupation
  SERVICE wikibase:label { bd:serviceParam wikibase:language "yue,en,sv,de,zh,ja,bg,ru"  }    
}
ORDER BY ASC(?itemLabel) 
LIMIT 4000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?asObject"):::projected v4("?item"):::projected v1("?itemLabel"):::projected v2("?p") v5("?prop") v7("?property") v8("?ps") v3("?q") v9("?value"):::projected a1((" ")) a2((" ")) c3(["wd:P794"]):::iri c9(["wd:Q12737077"]):::iri c11(["bd:serviceParam"]):::iri c1(["wd:P767"]):::iri c8(["wd:Q5"]):::iri c13(["yue,en,sv,de,zh,ja,bg,ru"]):::literal c1 --"wikibase:claim"--> v2 c3 --"wikibase:qualifier"--> v3 v4 -->v2--> v5 v5 -->v3--> v6 v7 --"wikibase:statementProperty"--> v8 v5 -->v8--> v9 v9 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c8 v6 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c9 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end