diff --git a/setup.py b/setup.py index 4f1309b8..ecef35ac 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ "twine", "jsonschema==3.2.0", "xmlschema==3.3.1", - "aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@6d5411b#egg=aas-core-meta", + "aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@31d6afd#egg=aas-core-meta", "ssort==0.12.3", ] }, diff --git a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/enhancing.hpp b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/enhancing.hpp index fb9d81d2..5b7c79a1 100644 --- a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/enhancing.hpp +++ b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/enhancing.hpp @@ -7118,22 +7118,16 @@ class EnhancedEmbeddedDataSpecification instance_->set_data_specification_content(value); } - const common::optional< - std::shared_ptr - >& data_specification() const override { + const std::shared_ptr& data_specification() const override { return instance_->data_specification(); } - common::optional< - std::shared_ptr - >& mutable_data_specification() override { + std::shared_ptr& mutable_data_specification() override { return instance_->mutable_data_specification(); } void set_data_specification( - common::optional< - std::shared_ptr - > value + std::shared_ptr value ) override { instance_->set_data_specification(value); } @@ -13537,26 +13531,12 @@ std::shared_ptr WrapEmbeddedDataSpecification ) ); - if (that->data_specification().has_value()) { - const std::shared_ptr& value( - that->data_specification().value() - ); - - std::shared_ptr< - types::IReference - > wrapped( - Wrap( - value, - factory - ) - ); - - that->set_data_specification( - common::make_optional( - std::move(wrapped) - ) - ); - } + that->set_data_specification( + Wrap( + that->data_specification(), + factory + ) + ); std::shared_ptr enh( factory(that) diff --git a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/iteration.cpp b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/iteration.cpp index d16d0426..8e652f4f 100644 --- a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/iteration.cpp +++ b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/iteration.cpp @@ -11313,15 +11313,10 @@ void IteratorOverEmbeddedDataSpecification::Execute() { } case 1: { - if (!(casted_->data_specification().has_value())) { - state_ = 2; - continue; - } - property_ = Property::kDataSpecification; item_ = std::move( std::static_pointer_cast( - *(casted_->data_specification()) + casted_->data_specification() ) ); ++index_; diff --git a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/jsonization.cpp b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/jsonization.cpp index 83663d2a..8b04abd1 100644 --- a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/jsonization.cpp +++ b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/jsonization.cpp @@ -23597,6 +23597,18 @@ std::pair< ); } + if (!json.contains("dataSpecification")) { + return std::make_pair< + common::optional >, + common::optional + >( + common::nullopt, + common::make_optional( + L"The required property dataSpecification is missing" + ) + ); + } + // endregion Check required properties // region Initialization @@ -23605,9 +23617,7 @@ std::pair< common::optional > the_data_specification_content; - common::optional< - std::shared_ptr - > the_data_specification; + common::optional > the_data_specification; // endregion Initialization @@ -23641,30 +23651,28 @@ std::pair< // region De-serialize dataSpecification - if (json.contains("dataSpecification")) { - std::tie( - the_data_specification, - error - ) = DeserializeReference( - json["dataSpecification"], - additional_properties - ); + std::tie( + the_data_specification, + error + ) = DeserializeReference( + json["dataSpecification"], + additional_properties + ); - if (error.has_value()) { - error->path.segments.emplace_front( - common::make_unique( - L"dataSpecification" - ) - ); + if (error.has_value()) { + error->path.segments.emplace_front( + common::make_unique( + L"dataSpecification" + ) + ); - return std::make_pair< - common::optional >, - common::optional - >( - common::nullopt, - std::move(error) - ); - } + return std::make_pair< + common::optional >, + common::optional + >( + common::nullopt, + std::move(error) + ); } // endregion De-serialize dataSpecification @@ -23678,7 +23686,7 @@ std::pair< // upcast. new types::EmbeddedDataSpecification( std::move(*the_data_specification_content), - std::move(the_data_specification) + std::move(*the_data_specification) ) ), common::nullopt @@ -36939,40 +36947,33 @@ std::pair< *json_data_specification_content ); - const common::optional< - std::shared_ptr - >& maybe_data_specification( - that.data_specification() + common::optional json_data_specification; + std::tie( + json_data_specification, + error + ) = SerializeIClass( + *that.data_specification() ); - if (maybe_data_specification.has_value()) { - common::optional json_data_specification; - std::tie( - json_data_specification, - error - ) = SerializeIClass( - **maybe_data_specification + if (error.has_value()) { + error->path.segments.emplace_front( + common::make_unique( + iteration::Property::kDataSpecification + ) ); - if (error.has_value()) { - error->path.segments.emplace_front( - common::make_unique( - iteration::Property::kDataSpecification - ) - ); - - return std::make_pair< - common::optional, - common::optional - >( - common::nullopt, - std::move(error) - ); - } - result["dataSpecification"] = std::move( - *json_data_specification + return std::make_pair< + common::optional, + common::optional + >( + common::nullopt, + std::move(error) ); } + result["dataSpecification"] = std::move( + *json_data_specification + ); + return std::make_pair< common::optional, common::optional diff --git a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/types.cpp b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/types.cpp index 36e1f1da..87663afe 100644 --- a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/types.cpp +++ b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/types.cpp @@ -6912,9 +6912,7 @@ void Environment::set_concept_descriptions( EmbeddedDataSpecification::EmbeddedDataSpecification( std::shared_ptr data_specification_content, - common::optional< - std::shared_ptr - > data_specification + std::shared_ptr data_specification ) { data_specification_content_ = std::move(data_specification_content); @@ -6939,22 +6937,16 @@ void EmbeddedDataSpecification::set_data_specification_content( data_specification_content_ = value; } -const common::optional< - std::shared_ptr ->& EmbeddedDataSpecification::data_specification() const { +const std::shared_ptr& EmbeddedDataSpecification::data_specification() const { return data_specification_; } -common::optional< - std::shared_ptr ->& EmbeddedDataSpecification::mutable_data_specification() { +std::shared_ptr& EmbeddedDataSpecification::mutable_data_specification() { return data_specification_; } void EmbeddedDataSpecification::set_data_specification( - common::optional< - std::shared_ptr - > value + std::shared_ptr value ) { data_specification_ = value; } diff --git a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/types.hpp b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/types.hpp index 37336777..b54c0e70 100644 --- a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/types.hpp +++ b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/types.hpp @@ -2942,18 +2942,12 @@ class IEmbeddedDataSpecification ///@{ /// \brief Reference to the data specification - virtual const common::optional< - std::shared_ptr - >& data_specification() const = 0; + virtual const std::shared_ptr& data_specification() const = 0; - virtual common::optional< - std::shared_ptr - >& mutable_data_specification() = 0; + virtual std::shared_ptr& mutable_data_specification() = 0; virtual void set_data_specification( - common::optional< - std::shared_ptr - > value + std::shared_ptr value ) = 0; ///@} @@ -10275,11 +10269,9 @@ class Environment class EmbeddedDataSpecification : public IEmbeddedDataSpecification { public: - explicit EmbeddedDataSpecification( + EmbeddedDataSpecification( std::shared_ptr data_specification_content, - common::optional< - std::shared_ptr - > data_specification = common::nullopt + std::shared_ptr data_specification ); ModelType model_type() const override; @@ -10298,18 +10290,12 @@ class EmbeddedDataSpecification // region Get and set data_specification_ - const common::optional< - std::shared_ptr - >& data_specification() const override; + const std::shared_ptr& data_specification() const override; - common::optional< - std::shared_ptr - >& mutable_data_specification() override; + std::shared_ptr& mutable_data_specification() override; void set_data_specification( - common::optional< - std::shared_ptr - > value + std::shared_ptr value ) override; // endregion @@ -10319,9 +10305,7 @@ class EmbeddedDataSpecification private: std::shared_ptr data_specification_content_; - common::optional< - std::shared_ptr - > data_specification_; + std::shared_ptr data_specification_; }; class LevelType diff --git a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/verification.cpp b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/verification.cpp index 6da0a6f0..017a0b99 100644 --- a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/verification.cpp +++ b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/verification.cpp @@ -5421,33 +5421,12 @@ void OfPathType::Execute() { } case 3: { - if ( - MatchesRfc8089Path( - (*value_) - ) - ) { - state_ = 4; - continue; - } - - error_ = common::make_unique( - L"The value must represent a valid file URI scheme according " - L"to RFC 8089." - ); - // No path is prepended as the error refers to the value itself. - ++index_; - - state_ = 4; - return; - } - - case 4: { done_ = true; error_ = nullptr; index_ = -1; // We invalidate the state since we reached the end of the routine. - state_ = 5; + state_ = 4; return; } @@ -24262,7 +24241,7 @@ void OfDataSpecificationIec61360::Execute() { } error_ = common::make_unique( - L"Constraint AASc-002: preferred name shall be provided at " + L"Constraint AASc-3a-002: preferred name shall be provided at " L"least in English." ); // No path is prepended as the error refers to the instance itself. diff --git a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/visitation.cpp b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/visitation.cpp index 953e5fb9..3554ad4c 100644 --- a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/visitation.cpp +++ b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/visitation.cpp @@ -3095,18 +3095,10 @@ void PassThroughVisitor::VisitEmbeddedDataSpecification( that->mutable_data_specification_content() ); - // region mutable_data_specification - const common::optional< - std::shared_ptr - >& maybe_data_specification( + // mutable_data_specification + Visit( that->mutable_data_specification() ); - if (maybe_data_specification.has_value()) { - Visit( - maybe_data_specification.value() - ); - } - // endregion } void PassThroughVisitor::VisitLevelType( diff --git a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/xmlization.cpp b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/xmlization.cpp index 9dd7593a..ef66436f 100644 --- a/test_data/cpp/test_main/aas_core_meta.v3/expected_output/xmlization.cpp +++ b/test_data/cpp/test_main/aas_core_meta.v3/expected_output/xmlization.cpp @@ -31507,9 +31507,7 @@ std::pair< common::optional > the_data_specification_content; - common::optional< - std::shared_ptr - > the_data_specification; + common::optional > the_data_specification; // endregion Initialization @@ -31694,6 +31692,14 @@ std::pair< ); } + if (!the_data_specification.has_value()) { + return NoInstanceAndDeserializationErrorWithCause< + std::shared_ptr + >( + L"The required property dataSpecification is missing" + ); + } + // endregion Check required properties return std::make_pair( @@ -31705,7 +31711,7 @@ std::pair< // upcast. new types::EmbeddedDataSpecification( std::move(*the_data_specification_content), - std::move(the_data_specification) + std::move(*the_data_specification) ) ), common::nullopt @@ -53775,46 +53781,41 @@ common::optional SerializeEmbeddedDataSpecificationAsSequenc return error; } - const auto& maybe_data_specification( + const std::shared_ptr& the_data_specification( that.data_specification() ); - if (maybe_data_specification.has_value()) { - const std::shared_ptr& the_data_specification( - *maybe_data_specification - ); - writer.StartElement( - "dataSpecification" - ); - if (writer.error().has_value()) { - return writer.move_error(); - } - error = SerializeReferenceAsSequence( - *the_data_specification, - writer + writer.StartElement( + "dataSpecification" + ); + if (writer.error().has_value()) { + return writer.move_error(); + } + error = SerializeReferenceAsSequence( + *the_data_specification, + writer + ); + if (error.has_value()) { + error->path.segments.emplace_front( + common::make_unique( + iteration::Property::kDataSpecification + ) ); - if (error.has_value()) { - error->path.segments.emplace_front( - common::make_unique( - iteration::Property::kDataSpecification - ) - ); - return error; - } - writer.StopElement( - "dataSpecification" - ); - if (writer.error().has_value()) { - error = writer.move_error(); + return error; + } + writer.StopElement( + "dataSpecification" + ); + if (writer.error().has_value()) { + error = writer.move_error(); - error->path.segments.emplace_front( - common::make_unique( - iteration::Property::kDataSpecification - ) - ); + error->path.segments.emplace_front( + common::make_unique( + iteration::Property::kDataSpecification + ) + ); - return error; - } + return error; } writer.Finish(); diff --git a/test_data/csharp/test_main/aas_core_meta.v3/expected_output/copying.cs b/test_data/csharp/test_main/aas_core_meta.v3/expected_output/copying.cs index c2fed0e4..ef6cb8aa 100644 --- a/test_data/csharp/test_main/aas_core_meta.v3/expected_output/copying.cs +++ b/test_data/csharp/test_main/aas_core_meta.v3/expected_output/copying.cs @@ -2457,9 +2457,7 @@ Aas.IEmbeddedDataSpecification that { return new Aas.EmbeddedDataSpecification( Deep(that.DataSpecificationContent), - (that.DataSpecification != null) - ? Deep(that.DataSpecification) - : null + Deep(that.DataSpecification) ); } diff --git a/test_data/csharp/test_main/aas_core_meta.v3/expected_output/enhancing.cs b/test_data/csharp/test_main/aas_core_meta.v3/expected_output/enhancing.cs index 34c63df1..eae4a3e0 100644 --- a/test_data/csharp/test_main/aas_core_meta.v3/expected_output/enhancing.cs +++ b/test_data/csharp/test_main/aas_core_meta.v3/expected_output/enhancing.cs @@ -3719,7 +3719,7 @@ public IDataSpecificationContent DataSpecificationContent set => _instance.DataSpecificationContent = value; } - public IReference? DataSpecification + public IReference DataSpecification { get => _instance.DataSpecification; set => _instance.DataSpecification = value; @@ -7660,19 +7660,16 @@ transformedDataSpecificationContent as Aas.IDataSpecificationContent ); that.DataSpecificationContent = castedDataSpecificationContent; - if (that.DataSpecification != null) - { - var transformedDataSpecification = Transform( - that.DataSpecification - ); - var castedDataSpecification = ( - transformedDataSpecification as Aas.IReference - ) ?? throw new System.InvalidOperationException( - "Expected the transformed value to be a IReference, " + - $"but got: {transformedDataSpecification}" - ); - that.DataSpecification = castedDataSpecification; - } + var transformedDataSpecification = Transform( + that.DataSpecification + ); + var castedDataSpecification = ( + transformedDataSpecification as Aas.IReference + ) ?? throw new System.InvalidOperationException( + "Expected the transformed value to be a IReference, " + + $"but got: {transformedDataSpecification}" + ); + that.DataSpecification = castedDataSpecification; var enhancement = _enhancementFactory(that); return (enhancement == null) diff --git a/test_data/csharp/test_main/aas_core_meta.v3/expected_output/jsonization.cs b/test_data/csharp/test_main/aas_core_meta.v3/expected_output/jsonization.cs index 2fa54697..5247df71 100644 --- a/test_data/csharp/test_main/aas_core_meta.v3/expected_output/jsonization.cs +++ b/test_data/csharp/test_main/aas_core_meta.v3/expected_output/jsonization.cs @@ -13875,11 +13875,20 @@ internal static class DeserializeImplementation return null; } + if (theDataSpecification == null) + { + error = new Reporting.Error( + "Required property \"dataSpecification\" is missing"); + return null; + } + return new Aas.EmbeddedDataSpecification( theDataSpecificationContent ?? throw new System.InvalidOperationException( "Unexpected null, had to be handled before"), - theDataSpecification); + theDataSpecification + ?? throw new System.InvalidOperationException( + "Unexpected null, had to be handled before")); } // internal static EmbeddedDataSpecificationFrom /// @@ -19140,11 +19149,8 @@ Aas.IEmbeddedDataSpecification that result["dataSpecificationContent"] = Transform( that.DataSpecificationContent); - if (that.DataSpecification != null) - { - result["dataSpecification"] = Transform( - that.DataSpecification); - } + result["dataSpecification"] = Transform( + that.DataSpecification); return result; } diff --git a/test_data/csharp/test_main/aas_core_meta.v3/expected_output/types.cs b/test_data/csharp/test_main/aas_core_meta.v3/expected_output/types.cs index 888fb754..f5777508 100644 --- a/test_data/csharp/test_main/aas_core_meta.v3/expected_output/types.cs +++ b/test_data/csharp/test_main/aas_core_meta.v3/expected_output/types.cs @@ -11894,7 +11894,7 @@ public interface IEmbeddedDataSpecification : IClass /// /// Reference to the data specification /// - public IReference? DataSpecification { get; set; } + public IReference DataSpecification { get; set; } } /// @@ -11910,7 +11910,7 @@ public class EmbeddedDataSpecification : IEmbeddedDataSpecification /// /// Reference to the data specification /// - public IReference? DataSpecification { get; set; } + public IReference DataSpecification { get; set; } /// /// Iterate over all the class instances referenced from this instance @@ -11920,10 +11920,7 @@ public IEnumerable DescendOnce() { yield return DataSpecificationContent; - if (DataSpecification != null) - { - yield return DataSpecification; - } + yield return DataSpecification; } /// @@ -11939,15 +11936,12 @@ public IEnumerable Descend() yield return anItem; } - if (DataSpecification != null) - { - yield return DataSpecification; + yield return DataSpecification; - // Recurse - foreach (var anItem in DataSpecification.Descend()) - { - yield return anItem; - } + // Recurse + foreach (var anItem in DataSpecification.Descend()) + { + yield return anItem; } } @@ -11993,7 +11987,7 @@ public T Transform( public EmbeddedDataSpecification( IDataSpecificationContent dataSpecificationContent, - IReference? dataSpecification = null) + IReference dataSpecification) { DataSpecificationContent = dataSpecificationContent; DataSpecification = dataSpecification; diff --git a/test_data/csharp/test_main/aas_core_meta.v3/expected_output/verification.cs b/test_data/csharp/test_main/aas_core_meta.v3/expected_output/verification.cs index 05cc3418..1d34168b 100644 --- a/test_data/csharp/test_main/aas_core_meta.v3/expected_output/verification.cs +++ b/test_data/csharp/test_main/aas_core_meta.v3/expected_output/verification.cs @@ -9119,15 +9119,12 @@ Aas.IEmbeddedDataSpecification that yield return error; } - if (that.DataSpecification != null) + foreach (var error in Verification.Verify(that.DataSpecification)) { - foreach (var error in Verification.Verify(that.DataSpecification)) - { - error.PrependSegment( - new Reporting.NameSegment( - "dataSpecification")); - yield return error; - } + error.PrependSegment( + new Reporting.NameSegment( + "dataSpecification")); + yield return error; } } @@ -9373,7 +9370,7 @@ Aas.IDataSpecificationIec61360 that { yield return new Reporting.Error( "Invariant violated:\n" + - "Constraint AASc-002: preferred name shall be provided at " + + "Constraint AASc-3a-002: preferred name shall be provided at " + "least in English."); } @@ -9934,14 +9931,6 @@ var error in Verification.VerifyNonEmptyXmlSerializableString( "Invariant violated:\n" + "Identifier shall have a maximum length of 2000 characters."); } - - if (!Verification.MatchesRfc8089Path(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must represent a valid file URI scheme according " + - "to RFC 8089."); - } } /// diff --git a/test_data/csharp/test_main/aas_core_meta.v3/expected_output/xmlization.cs b/test_data/csharp/test_main/aas_core_meta.v3/expected_output/xmlization.cs index c343b5d3..8f4ce6f9 100644 --- a/test_data/csharp/test_main/aas_core_meta.v3/expected_output/xmlization.cs +++ b/test_data/csharp/test_main/aas_core_meta.v3/expected_output/xmlization.cs @@ -17133,11 +17133,21 @@ out Reporting.Error? error return null; } + if (theDataSpecification == null) + { + error = new Reporting.Error( + "The required property DataSpecification has not been given " + + "in the XML representation of an instance of class EmbeddedDataSpecification"); + return null; + } + return new Aas.EmbeddedDataSpecification( theDataSpecificationContent ?? throw new System.InvalidOperationException( "Unexpected null, had to be handled before"), - theDataSpecification); + theDataSpecification + ?? throw new System.InvalidOperationException( + "Unexpected null, had to be handled before")); } // internal static Aas.EmbeddedDataSpecification? EmbeddedDataSpecificationFromSequence /// @@ -25822,18 +25832,15 @@ private void EmbeddedDataSpecificationToSequence( writer.WriteEndElement(); - if (that.DataSpecification != null) - { - writer.WriteStartElement( - "dataSpecification", - NS); + writer.WriteStartElement( + "dataSpecification", + NS); - this.ReferenceToSequence( - that.DataSpecification, - writer); + this.ReferenceToSequence( + that.DataSpecification, + writer); - writer.WriteEndElement(); - } + writer.WriteEndElement(); } // private void EmbeddedDataSpecificationToSequence public override void VisitEmbeddedDataSpecification( diff --git a/test_data/golang/test_main/aas_core_meta.v3/expected_output/enhancing/enhancing.go b/test_data/golang/test_main/aas_core_meta.v3/expected_output/enhancing/enhancing.go index aa14ad87..6e92c85b 100644 --- a/test_data/golang/test_main/aas_core_meta.v3/expected_output/enhancing/enhancing.go +++ b/test_data/golang/test_main/aas_core_meta.v3/expected_output/enhancing/enhancing.go @@ -6207,14 +6207,12 @@ func wrapEmbeddedDataSpecification[E any]( ) theDataSpecification := that.DataSpecification() - if theDataSpecification != nil { - that.SetDataSpecification( - Wrap[E]( - theDataSpecification, - factory, - ).(aastypes.IReference), - ) - } + that.SetDataSpecification( + Wrap[E]( + theDataSpecification, + factory, + ).(aastypes.IReference), + ) return } diff --git a/test_data/golang/test_main/aas_core_meta.v3/expected_output/jsonization/jsonization.go b/test_data/golang/test_main/aas_core_meta.v3/expected_output/jsonization/jsonization.go index aa7b14a9..8ac392c9 100644 --- a/test_data/golang/test_main/aas_core_meta.v3/expected_output/jsonization/jsonization.go +++ b/test_data/golang/test_main/aas_core_meta.v3/expected_output/jsonization/jsonization.go @@ -13131,6 +13131,7 @@ func embeddedDataSpecificationFromMapWithoutDispatch( var theDataSpecification aastypes.IReference foundDataSpecificationContent := false + foundDataSpecification := false for k, v := range m { switch k { @@ -13164,6 +13165,7 @@ func embeddedDataSpecificationFromMapWithoutDispatch( } return } + foundDataSpecification = true default: err = newDeserializationError( @@ -13183,10 +13185,15 @@ func embeddedDataSpecificationFromMapWithoutDispatch( return } + if !foundDataSpecification { + err = newDeserializationError( + "The required property 'dataSpecification' is missing", + ) + return + } + result = aastypes.NewEmbeddedDataSpecification( theDataSpecificationContent, - ) - result.SetDataSpecification( theDataSpecification, ) @@ -21216,24 +21223,22 @@ func embeddedDataSpecificationToMap( } result["dataSpecificationContent"] = jsonableDataSpecificationContent - if that.DataSpecification() != nil { - var jsonableDataSpecification interface{} - jsonableDataSpecification, err = ToJsonable( - that.DataSpecification(), - ) - if err != nil { - if seriaErr, ok := err.(*SerializationError); ok { - seriaErr.Path.PrependName( - &aasreporting.NameSegment{ - Name: "DataSpecification()", - }, - ) - } - - return + var jsonableDataSpecification interface{} + jsonableDataSpecification, err = ToJsonable( + that.DataSpecification(), + ) + if err != nil { + if seriaErr, ok := err.(*SerializationError); ok { + seriaErr.Path.PrependName( + &aasreporting.NameSegment{ + Name: "DataSpecification()", + }, + ) } - result["dataSpecification"] = jsonableDataSpecification + + return } + result["dataSpecification"] = jsonableDataSpecification return } diff --git a/test_data/golang/test_main/aas_core_meta.v3/expected_output/types/types.go b/test_data/golang/test_main/aas_core_meta.v3/expected_output/types/types.go index 430ef01d..4d1ee058 100644 --- a/test_data/golang/test_main/aas_core_meta.v3/expected_output/types/types.go +++ b/test_data/golang/test_main/aas_core_meta.v3/expected_output/types/types.go @@ -11504,13 +11504,11 @@ func (eds *EmbeddedDataSpecification) DescendOnce( return } - if eds.dataSpecification != nil { - abort = action( - eds.dataSpecification, - ) - if abort { - return - } + abort = action( + eds.dataSpecification, + ) + if abort { + return } return @@ -11538,19 +11536,17 @@ func (eds *EmbeddedDataSpecification) Descend( return } - if eds.dataSpecification != nil { - abort = action( - eds.dataSpecification, - ) - if abort { - return - } - abort = eds.dataSpecification.Descend( - action, - ) - if abort { - return - } + abort = action( + eds.dataSpecification, + ) + if abort { + return + } + abort = eds.dataSpecification.Descend( + action, + ) + if abort { + return } return @@ -11560,10 +11556,11 @@ func (eds *EmbeddedDataSpecification) Descend( // the given properties. func NewEmbeddedDataSpecification( dataSpecificationContent IDataSpecificationContent, + dataSpecification IReference, ) *EmbeddedDataSpecification { return &EmbeddedDataSpecification{ dataSpecificationContent: dataSpecificationContent, - dataSpecification: nil, + dataSpecification: dataSpecification, } } diff --git a/test_data/golang/test_main/aas_core_meta.v3/expected_output/verification/verification.go b/test_data/golang/test_main/aas_core_meta.v3/expected_output/verification/verification.go index aa61899f..4bc3cc01 100644 --- a/test_data/golang/test_main/aas_core_meta.v3/expected_output/verification/verification.go +++ b/test_data/golang/test_main/aas_core_meta.v3/expected_output/verification/verification.go @@ -12351,7 +12351,16 @@ func VerifyEmbeddedDataSpecification( } } - if that.DataSpecification() != nil { + if that.DataSpecification() == nil { + abort = onError( + newVerificationError( + "Required property not set: DataSpecification", + ), + ) + if abort { + return + } + } else { abort = Verify( that.DataSpecification(), func(err *VerificationError) bool { @@ -12793,7 +12802,7 @@ func VerifyDataSpecificationIEC61360( )) { abort = onError( newVerificationError( - "Constraint AASc-002: preferred name shall be provided at " + + "Constraint AASc-3a-002: preferred name shall be provided at " + "least in English.", ), ) @@ -13661,18 +13670,6 @@ func VerifyPathType( } } - if !MatchesRFC8089Path(that) { - abort = onError( - newVerificationError( - "The value must represent a valid file URI scheme according " + - "to RFC 8089.", - ), - ) - if abort { - return - } - } - return } diff --git a/test_data/golang/test_main/aas_core_meta.v3/expected_output/xmlization/xmlization.go b/test_data/golang/test_main/aas_core_meta.v3/expected_output/xmlization/xmlization.go index 81d21d48..85807647 100644 --- a/test_data/golang/test_main/aas_core_meta.v3/expected_output/xmlization/xmlization.go +++ b/test_data/golang/test_main/aas_core_meta.v3/expected_output/xmlization/xmlization.go @@ -9714,6 +9714,7 @@ func readEmbeddedDataSpecificationAsSequence( var theDataSpecification aastypes.IReference foundDataSpecificationContent := false + foundDataSpecification := false for { current, err = skipEmptyTextWhitespaceAndComments(decoder, current) @@ -9772,6 +9773,7 @@ func readEmbeddedDataSpecificationAsSequence( decoder, current, ) + foundDataSpecification = true default: valueErr = newDeserializationError( @@ -9824,10 +9826,15 @@ func readEmbeddedDataSpecificationAsSequence( return } + if !foundDataSpecification { + err = newDeserializationError( + "The required property 'dataSpecification' is missing", + ) + return + } + instance = aastypes.NewEmbeddedDataSpecification( theDataSpecificationContent, - ) - instance.SetDataSpecification( theDataSpecification, ) return @@ -21747,39 +21754,35 @@ func writeEmbeddedDataSpecificationAsSequence( // region DataSpecification - theDataSpecification := that.DataSpecification() - - if theDataSpecification != nil { - err = writeStartElement( - encoder, - "dataSpecification", - false, - ) - if err != nil { - return - } - err = writeReferenceAsSequence( - encoder, - theDataSpecification, - ) - if err != nil { - if seriaErr, ok := err.(*SerializationError); ok { - seriaErr.Path.PrependName( - &aasreporting.NameSegment{ - Name: "DataSpecification()", - }, - ) - } - return - } - err = writeEndElement( - encoder, - "dataSpecification", - false, - ) - if err != nil { - return + err = writeStartElement( + encoder, + "dataSpecification", + false, + ) + if err != nil { + return + } + err = writeReferenceAsSequence( + encoder, + that.DataSpecification(), + ) + if err != nil { + if seriaErr, ok := err.(*SerializationError); ok { + seriaErr.Path.PrependName( + &aasreporting.NameSegment{ + Name: "DataSpecification()", + }, + ) } + return + } + err = writeEndElement( + encoder, + "dataSpecification", + false, + ) + if err != nil { + return } err = encoder.Flush() diff --git a/test_data/intermediate/real_meta_models/aas_core_meta.v3/expected_symbol_table.txt b/test_data/intermediate/real_meta_models/aas_core_meta.v3/expected_symbol_table.txt index 0c5e4b3d..84cf4f46 100644 --- a/test_data/intermediate/real_meta_models/aas_core_meta.v3/expected_symbol_table.txt +++ b/test_data/intermediate/real_meta_models/aas_core_meta.v3/expected_symbol_table.txt @@ -814,18 +814,6 @@ SymbolTable( original_node=...), original_node=...)"""), specified_for='Reference to ConstrainedPrimitive Identifier', - parsed=...), - Invariant( - description='The value must represent a valid file URI scheme according to RFC 8089.', - body=textwrap.dedent("""\ - FunctionCall( - name='matches_RFC_8089_path', - args=[ - Name( - identifier='self', - original_node=...)], - original_node=...)"""), - specified_for='Reference to ConstrainedPrimitive Path_type', parsed=...)], invariant_id_set=..., description=DescriptionOfOurType( @@ -25638,10 +25626,8 @@ SymbolTable( parsed=...), Property( name='data_specification', - type_annotation=OptionalTypeAnnotation( - value=OurTypeAnnotation( - our_type='Reference to our type Reference', - parsed=...), + type_annotation=OurTypeAnnotation( + our_type='Reference to our type Reference', parsed=...), description=DescriptionOfProperty( summary='Reference to the data specification', @@ -25663,14 +25649,10 @@ SymbolTable( parsed=...), Argument( name='data_specification', - type_annotation=OptionalTypeAnnotation( - value=OurTypeAnnotation( - our_type='Reference to our type Reference', - parsed=...), - parsed=...), - default=DefaultPrimitive( - value=None, + type_annotation=OurTypeAnnotation( + our_type='Reference to our type Reference', parsed=...), + default=None, parsed=...)], returns=None, description=None, @@ -27343,7 +27325,7 @@ SymbolTable( specified_for='Reference to ConcreteClass Data_specification_IEC_61360', parsed=...), Invariant( - description='Constraint AASc-002: preferred name shall be provided at least in English.', + description='Constraint AASc-3a-002: preferred name shall be provided at least in English.', body=textwrap.dedent("""\ Any( generator=ForEach( diff --git a/test_data/java/test_main/aas_core_meta.v3/expected_output/copying/Copying.java b/test_data/java/test_main/aas_core_meta.v3/expected_output/copying/Copying.java index cf725946..b8759a93 100644 --- a/test_data/java/test_main/aas_core_meta.v3/expected_output/copying/Copying.java +++ b/test_data/java/test_main/aas_core_meta.v3/expected_output/copying/Copying.java @@ -507,7 +507,7 @@ public IClass transformEmbeddedDataSpecification( ) { return new EmbeddedDataSpecification( that.getDataSpecificationContent(), - that.getDataSpecification().orElse(null)); + that.getDataSpecification()); } @Override @@ -2513,7 +2513,7 @@ public IClass transformEmbeddedDataSpecification ( ) { return new EmbeddedDataSpecification( deep(that.getDataSpecificationContent()), - that.getDataSpecification().orElse(null) + deep(that.getDataSpecification()) ); } diff --git a/test_data/java/test_main/aas_core_meta.v3/expected_output/enhancing/EnhancedEmbeddedDataSpecification.java b/test_data/java/test_main/aas_core_meta.v3/expected_output/enhancing/EnhancedEmbeddedDataSpecification.java index 564dc612..89b792a5 100644 --- a/test_data/java/test_main/aas_core_meta.v3/expected_output/enhancing/EnhancedEmbeddedDataSpecification.java +++ b/test_data/java/test_main/aas_core_meta.v3/expected_output/enhancing/EnhancedEmbeddedDataSpecification.java @@ -40,7 +40,7 @@ public void setDataSpecificationContent(IDataSpecificationContent dataSpecificat } @Override - public Optional getDataSpecification() { + public IReference getDataSpecification() { return instance.getDataSpecification(); } diff --git a/test_data/java/test_main/aas_core_meta.v3/expected_output/enhancing/Wrapper.java b/test_data/java/test_main/aas_core_meta.v3/expected_output/enhancing/Wrapper.java index 986da172..d2ae1392 100644 --- a/test_data/java/test_main/aas_core_meta.v3/expected_output/enhancing/Wrapper.java +++ b/test_data/java/test_main/aas_core_meta.v3/expected_output/enhancing/Wrapper.java @@ -3116,18 +3116,16 @@ public IClass transformEmbeddedDataSpecification( IDataSpecificationContent castedDataSpecificationContent = (IDataSpecificationContent) transformedDataSpecificationContent; that.setDataSpecificationContent(castedDataSpecificationContent); - if (that.getDataSpecification().isPresent()) { - IReference dataSpecification = that.getDataSpecification().get(); - IClass transformedDataSpecification = transform(dataSpecification); - if (!(transformedDataSpecification instanceof IReference)) { - throw new UnsupportedOperationException( - "Expected the transformed value to be a IReference " + - ", but got: " + transformedDataSpecification - ); - } - IReference castedDataSpecification = (IReference) transformedDataSpecification; - that.setDataSpecification(castedDataSpecification); + IReference dataSpecification = that.getDataSpecification(); + IClass transformedDataSpecification = transform(dataSpecification); + if (!(transformedDataSpecification instanceof IReference)) { + throw new UnsupportedOperationException( + "Expected the transformed value to be a IReference " + + ", but got: " + transformedDataSpecification + ); } + IReference castedDataSpecification = (IReference) transformedDataSpecification; + that.setDataSpecification(castedDataSpecification); Optional enhancement = enhancementFactory.apply(that); return !enhancement.isPresent() diff --git a/test_data/java/test_main/aas_core_meta.v3/expected_output/jsonization/Jsonization.java b/test_data/java/test_main/aas_core_meta.v3/expected_output/jsonization/Jsonization.java index 06695fec..385b1110 100644 --- a/test_data/java/test_main/aas_core_meta.v3/expected_output/jsonization/Jsonization.java +++ b/test_data/java/test_main/aas_core_meta.v3/expected_output/jsonization/Jsonization.java @@ -10978,6 +10978,12 @@ private static Result tryEmbeddedDataSpecificationFro return Result.failure(error); } + if (theDataSpecification == null) { + final Reporting.Error error = new Reporting.Error( + "Required property \"dataSpecification\" is missing"); + return Result.failure(error); + } + return Result.success(new EmbeddedDataSpecification( theDataSpecificationContent, theDataSpecification)); @@ -15118,10 +15124,8 @@ public JsonNode transformEmbeddedDataSpecification( result.set("dataSpecificationContent", transform( that.getDataSpecificationContent())); - if (that.getDataSpecification().isPresent()) { - result.set("dataSpecification", transform( - that.getDataSpecification().get())); - } + result.set("dataSpecification", transform( + that.getDataSpecification())); return result; } diff --git a/test_data/java/test_main/aas_core_meta.v3/expected_output/types/impl/EmbeddedDataSpecification.java b/test_data/java/test_main/aas_core_meta.v3/expected_output/types/impl/EmbeddedDataSpecification.java index 0ab22470..1b1fbdc9 100644 --- a/test_data/java/test_main/aas_core_meta.v3/expected_output/types/impl/EmbeddedDataSpecification.java +++ b/test_data/java/test_main/aas_core_meta.v3/expected_output/types/impl/EmbeddedDataSpecification.java @@ -40,19 +40,15 @@ public class EmbeddedDataSpecification implements IEmbeddedDataSpecification { */ private IReference dataSpecification; - public EmbeddedDataSpecification(IDataSpecificationContent dataSpecificationContent) { - this.dataSpecificationContent = Objects.requireNonNull( - dataSpecificationContent, - "Argument \"dataSpecificationContent\" must be non-null."); - } - public EmbeddedDataSpecification( IDataSpecificationContent dataSpecificationContent, IReference dataSpecification) { this.dataSpecificationContent = Objects.requireNonNull( dataSpecificationContent, "Argument \"dataSpecificationContent\" must be non-null."); - this.dataSpecification = dataSpecification; + this.dataSpecification = Objects.requireNonNull( + dataSpecification, + "Argument \"dataSpecification\" must be non-null."); } @Override @@ -68,13 +64,15 @@ public void setDataSpecificationContent(IDataSpecificationContent dataSpecificat } @Override - public Optional getDataSpecification() { - return Optional.ofNullable(dataSpecification); + public IReference getDataSpecification() { + return dataSpecification; } @Override public void setDataSpecification(IReference dataSpecification) { - this.dataSpecification = dataSpecification; + this.dataSpecification = Objects.requireNonNull( + dataSpecification, + "Argument \"dataSpecification\" must be non-null."); } /** diff --git a/test_data/java/test_main/aas_core_meta.v3/expected_output/types/model/IEmbeddedDataSpecification.java b/test_data/java/test_main/aas_core_meta.v3/expected_output/types/model/IEmbeddedDataSpecification.java index 0de1d31e..a7df10ad 100644 --- a/test_data/java/test_main/aas_core_meta.v3/expected_output/types/model/IEmbeddedDataSpecification.java +++ b/test_data/java/test_main/aas_core_meta.v3/expected_output/types/model/IEmbeddedDataSpecification.java @@ -26,7 +26,7 @@ public interface IEmbeddedDataSpecification extends IClass { /** * Reference to the data specification */ - Optional getDataSpecification(); + IReference getDataSpecification(); void setDataSpecification(IReference dataSpecification); } diff --git a/test_data/java/test_main/aas_core_meta.v3/expected_output/verification/Verification.java b/test_data/java/test_main/aas_core_meta.v3/expected_output/verification/Verification.java index 0878dbad..71410ae3 100644 --- a/test_data/java/test_main/aas_core_meta.v3/expected_output/verification/Verification.java +++ b/test_data/java/test_main/aas_core_meta.v3/expected_output/verification/Verification.java @@ -8879,16 +8879,14 @@ public Stream transformEmbeddedDataSpecification( return error; })); - if (that.getDataSpecification().isPresent()) { - errorStream = Stream.concat(errorStream, - Stream.of(that.getDataSpecification().get()) - .flatMap(Verification::verifyToErrorStream) - .map(error -> { - error.prependSegment( - new Reporting.NameSegment("dataSpecification")); - return error; - })); - } + errorStream = Stream.concat(errorStream, + Stream.of(that.getDataSpecification()) + .flatMap(Verification::verifyToErrorStream) + .map(error -> { + error.prependSegment( + new Reporting.NameSegment("dataSpecification")); + return error; + })); return errorStream; } @@ -9151,7 +9149,7 @@ public Stream transformDataSpecificationIec61360( errorStream = Stream.concat(errorStream, Stream.of(new Reporting.Error( "Invariant violated:\n" + - "Constraint AASc-002: preferred name shall be provided at " + + "Constraint AASc-3a-002: preferred name shall be provided at " + "least in English."))); } @@ -9782,14 +9780,6 @@ public static Stream verifyPathType ( "Identifier shall have a maximum length of 2000 characters."))); } - if (!matchesRfc8089Path(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."))); - } - return errorStream; } diff --git a/test_data/java/test_main/aas_core_meta.v3/expected_output/xmlization/Xmlization.java b/test_data/java/test_main/aas_core_meta.v3/expected_output/xmlization/Xmlization.java index 5ca25813..36dd599e 100644 --- a/test_data/java/test_main/aas_core_meta.v3/expected_output/xmlization/Xmlization.java +++ b/test_data/java/test_main/aas_core_meta.v3/expected_output/xmlization/Xmlization.java @@ -13332,6 +13332,13 @@ private static Result tryEmbeddedDataSpecificationFro return Result.failure(error); } + if (theDataSpecification == null) { + final Reporting.Error error = new Reporting.Error( + "The required property dataSpecification has not been given " + + "in the XML representation of an instance of class EmbeddedDataSpecification"); + return Result.failure(error); + } + return Result.success(new EmbeddedDataSpecification( theDataSpecificationContent, theDataSpecification)); @@ -21725,20 +21732,18 @@ private void embeddedDataSpecificationToSequence( } try { - if (that.getDataSpecification().isPresent()) { - writer.writeStartElement( - "dataSpecification"); - if (topLevel) { - writer.writeNamespace("xmlns", AAS_NAME_SPACE); - topLevel = false; - } + writer.writeStartElement( + "dataSpecification"); + if (topLevel) { + writer.writeNamespace("xmlns", AAS_NAME_SPACE); + topLevel = false; + } - this.referenceToSequence( - that.getDataSpecification().get(), - writer); + this.referenceToSequence( + that.getDataSpecification(), + writer); - writer.writeEndElement(); - } + writer.writeEndElement(); } catch (XMLStreamException exception) { throw new SerializeException("",exception.getMessage()); } diff --git a/test_data/jsonschema/test_main/aas_core_meta.v3/expected_output/schema.json b/test_data/jsonschema/test_main/aas_core_meta.v3/expected_output/schema.json index 81cd1848..a46c51d8 100644 --- a/test_data/jsonschema/test_main/aas_core_meta.v3/expected_output/schema.json +++ b/test_data/jsonschema/test_main/aas_core_meta.v3/expected_output/schema.json @@ -513,7 +513,8 @@ } }, "required": [ - "dataSpecificationContent" + "dataSpecificationContent", + "dataSpecification" ] }, "Entity": { @@ -673,18 +674,9 @@ "properties": { "value": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 2000 - }, - { - "pattern": "^([\\x09\\x0a\\x0d\\x20-\\ud7ff\\ue000-\\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|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9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" - } - ] + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\x09\\x0a\\x0d\\x20-\\ud7ff\\ue000-\\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "contentType": { "type": "string", @@ -1280,18 +1272,9 @@ "properties": { "path": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 2000 - }, - { - "pattern": "^([\\x09\\x0a\\x0d\\x20-\\ud7ff\\ue000-\\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9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0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" - } - ] + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\x09\\x0a\\x0d\\x20-\\ud7ff\\ue000-\\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "contentType": { "type": "string", diff --git a/test_data/parse/real_meta_models/aas_core_meta.v3/expected_symbol_table.txt b/test_data/parse/real_meta_models/aas_core_meta.v3/expected_symbol_table.txt index 87f5e977..37cc472c 100644 --- a/test_data/parse/real_meta_models/aas_core_meta.v3/expected_symbol_table.txt +++ b/test_data/parse/real_meta_models/aas_core_meta.v3/expected_symbol_table.txt @@ -443,18 +443,7 @@ UnverifiedSymbolTable( 'Identifier'], properties=[], methods=[], - invariants=[ - Invariant( - description='The value must represent a valid file URI scheme according to RFC 8089.', - body=textwrap.dedent("""\ - FunctionCall( - name='matches_RFC_8089_path', - args=[ - Name( - identifier='self', - original_node=...)], - original_node=...)"""), - node=...)], + invariants=[], serialization=None, description=Description( document=..., @@ -10843,12 +10832,8 @@ UnverifiedSymbolTable( node=...), Property( name='data_specification', - type_annotation=SubscriptedTypeAnnotation( - identifier='Optional', - subscripts=[ - AtomicTypeAnnotation( - identifier='Reference', - node=...)], + type_annotation=AtomicTypeAnnotation( + identifier='Reference', node=...), description=Description( document=..., @@ -10873,15 +10858,10 @@ UnverifiedSymbolTable( node=...), Argument( name='data_specification', - type_annotation=SubscriptedTypeAnnotation( - identifier='Optional', - subscripts=[ - AtomicTypeAnnotation( - identifier='Reference', - node=...)], - node=...), - default=Default( + type_annotation=AtomicTypeAnnotation( + identifier='Reference', node=...), + default=None, node=...)], returns=None, description=None, @@ -12040,7 +12020,7 @@ UnverifiedSymbolTable( original_node=...)"""), node=...), Invariant( - description='Constraint AASc-002: preferred name shall be provided at least in English.', + description='Constraint AASc-3a-002: preferred name shall be provided at least in English.', body=textwrap.dedent("""\ Any( generator=ForEach( diff --git a/test_data/python/test_main/aas_core_meta.v3/expected_output/jsonization.py b/test_data/python/test_main/aas_core_meta.v3/expected_output/jsonization.py index a704e24c..2238c0ec 100644 --- a/test_data/python/test_main/aas_core_meta.v3/expected_output/jsonization.py +++ b/test_data/python/test_main/aas_core_meta.v3/expected_output/jsonization.py @@ -9579,6 +9579,11 @@ def embedded_data_specification_from_jsonable( "The required property 'dataSpecificationContent' is missing" ) + if setter.data_specification is None: + raise DeserializationException( + "The required property 'dataSpecification' is missing" + ) + return aas_types.EmbeddedDataSpecification( setter.data_specification_content, setter.data_specification @@ -13173,10 +13178,9 @@ def transform_embedded_data_specification( self.transform(that.data_specification_content) ) - if that.data_specification is not None: - jsonable['dataSpecification'] = ( - self.transform(that.data_specification) - ) + jsonable['dataSpecification'] = ( + self.transform(that.data_specification) + ) return jsonable diff --git a/test_data/python/test_main/aas_core_meta.v3/expected_output/types.py b/test_data/python/test_main/aas_core_meta.v3/expected_output/types.py index 442b46df..3cc9d320 100644 --- a/test_data/python/test_main/aas_core_meta.v3/expected_output/types.py +++ b/test_data/python/test_main/aas_core_meta.v3/expected_output/types.py @@ -5558,7 +5558,7 @@ class EmbeddedDataSpecification(Class): data_specification_content: 'DataSpecificationContent' #: Reference to the data specification - data_specification: Optional['Reference'] + data_specification: 'Reference' def descend_once(self) -> Iterator[Class]: """ @@ -5570,8 +5570,7 @@ def descend_once(self) -> Iterator[Class]: """ yield self.data_specification_content - if self.data_specification is not None: - yield self.data_specification + yield self.data_specification def descend(self) -> Iterator[Class]: """ @@ -5583,10 +5582,9 @@ def descend(self) -> Iterator[Class]: yield from self.data_specification_content.descend() - if self.data_specification is not None: - yield self.data_specification + yield self.data_specification - yield from self.data_specification.descend() + yield from self.data_specification.descend() def accept(self, visitor: "AbstractVisitor") -> None: """Dispatch the :paramref:`visitor` on this instance.""" @@ -5621,7 +5619,7 @@ def transform_with_context( def __init__( self, data_specification_content: 'DataSpecificationContent', - data_specification: Optional['Reference'] = None + data_specification: 'Reference' ) -> None: """Initialize with the given values.""" self.data_specification_content = data_specification_content diff --git a/test_data/python/test_main/aas_core_meta.v3/expected_output/verification.py b/test_data/python/test_main/aas_core_meta.v3/expected_output/verification.py index d3953416..a4fc6280 100644 --- a/test_data/python/test_main/aas_core_meta.v3/expected_output/verification.py +++ b/test_data/python/test_main/aas_core_meta.v3/expected_output/verification.py @@ -7904,15 +7904,14 @@ def transform_embedded_data_specification( ) yield error - if that.data_specification is not None: - for error in self.transform(that.data_specification): - error.path._prepend( - PropertySegment( - that, - 'data_specification' - ) + for error in self.transform(that.data_specification): + error.path._prepend( + PropertySegment( + that, + 'data_specification' ) - yield error + ) + yield error # noinspection PyMethodMayBeStatic def transform_level_type( @@ -8148,7 +8147,7 @@ def transform_data_specification_iec_61360( ) ): yield Error( - 'Constraint AASc-002: preferred name shall be provided at ' + + 'Constraint AASc-3a-002: preferred name shall be provided at ' + 'least in English.' ) @@ -8586,12 +8585,6 @@ def verify_path_type( 'Identifier shall have a maximum length of 2000 characters.' ) - if not matches_rfc_8089_path(that): - yield Error( - 'The value must represent a valid file URI scheme according ' + - 'to RFC 8089.' - ) - def verify_qualifier_type( that: str diff --git a/test_data/python/test_main/aas_core_meta.v3/expected_output/xmlization.py b/test_data/python/test_main/aas_core_meta.v3/expected_output/xmlization.py index 6599c161..d5f397e8 100644 --- a/test_data/python/test_main/aas_core_meta.v3/expected_output/xmlization.py +++ b/test_data/python/test_main/aas_core_meta.v3/expected_output/xmlization.py @@ -24181,6 +24181,11 @@ def _read_embedded_data_specification_as_sequence( "The required property 'dataSpecificationContent' is missing" ) + if reader_and_setter.data_specification is None: + raise DeserializationException( + "The required property 'dataSpecification' is missing" + ) + return aas_types.EmbeddedDataSpecification( reader_and_setter.data_specification_content, reader_and_setter.data_specification @@ -30472,12 +30477,11 @@ def _write_embedded_data_specification_as_sequence( self.visit(that.data_specification_content) self._write_end_element('dataSpecificationContent') - if that.data_specification is not None: - self._write_start_element('dataSpecification') - self._write_reference_as_sequence( - that.data_specification - ) - self._write_end_element('dataSpecification') + self._write_start_element('dataSpecification') + self._write_reference_as_sequence( + that.data_specification + ) + self._write_end_element('dataSpecification') def visit_embedded_data_specification( self, diff --git a/test_data/rdf_shacl/test_main/expected/aas_core_meta.v3/expected_output/shacl-schema.ttl b/test_data/rdf_shacl/test_main/expected/aas_core_meta.v3/expected_output/shacl-schema.ttl index 192eee03..4b734c5c 100644 --- a/test_data/rdf_shacl/test_main/expected/aas_core_meta.v3/expected_output/shacl-schema.ttl +++ b/test_data/rdf_shacl/test_main/expected/aas_core_meta.v3/expected_output/shacl-schema.ttl @@ -424,7 +424,7 @@ aas:EmbeddedDataSpecificationShape a sh:NodeShape ; a sh:PropertyShape ; sh:path ; sh:class aas:Reference ; - sh:minCount 0 ; + sh:minCount 1 ; sh:maxCount 1 ; ] ; . @@ -613,7 +613,6 @@ aas:FileShape a sh:NodeShape ; sh:minLength 1 ; sh:maxLength 2000 ; sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ; - sh:pattern "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[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25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" ; ] ; sh:property [ a sh:PropertyShape ; @@ -1161,7 +1160,6 @@ aas:ResourceShape a sh:NodeShape ; sh:minLength 1 ; sh:maxLength 2000 ; sh:pattern "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$" ; - sh:pattern "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2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?)$" ; ] ; sh:property [ a sh:PropertyShape ; diff --git a/test_data/typescript/test_main/aas_core_meta.v3/expected_output/jsonization.ts b/test_data/typescript/test_main/aas_core_meta.v3/expected_output/jsonization.ts index 3a466e03..0d166f6f 100644 --- a/test_data/typescript/test_main/aas_core_meta.v3/expected_output/jsonization.ts +++ b/test_data/typescript/test_main/aas_core_meta.v3/expected_output/jsonization.ts @@ -14565,6 +14565,14 @@ export function embeddedDataSpecificationFromJsonable( ); } + if (setter.dataSpecification === null) { + return newDeserializationError< + AasTypes.EmbeddedDataSpecification + >( + "The required property 'dataSpecification' is missing" + ); + } + return new AasCommon.Either< AasTypes.EmbeddedDataSpecification, DeserializationError @@ -20525,10 +20533,8 @@ class Serializer extends AasTypes.AbstractTransformer { jsonable["dataSpecificationContent"] = this.transform(that.dataSpecificationContent); - if (that.dataSpecification !== null) { - jsonable["dataSpecification"] = - this.transform(that.dataSpecification); - } + jsonable["dataSpecification"] = + this.transform(that.dataSpecification); return jsonable; } diff --git a/test_data/typescript/test_main/aas_core_meta.v3/expected_output/types.ts b/test_data/typescript/test_main/aas_core_meta.v3/expected_output/types.ts index 349c6461..ecb6838d 100644 --- a/test_data/typescript/test_main/aas_core_meta.v3/expected_output/types.ts +++ b/test_data/typescript/test_main/aas_core_meta.v3/expected_output/types.ts @@ -9941,7 +9941,7 @@ export class EmbeddedDataSpecification extends Class { /** * Reference to the data specification */ - dataSpecification: Reference | null; + dataSpecification: Reference; /** * Iterate over the instances referenced from this instance. @@ -9953,9 +9953,7 @@ export class EmbeddedDataSpecification extends Class { *descendOnce(): IterableIterator { yield this.dataSpecificationContent; - if (this.dataSpecification !== null) { - yield this.dataSpecification; - } + yield this.dataSpecification; } /** @@ -9968,11 +9966,9 @@ export class EmbeddedDataSpecification extends Class { yield * this.dataSpecificationContent.descend(); - if (this.dataSpecification !== null) { - yield this.dataSpecification; + yield this.dataSpecification; - yield * this.dataSpecification.descend(); - } + yield * this.dataSpecification.descend(); } /** @@ -10029,7 +10025,7 @@ export class EmbeddedDataSpecification extends Class { constructor( dataSpecificationContent: IDataSpecificationContent, - dataSpecification: Reference | null = null + dataSpecification: Reference ) { super(); this.dataSpecificationContent = dataSpecificationContent; diff --git a/test_data/typescript/test_main/aas_core_meta.v3/expected_output/verification.ts b/test_data/typescript/test_main/aas_core_meta.v3/expected_output/verification.ts index a40c748f..b0d961e2 100644 --- a/test_data/typescript/test_main/aas_core_meta.v3/expected_output/verification.ts +++ b/test_data/typescript/test_main/aas_core_meta.v3/expected_output/verification.ts @@ -9291,18 +9291,16 @@ class Verifier yield error; } - if (that.dataSpecification !== null) { - for (const error of this.transformWithContext( - that.dataSpecification, context) - ) { - error.path.prepend( - new PropertySegment( - that, - "dataSpecification" - ) - ); - yield error; - } + for (const error of this.transformWithContext( + that.dataSpecification, context) + ) { + error.path.prepend( + new PropertySegment( + that, + "dataSpecification" + ) + ); + yield error; } } } @@ -9567,7 +9565,7 @@ class Verifier ) )) { yield new VerificationError( - "Constraint AASc-002: preferred name shall be provided at " + + "Constraint AASc-3a-002: preferred name shall be provided at " + "least in English." ) } @@ -10143,13 +10141,6 @@ export function *verifyPathType( "Identifier shall have a maximum length of 2000 characters." ) } - - if (!matchesRfc8089Path(that)) { - yield new VerificationError( - "The value must represent a valid file URI scheme according " + - "to RFC 8089." - ) - } } /** diff --git a/test_data/xsd/test_main/aas_core_meta.v3/expected_output/schema.xsd b/test_data/xsd/test_main/aas_core_meta.v3/expected_output/schema.xsd index 5a246096..e53ba2f9 100644 --- a/test_data/xsd/test_main/aas_core_meta.v3/expected_output/schema.xsd +++ b/test_data/xsd/test_main/aas_core_meta.v3/expected_output/schema.xsd @@ -284,7 +284,7 @@ - + @@ -403,7 +403,6 @@ - @@ -803,7 +802,6 @@ -