aas_core_rc02.jsonization

Provide de/serialization of AAS classes to/from JSON.

We can not use one-pass deserialization for JSON since the object properties do not have fixed order, and hence we can not read modelType property ahead of the remaining properties.

class aas_core3_rc02.jsonization.PropertySegment(instance: Mapping[str, Any], name: str)[source]

Represent a property on a path to the erroneous value.

__init__(instance: Mapping[str, Any], name: str) None[source]

Initialize with the given values.

instance: Final[Mapping[str, Any]]

Instance that contains the property

name: Final[str]

Name of the property

class aas_core3_rc02.jsonization.IndexSegment(container: Iterable[Any], index: int)[source]

Represent an index access on a path to the erroneous value.

__init__(container: Iterable[Any], index: int) None[source]

Initialize with the given values.

container: Final[Iterable[Any]]

Container that contains the item

index: Final[int]

Index of the item

class aas_core3_rc02.jsonization.Path[source]

Represent the relative path to the erroneous value.

__init__() None[source]

Initialize as an empty path.

property segments: Sequence[Union[PropertySegment, IndexSegment]]

Get the segments of the path.

__str__() str[source]

Return str(self).

exception aas_core3_rc02.jsonization.DeserializationException(cause: str)[source]

Signal that the JSON de-serialization could not be performed.

__init__(cause: str) None[source]

Initialize with the given cause and an empty path.

cause: Final[str]

Human-readable explanation of the exception’s cause

path: Final[Path]

Relative path to the erroneous value

aas_core3_rc02.jsonization.has_semantics_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) HasSemantics[source]

Parse an instance of types.HasSemantics from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Concrete instance of types.HasSemantics

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.extension_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Extension[source]

Parse an instance of types.Extension from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.Extension

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.has_extensions_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) HasExtensions[source]

Parse an instance of types.HasExtensions from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Concrete instance of types.HasExtensions

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.referable_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Referable[source]

Parse an instance of types.Referable from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Concrete instance of types.Referable

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.identifiable_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Identifiable[source]

Parse an instance of types.Identifiable from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Concrete instance of types.Identifiable

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.modeling_kind_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) ModelingKind[source]

Convert the JSON-able structure jsonable to a literal of types.ModelingKind.

Parameters

jsonable – JSON-able structure to be parsed

Returns

parsed literal

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.has_kind_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) HasKind[source]

Parse an instance of types.HasKind from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Concrete instance of types.HasKind

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.has_data_specification_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) HasDataSpecification[source]

Parse an instance of types.HasDataSpecification from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Concrete instance of types.HasDataSpecification

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.administrative_information_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) AdministrativeInformation[source]

Parse an instance of types.AdministrativeInformation from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.AdministrativeInformation

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.qualifiable_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Qualifiable[source]

Parse an instance of types.Qualifiable from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Concrete instance of types.Qualifiable

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.qualifier_kind_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) QualifierKind[source]

Convert the JSON-able structure jsonable to a literal of types.QualifierKind.

Parameters

jsonable – JSON-able structure to be parsed

Returns

parsed literal

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.qualifier_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Qualifier[source]

Parse an instance of types.Qualifier from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.Qualifier

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.asset_administration_shell_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) AssetAdministrationShell[source]

Parse an instance of types.AssetAdministrationShell from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.AssetAdministrationShell

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.asset_information_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) AssetInformation[source]

Parse an instance of types.AssetInformation from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.AssetInformation

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.resource_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Resource[source]

Parse an instance of types.Resource from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.Resource

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.asset_kind_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) AssetKind[source]

Convert the JSON-able structure jsonable to a literal of types.AssetKind.

Parameters

jsonable – JSON-able structure to be parsed

Returns

parsed literal

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.specific_asset_id_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) SpecificAssetId[source]

Parse an instance of types.SpecificAssetId from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.SpecificAssetId

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.submodel_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Submodel[source]

Parse an instance of types.Submodel from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.Submodel

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.submodel_element_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) SubmodelElement[source]

Parse an instance of types.SubmodelElement from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Concrete instance of types.SubmodelElement

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.relationship_element_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) RelationshipElement[source]

Parse an instance of types.RelationshipElement from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Concrete instance of types.RelationshipElement

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.aas_submodel_elements_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) AasSubmodelElements[source]

Convert the JSON-able structure jsonable to a literal of types.AasSubmodelElements.

Parameters

jsonable – JSON-able structure to be parsed

Returns

parsed literal

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.submodel_element_list_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) SubmodelElementList[source]

Parse an instance of types.SubmodelElementList from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.SubmodelElementList

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.submodel_element_collection_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) SubmodelElementCollection[source]

Parse an instance of types.SubmodelElementCollection from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.SubmodelElementCollection

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.data_element_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) DataElement[source]

Parse an instance of types.DataElement from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Concrete instance of types.DataElement

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.property_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Property[source]

Parse an instance of types.Property from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.Property

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.multi_language_property_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) MultiLanguageProperty[source]

