lang-match proposal

ACTION: ericp to draft lang-match design, summarizing and citing RFC3066

I've drafted (1.502) an exciting new section with this proposal in it:½ sop:langMatches

Returns whether the first argument is the same as, or a sublanguage of, the second argument per Tags for the Identification of Languages [RFC3066] section 2.5, "Language-range".

 langMatches("en_US", "EN")

@prefix dc:       <> .

_:a  dc:name         "That Seventies Show"@en .
_:a  dc:name         "Cette Série des Années Septante"@fr-BE .
_:a  dc:name         "Cette Série des Années Soixante-dix"@fr-FR .

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

PREFIX dc: <>
SELECT ?name
 WHERE { ?x dc:name  "That Seventies Show"@en ;
            dc:name  ?name .
         FILTER ( langMatches( lang(?name), "FR" ) ) }

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

I had fun looking for an example where country codes would matter.
Thanks to MaxF.

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

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

Received on Monday, 10 October 2005 16:38:32 UTC