W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > April 2007

Re: [OK?] Re: [SPARQL] i18n comment: Modification in description of langMatches operator

From: Eric Prud'hommeaux <eric@w3.org>
Date: Sun, 22 Apr 2007 19:21:22 -0700
To: Felix Sasaki <fsasaki@w3.org>
Cc: Addison Phillips <addison@inter-locale.com>, jjc@hpl.hp.com, public-rdf-dawg-comments@w3.org, public-i18n-core@w3.org
Message-ID: <20070423022122.GE27357@w3.org>
* Felix Sasaki <fsasaki@w3.org> [2007-04-23 09:21+0900]
> I think Addison's mail did unfortunately not reach the lists, so I'm 
> sending it here again. Sorry for being late, Addison.
> Felix
> Addison Phillips wrote:
> >All,
> >
> >I sent comments that were apparently similar to Jeremy's to Felix 
> >privately. The following changes are better, but still not quite right 
> >in my opinion.
> >
> >You have currently proposed:
> >
> >-- 
> >Returns true if language-range (second argument) matches language-tag 
> >(first argument). language-range is a basic language range per 
> >Matching of Language Tags [RFC4647] section 2.1 and the matching 
> >scheme is basic filtering defined in [RFC4647] section 3.3.1. A 
> >language-range of "*" matches any non-empty language-tag string.
> >-- 
> >
> >I observe:
> >
> >1. Language matching in RFC 4647 is defined in terms of "language 
> >priority lists" made up of "language ranges". It may be useful to 
> >incorporate this concept into SPARQL query. If necessary, you may 
> >limit the list to a single range.

That is the intention. Multiple ones may be expressed as multiple
langMatches tests:

  FILTER (langMatches(lang(?x), "en") || langMatches(lang(?x), "es"))

> >2. The special range "*" usually matches all language tags, including 
> >the empty tag. If it didn't, you would have the problem of not being 
> >able to select contents with no tag except explicitly. That is, to 
> >select everything, you'd need two queries: one for "*" and one for the 
> >empty tag. (Obviously, omitting the langmatches statement has the same 
> >effect, so your current text may be by design??)

Yes, lang("abc") returns an empty string as giving type errors would
make the language more cumbersome. The use case for looking for
anything with a language tag drove langMatche("", "*") => false.

> >3. You don't have a way of specifying the empty tag, or at least you 
> >don't enumerate it. The empty tag only matches itself. That is:
> >
> > FILTER langMatches( lang(?title), "")
> >
> >only matches items with an xml:lang=""
> >
> >You should call this fact out.

RDF literals with empty language tags are treated as literals
with no language tag.
so <rdf:Description><some:predicate xml:lang="">abc</...></...>
exactly equals 
   <rdf:Description><some:predicate            >abc</...></...>

> >I would thus propose that you change your text to something like this:
> >
> >-- 
> >Returns true if the language priority list in the second argument 
> >matches the language tag in the first argument according to the Basic 
> >Filter matching scheme in Matching of Language Tags [RFC 4647] Section 
> >3.3.1. The language range may consist of one or more basic language 
> >ranges (RFC 4647 Section 2.1) separated by commas or the empty string. 
> >The special range "*" matches all language tag values, including the 
> >empty value, while the empty string matches only items whose language 
> >tag is the empty string.
> >-- 

Are you satisfied with the answers to the 3 points you raised?
Assuming you are (and changing "the language tag" to a typographically
distinct "lanugae-tag" for document consistency), I see one remaining
wording difference: whether it says "returns true if A according to
matching scheme B" or "returns true if A. and the matching scheme is B:

Returns true if language-range (second argument) matches language-tag
(first argument) according to the Basic Filter matching scheme in
Matching of Language Tags [RFC 4647] Section 3.3.1. language-range is
a basic language range per RFC 4647 Section 2.1. The special range "*"
matches any non-empty language-tag string.

I am content with either of these configurations, though slightly
prefer the one just uttered. If you are content with this wording,
please respond with a Subject: prefixed by "[CLOSED]". If not, let's
negotiate some more.

office: +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
mobile: +1.617.599.3509

Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Monday, 23 April 2007 02:21:53 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:52:08 UTC