From: Richard C. <ri...@cy...> - 2005-05-23 11:14:40
|
Hi, Am 23.05.2005 um 09:21 schrieb Seaborne, Andy: >> From: Charles Nepote <> >> I am trying to query the label of a resource in a particular =20 >> language. >> >> SELECT ?z WHERE (<http://example.org/ex#id>, rdfs:label, ?z@fr) USING >> rdfs FOR <http://www.w3.org/2000/01/rdf-schema#> >> --> error >> >> SELECT ?z WHERE (<http://example.org/ex#id>, rdfs:label, ?z) AND ?=20 >> z =3D~ >> "/@fr/" >> USING rdfs FOR <http://www.w3.org/2000/01/rdf-schema#> >> --> "no match" >> >> Any ideas ? >> See the discussion here : >> http://ilrt.org/discovery/chatlogs/swig/2005-05-20.html#T23-24-35 >> >> --- >> Charles Nepote > > It's "langeq" - it was added very late to RDQL and I don't know how > widely it is implemented. > > AND ?z langeq "fr" > > Which extracts the lang tag and does a language match: > > AND "foo"@en-gb langeq "en" I guess RAP doesn't support langeq. This is the Jena implementation of langeq: http://cvs.sourceforge.net/viewcvs.py/jena/jena2/src/com/hp/hpl/jena/=20 rdql/parser/Q_StringLangEqual.java?rev=3DHEAD&view=3Dauto The rawEval function is the interesting part. > In SPARQL, it is approximately (the regex could be better): > > FILTER regex(lang(?z), "^fr", "i") With subtag match: FILTER REGEX(LANG(?label), '^fr(-|$)', 'i') See also: http://dowhatimean.net/2005/05/the-semantic-web-and-languages-that-=20 are-not-english Richard > And better still > > FILTER ext:lang(?z, "fr") for a custom extension. > > Andy > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_idt12&alloc_id=16344&op=3Dclick > _______________________________________________ > Rdfapi-php-interest mailing list > Rdf...@li... > https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest > > |