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

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