Parse an instance of types.MultiLanguageProperty from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.MultiLanguageProperty

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.range_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Range[source]

Parse an instance of types.Range from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.Range

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.reference_element_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) ReferenceElement[source]

Parse an instance of types.ReferenceElement from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.ReferenceElement

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.blob_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Blob[source]

Parse an instance of types.Blob from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.Blob

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.file_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) File[source]

Parse an instance of types.File from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.File

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.annotated_relationship_element_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) AnnotatedRelationshipElement[source]

Parse an instance of types.AnnotatedRelationshipElement from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.AnnotatedRelationshipElement

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.entity_type_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) EntityType[source]

Convert the JSON-able structure jsonable to a literal of types.EntityType.

Parameters

jsonable – JSON-able structure to be parsed

Returns

parsed literal

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.entity_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Entity[source]

Parse an instance of types.Entity from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.Entity

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.direction_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Direction[source]

Convert the JSON-able structure jsonable to a literal of types.Direction.

Parameters

jsonable – JSON-able structure to be parsed

Returns

parsed literal

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.state_of_event_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) StateOfEvent[source]

Convert the JSON-able structure jsonable to a literal of types.StateOfEvent.

Parameters

jsonable – JSON-able structure to be parsed

Returns

parsed literal

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.event_payload_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) EventPayload[source]

Parse an instance of types.EventPayload from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.EventPayload

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.event_element_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) EventElement[source]

Parse an instance of types.EventElement from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Concrete instance of types.EventElement

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.basic_event_element_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) BasicEventElement[source]

Parse an instance of types.BasicEventElement from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.BasicEventElement

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.operation_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Operation[source]

Parse an instance of types.Operation from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.Operation

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.operation_variable_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) OperationVariable[source]

Parse an instance of types.OperationVariable from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.OperationVariable

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.capability_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Capability[source]

Parse an instance of types.Capability from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.Capability

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.concept_description_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) ConceptDescription[source]

Parse an instance of types.ConceptDescription from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.ConceptDescription

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.reference_types_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) ReferenceTypes[source]

Convert the JSON-able structure jsonable to a literal of types.ReferenceTypes.

Parameters

jsonable – JSON-able structure to be parsed

Returns

parsed literal

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.reference_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Reference[source]

Parse an instance of types.Reference from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.Reference

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.key_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Key[source]

Parse an instance of types.Key from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.Key

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.key_types_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) KeyTypes[source]

Convert the JSON-able structure jsonable to a literal of types.KeyTypes.

Parameters

jsonable – JSON-able structure to be parsed

Returns

parsed literal

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.data_type_def_xsd_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) DataTypeDefXsd[source]

Convert the JSON-able structure jsonable to a literal of types.DataTypeDefXsd.

Parameters

jsonable – JSON-able structure to be parsed

Returns

parsed literal

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.lang_string_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) LangString[source]

Parse an instance of types.LangString from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.LangString

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.environment_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) Environment[source]

Parse an instance of types.Environment from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.Environment

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.data_specification_content_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) DataSpecificationContent[source]

Parse an instance of types.DataSpecificationContent from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Concrete instance of types.DataSpecificationContent

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.embedded_data_specification_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) EmbeddedDataSpecification[source]

Parse an instance of types.EmbeddedDataSpecification from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.EmbeddedDataSpecification

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.data_type_iec_61360_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) DataTypeIEC61360[source]

Convert the JSON-able structure jsonable to a literal of types.DataTypeIEC61360.

Parameters

jsonable – JSON-able structure to be parsed

Returns

parsed literal

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.level_type_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) LevelType[source]

Convert the JSON-able structure jsonable to a literal of types.LevelType.

Parameters

jsonable – JSON-able structure to be parsed

Returns

parsed literal

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.value_reference_pair_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) ValueReferencePair[source]

Parse an instance of types.ValueReferencePair from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.ValueReferencePair

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.value_list_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) ValueList[source]

Parse an instance of types.ValueList from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.ValueList

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.data_specification_iec_61360_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) DataSpecificationIEC61360[source]

Parse an instance of types.DataSpecificationIEC61360 from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.DataSpecificationIEC61360

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.data_specification_physical_unit_from_jsonable(jsonable: Union[bool, int, float, str, Sequence[Any], Mapping[str, Any]]) DataSpecificationPhysicalUnit[source]

Parse an instance of types.DataSpecificationPhysicalUnit from the JSON-able structure jsonable.

Parameters

jsonable – structure to be parsed

Returns

Parsed instance of types.DataSpecificationPhysicalUnit

Raise

DeserializationException if unexpected jsonable

aas_core3_rc02.jsonization.to_jsonable(that: Class) Union[bool, int, float, str, List[Any], MutableMapping[str, Any]][source]

Convert that to a JSON-able structure.

Parameters

that – AAS data to be recursively converted to a JSON-able structure

Returns

JSON-able structure which can be further encoded with, e.g., json