Closed fnielsen closed 2 days ago
SELECT
(CONCAT('<option value="', SUBSTR(STR(?language), 32), '">', ?local_label, ' - ', ?code, ' - ', ?english_label, '</option>') AS ?string)
?audios
# ?language ?languageLabel
WITH {
SELECT
(COUNT(?audio) AS ?audios)
(COUNT(?image) AS ?images)
?language
WHERE {
[] dct:language ?language ;
ontolex:lexicalForm / wdt:P443 ?audio ;
ontolex:sense / wdt:P18 ?image
}
GROUP BY ?language
HAVING (?audios >= 10)
} AS %languages
WHERE {
INCLUDE %languages
?language rdfs:label ?english_label, ?local_label ;
wdt:P424 ?code .
FILTER (LANG(?english_label) = 'en')
FILTER (LANG(?local_label) = ?code)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}
ORDER BY ?code
SELECT
(CONCAT('<option value="', SUBSTR(STR(?language), 32), '">', ?local_label, ' - ', ?code, ' - ', ?english_label, '</option>') AS ?string)
?audios ?images
# ?language ?languageLabel
WITH {
SELECT
(COUNT(?audio) AS ?audios)
(COUNT(?image) AS ?images)
?language
WHERE {
[] dct:language ?language ;
ontolex:lexicalForm / wdt:P443 ?audio ;
ontolex:sense ?sense .
{ ?sense wdt:P18 ?image_via_sense }
UNION
{ ?sense wdt:P5137 / wdt:P18 ?image_via_q }
BIND(COALESCE(?image_via_sense, ?image_via_q) AS ?image)
}
GROUP BY ?language
HAVING (?audios >= 10)
} AS %languages
WHERE {
INCLUDE %languages
?language rdfs:label ?english_label, ?local_label ;
wdt:P424 ?code .
FILTER (LANG(?english_label) = 'en')
FILTER (LANG(?local_label) = ?code)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}
ORDER BY ?code
Variation of https://ordia.toolforge.org/guess-word-from-pronunciation/ and https://ordia.toolforge.org/guess-word-from-image/