aas_core3_2.verification

Verify that the instances of the meta-model satisfy the invariants.

Here is an example how to verify an instance of aas_core3_2.types.Extension:

import aas_core3_2.types as our_types
import aas_core3_2.verification as our_verification

an_instance = our_types.Extension(
    # ... some constructor arguments ...
)

for error in our_verification.verify(an_instance):
    print(f"{error.cause} at: {error.path}")
aas_core3_2.verification.matches_id_short(text: str) → bool[source]

Check that text is a valid short ID.

aas_core3_2.verification.matches_version_type(text: str) → bool[source]

Check that text is a valid version string.

aas_core3_2.verification.matches_revision_type(text: str) → bool[source]

Check that text is a valid revision string.

aas_core3_2.verification.matches_xs_date_time_utc(text: str) → bool[source]

Check that text conforms to the pattern of an xs:dateTime.

The time zone must be fixed to UTC. We verify only that the text matches a pre-defined pattern. We do not verify that the day of month is correct nor do we check for leap seconds.

See: https://www.w3.org/TR/xmlschema-2/#dateTime

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.is_xs_date_time_utc(text: str) → bool[source]

Check that text is a xs:dateTime with time zone set to UTC.

The text is assumed to match a pre-defined pattern for xs:dateTime with the time zone set to UTC. In this function, we check for days of month (e.g., February 29th).

See: https://www.w3.org/TR/xmlschema-2/#dateTime

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:dateTime in UTC

aas_core3_2.verification.matches_mime_type(text: str) → bool[source]

Check that text conforms to the pattern of MIME type.

The definition has been taken from: https://www.rfc-editor.org/rfc/rfc7231#section-3.1.1.1, https://www.rfc-editor.org/rfc/rfc7230#section-3.2.3 and https://www.rfc-editor.org/rfc/rfc7230#section-3.2.6.

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_rfc_2396(text: str) → bool[source]

Check that text matches to the URI pattern defined in RFC 2396

The definition has been taken from: https://datatracker.ietf.org/doc/html/rfc2396

Note that RFX 2396 alone is not enough for specifying xs:anyURI for XSD version 1.0, as that specifies URI together with the amendment of RFC 2732.

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_bcp_47(text: str) → bool[source]

Check that text is a valid BCP 47 language tag.

See: https://en.wikipedia.org/wiki/IETF_language_tag

aas_core3_2.verification.lang_strings_have_unique_languages(lang_strings: Sequence[AbstractLangString]) → bool[source]

Check that the lang_strings do not have overlapping types.AbstractLangString.language’s

aas_core3_2.verification.qualifier_types_are_unique(qualifiers: Sequence[Qualifier]) → bool[source]

Check that types.Qualifier.type’s of qualifiers are unique.

Parameters

qualifiers – to be checked

Returns

True if all types.Qualifier.type’s are unique

aas_core3_2.verification.matches_xml_serializable_string(text: str) → bool[source]

Check that text conforms to the pattern of the Constraint AASd-130.

Ensures that encoding is possible and interoperability between different serializations is possible.

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_any_uri(text: str) → bool[source]

Check that text conforms to the pattern of an xs:anyURI.

See: https://www.w3.org/TR/xmlschema-2/#anyURI and https://datatracker.ietf.org/doc/html/rfc2396 and https://datatracker.ietf.org/doc/html/rfc2732

Note, that version 1.0 of the XSD specification defines xs:anyURI as “defined by RFC 2396, as amended by RFC 2732”. Therefore, we use a pattern here that implements the amendments of RFC 2732. This should not be confused with matches_RFC_2396, which does not include those amendments and is used in different parts of the specification.

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_base_64_binary(text: str) → bool[source]

Check that text conforms to the pattern of an xs:base64Binary.

See: https://www.w3.org/TR/xmlschema-2/#base64Binary

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_boolean(text: str) → bool[source]

Check that text conforms to the pattern of an xs:boolean.

See: https://www.w3.org/TR/xmlschema-2/#boolean

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_date(text: str) → bool[source]

Check that text conforms to the pattern of an xs:date.

See: https://www.w3.org/TR/xmlschema-2/#date

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.is_xs_date(text: str) → bool[source]

