query-2a55df0bbf5b95d7a0eb5137c80a9cb8
I'm not sure whether I get you correctly. Does something like this help?
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 ?include ?includeLabel
WHERE {
wd:Q36322 wdt:P3373 ?include .
FILTER NOT EXISTS {
wd:Q36322 wdt:P3373 ?include .
VALUES ?include { wd:Q3101398 wd:Q2505245 }
}
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("?include"):::projected
c1(["wd:Q36322"]):::iri
c4(["bd:serviceParam"]):::iri
c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0c1 --"wdt:P3373"--> e0v2
bind0[/VALUES ?include/]
bind0-->e0v2
bind00(["wd:Q3101398"])
bind00 --> bind0
bind01(["wd:Q2505245"])
bind01 --> bind0
e0v2("?include"):::projected
e0c1(["wd:Q36322"]):::iri
end
f0--EXISTS--> f0e0
f0 --> c1
f0 --> c2
f0 --> v2
c1 --"wdt:P3373"--> v2
bind1[/VALUES ?include/]
bind1-->v2
bind10(["wd:Q3101398"])
bind10 --> bind1
bind11(["wd:Q2505245"])
bind11 --> bind1
c1 --"wdt:P3373"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end