query-06979ef6d279c66dfc6c3d172f490bd6
No RO labels for Italians
SELECT ?item ?LabelEN ?LabelIT
{
{
SELECT ?item (COUNT(?item) AS ?cnt) {
?item p:P27 [ ps:P27 wd:Q38 ] .
?item p:P27 ?valueStatement .
?item wdt:P31 wd:Q5 .
?sitelink schema:about ?item .
?item wikibase:sitelinks ?s .
FILTER (?s < 2 )
?item rdfs:label ?LabelEN filter (lang(?LabelEN) = "en" ) .
?item rdfs:label ?LabelIT filter (lang(?LabelIT) = "it" ) .
FILTER NOT EXISTS { ?item rdfs:label ?LabelRO filter (lang(?LabelRO) = "ro" ) . }
} GROUP BY ?item
LIMIT 5000
} FILTER(?cnt = 1)
SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en". }
}
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 schema: <http://schema.org/>
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#>
#No RO labels for Italians
SELECT ?item ?LabelEN ?LabelIT
{
{
SELECT ?item (COUNT(?item) AS ?cnt) {
?item p:P27 [ ps:P27 wd:Q38 ] .
?item p:P27 ?valueStatement .
?item wdt:P31 wd:Q5 .
# ?sitelink schema:about ?item .
# ?item wikibase:sitelinks ?s .
# FILTER (?s < 2 )
?item rdfs:label ?LabelEN filter (lang(?LabelEN) = "en" ) .
?item rdfs:label ?LabelIT filter (lang(?LabelIT) = "it" ) .
FILTER NOT EXISTS { ?item rdfs:label ?LabelRO filter (lang(?LabelRO) = "ro" ) . }
} GROUP BY ?item
LIMIT 5000
}
FILTER(?cnt = 1)
# SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?LabelEN"):::projected
v4("?LabelIT"):::projected
v2("?LabelRO")
v7("?cnt")
v3("?item"):::projected
v6("?valueStatement")
a1((" "))
c7(["wd:Q38"]):::iri
c10(["wd:Q5"]):::iri
f0[["?cnt = '1^^xsd:integer'"]]
f0 --> v7
f1[["not "]]
subgraph f1e0["Exists Clause"]
e0f0[["?LabelRO = 'ro'"]]
e0f0 --> e0v1
e0v2 --"rdfs:label"--> e0v1
e0v1("?LabelRO"):::projected
e0v2("?item"):::projected
end
f1--EXISTS--> f1e0
f1 --> v2
f1 --> v3
f1 --> c3
f2[["?LabelRO = 'ro'"]]
f2 --> v2
v3 --"rdfs:label"--> v2
f3[["?LabelIT = 'it'"]]
f3 --> v4
f4[["?LabelEN = 'en'"]]
f4 --> v5
a1 --"p:statement/P27"--> c7
v3 --"p:P27"--> a1
v3 --"p:P27"--> v6
v3 --"p:direct/P31"--> c10
v3 --"rdfs:label"--> v5
v3 --"rdfs:label"--> v4
bind6[/"count(?item)"/]
v3 --o bind6
bind6 --as--o v7