query-c555e8bffdcad778cd46dca3c146b33d
Translated labels that have not been added to objects with the same English name
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 ?item2 (CONCAT("L",LANG(?label_for)) AS ?lang) ?label_for WHERE {
?item wdt:P195/wdt:P361 wd:Q63160499. # Object from one of the Khalili Collections
?item rdfs:label ?label_for FILTER(lang(?label_for) != "en"). # Translated label
?item rdfs:label ?label_en FILTER(lang(?label_en) = "en"). # Original label
?item2 wdt:P195/wdt:P361 wd:Q63160499. # Another object from the Khalili Collections
?item2 rdfs:label ?label_en. # Same English label as the object whose label is translated
FILTER NOT EXISTS {?item2 rdfs:label ?label_for} # Suggested label isn't already there (prevents item1=item2)
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?item")
v1("?item2"):::projected
v3("?label_en")
v2("?label_for"):::projected
v5("?lang")
a1((" "))
a2((" "))
c5(["wd:Q63160499"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"rdfs:label"--> e0v2
e0v1("?item2"):::projected
e0v2("?label_for"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"rdfs:label"--> v2
f1[["?label_en = 'en'"]]
f1 --> v3
f2[["?label_for != 'en'"]]
f2 --> v2
v4 --"wdt:P195"--> a1
a1 --"wdt:P361"--> c5
v4 --"rdfs:label"--> v2
v4 --"rdfs:label"--> v3
v1 --"wdt:P195"--> a2
a2 --"wdt:P361"--> c5
v1 --"rdfs:label"--> v3
bind3[/"concat('L',?label_for)"/]
v2 --o bind3
bind3 --as--o v5