query-b5d5754710cb2f76181dac921e34ba94
duos
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT DISTINCT (STRAFTER(STR(?part1), STR(wd:)) AS ?1) ?prop (STRAFTER(STR(?part2), STR(wd:)) AS ?2) ('S3452' AS ?S3452) (STRAFTER(STR(?group), STR(wd:)) AS ?from) {
VALUES (?class ?p ?ps ?prop) {
# FIXME: cannot run both in a single query
#(wd:Q3046146 p:P26 ps:P26 "P26")
(wd:Q16979650 p:P3373 ps:P3373 "P3373")
} .
?group wdt:P31/wdt:P279* ?class; wdt:P527 ?part1, ?part2 .
FILTER( ?part1 != ?part2 ) .
MINUS { ?part1 ?p [ ?ps ?part2 ] } .
} ORDER BY ?from ?1 ?2
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v11("?1")
v11("?2")
v11("?S3452")
v6("?class")
v12("?from")
v10("?group"):::projected
v7("?p")
v4("?part1"):::projected
v5("?part2"):::projected
v9("?prop"):::projected
v8("?ps")
a1((" "))
a2((" "))
f0[["?part1 != ?part2"]]
f0 --> v4
f0 --> v5
bind1[/VALUES ?class ?p ?prop ?ps/]
bind1-->v6
bind1-->v7
bind1-->v8
bind1-->v9
bind10(["wd:Q16979650"])
bind10 --> bind1
bind11(["p:P3373"])
bind11 --> bind1
bind12(["p:statement/P3373"])
bind12 --> bind1
bind13(["P3373"])
bind13 --> bind1
v10 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> v6
v10 --"p:direct/P527"--> v4
v10 --"p:direct/P527"--> v5
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
a2 -->v8--> v5
v4 -->v7--> a2
end
bind3[/"substring-after(str(?part1),str('wd:'))"/]
v4 --o bind3
bind3 --as--o v11
bind4[/"substring-after(str(?part2),str('wd:'))"/]
v5 --o bind4
bind4 --as--o v11
bind5[/"'S3452'"/]
bind5 --as--o v11
bind6[/"substring-after(str(?group),str('wd:'))"/]
v10 --o bind6
bind6 --as--o v12