rdf-ext / rdf-parser-csvw

CSV on the Web parser
MIT License
16 stars 4 forks source link

Support for multiple table schemas? #40

Closed tpluscode closed 2 years ago

tpluscode commented 2 years ago

I noticed that the parser only supports on schema per table but the property in Metadata class is an array

https://github.com/rdf-ext/rdf-parser-csvw/blob/cae7d1d175f808079e3bf2aa8f450f83ceafe32a/lib/metadata/Metadata.js#L21-L25

On the other hand, the clearly defines tableSchema in section 5.4.2 as:

An object property that provides a single schema description

Was the intention to extend the standard CSVW behaviour and support multiple mappings from on CSV? This would certainly be useful when producing multiple outputs from a single source file in one pass (what we currently do by iterating a single CSV multiple times when mapping multiple times)

Otherwise, would that feature require partially implementing table groups?

bergos commented 2 years ago

The data structure, as it is now, was probably aligned to the spec. The internal data structure will be adapted in an upcoming refactoring, as the parser supports only a single table schema and will do so in the future to avoid joins.

tpluscode commented 2 years ago

It would still be nice to be able to map multiple tables from a single CSVW.

I guess I was wrong and it would not require the use of groups. There can be multiple tables in the single (implicit) group, thus allowing multiple output mappings from a single pass of a csv input. Wouldn't that be desirable?