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

* 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.
  http://www.w3.org/TR/rdf-syntax-grammar/#section-literal-node
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.
-- 
-eric

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

(eric@w3.org)
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:55 UTC