zazuko / xrm

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

csvw: deterministic order of tableSchema and columns in generated output #35

Closed mchlrch closed 4 years ago

mchlrch commented 4 years ago

To be able to effectively diff versions of generated CSVW JSON, the tableSchemas and columns need to be written in a deterministic order.

nnamtug commented 4 years ago

for columns: solution is (partially) covered by #40 , since the introduced CsvwDialectContext will preserve the order within the unused Referenceables. So within 'suppressOutput', this will be deterministic.

But: as soon as something becomes unreferenced, the order of columns will change. @mchlrch feature or bug?

'suppressOutput': https://github.com/zazuko/rdf-mapping-dsl/blob/master/com.zazuko.rdfmapping.dsl.parent/com.zazuko.rdfmapping.dsl/src/com/zazuko/rdfmapping/dsl/generator/CsvwDialectGenerator.xtend#L90

mchlrch commented 4 years ago

But: as soon as something becomes unreferenced, the order of columns will change. @mchlrch feature or bug?

@nnamtug It's a feature. The order of the columns in the generated .csv.meta.json reflects the ordering of the PredicateObjectMappings. Having unreferenced columns together at the end makes sense. I prefer that behaviour over reflecting the column order from referenceables.

I consider this issue resolved and close it