Check that text is a valid xs:date.

We check that the text matches the pattern of xs:date, and that the day exists in the month (e.g., February 29th only in leap years).

See: https://www.w3.org/TR/xmlschema-2/#date

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:date

aas_core3_2.verification.matches_xs_date_time(text: str) → bool[source]

Check that text conforms to the pattern of an xs:dateTime.

See: https://www.w3.org/TR/xmlschema-2/#dateTime

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.is_xs_date_time(text: str) → bool[source]

Check that text is a xs:dateTime.

The text is assumed to match a pre-defined pattern for xs:dateTime. In this function, we check for days of month (e.g., February 29th).

See: https://www.w3.org/TR/xmlschema-2/#dateTime

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:dateTime

aas_core3_2.verification.date_time_utc_less(that: str, other: str) → Optional[bool][source]

Check that the date-time that is before other.

We compare the years as integers, and the rest of the texts part by part as strings, since the fraction of a second can be arbitrarily long.

We do not compare the years with more than 15 digits, as they do not safely fit into an integer. Such years are valid in xs:dateTime, but not realistic.

The end of a day, 24:00:00, is the same instant as the start of the next day, see the note at https://www.w3.org/TR/xmlschema-2/#dateTime.

Parameters
  • that – Date-time which is expected to come first

  • other – Date-time which is expected to come later

Returns

True if that is before other, False if not, and None if either of them is not a valid xs:dateTime in UTC, or if either of their years has more than 15 digits

aas_core3_2.verification.date_time_utc_less_or_equal_or_invalid(that: str, other: str) → bool[source]

Check that the date-time that is before or at the same instant as other, unless either of them is invalid.

The invalid date-times are reported by the invariants of DateTimeUTC, so that we do not report them twice. See date_time_utc_less().

Parameters
  • that – Date-time which is expected to come first or at the same instant

  • other – Date-time which is expected to come later or at the same instant

Returns

True if that is before or at the same instant as other, or if either of them is not a valid xs:dateTime in UTC

aas_core3_2.verification.matches_xs_decimal(text: str) → bool[source]

Check that text conforms to the pattern of an xs:decimal.

See: https://www.w3.org/TR/xmlschema-2/#decimal

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_double(text: str) → bool[source]

Check that text conforms to the pattern of an xs:double.

See: https://www.w3.org/TR/xmlschema-2/#double

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_duration(text: str) → bool[source]

Check that text conforms to the pattern of an xs:duration.

See: https://www.w3.org/TR/xmlschema-2/#duration

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_float(text: str) → bool[source]

Check that text conforms to the pattern of an xs:float.

See: https://www.w3.org/TR/xmlschema-2/#float

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_g_day(text: str) → bool[source]

Check that text conforms to the pattern of an xs:gDay.

See: https://www.w3.org/TR/xmlschema-2/#gDay

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_g_month(text: str) → bool[source]

Check that text conforms to the pattern of an xs:gMonth.

See: https://www.w3.org/TR/xmlschema-2/#gMonth

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_g_month_day(text: str) → bool[source]

Check that text conforms to the pattern of an xs:gMonthDay.

See: https://www.w3.org/TR/xmlschema-2/#gMonthDay

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_g_year(text: str) → bool[source]

Check that text conforms to the pattern of an xs:gYear.

See: https://www.w3.org/TR/xmlschema-2/#gYear

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_g_year_month(text: str) → bool[source]

Check that text conforms to the pattern of an xs:gYearMonth.

See: https://www.w3.org/TR/xmlschema-2/#gYearMonth

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_hex_binary(text: str) → bool[source]

Check that text conforms to the pattern of an xs:hexBinary.

See: https://www.w3.org/TR/xmlschema-2/#hexBinary

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_time(text: str) → bool[source]

Check that text conforms to the pattern of an xs:time.

See: https://www.w3.org/TR/xmlschema-2/#time

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_integer(text: str) → bool[source]

Check that text conforms to the pattern of an xs:integer.

See: https://www.w3.org/TR/xmlschema-2/#integer

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_long(text: str) → bool[source]

Check that text conforms to the pattern of an xs:long.

See: https://www.w3.org/TR/xmlschema-2/#long

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_int(text: str) → bool[source]

