query-4c9306c20c0740198b59dee591d936ea
Help me make this query more organizedIs there a more efficient method for me to add new items without the need to repeatedly input additional text for each new item? I would like to seamlessly add statements 4, 5, 6, and so on as they arise.
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT DISTINCT ?item
WHERE {
?item p:P1733 ?statement0.
?statement0 (ps:P1733) _:anyValueP1733_0.
MINUS {
?item p:P8956 ?statement1.
?statement1 (ps:P8956/(wdt:P279*)) _:anyValueP8956.
}
MINUS {
?item p:P1733 ?statement2.
?statement2 (ps:P1733) "7940".
}
MINUS {
?item p:P1733 ?statement3.
?statement3 (ps:P1733) "245300".
}
}
LIMIT 100
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v2("?statement0")
v3("?statement1")
v4("?statement2")
v5("?statement3")
a1((" "))
a3((" "))
a2((" "))
c6(["7940"]):::literal
c7(["245300"]):::literal
v1 --"p:P1733"--> v2
v2 --"p:statement/P1733"--> a1
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"p:P8956"--> v3
v3 --"p:statement/P8956"--> a2
a2 --"p:direct/P279"--> a3
end
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v1 --"p:P1733"--> v4
v4 --"p:statement/P1733"--> c6
end
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
v1 --"p:P1733"--> v5
v5 --"p:statement/P1733"--> c7
end