W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > November 2005

[OK?] Re: SPARQL: language tag issues

From: Eric Prud'hommeaux <eric@w3.org>
Date: Tue, 8 Nov 2005 10:26:30 -0500
To: Bjoern Hoehrmann <derhoermi@gmx.net>
Cc: public-rdf-dawg-comments@w3.org
Message-ID: <20051108152630.GI17752@w3.org>
On Fri, Jul 22, 2005 at 02:07:11AM +0200, Bjoern Hoehrmann wrote:
> 
> Dear RDF Data Access Working Group,
> 
>   http://www.w3.org/TR/2005/WD-rdf-sparql-query-20050721/ seems
> to specify a conformance requirement that LANG(?v) MUST return
> a Language tag as defined in RFC 3066, though this is not very
> clear from the draft, please change it such that it uses clearer
> language for conformance requirements.
> 
> If this is indeed a requirement, RFC 3066 must be a normative
> reference, currently it is not. In this case, please change the
> draft such that the reference is normative.
> 
> It is not clear whether this is intended though, note that RFC
> 3066 is currently beeing revised, please coordinate with the
> I18N Core Working Group on how to reference the specification
> for language tags.
> 
> Please s/language string/language tag/.

We have added a langMatches operator to the editor's draft:
  langMATCHES(A, B) string string sop:langMatches(A, B) boolean

with the following definition for the semantics:

11.2.3.11 sop:langMatches [LM]
   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.

  @prefix dc:       <http://purl.org/dc/elements/1.1/> .
  _:a  dc:title         "That Seventies Show"@en .
  _:a  dc:title         "Cette Série des Années Soixante-dix"@fr .
  _:a  dc:title         "Cette Série des Années Septante"@fr-BE .

  This query uses langMatches and lang (described in section 11.2.3.8)
  to find the French titles for the show known in English as "That
  Seventies Show":

  PREFIX dc: <http://purl.org/dc/elements/1.1/>
  SELECT ?title
   WHERE { ?x dc:title  "That Seventies Show"@en ;
              dc:title  ?title .
           FILTER ( langMatches( lang(?title), "FR" ) ) }

  Query result:
  title
  "Cette Série des Années Soixante-dix"@fr
  "Cette Série des Années Septante"@fr-BE


and a normative reference to 3066 [RF]:

    RFC 3066 Tags for the Identification of Languages, H. Alvestrand
    January 2001


If this text meets your requirements, please respond with [CLOSED] in
the subject to allow the issue tracking scripts to close this issue.


[LM] http://www.w3.org/2001/sw/DataAccess/rq23/#func-langMatches
[RF] http://www.w3.org/2001/sw/DataAccess/rq23/#rfc3066
-- 
-eric

office: +81.466.49.1170 W3C, Keio Research Institute at SFC,
                        Shonan Fujisawa Campus, Keio University,
                        5322 Endo, Fujisawa, Kanagawa 252-8520
                        JAPAN
        +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
cell:   +81.90.6533.3882

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Tuesday, 8 November 2005 15:26:43 GMT

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