Okilele
Okilele

Reputation: 85

WIKIDATA/SPARQL: How to get the used language when using SERVICE wikibase:label with [AUTO_LANGUAGE] parameter

About everything in the title : When I use SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } I may get some results with the detected [AUTO_LANGUAGE] and others in 'en'. Is it possible to get the used language for each of the lines of the result ?

Upvotes: 0

Views: 939

Answers (1)

Matthias Winkelmann
Matthias Winkelmann

Reputation: 16394

Yes. LANG(?var) does that:

SELECT ?item ?itemLabel  (LANG(?itemLabel) as ?langLabel)
    WHERE {
        ?item wdt:P31 wd:Q146.
        SERVICE wikibase:label { 
            bd:serviceParam wikibase:language "de,fr,en".   
        }
    }

Upvotes: 3

Related Questions