Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorporate Changes Value-Only from IDTA-01002-3-0-2 #455

Merged
merged 5 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ Illustrations:
Plattform Industrie 4.0; Anna Salari, Publik. Agentur für Kommunikation GmbH, designed by Publik. Agentur für Kommunikation GmbH
////


[[value-only-serialization-example]]
= ValueOnly-Serialization Example

The following example shows the ValueOnly-Serialization for an entire Submodel that validates against the JSON-schema specified in Clause 11.4.3. +
As mentioned in Clause 11.4.3, __SubmodelElementCollection__s cannot be validated within the same schema due to circularity reasons; instead they have their own specific validation schema.
The following example shows the ValueOnly-Serialization for an entire Submodel that validates against the JSON-schema
specified in Clause xref:includes/value-only_json-schema.adoc#json-schema-value-only[JSON-Schema for the Value-Only Serialization]
As mentioned in Clause xref:includes/value-only_json-schema.adoc#json-schema-value-only[JSON-Schema for the Value-Only Serialization],
__SubmodelElementCollection__s cannot be validated within the same schema due to circularity reasons;
instead they have their own specific validation schema.
An exemplary _SubmodelElementCollection_ is added to the following JSON for completeness.
It is, however, not validatable against the schema in Clause 11.4.3 due to the reasons mentioned above.
It is, however, not validatable against the schema
in Clause xref:includes/value-only_json-schema.adoc#json-schema-value-only[JSON-Schema for the Value-Only Serialization]
due to the reasons mentioned above.

