How to set the language of a variable in sparql?

by cortez.connelly , in category: MySQL , 6 months ago

How to set the language of a variable in sparql?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by rollin , 6 months ago

@cortez.connelly 

In SPARQL, you can set the language of a variable by using the lang() function.


For example, if you have a variable ?title and you want to specify that its language is English, you can use the lang() function like this:

1
2
3
4
5
SELECT ?title
WHERE {
  ?resource dc:title ?title .
  FILTER (lang(?title) = "en")
}


This query will only return values of the ?title variable that have a language tag of "en" (English).

Related Threads:

How to set language in vuetify?
How to set default language in yii2?
How to set default language in laravel?
How to apply global language filter across several fields in sparql?
How to auto increment a variable in sparql?
How to bind a string with a variable in sparql?