From 23d9c61e000740ae97f5edd6b5acd009402eac9c Mon Sep 17 00:00:00 2001 From: Tobias Langer Date: Wed, 4 Feb 2026 13:30:30 +0100 Subject: [PATCH 1/3] Update to aas-core-codegen 0.0.17 aas-core-codegen has seen some fixes and improvements with release [9db4f51]. We update to the latest version for the code generation. [9db4f51]: https://github.com/aas-core-works/aas-core-codegen/commit/9db4f51d813c892b00c939f24a89ccbefadd9e9e --- dev_scripts/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev_scripts/pyproject.toml b/dev_scripts/pyproject.toml index 821d78c2..bd1c0007 100644 --- a/dev_scripts/pyproject.toml +++ b/dev_scripts/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ ] requires-python = ">=3.9" dependencies = [ - "aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@4c01ed64#egg=aas-core-codegen", + "aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@9db4f51", "lxml", "requests>=2.32.5", ] From 96d85685fe8a9d9dfb361080d2b3054777a68513 Mon Sep 17 00:00:00 2001 From: Tobias Langer Date: Fri, 6 Feb 2026 09:24:28 +0100 Subject: [PATCH 2/3] Bump spotless version to 3.2.1 spotless fails while auto-formatting some files with a NullPointerException. We bump its version to 3.2.1. This requires also changes of the used formatter. Furthermore, this means we have to use a newer JRE version for compilation. Hence, we explicitly state the target and release version in the pom.xml. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/deploy.yaml | 2 +- pom.xml | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c676568b..a4364ead 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,10 +14,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up JDK 8 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: - java-version: '8' + java-version: '21' distribution: 'corretto' cache: maven diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 0f6e3366..88a02d6d 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -15,7 +15,7 @@ jobs: - name: Set up Maven Central Repository uses: actions/setup-java@v4 with: - java-version: '8' + java-version: '21' distribution: 'corretto' server-id: central server-username: MAVEN_USERNAME diff --git a/pom.xml b/pom.xml index 94144497..66a8d2c7 100644 --- a/pom.xml +++ b/pom.xml @@ -48,11 +48,11 @@ 8 8 + 8 UTF-8 2.16.1 1.12-4 - - 2.30.0 + 3.2.1 3.6.3 true @@ -96,8 +96,7 @@ src/test/java/**/*.java - - 1.7 + 1.17.0 From 29f2b5daf3cb824e12c7be5b2d6de34e349a592e Mon Sep 17 00:00:00 2001 From: Tobias Langer Date: Fri, 6 Feb 2026 09:22:26 +0100 Subject: [PATCH 3/3] Update to aas-core-meta, codegen, testgen 11b116c5, 9db4f51, 7ddd731 We update the development requirements to and re-generate everything with: * [aas-core-meta 11b116c5], * [aas-core-codegen 9db4f51] and * [aas-core3.0-testgen 7ddd731]. There have been a number of fixes in for the 3.0 schema description, noteably: * Missing Path_type Constraints ([388]) * Incomplete IdShort docstrings ([385]) * Redundant verification function for RFC8089 path ([382]) [382]: https://github.com/aas-core-works/aas-core-meta/pull/382 [385]: https://github.com/aas-core-works/aas-core-meta/pull/385 [388]: https://github.com/aas-core-works/aas-core-meta/pull/388 [aas-core-meta 11b116c5]: https://github.com/aas-core-works/aas-core-meta/commit/11b116c5 [aas-core-codegen 9db4f51]: https://github.com/aas-core-works/aas-core-codegen/commit/9db4f51 [aas-core3.0-testgen 7ddd731]: https://github.com/aas-core-works/aas-core3.0-testgen/commit/7ddd731 --- dev_scripts/codegen/meta_model.py | 154 +++--- .../aas_core_works/PatchVerification.java | 35 +- .../test-data/Verification.java | 81 +-- .../java/aas_core/aas3_0/types/impl/Blob.java | 4 +- .../aas_core/aas3_0/types/impl/Extension.java | 4 +- .../java/aas_core/aas3_0/types/impl/File.java | 4 +- .../types/impl/MultiLanguageProperty.java | 4 +- .../aas_core/aas3_0/types/impl/Property.java | 4 +- .../aas_core/aas3_0/types/impl/Qualifier.java | 4 +- .../aas_core/aas3_0/types/impl/Range.java | 4 +- .../aas3_0/types/impl/ReferenceElement.java | 4 +- .../aas_core/aas3_0/types/impl/Submodel.java | 4 +- .../aas3_0/verification/Verification.java | 97 ++-- src/test/java/TestCopying.java | 516 ++++++++++++------ 14 files changed, 592 insertions(+), 327 deletions(-) diff --git a/dev_scripts/codegen/meta_model.py b/dev_scripts/codegen/meta_model.py index cae7e48a..cf7181a8 100644 --- a/dev_scripts/codegen/meta_model.py +++ b/dev_scripts/codegen/meta_model.py @@ -1,4 +1,4 @@ -# Downloaded from: https://raw.githubusercontent.com/aas-core-works/aas-core-meta/f1d97f60b34d2dc97a8004ccfb3fc28487b91c7a/aas_core_meta/v3.py +# Downloaded from: https://raw.githubusercontent.com/aas-core-works/aas-core-meta/11b116c5231d24dade11330ef127307f99a0e671/aas_core_meta/v3.py """ Provide an implementation of the Asset Administration Shell (AAS) V3.0. @@ -226,50 +226,57 @@ def matches_MIME_type(text: str) -> bool: return match(media_type, text) is not None -# noinspection SpellCheckingInspection @verification -def matches_RFC_8089_path(text: str) -> bool: +def matches_RFC_2396(text: str) -> bool: """ - Check that :paramref:`text` is a path conforming to the pattern of RFC 8089. + Check that :paramref:`text` matches to the URI pattern defined in RFC 2396 The definition has been taken from: - https://datatracker.ietf.org/doc/html/rfc8089 + 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. :param text: Text to be checked :returns: True if the :paramref:`text` conforms to the pattern - """ - h16 = "[0-9A-Fa-f]{1,4}" - dec_octet = "([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])" - ipv4address = f"{dec_octet}\\.{dec_octet}\\.{dec_octet}\\.{dec_octet}" - ls32 = f"({h16}:{h16}|{ipv4address})" - ipv6address = ( - f"(({h16}:){{6}}{ls32}|::({h16}:){{5}}{ls32}|({h16})?::({h16}:){{4}}" - f"{ls32}|(({h16}:)?{h16})?::({h16}:){{3}}{ls32}|(({h16}:){{,2}}{h16})?::" - f"({h16}:){{2}}{ls32}|(({h16}:){{,3}}{h16})?::{h16}:{ls32}|(({h16}:){{,4}}" - f"{h16})?::{ls32}|(({h16}:){{,5}}{h16})?::{h16}|(({h16}:){{,6}}{h16})?" - "::)" - ) - unreserved = "[a-zA-Z0-9\\-._~]" - sub_delims = "[!$&'()*+,;=]" - ipvfuture = f"[vV][0-9A-Fa-f]+\\.({unreserved}|{sub_delims}|:)+" - ip_literal = f"\\[({ipv6address}|{ipvfuture})\\]" - pct_encoded = "%[0-9A-Fa-f][0-9A-Fa-f]" - reg_name = f"({unreserved}|{pct_encoded}|{sub_delims})*" - host = f"({ip_literal}|{ipv4address}|{reg_name})" - file_auth = f"(localhost|{host})" - pchar = f"({unreserved}|{pct_encoded}|{sub_delims}|[:@])" - segment_nz = f"({pchar})+" - segment = f"({pchar})*" - path_absolute = f"/({segment_nz}(/{segment})*)?" - auth_path = f"({file_auth})?{path_absolute}" - local_path = f"{path_absolute}" - file_hier_part = f"(//{auth_path}|{local_path})" - file_scheme = "file" - file_uri = f"{file_scheme}:{file_hier_part}" - - pattern = f"^{file_uri}$" - return match(pattern, text) is not None + alphanum = "[a-zA-Z0-9]" + mark = "[\\-_.!~*'()]" + unreserved = f"({alphanum}|{mark})" + hex = "([0-9]|[aA]|[bB]|[cC]|[dD]|[eE]|[fF]|[aA]|[bB]|[cC]|[dD]|[eE]|[fF])" + escaped = f"%{hex}{hex}" + pchar = f"({unreserved}|{escaped}|[:@&=+$,])" + param = f"({pchar})*" + segment = f"({pchar})*(;{param})*" + path_segments = f"{segment}(/{segment})*" + abs_path = f"/{path_segments}" + scheme = "[a-zA-Z][a-zA-Z0-9+\\-.]*" + userinfo = f"({unreserved}|{escaped}|[;:&=+$,])*" + domainlabel = f"({alphanum}|{alphanum}({alphanum}|-)*{alphanum})" + toplabel = f"([a-zA-Z]|[a-zA-Z]({alphanum}|-)*{alphanum})" + hostname = f"({domainlabel}\\.)*{toplabel}(\\.)?" + ipv4address = "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+" + host = f"({hostname}|{ipv4address})" + port = "[0-9]*" + hostport = f"{host}(:{port})?" + server = f"(({userinfo}@)?{hostport})?" + reg_name = f"({unreserved}|{escaped}|[$,;:@&=+])+" + authority = f"({server}|{reg_name})" + net_path = f"//{authority}({abs_path})?" + reserved = "[;/?:@&=+$,]" + uric = f"({reserved}|{unreserved}|{escaped})" + query = f"({uric})*" + hier_part = f"({net_path}|{abs_path})(\\?{query})?" + uric_no_slash = f"({unreserved}|{escaped}|[;?:@&=+$,])" + opaque_part = f"{uric_no_slash}({uric})*" + absoluteuri = f"{scheme}:({hier_part}|{opaque_part})" + fragment = f"({uric})*" + rel_segment = f"({unreserved}|{escaped}|[;@&=+$,])+" + rel_path = f"{rel_segment}({abs_path})?" + relativeuri = f"({net_path}|{abs_path}|{rel_path})(\\?{query})?" + uri_reference = f"^({absoluteuri}|{relativeuri})?(\\#{fragment})?$" + return match(uri_reference, text) is not None # noinspection SpellCheckingInspection @@ -318,7 +325,7 @@ def lang_strings_have_unique_languages( Check that the :paramref:`lang_strings` do not have overlapping :attr:`Abstract_lang_string.language`'s """ - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. language_set = set() for lang_string in lang_strings: @@ -338,7 +345,7 @@ def qualifier_types_are_unique(qualifiers: List["Qualifier"]) -> bool: :param qualifiers: to be checked :return: True if all :attr:`Qualifier.type`'s are unique """ - # NOTE (mristin, 2022-04-1): + # NOTE (mristin): # This implementation is given here only as reference. It needs to be adapted # for each implementation separately. observed_types = set() @@ -600,7 +607,7 @@ def matches_xs_double(text: str) -> bool: :param text: Text to be checked :returns: True if the :paramref:`text` conforms to the pattern """ - # NOTE (mristin, 2022-04-6): + # NOTE (mristin): # See: https://www.w3.org/TR/xmlschema-2/#nt-doubleRep double_rep = r"((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|-?INF|NaN)" @@ -618,7 +625,7 @@ def matches_xs_duration(text: str) -> bool: :param text: Text to be checked :returns: True if the :paramref:`text` conforms to the pattern """ - # NOTE (mristin, 2022-04-6): + # NOTE (mristin): # See https://www.w3.org/TR/xmlschema-2/#nt-durationRep # fmt: off @@ -674,7 +681,7 @@ def matches_xs_g_day(text: str) -> bool: :param text: Text to be checked :returns: True if the :paramref:`text` conforms to the pattern """ - # NOTE (mristin, 2022-04-6): + # NOTE (mristin): # See https://www.w3.org/TR/xmlschema-2/#nt-gDayRep g_day_lexical_rep = ( r"---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?" @@ -694,7 +701,7 @@ def matches_xs_g_month(text: str) -> bool: :param text: Text to be checked :returns: True if the :paramref:`text` conforms to the pattern """ - # NOTE (mristin, 2022-04-6): + # NOTE (mristin): # See https://www.w3.org/TR/xmlschema-2/#nt-gMonthRep g_month_lexical_rep = ( r"--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?" @@ -714,7 +721,7 @@ def matches_xs_g_month_day(text: str) -> bool: :param text: Text to be checked :returns: True if the :paramref:`text` conforms to the pattern """ - # NOTE (mristin, 2022-04-6): + # NOTE (mristin): # See https://www.w3.org/TR/xmlschema-2/#nt-gMonthDayRep g_month_day_rep = ( r"--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])" @@ -735,7 +742,7 @@ def matches_xs_g_year(text: str) -> bool: :param text: Text to be checked :returns: True if the :paramref:`text` conforms to the pattern """ - # NOTE (mristin, 2022-04-6): + # NOTE (mristin): # See https://www.w3.org/TR/xmlschema-2/#nt-gYearRep g_year_rep = ( r"-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?" @@ -755,7 +762,7 @@ def matches_xs_g_year_month(text: str) -> bool: :param text: Text to be checked :returns: True if the :paramref:`text` conforms to the pattern """ - # NOTE (mristin, 2022-04-6): + # NOTE (mristin): # See https://www.w3.org/TR/xmlschema-2/#nt-gYearMonthRep g_year_month_rep = ( @@ -777,7 +784,7 @@ def matches_xs_hex_binary(text: str) -> bool: :param text: Text to be checked :returns: True if the :paramref:`text` conforms to the pattern """ - # NOTE (mristin, 2022-04-6): + # NOTE (mristin): # See https://www.w3.org/TR/xmlschema-2/#nt-hexBinary hex_binary = r"([0-9a-fA-F]{2})*" @@ -795,7 +802,7 @@ def matches_xs_time(text: str) -> bool: :param text: Text to be checked :returns: True if the :paramref:`text` conforms to the pattern """ - # NOTE (mristin, 2022-04-6): + # NOTE (mristin): # See https://www.w3.org/TR/xmlschema-2/#nt-timeRep time_rep = ( r"(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))" @@ -1042,7 +1049,7 @@ def value_consistent_with_XSD_type(value: str, value_type: "Data_type_def_XSD") :param value_type: pre-defined value type :return: True if the :paramref:`value` conforms """ - # NOTE (mristin, 2022-04-1): + # NOTE (mristin): # We specify the pattern-matching functions above, and they should be handy to check # for most obvious pattern mismatches. # @@ -1051,6 +1058,8 @@ def value_consistent_with_XSD_type(value: str, value_type: "Data_type_def_XSD") # follows the pattern, but also that the day-of-month and leap seconds are taken # into account. + raise NotImplementedError() + @verification def is_model_reference_to(reference: "Reference", expected_type: "Key_types") -> bool: @@ -1085,7 +1094,7 @@ def ID_shorts_are_unique(referables: List["Referable"]) -> bool: Check that the :attr:`Referable.ID_short`'s among the :paramref:`referables` are unique. """ - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. id_short_set = set() for referable in referables: @@ -1110,7 +1119,7 @@ def ID_shorts_of_variables_are_unique( :paramref:`input_variables`, :paramref:`output_variables` and :paramref:`inoutput_variables` are unique. """ - # NOTE (s-heppner, 2023-01-25): + # NOTE (s-heppner): # This implementation will not be transpiled, but is given here as reference. id_short_set = set() if input_variables is not None: @@ -1141,7 +1150,7 @@ def ID_shorts_of_variables_are_unique( @implementation_specific def extension_names_are_unique(extensions: List["Extension"]) -> bool: """Check that the extension names are unique.""" - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. name_set = set() for extension in extensions: @@ -1158,7 +1167,7 @@ def submodel_elements_have_identical_semantic_IDs( elements: List["Submodel_element"], ) -> bool: """Check that all semantic IDs are identical, if specified.""" - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as a reference. semantic_ID = None for element in elements: @@ -1190,7 +1199,7 @@ def properties_or_ranges_have_value_type( elements: List["Submodel_element"], value_type: "Data_type_def_XSD" ) -> bool: """Check that all the :paramref:`elements` have the :paramref:`value_type`.""" - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. for element in elements: if isinstance(element, (Property, Range)): @@ -1204,7 +1213,7 @@ def properties_or_ranges_have_value_type( @implementation_specific def reference_key_values_equal(that: "Reference", other: "Reference") -> bool: """Check that the two references are equal by comparing their key values.""" - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. if len(that.keys) != len(other.keys): return False @@ -1234,6 +1243,7 @@ class XML_serializable_string(str, DBC): An attribute with data type "string" shall consist of these characters only: ``^[\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u00010000-\u0010FFFF]*$``. """ + pass @@ -1389,6 +1399,10 @@ class Content_type(Non_empty_XML_serializable_string, DBC): """ +@invariant( + lambda self: matches_RFC_2396(self), + "String with max 2048 and min 1 characters conformant to a URI as per RFC 2396.", +) class Path_type(Identifier, DBC): """ Identifier @@ -1536,7 +1550,7 @@ class Extension(Has_semantics): @implementation_specific @non_mutating def value_type_or_default(self) -> "Data_type_def_XSD": - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. return ( self.value_type if self.value_type is not None else Data_type_def_XSD.String @@ -1786,7 +1800,7 @@ class Has_kind(DBC): @implementation_specific @non_mutating def kind_or_default(self) -> "Modelling_kind": - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. return self.kind if self.kind is not None else Modelling_kind.Instance @@ -2013,7 +2027,7 @@ class Qualifier(Has_semantics): @implementation_specific @non_mutating def kind_or_default(self) -> "Qualifier_kind": - # NOTE (mristin, 2022-05-24): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. return self.kind if self.kind is not None else Qualifier_kind.Concept_qualifier @@ -2770,7 +2784,7 @@ class Submodel_element_list(Submodel_element): @implementation_specific @non_mutating def order_relevant_or_default(self) -> bool: - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. return self.order_relevant if self.order_relevant is not None else True @@ -2974,7 +2988,7 @@ def __init__( @non_mutating @ensure(lambda result: result in Valid_categories_for_data_element) def category_or_default(self) -> str: - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. return self.category if self.category is not None else "VARIABLE" @@ -3924,7 +3938,7 @@ def __init__( self.inoutput_variables ), "Constraint AASd-134: For an Operation the ID-short of all values of " - "input, output and in/output variables." + "input, output and in/output variables shall be unique." ) # fmt: on class Operation(Submodel_element): @@ -4051,7 +4065,7 @@ def __init__( ) -# NOTE (mristin, 2022-08-19): +# NOTE (mristin): # We make the following verification functions implementation-specific since the casts # are very clumsy to formalize and transpile in a readable way across languages. # For example, since Python does not have a null-coalescing operator, formalizing @@ -4072,7 +4086,7 @@ def data_specification_IEC_61360s_for_property_or_value_have_appropriate_data_ty Check that the :attr:`Data_specification_IEC_61360.data_type` is defined appropriately for all data specifications whose content is given as IEC 61360. """ - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. return all( not ( @@ -4101,7 +4115,7 @@ def data_specification_IEC_61360s_for_reference_have_appropriate_data_type( Check that the :attr:`Data_specification_IEC_61360.data_type` is defined appropriately for all data specifications whose content is given as IEC 61360. """ - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. return all( not ( @@ -4130,7 +4144,7 @@ def data_specification_IEC_61360s_for_document_have_appropriate_data_type( Check that the :attr:`Data_specification_IEC_61360.data_type` is defined appropriately for all data specifications whose content is given as IEC 61360. """ - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. return all( not ( @@ -4159,7 +4173,7 @@ def data_specification_IEC_61360s_have_data_type( Check that the :attr:`Data_specification_IEC_61360.data_type` is defined for all data specifications whose content is given as IEC 61360. """ - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. return all( not ( @@ -4182,7 +4196,7 @@ def data_specification_IEC_61360s_have_value( Check that the :attr:`Data_specification_IEC_61360.value` is defined for all data specifications whose content is given as IEC 61360. """ - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. return all( not ( @@ -4205,7 +4219,7 @@ def data_specification_IEC_61360s_have_definition_at_least_in_english( Check that the :attr:`Data_specification_IEC_61360.definition` is defined for all data specifications whose content is given as IEC 61360 at least in English. """ - # NOTE (mristin, 2022-04-7): + # NOTE (mristin): # This implementation will not be transpiled, but is given here as reference. for data_specification in embedded_data_specifications: @@ -4462,7 +4476,7 @@ class Reference_types(Enum): "with type Submodel element list is an integer number denoting the position in " "the array of the submodel element list." ) -# NOTE (mristin, 2022-07-10): +# NOTE (mristin): # We can write AASd-127 in this simpler form assuming that AASd-126 ensures that # only the last key can be a fragment reference. @invariant( @@ -5714,4 +5728,4 @@ def __init__( self.value = value self.level_type = level_type -# Downloaded from: https://raw.githubusercontent.com/aas-core-works/aas-core-meta/f1d97f60b34d2dc97a8004ccfb3fc28487b91c7a/aas_core_meta/v3.py +# Downloaded from: https://raw.githubusercontent.com/aas-core-works/aas-core-meta/11b116c5231d24dade11330ef127307f99a0e671/aas_core_meta/v3.py diff --git a/dev_scripts/semantic-patching/src/main/java/aas_core_works/PatchVerification.java b/dev_scripts/semantic-patching/src/main/java/aas_core_works/PatchVerification.java index c116a11a..fc34136e 100644 --- a/dev_scripts/semantic-patching/src/main/java/aas_core_works/PatchVerification.java +++ b/dev_scripts/semantic-patching/src/main/java/aas_core_works/PatchVerification.java @@ -55,7 +55,7 @@ public static void main(String[] args) { MethodDeclaration constructMethod = null; for (MethodDeclaration method : verificationCls.getMethods()) { - if (method.getName().toString().equals("constructMatchesRfc8089Path")) { + if (method.getName().toString().equals("constructMatchesRfc2396")) { constructMethod = method; break; } @@ -63,7 +63,7 @@ public static void main(String[] args) { if (constructMethod == null) { System.err.println( - "Could not find the method constructMatchesRfc8089Path in " + sourcePath + "Could not find the method constructMatchesRfc2396 in " + sourcePath ); System.exit(1); return; @@ -73,7 +73,7 @@ public static void main(String[] args) { if (!constructMethod.getBody().isPresent()) { System.err.println( - "The constructMatchesRfc8089Path lacks the body in " + sourcePath + "The constructMatchesRfc2396 lacks the body in " + sourcePath ); System.exit(1); return; @@ -94,14 +94,15 @@ public static void main(String[] args) { if (expression instanceof VariableDeclarationExpr) { VariableDeclarationExpr varDeclExpr = (VariableDeclarationExpr) expression; - if (expression.toString().equals("String pattern = \"^\" + fileUri + \"$\"")) { + if (expression.toString().equals( + "String uriReference = \"^(\" + absoluteuri + \"|\" + relativeuri + \")?(#\" + fragment + \")?$\"")) { expectedPatternDecl = varDeclExpr.getVariable(0); } } } else if (statement.isReturnStmt()) { ReturnStmt returnStmt = (ReturnStmt) statement; - if (returnStmt.toString().equals("return Pattern.compile(pattern);")) { + if (returnStmt.toString().equals("return Pattern.compile(uriReference);")) { expectedReturnStmt = returnStmt; } } @@ -109,7 +110,9 @@ public static void main(String[] args) { if (expectedPatternDecl == null) { System.err.println( - "The constructMatchesRfc8089Path lacks the 'String pattern = \"^\" + fileUri + \"$\"' statement in " + "The constructMatchesRfc2396 lacks the " + + "'String uriReference = \"^(\" + absoluteuri + \"|\" + relativeuri + \")?(#\" + fragment + \")?$\"' " + + "statement in " + sourcePath ); System.exit(1); @@ -118,23 +121,25 @@ public static void main(String[] args) { if (expectedReturnStmt == null) { System.err.println( - "The constructMatchesRfc8089Path lacks the expected return statement " + - "'return Pattern.compile(pattern);' in " + sourcePath + "The constructMatchesRfc2396 lacks the expected return statement " + + "'return Pattern.compile(uriReference);' in " + sourcePath ); System.exit(1); return; } - expectedPatternDecl.setInitializer("fileUri"); + expectedPatternDecl.setInitializer( + "\"(\" + absoluteuri + \"|\" + relativeuri + \")?(#\" + fragment + \")?\"" + ); expectedReturnStmt.setExpression( - StaticJavaParser.parseExpression("new RegExp(pattern).toAutomaton()") + StaticJavaParser.parseExpression("new RegExp(uriReference).toAutomaton()") ); VariableDeclarator regexVariable = null; for (FieldDeclaration field : verificationCls.getFields()) { for (VariableDeclarator declarator : field.getVariables()) { - if (declarator.getNameAsString().equals("regexMatchesRfc8089Path")) { + if (declarator.getNameAsString().equals("regexMatchesRfc2396")) { regexVariable = declarator; break; } @@ -146,7 +151,7 @@ public static void main(String[] args) { if (regexVariable == null) { System.err.println( - "Could not find regexMatchesRfc8089Path field in " + sourcePath + "Could not find regexMatchesRfc2396 field in " + sourcePath ); System.exit(1); return; @@ -155,7 +160,7 @@ public static void main(String[] args) { MethodDeclaration matchesMethod = null; for (MethodDeclaration method : verificationCls.getMethods()) { - if (method.getName().toString().equals("matchesRfc8089Path")) { + if (method.getName().toString().equals("matchesRfc2396")) { matchesMethod = method; break; } @@ -163,7 +168,7 @@ public static void main(String[] args) { if (matchesMethod == null) { System.err.println( - "Could not find the method matchesRfc8089Path in " + sourcePath + "Could not find the method matchesRfc2396 in " + sourcePath ); System.exit(1); return; @@ -172,7 +177,7 @@ public static void main(String[] args) { matchesMethod.setBody( StaticJavaParser.parseBlock(""" { - return regexMatchesRfc8089Path.run(text); + return regexMatchesRfc2396.run(text); }""") ); diff --git a/dev_scripts/semantic-patching/test-data/Verification.java b/dev_scripts/semantic-patching/test-data/Verification.java index 917bddef..adbfd7bc 100644 --- a/dev_scripts/semantic-patching/test-data/Verification.java +++ b/dev_scripts/semantic-patching/test-data/Verification.java @@ -157,48 +157,59 @@ public static Boolean matchesMimeType(String text) { return regexMatchesMimeType.matcher(text).matches(); } - private static Pattern constructMatchesRfc8089Path() { - String h16 = "[0-9A-Fa-f]{1,4}"; - String decOctet = "([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"; - String ipv4address = decOctet + "\\." + decOctet + "\\." + decOctet + "\\." + decOctet; - String ls32 = "(" + h16 + ":" + h16 + "|" + ipv4address + ")"; - String ipv6address = "((" + h16 + ":){6}" + ls32 + "|::(" + h16 + ":){5}" + ls32 + "|(" + h16 + ")?::(" + h16 + ":){4}" + ls32 + "|((" + h16 + ":)?" + h16 + ")?::(" + h16 + ":){3}" + ls32 + "|((" + h16 + ":){2}" + h16 + ")?::(" + h16 + ":){2}" + ls32 + "|((" + h16 + ":){3}" + h16 + ")?::" + h16 + ":" + ls32 + "|((" + h16 + ":){4}" + h16 + ")?::" + ls32 + "|((" + h16 + ":){5}" + h16 + ")?::" + h16 + "|((" + h16 + ":){6}" + h16 + ")?::)"; - String unreserved = "[a-zA-Z0-9\\-._~]"; - String subDelims = "[!$&\'()*+,;=]"; - String ipvfuture = "[vV][0-9A-Fa-f]+\\.(" + unreserved + "|" + subDelims + "|:)+"; - String ipLiteral = "\\[(" + ipv6address + "|" + ipvfuture + ")\\]"; - String pctEncoded = "%[0-9A-Fa-f][0-9A-Fa-f]"; - String regName = "(" + unreserved + "|" + pctEncoded + "|" + subDelims + ")*"; - String host = "(" + ipLiteral + "|" + ipv4address + "|" + regName + ")"; - String fileAuth = "(localhost|" + host + ")"; - String pchar = "(" + unreserved + "|" + pctEncoded + "|" + subDelims + "|[:@])"; - String segmentNz = "(" + pchar + ")+"; - String segment = "(" + pchar + ")*"; - String pathAbsolute = "/(" + segmentNz + "(/" + segment + ")*)?"; - String authPath = "(" + fileAuth + ")?" + pathAbsolute; - String localPath = pathAbsolute; - String fileHierPart = "(//" + authPath + "|" + localPath + ")"; - String fileScheme = "file"; - String fileUri = fileScheme + ":" + fileHierPart; - String pattern = "^" + fileUri + "$"; - - return Pattern.compile(pattern); - } - - private static final Pattern regexMatchesRfc8089Path = constructMatchesRfc8089Path(); + private static Pattern constructMatchesRfc2396() { + String alphanum = "[a-zA-Z0-9]"; + String mark = "[-_.!~*\'()]"; + String unreserved = "(" + alphanum + "|" + mark + ")"; + String hex = "([0-9]|[aA]|[bB]|[cC]|[dD]|[eE]|[fF]|[aA]|[bB]|[cC]|[dD]|[eE]|[fF])"; + String escaped = "%" + hex + hex; + String pchar = "(" + unreserved + "|" + escaped + "|[:@&=+$,])"; + String param = "(" + pchar + ")*"; + String segment = "(" + pchar + ")*(;" + param + ")*"; + String pathSegments = segment + "(/" + segment + ")*"; + String absPath = "/" + pathSegments; + String scheme = "[a-zA-Z][a-zA-Z0-9+\\-.]*"; + String userinfo = "(" + unreserved + "|" + escaped + "|[;:&=+$,])*"; + String domainlabel = "(" + alphanum + "|" + alphanum + "(" + alphanum + "|-)*" + alphanum + ")"; + String toplabel = "([a-zA-Z]|[a-zA-Z](" + alphanum + "|-)*" + alphanum + ")"; + String hostname = "(" + domainlabel + "\\.)*" + toplabel + "(\\.)?"; + String ipv4address = "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+"; + String host = "(" + hostname + "|" + ipv4address + ")"; + String port = "[0-9]*"; + String hostport = host + "(:" + port + ")?"; + String server = "((" + userinfo + "@)?" + hostport + ")?"; + String regName = "(" + unreserved + "|" + escaped + "|[$,;:@&=+])+"; + String authority = "(" + server + "|" + regName + ")"; + String netPath = "//" + authority + "(" + absPath + ")?"; + String reserved = "[;/?:@&=+$,]"; + String uric = "(" + reserved + "|" + unreserved + "|" + escaped + ")"; + String query = "(" + uric + ")*"; + String hierPart = "(" + netPath + "|" + absPath + ")(\\?" + query + ")?"; + String uricNoSlash = "(" + unreserved + "|" + escaped + "|[;?:@&=+$,])"; + String opaquePart = uricNoSlash + "(" + uric + ")*"; + String absoluteuri = scheme + ":(" + hierPart + "|" + opaquePart + ")"; + String fragment = "(" + uric + ")*"; + String relSegment = "(" + unreserved + "|" + escaped + "|[;@&=+$,])+"; + String relPath = relSegment + "(" + absPath + ")?"; + String relativeuri = "(" + netPath + "|" + absPath + "|" + relPath + ")(\\?" + query + ")?"; + String uriReference = "^(" + absoluteuri + "|" + relativeuri + ")?(#" + fragment + ")?$"; + return Pattern.compile(uriReference); + } + + private static final Pattern regexMatchesRfc2396 = constructMatchesRfc2396(); /** - * Check that {@link text} is a path conforming to the pattern of RFC 8089. + * Check that {@link text} is a path conforming to the pattern of RFC 2396. * *

