langMatches wording in sparql query 2005-11-23 and tests

The langMatches definition:
http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/#func-langMatches

is:
[[
 xsd:boolean   langMatches (xsd:string language-range, xsd:string
language-tag)

Returns true if language-range (first argument) matches language-tag
(second argument) per Tags for the Identification of Languages [RFC3066]
section 2.5. RFC3066 defines a case-insensitive, hierarchical matching
algorithm which operates on ISO-defined subtags for language and country
codes, and user defined subtags. In SPARQL, a language-range of "*"
matches any non-empty language-tag string.
]]

so language-range, the first argument, can take '*'.

I think this is backwards, as an example following uses '*' in the
second argument position, and so do the test cases I was puzzling over -
q-langMatches-[1-4].rq

Seems to be the same wording in rq23
http://www.w3.org/2001/sw/DataAccess/rq23/#func-langMatches
as of this date (CVS $Revision: 1.600 $ of $Date: 2006/01/05 18:18:41 $)

I'm also unsure about the tests as q-langMatches-3 returns an answer
with no language but the definition above says * only matches non-empty
languages. q-langMatch-4 which is the negative of that, is similarly
affected.

The tests also rely that LANG(non-literals) returns "" although it's not
so explicit in the text to me as LANG() is only defined for literals,
including in the table "SPARQL Unary Operators".  I was returning a type
error taking anything not allowed as forbidden.

Dave

Received on Friday, 6 January 2006 07:31:46 UTC