Get string without the language tag
Asked Answered
N

1

6

A SPARQL query like:

SELECT distinct *  where  { 
  ?x dc:title ?title .
}

is always returning ?title with a language tag. How to obtain an rdf language string without a language tag, e.g. return "English"@en as "English" only

Natch answered 9/3, 2016 at 10:32 Comment(0)
S
14

I guess you are willing to show the results from one language only. If that is the case, you can take off the label with:

SELECT distinct ?stripped_title  where  { 
?x dc:title ?title .
BIND (STR(?title)  AS ?stripped_title) 
}

but it would be meaningful only after you filter your results for the desired language, e.g.

FILTER ( LANG(?title) = "en" )

Alternatively, there might be some confusion in reading the results, for example you might get seemingly duplicating answers, while it just happened that the label is the same in two different languages.

Sandysandye answered 9/3, 2016 at 10:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.