The definition has been taken from: - * https://datatracker.ietf.org/doc/html/rfc8089 + * https://datatracker.ietf.org/doc/html/rfc2396 * * @param textText to be checked * * @returns True if the {@link text} conforms to the pattern */ - public static Boolean matchesRfc8089Path(String text) { - return regexMatchesRfc8089Path.matcher(text).matches(); + public static Boolean matchesRfc2396(String text) { + return regexMatchesRfc2396.matcher(text).matches(); } private static Pattern constructMatchesBcp47() { @@ -9814,12 +9825,12 @@ public static Stream verifyPathType ( "Identifier shall have a maximum length of 2000 characters."))); } - if (!matchesRfc8089Path(that)) { + if (!matchesRfc2396(that)) { errorStream = Stream.concat(errorStream, Stream.of(new Reporting.Error( "Invariant violated:\n" + "The value must represent a valid file URI scheme according " + - "to RFC 8089."))); + "to RFC 2396."))); } return errorStream; diff --git a/src/main/java/aas_core/aas3_0/types/impl/Blob.java b/src/main/java/aas_core/aas3_0/types/impl/Blob.java index 90dae2ec..1c660ae8 100644 --- a/src/main/java/aas_core/aas3_0/types/impl/Blob.java +++ b/src/main/java/aas_core/aas3_0/types/impl/Blob.java @@ -299,7 +299,9 @@ public Iterable overEmbeddedDataSpecificationsOrEmpt return getEmbeddedDataSpecifications().orElseGet(Collections::emptyList); } - /** @return the category or the default value if it has not been set. */ + /** + * @return the category or the default value if it has not been set. + */ public String categoryOrDefault() { return category != null ? category : "VARIABLE"; } diff --git a/src/main/java/aas_core/aas3_0/types/impl/Extension.java b/src/main/java/aas_core/aas3_0/types/impl/Extension.java index 0466f5a6..2f0f77c3 100644 --- a/src/main/java/aas_core/aas3_0/types/impl/Extension.java +++ b/src/main/java/aas_core/aas3_0/types/impl/Extension.java @@ -157,7 +157,9 @@ public Iterable overRefersToOrEmpty() { return getRefersTo().orElseGet(Collections::emptyList); } - /** @return the value type {@link DataTypeDefXsd} or the default value if it has not been set. */ + /** + * @return the value type {@link DataTypeDefXsd} or the default value if it has not been set. + */ public DataTypeDefXsd valueTypeOrDefault() { return valueType != null ? valueType : DataTypeDefXsd.STRING; } diff --git a/src/main/java/aas_core/aas3_0/types/impl/File.java b/src/main/java/aas_core/aas3_0/types/impl/File.java index 16789507..a11d3234 100644 --- a/src/main/java/aas_core/aas3_0/types/impl/File.java +++ b/src/main/java/aas_core/aas3_0/types/impl/File.java @@ -294,7 +294,9 @@ public Iterable overEmbeddedDataSpecificationsOrEmpt return getEmbeddedDataSpecifications().orElseGet(Collections::emptyList); } - /** @return the category or the default value if it has not been set. */ + /** + * @return the category or the default value if it has not been set. + */ public String categoryOrDefault() { return category != null ? category : "VARIABLE"; } diff --git a/src/main/java/aas_core/aas3_0/types/impl/MultiLanguageProperty.java b/src/main/java/aas_core/aas3_0/types/impl/MultiLanguageProperty.java index 7f8927e7..7718bffe 100644 --- a/src/main/java/aas_core/aas3_0/types/impl/MultiLanguageProperty.java +++ b/src/main/java/aas_core/aas3_0/types/impl/MultiLanguageProperty.java @@ -308,7 +308,9 @@ public Iterable overValueOrEmpty() { return getValue().orElseGet(Collections::emptyList); } - /** @return the category or the default value if it has not been set. */ + /** + * @return the category or the default value if it has not been set. + */ public String categoryOrDefault() { return category != null ? category : "VARIABLE"; } diff --git a/src/main/java/aas_core/aas3_0/types/impl/Property.java b/src/main/java/aas_core/aas3_0/types/impl/Property.java index c91f7dec..3b9efd17 100644 --- a/src/main/java/aas_core/aas3_0/types/impl/Property.java +++ b/src/main/java/aas_core/aas3_0/types/impl/Property.java @@ -308,7 +308,9 @@ public Iterable overEmbeddedDataSpecificationsOrEmpt return getEmbeddedDataSpecifications().orElseGet(Collections::emptyList); } - /** @return the category or the default value if it has not been set. */ + /** + * @return the category or the default value if it has not been set. + */ public String categoryOrDefault() { return category != null ? category : "VARIABLE"; } diff --git a/src/main/java/aas_core/aas3_0/types/impl/Qualifier.java b/src/main/java/aas_core/aas3_0/types/impl/Qualifier.java index e8db1039..7f502dd8 100644 --- a/src/main/java/aas_core/aas3_0/types/impl/Qualifier.java +++ b/src/main/java/aas_core/aas3_0/types/impl/Qualifier.java @@ -178,7 +178,9 @@ public Iterable overSupplementalSemanticIdsOrEmpty() { return getSupplementalSemanticIds().orElseGet(Collections::emptyList); } - /** @return the {@link QualifierKind} or the default value if it has not been set. */ + /** + * @return the {@link QualifierKind} or the default value if it has not been set. + */ public QualifierKind kindOrDefault() { return kind != null ? kind : QualifierKind.CONCEPT_QUALIFIER; } diff --git a/src/main/java/aas_core/aas3_0/types/impl/Range.java b/src/main/java/aas_core/aas3_0/types/impl/Range.java index cf8ce202..c1ef8ef5 100644 --- a/src/main/java/aas_core/aas3_0/types/impl/Range.java +++ b/src/main/java/aas_core/aas3_0/types/impl/Range.java @@ -302,7 +302,9 @@ public Iterable overEmbeddedDataSpecificationsOrEmpt return getEmbeddedDataSpecifications().orElseGet(Collections::emptyList); } - /** @return the category or the default value if it has not been set. */ + /** + * @return the category or the default value if it has not been set. + */ public String categoryOrDefault() { return category != null ? category : "VARIABLE"; } diff --git a/src/main/java/aas_core/aas3_0/types/impl/ReferenceElement.java b/src/main/java/aas_core/aas3_0/types/impl/ReferenceElement.java index e878eea6..9dd22299 100644 --- a/src/main/java/aas_core/aas3_0/types/impl/ReferenceElement.java +++ b/src/main/java/aas_core/aas3_0/types/impl/ReferenceElement.java @@ -277,7 +277,9 @@ public Iterable overEmbeddedDataSpecificationsOrEmpt return getEmbeddedDataSpecifications().orElseGet(Collections::emptyList); } - /** @return the category or the default value if it has not been set. */ + /** + * @return the category or the default value if it has not been set. + */ public String categoryOrDefault() { return category != null ? category : "VARIABLE"; } diff --git a/src/main/java/aas_core/aas3_0/types/impl/Submodel.java b/src/main/java/aas_core/aas3_0/types/impl/Submodel.java index f21f10bd..352c6fcc 100644 --- a/src/main/java/aas_core/aas3_0/types/impl/Submodel.java +++ b/src/main/java/aas_core/aas3_0/types/impl/Submodel.java @@ -331,7 +331,9 @@ public Iterable overSubmodelElementsOrEmpty() { return getSubmodelElements().orElseGet(Collections::emptyList); } - /** @return the {@link ModellingKind} or the default value if it has not been set. */ + /** + * @return the {@link ModellingKind} or the default value if it has not been set. + */ public ModellingKind kindOrDefault() { return kind != null ? kind : ModellingKind.INSTANCE; } diff --git a/src/main/java/aas_core/aas3_0/verification/Verification.java b/src/main/java/aas_core/aas3_0/verification/Verification.java index eb3821dc..76f0755b 100644 --- a/src/main/java/aas_core/aas3_0/verification/Verification.java +++ b/src/main/java/aas_core/aas3_0/verification/Verification.java @@ -161,51 +161,61 @@ public static Boolean matchesMimeType(String text) { return regexMatchesMimeType.matcher(text).matches(); } - private static Automaton constructMatchesRfc8089Path() { - String h16 = "[0-9A-Fa-f]{1,4}"; - String decOctet = "([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"; - String ipv4address = decOctet + "\\." + decOctet + "\\." + decOctet + "\\." + decOctet; - String ls32 = "(" + h16 + ":" + h16 + "|" + ipv4address + ")"; - String ipv6address = - "((" + h16 + ":){6}" + ls32 + "|::(" + h16 + ":){5}" + ls32 + "|(" + h16 + ")?::(" + h16 - + ":){4}" + ls32 + "|((" + h16 + ":)?" + h16 + ")?::(" + h16 + ":){3}" + ls32 + "|((" - + h16 + ":){0,2}" + h16 + ")?::(" + h16 + ":){2}" + ls32 + "|((" + h16 + ":){0,3}" + h16 - + ")?::" + h16 + ":" + ls32 + "|((" + h16 + ":){0,4}" + h16 + ")?::" + ls32 + "|((" - + h16 + ":){0,5}" + h16 + ")?::" + h16 + "|((" + h16 + ":){0,6}" + h16 + ")?::)"; - String unreserved = "[a-zA-Z0-9\\-._~]"; - String subDelims = "[!$&\'()*+,;=]"; - String ipvfuture = "[vV][0-9A-Fa-f]+\\.(" + unreserved + "|" + subDelims + "|:)+"; - String ipLiteral = "\\[(" + ipv6address + "|" + ipvfuture + ")\\]"; - String pctEncoded = "%[0-9A-Fa-f][0-9A-Fa-f]"; - String regName = "(" + unreserved + "|" + pctEncoded + "|" + subDelims + ")*"; - String host = "(" + ipLiteral + "|" + ipv4address + "|" + regName + ")"; - String fileAuth = "(localhost|" + host + ")"; - String pchar = "(" + unreserved + "|" + pctEncoded + "|" + subDelims + "|[:@])"; - String segmentNz = "(" + pchar + ")+"; - String segment = "(" + pchar + ")*"; - String pathAbsolute = "/(" + segmentNz + "(/" + segment + ")*)?"; - String authPath = "(" + fileAuth + ")?" + pathAbsolute; - String localPath = pathAbsolute; - String fileHierPart = "(//" + authPath + "|" + localPath + ")"; - String fileScheme = "file"; - String fileUri = fileScheme + ":" + fileHierPart; - String pattern = fileUri; - return new RegExp(pattern).toAutomaton(); - } - - private static final Automaton regexMatchesRfc8089Path = constructMatchesRfc8089Path(); + private static Automaton constructMatchesRfc2396() { + String alphanum = "[a-zA-Z0-9]"; + String mark = "[-_.!~*\'()]"; + String unreserved = "(" + alphanum + "|" + mark + ")"; + String hex = "([0-9]|[aA]|[bB]|[cC]|[dD]|[eE]|[fF]|[aA]|[bB]|[cC]|[dD]|[eE]|[fF])"; + String escaped = "%" + hex + hex; + String pchar = "(" + unreserved + "|" + escaped + "|[:@&=+$,])"; + String param = "(" + pchar + ")*"; + String segment = "(" + pchar + ")*(;" + param + ")*"; + String pathSegments = segment + "(/" + segment + ")*"; + String absPath = "/" + pathSegments; + String scheme = "[a-zA-Z][a-zA-Z0-9+\\-.]*"; + String userinfo = "(" + unreserved + "|" + escaped + "|[;:&=+$,])*"; + String domainlabel = "(" + alphanum + "|" + alphanum + "(" + alphanum + "|-)*" + alphanum + ")"; + String toplabel = "([a-zA-Z]|[a-zA-Z](" + alphanum + "|-)*" + alphanum + ")"; + String hostname = "(" + domainlabel + "\\.)*" + toplabel + "(\\.)?"; + String ipv4address = "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+"; + String host = "(" + hostname + "|" + ipv4address + ")"; + String port = "[0-9]*"; + String hostport = host + "(:" + port + ")?"; + String server = "((" + userinfo + "@)?" + hostport + ")?"; + String regName = "(" + unreserved + "|" + escaped + "|[$,;:@&=+])+"; + String authority = "(" + server + "|" + regName + ")"; + String netPath = "//" + authority + "(" + absPath + ")?"; + String reserved = "[;/?:@&=+$,]"; + String uric = "(" + reserved + "|" + unreserved + "|" + escaped + ")"; + String query = "(" + uric + ")*"; + String hierPart = "(" + netPath + "|" + absPath + ")(\\?" + query + ")?"; + String uricNoSlash = "(" + unreserved + "|" + escaped + "|[;?:@&=+$,])"; + String opaquePart = uricNoSlash + "(" + uric + ")*"; + String absoluteuri = scheme + ":(" + hierPart + "|" + opaquePart + ")"; + String fragment = "(" + uric + ")*"; + String relSegment = "(" + unreserved + "|" + escaped + "|[;@&=+$,])+"; + String relPath = relSegment + "(" + absPath + ")?"; + String relativeuri = "(" + netPath + "|" + absPath + "|" + relPath + ")(\\?" + query + ")?"; + String uriReference = "(" + absoluteuri + "|" + relativeuri + ")?(#" + fragment + ")?"; + return new RegExp(uriReference).toAutomaton(); + } + + private static final Automaton regexMatchesRfc2396 = constructMatchesRfc2396(); /** - * Check that {@code text} is a path conforming to the pattern of RFC 8089. + * Check that {@code text} matches to the URI pattern defined in RFC 2396 * *

