query-488b4633daaba9f12a1847153e7bc6e9
Non-symmetric items of the same classList all fortifications where one item links to something that is also a fortification, but there is no reverse link
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 ?fort1 ?fort1Label ?fort2 ?fort2Label
WHERE
{
?fort1 wdt:P31/wdt:P279* wd:Q57821.
?fort1 wdt:P1889 ?fort2.
MINUS {?fort2 wdt:P1889 ?fort3}
?fort2 wdt:P31/wdt:P279* wd:Q57821.
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;
v1("?fort1"):::projected
v2("?fort2"):::projected
v3("?fort3")
a1((" "))
a2((" "))
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q57821"]):::iri
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P1889"--> v2
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P1889"--> v3
end
v2 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end