Check that text conforms to the pattern of an xs:int.

See: https://www.w3.org/TR/xmlschema-2/#int

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_short(text: str) → bool[source]

Check that text conforms to the pattern of an xs:short.

See: https://www.w3.org/TR/xmlschema-2/#short

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_byte(text: str) → bool[source]

Check that text conforms to the pattern of an xs:byte.

See: https://www.w3.org/TR/xmlschema-2/#byte

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_non_negative_integer(text: str) → bool[source]

Check that text conforms to the pattern of an xs:nonNegativeInteger.

See: https://www.w3.org/TR/xmlschema-2/#nonNegativeInteger

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_positive_integer(text: str) → bool[source]

Check that text conforms to the pattern of an xs:positiveInteger.

See: https://www.w3.org/TR/xmlschema-2/#positiveInteger

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_unsigned_long(text: str) → bool[source]

Check that text conforms to the pattern of an xs:unsignedLong.

See: https://www.w3.org/TR/xmlschema-2/#unsignedLong

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_unsigned_int(text: str) → bool[source]

Check that text conforms to the pattern of an xs:unsignedInt.

See: https://www.w3.org/TR/xmlschema-2/#unsignedInt

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_unsigned_short(text: str) → bool[source]

Check that text conforms to the pattern of an xs:unsignedShort.

See: https://www.w3.org/TR/xmlschema-2/#unsignedShort

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_unsigned_byte(text: str) → bool[source]

Check that text conforms to the pattern of an xs:unsignedByte.

See: https://www.w3.org/TR/xmlschema-2/#unsignedByte

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_non_positive_integer(text: str) → bool[source]

Check that text conforms to the pattern of an xs:nonPositiveInteger.

See: https://www.w3.org/TR/xmlschema-2/#nonPositiveInteger

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_negative_integer(text: str) → bool[source]

Check that text conforms to the pattern of an xs:negativeInteger.

See: https://www.w3.org/TR/xmlschema-2/#negativeInteger

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_xs_string(text: str) → bool[source]

Check that text conforms to the pattern of an xs:string.

See: https://www.w3.org/TR/xmlschema-2/#string

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.is_xs_double(text: str) → bool[source]

Check that text is a valid xs:double.

We check that the text matches the pattern of xs:double, and that it does not overflow, i.e., that it does not round to infinity unless it is INF or -INF. See constants.XS_DOUBLE_OVERFLOW_THRESHOLD.

See: https://www.w3.org/TR/xmlschema-2/#double

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:double

aas_core3_2.verification.is_xs_float(text: str) → bool[source]

Check that text is a valid xs:float.

We check that the text matches the pattern of xs:float, and that it does not overflow, i.e., that it does not round to infinity unless it is INF or -INF. See constants.XS_FLOAT_OVERFLOW_THRESHOLD.

See: https://www.w3.org/TR/xmlschema-2/#float

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:float

aas_core3_2.verification.is_xs_g_month_day(text: str) → bool[source]

Check that text is a valid xs:gMonthDay.

We check that the text matches the pattern of xs:gMonthDay, and that the day exists in the month. February 29th is valid, as there is no year to tell otherwise.

See: https://www.w3.org/TR/xmlschema-2/#gMonthDay

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:gMonthDay

aas_core3_2.verification.is_xs_long(text: str) → bool[source]

Check that text is a valid xs:long.

We check that the text matches the pattern of xs:long, and that the number is within the range of xs:long.

See: https://www.w3.org/TR/xmlschema-2/#long

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:long

aas_core3_2.verification.is_xs_int(text: str) → bool[source]

Check that text is a valid xs:int.

We check that the text matches the pattern of xs:int, and that the number is within the range of xs:int.

See: https://www.w3.org/TR/xmlschema-2/#int

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:int

aas_core3_2.verification.is_xs_short(text: str) → bool[source]

Check that text is a valid xs:short.

We check that the text matches the pattern of xs:short, and that the number is within the range of xs:short.

See: https://www.w3.org/TR/xmlschema-2/#short

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:short

aas_core3_2.verification.is_xs_byte(text: str) → bool[source]

Check that text is a valid xs:byte.

