query-dbbe65878124dc1cd6571fb62ae51fc6
Airon90
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#>
SELECT ?type1 ?type2 ?type1Label ?type2Label WHERE {
wd:Q3966183 ^wdt:P279 ?type1, ?type2.
wd:Q1266830 ^(wdt:P279/wdt:P279) ?type1, ?type2.
FILTER(?type1 != ?type2)
FILTER NOT EXISTS {
?species p:P31 [
ps:P31 ?type1;
pq:P518 wd:Q25931659
];
p:P31 [
ps:P31 ?type2;
pq:P518 wd:Q25931668
].
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?type1Label ?type2Label
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?species")
v3("?type1"):::projected
v1("?type1Label"):::projected
v5("?type2"):::projected
v2("?type2Label"):::projected
a3((" "))
a1((" "))
a2((" "))
c7(["wd:Q3966183"]):::iri
c8(["wd:Q1266830"]):::iri
c5(["wd:Q25931668"]):::iri
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q25931659"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0a1 --"p:statement/P31"--> e0v1
e0a1 --"p:qualifier/P518"--> e0c3
e0v2 --"p:P31"--> e0a1
e0a2 --"p:statement/P31"--> e0v3
e0a2 --"p:qualifier/P518"--> e0c5
e0v2 --"p:P31"--> e0a2
e0v2("?species"):::projected
e0v1("?type1"):::projected
e0v3("?type2"):::projected
e0a1((" ")):::projected
e0a2((" ")):::projected
e0c5(["wd:Q25931668"]):::iri
e0c3(["wd:Q25931659"]):::iri
end
f0--EXISTS--> f0e0
f0 --> a1
f0 --> c1
f0 --> v3
f0 --> c2
f0 --> c3
f0 --> v4
f0 --> c4
f0 --> a2
f0 --> v5
f0 --> c5
a1 --"p:statement/P31"--> v3
a1 --"p:qualifier/P518"--> c3
v4 --"p:P31"--> a1
a2 --"p:statement/P31"--> v5
a2 --"p:qualifier/P518"--> c5
v4 --"p:P31"--> a2
f1[["?type1 != ?type2"]]
f1 --> v3
f1 --> v5
v3 --"p:direct/P279"--> c7
v5 --"p:direct/P279"--> c7
v3 --"p:direct/P279"--> a3
a3 --"p:direct/P279"--> c8
v5 --"p:direct/P279"--> a3
a3 --"p:direct/P279"--> c8
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end