aas_core_rc02.verification
Verify that the instances of the meta-model satisfy the invariants.
Here is an example how to verify an instance of aas_core3_rc02.types.Extension:
import aas_core3_rc02.types as aas_types
import aas_core3_rc02.verification as aas_verification
an_instance = aas_types.Extension(
# ... some constructor arguments ...
)
for error in aas_verification.verify(an_instance):
print(f"{error.cause} at: {error.path}")
- class aas_core3_rc02.verification.PropertySegment(instance: Class, name: str)[source]
Represent a property access on a path to an erroneous value.
- name: Final[str]
Name of the property
- class aas_core3_rc02.verification.IndexSegment(sequence: Sequence[Class], index: int)[source]
Represent an index access on a path to an erroneous value.
- index: Final[int]
Index of the item
- class aas_core3_rc02.verification.Path[source]
Represent the relative path to the erroneous value.
- property segments: Sequence[Union[PropertySegment, IndexSegment]]
Get the segments of the path.
- class aas_core3_rc02.verification.Error(cause: str)[source]
Represent a verification error in the data.
- cause: Final[str]
Human-readable description of the error
- aas_core3_rc02.verification.matches_id_short(text: str) bool[source]
Check that
textis a valid short ID.
- aas_core3_rc02.verification.matches_xs_date_time_stamp_utc(text: str) bool[source]
Check that
textconforms to the pattern of anxs:dateTimeStamp.The time zone must be fixed to UTC. We verify only that the
textmatches 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/xmlschema11-2/#dateTimeStamp
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.is_xs_date_time_stamp_utc(value: str) bool[source]
Check that
valueis axs:dateTimeStampwith the time zone set to UTC.
- aas_core3_rc02.verification.matches_mime_type(text: str) bool[source]
Check that
textconforms 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
textconforms to the pattern
- aas_core3_rc02.verification.matches_rfc_8089_path(text: str) bool[source]
Check that
textis a path conforming to the pattern of RFC 8089.The definition has been taken from: https://datatracker.ietf.org/doc/html/rfc8089
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_bcp_47(text: str) bool[source]
Check that
textis a valid BCP 47 language tag.
- aas_core3_rc02.verification.lang_strings_have_unique_languages(lang_strings: Iterable[LangString]) bool[source]
Check that
lang_stringsare specified each for a unique language.
- aas_core3_rc02.verification.qualifier_types_are_unique(qualifiers: Iterable[Qualifier]) bool[source]
Check that there are no duplicate
types.Qualifier.type’s in thequalifiers.
- aas_core3_rc02.verification.matches_xs_any_uri(text: str) bool[source]
Check that
textconforms to the pattern of anxs:anyURI.See: https://www.w3.org/TR/xmlschema11-2/#anyURI and https://datatracker.ietf.org/doc/html/rfc3987
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_base_64_binary(text: str) bool[source]
Check that
textconforms to the pattern of anxs:base64Binary.See: https://www.w3.org/TR/xmlschema11-2/#base64Binary
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_boolean(text: str) bool[source]
Check that
textconforms to the pattern of anxs:boolean.See: https://www.w3.org/TR/xmlschema11-2/#boolean
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_date(text: str) bool[source]
Check that
textconforms to the pattern of anxs:date.See: https://www.w3.org/TR/xmlschema11-2/#date
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_date_time(text: str) bool[source]
Check that
textconforms to the pattern of anxs:dateTime.See: https://www.w3.org/TR/xmlschema11-2/#dateTime
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_date_time_stamp(text: str) bool[source]
Check that
textconforms to the pattern of anxs:dateTimeStamp.See: https://www.w3.org/TR/xmlschema11-2/#dateTimeStamp
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_decimal(text: str) bool[source]
Check that
textconforms to the pattern of anxs:decimal.See: https://www.w3.org/TR/xmlschema11-2/#decimal
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_double(text: str) bool[source]
Check that
textconforms to the pattern of anxs:double.See: https://www.w3.org/TR/xmlschema11-2/#double
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_duration(text: str) bool[source]
Check that
textconforms to the pattern of anxs:duration.See: https://www.w3.org/TR/xmlschema11-2/#duration
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_float(text: str) bool[source]
Check that
textconforms to the pattern of anxs:float.See: https://www.w3.org/TR/xmlschema11-2/#float
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_g_day(text: str) bool[source]
Check that
textconforms to the pattern of anxs:gDay.See: https://www.w3.org/TR/xmlschema11-2/#gDay
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_g_month(text: str) bool[source]
Check that
textconforms to the pattern of anxs:gMonth.See: https://www.w3.org/TR/xmlschema11-2/#gMonth
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_g_month_day(text: str) bool[source]
Check that
textconforms to the pattern of anxs:gMonthDay.See: https://www.w3.org/TR/xmlschema11-2/#gMonthDay
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_g_year(text: str) bool[source]
Check that
textconforms to the pattern of anxs:gYear.See: https://www.w3.org/TR/xmlschema11-2/#gYear
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_g_year_month(text: str) bool[source]
Check that
textconforms to the pattern of anxs:gYearMonth.See: https://www.w3.org/TR/xmlschema11-2/#gYearMonth
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_hex_binary(text: str) bool[source]
Check that
textconforms to the pattern of anxs:hexBinary.See: https://www.w3.org/TR/xmlschema11-2/#hexBinary
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_time(text: str) bool[source]
Check that
textconforms to the pattern of anxs:time.See: https://www.w3.org/TR/xmlschema11-2/#time
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_day_time_duration(text: str) bool[source]
Check that
textconforms to the pattern of anxs:dayTimeDuration.See: https://www.w3.org/TR/xmlschema11-2/#dayTimeDuration
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_year_month_duration(text: str) bool[source]
Check that
textconforms to the pattern of anxs:yearMonthDuration.See: https://www.w3.org/TR/xmlschema11-2/#yearMonthDuration
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_integer(text: str) bool[source]
Check that
textconforms to the pattern of anxs:integer.See: https://www.w3.org/TR/xmlschema11-2/#integer
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_long(text: str) bool[source]
Check that
textconforms to the pattern of anxs:long.See: https://www.w3.org/TR/xmlschema11-2/#long
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_int(text: str) bool[source]
Check that
textconforms to the pattern of anxs:int.See: https://www.w3.org/TR/xmlschema11-2/#int
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_short(text: str) bool[source]
Check that
textconforms to the pattern of anxs:short.See: https://www.w3.org/TR/xmlschema11-2/#short
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_byte(text: str) bool[source]
Check that
textconforms to the pattern of anxs:byte.See: https://www.w3.org/TR/xmlschema11-2/#byte
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_non_negative_integer(text: str) bool[source]
Check that
textconforms to the pattern of anxs:nonNegativeInteger.See: https://www.w3.org/TR/xmlschema11-2/#nonNegativeInteger
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_positive_integer(text: str) bool[source]
Check that
textconforms to the pattern of anxs:positiveInteger.See: https://www.w3.org/TR/xmlschema11-2/#positiveInteger
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_unsigned_long(text: str) bool[source]
Check that
textconforms to the pattern of anxs:unsignedLong.See: https://www.w3.org/TR/xmlschema11-2/#unsignedLong
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_unsigned_int(text: str) bool[source]
Check that
textconforms to the pattern of anxs:unsignedInt.See: https://www.w3.org/TR/xmlschema11-2/#unsignedInt
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_unsigned_short(text: str) bool[source]
Check that
textconforms to the pattern of anxs:unsignedShort.See: https://www.w3.org/TR/xmlschema11-2/#unsignedShort
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_unsigned_byte(text: str) bool[source]
Check that
textconforms to the pattern of anxs:unsignedByte.See: https://www.w3.org/TR/xmlschema11-2/#unsignedByte
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_non_positive_integer(text: str) bool[source]
Check that
textconforms to the pattern of anxs:nonPositiveInteger.See: https://www.w3.org/TR/xmlschema11-2/#nonPositiveInteger
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_negative_integer(text: str) bool[source]
Check that
textconforms to the pattern of anxs:negativeInteger.See: https://www.w3.org/TR/xmlschema11-2/#negativeInteger
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.matches_xs_string(text: str) bool[source]
Check that
textconforms to the pattern of anxs:string.See: https://www.w3.org/TR/xmlschema11-2/#string
- Parameters
text¶ – Text to be checked
- Returns
True if the
textconforms to the pattern
- aas_core3_rc02.verification.is_xs_date(value: str) bool[source]
Check that
valueis a validxs:date.
- aas_core3_rc02.verification.is_xs_date_time(value: str) bool[source]
Check that
valueis a validxs:dateTime.
- aas_core3_rc02.verification.is_xs_date_time_stamp(value: str) bool[source]
Check that
valueis a validxs:dateTimeStamp.
- aas_core3_rc02.verification.is_xs_double(value: str) bool[source]
Check that
valueis a validxs:double.
- aas_core3_rc02.verification.is_xs_float(value: str) bool[source]
Check that
valueis a validxs:float.
- aas_core3_rc02.verification.is_xs_g_month_day(value: str) bool[source]
Check that
valueis a validxs:gMonthDay.
- aas_core3_rc02.verification.is_xs_long(value: str) bool[source]
Check that
valueis a validxs:long.
- aas_core3_rc02.verification.is_xs_short(value: str) bool[source]
Check that
valueis a validxs:short.
- aas_core3_rc02.verification.is_xs_byte(value: str) bool[source]
Check that
valueis a validxs:byte.
- aas_core3_rc02.verification.is_xs_unsigned_long(value: str) bool[source]
Check that
valueis a validxs:unsignedLong.
- aas_core3_rc02.verification.is_xs_unsigned_int(value: str) bool[source]
Check that
valueis a validxs:unsignedInt.
- aas_core3_rc02.verification.is_xs_unsigned_short(value: str) bool[source]
Check that
valueis a validxs:unsignedShort.
- aas_core3_rc02.verification.is_xs_unsigned_byte(value: str) bool[source]
Check that
valueis a validxs:unsignedByte.
- aas_core3_rc02.verification.value_consistent_with_xsd_type(value: str, value_type: DataTypeDefXsd) bool[source]
Check that
valueis consistent with the givenvalue_type.
- aas_core3_rc02.verification.matches_global_asset_id_literally(text: str) bool[source]
Check that the
textmatchesglobalAssetIdcase-insensitive.The case-insensitivity depends on the culture. For example in Turkish, uppercase “i” is “İ”, not “I”. We assume the culture to be English, and explicitly check for English case-folding.
- Parameters
text¶ – which needs to match
globalAssetIdliterally- Returns
True if the
textmatches case-insensitive
- aas_core3_rc02.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_rc02.verification.is_model_reference_to_referable(reference: Reference) bool[source]
Check that the target of the reference matches a
constants.AAS_REFERABLES.
- aas_core3_rc02.verification.id_shorts_are_unique(referables: Iterable[Referable]) bool[source]
Check that all
types.Referable.id_shortare unique amongreferables.
- aas_core3_rc02.verification.extension_names_are_unique(extensions: Iterable[Extension]) bool[source]
Check that all
types.Extension.nameare unique amongextensions.
- aas_core3_rc02.verification.submodel_elements_have_identical_semantic_ids(elements: Iterable[SubmodelElement]) bool[source]
Check that all
elementshave the identicaltypes.HasSemantics.semantic_id.
- aas_core3_rc02.verification.submodel_element_is_of_type(element: SubmodelElement, expected_type: AasSubmodelElements) bool[source]
Check that
elementis an instance of class corresponding toexpected_type.
- aas_core3_rc02.verification.properties_or_ranges_have_value_type(elements: Iterable[SubmodelElement], value_type: DataTypeDefXsd) bool[source]
Check that
elementswhich aretypes.Propertyortypes.Rangehave the givenvalue_type.
- aas_core3_rc02.verification.reference_key_values_equal(that: Reference, other: Reference) bool[source]
Check that the two references,
thatandother, are equal by comparing theirtypes.Reference.keysbytypes.Key.value’s.
- aas_core3_rc02.verification.data_specification_iec_61360s_for_property_or_value_have_appropriate_data_type(embedded_data_specifications: Iterable[EmbeddedDataSpecification]) bool[source]
Check that
types.DataSpecificationIEC61360.data_typeis defined appropriately for all data specifications whose content is given as IEC 61360.
- aas_core3_rc02.verification.data_specification_iec_61360s_for_reference_have_appropriate_data_type(embedded_data_specifications: Iterable[EmbeddedDataSpecification]) bool[source]
Check that
types.DataSpecificationIEC61360.data_typeis defined appropriately for all data specifications whose content is given as IEC 61360.
- aas_core3_rc02.verification.data_specification_iec_61360s_for_document_have_appropriate_data_type(embedded_data_specifications: Iterable[EmbeddedDataSpecification]) bool[source]
Check that
types.DataSpecificationIEC61360.data_typeis defined appropriately for all data specifications whose content is given as IEC 61360.
- aas_core3_rc02.verification.data_specification_iec_61360s_have_data_type(embedded_data_specifications: Iterable[EmbeddedDataSpecification]) bool[source]
Check that
types.DataSpecificationIEC61360.data_typeis defined for all data specifications whose content is given as IEC 61360.
- aas_core3_rc02.verification.data_specification_iec_61360s_have_value(embedded_data_specifications: Iterable[EmbeddedDataSpecification]) bool[source]
Check that
types.DataSpecificationIEC61360.valueis defined for all data specifications whose content is given as IEC 61360.
- aas_core3_rc02.verification.data_specification_iec_61360s_have_definition_at_least_in_english(embedded_data_specifications: Iterable[EmbeddedDataSpecification]) bool[source]
Check that
types.DataSpecificationIEC61360.definitionis defined for all data specifications whose content is given as IEC 61360 at least in English.
- aas_core3_rc02.verification.is_bcp_47_for_english(text: str) bool[source]
Check that the
textcorresponds to a BCP47 code for english.
- aas_core3_rc02.verification.verify(that: Class) Iterator[Error][source]
Verify the constraints of
thatrecursively.- Parameters
that¶ – instance whose constraints we want to verify
- Yield
constraint violations
- aas_core3_rc02.verification.verify_non_empty_string(that: str) Iterator[Error][source]
Verify the constraints of
that.
- aas_core3_rc02.verification.verify_date_time_stamp_utc(that: str) Iterator[Error][source]
Verify the constraints of
that.
- aas_core3_rc02.verification.verify_blob_type(that: bytes) Iterator[Error][source]
Verify the constraints of
that.
- aas_core3_rc02.verification.verify_identifier(that: str) Iterator[Error][source]
Verify the constraints of
that.
- aas_core3_rc02.verification.verify_bcp_47_language_tag(that: str) Iterator[Error][source]
Verify the constraints of
that.
- aas_core3_rc02.verification.verify_content_type(that: str) Iterator[Error][source]
Verify the constraints of
that.
- aas_core3_rc02.verification.verify_path_type(that: str) Iterator[Error][source]
Verify the constraints of
that.
- aas_core3_rc02.verification.verify_qualifier_type(that: str) Iterator[Error][source]
Verify the constraints of
that.