zazuko / xrm

A friendly language for mappings to RDF
MIT License
1 stars 0 forks source link

csvw: omit "tables" in JSON output #70

Closed ktk closed 4 years ago

ktk commented 4 years ago

We do not support the tables part of the CSVW spec in our own CSVW parser, as our parser is a pure streaming parser and we cannot do some of the things in the specification where tablesmakes sense when we are streaming data.

I don't mind if we leave it in for other CSVW processors but I need at least an optional way to get rid of that nesting in the output. I see two ways of doing that:

mchlrch commented 4 years ago

Let's do the first one: Only add the "tables": [ ] nesting in the output, if there is more than one map in one .xrm file

Generated output, if there's only one map:

{
    "@context": "http://www.w3.org/ns/csvw",
    "url": "http://www.example.com/departments.csv",
    "tableSchema": {
        "aboutUrl": "http://www.example.com/department/{DEPTNO}",
        "columns": [...]
    }
}
nnamtug commented 4 years ago

simple change in one commit -> pushing this directly to master

mchlrch commented 4 years ago

Works as expected. Closing this.