-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sebastian Schleemilch <[email protected]>
- Loading branch information
1 parent
22c1a6a
commit 94c3a88
Showing
7 changed files
with
74 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
title: "Data Formats" | ||
date: 2024-08-29T12:36:12+02:00 | ||
weight: 25 | ||
--- | ||
|
||
## Data Formats | ||
|
||
For some data it is necessary to specify the format. | ||
An example are dates. | ||
Let's say we specify a leaf e.g. `Vehicle.ProductionDate` and give it | ||
the datatype `string`. How would a consumer know what to expect in this string? | ||
It could be ISO8601, it could be a unix-timestamp or it could be something totally different. | ||
To provide that info, a `format` field can be used. | ||
|
||
A complete definition of the imaginary `ProductionDate` field could then look like this: | ||
|
||
```yaml | ||
Vehicle.ProductionDate: | ||
description: The production date of the car | ||
datatype: string | ||
format: iso8601 | ||
``` | ||
All formats being used have to be specified in format definition files. | ||
## Format definitions file | ||
It has the following format: | ||
```yaml | ||
unix-time: | ||
description: Unix Timestamp | ||
allowed-datatypes: ['uint32','uint64','int64'] | ||
``` | ||
Both fields are required: | ||
- `description`: Should specify how the format is specified | ||
- `allowed-datatypes`: Datatypes allowed when using this format. The consistency will be enforced by `vss-tools` | ||
|
||
Please note that you can either specify `unit` or `format`. | ||
|
||
|
||
## Supported Data Formats in VSS Standard Catalog | ||
|
||
The catalog defines common formats in the `formats.yaml` file similar to how units are handled. `vss-tools` provides an interface to pass one or more format files. | ||
Like with unit files, `formats.yaml` will be loaded if it is present on the level | ||
of the given entry point `vspec` file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
unix-time: | ||
description: Unix time in seconds | ||
allowed-datatypes: ['uint32','uint64','int64'] | ||
unix-time-ms: | ||
description: Unix time in milliseconds | ||
allowed-datatypes: ['uint32','uint64','int64'] | ||
iso8601: | ||
description: Date and Time expressed as a string according to ISO 8601 | ||
allowed-datatypes: ['string'] | ||
ipv4: | ||
description: Internet Protocol version 4 | ||
allowed-datatypes: ['string'] | ||
ipv6: | ||
description: Internet Protocol version 6 | ||
allowed-datatypes: ['string'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters