query-268a5768352e12af8214550a68953e91
TODO
Use at
- https://query.wikidata.org/sparql
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 ?occLabel WHERE {
?item wdt:P106/wdt:P279* wd:Q1930187 . #item has occ of journalist or occ which is subclass of journalist
?item wdt:P106 ?occ. #get an occ value for the Label
?occ wdt:P279* wd:Q1930187 . # Outriggr addition: get rid of non-sub-journalist occupation ROWS (or so it seems)
FILTER NOT EXISTS {?item wdt:P106 wd:Q1930187 } #discard the item if it has occ=journalist
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
LIMIT 100
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v2("?occ")
a1((" "))
c2(["wd:Q1930187"]):::iri
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P106"--> e0c2
e0v1("?item"):::projected
e0c2(["wd:Q1930187"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> c2
v1 --"wdt:P106"--> c2
v1 --"wdt:P106"--> a1
a1 --"wdt:P279"--> c2
v1 --"wdt:P106"--> v2
v2 --"wdt:P279"--> c2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end