W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > January 2006

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

From: Dave Beckett <dave@dajobe.org>
Date: Thu, 05 Jan 2006 23:31:37 -0800
Message-ID: <43BE1CD9.2060809@dajobe.org>
To: public-rdf-dawg-comments@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:49 GMT