- From: Seaborne, Andy <andy.seaborne@hp.com>
- Date: Mon, 27 Mar 2006 12:22:24 +0100
- To: Faisal.Alkhateeb@inrialpes.fr
- CC: public-rdf-dawg-comments@w3.org
Faisal.Alkhateeb@inrialpes.fr wrote:
> Hello,
>
> Regadring the string in sparql, if we have the following DATA:
>
> DATA:
> @prefix foaf: <http://xmlns.com/foaf/0.1/> .
>
> _:a foaf:name "Robert"@EN.
> _:a foaf:name "Roberto"@ES.
> _:a foaf:mbox <mailto:bob@work.example> .
>
> And the following query:
>
> PREFIX foaf: <http://xmlns.com/foaf/0.1/>
> SELECT ?name ?mbox
> WHERE { ?x foaf:name ?name ;
> foaf:mbox ?mbox .
> FILTER ( lang(?name) = "es" ) }
>
> I think that this query fails to match "es" in the FILTER.
>
> And what about if we have 'ES' or '''ES''', does the query match the DATA or
> not?
> Should we transform the literals to a normal form?
>
>
> Best regards,
> Faisal
> INRIA Rhône-Alpes
SPARQL has a specific function to match language tags. It follows the rules
of RFC3066.
http://www.w3.org/2001/sw/DataAccess/rq23/#func-langMatches
FILTER ( langMatches( lang(?name), "es" )
Other examples:
langMatches( "ES", "es" ) ==> true
langMatches( "EN-gb", "en" ) ==> true
langMatches( "EN-gb", "en-g" ) ==> false
I hope this responds to your comment - please let us know if it does.
Andy
----
There is a new mailing list public-sparql-dev@w3.org for general questions on
SPARQL.
Received on Monday, 27 March 2006 11:22:40 UTC