We check that the text matches the pattern of xs:byte, and that the number is within the range of xs:byte.

See: https://www.w3.org/TR/xmlschema-2/#byte

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:byte

aas_core3_2.verification.is_xs_unsigned_long(text: str) → bool[source]

Check that text is a valid xs:unsignedLong.

We check that the text matches the pattern of xs:unsignedLong, and that the number is within the range of xs:unsignedLong.

See: https://www.w3.org/TR/xmlschema-2/#unsignedLong

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:unsignedLong

aas_core3_2.verification.is_xs_unsigned_int(text: str) → bool[source]

Check that text is a valid xs:unsignedInt.

We check that the text matches the pattern of xs:unsignedInt, and that the number is within the range of xs:unsignedInt.

See: https://www.w3.org/TR/xmlschema-2/#unsignedInt

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:unsignedInt

aas_core3_2.verification.is_xs_unsigned_short(text: str) → bool[source]

Check that text is a valid xs:unsignedShort.

We check that the text matches the pattern of xs:unsignedShort, and that the number is within the range of xs:unsignedShort.

See: https://www.w3.org/TR/xmlschema-2/#unsignedShort

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:unsignedShort

aas_core3_2.verification.is_xs_unsigned_byte(text: str) → bool[source]

Check that text is a valid xs:unsignedByte.

We check that the text matches the pattern of xs:unsignedByte, and that the number is within the range of xs:unsignedByte.

See: https://www.w3.org/TR/xmlschema-2/#unsignedByte

Parameters

text – Text to be checked

Returns

True if the text is a valid xs:unsignedByte

aas_core3_2.verification.value_consistent_with_xsd_type(value: str, value_type: DataTypeDefXSD) → bool[source]

Check that the value conforms to its value_type.

Parameters
  • value – which needs to conform

  • value_type – pre-defined value type

Returns

True if the value conforms

aas_core3_2.verification.is_model_reference_to(reference: Reference, expected_type: KeyTypes) → bool[source]

Check that the target of the model reference matches the expected_type.

aas_core3_2.verification.is_model_reference_to_referable(reference: Reference) → bool[source]

Check that the target of the reference matches a constants.AAS_REFERABLES.

aas_core3_2.verification.id_shorts_are_unique(referables: Sequence[Referable]) → bool[source]

Check that the types.Referable.id_short’s among the referables are unique in their namespace.

aas_core3_2.verification.id_shorts_of_variables_are_unique(input_variables: Optional[Sequence[OperationVariable]], output_variables: Optional[Sequence[OperationVariable]], inoutput_variables: Optional[Sequence[OperationVariable]]) → bool[source]

Check that the types.Referable.id_short’s among all the input_variables, output_variables and inoutput_variables are unique.

aas_core3_2.verification.specific_asset_id_name_matches_global_asset_id(name: str) → bool[source]

Check whether name is the reserved global asset ID key.

aas_core3_2.verification.submodel_element_has_template_qualifier_in_tree(element: SubmodelElement) → bool[source]

Check whether element or its descendants have template qualifiers.

aas_core3_2.verification.submodel_elements_have_no_template_qualifiers(elements: Sequence[SubmodelElement]) → bool[source]

Check that elements have no template qualifiers in their trees.

aas_core3_2.verification.submodel_element_lists_have_exactly_one_element_in_tree(element: SubmodelElement) → bool[source]

Recursively check that submodel element lists have exactly one child.

aas_core3_2.verification.submodel_element_lists_in_submodel_elements_have_exactly_one_element(elements: Sequence[SubmodelElement]) → bool[source]

Check that all submodel element lists among elements have one item.

aas_core3_2.verification.submodel_element_lists_in_operation_variables_have_exactly_one_element(input_variables: Optional[Sequence[OperationVariable]], output_variables: Optional[Sequence[OperationVariable]], inoutput_variables: Optional[Sequence[OperationVariable]]) → bool[source]

Check that submodel element lists in operation variables have one item.

aas_core3_2.verification.extension_names_are_unique(extensions: Sequence[Extension]) → bool[source]

Check that the extension names are unique.

aas_core3_2.verification.submodel_elements_have_identical_semantic_ids(elements: Sequence[SubmodelElement]) → bool[source]

