Class Verification

java.lang.Object
aas_core.aas3_0.verification.Verification

public class Verification extends Object
  • Constructor Details

    • Verification

      public Verification()
  • Method Details

    • matchesIdShort

      public static Boolean matchesIdShort(String text)
      Check that text is a valid short ID.
    • matchesVersionType

      public static Boolean matchesVersionType(String text)
      Check that text is a valid version string.
    • matchesRevisionType

      public static Boolean matchesRevisionType(String text)
      Check that text is a valid revision string.
    • matchesXsDateTimeUtc

      public static Boolean matchesXsDateTimeUtc(String text)
      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
    • isXsDateTimeUtc

      public static boolean isXsDateTimeUtc(String value)
      Check that value is a xs:dateTime with the time zone set to UTC.
      Parameters:
      value - the value to check
    • matchesMimeType

      public static Boolean matchesMimeType(String text)
      Parameters:
      text - Text to be checked
      Returns:
      True if the text conforms to the pattern
    • matchesRfc2396

      public static Boolean matchesRfc2396(String text)
      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
    • matchesBcp47

      public static Boolean matchesBcp47(String text)
      Check that text is a valid BCP 47 language tag.

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

    • langStringsHaveUniqueLanguages

      public static boolean langStringsHaveUniqueLanguages(Iterable<? extends IAbstractLangString> langStrings)
      Check that langStrings are specified each for a unique language.
      Parameters:
      langStrings - the langStrings.
    • qualifierTypesAreUnique

      public static boolean qualifierTypesAreUnique(Iterable<IQualifier> qualifiers)
      Check that there are no duplicate type's in the qualifiers.
      Parameters:
      qualifiers - the qualifiers
    • matchesXmlSerializableString

      public static Boolean matchesXmlSerializableString(String text)
      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
    • matchesXsAnyUri

      public static Boolean matchesXsAnyUri(String text)
      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/rfc3987

      Parameters:
      text - Text to be checked
      Returns:
      True if the text conforms to the pattern
    • matchesXsBase64Binary

      public static Boolean matchesXsBase64Binary(String text)
      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
    • matchesXsBoolean

      public static Boolean matchesXsBoolean(String text)
      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
    • matchesXsDate

      public static Boolean matchesXsDate(String text)
      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
    • matchesXsDateTime

      public static Boolean matchesXsDateTime(String text)
      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
    • isLeapYear

      public static boolean isLeapYear(BigInteger year)
      Check whether the given year is a leap year. Year 1 BCE is a leap year.
      Parameters:
      year - to be checked
      Returns:
      True if 'year' is a leap year
    • isXsDateTime

      public static boolean isXsDateTime(String value)
      Check that value is a xs:dateTime with the time zone set to UTC.
      Parameters:
      value - to check
    • matchesXsDecimal

      public static Boolean matchesXsDecimal(String text)
      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
    • matchesXsDouble

      public static Boolean matchesXsDouble(String text)
      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
    • matchesXsDuration

      public static Boolean matchesXsDuration(String text)
      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
    • matchesXsFloat

      public static Boolean matchesXsFloat(String text)
      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
    • matchesXsGDay

      public static Boolean matchesXsGDay(String text)
      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
    • matchesXsGMonth

      public static Boolean matchesXsGMonth(String text)
      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
    • matchesXsGMonthDay

      public static Boolean matchesXsGMonthDay(String text)
      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
    • matchesXsGYear

      public static Boolean matchesXsGYear(String text)
      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
    • matchesXsGYearMonth

      public static Boolean matchesXsGYearMonth(String text)
      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
    • matchesXsHexBinary

      public static Boolean matchesXsHexBinary(String text)
      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
    • matchesXsTime

      public static Boolean matchesXsTime(String text)
      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
    • matchesXsInteger

      public static Boolean matchesXsInteger(String text)
      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
    • matchesXsLong

      public static Boolean matchesXsLong(String text)
      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
    • matchesXsInt

      public static Boolean matchesXsInt(String text)
      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
    • matchesXsShort

      public static Boolean matchesXsShort(String text)
      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
    • matchesXsByte

      public static Boolean matchesXsByte(String text)
      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
    • matchesXsNonNegativeInteger

      public static Boolean matchesXsNonNegativeInteger(String text)
      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
    • matchesXsPositiveInteger

      public static Boolean matchesXsPositiveInteger(String text)
      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
    • matchesXsUnsignedLong

      public static Boolean matchesXsUnsignedLong(String text)
      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
    • matchesXsUnsignedInt

      public static Boolean matchesXsUnsignedInt(String text)
      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
    • matchesXsUnsignedShort

      public static Boolean matchesXsUnsignedShort(String text)
      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
    • matchesXsUnsignedByte

      public static Boolean matchesXsUnsignedByte(String text)
      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
    • matchesXsNonPositiveInteger

      public static Boolean matchesXsNonPositiveInteger(String text)
      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
    • matchesXsNegativeInteger

      public static Boolean matchesXsNegativeInteger(String text)
      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
    • matchesXsString

      public static Boolean matchesXsString(String text)
      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
    • valueConsistentWithXsdType

      public static boolean valueConsistentWithXsdType(String value, DataTypeDefXsd valueType)
      Check that the value is consistent with the given valueType.
      Parameters:
      value - the value to check
      valueType - the value type
    • isModelReferenceTo

      public static Boolean isModelReferenceTo(IReference reference, KeyTypes expectedType)
      Check that the target of the model reference matches the expectedType.
    • isModelReferenceToReferable

      public static Boolean isModelReferenceToReferable(IReference reference)
      Check that the target of the reference matches a Constants.aasReferables.
    • idShortsAreUnique

      public static boolean idShortsAreUnique(Iterable<? extends IReferable> referables)
      Check that all idShort are unique among referables.
      Parameters:
      referables - the referables.
    • idShortsOfVariablesAreUnique

      public static boolean idShortsOfVariablesAreUnique(Iterable<? extends IOperationVariable> inputVariables, Iterable<? extends IOperationVariable> outputVariables, Iterable<? extends IOperationVariable> inoutputVariables)
      Check that all idShort 's are among all the inputVariables, outputVariables and inoutputVariables are unique.
      Parameters:
      inputVariables - the inputVariables
      outputVariables - the outputVariables
      inoutputVariables - the inoutputVariables
    • extensionNamesAreUnique

      public static boolean extensionNamesAreUnique(Iterable<? extends IExtension> extensions)
      Check that all name are unique among extensions.
      Parameters:
      extensions - the extensions
    • submodelElementsHaveIdenticalSemanticIds

      public static boolean submodelElementsHaveIdenticalSemanticIds(Iterable<? extends ISubmodelElement> elements)
      Check that all elements have the identical semanticId's.
    • submodelElementIsOfType

      public static boolean submodelElementIsOfType(ISubmodelElement element, AasSubmodelElements expectedType)
    • propertiesOrRangesHaveValueType

      public static boolean propertiesOrRangesHaveValueType(Iterable<? extends ISubmodelElement> elements, DataTypeDefXsd valueType)
      Check that the elements which are IProperty or IRange have the given valueType.
      Parameters:
      elements - the elements.
      valueType - the valueType.
    • referenceKeyValuesEqual

      public static boolean referenceKeyValuesEqual(IReference that, IReference other)
      Check that the two references,'that' and 'other', are equal by comparing their keys by value's.
    • dataSpecificationIec61360sForPropertyOrValueHaveAppropriateDataType

      public static boolean dataSpecificationIec61360sForPropertyOrValueHaveAppropriateDataType(Iterable<? extends IEmbeddedDataSpecification> embeddedDataSpecifications)
      Check that the dataType is defined appropriately for all data specifications whose content is given as IEC 61360.
    • dataSpecificationIec61360sForReferenceHaveAppropriateDataType

      public static boolean dataSpecificationIec61360sForReferenceHaveAppropriateDataType(Iterable<? extends IEmbeddedDataSpecification> embeddedDataSpecifications)
      Check that the dataType is defined appropriately for all data specifications whose content is given as IEC 61360.
    • dataSpecificationIec61360sForDocumentHaveAppropriateDataType

      public static boolean dataSpecificationIec61360sForDocumentHaveAppropriateDataType(Iterable<? extends IEmbeddedDataSpecification> embeddedDataSpecifications)
      Check that the dataType is defined appropriately for all data specifications whose content is given as IEC 61360.
    • dataSpecificationIec61360sHaveDataType

      public static boolean dataSpecificationIec61360sHaveDataType(Iterable<? extends IEmbeddedDataSpecification> embeddedDataSpecifications)
      Check that the dataType is defined for all data specifications whose content is given as IEC 61360.
    • dataSpecificationIec61360sHaveValue

      public static boolean dataSpecificationIec61360sHaveValue(Iterable<? extends IEmbeddedDataSpecification> embeddedDataSpecifications)
      Check that the value is defined for all data specifications whose content is given as IEC 61360.
    • dataSpecificationIec61360sHaveDefinitionAtLeastInEnglish

      public static boolean dataSpecificationIec61360sHaveDefinitionAtLeastInEnglish(Iterable<? extends IEmbeddedDataSpecification> embeddedDataSpecifications)
      Check that the definition is defined for all data specifications whose content is given as IEC 61360 at least in English.
    • isBcp47ForEnglish

      public static Boolean isBcp47ForEnglish(String text)
      Check that the text corresponds to a BCP47 code for english.
    • verifyToErrorStream

      public static Stream<Reporting.Error> verifyToErrorStream(IClass that)
    • verify

      public static Iterable<Reporting.Error> verify(IClass that)
      Verify the constraints of that recursively.
      Parameters:
      that - The instance of the meta-model to be verified
    • verifyXmlSerializableString

      public static Stream<Reporting.Error> verifyXmlSerializableString(String that)
      Verify the constraints of that.
    • verifyNonEmptyXmlSerializableString

      public static Stream<Reporting.Error> verifyNonEmptyXmlSerializableString(String that)
      Verify the constraints of that.
    • verifyDateTimeUtc

      public static Stream<Reporting.Error> verifyDateTimeUtc(String that)
      Verify the constraints of that.
    • verifyDuration

      public static Stream<Reporting.Error> verifyDuration(String that)
      Verify the constraints of that.
    • verifyBlobType

      public static Stream<Reporting.Error> verifyBlobType(byte[] that)
      Verify the constraints of that.
    • verifyIdentifier

      public static Stream<Reporting.Error> verifyIdentifier(String that)
      Verify the constraints of that.
    • verifyValueTypeIec61360

      public static Stream<Reporting.Error> verifyValueTypeIec61360(String that)
      Verify the constraints of that.
    • verifyNameType

      public static Stream<Reporting.Error> verifyNameType(String that)
      Verify the constraints of that.
    • verifyVersionType

      public static Stream<Reporting.Error> verifyVersionType(String that)
      Verify the constraints of that.
    • verifyRevisionType

      public static Stream<Reporting.Error> verifyRevisionType(String that)
      Verify the constraints of that.
    • verifyLabelType

      public static Stream<Reporting.Error> verifyLabelType(String that)
      Verify the constraints of that.
    • verifyMessageTopicType

      public static Stream<Reporting.Error> verifyMessageTopicType(String that)
      Verify the constraints of that.
    • verifyBcp47LanguageTag

      public static Stream<Reporting.Error> verifyBcp47LanguageTag(String that)
      Verify the constraints of that.
    • verifyContentType

      public static Stream<Reporting.Error> verifyContentType(String that)
      Verify the constraints of that.
    • verifyPathType

      public static Stream<Reporting.Error> verifyPathType(String that)
      Verify the constraints of that.
    • verifyQualifierType

      public static Stream<Reporting.Error> verifyQualifierType(String that)
      Verify the constraints of that.
    • verifyValueDataType

      public static Stream<Reporting.Error> verifyValueDataType(String that)
      Verify the constraints of that.
    • verifyIdShortType

      public static Stream<Reporting.Error> verifyIdShortType(String that)
      Verify the constraints of that.
    • verifyModellingKind

      public static Stream<Reporting.Error> verifyModellingKind(ModellingKind that)
      Verify that that is a valid enumeration value.
    • verifyQualifierKind

      public static Stream<Reporting.Error> verifyQualifierKind(QualifierKind that)
      Verify that that is a valid enumeration value.
    • verifyAssetKind

      public static Stream<Reporting.Error> verifyAssetKind(AssetKind that)
      Verify that that is a valid enumeration value.
    • verifyAasSubmodelElements

      public static Stream<Reporting.Error> verifyAasSubmodelElements(AasSubmodelElements that)
      Verify that that is a valid enumeration value.
    • verifyEntityType

      public static Stream<Reporting.Error> verifyEntityType(EntityType that)
      Verify that that is a valid enumeration value.
    • verifyDirection

      public static Stream<Reporting.Error> verifyDirection(Direction that)
      Verify that that is a valid enumeration value.
    • verifyStateOfEvent

      public static Stream<Reporting.Error> verifyStateOfEvent(StateOfEvent that)
      Verify that that is a valid enumeration value.
    • verifyReferenceTypes

      public static Stream<Reporting.Error> verifyReferenceTypes(ReferenceTypes that)
      Verify that that is a valid enumeration value.
    • verifyKeyTypes

      public static Stream<Reporting.Error> verifyKeyTypes(KeyTypes that)
      Verify that that is a valid enumeration value.
    • verifyDataTypeDefXsd

      public static Stream<Reporting.Error> verifyDataTypeDefXsd(DataTypeDefXsd that)
      Verify that that is a valid enumeration value.
    • verifyDataTypeIec61360

      public static Stream<Reporting.Error> verifyDataTypeIec61360(DataTypeIec61360 that)
      Verify that that is a valid enumeration value.