- From: Eric Prud'hommeaux <eric@w3.org>
- Date: Mon, 10 Oct 2005 12:38:19 -0400
- To: RDF Data Access Working Group <public-rdf-dawg@w3.org>
- Message-ID: <20051010163819.GO17622@w3.org>
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:
11.2.3.5½ 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: <http://purl.org/dc/elements/1.1/> .
_: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 11.2.3.8) find the French names for the show known in English as "That Seventies Show":
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?name
WHERE { ?x dc:name "That Seventies Show"@en ;
dc:name ?name .
FILTER ( langMatches( lang(?name), "FR" ) ) }
Query result:
name
"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.
--
-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 Monday, 10 October 2005 16:38:32 UTC