query-d057890c48c95f3035ed914f56611167
TODO
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
{
SELECT DISTINCT ?item WHERE {
?item wdt:P31/wdt:P279* wd:Q57821.
?item wdt:P17 wd:Q145.
MINUS {
?item p:P361/ps:P361 ?partof.
?partof wdt:P31/wdt:P279* wd:Q57821.
filter not exists {?partof wdt:P31 wd:Q1516079.}
}
MINUS {
?item wdt:P31 wd:Q1516079.
}
?item rdfs:label ?name.
FILTER (lang(?name) = "en")
FILTER(CONTAINS(?name, "Brougham")).
}
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?name")
v3("?partof")
a1((" "))
a2((" "))
a3((" "))
c2(["bd:serviceParam"]):::iri
c4(["#91;AUTO_LANGUAGE#93;"]):::literal
c9(["wd:Q57821"]):::iri
c11(["wd:Q145"]):::iri
c12(["wd:Q1516079"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
f0[["contains(?name,'Brougham')"]]
f0 --> v1
f1[["?name = 'en'"]]
f1 --> v1
v2 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c9
v2 --"p:direct/P17"--> c11
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
f3[["not "]]
subgraph f3e0["Exists Clause"]
e0v1 --"p:direct/P31"--> e0c2
e0v1("?partof"):::projected
e0c2(["wd:Q1516079"]):::iri
end
f3--EXISTS--> f3e0
f3 --> v3
f3 --> c7
f3 --> c12
v3 --"p:direct/P31"--> c12
v2 --"p:P361"--> a2
a2 --"p:statement/P361"--> v3
v3 --"p:direct/P31"--> a3
a3 --"p:direct/P279"--> c9
end
subgraph minus4["MINUS"]
style minus4 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:direct/P31"--> c12
end
v2 --"rdfs:label"--> v1