query-52e3cb6028116ca4fb7c321f0fe14935
Editors-in-chief and their employers SELECT ?editor ?editorLabel ?empLabel WHERE { ?editor wdt:P31 wd:Q5. ?editor wdt:P39 wd:Q589298 . # holding editor-in-chief positions OPTIONAL { ?editor p:P39 ?prop . ?prop ps:P39 wd:Q589298 . ?prop pq:P108 ?emp . } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Editors-in-chief and their employers
SELECT ?editor ?editorLabel ?empLabel
WHERE
{
?editor wdt:P31 wd:Q5.
?editor wdt:P39 wd:Q589298 . # holding editor-in-chief positions
OPTIONAL {
?editor p:P39 ?prop .
?prop ps:P39 wd:Q589298 .
?prop pq:P108 ?emp . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?editor"):::projected
v3("?emp")
v2("?prop")
c9(["bd:serviceParam"]):::iri
c4(["wd:Q589298"]):::iri
c2(["wd:Q5"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v1 --"p:direct/P31"--> c2
v1 --"p:direct/P39"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:P39".-> v2
v2 --"p:statement/P39"--> c4
v2 --"p:qualifier/P108"--> v3
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end