[source,json,linenums]
----
Expand Down
6 changes: 3 additions & 3 deletions documentation/IDTA-01001/modules/ROOT/pages/changelog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ Major Changes:
** introduce equivalent matching and rename exact matching to value matching
** added notes
* (Editorial) Adding metamodel element IDs to tables themselves for easier usage (besides grammar defining how to derive them) (https://github.com/admin-shell-io/aas-specs/issues/366[#366])
* Update all metamodel element IDs to V3.1
* Transfer of chapters on formats Metadata, Paths and Value-Only from Part 2 API to Part 1 Metamodel (https://github.com/admin-shell-io/aas-specs/issues/325[#325])
* Enhanced documentation or Value-Only serialization (https://github.com/admin-shell-io/aas-specs/issues/371[#371], https://github.com/admin-shell-io/aas-specs/issues/370[#370])
* Update all metamodel element IDs to V3.1
* Transfer of chapters on formats Metadata, Paths and Value-Only from Part 2 API (IDTA-01002-3-0-2) to Part 1 Metamodel (https://github.com/admin-shell-io/aas-specs/issues/325[#325])
* Enhanced documentation or Value-Only serialization (https://github.com/admin-shell-io/aas-specs/issues/371[#371], https://github.com/admin-shell-io/aas-specs/issues/370[#370])
* (Editorial) Update Chapter on Value-Only Serialization
** add table similar to metadata table: which attributes are displayed in Value-Only serialization
** update examples to provide Value-Only serialization for every submodel element (not in the context of a Submodel as before)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,343 @@
////
Copyright (c) 2023 Industrial Digital Twin Association

This work is licensed under a [Creative Commons Attribution 4.0 International License](
https://creativecommons.org/licenses/by/4.0/).

SPDX-License-Identifier: CC-BY-4.0

////


[[json-schema-value-only]]
=== JSON-Schema for the Value-Only Serialization


The following JSON-Schema represents the validation schema for the ValueOnly-Serialization of submodel elements.
This holds true for all submodel elements mentioned in the previous clause except for _SubmodelElementCollections_.
Since _SubmodelElementCollections_ are treated as objects containing submodel elements of any kind, the integration
into the same validation schema would result in a circular reference or ambiguous results ignoring the actual
validation of submodel elements other than _SubmodelElementCollections_.
Hence, the same validation schema must be applied for each _SubmodelElementCollection_ within a submodel element hierarchy.
In this case, it may be necessary to create a specific JSON-Schema for the individual use case.
The _SubmodelElementCollection_ is added to the following schema for completeness and clarity.
It is, however, not referenced from the _SubmodelElementValue_-oneOf-Enumeration due to the reasons mentioned above.

See xref:annex/valueonly-serialization-example.adoc#value-only-serialization-example[Annex ValueOnly-Serialization Example]
for an example that validates against this schema

[source,json,linenums]
----
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"title": "ValueOnly-Serialization-Schema",
"$id": "https://admin-shell.io/schema/valueonly/json/V3.0",
"definitions": {
"AnnotatedRelationshipElementValue": {
"type": "object",
"properties": {
"first": {
"$ref": "#/definitions/ReferenceValue"
},
"second": {
"$ref": "#/definitions/ReferenceValue"
},
"annotations": {
"$ref": "#/definitions/ValueOnly"
}
},
"required": [
"first",
"second"
],
"additionalProperties": false
},
"BasicEventElementValue": {
"type": "object",
"properties": {
"observed": {
"$ref": "#/definitions/ReferenceValue"
}
},
"required": [
"observed"
],
"additionalProperties": false
},
"BlobValue": {
"type": "object",
"properties": {
"contentType": {
"type": "string",
"minLength": "1",
"maxLength": "100"
},
"value": {
"type": "string",
"minLength": 1
}
},
"required": [
"contentType"
],
"additionalProperties": false
},
"BooleanValue": {
"type": "boolean",
"additionalProperties": false
},
"EntityValue": {
"type": "object",
"properties": {
"statements": {
"$ref": "#/definitions/ValueOnly"
},
"entityType": {
"enum": [
"SelfManagedEntity",
"CoManagedEntity"
]
},
"globalAssetId": {
"type": "string"
},
"specificAssetIds": {
"type": "array",
"items": {
"$ref": "#/definitions/SpecificAssetIdValue"
}
}
},
"required": [
"entityType"
],
"additionalProperties": false
},
"FileValue": {
"type": "object",
"properties": {
"contentType": {
"type": "string",
"minLength": "1",
"maxLength": "100"
},
"value": {
"type": "string",
"minLength": "1",
"maxLength": "2000"
}
},
"required": [
"contentType"
],
"additionalProperties": false
},
"Identifier": {
"type": "string"
},
"Key": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
},
"LangString": {
"type": "object",
"patternProperties": {
"^[a-z]{2,4}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$": {
"type": "string"
}
},
"additionalProperties": false
},
"MultiLanguagePropertyValue": {
"type": "array",
"items": {
"$ref": "#/definitions/LangString"
},
"additionalProperties": false
},
"NumberValue": {
"type": "number",
"additionalProperties": false
},
"OperationRequestValueOnly": {
"inoutputArguments": {
"$ref": "#/definitions/ValueOnly"
},
"inputArguments": {
"$ref": "#/definitions/ValueOnly"
},
"timestamp": {
"type": "string",
"pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)(Z|\\+00:00|-00:00)$"
},
"additionalProperties": false
},
"OperationResultValueOnly": {
"executionState": {
"type": "string",
"enum": ["Initiated", "Running", "Completed", "Canceled",
"Failed", "Timeout"]
},
"inoutputArguments": {
"$ref": "#/definitions/ValueOnly"
},
"outputArguments": {
"$ref": "#/definitions/ValueOnly"
},
"additionalProperties": false
},
"PropertyValue": {
"oneOf": [
{
"$ref": "#/definitions/StringValue"
},
{
"$ref": "#/definitions/NumberValue"
},
{
"$ref": "#/definitions/BooleanValue"
}
]
},
"RangeValue": {
"type": "object",
"properties": {
"min": {
"$ref": "#/definitions/RangeValueType"
},
"max": {
"$ref": "#/definitions/RangeValueType"
}
},
"additionalProperties": false
},
"RangeValueType": {
"oneOf": [
{
"$ref": "#/definitions/StringValue"
},
{
"$ref": "#/definitions/NumberValue"
},
{
"$ref": "#/definitions/BooleanValue"
}
]
},
"ReferenceElementValue": {
"$ref": "#/definitions/ReferenceValue"
},
"ReferenceValue": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["ModelReference", "ExternalReference"]
},
"keys": {
"type": "array",
"items": {
"$ref": "#/definitions/Key"
}
}
},
"additionalProperties": false
},
"RelationshipElementValue": {
"type": "object",
"properties": {
"first": {
"$ref": "#/definitions/ReferenceValue"
},
"second": {
"$ref": "#/definitions/ReferenceValue"
}
},
"required": [
"first",
"second"
],
"additionalProperties": false
},
"SpecificAssetIdValue": {
"type": "object",
"patternProperties": {
"(.*?)": {
"type": "string"
}
}
},
"StringValue": {
"type": "string",
"additionalProperties": false
},
"SubmodelElementCollectionValue": {
"$ref": "#/definitions/ValueOnly"
},
"SubmodelElementListValue": {
"type": "array",
"items": {
"$ref": "#/definitions/SubmodelElementValue"
}
},
"SubmodelElementValue": {
"oneOf": [
{
"$ref": "#/definitions/BasicEventElementValue"
},
{
"$ref": "#/definitions/RangeValue"
},
{
"$ref": "#/definitions/MultiLanguagePropertyValue"
},
{
"$ref": "#/definitions/FileBlobValue"
},
{
"$ref": "#/definitions/ReferenceElementValue"
},
{
"$ref": "#/definitions/RelationshipElementValue"
},
{
"$ref": "#/definitions/AnnotatedRelationshipElementValue"
},
{
"$ref": "#/definitions/EntityValue"
},
{
"$ref": "#/definitions/PropertyValue"
},
{
"$ref": "#/definitions/SubmodelElementListValue"
}
]
},
"ValueOnly": {
"propertyNames": {
"pattern": "^[A-Za-z_][A-Za-z0-9_-]*$"
},
"patternProperties": {
"^[A-Za-z_][A-Za-z0-9_-]*$": {
"$ref": "#/definitions/SubmodelElementValue"
}
},
"additionalProperties": false
}
}
}

----
Loading
Loading