atviriduomenys / spinta

Spinta is a framework to describe, extract and publish data (a DEP Framework).
MIT License
10 stars 4 forks source link

Language support in RDF #549

Closed sirex closed 3 months ago

sirex commented 7 months ago
d | r | b | m | property | type    | ref | access
example                  |         |     |
  |   |   | Country      |         | id  |
  |   |   |   | id       | integer |     | open
  |   |   |   | name     | text    |     | open
  |   |   |   | name@lt  | string  |     | open
  |   |   |   | name@en  | string  |     | open

With this manifest file, we should get:

http GET "$SERVER/$DATASET/Country?format(rdf)"
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:pav="http://purl.org/pav/"
    xmlns="http://localhost:8000/">
  <rdf:Description
      rdf:about="/types/text/Country/e4a346e9-5848-4799-af2a-18b4e2acb146"
      rdf:type="types/text/Country"
      pav:version="33e41832-115d-4f07-a514-e5cc02708370">
    <_page>WzEsICJlNGEzNDZlOS01ODQ4LTQ3OTktYWYyYS0xOGI0ZTJhY2IxNDYiXQ==</_page>
    <id>1</id>
    <name xml:lang="lt">Lietuva</name>
  </rdf:Description>
  <rdf:Description
      rdf:about="/types/text/Country/f077eee9-d827-4451-bc0a-7ff1da18a36e"
      rdf:type="types/text/Country"
      pav:version="2791ea9c-1c80-4854-a017-c8aed9e82301">
    <_page>WzIsICJmMDc3ZWVlOS1kODI3LTQ0NTEtYmMwYS03ZmYxZGExOGEzNmUiXQ==</_page>
    <id>2</id>
    <name xml:lang="lt">Latvija</name>
  </rdf:Description>
</rdf:RDF>

Now xml:lang attributes are not added.

We also need a lang(*) function, to expand all languages instead of using just one requested language.

lang() function, should also accept list of languages, for example lang('en', 'lt') and with this, all text type properties should be returned for en and lt languages.

Related