The definition has been taken from: https://datatracker.ietf.org/doc/html/rfc8089 + * href='https%3A//datatracker.ietf.org/doc/html/rfc2396'>https://datatracker.ietf.org/doc/html/rfc2396 + * + *

Note that RFX 2396 alone is not enough for specifying {@code xs:anyURI} for XSD version 1.0, + * as that specifies URI together with the amendment of RFC 2732. * * @param text Text to be checked * @return True if the {@code text} conforms to the pattern */ - public static Boolean matchesRfc8089Path(String text) { - return regexMatchesRfc8089Path.run(text); + public static Boolean matchesRfc2396(String text) { + return regexMatchesRfc2396.run(text); } private static Pattern constructMatchesBcp47() { @@ -8037,7 +8047,8 @@ public Stream transformOperation(IOperation that) { new Reporting.Error( "Invariant violated:\n" + "Constraint AASd-134: For an Operation the ID-short of all " - + "values of input, output and in/output variables."))); + + "values of input, output and in/output variables shall be " + + "unique."))); } if (!(!(that.getInputVariables().isPresent()) || (that.getInputVariables().get().size() >= 1))) { @@ -10314,6 +10325,16 @@ public static Stream verifyPathType(String that) { "Invariant violated:\n" + "Identifier shall have a maximum length of 2000 characters."))); } + if (!matchesRfc2396(that)) { + errorStream = + Stream.concat( + errorStream, + Stream.of( + new Reporting.Error( + "Invariant violated:\n" + + "String with max 2048 and min 1 characters conformant to " + + "a URI as per RFC 2396."))); + } return errorStream; } diff --git a/src/test/java/TestCopying.java b/src/test/java/TestCopying.java index 1232b5ec..86fbc866 100644 --- a/src/test/java/TestCopying.java +++ b/src/test/java/TestCopying.java @@ -96,7 +96,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getName() == casted.getName() @@ -113,7 +114,8 @@ && zip( that.getRefersTo().get().stream(), casted.getRefersTo().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getRefersTo().isPresent()); } @@ -136,7 +138,8 @@ && zip( that.getEmbeddedDataSpecifications().get().stream(), casted.getEmbeddedDataSpecifications().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && that.getVersion().isPresent() ? casted.getVersion().isPresent() @@ -176,7 +179,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getKind().isPresent() ? (casted.getKind().isPresent() && that.getKind().get() == casted.getKind().get()) @@ -207,7 +211,8 @@ public Boolean transformAssetAdministrationShell(IAssetAdministrationShell that, && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -223,7 +228,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -233,7 +239,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getAdministration().isPresent() @@ -251,7 +258,8 @@ && zip( that.getEmbeddedDataSpecifications().get().stream(), casted.getEmbeddedDataSpecifications().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && (that.getDerivedFrom().isPresent() @@ -270,7 +278,8 @@ && zip( that.getSubmodels().get().stream(), casted.getSubmodels().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSubmodels().isPresent()); } @@ -295,7 +304,8 @@ && zip( that.getSpecificAssetIds().get().stream(), casted.getSpecificAssetIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSpecificAssetIds().isPresent() && that.getAssetType().isPresent() ? casted.getAssetType().isPresent() @@ -345,7 +355,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getName() == casted.getName() @@ -371,7 +382,8 @@ public Boolean transformSubmodel(ISubmodel that, IClass other) { && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -387,7 +399,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -397,7 +410,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getAdministration().isPresent() @@ -425,7 +439,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -438,7 +453,8 @@ && zip( .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -449,15 +465,20 @@ && zip( .get() .size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform( pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && that.getSubmodelElements().isPresent() @@ -466,14 +487,17 @@ && zip( == casted.getSubmodelElements().get().size() && zip( that.getSubmodelElements().get().stream(), - casted.getSubmodelElements().get() + casted + .getSubmodelElements() + .get() .stream()) .map( pair -> transform( pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSubmodelElements().isPresent()); } @@ -492,7 +516,8 @@ public Boolean transformRelationshipElement(IRelationshipElement that, IClass ot && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -508,7 +533,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -518,7 +544,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -535,7 +562,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -546,7 +574,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -554,14 +583,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && transform(that.getFirst(), casted.getFirst()) @@ -582,7 +616,8 @@ public Boolean transformSubmodelElementList(ISubmodelElementList that, IClass ot && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -598,7 +633,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -608,7 +644,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -625,7 +662,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -636,7 +674,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -644,14 +683,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && that.getOrderRelevant().isPresent() @@ -690,7 +734,8 @@ && zip( transform( pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getValue().isPresent()); } @@ -710,7 +755,8 @@ public Boolean transformSubmodelElementCollection( && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -726,7 +772,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -736,7 +783,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -753,7 +801,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -764,7 +813,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -772,14 +822,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && that.getValue().isPresent() @@ -793,7 +848,8 @@ && zip( pair -> transform( pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getValue().isPresent()); } @@ -812,7 +868,8 @@ public Boolean transformProperty(IProperty that, IClass other) { && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -828,7 +885,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -838,7 +896,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -855,7 +914,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -866,7 +926,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -874,14 +935,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && that.getValueType() == casted.getValueType() @@ -911,7 +977,8 @@ public Boolean transformMultiLanguageProperty(IMultiLanguageProperty that, IClas && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -927,7 +994,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -937,7 +1005,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -954,7 +1023,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -965,7 +1035,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -973,14 +1044,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && that.getValue().isPresent() @@ -994,7 +1070,8 @@ && zip( pair -> transform( pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getValue().isPresent() && (that.getValueId().isPresent() @@ -1019,7 +1096,8 @@ public Boolean transformRange(IRange that, IClass other) { && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -1035,7 +1113,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -1045,7 +1124,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -1062,7 +1142,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -1073,7 +1154,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -1081,14 +1163,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && that.getValueType() == casted.getValueType() @@ -1116,7 +1203,8 @@ public Boolean transformReferenceElement(IReferenceElement that, IClass other) { && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -1132,7 +1220,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -1142,7 +1231,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -1159,7 +1249,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -1170,7 +1261,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -1178,14 +1270,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && (that.getValue().isPresent() @@ -1210,7 +1307,8 @@ public Boolean transformBlob(IBlob that, IClass other) { && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -1226,7 +1324,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -1236,7 +1335,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -1253,7 +1353,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -1264,7 +1365,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -1272,14 +1374,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && Arrays.equals( @@ -1301,7 +1408,8 @@ public Boolean transformFile(IFile that, IClass other) { && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -1317,7 +1425,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -1327,7 +1436,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -1344,7 +1454,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -1355,7 +1466,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -1363,14 +1475,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && that.getValue().isPresent() @@ -1395,7 +1512,8 @@ public Boolean transformAnnotatedRelationshipElement( && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -1411,7 +1529,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -1421,7 +1540,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -1438,7 +1558,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -1449,7 +1570,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -1457,14 +1579,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && transform(that.getFirst(), casted.getFirst()) @@ -1480,7 +1607,8 @@ && zip( pair -> transform( pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getAnnotations().isPresent()); } @@ -1499,7 +1627,8 @@ public Boolean transformEntity(IEntity that, IClass other) { && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -1515,7 +1644,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -1525,7 +1655,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -1542,7 +1673,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -1553,7 +1685,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -1561,14 +1694,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && that.getStatements().isPresent() @@ -1582,7 +1720,8 @@ && zip( pair -> transform( pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getStatements().isPresent() && that.getEntityType() == casted.getEntityType() @@ -1599,16 +1738,21 @@ && zip( .get() .size() && zip( - that.getSpecificAssetIds().get() + that + .getSpecificAssetIds() + .get() .stream(), - casted.getSpecificAssetIds().get() + casted + .getSpecificAssetIds() + .get() .stream()) .map( pair -> transform( pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSpecificAssetIds().isPresent()); } @@ -1660,7 +1804,8 @@ public Boolean transformBasicEventElement(IBasicEventElement that, IClass other) && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -1676,7 +1821,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -1686,7 +1832,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -1703,7 +1850,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -1714,7 +1862,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -1722,14 +1871,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && transform(that.getObserved(), casted.getObserved()) @@ -1777,7 +1931,8 @@ public Boolean transformOperation(IOperation that, IClass other) { && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -1793,7 +1948,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -1803,7 +1959,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -1820,7 +1977,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -1831,7 +1989,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -1839,14 +1998,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && that.getInputVariables().isPresent() @@ -1860,7 +2024,8 @@ && zip( pair -> transform( pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getInputVariables().isPresent() && that.getOutputVariables().isPresent() @@ -1869,14 +2034,17 @@ && zip( == casted.getOutputVariables().get().size() && zip( that.getOutputVariables().get().stream(), - casted.getOutputVariables().get() + casted + .getOutputVariables() + .get() .stream()) .map( pair -> transform( pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getOutputVariables().isPresent() && that.getInoutputVariables().isPresent() @@ -1887,16 +2055,21 @@ && zip( .get() .size() && zip( - that.getInoutputVariables().get() + that + .getInoutputVariables() + .get() .stream(), - casted.getInoutputVariables().get() + casted + .getInoutputVariables() + .get() .stream()) .map( pair -> transform( pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getInoutputVariables().isPresent()); } @@ -1927,7 +2100,8 @@ public Boolean transformCapability(ICapability that, IClass other) { && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -1943,7 +2117,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -1953,7 +2128,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getSemanticId().isPresent() @@ -1970,7 +2146,8 @@ && zip( that.getSupplementalSemanticIds().get().stream(), casted.getSupplementalSemanticIds().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSupplementalSemanticIds().isPresent() && that.getQualifiers().isPresent() @@ -1981,7 +2158,8 @@ && zip( that.getQualifiers().get().stream(), casted.getQualifiers().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getQualifiers().isPresent() && that.getEmbeddedDataSpecifications().isPresent() @@ -1989,14 +2167,19 @@ && zip( && that.getEmbeddedDataSpecifications().get().size() == casted.getEmbeddedDataSpecifications().get().size() && zip( - that.getEmbeddedDataSpecifications().get() + that + .getEmbeddedDataSpecifications() + .get() .stream(), - casted.getEmbeddedDataSpecifications().get() + casted + .getEmbeddedDataSpecifications() + .get() .stream()) .map( pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent()); } @@ -2015,7 +2198,8 @@ public Boolean transformConceptDescription(IConceptDescription that, IClass othe && that.getExtensions().get().size() == casted.getExtensions().get().size() && zip(that.getExtensions().get().stream(), casted.getExtensions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getExtensions().isPresent() && that.getCategory().isPresent() ? casted.getCategory().isPresent() @@ -2031,7 +2215,8 @@ && zip( that.getDisplayName().get().stream(), casted.getDisplayName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDisplayName().isPresent() && that.getDescription().isPresent() ? (casted.getDescription().isPresent() @@ -2041,7 +2226,8 @@ && zip( that.getDescription().get().stream(), casted.getDescription().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDescription().isPresent() && (that.getAdministration().isPresent() @@ -2059,7 +2245,8 @@ && zip( that.getEmbeddedDataSpecifications().get().stream(), casted.getEmbeddedDataSpecifications().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getEmbeddedDataSpecifications().isPresent() && that.getIsCaseOf().isPresent() @@ -2070,7 +2257,8 @@ && zip( that.getIsCaseOf().get().stream(), casted.getIsCaseOf().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getIsCaseOf().isPresent()); } @@ -2093,7 +2281,8 @@ && transform( && that.getKeys().size() == casted.getKeys().size() && (zip(that.getKeys().stream(), casted.getKeys().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals))); } @@ -2150,14 +2339,16 @@ && zip( that.getAssetAdministrationShells().get().stream(), casted.getAssetAdministrationShells().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getAssetAdministrationShells().isPresent() && that.getSubmodels().isPresent() ? (casted.getSubmodels().isPresent() && that.getSubmodels().get().size() == casted.getSubmodels().get().size() && zip(that.getSubmodels().get().stream(), casted.getSubmodels().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getSubmodels().isPresent() && that.getConceptDescriptions().isPresent() ? (casted.getConceptDescriptions().isPresent() @@ -2167,7 +2358,8 @@ && zip( that.getConceptDescriptions().get().stream(), casted.getConceptDescriptions().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getConceptDescriptions().isPresent()); } @@ -2226,7 +2418,8 @@ public Boolean transformValueList(IValueList that, IClass other) { return (that.getValueReferencePairs().size() == casted.getValueReferencePairs().size() && (zip(that.getValueReferencePairs().stream(), casted.getValueReferencePairs().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals))); } @@ -2282,14 +2475,16 @@ public Boolean transformDataSpecificationIec61360( return (that.getPreferredName().size() == casted.getPreferredName().size() && (zip(that.getPreferredName().stream(), casted.getPreferredName().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) && that.getShortName().isPresent() ? (casted.getShortName().isPresent() && that.getShortName().get().size() == casted.getShortName().get().size() && zip(that.getShortName().get().stream(), casted.getShortName().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getShortName().isPresent() && that.getUnit().isPresent() ? casted.getUnit().isPresent() && that.getUnit().get() == casted.getUnit().get() @@ -2315,7 +2510,8 @@ && zip( that.getDefinition().get().stream(), casted.getDefinition().get().stream()) .map(pair -> transform(pair.getFirst(), pair.getSecond())) - .collect(Collectors.toList()).stream() + .collect(Collectors.toList()) + .stream() .allMatch(Boolean.TRUE::equals)) : !casted.getDefinition().isPresent() && that.getValueFormat().isPresent()