W3C home > Mailing lists > Public > public-ontolex@w3.org > March 2016

Re: [open-linguistics] Question: replacing language codes in a SPARQL BIND statement?

From: Manuel Fiorelli <manuel.fiorelli@gmail.com>
Date: Sun, 13 Mar 2016 22:33:32 +0100
Message-ID: <CAGDmdGg+=dMZjQY7_e+e79+L4-to_4vQ6ot9947vUgnNwaKCbQ@mail.gmail.com>
To: Christian Chiarcos <chiarcos@informatik.uni-frankfurt.de>
Cc: John McCrae <john@mccr.ae>, "A list for those interested in open data in linguistics." <open-linguistics@lists.okfn.org>, public-ontolex <public-ontolex@w3.org>
2016-03-13 20:40 GMT+01:00 Christian Chiarcos <
chiarcos@informatik.uni-frankfurt.de>:

> Am .03.2016, 19:24 Uhr, schrieb Manuel Fiorelli <manuel.fiorelli@gmail.com
> >:
>
> Hi John, All
>
> In the SPARQL 1.1 specification, I found some functions that could be
> useful to Dr. Christian Chiarcos.
>
> STRLANG (https://www.w3.org/TR/sparql11-query/#func-strlang) allows to
> construct an RDF literal from its literal form and language tag, such as:
>
> bind(strlang("Mais", "it") as ?aLiteral)
>
>
> Yes, strlang() was precisely what I was looking for. I felt I was missing
> something obvious, and I cannot quite explain how I missed that when I
> consulted the page. Thanks!
>

I'm happy to have been helpful.


> As for *fully automated* conversion, we can simply strip region subtags
> from the language tag and then consult lexvo (e.g.,
> http://www.lexvo.org/page/iso639-3/rus) to retrieve the iso639-2 tag
> which is then assigned to the string via strlang().
>

I haven't thought at lexvo. Thank you. In fact, after reading your original
question a second time, I realized that probably I misunderstood your
needs: it seems to me that in your use case you know beforehand which
language tags are involved, so that you can probably hard code the relevant
codes in the query.


Best Regards
Manuel Fiorelli
Received on Sunday, 13 March 2016 21:34:01 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 10:57:39 UTC