- From: Steve Harris <steve.harris@garlik.com>
- Date: Wed, 3 Nov 2010 15:45:04 +0000
- To: Axel Polleres <axel.polleres@deri.org>
- Cc: SPARQL Working Group <public-rdf-dawg@w3.org>
On 2010-11-03, at 13:19, Axel Polleres wrote:
> Hi all,
>
> A user just made me aware of a small editorial detail we could improve in the query spec to explain lang/langmatches better:
> We have the following example for lang in the spec: http://www.w3.org/TR/rdf-sparql-query/#func-lang
>
> 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> .
>
> This query finds the Spanish foaf:name and foaf:mbox:
>
> PREFIX foaf: <http://xmlns.com/foaf/0.1/>
> SELECT ?name ?mbox
> WHERE { ?x foaf:name ?name ;
> foaf:mbox ?mbox .
> FILTER ( lang(?name) = "ES" ) }
>
>
> Since the example comes before langMatches http://www.w3.org/TR/rdf-sparql-query/#func-langMatches
> users may be inclined to read that this is the way to match language tags.
>
> The suggestion to improve this is as follows:
>
> 1)Add a triple to the graph of the example of lang, i.e.
>
> Data:
>
> @prefix foaf: <http://xmlns.com/foaf/0.1/> .
>
> _:a foaf:name "Robert"@EN.
> _:a foaf:name "Roberto"@ES.
> _:a foaf:name "roberto"@es.
> _:a foaf:mbox <mailto:bob@work.example> .
>
> 2) and after the result add a note with a forward-reference to langMatches, e.g.:
> "
> Note that "roberto"@es is not returned here returned since "=" used in this FILTER checks for string equality in a case-sensitive manner.
> For more general matching of lang-tags, please refer to the function <a href="#func-langMatches>langMatches</a> explained below.
> "
>
> Opinions on this suggestion? I am neutral on it, but think it wouldn't do harm.
There might be issues around legal entailments too, I seem to remember that 4store normalises ISO language identifiers, and that this is legal by whatever RFC defines them.
- Steve
--
Steve Harris, CTO, Garlik Limited
1-3 Halford Road, Richmond, TW10 6AW, UK
+44 20 8439 8203 http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10 9AD
Received on Wednesday, 3 November 2010 16:07:38 UTC