How to set the language of a variable in sparql?

by cortez.connelly , in category: MySQL , a month ago

How to set the language of a variable in sparql?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by rollin , a month 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).