Check that all semantic IDs are identical, if specified.

aas_core3_2.verification.submodel_element_is_of_type(element: SubmodelElement, element_type: AASSubmodelElements) → bool[source]

Check that the run-time type of the element coincides with element_type.

aas_core3_2.verification.properties_or_ranges_have_value_type(elements: Sequence[SubmodelElement], value_type: DataTypeDefXSD) → bool[source]

Check that all the elements have the value_type.

aas_core3_2.verification.reference_key_values_equal(that: Reference, other: Reference) → bool[source]

Check that the two references are equal by comparing their key values.

aas_core3_2.verification.data_specification_iec_61360s_for_property_or_value_have_appropriate_data_type(embedded_data_specifications: Sequence[EmbeddedDataSpecification]) → bool[source]

Check that the types.DataSpecificationIEC61360.data_type is defined appropriately for all data specifications whose content is given as IEC 61360.

aas_core3_2.verification.data_specification_iec_61360s_for_reference_have_appropriate_data_type(embedded_data_specifications: Sequence[EmbeddedDataSpecification]) → bool[source]

Check that the types.DataSpecificationIEC61360.data_type is defined appropriately for all data specifications whose content is given as IEC 61360.

aas_core3_2.verification.data_specification_iec_61360s_for_document_have_appropriate_data_type(embedded_data_specifications: Sequence[EmbeddedDataSpecification]) → bool[source]

Check that the types.DataSpecificationIEC61360.data_type is defined appropriately for all data specifications whose content is given as IEC 61360.

aas_core3_2.verification.data_specification_iec_61360s_have_data_type(embedded_data_specifications: Sequence[EmbeddedDataSpecification]) → bool[source]

Check that the types.DataSpecificationIEC61360.data_type is defined for all data specifications whose content is given as IEC 61360.

aas_core3_2.verification.data_specification_iec_61360s_have_value(embedded_data_specifications: Sequence[EmbeddedDataSpecification]) → bool[source]

Check that the types.DataSpecificationIEC61360.value is defined for all data specifications whose content is given as IEC 61360.

aas_core3_2.verification.data_specification_iec_61360s_have_definition_at_least_in_english(embedded_data_specifications: Sequence[EmbeddedDataSpecification]) → bool[source]

Check that the types.DataSpecificationIEC61360.definition is defined for all data specifications whose content is given as IEC 61360 at least in English.

aas_core3_2.verification.is_bcp_47_for_english(text: str) → bool[source]

Check that the text corresponds to a BCP47 code for english.

aas_core3_2.verification.matches_path_item(text: str) → bool[source]

Check that text is a valid idShortPath.

An idShortPath is a chain of idShorts or SubmodelElementList-indexes which points to an element within a hierarchy of elements, e.g., sme1.sme2[0].p1.

aas_core3_2.verification.matches_field_identifier(text: str) → bool[source]

Check that text is a valid field identifier of the query language.

A field identifier starts with a root ($aas, $sm, $sme, $cd, $aasdesc or $smdesc), optionally followed by an idShortPath in case of $sme, and ends with an attribute declaration after #, e.g., $sme.someCollection.someProperty#value.

See: https://industrialdigitaltwin.io/aas-specifications/IDTA-01002/v3.2/query-language.html#query-grammar

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_fragment_field_identifier(text: str) → bool[source]

Check that text is a valid fragment field identifier.

A fragment field identifier points to the part of the returned data which should be filtered, e.g., $aas#assetInformation.specificAssetIds[] or $sme.someCollection.

See: https://industrialdigitaltwin.io/aas-specifications/IDTA-01002/v3.2/query-language.html#query-grammar

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_hex_literal(text: str) → bool[source]

Check that text is a valid hexadecimal literal of the query language.

A hexadecimal literal is prefixed with 16#, e.g., 16#1F.

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_date_time_literal(text: str) → bool[source]

Check that text is a valid date-time literal of the query language.

A date-time literal is a valid calendar date, followed by an optional T separator, the time and an optional time zone, e.g., 2024-02-29T12:00:00Z.

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_time_literal(text: str) → bool[source]

Check that text is a valid time literal of the query language.

