InseeFr / Trevas-TS

JavaScript engine for the Validation and Transformation Language
MIT License
9 stars 8 forks source link

Propose interface for datasets #47

Closed FranckCo closed 3 years ago

FranckCo commented 4 years ago

In order to expand the support of dataset, we need an abstract definition of the dataset type.

romaintailhurat commented 4 years ago

Working on it: https://github.com/InseeFr/VTL-Tools/pull/49

romaintailhurat commented 4 years ago

Because we don't have abstraction like Typescript interface, it's hard to reify our intended "outer" dataset representation.

What would be the best way to document and represent it in the code ?

Our current proposition is an object of this shape:

{
  "ds": {
    // Holds the dataset structure information
    "dataStructure": {
      "col_1": {
        "name": "col_1",
        "role": "MEASURE"
      }
    },
    // Holds the columns, named and stored as arrays
    "dataPoints": {
      "col_1": [
        1,
        2,
        3
      ]
    }
  }
}