Re: language code and regex

On Sun, Sep 17, 2006 at 11:38:46 +0200, Denis Gaertner wrote:
> 
> Hi,
> 
> another problem, language codes this time. I am trying to incorporate
> the search using regex patterns and language codes having this data for
> instance :
> 
> @prefix foaf: <http://xmlns.com/foaf/0.1/> .
> <http://johnsmith.org/Jonny>     a foaf:Person;
> 	foaf:name "John Smith";
> 	foaf:name "Smith"@en-US;
> 	foaf:name "Schmidt"@de .
> 
> I can do this: 
> 
> ?x ?foaf:name "Schmidt"@de 
> ?x ?foaf:name ?name FILTER (?name = "Schmidt"@de)
> 
> but how do I get this with the regex function? 
> 
> This doesn't catch it: regex(?name, "^Schmidt$") && lang(?name) = "de")

You might need
   regex(STR(?name), "^Schmidt$") && lang(?name) = "de")
STR should strip the language tag from the literal.

- Steve

Received on Sunday, 17 September 2006 10:58:10 UTC