query-76062e4f5c39eb03c141a2994cc94cb6
Comparison of labels in different languages 07:01, 23 December 2016 (UTC)) talk (FlorentynaAim of this task is to find out the correctness of Chinese labels by comparison. The following columns would be needed: Item, label Chinese simple, label Chinese traditional. It should be displayed only items, where at least one of the Chinese versions exists. Items, where both labels are missing should not be displayed (again for occupation badminton player like in the case before). Hello again. I dared to set up a slightly different query which I think could be more useful for your task:
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?numberOfDifferentChineseLabels WHERE {
{
SELECT ?item (COUNT(DISTINCT ?plainlabel) AS ?numberOfDifferentChineseLabels) WHERE {
{
SELECT ?item WHERE {
?item wdt:P106 wd:Q13141064 .
}
}
OPTIONAL {
?item rdfs:label ?label .
BIND(STR(?label) AS ?plainlabel) .
}
FILTER( SUBSTR(LANG(?label), 0, 2) = "zh" ) .
FILTER( BOUND(?label) ) .
} GROUP BY ?item
}
FILTER(?numberOfDifferentChineseLabels > 1) .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
} ORDER BY DESC(?numberOfDifferentChineseLabels)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v2("?label")
v5("?numberOfDifferentChineseLabels"):::projected
v4("?plainlabel")
c9(["bd:serviceParam"]):::iri
c11(["en"]):::literal
c6(["wd:Q13141064"]):::iri
f0[["?numberOfDifferentChineseLabels > '1^^xsd:integer'"]]
f0 --> v5
f1[["bound(?label)"]]
f1 --> v2
f2[["substring(?label,'0^^xsd:integer','2^^xsd:integer') = 'zh'"]]
f2 --> v2
v3 --"wdt:P106"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."rdfs:label".-> v2
bind3[/"str(?label)"/]
v2 --o bind3
bind3 --as--o v4
end
bind5[/"count(?plainlabel)"/]
v4 --o bind5
bind5 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end