query-b4da7a707f7c2198e207aa9cb326a652
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?code ?alt
WHERE
{
?item p:P528 ?statement .
?statement ps:P528 ?code ;
pq:P972 wd:Q4411194 .
FILTER NOT EXISTS {
?item skos:altLabel ?alt .
FILTER(LANG(?alt) = 'fi')
FILTER ( str(?alt) = ?code )
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "fi,en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?alt"):::projected
v2("?code"):::projected
v3("?item"):::projected
v4("?statement")
c8(["bd:serviceParam"]):::iri
c6(["wd:Q4411194"]):::iri
c10(["fi,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0f0[["str(?alt) = ?code"]]
e0f0 --> e0v1
e0f0 --> e0v2
e0f1[["?alt = 'fi'"]]
e0f1 --> e0v1
e0v3 --"skos:altLabel"--> e0v1
e0v1("?alt"):::projected
e0v2("?code"):::projected
e0v3("?item"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> v2
f0 --> v3
f0 --> c2
f1[["str(?alt) = ?code"]]
f1 --> v1
f1 --> v2
f2[["?alt = 'fi'"]]
f2 --> v1
v3 --"skos:altLabel"--> v1
v3 --"p:P528"--> v4
v4 --"p:statement/P528"--> v2
v4 --"p:qualifier/P972"--> c6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end