Platform Requirements¶
One of the main purposes of ts-ids-core is to enable users to streamline IDS creation by automatically disallowing IDS definitions which are incompatible with the TetraScience platform.
Publishing an IDS to the TetraScience platform can be done using the TetraScience software development kit, ts-sdk, and is often done while creating a self-service pipeline.
Each IDS project should contain the required file set that completes an IDS artifact.
Upon publishing an IDS to the platform, schema.json, athena.json, and elasticsearch.json are validated that each document conforms to its respective requirements detailed below.
Under the hood this validation is performed by TetraScience’s publicly available Python package, ts-ids-validator.
Note that ts-ids-validator currently validates a larger rule set than ts-ids-core enforces and ts-ids-core only enforces definitions for schema.json.
See the table below to understand Platform requirements of IDS artifacts and the differences between what is validated on publishing an IDS vs. what is automatically enforced using ts-ids-core.
schema.json platform requirements¶
# |
Rule |
Checked by |
Enforced in |
|---|---|---|---|
1 |
All field names should be snake case . |
Yes |
No |
2 |
Field names cannot have any special characters other than non-leading single underscores with the exception of TetraScience defined fields leading with |
Yes |
No |
3 |
Every object type field should always have |
Yes |
Yes |
4 |
If a field is in the |
Yes |
Yes |
5 |
Fields with type |
Yes |
Yes |
6 |
|
Yes |
No |
7 |
|
Yes |
Yes when inheriting from |
8 |
When updating an existing IDS the |
Yes |
No |
9 |
If |
Yes |
Yes when defining the |
10 |
If |
Yes |
Yes when defining the |
11 |
If |
Yes |
Yes when defining the |
elasticsearch.json platform requirements¶
# |
Rule |
Checked by |
|---|---|---|
1 |
|
Yes |
2 |
All fields defined in |
Yes |
3 |
The |
Yes |
athena.json platform requirements¶
# |
Rule |
Checked by |
|---|---|---|
1 |
The partition name cannot collide with any of the normalized IDS paths. See details here. |
Yes |
2 |
The partition path cannot be a field in an array of objects. See details here. |
Yes |
3 |
The partition path must correspond to a field in the IDS artifact’s |
Yes |
IDS versioning rules¶
It is important to version your IDSs in a way that is platform compliant.
As mentioned in rule #7 above, it is required that an IDS contains the field @idsVersion whose value is a version string which follows the semantic versioning specification.
Semantic versioning rules specific to IDSs follow.
It’s necessary to follow these rules, otherwise you may not see changes reflected in the platform even though you made the change in your IDS.
Major version change¶
Add new fields or add new table
Data fields are removed, renamed, or re-structured
Data field primitive type is modified (e.g.
"string"->"number")Disallow a value to be null (e.g.
{"type": ["string", null]}->{"type": "string"})Making a non-required field required
Adding a constraint (e.g.
"maximum": 100)
Minor version change¶
There are no platform-specific needs for a minor version change. Versioning change to the minor version is up to the user’s rule set.
Patch version change¶
Making a required field non-required (note required here refers to the required array in an object)
Add support for null type to a field (e.g.
{"type": "string"}->{"type": ["string", null]})