Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improper handling of lists in columns #15

Open
jakubklimek opened this issue Nov 21, 2023 · 0 comments
Open

Improper handling of lists in columns #15

jakubklimek opened this issue Nov 21, 2023 · 0 comments

Comments

@jakubklimek
Copy link
Contributor

I think rdf-tabular does not handle lists in columns properly, when mapping to RDF.
I have a dataset of applications classified by their themes, and I need a list of themes to be in one column (I have the "normalized" version elsewhere). So the data looks like this:

app,theme
https://app1,http://publications.europa.eu/resource/authority/data-theme/SOCI
https://app2,http://publications.europa.eu/resource/authority/data-theme/INTR http://publications.europa.eu/resource/authority/data-theme/JUST

I utilize the separator feature of CSVW like this:

{
    "@context": "http://www.w3.org/ns/csvw",
    "url": "app.csv",
    "tableSchema": {
        "columns": [
            {
                "name": "app",
                "titles": "app",
                "aboutUrl": "{+app}",
                "propertyUrl": "rdf:type",
                "valueUrl": "dcat:Resource",
                "required": true,
                "datatype": "anyURI"
            }, {
                "name": "theme",
                "titles": "theme",
                "aboutUrl": "{+app}",
                "propertyUrl": "http://www.w3.org/ns/dcat#theme",
                "valueUrl": "{+theme}",
                "required": true,
                "separator": " "
            }
        ],
        "primaryKey": "app"
    }
}

Then I translate this to RDF using rdf serialize --input-format tabular --output-format turtle --minimal app.csv. I get:

@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<https://app1> a dcat:Resource;
  dcat:theme <http://publications.europa.eu/resource/authority/data-theme/SOCI> .

<https://app2> a dcat:Resource;
  dcat:theme <http://publications.europa.eu/resource/authority/data-theme/INTR,http://publications.europa.eu/resource/authority/data-theme/JUST> .

Note the comma in the dcat:theme value. What I would expect is multiple values like this:

@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<https://app1> a dcat:Resource;
  dcat:theme <http://publications.europa.eu/resource/authority/data-theme/SOCI> .

<https://app2> a dcat:Resource;
  dcat:theme <http://publications.europa.eu/resource/authority/data-theme/INTR>, <http://publications.europa.eu/resource/authority/data-theme/JUST> .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant