query-6eed534a3e4d30a6c8268accda1f330d
identical label - optimization
Use at
- https://query.wikidata.org/sparql
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#>
SELECT ?item ?dab ?l WHERE
{
?item wdt:P31 wd:Q101352 ; rdfs:label ?l . FILTER( lang(?l) = "en") # "en" or another language
?dab rdfs:label ?l ; wdt:P31 wd:Q4167410 .
FILTER NOT EXISTS { ?item wdt:P1889 ?dab }
FILTER( ?dab != ?item )
# FILTER NOT EXISTS { ?dab wdt:P31 ?inst . FILTER( ?inst != wd:Q4167410 ) }
# FILTER NOT EXISTS { ?item wdt:P31 wd:Q4167410 }
}
LIMIT 10
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?dab"):::projected
v2("?item"):::projected
v3("?l"):::projected
c4(["wd:Q101352"]):::iri
c6(["wd:Q4167410"]):::iri
f0[["?dab != ?item"]]
f0 --> v1
f0 --> v2
f1[["not "]]
subgraph f1e0["Exists Clause"]
e0v1 --"wdt:P1889"--> e0v2
e0v2("?dab"):::projected
e0v1("?item"):::projected
end
f1--EXISTS--> f1e0
f1 --> v2
f1 --> c1
f1 --> v1
v2 --"wdt:P1889"--> v1
f2[["?l = 'en'"]]
f2 --> v3
v2 --"wdt:P31"--> c4
v2 --"rdfs:label"--> v3
v1 --"rdfs:label"--> v3
v1 --"wdt:P31"--> c6