[open-linguistics] Question: replacing language codes in a SPARQL BIND statement?
Manuel Fiorelli
manuel.fiorelli at gmail.com
Sun Mar 13 21:33:32 UTC 2016
2016-03-13 20:40 GMT+01:00 Christian Chiarcos <
chiarcos at informatik.uni-frankfurt.de>:
> Am .03.2016, 19:24 Uhr, schrieb Manuel Fiorelli <manuel.fiorelli at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/open-linguistics/attachments/20160313/dd11c3f7/attachment-0003.html>
More information about the open-linguistics
mailing list