W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2010

Re: functions detail: lang/langmatches

From: Axel Polleres <axel.polleres@deri.org>
Date: Wed, 3 Nov 2010 14:07:57 +0000
Cc: "SPARQL Working Group" <public-rdf-dawg@w3.org>
Message-Id: <ED54B0E2-9BE5-4601-BD41-289A5CD4FA0B@deri.org>
To: "Lee Feigenbaum" <lee@thefigtrees.net>
> Perhaps instead we could adapt this example to take advantage of BIND or
> project expressions and simply project out the language, so that no
> testing is involved at all?

Good idea!

Axel


On 3 Nov 2010, at 13:29, Lee Feigenbaum wrote:

> On 11/3/2010 9:19 AM, 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.
> 
> I do not like this suggestion.
> 
> I agree with the initial observation that lang(...) = ... doesn't make a
> good example since it's not the best way to do things, but I don't think
> that making the example _more_ complicated is the way to do it.
> 
> Perhaps instead we could adapt this example to take advantage of BIND or
> project expressions and simply project out the language, so that no
> testing is involved at all?
> 
> Lee
> 
> >
> > Axel
> >
> >
> >
> >
> >
> >
> 
Received on Wednesday, 3 November 2010 14:13:41 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:44 GMT