1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
10 Data formats are descriptions of data; they are the data contract
11 between your component and other components. When the components are
12 ‘composed’ into services in the Design tool, they can only be matched with
13 components that have compatible data formats. Data formats will be
14 onboarded to Design tool and assigned a UUID at that time. This UUID is then
15 used to ensure compatibility amoung components. (If component X outputs
16 data format ‘DF-Y’, and another component Z specifies ‘DF-Y’ as its
17 input data format, then X is said to be ``composable`` with component
20 Since data formats will be shared across components, the onboarding
21 catalog should be checked first to see if the desired data format is
22 available before creating one. The vision is to have a repository of
23 shared data formats that developers and teams can re-use and also
24 provide them the means to extend and create new custom data formats. A
25 data format is referenced by its data format id and version number.
30 The data format specification is represented (and validated) against
31 this `Data Format json schema <https://git.onap.org/dcaegen2/platform/plain/mod/component-json-schemas/data-format/dcae-cli-v1/data-format-schema.json>`__
34 Meta Schema Definition
35 ~~~~~~~~~~~~~~~~~~~~~~
37 The “Meta Schema” implementation defines how data format JSON schemas
38 can be written to define user input. It is itself a JSON schema (thus it
39 is a “meta schema”). It requires the name of the data format entry, the
40 data format entry version and allows a description under “self” object.
41 The meta schema version must be specified as the value of the
42 “dataformatversion” key. Then the input schema itself is described as
43 one of the four types listed below:
45 +------------------+---------------------------------------------------+
46 | Type | Description |
47 +==================+===================================================+
48 | jsonschema | inline standard JSON Schema definitions of JSON |
50 +------------------+---------------------------------------------------+
51 | delimitedschema | delimited data input using a JSON description and |
52 | | defined delimiter |
53 +------------------+---------------------------------------------------+
54 | unstructured | unstructured text, and reference that allows a |
55 | | pointer to another artifact for a schema. |
56 +------------------+---------------------------------------------------+
57 | reference | allows for XML and Protocol Buffers schema, |
58 | | but can be used to reference other JSON, |
59 | | delimitedschema and unstructured schemas as well. |
60 +------------------+---------------------------------------------------+
66 By reference example - Common Event Format
67 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69 First the full JSON schema description of the Common Event Format would
70 be loaded with a name of “Common Event Format” and the current version
73 Then the data format description is loaded by this schema:
79 "name": "Common Event Format Definition",
81 "description": "Common Event Format Definition"
84 "dataformatversion": "1.0.0",
86 "name": "Common Event Format",
102 "name": "Simple JSON Example",
104 "description": "An example of unnested JSON schema for Input and output"
107 "dataformatversion": "1.0.0",
109 "$schema": "http://json-schema.org/draft-04/schema#",
116 "required": ["raw-text"],
117 "additionalProperties": false
128 "name": "Nested JSON Example",
130 "description": "An example of nested JSON schema for Input and output"
133 "dataformatversion": "1.0.0",
135 "$schema": "http://json-schema.org/draft-04/schema#",
177 "additionalProperties": false
188 "name": "Unstructured Text Example",
190 "description": "An example of a unstructured text used for both input and output for "
193 "dataformatversion": "1.0.0",
200 An example of a delimited schema
201 --------------------------------
207 "name": "Delimited Format Example",
209 "description": "Delimited format example just for testing"
212 "dataformatversion": "1.0.0",
217 "description": "test field1",
218 "fieldtype": "string"
221 "description": "test field2",
222 "fieldtype": "boolean"
227 Note: The referenced data format (in this case, a schema named “Common
228 Event Format” with version of “25.0.0”) must already exist in the
231 Working with Data Formats
232 -------------------------
234 Data Formats can be validated using `schema <https://git.onap.org/dcaegen2/platform/plain/mod/component-json-schemas/data-format/dcae-cli-v1/data-format-schema.json>`__
235 Once validated, the dataformat can be onboarded using :doc:`DCAE-MOD <../DCAE-MOD/DCAE-MOD-User-Guide>`