A time literal is given as HH:MM, HH:MM:SS, optionally with fractional seconds and an optional time zone, e.g., 12:00:00+01:00.

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.matches_reference_identifier(text: str) → bool[source]

Check that text is a valid reference identifier.

A reference identifier points to an attribute of a specific instance given by its identifier, e.g., $sm("https://example.com/sm")#idShort or $sme("https://example.com/sm").someProperty#value. A quotation mark and a reverse solidus in the identifier are escaped as \" and \\, respectively.

See: https://industrialdigitaltwin.io/aas-specifications/IDTA-01002/v3.2/query-language.html#query-grammar

Parameters

text – Text to be checked

Returns

True if the text conforms to the pattern

aas_core3_2.verification.are_equality_comparable(left: Union[FieldOperand, StringLiteral, StringCast, AttributeOperand, NumberLiteral, NumberCast, DayOfWeek, DayOfMonth, Month, Year, HexLiteral, HexCast, BooleanLiteral, BooleanCast, DateTimeLiteral, DateTimeCast, TimeLiteral, TimeCast], right: Union[FieldOperand, StringLiteral, StringCast, AttributeOperand, NumberLiteral, NumberCast, DayOfWeek, DayOfMonth, Month, Year, HexLiteral, HexCast, BooleanLiteral, BooleanCast, DateTimeLiteral, DateTimeCast, TimeLiteral, TimeCast]) → bool[source]

Check that left and right can be compared for (in)equality.

Following the normative JSON schema of the query language, the two operands need to be of the same type: a string, a number, a hexadecimal, a boolean, a date-time or a time. A field is implicitly cast to the type of the other operand, and can hence be compared with an operand of any type. A global attribute giving a date and time (LOCALNOW, UTCNOW or CLIENTNOW) can be used both as a string and as a date-time.

See: https://industrialdigitaltwin.io/aas-specifications/IDTA-01002/v3.2/query-language.html#_json_schema

Parameters
  • left – First operand of the comparison

  • right – Second operand of the comparison

Returns

True if the operands can be compared for (in)equality

aas_core3_2.verification.are_order_comparable(left: Union[FieldOperand, StringLiteral, StringCast, AttributeOperand, NumberLiteral, NumberCast, DayOfWeek, DayOfMonth, Month, Year, HexLiteral, HexCast, BooleanLiteral, BooleanCast, DateTimeLiteral, DateTimeCast, TimeLiteral, TimeCast], right: Union[FieldOperand, StringLiteral, StringCast, AttributeOperand, NumberLiteral, NumberCast, DayOfWeek, DayOfMonth, Month, Year, HexLiteral, HexCast, BooleanLiteral, BooleanCast, DateTimeLiteral, DateTimeCast, TimeLiteral, TimeCast]) → bool[source]

Check that left and right can be compared by order.

The operands need to be comparable for (in)equality (see are_equality_comparable), but booleans can not be ordered.

See: https://industrialdigitaltwin.io/aas-specifications/IDTA-01002/v3.2/query-language.html#_json_schema

Parameters
  • left – First operand of the comparison

  • right – Second operand of the comparison

Returns

True if the operands can be compared by order

aas_core3_2.verification.verify(that: Class) → Iterator[Error][source]

Verify the constraints of that recursively.

Parameters

that – instance whose constraints we want to verify

Yield

constraint violations

aas_core3_2.verification.verify_xml_serializable_string(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_non_empty_xml_serializable_string(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_date_time_utc(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_date_time(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_duration(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_blob_type(that: bytes) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_identifier(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_value_type_iec_61360(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_name_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_version_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_revision_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_label_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_message_topic_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_bcp_47_language_tag(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_content_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_path_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_qualifier_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_value_data_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_id_short_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_string_uom(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_identifier_uom(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_non_negative_integer(that: int) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_code_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_short_id_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_locator_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_text_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_scheme_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_path_item(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_field_identifier(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_fragment_field_identifier(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_standard_string(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_hex_literal_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_date_time_literal_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_time_literal_type(that: str) → Iterator[Error][source]

Verify the constraints of that.

aas_core3_2.verification.verify_reference_identifier(that: str) → Iterator[Error][source]

Verify the constraints of that.