When editing the attribute "official name" (P1448, https://www.wikidata.org/wiki/Property:P1448) of an item the editor has to specify the language. However, this is done via a combobox and nor via a qualifier.
See for instance the item "Szczawno-Zdrój" (Q1001231, https://www.wikidata.org/wiki/Q1001231). One "official name" is "Бад-Зальцбрун" and the language for this value is Belarusian; however the language is not specified via a qualifier like e.g. "start time".
How can the 'pseudo-qualifier' "language" of "official name" be queried for via a SPARQL query?
What you call "pseudo-qualifier" is the so-called language tag.
For specifying a language for a constant string, you can use "my syting"@lang
. For example:
SELECT ?item
WHERE {
?item wdt:P1448 "Бад-Зальцбрун"@be.
}
For specifying a language for a variable string, you can use the lang()
function in the query's body. For example:
SELECT ?officialName
WHERE {
wd:Q1001231 wdt:P1448 ?officialName
FILTER (lang(?officialName) = "be") .
}
For querying a string language, you can use the lang()
function in the query's head. For example:
SELECT ?officialName (lang(?officialName) AS ?lang)
WHERE {
wd:Q1001231 wdt:P1448 ?officialName .
}
References: