3,427
edits
Line 3,230: | Line 3,230: | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# query to | # query to check for any items/properties which don't have "en" labels. [currently not an issue but retained for reference.] | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 3,245: | Line 3,243: | ||
SELECT | SELECT | ||
?item | ?item ?itemLabel | ||
(group_concat(distinct ?language) as ?languages) | (group_concat(distinct ?language) as ?languages) | ||
(count(distinct ?rdfs_label) as ?count) # TIL: where you put distinct matters! | (count(distinct ?rdfs_label) as ?count) # TIL: where you put distinct matters! | ||
Line 3,251: | Line 3,249: | ||
WHERE { | WHERE { | ||
?item bnwdt:P12 ?s. # limit to items with instance of. speeds up the query a lot cf. fetching anything. | #?item bnwdt:P12 ?s. # limit to items with instance of. speeds up the query a lot cf. fetching anything. | ||
?item ?p ?s. # anything. takes a while, adds ~20 not found in the instance of version | |||
?item rdfs:label ?rdfs_label . # rdfs item label (1 per language). | ?item rdfs:label ?rdfs_label . # rdfs item label (1 per language). | ||
BIND(LANG(?rdfs_label) as ?language) . # get 2 letter language codes | BIND(LANG(?rdfs_label) as ?language) . # get 2 letter language codes | ||
#optional { ?item rdfs:label ?engb . filter(lang(?engb)="en-gb"). } | #optional { ?item rdfs:label ?engb . filter(lang(?engb)="en-gb"). } | ||
optional { ?item rdfs:label ?en . filter(lang(?en)="en"). } | #optional { ?item rdfs:label ?en . filter(lang(?en)="en"). } | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en-gb, en". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en-gb, en". } | ||
} | } | ||
group by ?item | group by ?item ?itemLabel | ||
HAVING (?count<2) | HAVING (?count<2) | ||
order by ?item | order by ?item |
edits