W3C home > Mailing lists > Public > public-sparql-dev@w3.org > July to September 2006

Re: language code and regex

From: Steve Harris <S.W.Harris@ecs.soton.ac.uk>
Date: Sun, 17 Sep 2006 11:57:47 +0100
To: Denis Gaertner <denis_gaertner@gmx.net>
Cc: public-sparql-dev@w3.org
Message-ID: <20060917105747.GA27509@login.ecs.soton.ac.uk>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:17:05 GMT