query-3c32e8d972d93fe5a32c2dd329be18d8
Propertiesinstance of (P31)subclass of (P279)present in work (P1441)
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 ?item ?itemLabel ?workLabel
WHERE {
VALUES ?work {wd:Q438406 wd:Q283393} # Grey's anatomy or Private Practice
?item wdt:P31/wdt:P279? wd:Q95074 . #a fictional character or subclass of a fictional character
?item wdt:P1441 ?work #present in work
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;
v2("?item"):::projected
v1("?work")
a1((" "))
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q95074"]):::iri
bind0[/VALUES ?work/]
bind0-->v1
bind00(["wd:Q438406"])
bind00 --> bind0
bind01(["wd:Q283393"])
bind01 --> bind0
v2 --"wdt:P31"--> a1
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
a1 --"wdt:P279"--> c2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
end
union0r <== or ==> union0l
end
v2 --"wdt:P1441"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end