diff --git a/src/AasCore.Aas3_0/AasCore.Aas3_0.csproj b/src/AasCore.Aas3_0/AasCore.Aas3_0.csproj deleted file mode 100644 index 96a86a8a9..000000000 --- a/src/AasCore.Aas3_0/AasCore.Aas3_0.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - net6.0 - enable - Debug;Release;DebugSlow - AnyCPU - 8 - - AasCore.Aas3_0 - 1.0.0-rc1 - Marko Ristin - - An SDK for manipulating, verifying and de/serializing Asset Administration Shells. - - https://github.com/aas-core-works/aas-core3.0-csharp.git - git - Copyright (c) 2023 Marko Ristin - https://raw.githubusercontent.com/aas-core-works/aas-core3.0-csharp/main/LICENSE - https://github.com/aas-core-works/aas-core3.0-csharp - aas;asset administration shell;iiot;industry internet of things;industrie 4.0;i4.0 - - - - - diff --git a/src/AasCore.Aas3_0/Attributes/CountForHash.cs b/src/AasCore.Aas3_0/Attributes/CountForHash.cs deleted file mode 100644 index cdc1d070e..000000000 --- a/src/AasCore.Aas3_0/Attributes/CountForHash.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace AasCore.Aas3_0.Attributes -{ - /// - /// This attribute indicates, that it should e.g. serialized in JSON. - /// - [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)] - public class CountForHash : Attribute - { - } -} diff --git a/src/AasCore.Aas3_0/Attributes/MetaModelName.cs b/src/AasCore.Aas3_0/Attributes/MetaModelName.cs deleted file mode 100644 index fd2cdf3f0..000000000 --- a/src/AasCore.Aas3_0/Attributes/MetaModelName.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace AasCore.Aas3_0.Attributes -{ - /// - /// This attribute indicates, that the field / property is searchable - /// - [System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)] - public class MetaModelName : System.Attribute - { - public string name; - public MetaModelName(string name) - { - this.name = name; - } - } -} diff --git a/src/AasCore.Aas3_0/Attributes/SkipForReflection.cs b/src/AasCore.Aas3_0/Attributes/SkipForReflection.cs deleted file mode 100644 index 3a4da8c51..000000000 --- a/src/AasCore.Aas3_0/Attributes/SkipForReflection.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace AasCore.Aas3_0.Attributes -{ - /// - /// This attribute indicates, that the field / property shall be skipped for reflection - /// in order to avoid cycles - /// - [System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)] - public class SkipForReflection : System.Attribute - { - } -} diff --git a/src/AasCore.Aas3_0/Attributes/SkipForSearch.cs b/src/AasCore.Aas3_0/Attributes/SkipForSearch.cs deleted file mode 100644 index 55c7087a8..000000000 --- a/src/AasCore.Aas3_0/Attributes/SkipForSearch.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace AasCore.Aas3_0.Attributes -{ - /// - /// This attribute indicates, that the field / property shall be skipped for searching, because it is not - /// directly displayed in Package Explorer - /// - [System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)] - public class SkipForSearch : System.Attribute - { - } -} diff --git a/src/AasCore.Aas3_0/Attributes/TextSearchable.cs b/src/AasCore.Aas3_0/Attributes/TextSearchable.cs deleted file mode 100644 index b869a6be8..000000000 --- a/src/AasCore.Aas3_0/Attributes/TextSearchable.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace AasCore.Aas3_0.Attributes -{ - /// - /// This attribute indicates, that the field / property is searchable - /// - [System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)] - public class TextSearchable : System.Attribute - { - } -} diff --git a/src/AasCore.Aas3_0/DiaryData/DiaryDataDef.cs b/src/AasCore.Aas3_0/DiaryData/DiaryDataDef.cs deleted file mode 100644 index 75671ff81..000000000 --- a/src/AasCore.Aas3_0/DiaryData/DiaryDataDef.cs +++ /dev/null @@ -1,58 +0,0 @@ -using AasCore.Aas3_0; -using System; -using System.Collections.Generic; -using System.Text.Json.Serialization; -using System.Xml.Serialization; - -namespace AdminShellNS.DiaryData -{ - public class DiaryDataDef - { - public enum TimeStampKind { Create, Update } - - [XmlIgnore] - [JsonIgnore] - private DateTime[] _timeStamp = new DateTime[2]; - - [XmlIgnore] - [JsonIgnore] - public DateTime[] TimeStamp { get { return _timeStamp; } } - - /// - /// List of entries, timewise one after each other (entries are timestamped). - /// Note: Default is Entries = null, as handling of many many AAS elements does not - /// create additional overhead of creating empty lists. An empty list shall be avoided. - /// - public List Entries = null; - - public static void AddAndSetTimestamps(IReferable element, IAasDiaryEntry de, bool isCreate = false) - { - // trivial - if (element == null || de == null || element.DiaryData == null) - return; - - // add entry - if (element.DiaryData.Entries == null) - element.DiaryData.Entries = new List(); - element.DiaryData.Entries.Add(de); - - // figure out which timestamp - var tsk = TimeStampKind.Update; - if (isCreate) - { - tsk = TimeStampKind.Create; - } - - // set this timestamp (and for the parents, as well) - IDiaryData el = element; - while (el?.DiaryData != null) - { - // itself - el.DiaryData.TimeStamp[(int)tsk] = DateTime.UtcNow; - - // go up - el = (el as IReferable)?.Parent as IDiaryData; - } - } - } -} diff --git a/src/AasCore.Aas3_0/DiaryData/IAasDiaryEntry.cs b/src/AasCore.Aas3_0/DiaryData/IAasDiaryEntry.cs deleted file mode 100644 index 52e21a920..000000000 --- a/src/AasCore.Aas3_0/DiaryData/IAasDiaryEntry.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace AdminShellNS.DiaryData -{ - public interface IAasDiaryEntry - { - } -} diff --git a/src/AasCore.Aas3_0/DiaryData/IDiaryData.cs b/src/AasCore.Aas3_0/DiaryData/IDiaryData.cs deleted file mode 100644 index 4c9c0f896..000000000 --- a/src/AasCore.Aas3_0/DiaryData/IDiaryData.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AdminShellNS.DiaryData -{ - public interface IDiaryData - { - DiaryDataDef DiaryData { get; } - } -} diff --git a/src/AasCore.Aas3_0/LICENSE.txt b/src/AasCore.Aas3_0/LICENSE.txt deleted file mode 100644 index 01f9cb5eb..000000000 --- a/src/AasCore.Aas3_0/LICENSE.txt +++ /dev/null @@ -1,1475 +0,0 @@ -Copyright (c) 2018-2023 Festo SE & Co. KG -, -author: Michael Hoffmeister - -Copyright (c) 2019-2021 PHOENIX CONTACT GmbH & Co. KG -, -author: Andreas Orzelski - -Copyright (c) 2019-2020 Fraunhofer IOSB-INA Lemgo, - eine rechtlich nicht selbstaendige Einrichtung der Fraunhofer-Gesellschaft - zur Foerderung der angewandten Forschung e.V. - -Copyright (c) 2020 Schneider Electric Automation GmbH -, -author: Marco Mendes - -Copyright (c) 2020 SICK AG - -Copyright (c) 2021 KEB Automation KG - -Copyright (c) 2021 Lenze SE -author: Jonas Grote, Denis Göllner, Sebastian Bischof - -The AASX Package Explorer is licensed under the Apache License 2.0 -(Apache-2.0, see below). - -The AASX Package Explorer is a sample application for demonstration of the -features of the Asset Administration Shell. -The implementation uses the concepts of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed -under Creative Commons CC BY-ND 3.0 DE. - -When using eCl@ss or IEC CDD data, please check the corresponding license -conditions. - -------------------------------------------------------------------------------- - -The components below are used in AASX Package Explorer. -The related licenses are listed for information purposes only. -Some licenses may only apply to their related plugins. - -The browser functionality is licensed under the cefSharp license (see below). - -The Newtonsoft.JSON serialization is licensed under the MIT License -(MIT, see below). - -The QR code generation is licensed under the MIT license (MIT, see below). - -The Zxing.Net Dot Matrix Code (DMC) generation is licensed under -the Apache License 2.0 (Apache-2.0, see below). - -The Grapevine REST server framework is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The AutomationML.Engine is licensed under the MIT license (MIT, see below). - -The MQTT server and client is licensed under the MIT license (MIT, see below). - -The ClosedXML Excel reader/writer is licensed under the MIT license (MIT, -see below). - -The CountryFlag WPF control is licensed under the Code Project Open License -(CPOL, see below). - -The DocumentFormat.OpenXml SDK is licensed under the MIT license (MIT, -see below). - -The ExcelNumberFormat number parser is licensed under the MIT license (MIT, -see below). - -The FastMember reflection access is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The IdentityModel OpenID client is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The jose-jwt object signing and encryption is licensed under the -MIT license (MIT, see below). - -The ExcelDataReader is licensed under the MIT license (MIT, see below). - -Portions copyright (c) by OPC Foundation, Inc. and licensed under the -Reciprocal Community License (RCL, see below) - -The OPC UA Example Code of OPC UA Standard is licensed under the MIT license -(MIT, see below). - -The MSAGL (Microsoft Automatic Graph Layout) is licensed under the MIT license -(MIT, see below) - -Glob (https://www.nuget.org/packages/Glob/) is licensed under the MIT license -(MIT, see below). - -The Magick.NET library is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The SSharp.NET library (https://github.com/PetroProtsyk/SSharp) is licensed -under Apache License 2.0 (Apache-2.0, see below). - -------------------------------------------------------------------------------- - - -With respect to AASX Package Explorer -===================================== - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to cefSharp -======================== - -(https://raw.githubusercontent.com/cefsharp/CefSharp/master/LICENSE) - -Copyright © The CefSharp Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google Inc. nor the name Chromium Embedded - Framework nor the name CefSharp nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -With respect to Newtonsoft.Json -=============================== - -(https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md) - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to QRcoder -======================= - -(https://github.com/codebude/QRCoder/blob/master/LICENSE.txt) - -The MIT License (MIT) - -Copyright (c) 2013-2018 Raffael Herrmann - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to ZXing.Net -========================= -With respect to Grapevine -========================= -With respect to FastMember -========================== -With respect to IdentityModel -============================= - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - -With respect to MQTTnet -======================= - -(https://github.com/chkr1011/MQTTnet/blob/master/LICENSE) - -MIT License - -MQTTnet Copyright (c) 2016-2019 Christian Kratky - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to ClosedXML -========================= - -(https://github.com/ClosedXML/ClosedXML/blob/develop/LICENSE) - -MIT License - -Copyright (c) 2016 ClosedXML - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to CountryFlag -=========================== - -(https://www.codeproject.com/Articles/190722/WPF-CountryFlag-Control) - -The Code Project Open License (CPOL) 1.02 - -Copyright © 2017 Meshack Musundi - -Preamble - -This License governs Your use of the Work. This License is intended to allow -developers to use the Source Code and Executable Files provided as part of -the Work in any application in any form. - -The main points subject to the terms of the License are: - - Source Code and Executable Files can be used in commercial applications; - Source Code and Executable Files can be redistributed; and - Source Code can be modified to create derivative works. - No claim of suitability, guarantee, or any warranty whatsoever is provided. - The software is provided "as-is". - The Article(s) accompanying the Work may not be distributed or republished - without the Author's consent - -This License is entered between You, the individual or other entity reading or -otherwise making use of the Work licensed pursuant to this License and the -individual or other entity which offers the Work under the terms of this -License ("Author"). - -License - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS -CODE PROJECT OPEN LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT -AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED -UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE -TO BE BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS -CONTAINED HEREIN IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND -CONDITIONS. IF YOU DO NOT AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS -LICENSE, YOU CANNOT MAKE ANY USE OF THE WORK. - -Definitions. - "Articles" means, collectively, all articles written by Author which -describes how the Source Code and Executable Files for the Work may -be used by a user. - "Author" means the individual or entity that offers the Work under -the terms of this License. - "Derivative Work" means a work based upon the Work or upon the Work -and other pre-existing works. - "Executable Files" refer to the executables, binary files, -configuration and any required data files included in the Work. - "Publisher" means the provider of the website, magazine, CD-ROM, -DVD or other medium from or by which the Work is obtained by You. - "Source Code" refers to the collection of source code and -configuration files used to create the Executable Files. - "Standard Version" refers to such a Work if it has not been modified, -or has been modified in accordance with the consent of the Author, -such consent being in the full discretion of the Author. - "Work" refers to the collection of files distributed by the Publisher, -including the Source Code, Executable Files, binaries, data files, -documentation, whitepapers and the Articles. - "You" is you, an individual or entity wishing to use the Work and -exercise your rights under this License. - -Fair Use/Fair Use Rights. Nothing in this License is intended to reduce, -limit, or restrict any rights arising from fair use, fair dealing, -first sale or other limitations on the exclusive rights of the -copyright owner under copyright law or other applicable laws. - -License Grant. Subject to the terms and conditions of this License, the -Author hereby grants You a worldwide, royalty-free, non-exclusive, -perpetual (for the duration of the applicable copyright) license -to exercise the rights in the Work as stated below: - You may use the standard version of the Source Code or Executable -Files in Your own applications. - You may apply bug fixes, portability fixes and other modifications -obtained from the Public Domain or from the Author. A Work modified -in such a way shall still be considered the standard version and will -be subject to this License. - You may otherwise modify Your copy of this Work (excluding the Articles) -in any way to create a Derivative Work, provided that You insert a prominent -notice in each changed file stating how, when and where You changed that file. - You may distribute the standard version of the Executable Files and Source -Code or Derivative Work in aggregate with other (possibly commercial) -programs as part of a larger (possibly commercial) software distribution. - The Articles discussing the Work published in any form by the author may -not be distributed or republished without the Author's consent. The author -retains copyright to any such Articles. You may use the Executable Files and -Source Code pursuant to this License but you may not repost or republish or -otherwise distribute or make available the Articles, without the prior written -consent of the Author. - -Any subroutines or modules supplied by You and linked into the Source Code -or Executable Files of this Work shall not be considered part of this Work -and will not be subject to the terms of this License. - -Patent License. Subject to the terms and conditions of this License, each -Author hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, -royalty-free, irrevocable (except as stated in this section) patent license -to make, have made, use, import, and otherwise transfer the Work. - -Restrictions. The license granted in Section 3 above is expressly made subject -to and limited by the following restrictions: - You agree not to remove any of the original copyright, patent, trademark, -and attribution notices and associated disclaimers that may appear in the -Source Code or Executable Files. - You agree not to advertise or in any way imply that this Work is a product -of Your own. - The name of the Author may not be used to endorse or promote products -derived from the Work without the prior written consent of the Author. - You agree not to sell, lease, or rent any part of the Work. This does -not restrict you from including the Work or any part of the Work inside -a larger software distribution that itself is being sold. The Work by itself, -though, cannot be sold, leased or rented. - You may distribute the Executable Files and Source Code only under the terms -of this License, and You must include a copy of, or the Uniform Resource -Identifier for, this License with every copy of the Executable Files or -Source Code You distribute and ensure that anyone receiving such Executable -Files and Source Code agrees that the terms of this License apply to such -Executable Files and/or Source Code. You may not offer or impose any terms -on the Work that alter or restrict the terms of this License or the -recipients' exercise of the rights granted hereunder. You may not sublicense -the Work. You must keep intact all notices that refer to this License and to -the disclaimer of warranties. You may not distribute the Executable Files or -Source Code with any technological measures that control access or use of the -Work in a manner inconsistent with the terms of this License. - You agree not to use the Work for illegal, immoral or improper -purposes, or on pages containing illegal, immoral or improper material. -The Work is subject to applicable export laws. You agree to comply with all -such laws and regulations that may apply to the Work after Your receipt of -the Work. - -Representations, Warranties and Disclaimer. THIS WORK IS PROVIDED "AS IS", -"WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OR -CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE, -INCLUDING COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. -AUTHOR EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES -OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS -OF MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR -PURPOSE, OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK -(OR ANY PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES. -YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE -WORKS. - -Indemnity. You agree to defend, indemnify and hold harmless the Author and the -Publisher from and against any claims, suits, losses, damages, liabilities, -costs, and expenses (including reasonable legal or attorneys’ fees) -resulting from or relating to any use of the Work by You. - -Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, -IN NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL -THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY -DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE, -EVEN IF THE AUTHOR OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH DAMAGES. - -Termination. - This License and the rights granted hereunder will terminate -automatically upon any breach by You of any term of this License. -Individuals or entities who have received Derivative Works from You under -this License, however, will not have their licenses terminated provided such -individuals or entities remain in full compliance with those licenses. -Sections 1, 2, 6, 7, 8, 9, 10 and 11 will survive any termination of -this License. - If You bring a copyright, trademark, patent or any other infringement -claim against any contributor over infringements You claim are made by the -Work, your License from such contributor to the Work ends automatically. - Subject to the above terms and conditions, this License is perpetual -(for the duration of the applicable copyright in the Work). -Notwithstanding the above, the Author reserves the right to release the Work -under different license terms or to stop distributing the Work at any time; -provided, however that any such election will not serve to withdraw this -License (or any other license that has been, or is required to be, -granted under the terms of this License), and this License will continue -in full force and effect unless terminated as stated above. - -Publisher. The parties hereby confirm that the Publisher shall not, under -any circumstances, be responsible for and shall not have any liability -in respect of the subject matter of this License. The Publisher makes no -warranty whatsoever in connection with the Work and shall not be liable -to You or any party on any legal theory for any damages whatsoever, including -without limitation any general, special, incidental or consequential damages -arising in connection to this license. The Publisher reserves the right to -cease making the Work available to You at any time without notice - -Miscellaneous - This License shall be governed by the laws of the location of the head -office of the Author or if the Author is an individual, the laws of -location of the principal place of residence of the Author. - If any provision of this License is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of the -remainder of the terms of this License, and without further action by the -parties to this License, such provision shall be reformed to the minimum -extent necessary to make such provision valid and enforceable. - No term or provision of this License shall be deemed waived and no -breach consented to unless such waiver or consent shall be in writing -and signed by the party to be charged with such waiver or consent. - This License constitutes the entire agreement between the parties -with respect to the Work licensed herein. There are no understandings, -agreements or representations with respect to the Work not specified herein. -The Author shall not be bound by any additional provisions that may appear -in any communication from You. This License may not be modified without -the mutual written agreement of the Author and You. - - -With respect to DocumentFormat.OpenXml -====================================== - -(https://github.com/OfficeDev/Open-XML-SDK/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to ExcelNumberFormat -================================= - -(https://github.com/andersnm/ExcelNumberFormat/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2017 andersnm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to jose-jwt -======================== - -(https://github.com/dvsekhvalnov/jose-jwt/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014-2019 dvsekhvalnov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With resepect to ExcelDataReader -================================ - -(https://github.com/ExcelDataReader/ExcelDataReader/blob/develop/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014 ExcelDataReader - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepect to OPC UA Example Code -==================================== - - * Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. - * - * OPC Foundation MIT License 1.00 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * The complete license agreement can be found here: - * http://opcfoundation.org/License/MIT/1.00/ - - -With respect to OPC Foundation -============================== - -RCL License -Reciprocal Community License 1.00 (RCL1.00) -Version 1.00, June 24, 2009 -Copyright (C) 2008,2009 OPC Foundation, Inc., All Rights Reserved. - -https://opcfoundation.org/license/rcl.html - -Remark: PHOENIX CONTACT GmbH & Co. KG and Festo SE & Co. KG are members -of OPC foundation. - -With respect to MSAGL (Microsoft Automatic Graph Layout) -======================================================== -(see: https://github.com/microsoft/automatic-graph-layout/blob/master/LICENSE) - -Microsoft Automatic Graph Layout, MSAGL - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With respect to Glob (https://www.nuget.org/packages/Glob/) -=========================================================== -(see: https://raw.githubusercontent.com/kthompson/glob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2013-2019 Kevin Thompson - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to Magick.NET -========================== - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -With respect to SSharp.NET library -================================== - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/AasCore.Aas3_0/constants.cs b/src/AasCore.Aas3_0/constants.cs deleted file mode 100644 index 92a9f8c49..000000000 --- a/src/AasCore.Aas3_0/constants.cs +++ /dev/null @@ -1,198 +0,0 @@ -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ - -using System.Collections.Generic; // can't alias - -namespace AasCore.Aas3_0 -{ - /// - /// Provide constant values of the meta-model. - /// - public static class Constants - { - public static readonly HashSet ValidCategoriesForDataElement = ( - new HashSet() - { - "CONSTANT", - "PARAMETER", - "VARIABLE" - }); - - public static readonly HashSet GenericFragmentKeys = ( - new HashSet() - { - KeyTypes.FragmentReference - }); - - public static readonly HashSet GenericGloballyIdentifiables = ( - new HashSet() - { - KeyTypes.GlobalReference - }); - - public static readonly HashSet AasIdentifiables = ( - new HashSet() - { - KeyTypes.AssetAdministrationShell, - KeyTypes.ConceptDescription, - KeyTypes.Identifiable, - KeyTypes.Submodel - }); - - public static readonly HashSet AasSubmodelElementsAsKeys = ( - new HashSet() - { - KeyTypes.AnnotatedRelationshipElement, - KeyTypes.BasicEventElement, - KeyTypes.Blob, - KeyTypes.Capability, - KeyTypes.DataElement, - KeyTypes.Entity, - KeyTypes.EventElement, - KeyTypes.File, - KeyTypes.MultiLanguageProperty, - KeyTypes.Operation, - KeyTypes.Property, - KeyTypes.Range, - KeyTypes.ReferenceElement, - KeyTypes.RelationshipElement, - KeyTypes.SubmodelElement, - KeyTypes.SubmodelElementCollection, - KeyTypes.SubmodelElementList - }); - - public static readonly HashSet AasReferableNonIdentifiables = ( - new HashSet() - { - KeyTypes.AnnotatedRelationshipElement, - KeyTypes.BasicEventElement, - KeyTypes.Blob, - KeyTypes.Capability, - KeyTypes.DataElement, - KeyTypes.Entity, - KeyTypes.EventElement, - KeyTypes.File, - KeyTypes.MultiLanguageProperty, - KeyTypes.Operation, - KeyTypes.Property, - KeyTypes.Range, - KeyTypes.ReferenceElement, - KeyTypes.RelationshipElement, - KeyTypes.SubmodelElement, - KeyTypes.SubmodelElementCollection, - KeyTypes.SubmodelElementList - }); - - public static readonly HashSet AasReferables = ( - new HashSet() - { - KeyTypes.AssetAdministrationShell, - KeyTypes.ConceptDescription, - KeyTypes.Identifiable, - KeyTypes.Submodel, - KeyTypes.AnnotatedRelationshipElement, - KeyTypes.BasicEventElement, - KeyTypes.Blob, - KeyTypes.Capability, - KeyTypes.DataElement, - KeyTypes.Entity, - KeyTypes.EventElement, - KeyTypes.File, - KeyTypes.MultiLanguageProperty, - KeyTypes.Operation, - KeyTypes.Property, - KeyTypes.Range, - KeyTypes.ReferenceElement, - KeyTypes.Referable, - KeyTypes.RelationshipElement, - KeyTypes.SubmodelElement, - KeyTypes.SubmodelElementCollection, - KeyTypes.SubmodelElementList - }); - - public static readonly HashSet GloballyIdentifiables = ( - new HashSet() - { - KeyTypes.GlobalReference, - KeyTypes.AssetAdministrationShell, - KeyTypes.ConceptDescription, - KeyTypes.Identifiable, - KeyTypes.Submodel - }); - - public static readonly HashSet FragmentKeys = ( - new HashSet() - { - KeyTypes.AnnotatedRelationshipElement, - KeyTypes.BasicEventElement, - KeyTypes.Blob, - KeyTypes.Capability, - KeyTypes.DataElement, - KeyTypes.Entity, - KeyTypes.EventElement, - KeyTypes.File, - KeyTypes.FragmentReference, - KeyTypes.MultiLanguageProperty, - KeyTypes.Operation, - KeyTypes.Property, - KeyTypes.Range, - KeyTypes.ReferenceElement, - KeyTypes.RelationshipElement, - KeyTypes.SubmodelElement, - KeyTypes.SubmodelElementCollection, - KeyTypes.SubmodelElementList - }); - - public static readonly HashSet DataTypeIec61360ForPropertyOrValue = ( - new HashSet() - { - DataTypeIec61360.Date, - DataTypeIec61360.String, - DataTypeIec61360.StringTranslatable, - DataTypeIec61360.IntegerMeasure, - DataTypeIec61360.IntegerCount, - DataTypeIec61360.IntegerCurrency, - DataTypeIec61360.RealMeasure, - DataTypeIec61360.RealCount, - DataTypeIec61360.RealCurrency, - DataTypeIec61360.Boolean, - DataTypeIec61360.Rational, - DataTypeIec61360.RationalMeasure, - DataTypeIec61360.Time, - DataTypeIec61360.Timestamp - }); - - public static readonly HashSet DataTypeIec61360ForReference = ( - new HashSet() - { - DataTypeIec61360.String, - DataTypeIec61360.Iri, - DataTypeIec61360.Irdi - }); - - public static readonly HashSet DataTypeIec61360ForDocument = ( - new HashSet() - { - DataTypeIec61360.File, - DataTypeIec61360.Blob, - DataTypeIec61360.Html - }); - - public static readonly HashSet Iec61360DataTypesWithUnit = ( - new HashSet() - { - DataTypeIec61360.IntegerMeasure, - DataTypeIec61360.RealMeasure, - DataTypeIec61360.RationalMeasure, - DataTypeIec61360.IntegerCurrency, - DataTypeIec61360.RealCurrency - }); - } // public static class Constants -} // namespace AasCore.Aas3_0 - -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ diff --git a/src/AasCore.Aas3_0/copying.cs b/src/AasCore.Aas3_0/copying.cs deleted file mode 100644 index 5b06e3a47..000000000 --- a/src/AasCore.Aas3_0/copying.cs +++ /dev/null @@ -1,2594 +0,0 @@ -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ - -using Aas = AasCore.Aas3_0; // renamed -using System.Collections.Generic; // can't alias - -namespace AasCore.Aas3_0 -{ - /// - /// Allow for making shallow and deep copies of AAS model instances. - /// - public static class Copying - { - private static readonly ShallowCopier ShallowCopierInstance = ( - new ShallowCopier()); - - private static readonly DeepCopier DeepCopierInstance = ( - new DeepCopier()); - - /// - /// Make a shallow copy of . - /// - /// - /// All the properties are copied by reference. This includes also the lists. - /// Hence, a list property is copied by reference, and not, as sometimes might be - /// expected, as a new list of underlying references. - /// . - /// to be copied in a shallow manner - /// type to cast the result to - public static T Shallow(T that) where T : Aas.IClass - { - return (T)ShallowCopierInstance.Transform(that); - } - - /// - /// Make a recursively a deep copy of . - /// - /// to be deeply copied in a recursive manner - /// type to cast the result to - public static T Deep(T that) where T : Aas.IClass - { - return (T)DeepCopierInstance.Transform(that); - } - - /// Dispatch the making of shallow copies. - internal class ShallowCopier : Visitation.AbstractTransformer - { - public override Aas.IClass TransformExtension( - Aas.IExtension that - ) - { - return new Aas.Extension( - that.Name, - that.SemanticId, - that.SupplementalSemanticIds, - that.ValueType, - that.Value, - that.RefersTo); - } - - public override Aas.IClass TransformAdministrativeInformation( - Aas.IAdministrativeInformation that - ) - { - return new Aas.AdministrativeInformation( - that.EmbeddedDataSpecifications, - that.Version, - that.Revision, - that.Creator, - that.TemplateId); - } - - public override Aas.IClass TransformQualifier( - Aas.IQualifier that - ) - { - return new Aas.Qualifier( - that.Type, - that.ValueType, - that.SemanticId, - that.SupplementalSemanticIds, - that.Kind, - that.Value, - that.ValueId); - } - - public override Aas.IClass TransformAssetAdministrationShell( - Aas.IAssetAdministrationShell that - ) - { - return new Aas.AssetAdministrationShell( - that.Id, - that.AssetInformation, - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.Administration, - that.EmbeddedDataSpecifications, - that.DerivedFrom, - that.Submodels); - } - - public override Aas.IClass TransformAssetInformation( - Aas.IAssetInformation that - ) - { - return new Aas.AssetInformation( - that.AssetKind, - that.GlobalAssetId, - that.SpecificAssetIds, - that.AssetType, - that.DefaultThumbnail); - } - - public override Aas.IClass TransformResource( - Aas.IResource that - ) - { - return new Aas.Resource(that.Path, that.ContentType); - } - - public override Aas.IClass TransformSpecificAssetId( - Aas.ISpecificAssetId that - ) - { - return new Aas.SpecificAssetId( - that.Name, - that.Value, - that.SemanticId, - that.SupplementalSemanticIds, - that.ExternalSubjectId); - } - - public override Aas.IClass TransformSubmodel( - Aas.ISubmodel that - ) - { - return new Aas.Submodel( - that.Id, - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.Administration, - that.Kind, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications, - that.SubmodelElements); - } - - public override Aas.IClass TransformRelationshipElement( - Aas.IRelationshipElement that - ) - { - return new Aas.RelationshipElement( - that.First, - that.Second, - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications); - } - - public override Aas.IClass TransformSubmodelElementList( - Aas.ISubmodelElementList that - ) - { - return new Aas.SubmodelElementList( - that.TypeValueListElement, - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications, - that.OrderRelevant, - that.SemanticIdListElement, - that.ValueTypeListElement, - that.Value); - } - - public override Aas.IClass TransformSubmodelElementCollection( - Aas.ISubmodelElementCollection that - ) - { - return new Aas.SubmodelElementCollection( - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications, - that.Value); - } - - public override Aas.IClass TransformProperty( - Aas.IProperty that - ) - { - return new Aas.Property( - that.ValueType, - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications, - that.Value, - that.ValueId); - } - - public override Aas.IClass TransformMultiLanguageProperty( - Aas.IMultiLanguageProperty that - ) - { - return new Aas.MultiLanguageProperty( - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications, - that.Value, - that.ValueId); - } - - public override Aas.IClass TransformRange( - Aas.IRange that - ) - { - return new Aas.Range( - that.ValueType, - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications, - that.Min, - that.Max); - } - - public override Aas.IClass TransformReferenceElement( - Aas.IReferenceElement that - ) - { - return new Aas.ReferenceElement( - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications, - that.Value); - } - - public override Aas.IClass TransformBlob( - Aas.IBlob that - ) - { - return new Aas.Blob( - that.ContentType, - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications, - that.Value); - } - - public override Aas.IClass TransformFile( - Aas.IFile that - ) - { - return new Aas.File( - that.ContentType, - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications, - that.Value); - } - - public override Aas.IClass TransformAnnotatedRelationshipElement( - Aas.IAnnotatedRelationshipElement that - ) - { - return new Aas.AnnotatedRelationshipElement( - that.First, - that.Second, - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications, - that.Annotations); - } - - public override Aas.IClass TransformEntity( - Aas.IEntity that - ) - { - return new Aas.Entity( - that.EntityType, - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications, - that.Statements, - that.GlobalAssetId, - that.SpecificAssetIds); - } - - public override Aas.IClass TransformEventPayload( - Aas.IEventPayload that - ) - { - return new Aas.EventPayload( - that.Source, - that.ObservableReference, - that.TimeStamp, - that.SourceSemanticId, - that.ObservableSemanticId, - that.Topic, - that.SubjectId, - that.Payload); - } - - public override Aas.IClass TransformBasicEventElement( - Aas.IBasicEventElement that - ) - { - return new Aas.BasicEventElement( - that.Observed, - that.Direction, - that.State, - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications, - that.MessageTopic, - that.MessageBroker, - that.LastUpdate, - that.MinInterval, - that.MaxInterval); - } - - public override Aas.IClass TransformOperation( - Aas.IOperation that - ) - { - return new Aas.Operation( - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications, - that.InputVariables, - that.OutputVariables, - that.InoutputVariables); - } - - public override Aas.IClass TransformOperationVariable( - Aas.IOperationVariable that - ) - { - return new Aas.OperationVariable(that.Value); - } - - public override Aas.IClass TransformCapability( - Aas.ICapability that - ) - { - return new Aas.Capability( - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.SemanticId, - that.SupplementalSemanticIds, - that.Qualifiers, - that.EmbeddedDataSpecifications); - } - - public override Aas.IClass TransformConceptDescription( - Aas.IConceptDescription that - ) - { - return new Aas.ConceptDescription( - that.Id, - that.Extensions, - that.Category, - that.IdShort, - that.DisplayName, - that.Description, - that.Administration, - that.EmbeddedDataSpecifications, - that.IsCaseOf); - } - - public override Aas.IClass TransformReference( - Aas.IReference that - ) - { - return new Aas.Reference( - that.Type, - that.Keys, - that.ReferredSemanticId); - } - - public override Aas.IClass TransformKey( - Aas.IKey that - ) - { - return new Aas.Key(that.Type, that.Value); - } - - public override Aas.IClass TransformLangStringNameType( - Aas.ILangStringNameType that - ) - { - return new Aas.LangStringNameType(that.Language, that.Text); - } - - public override Aas.IClass TransformLangStringTextType( - Aas.ILangStringTextType that - ) - { - return new Aas.LangStringTextType(that.Language, that.Text); - } - - public override Aas.IClass TransformEnvironment( - Aas.IEnvironment that - ) - { - return new Aas.Environment( - that.AssetAdministrationShells, - that.Submodels, - that.ConceptDescriptions); - } - - public override Aas.IClass TransformEmbeddedDataSpecification( - Aas.IEmbeddedDataSpecification that - ) - { - return new Aas.EmbeddedDataSpecification( - that.DataSpecification, - that.DataSpecificationContent); - } - - public override Aas.IClass TransformLevelType( - Aas.ILevelType that - ) - { - return new Aas.LevelType(that.Min, that.Nom, that.Typ, that.Max); - } - - public override Aas.IClass TransformValueReferencePair( - Aas.IValueReferencePair that - ) - { - return new Aas.ValueReferencePair(that.Value, that.ValueId); - } - - public override Aas.IClass TransformValueList( - Aas.IValueList that - ) - { - return new Aas.ValueList(that.ValueReferencePairs); - } - - public override Aas.IClass TransformLangStringPreferredNameTypeIec61360( - Aas.ILangStringPreferredNameTypeIec61360 that - ) - { - return new Aas.LangStringPreferredNameTypeIec61360( - that.Language, - that.Text); - } - - public override Aas.IClass TransformLangStringShortNameTypeIec61360( - Aas.ILangStringShortNameTypeIec61360 that - ) - { - return new Aas.LangStringShortNameTypeIec61360( - that.Language, - that.Text); - } - - public override Aas.IClass TransformLangStringDefinitionTypeIec61360( - Aas.ILangStringDefinitionTypeIec61360 that - ) - { - return new Aas.LangStringDefinitionTypeIec61360( - that.Language, - that.Text); - } - - public override Aas.IClass TransformDataSpecificationIec61360( - Aas.IDataSpecificationIec61360 that - ) - { - return new Aas.DataSpecificationIec61360( - that.PreferredName, - that.ShortName, - that.Unit, - that.UnitId, - that.SourceOfDefinition, - that.Symbol, - that.DataType, - that.Definition, - that.ValueFormat, - that.ValueList, - that.Value, - that.LevelType); - } - } // internal class ShallowCopier - - /// Dispatch the making of deep copies. - internal class DeepCopier : Visitation.AbstractTransformer - { - public override Aas.IClass TransformExtension( - Aas.IExtension that - ) - { - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theRefersTo = null; - if (that.RefersTo != null) - { - theRefersTo = new List( - that.RefersTo.Count); - foreach (var item in that.RefersTo) - { - theRefersTo.Add(Deep(item)); - } - } - - return new Aas.Extension( - that.Name, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - that.ValueType, - that.Value, - theRefersTo - ); - } - - public override Aas.IClass TransformAdministrativeInformation( - Aas.IAdministrativeInformation that - ) - { - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - return new Aas.AdministrativeInformation( - theEmbeddedDataSpecifications, - that.Version, - that.Revision, - (that.Creator != null) - ? Deep(that.Creator) - : null, - that.TemplateId - ); - } - - public override Aas.IClass TransformQualifier( - Aas.IQualifier that - ) - { - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - return new Aas.Qualifier( - that.Type, - that.ValueType, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - that.Kind, - that.Value, - (that.ValueId != null) - ? Deep(that.ValueId) - : null - ); - } - - public override Aas.IClass TransformAssetAdministrationShell( - Aas.IAssetAdministrationShell that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - List? theSubmodels = null; - if (that.Submodels != null) - { - theSubmodels = new List( - that.Submodels.Count); - foreach (var item in that.Submodels) - { - theSubmodels.Add(Deep(item)); - } - } - - return new Aas.AssetAdministrationShell( - that.Id, - Deep(that.AssetInformation), - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.Administration != null) - ? Deep(that.Administration) - : null, - theEmbeddedDataSpecifications, - (that.DerivedFrom != null) - ? Deep(that.DerivedFrom) - : null, - theSubmodels - ); - } - - public override Aas.IClass TransformAssetInformation( - Aas.IAssetInformation that - ) - { - List? theSpecificAssetIds = null; - if (that.SpecificAssetIds != null) - { - theSpecificAssetIds = new List( - that.SpecificAssetIds.Count); - foreach (var item in that.SpecificAssetIds) - { - theSpecificAssetIds.Add(Deep(item)); - } - } - - return new Aas.AssetInformation( - that.AssetKind, - that.GlobalAssetId, - theSpecificAssetIds, - that.AssetType, - (that.DefaultThumbnail != null) - ? Deep(that.DefaultThumbnail) - : null - ); - } - - public override Aas.IClass TransformResource( - Aas.IResource that - ) - { - return new Aas.Resource( - that.Path, - that.ContentType - ); - } - - public override Aas.IClass TransformSpecificAssetId( - Aas.ISpecificAssetId that - ) - { - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - return new Aas.SpecificAssetId( - that.Name, - that.Value, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - (that.ExternalSubjectId != null) - ? Deep(that.ExternalSubjectId) - : null - ); - } - - public override Aas.IClass TransformSubmodel( - Aas.ISubmodel that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - List? theSubmodelElements = null; - if (that.SubmodelElements != null) - { - theSubmodelElements = new List( - that.SubmodelElements.Count); - foreach (var item in that.SubmodelElements) - { - theSubmodelElements.Add(Deep(item)); - } - } - - return new Aas.Submodel( - that.Id, - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.Administration != null) - ? Deep(that.Administration) - : null, - that.Kind, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theSubmodelElements - ); - } - - public override Aas.IClass TransformRelationshipElement( - Aas.IRelationshipElement that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - return new Aas.RelationshipElement( - Deep(that.First), - Deep(that.Second), - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications - ); - } - - public override Aas.IClass TransformSubmodelElementList( - Aas.ISubmodelElementList that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - List? theValue = null; - if (that.Value != null) - { - theValue = new List( - that.Value.Count); - foreach (var item in that.Value) - { - theValue.Add(Deep(item)); - } - } - - return new Aas.SubmodelElementList( - that.TypeValueListElement, - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - that.OrderRelevant, - (that.SemanticIdListElement != null) - ? Deep(that.SemanticIdListElement) - : null, - that.ValueTypeListElement, - theValue - ); - } - - public override Aas.IClass TransformSubmodelElementCollection( - Aas.ISubmodelElementCollection that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - List? theValue = null; - if (that.Value != null) - { - theValue = new List( - that.Value.Count); - foreach (var item in that.Value) - { - theValue.Add(Deep(item)); - } - } - - return new Aas.SubmodelElementCollection( - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue - ); - } - - public override Aas.IClass TransformProperty( - Aas.IProperty that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - return new Aas.Property( - that.ValueType, - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - that.Value, - (that.ValueId != null) - ? Deep(that.ValueId) - : null - ); - } - - public override Aas.IClass TransformMultiLanguageProperty( - Aas.IMultiLanguageProperty that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - List? theValue = null; - if (that.Value != null) - { - theValue = new List( - that.Value.Count); - foreach (var item in that.Value) - { - theValue.Add(Deep(item)); - } - } - - return new Aas.MultiLanguageProperty( - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue, - (that.ValueId != null) - ? Deep(that.ValueId) - : null - ); - } - - public override Aas.IClass TransformRange( - Aas.IRange that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - return new Aas.Range( - that.ValueType, - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - that.Min, - that.Max - ); - } - - public override Aas.IClass TransformReferenceElement( - Aas.IReferenceElement that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - return new Aas.ReferenceElement( - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - (that.Value != null) - ? Deep(that.Value) - : null - ); - } - - public override Aas.IClass TransformBlob( - Aas.IBlob that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - return new Aas.Blob( - that.ContentType, - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - that.Value - ); - } - - public override Aas.IClass TransformFile( - Aas.IFile that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - return new Aas.File( - that.ContentType, - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - that.Value - ); - } - - public override Aas.IClass TransformAnnotatedRelationshipElement( - Aas.IAnnotatedRelationshipElement that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - List? theAnnotations = null; - if (that.Annotations != null) - { - theAnnotations = new List( - that.Annotations.Count); - foreach (var item in that.Annotations) - { - theAnnotations.Add(Deep(item)); - } - } - - return new Aas.AnnotatedRelationshipElement( - Deep(that.First), - Deep(that.Second), - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theAnnotations - ); - } - - public override Aas.IClass TransformEntity( - Aas.IEntity that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - List? theStatements = null; - if (that.Statements != null) - { - theStatements = new List( - that.Statements.Count); - foreach (var item in that.Statements) - { - theStatements.Add(Deep(item)); - } - } - - List? theSpecificAssetIds = null; - if (that.SpecificAssetIds != null) - { - theSpecificAssetIds = new List( - that.SpecificAssetIds.Count); - foreach (var item in that.SpecificAssetIds) - { - theSpecificAssetIds.Add(Deep(item)); - } - } - - return new Aas.Entity( - that.EntityType, - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theStatements, - that.GlobalAssetId, - theSpecificAssetIds - ); - } - - public override Aas.IClass TransformEventPayload( - Aas.IEventPayload that - ) - { - return new Aas.EventPayload( - Deep(that.Source), - Deep(that.ObservableReference), - that.TimeStamp, - (that.SourceSemanticId != null) - ? Deep(that.SourceSemanticId) - : null, - (that.ObservableSemanticId != null) - ? Deep(that.ObservableSemanticId) - : null, - that.Topic, - (that.SubjectId != null) - ? Deep(that.SubjectId) - : null, - that.Payload - ); - } - - public override Aas.IClass TransformBasicEventElement( - Aas.IBasicEventElement that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - return new Aas.BasicEventElement( - Deep(that.Observed), - that.Direction, - that.State, - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - that.MessageTopic, - (that.MessageBroker != null) - ? Deep(that.MessageBroker) - : null, - that.LastUpdate, - that.MinInterval, - that.MaxInterval - ); - } - - public override Aas.IClass TransformOperation( - Aas.IOperation that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - List? theInputVariables = null; - if (that.InputVariables != null) - { - theInputVariables = new List( - that.InputVariables.Count); - foreach (var item in that.InputVariables) - { - theInputVariables.Add(Deep(item)); - } - } - - List? theOutputVariables = null; - if (that.OutputVariables != null) - { - theOutputVariables = new List( - that.OutputVariables.Count); - foreach (var item in that.OutputVariables) - { - theOutputVariables.Add(Deep(item)); - } - } - - List? theInoutputVariables = null; - if (that.InoutputVariables != null) - { - theInoutputVariables = new List( - that.InoutputVariables.Count); - foreach (var item in that.InoutputVariables) - { - theInoutputVariables.Add(Deep(item)); - } - } - - return new Aas.Operation( - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theInputVariables, - theOutputVariables, - theInoutputVariables - ); - } - - public override Aas.IClass TransformOperationVariable( - Aas.IOperationVariable that - ) - { - return new Aas.OperationVariable( - Deep(that.Value) - ); - } - - public override Aas.IClass TransformCapability( - Aas.ICapability that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theSupplementalSemanticIds = null; - if (that.SupplementalSemanticIds != null) - { - theSupplementalSemanticIds = new List( - that.SupplementalSemanticIds.Count); - foreach (var item in that.SupplementalSemanticIds) - { - theSupplementalSemanticIds.Add(Deep(item)); - } - } - - List? theQualifiers = null; - if (that.Qualifiers != null) - { - theQualifiers = new List( - that.Qualifiers.Count); - foreach (var item in that.Qualifiers) - { - theQualifiers.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - return new Aas.Capability( - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.SemanticId != null) - ? Deep(that.SemanticId) - : null, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications - ); - } - - public override Aas.IClass TransformConceptDescription( - Aas.IConceptDescription that - ) - { - List? theExtensions = null; - if (that.Extensions != null) - { - theExtensions = new List( - that.Extensions.Count); - foreach (var item in that.Extensions) - { - theExtensions.Add(Deep(item)); - } - } - - List? theDisplayName = null; - if (that.DisplayName != null) - { - theDisplayName = new List( - that.DisplayName.Count); - foreach (var item in that.DisplayName) - { - theDisplayName.Add(Deep(item)); - } - } - - List? theDescription = null; - if (that.Description != null) - { - theDescription = new List( - that.Description.Count); - foreach (var item in that.Description) - { - theDescription.Add(Deep(item)); - } - } - - List? theEmbeddedDataSpecifications = null; - if (that.EmbeddedDataSpecifications != null) - { - theEmbeddedDataSpecifications = new List( - that.EmbeddedDataSpecifications.Count); - foreach (var item in that.EmbeddedDataSpecifications) - { - theEmbeddedDataSpecifications.Add(Deep(item)); - } - } - - List? theIsCaseOf = null; - if (that.IsCaseOf != null) - { - theIsCaseOf = new List( - that.IsCaseOf.Count); - foreach (var item in that.IsCaseOf) - { - theIsCaseOf.Add(Deep(item)); - } - } - - return new Aas.ConceptDescription( - that.Id, - theExtensions, - that.Category, - that.IdShort, - theDisplayName, - theDescription, - (that.Administration != null) - ? Deep(that.Administration) - : null, - theEmbeddedDataSpecifications, - theIsCaseOf - ); - } - - public override Aas.IClass TransformReference( - Aas.IReference that - ) - { - var theKeys = new List( - that.Keys.Count); - foreach (var item in that.Keys) - { - theKeys.Add(Deep(item)); - } - - return new Aas.Reference( - that.Type, - theKeys, - (that.ReferredSemanticId != null) - ? Deep(that.ReferredSemanticId) - : null - ); - } - - public override Aas.IClass TransformKey( - Aas.IKey that - ) - { - return new Aas.Key( - that.Type, - that.Value - ); - } - - public override Aas.IClass TransformLangStringNameType( - Aas.ILangStringNameType that - ) - { - return new Aas.LangStringNameType( - that.Language, - that.Text - ); - } - - public override Aas.IClass TransformLangStringTextType( - Aas.ILangStringTextType that - ) - { - return new Aas.LangStringTextType( - that.Language, - that.Text - ); - } - - public override Aas.IClass TransformEnvironment( - Aas.IEnvironment that - ) - { - List? theAssetAdministrationShells = null; - if (that.AssetAdministrationShells != null) - { - theAssetAdministrationShells = new List( - that.AssetAdministrationShells.Count); - foreach (var item in that.AssetAdministrationShells) - { - theAssetAdministrationShells.Add(Deep(item)); - } - } - - List? theSubmodels = null; - if (that.Submodels != null) - { - theSubmodels = new List( - that.Submodels.Count); - foreach (var item in that.Submodels) - { - theSubmodels.Add(Deep(item)); - } - } - - List? theConceptDescriptions = null; - if (that.ConceptDescriptions != null) - { - theConceptDescriptions = new List( - that.ConceptDescriptions.Count); - foreach (var item in that.ConceptDescriptions) - { - theConceptDescriptions.Add(Deep(item)); - } - } - - return new Aas.Environment( - theAssetAdministrationShells, - theSubmodels, - theConceptDescriptions - ); - } - - public override Aas.IClass TransformEmbeddedDataSpecification( - Aas.IEmbeddedDataSpecification that - ) - { - return new Aas.EmbeddedDataSpecification( - Deep(that.DataSpecification), - Deep(that.DataSpecificationContent) - ); - } - - public override Aas.IClass TransformLevelType( - Aas.ILevelType that - ) - { - return new Aas.LevelType( - that.Min, - that.Nom, - that.Typ, - that.Max - ); - } - - public override Aas.IClass TransformValueReferencePair( - Aas.IValueReferencePair that - ) - { - return new Aas.ValueReferencePair( - that.Value, - Deep(that.ValueId) - ); - } - - public override Aas.IClass TransformValueList( - Aas.IValueList that - ) - { - var theValueReferencePairs = new List( - that.ValueReferencePairs.Count); - foreach (var item in that.ValueReferencePairs) - { - theValueReferencePairs.Add(Deep(item)); - } - - return new Aas.ValueList( - theValueReferencePairs - ); - } - - public override Aas.IClass TransformLangStringPreferredNameTypeIec61360( - Aas.ILangStringPreferredNameTypeIec61360 that - ) - { - return new Aas.LangStringPreferredNameTypeIec61360( - that.Language, - that.Text - ); - } - - public override Aas.IClass TransformLangStringShortNameTypeIec61360( - Aas.ILangStringShortNameTypeIec61360 that - ) - { - return new Aas.LangStringShortNameTypeIec61360( - that.Language, - that.Text - ); - } - - public override Aas.IClass TransformLangStringDefinitionTypeIec61360( - Aas.ILangStringDefinitionTypeIec61360 that - ) - { - return new Aas.LangStringDefinitionTypeIec61360( - that.Language, - that.Text - ); - } - - public override Aas.IClass TransformDataSpecificationIec61360( - Aas.IDataSpecificationIec61360 that - ) - { - var thePreferredName = new List( - that.PreferredName.Count); - foreach (var item in that.PreferredName) - { - thePreferredName.Add(Deep(item)); - } - - List? theShortName = null; - if (that.ShortName != null) - { - theShortName = new List( - that.ShortName.Count); - foreach (var item in that.ShortName) - { - theShortName.Add(Deep(item)); - } - } - - List? theDefinition = null; - if (that.Definition != null) - { - theDefinition = new List( - that.Definition.Count); - foreach (var item in that.Definition) - { - theDefinition.Add(Deep(item)); - } - } - - return new Aas.DataSpecificationIec61360( - thePreferredName, - theShortName, - that.Unit, - (that.UnitId != null) - ? Deep(that.UnitId) - : null, - that.SourceOfDefinition, - that.Symbol, - that.DataType, - theDefinition, - that.ValueFormat, - (that.ValueList != null) - ? Deep(that.ValueList) - : null, - that.Value, - (that.LevelType != null) - ? Deep(that.LevelType) - : null - ); - } - } // internal class DeepCopier - } // public static class Copying -} // namespace AasCore.Aas3_0 - -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ diff --git a/src/AasCore.Aas3_0/jsonization.cs b/src/AasCore.Aas3_0/jsonization.cs deleted file mode 100644 index 600fd770f..000000000 --- a/src/AasCore.Aas3_0/jsonization.cs +++ /dev/null @@ -1,18828 +0,0 @@ -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ - -using Aas = AasCore.Aas3_0; // renamed -using CodeAnalysis = System.Diagnostics.CodeAnalysis; -using Nodes = System.Text.Json.Nodes; - -using System.Collections.Generic; // can't alias - -namespace AasCore.Aas3_0 -{ - /// - /// Provide de/serialization of meta-model classes to/from JSON. - /// - /// - /// We can not use one-pass deserialization for JSON since the object - /// properties do not have fixed order, and hence we can not read - /// modelType property ahead of the remaining properties. - /// - public static class Jsonization - { - /// - /// Implement the deserialization of meta-model classes from JSON nodes. - /// - /// - /// The implementation propagates an instead of relying - /// on exceptions. Under the assumption that incorrect data is much less - /// frequent than correct data, this makes the deserialization more - /// efficient. - /// - /// However, we do not want to force the client to deal with - /// the class as this is not intuitive. Therefore - /// we distinguish the implementation, realized in - /// , and the facade given in - /// class. - /// - internal static class DeserializeImplementation - { - /// Convert to a boolean. - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static bool? BoolFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - Nodes.JsonValue? value = node as Nodes.JsonValue; - if (value == null) - { - error = new Reporting.Error( - $"Expected a JsonValue, but got {node.GetType()}"); - return null; - } - bool ok = value.TryGetValue(out bool result); - if (!ok) - { - error = new Reporting.Error( - "Expected a boolean, but the conversion failed " + - $"from {value.ToJsonString()}"); - return null; - } - return result; - } - - /// - /// Convert the to a long 64-bit integer. - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static long? LongFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - Nodes.JsonValue? value = node as Nodes.JsonValue; - if (value == null) - { - error = new Reporting.Error( - $"Expected a JsonValue, but got {node.GetType()}"); - return null; - } - bool ok = value.TryGetValue(out long result); - if (!ok) - { - error = new Reporting.Error( - "Expected a 64-bit long integer, but the conversion failed " + - $"from {value.ToJsonString()}"); - return null; - } - return result; - } - - /// - /// Convert the to a double-precision 64-bit float. - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static double? DoubleFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - Nodes.JsonValue? value = node as Nodes.JsonValue; - if (value == null) - { - error = new Reporting.Error( - $"Expected a JsonValue, but got {node.GetType()}"); - return null; - } - bool ok = value.TryGetValue(out double result); - if (!ok) - { - error = new Reporting.Error( - "Expected a 64-bit double-precision float, " + - "but the conversion failed " + - $"from {value.ToJsonString()}"); - return null; - } - return result; - } - - /// - /// Convert the to a string. - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static string? StringFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - Nodes.JsonValue? value = node as Nodes.JsonValue; - if (value == null) - { - error = new Reporting.Error( - $"Expected a JsonValue, but got {node.GetType()}"); - return null; - } - bool ok = value.TryGetValue(out string? result); - if (!ok) - { - error = new Reporting.Error( - "Expected a string, but the conversion failed " + - $"from {value.ToJsonString()}"); - return null; - } - if (result == null) - { - error = new Reporting.Error( - "Expected a string, but got a null"); - return null; - } - return result; - } - - /// - /// Convert the to bytes. - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static byte[]? BytesFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - Nodes.JsonValue? value = node as Nodes.JsonValue; - if (value == null) - { - error = new Reporting.Error( - $"Expected a JsonValue, but got {node.GetType()}"); - return null; - } - bool ok = value.TryGetValue(out string? text); - if (!ok) - { - error = new Reporting.Error( - "Expected a string, but the conversion failed " + - $"from {value.ToJsonString()}"); - return null; - } - if (text == null) - { - error = new Reporting.Error( - "Expected a string, but got a null"); - return null; - } - try - { - return System.Convert.FromBase64String(text); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "Expected Base-64 encoded bytes, but the conversion failed " + - $"because: {exception}"); - return null; - } - } - - /// - /// Deserialize an instance of IHasSemantics by dispatching - /// based on modelType property of the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IHasSemantics? IHasSemanticsFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - var obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - "Expected Nodes.JsonObject, but got {node.GetType()}"); - return null; - } - - Nodes.JsonNode? modelTypeNode = obj["modelType"]; - if (modelTypeNode == null) - { - error = new Reporting.Error( - "Expected a model type, but none is present"); - return null; - } - Nodes.JsonValue? modelTypeValue = modelTypeNode as Nodes.JsonValue; - if (modelTypeValue == null) - { - error = new Reporting.Error( - "Expected JsonValue, " + - $"but got {modelTypeNode.GetType()}"); - return null; - } - modelTypeValue.TryGetValue(out string? modelType); - if (modelType == null) - { - error = new Reporting.Error( - "Expected a string, " + - $"but the conversion failed from {modelTypeValue}"); - return null; - } - - switch (modelType) - { - case "RelationshipElement": - return RelationshipElementFrom( - node, out error); - case "AnnotatedRelationshipElement": - return AnnotatedRelationshipElementFrom( - node, out error); - case "BasicEventElement": - return BasicEventElementFrom( - node, out error); - case "Blob": - return BlobFrom( - node, out error); - case "Capability": - return CapabilityFrom( - node, out error); - case "Entity": - return EntityFrom( - node, out error); - case "Extension": - return ExtensionFrom( - node, out error); - case "File": - return FileFrom( - node, out error); - case "MultiLanguageProperty": - return MultiLanguagePropertyFrom( - node, out error); - case "Operation": - return OperationFrom( - node, out error); - case "Property": - return PropertyFrom( - node, out error); - case "Qualifier": - return QualifierFrom( - node, out error); - case "Range": - return RangeFrom( - node, out error); - case "ReferenceElement": - return ReferenceElementFrom( - node, out error); - case "SpecificAssetId": - return SpecificAssetIdFrom( - node, out error); - case "Submodel": - return SubmodelFrom( - node, out error); - case "SubmodelElementCollection": - return SubmodelElementCollectionFrom( - node, out error); - case "SubmodelElementList": - return SubmodelElementListFrom( - node, out error); - default: - error = new Reporting.Error( - $"Unexpected model type for IHasSemantics: {modelType}"); - return null; - } - } // public static Aas.IHasSemantics IHasSemanticsFrom - - /// - /// Deserialize an instance of Extension from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Extension? ExtensionFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theName = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - DataTypeDefXsd? theValueType = null; - string? theValue = null; - List? theRefersTo = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "name": - { - if (keyValue.Value == null) - { - continue; - } - - theName = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "name")); - return null; - } - if (theName == null) - { - throw new System.InvalidOperationException( - "Unexpected theName null when error is also null"); - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "valueType": - { - if (keyValue.Value == null) - { - continue; - } - - theValueType = DeserializeImplementation.DataTypeDefXsdFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - if (theValueType == null) - { - throw new System.InvalidOperationException( - "Unexpected theValueType null when error is also null"); - } - break; - } - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - theValue = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - if (theValue == null) - { - throw new System.InvalidOperationException( - "Unexpected theValue null when error is also null"); - } - break; - } - case "refersTo": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayRefersTo = keyValue.Value as Nodes.JsonArray; - if (arrayRefersTo == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "refersTo")); - return null; - } - theRefersTo = new List( - arrayRefersTo.Count); - int indexRefersTo = 0; - foreach (Nodes.JsonNode? item in arrayRefersTo) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexRefersTo)); - error.PrependSegment( - new Reporting.NameSegment( - "refersTo")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexRefersTo)); - error.PrependSegment( - new Reporting.NameSegment( - "refersTo")); - return null; - } - theRefersTo.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexRefersTo++; - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theName == null) - { - error = new Reporting.Error( - "Required property \"name\" is missing"); - return null; - } - - return new Aas.Extension( - theName - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theSemanticId, - theSupplementalSemanticIds, - theValueType, - theValue, - theRefersTo); - } // internal static ExtensionFrom - - /// - /// Deserialize an instance of IHasExtensions by dispatching - /// based on modelType property of the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IHasExtensions? IHasExtensionsFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - var obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - "Expected Nodes.JsonObject, but got {node.GetType()}"); - return null; - } - - Nodes.JsonNode? modelTypeNode = obj["modelType"]; - if (modelTypeNode == null) - { - error = new Reporting.Error( - "Expected a model type, but none is present"); - return null; - } - Nodes.JsonValue? modelTypeValue = modelTypeNode as Nodes.JsonValue; - if (modelTypeValue == null) - { - error = new Reporting.Error( - "Expected JsonValue, " + - $"but got {modelTypeNode.GetType()}"); - return null; - } - modelTypeValue.TryGetValue(out string? modelType); - if (modelType == null) - { - error = new Reporting.Error( - "Expected a string, " + - $"but the conversion failed from {modelTypeValue}"); - return null; - } - - switch (modelType) - { - case "RelationshipElement": - return RelationshipElementFrom( - node, out error); - case "AnnotatedRelationshipElement": - return AnnotatedRelationshipElementFrom( - node, out error); - case "AssetAdministrationShell": - return AssetAdministrationShellFrom( - node, out error); - case "BasicEventElement": - return BasicEventElementFrom( - node, out error); - case "Blob": - return BlobFrom( - node, out error); - case "Capability": - return CapabilityFrom( - node, out error); - case "ConceptDescription": - return ConceptDescriptionFrom( - node, out error); - case "Entity": - return EntityFrom( - node, out error); - case "File": - return FileFrom( - node, out error); - case "MultiLanguageProperty": - return MultiLanguagePropertyFrom( - node, out error); - case "Operation": - return OperationFrom( - node, out error); - case "Property": - return PropertyFrom( - node, out error); - case "Range": - return RangeFrom( - node, out error); - case "ReferenceElement": - return ReferenceElementFrom( - node, out error); - case "Submodel": - return SubmodelFrom( - node, out error); - case "SubmodelElementCollection": - return SubmodelElementCollectionFrom( - node, out error); - case "SubmodelElementList": - return SubmodelElementListFrom( - node, out error); - default: - error = new Reporting.Error( - $"Unexpected model type for IHasExtensions: {modelType}"); - return null; - } - } // public static Aas.IHasExtensions IHasExtensionsFrom - - /// - /// Deserialize an instance of IReferable by dispatching - /// based on modelType property of the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IReferable? IReferableFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - var obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - "Expected Nodes.JsonObject, but got {node.GetType()}"); - return null; - } - - Nodes.JsonNode? modelTypeNode = obj["modelType"]; - if (modelTypeNode == null) - { - error = new Reporting.Error( - "Expected a model type, but none is present"); - return null; - } - Nodes.JsonValue? modelTypeValue = modelTypeNode as Nodes.JsonValue; - if (modelTypeValue == null) - { - error = new Reporting.Error( - "Expected JsonValue, " + - $"but got {modelTypeNode.GetType()}"); - return null; - } - modelTypeValue.TryGetValue(out string? modelType); - if (modelType == null) - { - error = new Reporting.Error( - "Expected a string, " + - $"but the conversion failed from {modelTypeValue}"); - return null; - } - - switch (modelType) - { - case "RelationshipElement": - return RelationshipElementFrom( - node, out error); - case "AnnotatedRelationshipElement": - return AnnotatedRelationshipElementFrom( - node, out error); - case "AssetAdministrationShell": - return AssetAdministrationShellFrom( - node, out error); - case "BasicEventElement": - return BasicEventElementFrom( - node, out error); - case "Blob": - return BlobFrom( - node, out error); - case "Capability": - return CapabilityFrom( - node, out error); - case "ConceptDescription": - return ConceptDescriptionFrom( - node, out error); - case "Entity": - return EntityFrom( - node, out error); - case "File": - return FileFrom( - node, out error); - case "MultiLanguageProperty": - return MultiLanguagePropertyFrom( - node, out error); - case "Operation": - return OperationFrom( - node, out error); - case "Property": - return PropertyFrom( - node, out error); - case "Range": - return RangeFrom( - node, out error); - case "ReferenceElement": - return ReferenceElementFrom( - node, out error); - case "Submodel": - return SubmodelFrom( - node, out error); - case "SubmodelElementCollection": - return SubmodelElementCollectionFrom( - node, out error); - case "SubmodelElementList": - return SubmodelElementListFrom( - node, out error); - default: - error = new Reporting.Error( - $"Unexpected model type for IReferable: {modelType}"); - return null; - } - } // public static Aas.IReferable IReferableFrom - - /// - /// Deserialize an instance of IIdentifiable by dispatching - /// based on modelType property of the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IIdentifiable? IIdentifiableFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - var obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - "Expected Nodes.JsonObject, but got {node.GetType()}"); - return null; - } - - Nodes.JsonNode? modelTypeNode = obj["modelType"]; - if (modelTypeNode == null) - { - error = new Reporting.Error( - "Expected a model type, but none is present"); - return null; - } - Nodes.JsonValue? modelTypeValue = modelTypeNode as Nodes.JsonValue; - if (modelTypeValue == null) - { - error = new Reporting.Error( - "Expected JsonValue, " + - $"but got {modelTypeNode.GetType()}"); - return null; - } - modelTypeValue.TryGetValue(out string? modelType); - if (modelType == null) - { - error = new Reporting.Error( - "Expected a string, " + - $"but the conversion failed from {modelTypeValue}"); - return null; - } - - switch (modelType) - { - case "AssetAdministrationShell": - return AssetAdministrationShellFrom( - node, out error); - case "ConceptDescription": - return ConceptDescriptionFrom( - node, out error); - case "Submodel": - return SubmodelFrom( - node, out error); - default: - error = new Reporting.Error( - $"Unexpected model type for IIdentifiable: {modelType}"); - return null; - } - } // public static Aas.IIdentifiable IIdentifiableFrom - - /// - /// Deserialize the enumeration ModellingKind from the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.ModellingKind? ModellingKindFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - string? text = DeserializeImplementation.StringFrom( - node, out error); - if (error != null) - { - return null; - } - if (text == null) - { - throw new System.InvalidOperationException( - "Unexpected text null if error null"); - } - Aas.ModellingKind? result = Stringification.ModellingKindFromString(text); - if (result == null) - { - error = new Reporting.Error( - "Not a valid JSON representation of ModellingKind"); - } - return result; - } // internal static ModellingKindFrom - - /// - /// Deserialize an instance of IHasKind by dispatching - /// based on modelType property of the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IHasKind? IHasKindFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - var obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - "Expected Nodes.JsonObject, but got {node.GetType()}"); - return null; - } - - Nodes.JsonNode? modelTypeNode = obj["modelType"]; - if (modelTypeNode == null) - { - error = new Reporting.Error( - "Expected a model type, but none is present"); - return null; - } - Nodes.JsonValue? modelTypeValue = modelTypeNode as Nodes.JsonValue; - if (modelTypeValue == null) - { - error = new Reporting.Error( - "Expected JsonValue, " + - $"but got {modelTypeNode.GetType()}"); - return null; - } - modelTypeValue.TryGetValue(out string? modelType); - if (modelType == null) - { - error = new Reporting.Error( - "Expected a string, " + - $"but the conversion failed from {modelTypeValue}"); - return null; - } - - switch (modelType) - { - case "Submodel": - return SubmodelFrom( - node, out error); - default: - error = new Reporting.Error( - $"Unexpected model type for IHasKind: {modelType}"); - return null; - } - } // public static Aas.IHasKind IHasKindFrom - - /// - /// Deserialize an instance of IHasDataSpecification by dispatching - /// based on modelType property of the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IHasDataSpecification? IHasDataSpecificationFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - var obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - "Expected Nodes.JsonObject, but got {node.GetType()}"); - return null; - } - - Nodes.JsonNode? modelTypeNode = obj["modelType"]; - if (modelTypeNode == null) - { - error = new Reporting.Error( - "Expected a model type, but none is present"); - return null; - } - Nodes.JsonValue? modelTypeValue = modelTypeNode as Nodes.JsonValue; - if (modelTypeValue == null) - { - error = new Reporting.Error( - "Expected JsonValue, " + - $"but got {modelTypeNode.GetType()}"); - return null; - } - modelTypeValue.TryGetValue(out string? modelType); - if (modelType == null) - { - error = new Reporting.Error( - "Expected a string, " + - $"but the conversion failed from {modelTypeValue}"); - return null; - } - - switch (modelType) - { - case "AdministrativeInformation": - return AdministrativeInformationFrom( - node, out error); - case "RelationshipElement": - return RelationshipElementFrom( - node, out error); - case "AnnotatedRelationshipElement": - return AnnotatedRelationshipElementFrom( - node, out error); - case "AssetAdministrationShell": - return AssetAdministrationShellFrom( - node, out error); - case "BasicEventElement": - return BasicEventElementFrom( - node, out error); - case "Blob": - return BlobFrom( - node, out error); - case "Capability": - return CapabilityFrom( - node, out error); - case "ConceptDescription": - return ConceptDescriptionFrom( - node, out error); - case "Entity": - return EntityFrom( - node, out error); - case "File": - return FileFrom( - node, out error); - case "MultiLanguageProperty": - return MultiLanguagePropertyFrom( - node, out error); - case "Operation": - return OperationFrom( - node, out error); - case "Property": - return PropertyFrom( - node, out error); - case "Range": - return RangeFrom( - node, out error); - case "ReferenceElement": - return ReferenceElementFrom( - node, out error); - case "Submodel": - return SubmodelFrom( - node, out error); - case "SubmodelElementCollection": - return SubmodelElementCollectionFrom( - node, out error); - case "SubmodelElementList": - return SubmodelElementListFrom( - node, out error); - default: - error = new Reporting.Error( - $"Unexpected model type for IHasDataSpecification: {modelType}"); - return null; - } - } // public static Aas.IHasDataSpecification IHasDataSpecificationFrom - - /// - /// Deserialize an instance of AdministrativeInformation from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.AdministrativeInformation? AdministrativeInformationFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - List? theEmbeddedDataSpecifications = null; - string? theVersion = null; - string? theRevision = null; - IReference? theCreator = null; - string? theTemplateId = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "version": - { - if (keyValue.Value == null) - { - continue; - } - - theVersion = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "version")); - return null; - } - if (theVersion == null) - { - throw new System.InvalidOperationException( - "Unexpected theVersion null when error is also null"); - } - break; - } - case "revision": - { - if (keyValue.Value == null) - { - continue; - } - - theRevision = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "revision")); - return null; - } - if (theRevision == null) - { - throw new System.InvalidOperationException( - "Unexpected theRevision null when error is also null"); - } - break; - } - case "creator": - { - if (keyValue.Value == null) - { - continue; - } - - theCreator = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "creator")); - return null; - } - if (theCreator == null) - { - throw new System.InvalidOperationException( - "Unexpected theCreator null when error is also null"); - } - break; - } - case "templateId": - { - if (keyValue.Value == null) - { - continue; - } - - theTemplateId = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "templateId")); - return null; - } - if (theTemplateId == null) - { - throw new System.InvalidOperationException( - "Unexpected theTemplateId null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - - - return new Aas.AdministrativeInformation( - theEmbeddedDataSpecifications, - theVersion, - theRevision, - theCreator, - theTemplateId); - } // internal static AdministrativeInformationFrom - - /// - /// Deserialize an instance of IQualifiable by dispatching - /// based on modelType property of the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IQualifiable? IQualifiableFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - var obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - "Expected Nodes.JsonObject, but got {node.GetType()}"); - return null; - } - - Nodes.JsonNode? modelTypeNode = obj["modelType"]; - if (modelTypeNode == null) - { - error = new Reporting.Error( - "Expected a model type, but none is present"); - return null; - } - Nodes.JsonValue? modelTypeValue = modelTypeNode as Nodes.JsonValue; - if (modelTypeValue == null) - { - error = new Reporting.Error( - "Expected JsonValue, " + - $"but got {modelTypeNode.GetType()}"); - return null; - } - modelTypeValue.TryGetValue(out string? modelType); - if (modelType == null) - { - error = new Reporting.Error( - "Expected a string, " + - $"but the conversion failed from {modelTypeValue}"); - return null; - } - - switch (modelType) - { - case "RelationshipElement": - return RelationshipElementFrom( - node, out error); - case "AnnotatedRelationshipElement": - return AnnotatedRelationshipElementFrom( - node, out error); - case "BasicEventElement": - return BasicEventElementFrom( - node, out error); - case "Blob": - return BlobFrom( - node, out error); - case "Capability": - return CapabilityFrom( - node, out error); - case "Entity": - return EntityFrom( - node, out error); - case "File": - return FileFrom( - node, out error); - case "MultiLanguageProperty": - return MultiLanguagePropertyFrom( - node, out error); - case "Operation": - return OperationFrom( - node, out error); - case "Property": - return PropertyFrom( - node, out error); - case "Range": - return RangeFrom( - node, out error); - case "ReferenceElement": - return ReferenceElementFrom( - node, out error); - case "Submodel": - return SubmodelFrom( - node, out error); - case "SubmodelElementCollection": - return SubmodelElementCollectionFrom( - node, out error); - case "SubmodelElementList": - return SubmodelElementListFrom( - node, out error); - default: - error = new Reporting.Error( - $"Unexpected model type for IQualifiable: {modelType}"); - return null; - } - } // public static Aas.IQualifiable IQualifiableFrom - - /// - /// Deserialize the enumeration QualifierKind from the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.QualifierKind? QualifierKindFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - string? text = DeserializeImplementation.StringFrom( - node, out error); - if (error != null) - { - return null; - } - if (text == null) - { - throw new System.InvalidOperationException( - "Unexpected text null if error null"); - } - Aas.QualifierKind? result = Stringification.QualifierKindFromString(text); - if (result == null) - { - error = new Reporting.Error( - "Not a valid JSON representation of QualifierKind"); - } - return result; - } // internal static QualifierKindFrom - - /// - /// Deserialize an instance of Qualifier from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Qualifier? QualifierFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theType = null; - DataTypeDefXsd? theValueType = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - QualifierKind? theKind = null; - string? theValue = null; - IReference? theValueId = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "type": - { - if (keyValue.Value == null) - { - continue; - } - - theType = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "type")); - return null; - } - if (theType == null) - { - throw new System.InvalidOperationException( - "Unexpected theType null when error is also null"); - } - break; - } - case "valueType": - { - if (keyValue.Value == null) - { - continue; - } - - theValueType = DeserializeImplementation.DataTypeDefXsdFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - if (theValueType == null) - { - throw new System.InvalidOperationException( - "Unexpected theValueType null when error is also null"); - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "kind": - { - if (keyValue.Value == null) - { - continue; - } - - theKind = DeserializeImplementation.QualifierKindFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "kind")); - return null; - } - if (theKind == null) - { - throw new System.InvalidOperationException( - "Unexpected theKind null when error is also null"); - } - break; - } - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - theValue = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - if (theValue == null) - { - throw new System.InvalidOperationException( - "Unexpected theValue null when error is also null"); - } - break; - } - case "valueId": - { - if (keyValue.Value == null) - { - continue; - } - - theValueId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueId")); - return null; - } - if (theValueId == null) - { - throw new System.InvalidOperationException( - "Unexpected theValueId null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theType == null) - { - error = new Reporting.Error( - "Required property \"type\" is missing"); - return null; - } - - if (theValueType == null) - { - error = new Reporting.Error( - "Required property \"valueType\" is missing"); - return null; - } - - return new Aas.Qualifier( - theType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theValueType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theSemanticId, - theSupplementalSemanticIds, - theKind, - theValue, - theValueId); - } // internal static QualifierFrom - - /// - /// Deserialize an instance of AssetAdministrationShell from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.AssetAdministrationShell? AssetAdministrationShellFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theId = null; - IAssetInformation? theAssetInformation = null; - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IAdministrativeInformation? theAdministration = null; - List? theEmbeddedDataSpecifications = null; - IReference? theDerivedFrom = null; - List? theSubmodels = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "id": - { - if (keyValue.Value == null) - { - continue; - } - - theId = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "id")); - return null; - } - if (theId == null) - { - throw new System.InvalidOperationException( - "Unexpected theId null when error is also null"); - } - break; - } - case "assetInformation": - { - if (keyValue.Value == null) - { - continue; - } - - theAssetInformation = DeserializeImplementation.AssetInformationFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "assetInformation")); - return null; - } - if (theAssetInformation == null) - { - throw new System.InvalidOperationException( - "Unexpected theAssetInformation null when error is also null"); - } - break; - } - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "administration": - { - if (keyValue.Value == null) - { - continue; - } - - theAdministration = DeserializeImplementation.AdministrativeInformationFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "administration")); - return null; - } - if (theAdministration == null) - { - throw new System.InvalidOperationException( - "Unexpected theAdministration null when error is also null"); - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "derivedFrom": - { - if (keyValue.Value == null) - { - continue; - } - - theDerivedFrom = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "derivedFrom")); - return null; - } - if (theDerivedFrom == null) - { - throw new System.InvalidOperationException( - "Unexpected theDerivedFrom null when error is also null"); - } - break; - } - case "submodels": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySubmodels = keyValue.Value as Nodes.JsonArray; - if (arraySubmodels == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "submodels")); - return null; - } - theSubmodels = new List( - arraySubmodels.Count); - int indexSubmodels = 0; - foreach (Nodes.JsonNode? item in arraySubmodels) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSubmodels)); - error.PrependSegment( - new Reporting.NameSegment( - "submodels")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSubmodels)); - error.PrependSegment( - new Reporting.NameSegment( - "submodels")); - return null; - } - theSubmodels.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSubmodels++; - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theId == null) - { - error = new Reporting.Error( - "Required property \"id\" is missing"); - return null; - } - - if (theAssetInformation == null) - { - error = new Reporting.Error( - "Required property \"assetInformation\" is missing"); - return null; - } - - return new Aas.AssetAdministrationShell( - theId - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theAssetInformation - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theAdministration, - theEmbeddedDataSpecifications, - theDerivedFrom, - theSubmodels); - } // internal static AssetAdministrationShellFrom - - /// - /// Deserialize an instance of AssetInformation from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.AssetInformation? AssetInformationFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - AssetKind? theAssetKind = null; - string? theGlobalAssetId = null; - List? theSpecificAssetIds = null; - string? theAssetType = null; - IResource? theDefaultThumbnail = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "assetKind": - { - if (keyValue.Value == null) - { - continue; - } - - theAssetKind = DeserializeImplementation.AssetKindFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "assetKind")); - return null; - } - if (theAssetKind == null) - { - throw new System.InvalidOperationException( - "Unexpected theAssetKind null when error is also null"); - } - break; - } - case "globalAssetId": - { - if (keyValue.Value == null) - { - continue; - } - - theGlobalAssetId = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "globalAssetId")); - return null; - } - if (theGlobalAssetId == null) - { - throw new System.InvalidOperationException( - "Unexpected theGlobalAssetId null when error is also null"); - } - break; - } - case "specificAssetIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySpecificAssetIds = keyValue.Value as Nodes.JsonArray; - if (arraySpecificAssetIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "specificAssetIds")); - return null; - } - theSpecificAssetIds = new List( - arraySpecificAssetIds.Count); - int indexSpecificAssetIds = 0; - foreach (Nodes.JsonNode? item in arraySpecificAssetIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSpecificAssetIds)); - error.PrependSegment( - new Reporting.NameSegment( - "specificAssetIds")); - return null; - } - ISpecificAssetId? parsedItem = DeserializeImplementation.SpecificAssetIdFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSpecificAssetIds)); - error.PrependSegment( - new Reporting.NameSegment( - "specificAssetIds")); - return null; - } - theSpecificAssetIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSpecificAssetIds++; - } - break; - } - case "assetType": - { - if (keyValue.Value == null) - { - continue; - } - - theAssetType = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "assetType")); - return null; - } - if (theAssetType == null) - { - throw new System.InvalidOperationException( - "Unexpected theAssetType null when error is also null"); - } - break; - } - case "defaultThumbnail": - { - if (keyValue.Value == null) - { - continue; - } - - theDefaultThumbnail = DeserializeImplementation.ResourceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "defaultThumbnail")); - return null; - } - if (theDefaultThumbnail == null) - { - throw new System.InvalidOperationException( - "Unexpected theDefaultThumbnail null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theAssetKind == null) - { - error = new Reporting.Error( - "Required property \"assetKind\" is missing"); - return null; - } - - return new Aas.AssetInformation( - theAssetKind - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theGlobalAssetId, - theSpecificAssetIds, - theAssetType, - theDefaultThumbnail); - } // internal static AssetInformationFrom - - /// - /// Deserialize an instance of Resource from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Resource? ResourceFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? thePath = null; - string? theContentType = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "path": - { - if (keyValue.Value == null) - { - continue; - } - - thePath = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "path")); - return null; - } - if (thePath == null) - { - throw new System.InvalidOperationException( - "Unexpected thePath null when error is also null"); - } - break; - } - case "contentType": - { - if (keyValue.Value == null) - { - continue; - } - - theContentType = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "contentType")); - return null; - } - if (theContentType == null) - { - throw new System.InvalidOperationException( - "Unexpected theContentType null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (thePath == null) - { - error = new Reporting.Error( - "Required property \"path\" is missing"); - return null; - } - - return new Aas.Resource( - thePath - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theContentType); - } // internal static ResourceFrom - - /// - /// Deserialize the enumeration AssetKind from the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.AssetKind? AssetKindFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - string? text = DeserializeImplementation.StringFrom( - node, out error); - if (error != null) - { - return null; - } - if (text == null) - { - throw new System.InvalidOperationException( - "Unexpected text null if error null"); - } - Aas.AssetKind? result = Stringification.AssetKindFromString(text); - if (result == null) - { - error = new Reporting.Error( - "Not a valid JSON representation of AssetKind"); - } - return result; - } // internal static AssetKindFrom - - /// - /// Deserialize an instance of SpecificAssetId from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.SpecificAssetId? SpecificAssetIdFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theName = null; - string? theValue = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - IReference? theExternalSubjectId = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "name": - { - if (keyValue.Value == null) - { - continue; - } - - theName = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "name")); - return null; - } - if (theName == null) - { - throw new System.InvalidOperationException( - "Unexpected theName null when error is also null"); - } - break; - } - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - theValue = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - if (theValue == null) - { - throw new System.InvalidOperationException( - "Unexpected theValue null when error is also null"); - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "externalSubjectId": - { - if (keyValue.Value == null) - { - continue; - } - - theExternalSubjectId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "externalSubjectId")); - return null; - } - if (theExternalSubjectId == null) - { - throw new System.InvalidOperationException( - "Unexpected theExternalSubjectId null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theName == null) - { - error = new Reporting.Error( - "Required property \"name\" is missing"); - return null; - } - - if (theValue == null) - { - error = new Reporting.Error( - "Required property \"value\" is missing"); - return null; - } - - return new Aas.SpecificAssetId( - theName - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theValue - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theSemanticId, - theSupplementalSemanticIds, - theExternalSubjectId); - } // internal static SpecificAssetIdFrom - - /// - /// Deserialize an instance of Submodel from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Submodel? SubmodelFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theId = null; - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IAdministrativeInformation? theAdministration = null; - ModellingKind? theKind = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - List? theSubmodelElements = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "id": - { - if (keyValue.Value == null) - { - continue; - } - - theId = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "id")); - return null; - } - if (theId == null) - { - throw new System.InvalidOperationException( - "Unexpected theId null when error is also null"); - } - break; - } - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "administration": - { - if (keyValue.Value == null) - { - continue; - } - - theAdministration = DeserializeImplementation.AdministrativeInformationFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "administration")); - return null; - } - if (theAdministration == null) - { - throw new System.InvalidOperationException( - "Unexpected theAdministration null when error is also null"); - } - break; - } - case "kind": - { - if (keyValue.Value == null) - { - continue; - } - - theKind = DeserializeImplementation.ModellingKindFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "kind")); - return null; - } - if (theKind == null) - { - throw new System.InvalidOperationException( - "Unexpected theKind null when error is also null"); - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "submodelElements": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySubmodelElements = keyValue.Value as Nodes.JsonArray; - if (arraySubmodelElements == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "submodelElements")); - return null; - } - theSubmodelElements = new List( - arraySubmodelElements.Count); - int indexSubmodelElements = 0; - foreach (Nodes.JsonNode? item in arraySubmodelElements) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSubmodelElements)); - error.PrependSegment( - new Reporting.NameSegment( - "submodelElements")); - return null; - } - ISubmodelElement? parsedItem = DeserializeImplementation.ISubmodelElementFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSubmodelElements)); - error.PrependSegment( - new Reporting.NameSegment( - "submodelElements")); - return null; - } - theSubmodelElements.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSubmodelElements++; - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theId == null) - { - error = new Reporting.Error( - "Required property \"id\" is missing"); - return null; - } - - return new Aas.Submodel( - theId - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theAdministration, - theKind, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theSubmodelElements); - } // internal static SubmodelFrom - - /// - /// Deserialize an instance of ISubmodelElement by dispatching - /// based on modelType property of the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.ISubmodelElement? ISubmodelElementFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - var obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - "Expected Nodes.JsonObject, but got {node.GetType()}"); - return null; - } - - Nodes.JsonNode? modelTypeNode = obj["modelType"]; - if (modelTypeNode == null) - { - error = new Reporting.Error( - "Expected a model type, but none is present"); - return null; - } - Nodes.JsonValue? modelTypeValue = modelTypeNode as Nodes.JsonValue; - if (modelTypeValue == null) - { - error = new Reporting.Error( - "Expected JsonValue, " + - $"but got {modelTypeNode.GetType()}"); - return null; - } - modelTypeValue.TryGetValue(out string? modelType); - if (modelType == null) - { - error = new Reporting.Error( - "Expected a string, " + - $"but the conversion failed from {modelTypeValue}"); - return null; - } - - switch (modelType) - { - case "RelationshipElement": - return RelationshipElementFrom( - node, out error); - case "AnnotatedRelationshipElement": - return AnnotatedRelationshipElementFrom( - node, out error); - case "BasicEventElement": - return BasicEventElementFrom( - node, out error); - case "Blob": - return BlobFrom( - node, out error); - case "Capability": - return CapabilityFrom( - node, out error); - case "Entity": - return EntityFrom( - node, out error); - case "File": - return FileFrom( - node, out error); - case "MultiLanguageProperty": - return MultiLanguagePropertyFrom( - node, out error); - case "Operation": - return OperationFrom( - node, out error); - case "Property": - return PropertyFrom( - node, out error); - case "Range": - return RangeFrom( - node, out error); - case "ReferenceElement": - return ReferenceElementFrom( - node, out error); - case "SubmodelElementCollection": - return SubmodelElementCollectionFrom( - node, out error); - case "SubmodelElementList": - return SubmodelElementListFrom( - node, out error); - default: - error = new Reporting.Error( - $"Unexpected model type for ISubmodelElement: {modelType}"); - return null; - } - } // public static Aas.ISubmodelElement ISubmodelElementFrom - - /// - /// Deserialize an instance of IRelationshipElement by dispatching - /// based on modelType property of the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IRelationshipElement? IRelationshipElementFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - var obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - "Expected Nodes.JsonObject, but got {node.GetType()}"); - return null; - } - - Nodes.JsonNode? modelTypeNode = obj["modelType"]; - if (modelTypeNode == null) - { - error = new Reporting.Error( - "Expected a model type, but none is present"); - return null; - } - Nodes.JsonValue? modelTypeValue = modelTypeNode as Nodes.JsonValue; - if (modelTypeValue == null) - { - error = new Reporting.Error( - "Expected JsonValue, " + - $"but got {modelTypeNode.GetType()}"); - return null; - } - modelTypeValue.TryGetValue(out string? modelType); - if (modelType == null) - { - error = new Reporting.Error( - "Expected a string, " + - $"but the conversion failed from {modelTypeValue}"); - return null; - } - - switch (modelType) - { - case "AnnotatedRelationshipElement": - return AnnotatedRelationshipElementFrom( - node, out error); - case "RelationshipElement": - return RelationshipElementFrom( - node, out error); - default: - error = new Reporting.Error( - $"Unexpected model type for IRelationshipElement: {modelType}"); - return null; - } - } // public static Aas.IRelationshipElement IRelationshipElementFrom - - /// - /// Deserialize an instance of RelationshipElement from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.RelationshipElement? RelationshipElementFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - IReference? theFirst = null; - IReference? theSecond = null; - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "first": - { - if (keyValue.Value == null) - { - continue; - } - - theFirst = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "first")); - return null; - } - if (theFirst == null) - { - throw new System.InvalidOperationException( - "Unexpected theFirst null when error is also null"); - } - break; - } - case "second": - { - if (keyValue.Value == null) - { - continue; - } - - theSecond = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "second")); - return null; - } - if (theSecond == null) - { - throw new System.InvalidOperationException( - "Unexpected theSecond null when error is also null"); - } - break; - } - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theFirst == null) - { - error = new Reporting.Error( - "Required property \"first\" is missing"); - return null; - } - - if (theSecond == null) - { - error = new Reporting.Error( - "Required property \"second\" is missing"); - return null; - } - - return new Aas.RelationshipElement( - theFirst - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theSecond - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications); - } // internal static RelationshipElementFrom - - /// - /// Deserialize the enumeration AasSubmodelElements from the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.AasSubmodelElements? AasSubmodelElementsFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - string? text = DeserializeImplementation.StringFrom( - node, out error); - if (error != null) - { - return null; - } - if (text == null) - { - throw new System.InvalidOperationException( - "Unexpected text null if error null"); - } - Aas.AasSubmodelElements? result = Stringification.AasSubmodelElementsFromString(text); - if (result == null) - { - error = new Reporting.Error( - "Not a valid JSON representation of AasSubmodelElements"); - } - return result; - } // internal static AasSubmodelElementsFrom - - /// - /// Deserialize an instance of SubmodelElementList from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.SubmodelElementList? SubmodelElementListFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - AasSubmodelElements? theTypeValueListElement = null; - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - bool? theOrderRelevant = null; - IReference? theSemanticIdListElement = null; - DataTypeDefXsd? theValueTypeListElement = null; - List? theValue = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "typeValueListElement": - { - if (keyValue.Value == null) - { - continue; - } - - theTypeValueListElement = DeserializeImplementation.AasSubmodelElementsFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "typeValueListElement")); - return null; - } - if (theTypeValueListElement == null) - { - throw new System.InvalidOperationException( - "Unexpected theTypeValueListElement null when error is also null"); - } - break; - } - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "orderRelevant": - { - if (keyValue.Value == null) - { - continue; - } - - theOrderRelevant = DeserializeImplementation.BoolFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "orderRelevant")); - return null; - } - if (theOrderRelevant == null) - { - throw new System.InvalidOperationException( - "Unexpected theOrderRelevant null when error is also null"); - } - break; - } - case "semanticIdListElement": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticIdListElement = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticIdListElement")); - return null; - } - if (theSemanticIdListElement == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticIdListElement null when error is also null"); - } - break; - } - case "valueTypeListElement": - { - if (keyValue.Value == null) - { - continue; - } - - theValueTypeListElement = DeserializeImplementation.DataTypeDefXsdFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueTypeListElement")); - return null; - } - if (theValueTypeListElement == null) - { - throw new System.InvalidOperationException( - "Unexpected theValueTypeListElement null when error is also null"); - } - break; - } - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayValue = keyValue.Value as Nodes.JsonArray; - if (arrayValue == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - theValue = new List( - arrayValue.Count); - int indexValue = 0; - foreach (Nodes.JsonNode? item in arrayValue) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexValue)); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - ISubmodelElement? parsedItem = DeserializeImplementation.ISubmodelElementFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexValue)); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - theValue.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexValue++; - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theTypeValueListElement == null) - { - error = new Reporting.Error( - "Required property \"typeValueListElement\" is missing"); - return null; - } - - return new Aas.SubmodelElementList( - theTypeValueListElement - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theOrderRelevant, - theSemanticIdListElement, - theValueTypeListElement, - theValue); - } // internal static SubmodelElementListFrom - - /// - /// Deserialize an instance of SubmodelElementCollection from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.SubmodelElementCollection? SubmodelElementCollectionFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - List? theValue = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayValue = keyValue.Value as Nodes.JsonArray; - if (arrayValue == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - theValue = new List( - arrayValue.Count); - int indexValue = 0; - foreach (Nodes.JsonNode? item in arrayValue) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexValue)); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - ISubmodelElement? parsedItem = DeserializeImplementation.ISubmodelElementFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexValue)); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - theValue.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexValue++; - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - - - return new Aas.SubmodelElementCollection( - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue); - } // internal static SubmodelElementCollectionFrom - - /// - /// Deserialize an instance of IDataElement by dispatching - /// based on modelType property of the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IDataElement? IDataElementFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - var obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - "Expected Nodes.JsonObject, but got {node.GetType()}"); - return null; - } - - Nodes.JsonNode? modelTypeNode = obj["modelType"]; - if (modelTypeNode == null) - { - error = new Reporting.Error( - "Expected a model type, but none is present"); - return null; - } - Nodes.JsonValue? modelTypeValue = modelTypeNode as Nodes.JsonValue; - if (modelTypeValue == null) - { - error = new Reporting.Error( - "Expected JsonValue, " + - $"but got {modelTypeNode.GetType()}"); - return null; - } - modelTypeValue.TryGetValue(out string? modelType); - if (modelType == null) - { - error = new Reporting.Error( - "Expected a string, " + - $"but the conversion failed from {modelTypeValue}"); - return null; - } - - switch (modelType) - { - case "Blob": - return BlobFrom( - node, out error); - case "File": - return FileFrom( - node, out error); - case "MultiLanguageProperty": - return MultiLanguagePropertyFrom( - node, out error); - case "Property": - return PropertyFrom( - node, out error); - case "Range": - return RangeFrom( - node, out error); - case "ReferenceElement": - return ReferenceElementFrom( - node, out error); - default: - error = new Reporting.Error( - $"Unexpected model type for IDataElement: {modelType}"); - return null; - } - } // public static Aas.IDataElement IDataElementFrom - - /// - /// Deserialize an instance of Property from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Property? PropertyFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - DataTypeDefXsd? theValueType = null; - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - string? theValue = null; - IReference? theValueId = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "valueType": - { - if (keyValue.Value == null) - { - continue; - } - - theValueType = DeserializeImplementation.DataTypeDefXsdFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - if (theValueType == null) - { - throw new System.InvalidOperationException( - "Unexpected theValueType null when error is also null"); - } - break; - } - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - theValue = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - if (theValue == null) - { - throw new System.InvalidOperationException( - "Unexpected theValue null when error is also null"); - } - break; - } - case "valueId": - { - if (keyValue.Value == null) - { - continue; - } - - theValueId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueId")); - return null; - } - if (theValueId == null) - { - throw new System.InvalidOperationException( - "Unexpected theValueId null when error is also null"); - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theValueType == null) - { - error = new Reporting.Error( - "Required property \"valueType\" is missing"); - return null; - } - - return new Aas.Property( - theValueType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue, - theValueId); - } // internal static PropertyFrom - - /// - /// Deserialize an instance of MultiLanguageProperty from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.MultiLanguageProperty? MultiLanguagePropertyFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - List? theValue = null; - IReference? theValueId = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayValue = keyValue.Value as Nodes.JsonArray; - if (arrayValue == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - theValue = new List( - arrayValue.Count); - int indexValue = 0; - foreach (Nodes.JsonNode? item in arrayValue) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexValue)); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexValue)); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - theValue.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexValue++; - } - break; - } - case "valueId": - { - if (keyValue.Value == null) - { - continue; - } - - theValueId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueId")); - return null; - } - if (theValueId == null) - { - throw new System.InvalidOperationException( - "Unexpected theValueId null when error is also null"); - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - - - return new Aas.MultiLanguageProperty( - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue, - theValueId); - } // internal static MultiLanguagePropertyFrom - - /// - /// Deserialize an instance of Range from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Range? RangeFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - DataTypeDefXsd? theValueType = null; - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - string? theMin = null; - string? theMax = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "valueType": - { - if (keyValue.Value == null) - { - continue; - } - - theValueType = DeserializeImplementation.DataTypeDefXsdFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - if (theValueType == null) - { - throw new System.InvalidOperationException( - "Unexpected theValueType null when error is also null"); - } - break; - } - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "min": - { - if (keyValue.Value == null) - { - continue; - } - - theMin = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "min")); - return null; - } - if (theMin == null) - { - throw new System.InvalidOperationException( - "Unexpected theMin null when error is also null"); - } - break; - } - case "max": - { - if (keyValue.Value == null) - { - continue; - } - - theMax = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "max")); - return null; - } - if (theMax == null) - { - throw new System.InvalidOperationException( - "Unexpected theMax null when error is also null"); - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theValueType == null) - { - error = new Reporting.Error( - "Required property \"valueType\" is missing"); - return null; - } - - return new Aas.Range( - theValueType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theMin, - theMax); - } // internal static RangeFrom - - /// - /// Deserialize an instance of ReferenceElement from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.ReferenceElement? ReferenceElementFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - IReference? theValue = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - theValue = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - if (theValue == null) - { - throw new System.InvalidOperationException( - "Unexpected theValue null when error is also null"); - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - - - return new Aas.ReferenceElement( - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue); - } // internal static ReferenceElementFrom - - /// - /// Deserialize an instance of Blob from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Blob? BlobFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theContentType = null; - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - byte[]? theValue = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "contentType": - { - if (keyValue.Value == null) - { - continue; - } - - theContentType = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "contentType")); - return null; - } - if (theContentType == null) - { - throw new System.InvalidOperationException( - "Unexpected theContentType null when error is also null"); - } - break; - } - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - theValue = DeserializeImplementation.BytesFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - if (theValue == null) - { - throw new System.InvalidOperationException( - "Unexpected theValue null when error is also null"); - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theContentType == null) - { - error = new Reporting.Error( - "Required property \"contentType\" is missing"); - return null; - } - - return new Aas.Blob( - theContentType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue); - } // internal static BlobFrom - - /// - /// Deserialize an instance of File from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.File? FileFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theContentType = null; - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - string? theValue = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "contentType": - { - if (keyValue.Value == null) - { - continue; - } - - theContentType = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "contentType")); - return null; - } - if (theContentType == null) - { - throw new System.InvalidOperationException( - "Unexpected theContentType null when error is also null"); - } - break; - } - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - theValue = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - if (theValue == null) - { - throw new System.InvalidOperationException( - "Unexpected theValue null when error is also null"); - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theContentType == null) - { - error = new Reporting.Error( - "Required property \"contentType\" is missing"); - return null; - } - - return new Aas.File( - theContentType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue); - } // internal static FileFrom - - /// - /// Deserialize an instance of AnnotatedRelationshipElement from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.AnnotatedRelationshipElement? AnnotatedRelationshipElementFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - IReference? theFirst = null; - IReference? theSecond = null; - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - List? theAnnotations = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "first": - { - if (keyValue.Value == null) - { - continue; - } - - theFirst = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "first")); - return null; - } - if (theFirst == null) - { - throw new System.InvalidOperationException( - "Unexpected theFirst null when error is also null"); - } - break; - } - case "second": - { - if (keyValue.Value == null) - { - continue; - } - - theSecond = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "second")); - return null; - } - if (theSecond == null) - { - throw new System.InvalidOperationException( - "Unexpected theSecond null when error is also null"); - } - break; - } - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "annotations": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayAnnotations = keyValue.Value as Nodes.JsonArray; - if (arrayAnnotations == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "annotations")); - return null; - } - theAnnotations = new List( - arrayAnnotations.Count); - int indexAnnotations = 0; - foreach (Nodes.JsonNode? item in arrayAnnotations) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexAnnotations)); - error.PrependSegment( - new Reporting.NameSegment( - "annotations")); - return null; - } - IDataElement? parsedItem = DeserializeImplementation.IDataElementFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexAnnotations)); - error.PrependSegment( - new Reporting.NameSegment( - "annotations")); - return null; - } - theAnnotations.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexAnnotations++; - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theFirst == null) - { - error = new Reporting.Error( - "Required property \"first\" is missing"); - return null; - } - - if (theSecond == null) - { - error = new Reporting.Error( - "Required property \"second\" is missing"); - return null; - } - - return new Aas.AnnotatedRelationshipElement( - theFirst - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theSecond - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theAnnotations); - } // internal static AnnotatedRelationshipElementFrom - - /// - /// Deserialize an instance of Entity from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Entity? EntityFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - EntityType? theEntityType = null; - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - List? theStatements = null; - string? theGlobalAssetId = null; - List? theSpecificAssetIds = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "entityType": - { - if (keyValue.Value == null) - { - continue; - } - - theEntityType = DeserializeImplementation.EntityTypeFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "entityType")); - return null; - } - if (theEntityType == null) - { - throw new System.InvalidOperationException( - "Unexpected theEntityType null when error is also null"); - } - break; - } - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "statements": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayStatements = keyValue.Value as Nodes.JsonArray; - if (arrayStatements == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "statements")); - return null; - } - theStatements = new List( - arrayStatements.Count); - int indexStatements = 0; - foreach (Nodes.JsonNode? item in arrayStatements) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexStatements)); - error.PrependSegment( - new Reporting.NameSegment( - "statements")); - return null; - } - ISubmodelElement? parsedItem = DeserializeImplementation.ISubmodelElementFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexStatements)); - error.PrependSegment( - new Reporting.NameSegment( - "statements")); - return null; - } - theStatements.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexStatements++; - } - break; - } - case "globalAssetId": - { - if (keyValue.Value == null) - { - continue; - } - - theGlobalAssetId = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "globalAssetId")); - return null; - } - if (theGlobalAssetId == null) - { - throw new System.InvalidOperationException( - "Unexpected theGlobalAssetId null when error is also null"); - } - break; - } - case "specificAssetIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySpecificAssetIds = keyValue.Value as Nodes.JsonArray; - if (arraySpecificAssetIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "specificAssetIds")); - return null; - } - theSpecificAssetIds = new List( - arraySpecificAssetIds.Count); - int indexSpecificAssetIds = 0; - foreach (Nodes.JsonNode? item in arraySpecificAssetIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSpecificAssetIds)); - error.PrependSegment( - new Reporting.NameSegment( - "specificAssetIds")); - return null; - } - ISpecificAssetId? parsedItem = DeserializeImplementation.SpecificAssetIdFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSpecificAssetIds)); - error.PrependSegment( - new Reporting.NameSegment( - "specificAssetIds")); - return null; - } - theSpecificAssetIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSpecificAssetIds++; - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theEntityType == null) - { - error = new Reporting.Error( - "Required property \"entityType\" is missing"); - return null; - } - - return new Aas.Entity( - theEntityType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theStatements, - theGlobalAssetId, - theSpecificAssetIds); - } // internal static EntityFrom - - /// - /// Deserialize the enumeration EntityType from the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.EntityType? EntityTypeFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - string? text = DeserializeImplementation.StringFrom( - node, out error); - if (error != null) - { - return null; - } - if (text == null) - { - throw new System.InvalidOperationException( - "Unexpected text null if error null"); - } - Aas.EntityType? result = Stringification.EntityTypeFromString(text); - if (result == null) - { - error = new Reporting.Error( - "Not a valid JSON representation of EntityType"); - } - return result; - } // internal static EntityTypeFrom - - /// - /// Deserialize the enumeration Direction from the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Direction? DirectionFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - string? text = DeserializeImplementation.StringFrom( - node, out error); - if (error != null) - { - return null; - } - if (text == null) - { - throw new System.InvalidOperationException( - "Unexpected text null if error null"); - } - Aas.Direction? result = Stringification.DirectionFromString(text); - if (result == null) - { - error = new Reporting.Error( - "Not a valid JSON representation of Direction"); - } - return result; - } // internal static DirectionFrom - - /// - /// Deserialize the enumeration StateOfEvent from the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.StateOfEvent? StateOfEventFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - string? text = DeserializeImplementation.StringFrom( - node, out error); - if (error != null) - { - return null; - } - if (text == null) - { - throw new System.InvalidOperationException( - "Unexpected text null if error null"); - } - Aas.StateOfEvent? result = Stringification.StateOfEventFromString(text); - if (result == null) - { - error = new Reporting.Error( - "Not a valid JSON representation of StateOfEvent"); - } - return result; - } // internal static StateOfEventFrom - - /// - /// Deserialize an instance of EventPayload from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.EventPayload? EventPayloadFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - IReference? theSource = null; - IReference? theObservableReference = null; - string? theTimeStamp = null; - IReference? theSourceSemanticId = null; - IReference? theObservableSemanticId = null; - string? theTopic = null; - IReference? theSubjectId = null; - byte[]? thePayload = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "source": - { - if (keyValue.Value == null) - { - continue; - } - - theSource = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "source")); - return null; - } - if (theSource == null) - { - throw new System.InvalidOperationException( - "Unexpected theSource null when error is also null"); - } - break; - } - case "observableReference": - { - if (keyValue.Value == null) - { - continue; - } - - theObservableReference = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "observableReference")); - return null; - } - if (theObservableReference == null) - { - throw new System.InvalidOperationException( - "Unexpected theObservableReference null when error is also null"); - } - break; - } - case "timeStamp": - { - if (keyValue.Value == null) - { - continue; - } - - theTimeStamp = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "timeStamp")); - return null; - } - if (theTimeStamp == null) - { - throw new System.InvalidOperationException( - "Unexpected theTimeStamp null when error is also null"); - } - break; - } - case "sourceSemanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSourceSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "sourceSemanticId")); - return null; - } - if (theSourceSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSourceSemanticId null when error is also null"); - } - break; - } - case "observableSemanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theObservableSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "observableSemanticId")); - return null; - } - if (theObservableSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theObservableSemanticId null when error is also null"); - } - break; - } - case "topic": - { - if (keyValue.Value == null) - { - continue; - } - - theTopic = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "topic")); - return null; - } - if (theTopic == null) - { - throw new System.InvalidOperationException( - "Unexpected theTopic null when error is also null"); - } - break; - } - case "subjectId": - { - if (keyValue.Value == null) - { - continue; - } - - theSubjectId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "subjectId")); - return null; - } - if (theSubjectId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSubjectId null when error is also null"); - } - break; - } - case "payload": - { - if (keyValue.Value == null) - { - continue; - } - - thePayload = DeserializeImplementation.BytesFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "payload")); - return null; - } - if (thePayload == null) - { - throw new System.InvalidOperationException( - "Unexpected thePayload null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theSource == null) - { - error = new Reporting.Error( - "Required property \"source\" is missing"); - return null; - } - - if (theObservableReference == null) - { - error = new Reporting.Error( - "Required property \"observableReference\" is missing"); - return null; - } - - if (theTimeStamp == null) - { - error = new Reporting.Error( - "Required property \"timeStamp\" is missing"); - return null; - } - - return new Aas.EventPayload( - theSource - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theObservableReference - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theTimeStamp - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theSourceSemanticId, - theObservableSemanticId, - theTopic, - theSubjectId, - thePayload); - } // internal static EventPayloadFrom - - /// - /// Deserialize an instance of IEventElement by dispatching - /// based on modelType property of the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IEventElement? IEventElementFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - var obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - "Expected Nodes.JsonObject, but got {node.GetType()}"); - return null; - } - - Nodes.JsonNode? modelTypeNode = obj["modelType"]; - if (modelTypeNode == null) - { - error = new Reporting.Error( - "Expected a model type, but none is present"); - return null; - } - Nodes.JsonValue? modelTypeValue = modelTypeNode as Nodes.JsonValue; - if (modelTypeValue == null) - { - error = new Reporting.Error( - "Expected JsonValue, " + - $"but got {modelTypeNode.GetType()}"); - return null; - } - modelTypeValue.TryGetValue(out string? modelType); - if (modelType == null) - { - error = new Reporting.Error( - "Expected a string, " + - $"but the conversion failed from {modelTypeValue}"); - return null; - } - - switch (modelType) - { - case "BasicEventElement": - return BasicEventElementFrom( - node, out error); - default: - error = new Reporting.Error( - $"Unexpected model type for IEventElement: {modelType}"); - return null; - } - } // public static Aas.IEventElement IEventElementFrom - - /// - /// Deserialize an instance of BasicEventElement from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.BasicEventElement? BasicEventElementFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - IReference? theObserved = null; - Direction? theDirection = null; - StateOfEvent? theState = null; - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - string? theMessageTopic = null; - IReference? theMessageBroker = null; - string? theLastUpdate = null; - string? theMinInterval = null; - string? theMaxInterval = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "observed": - { - if (keyValue.Value == null) - { - continue; - } - - theObserved = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "observed")); - return null; - } - if (theObserved == null) - { - throw new System.InvalidOperationException( - "Unexpected theObserved null when error is also null"); - } - break; - } - case "direction": - { - if (keyValue.Value == null) - { - continue; - } - - theDirection = DeserializeImplementation.DirectionFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "direction")); - return null; - } - if (theDirection == null) - { - throw new System.InvalidOperationException( - "Unexpected theDirection null when error is also null"); - } - break; - } - case "state": - { - if (keyValue.Value == null) - { - continue; - } - - theState = DeserializeImplementation.StateOfEventFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "state")); - return null; - } - if (theState == null) - { - throw new System.InvalidOperationException( - "Unexpected theState null when error is also null"); - } - break; - } - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "messageTopic": - { - if (keyValue.Value == null) - { - continue; - } - - theMessageTopic = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "messageTopic")); - return null; - } - if (theMessageTopic == null) - { - throw new System.InvalidOperationException( - "Unexpected theMessageTopic null when error is also null"); - } - break; - } - case "messageBroker": - { - if (keyValue.Value == null) - { - continue; - } - - theMessageBroker = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "messageBroker")); - return null; - } - if (theMessageBroker == null) - { - throw new System.InvalidOperationException( - "Unexpected theMessageBroker null when error is also null"); - } - break; - } - case "lastUpdate": - { - if (keyValue.Value == null) - { - continue; - } - - theLastUpdate = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "lastUpdate")); - return null; - } - if (theLastUpdate == null) - { - throw new System.InvalidOperationException( - "Unexpected theLastUpdate null when error is also null"); - } - break; - } - case "minInterval": - { - if (keyValue.Value == null) - { - continue; - } - - theMinInterval = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "minInterval")); - return null; - } - if (theMinInterval == null) - { - throw new System.InvalidOperationException( - "Unexpected theMinInterval null when error is also null"); - } - break; - } - case "maxInterval": - { - if (keyValue.Value == null) - { - continue; - } - - theMaxInterval = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "maxInterval")); - return null; - } - if (theMaxInterval == null) - { - throw new System.InvalidOperationException( - "Unexpected theMaxInterval null when error is also null"); - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theObserved == null) - { - error = new Reporting.Error( - "Required property \"observed\" is missing"); - return null; - } - - if (theDirection == null) - { - error = new Reporting.Error( - "Required property \"direction\" is missing"); - return null; - } - - if (theState == null) - { - error = new Reporting.Error( - "Required property \"state\" is missing"); - return null; - } - - return new Aas.BasicEventElement( - theObserved - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theDirection - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theState - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theMessageTopic, - theMessageBroker, - theLastUpdate, - theMinInterval, - theMaxInterval); - } // internal static BasicEventElementFrom - - /// - /// Deserialize an instance of Operation from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Operation? OperationFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - List? theInputVariables = null; - List? theOutputVariables = null; - List? theInoutputVariables = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "inputVariables": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayInputVariables = keyValue.Value as Nodes.JsonArray; - if (arrayInputVariables == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "inputVariables")); - return null; - } - theInputVariables = new List( - arrayInputVariables.Count); - int indexInputVariables = 0; - foreach (Nodes.JsonNode? item in arrayInputVariables) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexInputVariables)); - error.PrependSegment( - new Reporting.NameSegment( - "inputVariables")); - return null; - } - IOperationVariable? parsedItem = DeserializeImplementation.OperationVariableFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexInputVariables)); - error.PrependSegment( - new Reporting.NameSegment( - "inputVariables")); - return null; - } - theInputVariables.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexInputVariables++; - } - break; - } - case "outputVariables": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayOutputVariables = keyValue.Value as Nodes.JsonArray; - if (arrayOutputVariables == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "outputVariables")); - return null; - } - theOutputVariables = new List( - arrayOutputVariables.Count); - int indexOutputVariables = 0; - foreach (Nodes.JsonNode? item in arrayOutputVariables) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexOutputVariables)); - error.PrependSegment( - new Reporting.NameSegment( - "outputVariables")); - return null; - } - IOperationVariable? parsedItem = DeserializeImplementation.OperationVariableFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexOutputVariables)); - error.PrependSegment( - new Reporting.NameSegment( - "outputVariables")); - return null; - } - theOutputVariables.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexOutputVariables++; - } - break; - } - case "inoutputVariables": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayInoutputVariables = keyValue.Value as Nodes.JsonArray; - if (arrayInoutputVariables == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "inoutputVariables")); - return null; - } - theInoutputVariables = new List( - arrayInoutputVariables.Count); - int indexInoutputVariables = 0; - foreach (Nodes.JsonNode? item in arrayInoutputVariables) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexInoutputVariables)); - error.PrependSegment( - new Reporting.NameSegment( - "inoutputVariables")); - return null; - } - IOperationVariable? parsedItem = DeserializeImplementation.OperationVariableFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexInoutputVariables)); - error.PrependSegment( - new Reporting.NameSegment( - "inoutputVariables")); - return null; - } - theInoutputVariables.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexInoutputVariables++; - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - - - return new Aas.Operation( - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theInputVariables, - theOutputVariables, - theInoutputVariables); - } // internal static OperationFrom - - /// - /// Deserialize an instance of OperationVariable from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.OperationVariable? OperationVariableFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - ISubmodelElement? theValue = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - theValue = DeserializeImplementation.ISubmodelElementFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - if (theValue == null) - { - throw new System.InvalidOperationException( - "Unexpected theValue null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theValue == null) - { - error = new Reporting.Error( - "Required property \"value\" is missing"); - return null; - } - - return new Aas.OperationVariable( - theValue - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static OperationVariableFrom - - /// - /// Deserialize an instance of Capability from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Capability? CapabilityFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "semanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - if (theSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theSemanticId null when error is also null"); - } - break; - } - case "supplementalSemanticIds": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySupplementalSemanticIds = keyValue.Value as Nodes.JsonArray; - if (arraySupplementalSemanticIds == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds = new List( - arraySupplementalSemanticIds.Count); - int indexSupplementalSemanticIds = 0; - foreach (Nodes.JsonNode? item in arraySupplementalSemanticIds) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - theSupplementalSemanticIds.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSupplementalSemanticIds++; - } - break; - } - case "qualifiers": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayQualifiers = keyValue.Value as Nodes.JsonArray; - if (arrayQualifiers == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers = new List( - arrayQualifiers.Count); - int indexQualifiers = 0; - foreach (Nodes.JsonNode? item in arrayQualifiers) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - IQualifier? parsedItem = DeserializeImplementation.QualifierFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - theQualifiers.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexQualifiers++; - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - - - return new Aas.Capability( - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications); - } // internal static CapabilityFrom - - /// - /// Deserialize an instance of ConceptDescription from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.ConceptDescription? ConceptDescriptionFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theId = null; - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IAdministrativeInformation? theAdministration = null; - List? theEmbeddedDataSpecifications = null; - List? theIsCaseOf = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "id": - { - if (keyValue.Value == null) - { - continue; - } - - theId = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "id")); - return null; - } - if (theId == null) - { - throw new System.InvalidOperationException( - "Unexpected theId null when error is also null"); - } - break; - } - case "extensions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayExtensions = keyValue.Value as Nodes.JsonArray; - if (arrayExtensions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions = new List( - arrayExtensions.Count); - int indexExtensions = 0; - foreach (Nodes.JsonNode? item in arrayExtensions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - IExtension? parsedItem = DeserializeImplementation.ExtensionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - theExtensions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexExtensions++; - } - break; - } - case "category": - { - if (keyValue.Value == null) - { - continue; - } - - theCategory = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - if (theCategory == null) - { - throw new System.InvalidOperationException( - "Unexpected theCategory null when error is also null"); - } - break; - } - case "idShort": - { - if (keyValue.Value == null) - { - continue; - } - - theIdShort = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - if (theIdShort == null) - { - throw new System.InvalidOperationException( - "Unexpected theIdShort null when error is also null"); - } - break; - } - case "displayName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDisplayName = keyValue.Value as Nodes.JsonArray; - if (arrayDisplayName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName = new List( - arrayDisplayName.Count); - int indexDisplayName = 0; - foreach (Nodes.JsonNode? item in arrayDisplayName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - ILangStringNameType? parsedItem = DeserializeImplementation.LangStringNameTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - theDisplayName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDisplayName++; - } - break; - } - case "description": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDescription = keyValue.Value as Nodes.JsonArray; - if (arrayDescription == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription = new List( - arrayDescription.Count); - int indexDescription = 0; - foreach (Nodes.JsonNode? item in arrayDescription) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - ILangStringTextType? parsedItem = DeserializeImplementation.LangStringTextTypeFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - theDescription.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDescription++; - } - break; - } - case "administration": - { - if (keyValue.Value == null) - { - continue; - } - - theAdministration = DeserializeImplementation.AdministrativeInformationFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "administration")); - return null; - } - if (theAdministration == null) - { - throw new System.InvalidOperationException( - "Unexpected theAdministration null when error is also null"); - } - break; - } - case "embeddedDataSpecifications": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayEmbeddedDataSpecifications = keyValue.Value as Nodes.JsonArray; - if (arrayEmbeddedDataSpecifications == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications = new List( - arrayEmbeddedDataSpecifications.Count); - int indexEmbeddedDataSpecifications = 0; - foreach (Nodes.JsonNode? item in arrayEmbeddedDataSpecifications) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - IEmbeddedDataSpecification? parsedItem = DeserializeImplementation.EmbeddedDataSpecificationFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - theEmbeddedDataSpecifications.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexEmbeddedDataSpecifications++; - } - break; - } - case "isCaseOf": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayIsCaseOf = keyValue.Value as Nodes.JsonArray; - if (arrayIsCaseOf == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "isCaseOf")); - return null; - } - theIsCaseOf = new List( - arrayIsCaseOf.Count); - int indexIsCaseOf = 0; - foreach (Nodes.JsonNode? item in arrayIsCaseOf) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexIsCaseOf)); - error.PrependSegment( - new Reporting.NameSegment( - "isCaseOf")); - return null; - } - IReference? parsedItem = DeserializeImplementation.ReferenceFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexIsCaseOf)); - error.PrependSegment( - new Reporting.NameSegment( - "isCaseOf")); - return null; - } - theIsCaseOf.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexIsCaseOf++; - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theId == null) - { - error = new Reporting.Error( - "Required property \"id\" is missing"); - return null; - } - - return new Aas.ConceptDescription( - theId - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theAdministration, - theEmbeddedDataSpecifications, - theIsCaseOf); - } // internal static ConceptDescriptionFrom - - /// - /// Deserialize the enumeration ReferenceTypes from the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.ReferenceTypes? ReferenceTypesFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - string? text = DeserializeImplementation.StringFrom( - node, out error); - if (error != null) - { - return null; - } - if (text == null) - { - throw new System.InvalidOperationException( - "Unexpected text null if error null"); - } - Aas.ReferenceTypes? result = Stringification.ReferenceTypesFromString(text); - if (result == null) - { - error = new Reporting.Error( - "Not a valid JSON representation of ReferenceTypes"); - } - return result; - } // internal static ReferenceTypesFrom - - /// - /// Deserialize an instance of Reference from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Reference? ReferenceFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - ReferenceTypes? theType = null; - List? theKeys = null; - IReference? theReferredSemanticId = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "type": - { - if (keyValue.Value == null) - { - continue; - } - - theType = DeserializeImplementation.ReferenceTypesFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "type")); - return null; - } - if (theType == null) - { - throw new System.InvalidOperationException( - "Unexpected theType null when error is also null"); - } - break; - } - case "keys": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayKeys = keyValue.Value as Nodes.JsonArray; - if (arrayKeys == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "keys")); - return null; - } - theKeys = new List( - arrayKeys.Count); - int indexKeys = 0; - foreach (Nodes.JsonNode? item in arrayKeys) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexKeys)); - error.PrependSegment( - new Reporting.NameSegment( - "keys")); - return null; - } - IKey? parsedItem = DeserializeImplementation.KeyFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexKeys)); - error.PrependSegment( - new Reporting.NameSegment( - "keys")); - return null; - } - theKeys.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexKeys++; - } - break; - } - case "referredSemanticId": - { - if (keyValue.Value == null) - { - continue; - } - - theReferredSemanticId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "referredSemanticId")); - return null; - } - if (theReferredSemanticId == null) - { - throw new System.InvalidOperationException( - "Unexpected theReferredSemanticId null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theType == null) - { - error = new Reporting.Error( - "Required property \"type\" is missing"); - return null; - } - - if (theKeys == null) - { - error = new Reporting.Error( - "Required property \"keys\" is missing"); - return null; - } - - return new Aas.Reference( - theType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theKeys - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theReferredSemanticId); - } // internal static ReferenceFrom - - /// - /// Deserialize an instance of Key from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Key? KeyFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - KeyTypes? theType = null; - string? theValue = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "type": - { - if (keyValue.Value == null) - { - continue; - } - - theType = DeserializeImplementation.KeyTypesFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "type")); - return null; - } - if (theType == null) - { - throw new System.InvalidOperationException( - "Unexpected theType null when error is also null"); - } - break; - } - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - theValue = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - if (theValue == null) - { - throw new System.InvalidOperationException( - "Unexpected theValue null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theType == null) - { - error = new Reporting.Error( - "Required property \"type\" is missing"); - return null; - } - - if (theValue == null) - { - error = new Reporting.Error( - "Required property \"value\" is missing"); - return null; - } - - return new Aas.Key( - theType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theValue - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static KeyFrom - - /// - /// Deserialize the enumeration KeyTypes from the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.KeyTypes? KeyTypesFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - string? text = DeserializeImplementation.StringFrom( - node, out error); - if (error != null) - { - return null; - } - if (text == null) - { - throw new System.InvalidOperationException( - "Unexpected text null if error null"); - } - Aas.KeyTypes? result = Stringification.KeyTypesFromString(text); - if (result == null) - { - error = new Reporting.Error( - "Not a valid JSON representation of KeyTypes"); - } - return result; - } // internal static KeyTypesFrom - - /// - /// Deserialize the enumeration DataTypeDefXsd from the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.DataTypeDefXsd? DataTypeDefXsdFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - string? text = DeserializeImplementation.StringFrom( - node, out error); - if (error != null) - { - return null; - } - if (text == null) - { - throw new System.InvalidOperationException( - "Unexpected text null if error null"); - } - Aas.DataTypeDefXsd? result = Stringification.DataTypeDefXsdFromString(text); - if (result == null) - { - error = new Reporting.Error( - "Not a valid JSON representation of DataTypeDefXsd"); - } - return result; - } // internal static DataTypeDefXsdFrom - - /// - /// Deserialize an instance of IAbstractLangString by dispatching - /// based on modelType property of the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IAbstractLangString? IAbstractLangStringFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - var obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - "Expected Nodes.JsonObject, but got {node.GetType()}"); - return null; - } - - Nodes.JsonNode? modelTypeNode = obj["modelType"]; - if (modelTypeNode == null) - { - error = new Reporting.Error( - "Expected a model type, but none is present"); - return null; - } - Nodes.JsonValue? modelTypeValue = modelTypeNode as Nodes.JsonValue; - if (modelTypeValue == null) - { - error = new Reporting.Error( - "Expected JsonValue, " + - $"but got {modelTypeNode.GetType()}"); - return null; - } - modelTypeValue.TryGetValue(out string? modelType); - if (modelType == null) - { - error = new Reporting.Error( - "Expected a string, " + - $"but the conversion failed from {modelTypeValue}"); - return null; - } - - switch (modelType) - { - case "LangStringDefinitionTypeIec61360": - return LangStringDefinitionTypeIec61360From( - node, out error); - case "LangStringNameType": - return LangStringNameTypeFrom( - node, out error); - case "LangStringPreferredNameTypeIec61360": - return LangStringPreferredNameTypeIec61360From( - node, out error); - case "LangStringShortNameTypeIec61360": - return LangStringShortNameTypeIec61360From( - node, out error); - case "LangStringTextType": - return LangStringTextTypeFrom( - node, out error); - default: - error = new Reporting.Error( - $"Unexpected model type for IAbstractLangString: {modelType}"); - return null; - } - } // public static Aas.IAbstractLangString IAbstractLangStringFrom - - /// - /// Deserialize an instance of LangStringNameType from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.LangStringNameType? LangStringNameTypeFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theLanguage = null; - string? theText = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "language": - { - if (keyValue.Value == null) - { - continue; - } - - theLanguage = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "language")); - return null; - } - if (theLanguage == null) - { - throw new System.InvalidOperationException( - "Unexpected theLanguage null when error is also null"); - } - break; - } - case "text": - { - if (keyValue.Value == null) - { - continue; - } - - theText = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "text")); - return null; - } - if (theText == null) - { - throw new System.InvalidOperationException( - "Unexpected theText null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theLanguage == null) - { - error = new Reporting.Error( - "Required property \"language\" is missing"); - return null; - } - - if (theText == null) - { - error = new Reporting.Error( - "Required property \"text\" is missing"); - return null; - } - - return new Aas.LangStringNameType( - theLanguage - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theText - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static LangStringNameTypeFrom - - /// - /// Deserialize an instance of LangStringTextType from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.LangStringTextType? LangStringTextTypeFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theLanguage = null; - string? theText = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "language": - { - if (keyValue.Value == null) - { - continue; - } - - theLanguage = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "language")); - return null; - } - if (theLanguage == null) - { - throw new System.InvalidOperationException( - "Unexpected theLanguage null when error is also null"); - } - break; - } - case "text": - { - if (keyValue.Value == null) - { - continue; - } - - theText = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "text")); - return null; - } - if (theText == null) - { - throw new System.InvalidOperationException( - "Unexpected theText null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theLanguage == null) - { - error = new Reporting.Error( - "Required property \"language\" is missing"); - return null; - } - - if (theText == null) - { - error = new Reporting.Error( - "Required property \"text\" is missing"); - return null; - } - - return new Aas.LangStringTextType( - theLanguage - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theText - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static LangStringTextTypeFrom - - /// - /// Deserialize an instance of Environment from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.Environment? EnvironmentFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - List? theAssetAdministrationShells = null; - List? theSubmodels = null; - List? theConceptDescriptions = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "assetAdministrationShells": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayAssetAdministrationShells = keyValue.Value as Nodes.JsonArray; - if (arrayAssetAdministrationShells == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "assetAdministrationShells")); - return null; - } - theAssetAdministrationShells = new List( - arrayAssetAdministrationShells.Count); - int indexAssetAdministrationShells = 0; - foreach (Nodes.JsonNode? item in arrayAssetAdministrationShells) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexAssetAdministrationShells)); - error.PrependSegment( - new Reporting.NameSegment( - "assetAdministrationShells")); - return null; - } - IAssetAdministrationShell? parsedItem = DeserializeImplementation.AssetAdministrationShellFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexAssetAdministrationShells)); - error.PrependSegment( - new Reporting.NameSegment( - "assetAdministrationShells")); - return null; - } - theAssetAdministrationShells.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexAssetAdministrationShells++; - } - break; - } - case "submodels": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arraySubmodels = keyValue.Value as Nodes.JsonArray; - if (arraySubmodels == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "submodels")); - return null; - } - theSubmodels = new List( - arraySubmodels.Count); - int indexSubmodels = 0; - foreach (Nodes.JsonNode? item in arraySubmodels) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexSubmodels)); - error.PrependSegment( - new Reporting.NameSegment( - "submodels")); - return null; - } - ISubmodel? parsedItem = DeserializeImplementation.SubmodelFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSubmodels)); - error.PrependSegment( - new Reporting.NameSegment( - "submodels")); - return null; - } - theSubmodels.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexSubmodels++; - } - break; - } - case "conceptDescriptions": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayConceptDescriptions = keyValue.Value as Nodes.JsonArray; - if (arrayConceptDescriptions == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "conceptDescriptions")); - return null; - } - theConceptDescriptions = new List( - arrayConceptDescriptions.Count); - int indexConceptDescriptions = 0; - foreach (Nodes.JsonNode? item in arrayConceptDescriptions) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexConceptDescriptions)); - error.PrependSegment( - new Reporting.NameSegment( - "conceptDescriptions")); - return null; - } - IConceptDescription? parsedItem = DeserializeImplementation.ConceptDescriptionFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexConceptDescriptions)); - error.PrependSegment( - new Reporting.NameSegment( - "conceptDescriptions")); - return null; - } - theConceptDescriptions.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexConceptDescriptions++; - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - - - return new Aas.Environment( - theAssetAdministrationShells, - theSubmodels, - theConceptDescriptions); - } // internal static EnvironmentFrom - - /// - /// Deserialize an instance of IDataSpecificationContent by dispatching - /// based on modelType property of the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IDataSpecificationContent? IDataSpecificationContentFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - var obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - "Expected Nodes.JsonObject, but got {node.GetType()}"); - return null; - } - - Nodes.JsonNode? modelTypeNode = obj["modelType"]; - if (modelTypeNode == null) - { - error = new Reporting.Error( - "Expected a model type, but none is present"); - return null; - } - Nodes.JsonValue? modelTypeValue = modelTypeNode as Nodes.JsonValue; - if (modelTypeValue == null) - { - error = new Reporting.Error( - "Expected JsonValue, " + - $"but got {modelTypeNode.GetType()}"); - return null; - } - modelTypeValue.TryGetValue(out string? modelType); - if (modelType == null) - { - error = new Reporting.Error( - "Expected a string, " + - $"but the conversion failed from {modelTypeValue}"); - return null; - } - - switch (modelType) - { - case "DataSpecificationIec61360": - return DataSpecificationIec61360From( - node, out error); - default: - error = new Reporting.Error( - $"Unexpected model type for IDataSpecificationContent: {modelType}"); - return null; - } - } // public static Aas.IDataSpecificationContent IDataSpecificationContentFrom - - /// - /// Deserialize an instance of EmbeddedDataSpecification from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.EmbeddedDataSpecification? EmbeddedDataSpecificationFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - IReference? theDataSpecification = null; - IDataSpecificationContent? theDataSpecificationContent = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "dataSpecification": - { - if (keyValue.Value == null) - { - continue; - } - - theDataSpecification = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "dataSpecification")); - return null; - } - if (theDataSpecification == null) - { - throw new System.InvalidOperationException( - "Unexpected theDataSpecification null when error is also null"); - } - break; - } - case "dataSpecificationContent": - { - if (keyValue.Value == null) - { - continue; - } - - theDataSpecificationContent = DeserializeImplementation.IDataSpecificationContentFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "dataSpecificationContent")); - return null; - } - if (theDataSpecificationContent == null) - { - throw new System.InvalidOperationException( - "Unexpected theDataSpecificationContent null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theDataSpecification == null) - { - error = new Reporting.Error( - "Required property \"dataSpecification\" is missing"); - return null; - } - - if (theDataSpecificationContent == null) - { - error = new Reporting.Error( - "Required property \"dataSpecificationContent\" is missing"); - return null; - } - - return new Aas.EmbeddedDataSpecification( - theDataSpecification - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theDataSpecificationContent - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static EmbeddedDataSpecificationFrom - - /// - /// Deserialize the enumeration DataTypeIec61360 from the . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.DataTypeIec61360? DataTypeIec61360From( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - string? text = DeserializeImplementation.StringFrom( - node, out error); - if (error != null) - { - return null; - } - if (text == null) - { - throw new System.InvalidOperationException( - "Unexpected text null if error null"); - } - Aas.DataTypeIec61360? result = Stringification.DataTypeIec61360FromString(text); - if (result == null) - { - error = new Reporting.Error( - "Not a valid JSON representation of DataTypeIec61360"); - } - return result; - } // internal static DataTypeIec61360From - - /// - /// Deserialize an instance of LevelType from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.LevelType? LevelTypeFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - bool? theMin = null; - bool? theNom = null; - bool? theTyp = null; - bool? theMax = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "min": - { - if (keyValue.Value == null) - { - continue; - } - - theMin = DeserializeImplementation.BoolFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "min")); - return null; - } - if (theMin == null) - { - throw new System.InvalidOperationException( - "Unexpected theMin null when error is also null"); - } - break; - } - case "nom": - { - if (keyValue.Value == null) - { - continue; - } - - theNom = DeserializeImplementation.BoolFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "nom")); - return null; - } - if (theNom == null) - { - throw new System.InvalidOperationException( - "Unexpected theNom null when error is also null"); - } - break; - } - case "typ": - { - if (keyValue.Value == null) - { - continue; - } - - theTyp = DeserializeImplementation.BoolFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "typ")); - return null; - } - if (theTyp == null) - { - throw new System.InvalidOperationException( - "Unexpected theTyp null when error is also null"); - } - break; - } - case "max": - { - if (keyValue.Value == null) - { - continue; - } - - theMax = DeserializeImplementation.BoolFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "max")); - return null; - } - if (theMax == null) - { - throw new System.InvalidOperationException( - "Unexpected theMax null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theMin == null) - { - error = new Reporting.Error( - "Required property \"min\" is missing"); - return null; - } - - if (theNom == null) - { - error = new Reporting.Error( - "Required property \"nom\" is missing"); - return null; - } - - if (theTyp == null) - { - error = new Reporting.Error( - "Required property \"typ\" is missing"); - return null; - } - - if (theMax == null) - { - error = new Reporting.Error( - "Required property \"max\" is missing"); - return null; - } - - return new Aas.LevelType( - theMin - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theNom - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theTyp - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theMax - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static LevelTypeFrom - - /// - /// Deserialize an instance of ValueReferencePair from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.ValueReferencePair? ValueReferencePairFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theValue = null; - IReference? theValueId = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - theValue = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - if (theValue == null) - { - throw new System.InvalidOperationException( - "Unexpected theValue null when error is also null"); - } - break; - } - case "valueId": - { - if (keyValue.Value == null) - { - continue; - } - - theValueId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueId")); - return null; - } - if (theValueId == null) - { - throw new System.InvalidOperationException( - "Unexpected theValueId null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theValue == null) - { - error = new Reporting.Error( - "Required property \"value\" is missing"); - return null; - } - - if (theValueId == null) - { - error = new Reporting.Error( - "Required property \"valueId\" is missing"); - return null; - } - - return new Aas.ValueReferencePair( - theValue - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theValueId - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static ValueReferencePairFrom - - /// - /// Deserialize an instance of ValueList from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.ValueList? ValueListFrom( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - List? theValueReferencePairs = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "valueReferencePairs": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayValueReferencePairs = keyValue.Value as Nodes.JsonArray; - if (arrayValueReferencePairs == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "valueReferencePairs")); - return null; - } - theValueReferencePairs = new List( - arrayValueReferencePairs.Count); - int indexValueReferencePairs = 0; - foreach (Nodes.JsonNode? item in arrayValueReferencePairs) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexValueReferencePairs)); - error.PrependSegment( - new Reporting.NameSegment( - "valueReferencePairs")); - return null; - } - IValueReferencePair? parsedItem = DeserializeImplementation.ValueReferencePairFrom( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexValueReferencePairs)); - error.PrependSegment( - new Reporting.NameSegment( - "valueReferencePairs")); - return null; - } - theValueReferencePairs.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexValueReferencePairs++; - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theValueReferencePairs == null) - { - error = new Reporting.Error( - "Required property \"valueReferencePairs\" is missing"); - return null; - } - - return new Aas.ValueList( - theValueReferencePairs - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static ValueListFrom - - /// - /// Deserialize an instance of LangStringPreferredNameTypeIec61360 from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.LangStringPreferredNameTypeIec61360? LangStringPreferredNameTypeIec61360From( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theLanguage = null; - string? theText = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "language": - { - if (keyValue.Value == null) - { - continue; - } - - theLanguage = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "language")); - return null; - } - if (theLanguage == null) - { - throw new System.InvalidOperationException( - "Unexpected theLanguage null when error is also null"); - } - break; - } - case "text": - { - if (keyValue.Value == null) - { - continue; - } - - theText = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "text")); - return null; - } - if (theText == null) - { - throw new System.InvalidOperationException( - "Unexpected theText null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theLanguage == null) - { - error = new Reporting.Error( - "Required property \"language\" is missing"); - return null; - } - - if (theText == null) - { - error = new Reporting.Error( - "Required property \"text\" is missing"); - return null; - } - - return new Aas.LangStringPreferredNameTypeIec61360( - theLanguage - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theText - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static LangStringPreferredNameTypeIec61360From - - /// - /// Deserialize an instance of LangStringShortNameTypeIec61360 from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.LangStringShortNameTypeIec61360? LangStringShortNameTypeIec61360From( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theLanguage = null; - string? theText = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "language": - { - if (keyValue.Value == null) - { - continue; - } - - theLanguage = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "language")); - return null; - } - if (theLanguage == null) - { - throw new System.InvalidOperationException( - "Unexpected theLanguage null when error is also null"); - } - break; - } - case "text": - { - if (keyValue.Value == null) - { - continue; - } - - theText = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "text")); - return null; - } - if (theText == null) - { - throw new System.InvalidOperationException( - "Unexpected theText null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theLanguage == null) - { - error = new Reporting.Error( - "Required property \"language\" is missing"); - return null; - } - - if (theText == null) - { - error = new Reporting.Error( - "Required property \"text\" is missing"); - return null; - } - - return new Aas.LangStringShortNameTypeIec61360( - theLanguage - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theText - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static LangStringShortNameTypeIec61360From - - /// - /// Deserialize an instance of LangStringDefinitionTypeIec61360 from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.LangStringDefinitionTypeIec61360? LangStringDefinitionTypeIec61360From( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - string? theLanguage = null; - string? theText = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "language": - { - if (keyValue.Value == null) - { - continue; - } - - theLanguage = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "language")); - return null; - } - if (theLanguage == null) - { - throw new System.InvalidOperationException( - "Unexpected theLanguage null when error is also null"); - } - break; - } - case "text": - { - if (keyValue.Value == null) - { - continue; - } - - theText = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "text")); - return null; - } - if (theText == null) - { - throw new System.InvalidOperationException( - "Unexpected theText null when error is also null"); - } - break; - } - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (theLanguage == null) - { - error = new Reporting.Error( - "Required property \"language\" is missing"); - return null; - } - - if (theText == null) - { - error = new Reporting.Error( - "Required property \"text\" is missing"); - return null; - } - - return new Aas.LangStringDefinitionTypeIec61360( - theLanguage - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theText - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static LangStringDefinitionTypeIec61360From - - /// - /// Deserialize an instance of DataSpecificationIec61360 from . - /// - /// JSON node to be parsed - /// Error, if any, during the deserialization - internal static Aas.DataSpecificationIec61360? DataSpecificationIec61360From( - Nodes.JsonNode node, - out Reporting.Error? error) - { - error = null; - - Nodes.JsonObject? obj = node as Nodes.JsonObject; - if (obj == null) - { - error = new Reporting.Error( - $"Expected a JsonObject, but got {node.GetType()}"); - return null; - } - - List? thePreferredName = null; - List? theShortName = null; - string? theUnit = null; - IReference? theUnitId = null; - string? theSourceOfDefinition = null; - string? theSymbol = null; - DataTypeIec61360? theDataType = null; - List? theDefinition = null; - string? theValueFormat = null; - IValueList? theValueList = null; - string? theValue = null; - ILevelType? theLevelType = null; - - foreach (var keyValue in obj) - { - switch (keyValue.Key) - { - case "preferredName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayPreferredName = keyValue.Value as Nodes.JsonArray; - if (arrayPreferredName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "preferredName")); - return null; - } - thePreferredName = new List( - arrayPreferredName.Count); - int indexPreferredName = 0; - foreach (Nodes.JsonNode? item in arrayPreferredName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexPreferredName)); - error.PrependSegment( - new Reporting.NameSegment( - "preferredName")); - return null; - } - ILangStringPreferredNameTypeIec61360? parsedItem = DeserializeImplementation.LangStringPreferredNameTypeIec61360From( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexPreferredName)); - error.PrependSegment( - new Reporting.NameSegment( - "preferredName")); - return null; - } - thePreferredName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexPreferredName++; - } - break; - } - case "shortName": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayShortName = keyValue.Value as Nodes.JsonArray; - if (arrayShortName == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "shortName")); - return null; - } - theShortName = new List( - arrayShortName.Count); - int indexShortName = 0; - foreach (Nodes.JsonNode? item in arrayShortName) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexShortName)); - error.PrependSegment( - new Reporting.NameSegment( - "shortName")); - return null; - } - ILangStringShortNameTypeIec61360? parsedItem = DeserializeImplementation.LangStringShortNameTypeIec61360From( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexShortName)); - error.PrependSegment( - new Reporting.NameSegment( - "shortName")); - return null; - } - theShortName.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexShortName++; - } - break; - } - case "unit": - { - if (keyValue.Value == null) - { - continue; - } - - theUnit = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "unit")); - return null; - } - if (theUnit == null) - { - throw new System.InvalidOperationException( - "Unexpected theUnit null when error is also null"); - } - break; - } - case "unitId": - { - if (keyValue.Value == null) - { - continue; - } - - theUnitId = DeserializeImplementation.ReferenceFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "unitId")); - return null; - } - if (theUnitId == null) - { - throw new System.InvalidOperationException( - "Unexpected theUnitId null when error is also null"); - } - break; - } - case "sourceOfDefinition": - { - if (keyValue.Value == null) - { - continue; - } - - theSourceOfDefinition = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "sourceOfDefinition")); - return null; - } - if (theSourceOfDefinition == null) - { - throw new System.InvalidOperationException( - "Unexpected theSourceOfDefinition null when error is also null"); - } - break; - } - case "symbol": - { - if (keyValue.Value == null) - { - continue; - } - - theSymbol = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "symbol")); - return null; - } - if (theSymbol == null) - { - throw new System.InvalidOperationException( - "Unexpected theSymbol null when error is also null"); - } - break; - } - case "dataType": - { - if (keyValue.Value == null) - { - continue; - } - - theDataType = DeserializeImplementation.DataTypeIec61360From( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "dataType")); - return null; - } - if (theDataType == null) - { - throw new System.InvalidOperationException( - "Unexpected theDataType null when error is also null"); - } - break; - } - case "definition": - { - if (keyValue.Value == null) - { - continue; - } - - Nodes.JsonArray? arrayDefinition = keyValue.Value as Nodes.JsonArray; - if (arrayDefinition == null) - { - error = new Reporting.Error( - $"Expected a JsonArray, but got {keyValue.Value.GetType()}"); - error.PrependSegment( - new Reporting.NameSegment( - "definition")); - return null; - } - theDefinition = new List( - arrayDefinition.Count); - int indexDefinition = 0; - foreach (Nodes.JsonNode? item in arrayDefinition) - { - if (item == null) - { - error = new Reporting.Error( - "Expected a non-null item, but got a null"); - error.PrependSegment( - new Reporting.IndexSegment( - indexDefinition)); - error.PrependSegment( - new Reporting.NameSegment( - "definition")); - return null; - } - ILangStringDefinitionTypeIec61360? parsedItem = DeserializeImplementation.LangStringDefinitionTypeIec61360From( - item ?? throw new System.InvalidOperationException(), - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDefinition)); - error.PrependSegment( - new Reporting.NameSegment( - "definition")); - return null; - } - theDefinition.Add( - parsedItem - ?? throw new System.InvalidOperationException( - "Unexpected result null when error is null")); - indexDefinition++; - } - break; - } - case "valueFormat": - { - if (keyValue.Value == null) - { - continue; - } - - theValueFormat = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueFormat")); - return null; - } - if (theValueFormat == null) - { - throw new System.InvalidOperationException( - "Unexpected theValueFormat null when error is also null"); - } - break; - } - case "valueList": - { - if (keyValue.Value == null) - { - continue; - } - - theValueList = DeserializeImplementation.ValueListFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueList")); - return null; - } - if (theValueList == null) - { - throw new System.InvalidOperationException( - "Unexpected theValueList null when error is also null"); - } - break; - } - case "value": - { - if (keyValue.Value == null) - { - continue; - } - - theValue = DeserializeImplementation.StringFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - if (theValue == null) - { - throw new System.InvalidOperationException( - "Unexpected theValue null when error is also null"); - } - break; - } - case "levelType": - { - if (keyValue.Value == null) - { - continue; - } - - theLevelType = DeserializeImplementation.LevelTypeFrom( - keyValue.Value, - out error); - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "levelType")); - return null; - } - if (theLevelType == null) - { - throw new System.InvalidOperationException( - "Unexpected theLevelType null when error is also null"); - } - break; - } - case "modelType": - continue; - default: - error = new Reporting.Error( - $"Unexpected property: {keyValue.Key}"); - return null; - } - } - - if (thePreferredName == null) - { - error = new Reporting.Error( - "Required property \"preferredName\" is missing"); - return null; - } - - return new Aas.DataSpecificationIec61360( - thePreferredName - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theShortName, - theUnit, - theUnitId, - theSourceOfDefinition, - theSymbol, - theDataType, - theDefinition, - theValueFormat, - theValueList, - theValue, - theLevelType); - } // internal static DataSpecificationIec61360From - } // public static class DeserializeImplementation - - /// - /// Represent a critical error during the deserialization. - /// - public class Exception : System.Exception - { - public readonly string Path; - public readonly string Cause; - public Exception(string path, string cause) - : base($"{cause} at: {path}") - { - Path = path; - Cause = cause; - } - } - - /// - /// Deserialize instances of meta-model classes from JSON nodes. - /// - /// - /// Here is an example how to parse an instance of IHasSemantics: - /// - /// string someString = "... some JSON ..."; - /// var node = System.Text.Json.Nodes.JsonNode.Parse(someString); - /// Aas.IHasSemantics anInstance = Deserialize.IHasSemanticsFrom( - /// node); - /// - /// - public static class Deserialize - { - /// - /// Deserialize an instance of IHasSemantics from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of IHasSemantics. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IHasSemantics IHasSemanticsFrom( - Nodes.JsonNode node) - { - Aas.IHasSemantics? result = DeserializeImplementation.IHasSemanticsFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Extension from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Extension. - /// - public static Aas.Extension ExtensionFrom( - Nodes.JsonNode node) - { - Aas.Extension? result = DeserializeImplementation.ExtensionFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IHasExtensions from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of IHasExtensions. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IHasExtensions IHasExtensionsFrom( - Nodes.JsonNode node) - { - Aas.IHasExtensions? result = DeserializeImplementation.IHasExtensionsFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IReferable from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of IReferable. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IReferable IReferableFrom( - Nodes.JsonNode node) - { - Aas.IReferable? result = DeserializeImplementation.IReferableFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IIdentifiable from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of IIdentifiable. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IIdentifiable IIdentifiableFrom( - Nodes.JsonNode node) - { - Aas.IIdentifiable? result = DeserializeImplementation.IIdentifiableFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of ModellingKind from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of ModellingKind. - /// - public static Aas.ModellingKind ModellingKindFrom( - Nodes.JsonNode node) - { - Aas.ModellingKind? result = DeserializeImplementation.ModellingKindFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IHasKind from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of IHasKind. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IHasKind IHasKindFrom( - Nodes.JsonNode node) - { - Aas.IHasKind? result = DeserializeImplementation.IHasKindFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IHasDataSpecification from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of IHasDataSpecification. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IHasDataSpecification IHasDataSpecificationFrom( - Nodes.JsonNode node) - { - Aas.IHasDataSpecification? result = DeserializeImplementation.IHasDataSpecificationFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of AdministrativeInformation from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of AdministrativeInformation. - /// - public static Aas.AdministrativeInformation AdministrativeInformationFrom( - Nodes.JsonNode node) - { - Aas.AdministrativeInformation? result = DeserializeImplementation.AdministrativeInformationFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IQualifiable from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of IQualifiable. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IQualifiable IQualifiableFrom( - Nodes.JsonNode node) - { - Aas.IQualifiable? result = DeserializeImplementation.IQualifiableFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of QualifierKind from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of QualifierKind. - /// - public static Aas.QualifierKind QualifierKindFrom( - Nodes.JsonNode node) - { - Aas.QualifierKind? result = DeserializeImplementation.QualifierKindFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Qualifier from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Qualifier. - /// - public static Aas.Qualifier QualifierFrom( - Nodes.JsonNode node) - { - Aas.Qualifier? result = DeserializeImplementation.QualifierFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of AssetAdministrationShell from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of AssetAdministrationShell. - /// - public static Aas.AssetAdministrationShell AssetAdministrationShellFrom( - Nodes.JsonNode node) - { - Aas.AssetAdministrationShell? result = DeserializeImplementation.AssetAdministrationShellFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of AssetInformation from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of AssetInformation. - /// - public static Aas.AssetInformation AssetInformationFrom( - Nodes.JsonNode node) - { - Aas.AssetInformation? result = DeserializeImplementation.AssetInformationFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Resource from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Resource. - /// - public static Aas.Resource ResourceFrom( - Nodes.JsonNode node) - { - Aas.Resource? result = DeserializeImplementation.ResourceFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of AssetKind from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of AssetKind. - /// - public static Aas.AssetKind AssetKindFrom( - Nodes.JsonNode node) - { - Aas.AssetKind? result = DeserializeImplementation.AssetKindFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of SpecificAssetId from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of SpecificAssetId. - /// - public static Aas.SpecificAssetId SpecificAssetIdFrom( - Nodes.JsonNode node) - { - Aas.SpecificAssetId? result = DeserializeImplementation.SpecificAssetIdFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Submodel from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Submodel. - /// - public static Aas.Submodel SubmodelFrom( - Nodes.JsonNode node) - { - Aas.Submodel? result = DeserializeImplementation.SubmodelFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of ISubmodelElement from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of ISubmodelElement. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.ISubmodelElement ISubmodelElementFrom( - Nodes.JsonNode node) - { - Aas.ISubmodelElement? result = DeserializeImplementation.ISubmodelElementFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IRelationshipElement from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of IRelationshipElement. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IRelationshipElement IRelationshipElementFrom( - Nodes.JsonNode node) - { - Aas.IRelationshipElement? result = DeserializeImplementation.IRelationshipElementFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of RelationshipElement from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of RelationshipElement. - /// - public static Aas.RelationshipElement RelationshipElementFrom( - Nodes.JsonNode node) - { - Aas.RelationshipElement? result = DeserializeImplementation.RelationshipElementFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of AasSubmodelElements from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of AasSubmodelElements. - /// - public static Aas.AasSubmodelElements AasSubmodelElementsFrom( - Nodes.JsonNode node) - { - Aas.AasSubmodelElements? result = DeserializeImplementation.AasSubmodelElementsFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of SubmodelElementList from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of SubmodelElementList. - /// - public static Aas.SubmodelElementList SubmodelElementListFrom( - Nodes.JsonNode node) - { - Aas.SubmodelElementList? result = DeserializeImplementation.SubmodelElementListFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of SubmodelElementCollection from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of SubmodelElementCollection. - /// - public static Aas.SubmodelElementCollection SubmodelElementCollectionFrom( - Nodes.JsonNode node) - { - Aas.SubmodelElementCollection? result = DeserializeImplementation.SubmodelElementCollectionFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IDataElement from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of IDataElement. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IDataElement IDataElementFrom( - Nodes.JsonNode node) - { - Aas.IDataElement? result = DeserializeImplementation.IDataElementFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Property from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Property. - /// - public static Aas.Property PropertyFrom( - Nodes.JsonNode node) - { - Aas.Property? result = DeserializeImplementation.PropertyFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of MultiLanguageProperty from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of MultiLanguageProperty. - /// - public static Aas.MultiLanguageProperty MultiLanguagePropertyFrom( - Nodes.JsonNode node) - { - Aas.MultiLanguageProperty? result = DeserializeImplementation.MultiLanguagePropertyFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Range from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Range. - /// - public static Aas.Range RangeFrom( - Nodes.JsonNode node) - { - Aas.Range? result = DeserializeImplementation.RangeFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of ReferenceElement from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of ReferenceElement. - /// - public static Aas.ReferenceElement ReferenceElementFrom( - Nodes.JsonNode node) - { - Aas.ReferenceElement? result = DeserializeImplementation.ReferenceElementFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Blob from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Blob. - /// - public static Aas.Blob BlobFrom( - Nodes.JsonNode node) - { - Aas.Blob? result = DeserializeImplementation.BlobFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of File from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of File. - /// - public static Aas.File FileFrom( - Nodes.JsonNode node) - { - Aas.File? result = DeserializeImplementation.FileFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of AnnotatedRelationshipElement from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of AnnotatedRelationshipElement. - /// - public static Aas.AnnotatedRelationshipElement AnnotatedRelationshipElementFrom( - Nodes.JsonNode node) - { - Aas.AnnotatedRelationshipElement? result = DeserializeImplementation.AnnotatedRelationshipElementFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Entity from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Entity. - /// - public static Aas.Entity EntityFrom( - Nodes.JsonNode node) - { - Aas.Entity? result = DeserializeImplementation.EntityFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of EntityType from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of EntityType. - /// - public static Aas.EntityType EntityTypeFrom( - Nodes.JsonNode node) - { - Aas.EntityType? result = DeserializeImplementation.EntityTypeFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Direction from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Direction. - /// - public static Aas.Direction DirectionFrom( - Nodes.JsonNode node) - { - Aas.Direction? result = DeserializeImplementation.DirectionFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of StateOfEvent from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of StateOfEvent. - /// - public static Aas.StateOfEvent StateOfEventFrom( - Nodes.JsonNode node) - { - Aas.StateOfEvent? result = DeserializeImplementation.StateOfEventFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of EventPayload from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of EventPayload. - /// - public static Aas.EventPayload EventPayloadFrom( - Nodes.JsonNode node) - { - Aas.EventPayload? result = DeserializeImplementation.EventPayloadFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IEventElement from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of IEventElement. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IEventElement IEventElementFrom( - Nodes.JsonNode node) - { - Aas.IEventElement? result = DeserializeImplementation.IEventElementFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of BasicEventElement from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of BasicEventElement. - /// - public static Aas.BasicEventElement BasicEventElementFrom( - Nodes.JsonNode node) - { - Aas.BasicEventElement? result = DeserializeImplementation.BasicEventElementFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Operation from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Operation. - /// - public static Aas.Operation OperationFrom( - Nodes.JsonNode node) - { - Aas.Operation? result = DeserializeImplementation.OperationFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of OperationVariable from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of OperationVariable. - /// - public static Aas.OperationVariable OperationVariableFrom( - Nodes.JsonNode node) - { - Aas.OperationVariable? result = DeserializeImplementation.OperationVariableFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Capability from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Capability. - /// - public static Aas.Capability CapabilityFrom( - Nodes.JsonNode node) - { - Aas.Capability? result = DeserializeImplementation.CapabilityFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of ConceptDescription from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of ConceptDescription. - /// - public static Aas.ConceptDescription ConceptDescriptionFrom( - Nodes.JsonNode node) - { - Aas.ConceptDescription? result = DeserializeImplementation.ConceptDescriptionFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of ReferenceTypes from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of ReferenceTypes. - /// - public static Aas.ReferenceTypes ReferenceTypesFrom( - Nodes.JsonNode node) - { - Aas.ReferenceTypes? result = DeserializeImplementation.ReferenceTypesFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Reference from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Reference. - /// - public static Aas.Reference ReferenceFrom( - Nodes.JsonNode node) - { - Aas.Reference? result = DeserializeImplementation.ReferenceFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Key from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Key. - /// - public static Aas.Key KeyFrom( - Nodes.JsonNode node) - { - Aas.Key? result = DeserializeImplementation.KeyFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of KeyTypes from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of KeyTypes. - /// - public static Aas.KeyTypes KeyTypesFrom( - Nodes.JsonNode node) - { - Aas.KeyTypes? result = DeserializeImplementation.KeyTypesFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of DataTypeDefXsd from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of DataTypeDefXsd. - /// - public static Aas.DataTypeDefXsd DataTypeDefXsdFrom( - Nodes.JsonNode node) - { - Aas.DataTypeDefXsd? result = DeserializeImplementation.DataTypeDefXsdFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IAbstractLangString from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of IAbstractLangString. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IAbstractLangString IAbstractLangStringFrom( - Nodes.JsonNode node) - { - Aas.IAbstractLangString? result = DeserializeImplementation.IAbstractLangStringFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of LangStringNameType from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of LangStringNameType. - /// - public static Aas.LangStringNameType LangStringNameTypeFrom( - Nodes.JsonNode node) - { - Aas.LangStringNameType? result = DeserializeImplementation.LangStringNameTypeFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of LangStringTextType from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of LangStringTextType. - /// - public static Aas.LangStringTextType LangStringTextTypeFrom( - Nodes.JsonNode node) - { - Aas.LangStringTextType? result = DeserializeImplementation.LangStringTextTypeFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Environment from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of Environment. - /// - public static Aas.Environment EnvironmentFrom( - Nodes.JsonNode node) - { - Aas.Environment? result = DeserializeImplementation.EnvironmentFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IDataSpecificationContent from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of IDataSpecificationContent. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IDataSpecificationContent IDataSpecificationContentFrom( - Nodes.JsonNode node) - { - Aas.IDataSpecificationContent? result = DeserializeImplementation.IDataSpecificationContentFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of EmbeddedDataSpecification from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of EmbeddedDataSpecification. - /// - public static Aas.EmbeddedDataSpecification EmbeddedDataSpecificationFrom( - Nodes.JsonNode node) - { - Aas.EmbeddedDataSpecification? result = DeserializeImplementation.EmbeddedDataSpecificationFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of DataTypeIec61360 from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of DataTypeIec61360. - /// - public static Aas.DataTypeIec61360 DataTypeIec61360From( - Nodes.JsonNode node) - { - Aas.DataTypeIec61360? result = DeserializeImplementation.DataTypeIec61360From( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of LevelType from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of LevelType. - /// - public static Aas.LevelType LevelTypeFrom( - Nodes.JsonNode node) - { - Aas.LevelType? result = DeserializeImplementation.LevelTypeFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of ValueReferencePair from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of ValueReferencePair. - /// - public static Aas.ValueReferencePair ValueReferencePairFrom( - Nodes.JsonNode node) - { - Aas.ValueReferencePair? result = DeserializeImplementation.ValueReferencePairFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of ValueList from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of ValueList. - /// - public static Aas.ValueList ValueListFrom( - Nodes.JsonNode node) - { - Aas.ValueList? result = DeserializeImplementation.ValueListFrom( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of LangStringPreferredNameTypeIec61360 from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of LangStringPreferredNameTypeIec61360. - /// - public static Aas.LangStringPreferredNameTypeIec61360 LangStringPreferredNameTypeIec61360From( - Nodes.JsonNode node) - { - Aas.LangStringPreferredNameTypeIec61360? result = DeserializeImplementation.LangStringPreferredNameTypeIec61360From( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of LangStringShortNameTypeIec61360 from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of LangStringShortNameTypeIec61360. - /// - public static Aas.LangStringShortNameTypeIec61360 LangStringShortNameTypeIec61360From( - Nodes.JsonNode node) - { - Aas.LangStringShortNameTypeIec61360? result = DeserializeImplementation.LangStringShortNameTypeIec61360From( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of LangStringDefinitionTypeIec61360 from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of LangStringDefinitionTypeIec61360. - /// - public static Aas.LangStringDefinitionTypeIec61360 LangStringDefinitionTypeIec61360From( - Nodes.JsonNode node) - { - Aas.LangStringDefinitionTypeIec61360? result = DeserializeImplementation.LangStringDefinitionTypeIec61360From( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of DataSpecificationIec61360 from . - /// - /// JSON node to be parsed - /// - /// Thrown when is not a valid JSON - /// representation of DataSpecificationIec61360. - /// - public static Aas.DataSpecificationIec61360 DataSpecificationIec61360From( - Nodes.JsonNode node) - { - Aas.DataSpecificationIec61360? result = DeserializeImplementation.DataSpecificationIec61360From( - node, - out Reporting.Error? error); - if (error != null) - { - throw new Jsonization.Exception( - Reporting.GenerateJsonPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - } // public static class Deserialize - - internal class Transformer - : Visitation.AbstractTransformer - { - /// - /// Convert 64-bit long integer to a JSON value. - /// - /// value to be converted - /// - /// Thrown if is not within the range where it - /// can be losslessly converted to a double floating number. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "UnusedMember.Local")] - private static Nodes.JsonValue ToJsonValue(long that) - { - // We need to check that we can perform a lossless conversion. - if ((long)((double)that) != that) - { - throw new System.ArgumentException( - $"The number can not be losslessly represented in JSON: {that}"); - } - return Nodes.JsonValue.Create(that); - } - - public override Nodes.JsonObject TransformExtension( - Aas.IExtension that - ) - { - var result = new Nodes.JsonObject(); - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - result["name"] = Nodes.JsonValue.Create( - that.Name); - - if (that.ValueType != null) - { - // We need to help the static analyzer with a null coalescing. - Aas.DataTypeDefXsd value = that.ValueType - ?? throw new System.InvalidOperationException(); - result["valueType"] = Serialize.DataTypeDefXsdToJsonValue( - value); - } - - if (that.Value != null) - { - result["value"] = Nodes.JsonValue.Create( - that.Value); - } - - if (that.RefersTo != null) - { - var arrayRefersTo = new Nodes.JsonArray(); - foreach (IReference item in that.RefersTo) - { - arrayRefersTo.Add( - Transform( - item)); - } - result["refersTo"] = arrayRefersTo; - } - - return result; - } - - public override Nodes.JsonObject TransformAdministrativeInformation( - Aas.IAdministrativeInformation that - ) - { - var result = new Nodes.JsonObject(); - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - if (that.Version != null) - { - result["version"] = Nodes.JsonValue.Create( - that.Version); - } - - if (that.Revision != null) - { - result["revision"] = Nodes.JsonValue.Create( - that.Revision); - } - - if (that.Creator != null) - { - result["creator"] = Transform( - that.Creator); - } - - if (that.TemplateId != null) - { - result["templateId"] = Nodes.JsonValue.Create( - that.TemplateId); - } - - return result; - } - - public override Nodes.JsonObject TransformQualifier( - Aas.IQualifier that - ) - { - var result = new Nodes.JsonObject(); - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Kind != null) - { - // We need to help the static analyzer with a null coalescing. - Aas.QualifierKind value = that.Kind - ?? throw new System.InvalidOperationException(); - result["kind"] = Serialize.QualifierKindToJsonValue( - value); - } - - result["type"] = Nodes.JsonValue.Create( - that.Type); - - result["valueType"] = Serialize.DataTypeDefXsdToJsonValue( - that.ValueType); - - if (that.Value != null) - { - result["value"] = Nodes.JsonValue.Create( - that.Value); - } - - if (that.ValueId != null) - { - result["valueId"] = Transform( - that.ValueId); - } - - return result; - } - - public override Nodes.JsonObject TransformAssetAdministrationShell( - Aas.IAssetAdministrationShell that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.Administration != null) - { - result["administration"] = Transform( - that.Administration); - } - - result["id"] = Nodes.JsonValue.Create( - that.Id); - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - if (that.DerivedFrom != null) - { - result["derivedFrom"] = Transform( - that.DerivedFrom); - } - - result["assetInformation"] = Transform( - that.AssetInformation); - - if (that.Submodels != null) - { - var arraySubmodels = new Nodes.JsonArray(); - foreach (IReference item in that.Submodels) - { - arraySubmodels.Add( - Transform( - item)); - } - result["submodels"] = arraySubmodels; - } - - result["modelType"] = "AssetAdministrationShell"; - - return result; - } - - public override Nodes.JsonObject TransformAssetInformation( - Aas.IAssetInformation that - ) - { - var result = new Nodes.JsonObject(); - - result["assetKind"] = Serialize.AssetKindToJsonValue( - that.AssetKind); - - if (that.GlobalAssetId != null) - { - result["globalAssetId"] = Nodes.JsonValue.Create( - that.GlobalAssetId); - } - - if (that.SpecificAssetIds != null) - { - var arraySpecificAssetIds = new Nodes.JsonArray(); - foreach (ISpecificAssetId item in that.SpecificAssetIds) - { - arraySpecificAssetIds.Add( - Transform( - item)); - } - result["specificAssetIds"] = arraySpecificAssetIds; - } - - if (that.AssetType != null) - { - result["assetType"] = Nodes.JsonValue.Create( - that.AssetType); - } - - if (that.DefaultThumbnail != null) - { - result["defaultThumbnail"] = Transform( - that.DefaultThumbnail); - } - - return result; - } - - public override Nodes.JsonObject TransformResource( - Aas.IResource that - ) - { - var result = new Nodes.JsonObject(); - - result["path"] = Nodes.JsonValue.Create( - that.Path); - - if (that.ContentType != null) - { - result["contentType"] = Nodes.JsonValue.Create( - that.ContentType); - } - - return result; - } - - public override Nodes.JsonObject TransformSpecificAssetId( - Aas.ISpecificAssetId that - ) - { - var result = new Nodes.JsonObject(); - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - result["name"] = Nodes.JsonValue.Create( - that.Name); - - result["value"] = Nodes.JsonValue.Create( - that.Value); - - if (that.ExternalSubjectId != null) - { - result["externalSubjectId"] = Transform( - that.ExternalSubjectId); - } - - return result; - } - - public override Nodes.JsonObject TransformSubmodel( - Aas.ISubmodel that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.Administration != null) - { - result["administration"] = Transform( - that.Administration); - } - - result["id"] = Nodes.JsonValue.Create( - that.Id); - - if (that.Kind != null) - { - // We need to help the static analyzer with a null coalescing. - Aas.ModellingKind value = that.Kind - ?? throw new System.InvalidOperationException(); - result["kind"] = Serialize.ModellingKindToJsonValue( - value); - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - if (that.SubmodelElements != null) - { - var arraySubmodelElements = new Nodes.JsonArray(); - foreach (ISubmodelElement item in that.SubmodelElements) - { - arraySubmodelElements.Add( - Transform( - item)); - } - result["submodelElements"] = arraySubmodelElements; - } - - result["modelType"] = "Submodel"; - - return result; - } - - public override Nodes.JsonObject TransformRelationshipElement( - Aas.IRelationshipElement that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - result["first"] = Transform( - that.First); - - result["second"] = Transform( - that.Second); - - result["modelType"] = "RelationshipElement"; - - return result; - } - - public override Nodes.JsonObject TransformSubmodelElementList( - Aas.ISubmodelElementList that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - if (that.OrderRelevant != null) - { - result["orderRelevant"] = Nodes.JsonValue.Create( - that.OrderRelevant); - } - - if (that.SemanticIdListElement != null) - { - result["semanticIdListElement"] = Transform( - that.SemanticIdListElement); - } - - result["typeValueListElement"] = Serialize.AasSubmodelElementsToJsonValue( - that.TypeValueListElement); - - if (that.ValueTypeListElement != null) - { - // We need to help the static analyzer with a null coalescing. - Aas.DataTypeDefXsd value = that.ValueTypeListElement - ?? throw new System.InvalidOperationException(); - result["valueTypeListElement"] = Serialize.DataTypeDefXsdToJsonValue( - value); - } - - if (that.Value != null) - { - var arrayValue = new Nodes.JsonArray(); - foreach (ISubmodelElement item in that.Value) - { - arrayValue.Add( - Transform( - item)); - } - result["value"] = arrayValue; - } - - result["modelType"] = "SubmodelElementList"; - - return result; - } - - public override Nodes.JsonObject TransformSubmodelElementCollection( - Aas.ISubmodelElementCollection that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - if (that.Value != null) - { - var arrayValue = new Nodes.JsonArray(); - foreach (ISubmodelElement item in that.Value) - { - arrayValue.Add( - Transform( - item)); - } - result["value"] = arrayValue; - } - - result["modelType"] = "SubmodelElementCollection"; - - return result; - } - - public override Nodes.JsonObject TransformProperty( - Aas.IProperty that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - result["valueType"] = Serialize.DataTypeDefXsdToJsonValue( - that.ValueType); - - if (that.Value != null) - { - result["value"] = Nodes.JsonValue.Create( - that.Value); - } - - if (that.ValueId != null) - { - result["valueId"] = Transform( - that.ValueId); - } - - result["modelType"] = "Property"; - - return result; - } - - public override Nodes.JsonObject TransformMultiLanguageProperty( - Aas.IMultiLanguageProperty that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - if (that.Value != null) - { - var arrayValue = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Value) - { - arrayValue.Add( - Transform( - item)); - } - result["value"] = arrayValue; - } - - if (that.ValueId != null) - { - result["valueId"] = Transform( - that.ValueId); - } - - result["modelType"] = "MultiLanguageProperty"; - - return result; - } - - public override Nodes.JsonObject TransformRange( - Aas.IRange that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - result["valueType"] = Serialize.DataTypeDefXsdToJsonValue( - that.ValueType); - - if (that.Min != null) - { - result["min"] = Nodes.JsonValue.Create( - that.Min); - } - - if (that.Max != null) - { - result["max"] = Nodes.JsonValue.Create( - that.Max); - } - - result["modelType"] = "Range"; - - return result; - } - - public override Nodes.JsonObject TransformReferenceElement( - Aas.IReferenceElement that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - if (that.Value != null) - { - result["value"] = Transform( - that.Value); - } - - result["modelType"] = "ReferenceElement"; - - return result; - } - - public override Nodes.JsonObject TransformBlob( - Aas.IBlob that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - if (that.Value != null) - { - result["value"] = Nodes.JsonValue.Create( - System.Convert.ToBase64String( - that.Value)); - } - - result["contentType"] = Nodes.JsonValue.Create( - that.ContentType); - - result["modelType"] = "Blob"; - - return result; - } - - public override Nodes.JsonObject TransformFile( - Aas.IFile that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - if (that.Value != null) - { - result["value"] = Nodes.JsonValue.Create( - that.Value); - } - - result["contentType"] = Nodes.JsonValue.Create( - that.ContentType); - - result["modelType"] = "File"; - - return result; - } - - public override Nodes.JsonObject TransformAnnotatedRelationshipElement( - Aas.IAnnotatedRelationshipElement that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - result["first"] = Transform( - that.First); - - result["second"] = Transform( - that.Second); - - if (that.Annotations != null) - { - var arrayAnnotations = new Nodes.JsonArray(); - foreach (IDataElement item in that.Annotations) - { - arrayAnnotations.Add( - Transform( - item)); - } - result["annotations"] = arrayAnnotations; - } - - result["modelType"] = "AnnotatedRelationshipElement"; - - return result; - } - - public override Nodes.JsonObject TransformEntity( - Aas.IEntity that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - if (that.Statements != null) - { - var arrayStatements = new Nodes.JsonArray(); - foreach (ISubmodelElement item in that.Statements) - { - arrayStatements.Add( - Transform( - item)); - } - result["statements"] = arrayStatements; - } - - result["entityType"] = Serialize.EntityTypeToJsonValue( - that.EntityType); - - if (that.GlobalAssetId != null) - { - result["globalAssetId"] = Nodes.JsonValue.Create( - that.GlobalAssetId); - } - - if (that.SpecificAssetIds != null) - { - var arraySpecificAssetIds = new Nodes.JsonArray(); - foreach (ISpecificAssetId item in that.SpecificAssetIds) - { - arraySpecificAssetIds.Add( - Transform( - item)); - } - result["specificAssetIds"] = arraySpecificAssetIds; - } - - result["modelType"] = "Entity"; - - return result; - } - - public override Nodes.JsonObject TransformEventPayload( - Aas.IEventPayload that - ) - { - var result = new Nodes.JsonObject(); - - result["source"] = Transform( - that.Source); - - if (that.SourceSemanticId != null) - { - result["sourceSemanticId"] = Transform( - that.SourceSemanticId); - } - - result["observableReference"] = Transform( - that.ObservableReference); - - if (that.ObservableSemanticId != null) - { - result["observableSemanticId"] = Transform( - that.ObservableSemanticId); - } - - if (that.Topic != null) - { - result["topic"] = Nodes.JsonValue.Create( - that.Topic); - } - - if (that.SubjectId != null) - { - result["subjectId"] = Transform( - that.SubjectId); - } - - result["timeStamp"] = Nodes.JsonValue.Create( - that.TimeStamp); - - if (that.Payload != null) - { - result["payload"] = Nodes.JsonValue.Create( - System.Convert.ToBase64String( - that.Payload)); - } - - return result; - } - - public override Nodes.JsonObject TransformBasicEventElement( - Aas.IBasicEventElement that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - result["observed"] = Transform( - that.Observed); - - result["direction"] = Serialize.DirectionToJsonValue( - that.Direction); - - result["state"] = Serialize.StateOfEventToJsonValue( - that.State); - - if (that.MessageTopic != null) - { - result["messageTopic"] = Nodes.JsonValue.Create( - that.MessageTopic); - } - - if (that.MessageBroker != null) - { - result["messageBroker"] = Transform( - that.MessageBroker); - } - - if (that.LastUpdate != null) - { - result["lastUpdate"] = Nodes.JsonValue.Create( - that.LastUpdate); - } - - if (that.MinInterval != null) - { - result["minInterval"] = Nodes.JsonValue.Create( - that.MinInterval); - } - - if (that.MaxInterval != null) - { - result["maxInterval"] = Nodes.JsonValue.Create( - that.MaxInterval); - } - - result["modelType"] = "BasicEventElement"; - - return result; - } - - public override Nodes.JsonObject TransformOperation( - Aas.IOperation that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - if (that.InputVariables != null) - { - var arrayInputVariables = new Nodes.JsonArray(); - foreach (IOperationVariable item in that.InputVariables) - { - arrayInputVariables.Add( - Transform( - item)); - } - result["inputVariables"] = arrayInputVariables; - } - - if (that.OutputVariables != null) - { - var arrayOutputVariables = new Nodes.JsonArray(); - foreach (IOperationVariable item in that.OutputVariables) - { - arrayOutputVariables.Add( - Transform( - item)); - } - result["outputVariables"] = arrayOutputVariables; - } - - if (that.InoutputVariables != null) - { - var arrayInoutputVariables = new Nodes.JsonArray(); - foreach (IOperationVariable item in that.InoutputVariables) - { - arrayInoutputVariables.Add( - Transform( - item)); - } - result["inoutputVariables"] = arrayInoutputVariables; - } - - result["modelType"] = "Operation"; - - return result; - } - - public override Nodes.JsonObject TransformOperationVariable( - Aas.IOperationVariable that - ) - { - var result = new Nodes.JsonObject(); - - result["value"] = Transform( - that.Value); - - return result; - } - - public override Nodes.JsonObject TransformCapability( - Aas.ICapability that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.SemanticId != null) - { - result["semanticId"] = Transform( - that.SemanticId); - } - - if (that.SupplementalSemanticIds != null) - { - var arraySupplementalSemanticIds = new Nodes.JsonArray(); - foreach (IReference item in that.SupplementalSemanticIds) - { - arraySupplementalSemanticIds.Add( - Transform( - item)); - } - result["supplementalSemanticIds"] = arraySupplementalSemanticIds; - } - - if (that.Qualifiers != null) - { - var arrayQualifiers = new Nodes.JsonArray(); - foreach (IQualifier item in that.Qualifiers) - { - arrayQualifiers.Add( - Transform( - item)); - } - result["qualifiers"] = arrayQualifiers; - } - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - result["modelType"] = "Capability"; - - return result; - } - - public override Nodes.JsonObject TransformConceptDescription( - Aas.IConceptDescription that - ) - { - var result = new Nodes.JsonObject(); - - if (that.Extensions != null) - { - var arrayExtensions = new Nodes.JsonArray(); - foreach (IExtension item in that.Extensions) - { - arrayExtensions.Add( - Transform( - item)); - } - result["extensions"] = arrayExtensions; - } - - if (that.Category != null) - { - result["category"] = Nodes.JsonValue.Create( - that.Category); - } - - if (that.IdShort != null) - { - result["idShort"] = Nodes.JsonValue.Create( - that.IdShort); - } - - if (that.DisplayName != null) - { - var arrayDisplayName = new Nodes.JsonArray(); - foreach (ILangStringNameType item in that.DisplayName) - { - arrayDisplayName.Add( - Transform( - item)); - } - result["displayName"] = arrayDisplayName; - } - - if (that.Description != null) - { - var arrayDescription = new Nodes.JsonArray(); - foreach (ILangStringTextType item in that.Description) - { - arrayDescription.Add( - Transform( - item)); - } - result["description"] = arrayDescription; - } - - if (that.Administration != null) - { - result["administration"] = Transform( - that.Administration); - } - - result["id"] = Nodes.JsonValue.Create( - that.Id); - - if (that.EmbeddedDataSpecifications != null) - { - var arrayEmbeddedDataSpecifications = new Nodes.JsonArray(); - foreach (IEmbeddedDataSpecification item in that.EmbeddedDataSpecifications) - { - arrayEmbeddedDataSpecifications.Add( - Transform( - item)); - } - result["embeddedDataSpecifications"] = arrayEmbeddedDataSpecifications; - } - - if (that.IsCaseOf != null) - { - var arrayIsCaseOf = new Nodes.JsonArray(); - foreach (IReference item in that.IsCaseOf) - { - arrayIsCaseOf.Add( - Transform( - item)); - } - result["isCaseOf"] = arrayIsCaseOf; - } - - result["modelType"] = "ConceptDescription"; - - return result; - } - - public override Nodes.JsonObject TransformReference( - Aas.IReference that - ) - { - var result = new Nodes.JsonObject(); - - result["type"] = Serialize.ReferenceTypesToJsonValue( - that.Type); - - if (that.ReferredSemanticId != null) - { - result["referredSemanticId"] = Transform( - that.ReferredSemanticId); - } - - var arrayKeys = new Nodes.JsonArray(); - foreach (IKey item in that.Keys) - { - arrayKeys.Add( - Transform( - item)); - } - result["keys"] = arrayKeys; - - return result; - } - - public override Nodes.JsonObject TransformKey( - Aas.IKey that - ) - { - var result = new Nodes.JsonObject(); - - result["type"] = Serialize.KeyTypesToJsonValue( - that.Type); - - result["value"] = Nodes.JsonValue.Create( - that.Value); - - return result; - } - - public override Nodes.JsonObject TransformLangStringNameType( - Aas.ILangStringNameType that - ) - { - var result = new Nodes.JsonObject(); - - result["language"] = Nodes.JsonValue.Create( - that.Language); - - result["text"] = Nodes.JsonValue.Create( - that.Text); - - return result; - } - - public override Nodes.JsonObject TransformLangStringTextType( - Aas.ILangStringTextType that - ) - { - var result = new Nodes.JsonObject(); - - result["language"] = Nodes.JsonValue.Create( - that.Language); - - result["text"] = Nodes.JsonValue.Create( - that.Text); - - return result; - } - - public override Nodes.JsonObject TransformEnvironment( - Aas.IEnvironment that - ) - { - var result = new Nodes.JsonObject(); - - if (that.AssetAdministrationShells != null) - { - var arrayAssetAdministrationShells = new Nodes.JsonArray(); - foreach (IAssetAdministrationShell item in that.AssetAdministrationShells) - { - arrayAssetAdministrationShells.Add( - Transform( - item)); - } - result["assetAdministrationShells"] = arrayAssetAdministrationShells; - } - - if (that.Submodels != null) - { - var arraySubmodels = new Nodes.JsonArray(); - foreach (ISubmodel item in that.Submodels) - { - arraySubmodels.Add( - Transform( - item)); - } - result["submodels"] = arraySubmodels; - } - - if (that.ConceptDescriptions != null) - { - var arrayConceptDescriptions = new Nodes.JsonArray(); - foreach (IConceptDescription item in that.ConceptDescriptions) - { - arrayConceptDescriptions.Add( - Transform( - item)); - } - result["conceptDescriptions"] = arrayConceptDescriptions; - } - - return result; - } - - public override Nodes.JsonObject TransformEmbeddedDataSpecification( - Aas.IEmbeddedDataSpecification that - ) - { - var result = new Nodes.JsonObject(); - - result["dataSpecification"] = Transform( - that.DataSpecification); - - result["dataSpecificationContent"] = Transform( - that.DataSpecificationContent); - - return result; - } - - public override Nodes.JsonObject TransformLevelType( - Aas.ILevelType that - ) - { - var result = new Nodes.JsonObject(); - - result["min"] = Nodes.JsonValue.Create( - that.Min); - - result["nom"] = Nodes.JsonValue.Create( - that.Nom); - - result["typ"] = Nodes.JsonValue.Create( - that.Typ); - - result["max"] = Nodes.JsonValue.Create( - that.Max); - - return result; - } - - public override Nodes.JsonObject TransformValueReferencePair( - Aas.IValueReferencePair that - ) - { - var result = new Nodes.JsonObject(); - - result["value"] = Nodes.JsonValue.Create( - that.Value); - - result["valueId"] = Transform( - that.ValueId); - - return result; - } - - public override Nodes.JsonObject TransformValueList( - Aas.IValueList that - ) - { - var result = new Nodes.JsonObject(); - - var arrayValueReferencePairs = new Nodes.JsonArray(); - foreach (IValueReferencePair item in that.ValueReferencePairs) - { - arrayValueReferencePairs.Add( - Transform( - item)); - } - result["valueReferencePairs"] = arrayValueReferencePairs; - - return result; - } - - public override Nodes.JsonObject TransformLangStringPreferredNameTypeIec61360( - Aas.ILangStringPreferredNameTypeIec61360 that - ) - { - var result = new Nodes.JsonObject(); - - result["language"] = Nodes.JsonValue.Create( - that.Language); - - result["text"] = Nodes.JsonValue.Create( - that.Text); - - return result; - } - - public override Nodes.JsonObject TransformLangStringShortNameTypeIec61360( - Aas.ILangStringShortNameTypeIec61360 that - ) - { - var result = new Nodes.JsonObject(); - - result["language"] = Nodes.JsonValue.Create( - that.Language); - - result["text"] = Nodes.JsonValue.Create( - that.Text); - - return result; - } - - public override Nodes.JsonObject TransformLangStringDefinitionTypeIec61360( - Aas.ILangStringDefinitionTypeIec61360 that - ) - { - var result = new Nodes.JsonObject(); - - result["language"] = Nodes.JsonValue.Create( - that.Language); - - result["text"] = Nodes.JsonValue.Create( - that.Text); - - return result; - } - - public override Nodes.JsonObject TransformDataSpecificationIec61360( - Aas.IDataSpecificationIec61360 that - ) - { - var result = new Nodes.JsonObject(); - - var arrayPreferredName = new Nodes.JsonArray(); - foreach (ILangStringPreferredNameTypeIec61360 item in that.PreferredName) - { - arrayPreferredName.Add( - Transform( - item)); - } - result["preferredName"] = arrayPreferredName; - - if (that.ShortName != null) - { - var arrayShortName = new Nodes.JsonArray(); - foreach (ILangStringShortNameTypeIec61360 item in that.ShortName) - { - arrayShortName.Add( - Transform( - item)); - } - result["shortName"] = arrayShortName; - } - - if (that.Unit != null) - { - result["unit"] = Nodes.JsonValue.Create( - that.Unit); - } - - if (that.UnitId != null) - { - result["unitId"] = Transform( - that.UnitId); - } - - if (that.SourceOfDefinition != null) - { - result["sourceOfDefinition"] = Nodes.JsonValue.Create( - that.SourceOfDefinition); - } - - if (that.Symbol != null) - { - result["symbol"] = Nodes.JsonValue.Create( - that.Symbol); - } - - if (that.DataType != null) - { - // We need to help the static analyzer with a null coalescing. - Aas.DataTypeIec61360 value = that.DataType - ?? throw new System.InvalidOperationException(); - result["dataType"] = Serialize.DataTypeIec61360ToJsonValue( - value); - } - - if (that.Definition != null) - { - var arrayDefinition = new Nodes.JsonArray(); - foreach (ILangStringDefinitionTypeIec61360 item in that.Definition) - { - arrayDefinition.Add( - Transform( - item)); - } - result["definition"] = arrayDefinition; - } - - if (that.ValueFormat != null) - { - result["valueFormat"] = Nodes.JsonValue.Create( - that.ValueFormat); - } - - if (that.ValueList != null) - { - result["valueList"] = Transform( - that.ValueList); - } - - if (that.Value != null) - { - result["value"] = Nodes.JsonValue.Create( - that.Value); - } - - if (that.LevelType != null) - { - result["levelType"] = Transform( - that.LevelType); - } - - result["modelType"] = "DataSpecificationIec61360"; - - return result; - } - } // internal class Transformer - - /// - /// Serialize instances of meta-model classes to JSON elements. - /// - /// - /// Here is an example how to serialize an instance of IHasSemantics: - /// - /// var anInstance = new Aas.IHasSemantics( - /// // ... some constructor arguments ... - /// ); - /// System.Text.Json.Nodes.JsonObject element = ( - /// Serialize.ToJsonObject( - /// anInstance)); - /// - /// - public static class Serialize - { - private static readonly Transformer Transformer = new Transformer(); - - /// - /// Serialize an instance of the meta-model into a JSON object. - /// - public static Nodes.JsonObject ToJsonObject(Aas.IClass that) - { - return Serialize.Transformer.Transform(that); - } - - /// - /// Serialize a literal of ModellingKind into a JSON string. - /// - public static Nodes.JsonValue ModellingKindToJsonValue(Aas.ModellingKind that) - { - string? text = Stringification.ToString(that); - return Nodes.JsonValue.Create(text) - ?? throw new System.ArgumentException( - $"Invalid ModellingKind: {that}"); - } - - /// - /// Serialize a literal of QualifierKind into a JSON string. - /// - public static Nodes.JsonValue QualifierKindToJsonValue(Aas.QualifierKind that) - { - string? text = Stringification.ToString(that); - return Nodes.JsonValue.Create(text) - ?? throw new System.ArgumentException( - $"Invalid QualifierKind: {that}"); - } - - /// - /// Serialize a literal of AssetKind into a JSON string. - /// - public static Nodes.JsonValue AssetKindToJsonValue(Aas.AssetKind that) - { - string? text = Stringification.ToString(that); - return Nodes.JsonValue.Create(text) - ?? throw new System.ArgumentException( - $"Invalid AssetKind: {that}"); - } - - /// - /// Serialize a literal of AasSubmodelElements into a JSON string. - /// - public static Nodes.JsonValue AasSubmodelElementsToJsonValue(Aas.AasSubmodelElements that) - { - string? text = Stringification.ToString(that); - return Nodes.JsonValue.Create(text) - ?? throw new System.ArgumentException( - $"Invalid AasSubmodelElements: {that}"); - } - - /// - /// Serialize a literal of EntityType into a JSON string. - /// - public static Nodes.JsonValue EntityTypeToJsonValue(Aas.EntityType that) - { - string? text = Stringification.ToString(that); - return Nodes.JsonValue.Create(text) - ?? throw new System.ArgumentException( - $"Invalid EntityType: {that}"); - } - - /// - /// Serialize a literal of Direction into a JSON string. - /// - public static Nodes.JsonValue DirectionToJsonValue(Aas.Direction that) - { - string? text = Stringification.ToString(that); - return Nodes.JsonValue.Create(text) - ?? throw new System.ArgumentException( - $"Invalid Direction: {that}"); - } - - /// - /// Serialize a literal of StateOfEvent into a JSON string. - /// - public static Nodes.JsonValue StateOfEventToJsonValue(Aas.StateOfEvent that) - { - string? text = Stringification.ToString(that); - return Nodes.JsonValue.Create(text) - ?? throw new System.ArgumentException( - $"Invalid StateOfEvent: {that}"); - } - - /// - /// Serialize a literal of ReferenceTypes into a JSON string. - /// - public static Nodes.JsonValue ReferenceTypesToJsonValue(Aas.ReferenceTypes that) - { - string? text = Stringification.ToString(that); - return Nodes.JsonValue.Create(text) - ?? throw new System.ArgumentException( - $"Invalid ReferenceTypes: {that}"); - } - - /// - /// Serialize a literal of KeyTypes into a JSON string. - /// - public static Nodes.JsonValue KeyTypesToJsonValue(Aas.KeyTypes that) - { - string? text = Stringification.ToString(that); - return Nodes.JsonValue.Create(text) - ?? throw new System.ArgumentException( - $"Invalid KeyTypes: {that}"); - } - - /// - /// Serialize a literal of DataTypeDefXsd into a JSON string. - /// - public static Nodes.JsonValue DataTypeDefXsdToJsonValue(Aas.DataTypeDefXsd that) - { - string? text = Stringification.ToString(that); - return Nodes.JsonValue.Create(text) - ?? throw new System.ArgumentException( - $"Invalid DataTypeDefXsd: {that}"); - } - - /// - /// Serialize a literal of DataTypeIec61360 into a JSON string. - /// - public static Nodes.JsonValue DataTypeIec61360ToJsonValue(Aas.DataTypeIec61360 that) - { - string? text = Stringification.ToString(that); - return Nodes.JsonValue.Create(text) - ?? throw new System.ArgumentException( - $"Invalid DataTypeIec61360: {that}"); - } - } // public static class Serialize - } // public static class Jsonization -} // namespace AasCore.Aas3_0 - -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ diff --git a/src/AasCore.Aas3_0/reporting.cs b/src/AasCore.Aas3_0/reporting.cs deleted file mode 100644 index 4024a7ee9..000000000 --- a/src/AasCore.Aas3_0/reporting.cs +++ /dev/null @@ -1,175 +0,0 @@ -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ - -using Aas = AasCore.Aas3_0; // renamed -using CodeAnalysis = System.Diagnostics.CodeAnalysis; - -using System.Collections.Generic; // can't alias - -namespace AasCore.Aas3_0 -{ - /// - /// Provide reporting for de/serialization and verification. - /// - public static class Reporting - { - /// - /// Capture a path segment of a value in a model. - /// - public abstract class Segment - { - // Intentionally empty. - } - - public class NameSegment : Segment - { - public readonly string Name; - public NameSegment(string name) - { - Name = name; - } - } - - public class IndexSegment : Segment - { - public readonly int Index; - public IndexSegment(int index) - { - Index = index; - } - } - - private static readonly System.Text.RegularExpressions.Regex VariableNameRe = ( - new System.Text.RegularExpressions.Regex( - @"^[a-zA-Z_][a-zA-Z_0-9]*$")); - - /// - /// Generate a JSON Path based on the path segments. - /// - /// - /// See, for example, this page for more information on JSON path: - /// https://support.smartbear.com/alertsite/docs/monitors/api/endpoint/jsonpath.html - /// - public static string GenerateJsonPath( - ICollection segments) - { - var parts = new List(segments.Count); - int i = 0; - foreach (var segment in segments) - { - string? part; - switch (segment) - { - case NameSegment nameSegment: - if (VariableNameRe.IsMatch(nameSegment.Name)) - { - part = (i == 0) ? nameSegment.Name : $".{nameSegment.Name}"; - } - else - { - string escaped = nameSegment.Name - .Replace("\\", "\\\\") - .Replace("\"", "\\\"") - .Replace("\b", "\\b") - .Replace("\f", "\\f") - .Replace("\n", "\\n") - .Replace("\r", "\\r") - .Replace("\t", "\\t"); - part = $"[\"{escaped}\"]"; - } - break; - case IndexSegment indexSegment: - part = $"[{indexSegment.Index}]"; - break; - default: - throw new System.InvalidOperationException( - $"Unexpected segment type: {segment.GetType()}"); - } - parts.Add(part); - i++; - } - return string.Join("", parts); - } - - /// - /// Escape special characters for XPath. - /// - private static string EscapeForXPath( - string text) - { - // Mind the order, as we need to replace '&' first. - // - // For some benchmarks, see: - // https://stackoverflow.com/questions/1321331/replace-multiple-string-elements-in-c-sharp - return ( - text - // Even though ampersand, less-then etc. can not occur in valid element names, - // we escape them here for easier debugging and better bug reports. - .Replace("&", "&") - .Replace("/", "/") - .Replace("<", "<") - .Replace(">", ">") - .Replace("\"", """) - .Replace("'", "'") - ); - } - - /// - /// Generate a relative XPath based on the path segments. - /// - /// - /// This method leaves out the leading slash ('/'). This is helpful if - /// to embed the error report in a larger document with a prefix etc. - /// - public static string GenerateRelativeXPath( - ICollection segments) - { - var parts = new List(segments.Count); - foreach (var segment in segments) - { - string? part; - switch (segment) - { - case NameSegment nameSegment: - part = EscapeForXPath(nameSegment.Name); - break; - case IndexSegment indexSegment: - part = $"*[{indexSegment.Index}]"; - break; - default: - throw new System.InvalidOperationException( - $"Unexpected segment type: {segment.GetType()}"); - } - parts.Add(part); - } - return string.Join("/", parts); - } - - /// - /// Represent an error during the deserialization or the verification. - /// - public class Error - { - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal readonly LinkedList _pathSegments = new LinkedList(); - public readonly string Cause; - public ICollection PathSegments => _pathSegments; - public Error(string cause) - { - Cause = cause; - } - - public void PrependSegment(Segment segment) - { - _pathSegments.AddFirst(segment); - } - } - } // public static class Reporting -} // namespace AasCore.Aas3_0 - -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ diff --git a/src/AasCore.Aas3_0/stringification.cs b/src/AasCore.Aas3_0/stringification.cs deleted file mode 100644 index 7077475ae..000000000 --- a/src/AasCore.Aas3_0/stringification.cs +++ /dev/null @@ -1,848 +0,0 @@ -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ - -using Aas = AasCore.Aas3_0; // renamed -using CodeAnalysis = System.Diagnostics.CodeAnalysis; - -using System.Collections.Generic; // can't alias - -namespace AasCore.Aas3_0 -{ - public static class Stringification - { - private static readonly Dictionary ModellingKindToString = ( - new Dictionary() - { - { Aas.ModellingKind.Template, "Template" }, - { Aas.ModellingKind.Instance, "Instance" } - }); - - /// - /// Retrieve the string representation of . - /// - /// - /// If is not a valid literal, return null. - /// - public static string? ToString(Aas.ModellingKind? that) - { - if (!that.HasValue) - { - return null; - } - else - { - if (ModellingKindToString.TryGetValue(that.Value, out string? value)) - { - return value; - } - else - { - return null; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - private static readonly Dictionary _modellingKindFromString = ( - new Dictionary() - { - { "Template", Aas.ModellingKind.Template }, - { "Instance", Aas.ModellingKind.Instance } - }); - - /// - /// Parse the string representation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static Aas.ModellingKind? ModellingKindFromString(string text) - { - if (_modellingKindFromString.TryGetValue(text, out ModellingKind value)) - { - return value; - } - else - { - return null; - } - } - - private static readonly Dictionary QualifierKindToString = ( - new Dictionary() - { - { Aas.QualifierKind.ValueQualifier, "ValueQualifier" }, - { Aas.QualifierKind.ConceptQualifier, "ConceptQualifier" }, - { Aas.QualifierKind.TemplateQualifier, "TemplateQualifier" } - }); - - /// - /// Retrieve the string representation of . - /// - /// - /// If is not a valid literal, return null. - /// - public static string? ToString(Aas.QualifierKind? that) - { - if (!that.HasValue) - { - return null; - } - else - { - if (QualifierKindToString.TryGetValue(that.Value, out string? value)) - { - return value; - } - else - { - return null; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - private static readonly Dictionary _qualifierKindFromString = ( - new Dictionary() - { - { "ValueQualifier", Aas.QualifierKind.ValueQualifier }, - { "ConceptQualifier", Aas.QualifierKind.ConceptQualifier }, - { "TemplateQualifier", Aas.QualifierKind.TemplateQualifier } - }); - - /// - /// Parse the string representation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static Aas.QualifierKind? QualifierKindFromString(string text) - { - if (_qualifierKindFromString.TryGetValue(text, out QualifierKind value)) - { - return value; - } - else - { - return null; - } - } - - private static readonly Dictionary AssetKindToString = ( - new Dictionary() - { - { Aas.AssetKind.Type, "Type" }, - { Aas.AssetKind.Instance, "Instance" }, - { Aas.AssetKind.NotApplicable, "NotApplicable" } - }); - - /// - /// Retrieve the string representation of . - /// - /// - /// If is not a valid literal, return null. - /// - public static string? ToString(Aas.AssetKind? that) - { - if (!that.HasValue) - { - return null; - } - else - { - if (AssetKindToString.TryGetValue(that.Value, out string? value)) - { - return value; - } - else - { - return null; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - private static readonly Dictionary _assetKindFromString = ( - new Dictionary() - { - { "Type", Aas.AssetKind.Type }, - { "Instance", Aas.AssetKind.Instance }, - { "NotApplicable", Aas.AssetKind.NotApplicable } - }); - - /// - /// Parse the string representation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static Aas.AssetKind? AssetKindFromString(string text) - { - if (_assetKindFromString.TryGetValue(text, out AssetKind value)) - { - return value; - } - else - { - return null; - } - } - - private static readonly Dictionary AasSubmodelElementsToString = ( - new Dictionary() - { - { Aas.AasSubmodelElements.AnnotatedRelationshipElement, "AnnotatedRelationshipElement" }, - { Aas.AasSubmodelElements.BasicEventElement, "BasicEventElement" }, - { Aas.AasSubmodelElements.Blob, "Blob" }, - { Aas.AasSubmodelElements.Capability, "Capability" }, - { Aas.AasSubmodelElements.DataElement, "DataElement" }, - { Aas.AasSubmodelElements.Entity, "Entity" }, - { Aas.AasSubmodelElements.EventElement, "EventElement" }, - { Aas.AasSubmodelElements.File, "File" }, - { Aas.AasSubmodelElements.MultiLanguageProperty, "MultiLanguageProperty" }, - { Aas.AasSubmodelElements.Operation, "Operation" }, - { Aas.AasSubmodelElements.Property, "Property" }, - { Aas.AasSubmodelElements.Range, "Range" }, - { Aas.AasSubmodelElements.ReferenceElement, "ReferenceElement" }, - { Aas.AasSubmodelElements.RelationshipElement, "RelationshipElement" }, - { Aas.AasSubmodelElements.SubmodelElement, "SubmodelElement" }, - { Aas.AasSubmodelElements.SubmodelElementList, "SubmodelElementList" }, - { Aas.AasSubmodelElements.SubmodelElementCollection, "SubmodelElementCollection" } - }); - - /// - /// Retrieve the string representation of . - /// - /// - /// If is not a valid literal, return null. - /// - public static string? ToString(Aas.AasSubmodelElements? that) - { - if (!that.HasValue) - { - return null; - } - else - { - if (AasSubmodelElementsToString.TryGetValue(that.Value, out string? value)) - { - return value; - } - else - { - return null; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - private static readonly Dictionary _aasSubmodelElementsFromString = ( - new Dictionary() - { - { "AnnotatedRelationshipElement", Aas.AasSubmodelElements.AnnotatedRelationshipElement }, - { "BasicEventElement", Aas.AasSubmodelElements.BasicEventElement }, - { "Blob", Aas.AasSubmodelElements.Blob }, - { "Capability", Aas.AasSubmodelElements.Capability }, - { "DataElement", Aas.AasSubmodelElements.DataElement }, - { "Entity", Aas.AasSubmodelElements.Entity }, - { "EventElement", Aas.AasSubmodelElements.EventElement }, - { "File", Aas.AasSubmodelElements.File }, - { "MultiLanguageProperty", Aas.AasSubmodelElements.MultiLanguageProperty }, - { "Operation", Aas.AasSubmodelElements.Operation }, - { "Property", Aas.AasSubmodelElements.Property }, - { "Range", Aas.AasSubmodelElements.Range }, - { "ReferenceElement", Aas.AasSubmodelElements.ReferenceElement }, - { "RelationshipElement", Aas.AasSubmodelElements.RelationshipElement }, - { "SubmodelElement", Aas.AasSubmodelElements.SubmodelElement }, - { "SubmodelElementList", Aas.AasSubmodelElements.SubmodelElementList }, - { "SubmodelElementCollection", Aas.AasSubmodelElements.SubmodelElementCollection } - }); - - /// - /// Parse the string representation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static Aas.AasSubmodelElements? AasSubmodelElementsFromString(string text) - { - if (_aasSubmodelElementsFromString.TryGetValue(text, out AasSubmodelElements value)) - { - return value; - } - else - { - return null; - } - } - - private static readonly Dictionary EntityTypeToString = ( - new Dictionary() - { - { Aas.EntityType.CoManagedEntity, "CoManagedEntity" }, - { Aas.EntityType.SelfManagedEntity, "SelfManagedEntity" } - }); - - /// - /// Retrieve the string representation of . - /// - /// - /// If is not a valid literal, return null. - /// - public static string? ToString(Aas.EntityType? that) - { - if (!that.HasValue) - { - return null; - } - else - { - if (EntityTypeToString.TryGetValue(that.Value, out string? value)) - { - return value; - } - else - { - return null; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - private static readonly Dictionary _entityTypeFromString = ( - new Dictionary() - { - { "CoManagedEntity", Aas.EntityType.CoManagedEntity }, - { "SelfManagedEntity", Aas.EntityType.SelfManagedEntity } - }); - - /// - /// Parse the string representation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static Aas.EntityType? EntityTypeFromString(string text) - { - if (_entityTypeFromString.TryGetValue(text, out EntityType value)) - { - return value; - } - else - { - return null; - } - } - - private static readonly Dictionary DirectionToString = ( - new Dictionary() - { - { Aas.Direction.Input, "input" }, - { Aas.Direction.Output, "output" } - }); - - /// - /// Retrieve the string representation of . - /// - /// - /// If is not a valid literal, return null. - /// - public static string? ToString(Aas.Direction? that) - { - if (!that.HasValue) - { - return null; - } - else - { - if (DirectionToString.TryGetValue(that.Value, out string? value)) - { - return value; - } - else - { - return null; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - private static readonly Dictionary _directionFromString = ( - new Dictionary() - { - { "input", Aas.Direction.Input }, - { "output", Aas.Direction.Output } - }); - - /// - /// Parse the string representation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static Aas.Direction? DirectionFromString(string text) - { - if (_directionFromString.TryGetValue(text, out Direction value)) - { - return value; - } - else - { - return null; - } - } - - private static readonly Dictionary StateOfEventToString = ( - new Dictionary() - { - { Aas.StateOfEvent.On, "on" }, - { Aas.StateOfEvent.Off, "off" } - }); - - /// - /// Retrieve the string representation of . - /// - /// - /// If is not a valid literal, return null. - /// - public static string? ToString(Aas.StateOfEvent? that) - { - if (!that.HasValue) - { - return null; - } - else - { - if (StateOfEventToString.TryGetValue(that.Value, out string? value)) - { - return value; - } - else - { - return null; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - private static readonly Dictionary _stateOfEventFromString = ( - new Dictionary() - { - { "on", Aas.StateOfEvent.On }, - { "off", Aas.StateOfEvent.Off } - }); - - /// - /// Parse the string representation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static Aas.StateOfEvent? StateOfEventFromString(string text) - { - if (_stateOfEventFromString.TryGetValue(text, out StateOfEvent value)) - { - return value; - } - else - { - return null; - } - } - - private static readonly Dictionary ReferenceTypesToString = ( - new Dictionary() - { - { Aas.ReferenceTypes.ExternalReference, "ExternalReference" }, - { Aas.ReferenceTypes.ModelReference, "ModelReference" } - }); - - /// - /// Retrieve the string representation of . - /// - /// - /// If is not a valid literal, return null. - /// - public static string? ToString(Aas.ReferenceTypes? that) - { - if (!that.HasValue) - { - return null; - } - else - { - if (ReferenceTypesToString.TryGetValue(that.Value, out string? value)) - { - return value; - } - else - { - return null; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - private static readonly Dictionary _referenceTypesFromString = ( - new Dictionary() - { - { "ExternalReference", Aas.ReferenceTypes.ExternalReference }, - { "ModelReference", Aas.ReferenceTypes.ModelReference } - }); - - /// - /// Parse the string representation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static Aas.ReferenceTypes? ReferenceTypesFromString(string text) - { - if (_referenceTypesFromString.TryGetValue(text, out ReferenceTypes value)) - { - return value; - } - else - { - return null; - } - } - - private static readonly Dictionary KeyTypesToString = ( - new Dictionary() - { - { Aas.KeyTypes.AnnotatedRelationshipElement, "AnnotatedRelationshipElement" }, - { Aas.KeyTypes.AssetAdministrationShell, "AssetAdministrationShell" }, - { Aas.KeyTypes.BasicEventElement, "BasicEventElement" }, - { Aas.KeyTypes.Blob, "Blob" }, - { Aas.KeyTypes.Capability, "Capability" }, - { Aas.KeyTypes.ConceptDescription, "ConceptDescription" }, - { Aas.KeyTypes.DataElement, "DataElement" }, - { Aas.KeyTypes.Entity, "Entity" }, - { Aas.KeyTypes.EventElement, "EventElement" }, - { Aas.KeyTypes.File, "File" }, - { Aas.KeyTypes.FragmentReference, "FragmentReference" }, - { Aas.KeyTypes.GlobalReference, "GlobalReference" }, - { Aas.KeyTypes.Identifiable, "Identifiable" }, - { Aas.KeyTypes.MultiLanguageProperty, "MultiLanguageProperty" }, - { Aas.KeyTypes.Operation, "Operation" }, - { Aas.KeyTypes.Property, "Property" }, - { Aas.KeyTypes.Range, "Range" }, - { Aas.KeyTypes.Referable, "Referable" }, - { Aas.KeyTypes.ReferenceElement, "ReferenceElement" }, - { Aas.KeyTypes.RelationshipElement, "RelationshipElement" }, - { Aas.KeyTypes.Submodel, "Submodel" }, - { Aas.KeyTypes.SubmodelElement, "SubmodelElement" }, - { Aas.KeyTypes.SubmodelElementCollection, "SubmodelElementCollection" }, - { Aas.KeyTypes.SubmodelElementList, "SubmodelElementList" } - }); - - /// - /// Retrieve the string representation of . - /// - /// - /// If is not a valid literal, return null. - /// - public static string? ToString(Aas.KeyTypes? that) - { - if (!that.HasValue) - { - return null; - } - else - { - if (KeyTypesToString.TryGetValue(that.Value, out string? value)) - { - return value; - } - else - { - return null; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - private static readonly Dictionary _keyTypesFromString = ( - new Dictionary() - { - { "AnnotatedRelationshipElement", Aas.KeyTypes.AnnotatedRelationshipElement }, - { "AssetAdministrationShell", Aas.KeyTypes.AssetAdministrationShell }, - { "BasicEventElement", Aas.KeyTypes.BasicEventElement }, - { "Blob", Aas.KeyTypes.Blob }, - { "Capability", Aas.KeyTypes.Capability }, - { "ConceptDescription", Aas.KeyTypes.ConceptDescription }, - { "DataElement", Aas.KeyTypes.DataElement }, - { "Entity", Aas.KeyTypes.Entity }, - { "EventElement", Aas.KeyTypes.EventElement }, - { "File", Aas.KeyTypes.File }, - { "FragmentReference", Aas.KeyTypes.FragmentReference }, - { "GlobalReference", Aas.KeyTypes.GlobalReference }, - { "Identifiable", Aas.KeyTypes.Identifiable }, - { "MultiLanguageProperty", Aas.KeyTypes.MultiLanguageProperty }, - { "Operation", Aas.KeyTypes.Operation }, - { "Property", Aas.KeyTypes.Property }, - { "Range", Aas.KeyTypes.Range }, - { "Referable", Aas.KeyTypes.Referable }, - { "ReferenceElement", Aas.KeyTypes.ReferenceElement }, - { "RelationshipElement", Aas.KeyTypes.RelationshipElement }, - { "Submodel", Aas.KeyTypes.Submodel }, - { "SubmodelElement", Aas.KeyTypes.SubmodelElement }, - { "SubmodelElementCollection", Aas.KeyTypes.SubmodelElementCollection }, - { "SubmodelElementList", Aas.KeyTypes.SubmodelElementList } - }); - - /// - /// Parse the string representation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static Aas.KeyTypes? KeyTypesFromString(string text) - { - if (_keyTypesFromString.TryGetValue(text, out KeyTypes value)) - { - return value; - } - else - { - return null; - } - } - - private static readonly Dictionary DataTypeDefXsdToString = ( - new Dictionary() - { - { Aas.DataTypeDefXsd.AnyUri, "xs:anyURI" }, - { Aas.DataTypeDefXsd.Base64Binary, "xs:base64Binary" }, - { Aas.DataTypeDefXsd.Boolean, "xs:boolean" }, - { Aas.DataTypeDefXsd.Byte, "xs:byte" }, - { Aas.DataTypeDefXsd.Date, "xs:date" }, - { Aas.DataTypeDefXsd.DateTime, "xs:dateTime" }, - { Aas.DataTypeDefXsd.Decimal, "xs:decimal" }, - { Aas.DataTypeDefXsd.Double, "xs:double" }, - { Aas.DataTypeDefXsd.Duration, "xs:duration" }, - { Aas.DataTypeDefXsd.Float, "xs:float" }, - { Aas.DataTypeDefXsd.GDay, "xs:gDay" }, - { Aas.DataTypeDefXsd.GMonth, "xs:gMonth" }, - { Aas.DataTypeDefXsd.GMonthDay, "xs:gMonthDay" }, - { Aas.DataTypeDefXsd.GYear, "xs:gYear" }, - { Aas.DataTypeDefXsd.GYearMonth, "xs:gYearMonth" }, - { Aas.DataTypeDefXsd.HexBinary, "xs:hexBinary" }, - { Aas.DataTypeDefXsd.Int, "xs:int" }, - { Aas.DataTypeDefXsd.Integer, "xs:integer" }, - { Aas.DataTypeDefXsd.Long, "xs:long" }, - { Aas.DataTypeDefXsd.NegativeInteger, "xs:negativeInteger" }, - { Aas.DataTypeDefXsd.NonNegativeInteger, "xs:nonNegativeInteger" }, - { Aas.DataTypeDefXsd.NonPositiveInteger, "xs:nonPositiveInteger" }, - { Aas.DataTypeDefXsd.PositiveInteger, "xs:positiveInteger" }, - { Aas.DataTypeDefXsd.Short, "xs:short" }, - { Aas.DataTypeDefXsd.String, "xs:string" }, - { Aas.DataTypeDefXsd.Time, "xs:time" }, - { Aas.DataTypeDefXsd.UnsignedByte, "xs:unsignedByte" }, - { Aas.DataTypeDefXsd.UnsignedInt, "xs:unsignedInt" }, - { Aas.DataTypeDefXsd.UnsignedLong, "xs:unsignedLong" }, - { Aas.DataTypeDefXsd.UnsignedShort, "xs:unsignedShort" } - }); - - /// - /// Retrieve the string representation of . - /// - /// - /// If is not a valid literal, return null. - /// - public static string? ToString(Aas.DataTypeDefXsd? that) - { - if (!that.HasValue) - { - return null; - } - else - { - if (DataTypeDefXsdToString.TryGetValue(that.Value, out string? value)) - { - return value; - } - else - { - return null; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - private static readonly Dictionary _dataTypeDefXsdFromString = ( - new Dictionary() - { - { "xs:anyURI", Aas.DataTypeDefXsd.AnyUri }, - { "xs:base64Binary", Aas.DataTypeDefXsd.Base64Binary }, - { "xs:boolean", Aas.DataTypeDefXsd.Boolean }, - { "xs:byte", Aas.DataTypeDefXsd.Byte }, - { "xs:date", Aas.DataTypeDefXsd.Date }, - { "xs:dateTime", Aas.DataTypeDefXsd.DateTime }, - { "xs:decimal", Aas.DataTypeDefXsd.Decimal }, - { "xs:double", Aas.DataTypeDefXsd.Double }, - { "xs:duration", Aas.DataTypeDefXsd.Duration }, - { "xs:float", Aas.DataTypeDefXsd.Float }, - { "xs:gDay", Aas.DataTypeDefXsd.GDay }, - { "xs:gMonth", Aas.DataTypeDefXsd.GMonth }, - { "xs:gMonthDay", Aas.DataTypeDefXsd.GMonthDay }, - { "xs:gYear", Aas.DataTypeDefXsd.GYear }, - { "xs:gYearMonth", Aas.DataTypeDefXsd.GYearMonth }, - { "xs:hexBinary", Aas.DataTypeDefXsd.HexBinary }, - { "xs:int", Aas.DataTypeDefXsd.Int }, - { "xs:integer", Aas.DataTypeDefXsd.Integer }, - { "xs:long", Aas.DataTypeDefXsd.Long }, - { "xs:negativeInteger", Aas.DataTypeDefXsd.NegativeInteger }, - { "xs:nonNegativeInteger", Aas.DataTypeDefXsd.NonNegativeInteger }, - { "xs:nonPositiveInteger", Aas.DataTypeDefXsd.NonPositiveInteger }, - { "xs:positiveInteger", Aas.DataTypeDefXsd.PositiveInteger }, - { "xs:short", Aas.DataTypeDefXsd.Short }, - { "xs:string", Aas.DataTypeDefXsd.String }, - { "xs:time", Aas.DataTypeDefXsd.Time }, - { "xs:unsignedByte", Aas.DataTypeDefXsd.UnsignedByte }, - { "xs:unsignedInt", Aas.DataTypeDefXsd.UnsignedInt }, - { "xs:unsignedLong", Aas.DataTypeDefXsd.UnsignedLong }, - { "xs:unsignedShort", Aas.DataTypeDefXsd.UnsignedShort } - }); - - /// - /// Parse the string representation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static Aas.DataTypeDefXsd? DataTypeDefXsdFromString(string text) - { - if (_dataTypeDefXsdFromString.TryGetValue(text, out DataTypeDefXsd value)) - { - return value; - } - else - { - return null; - } - } - - private static readonly Dictionary DataTypeIec61360ToString = ( - new Dictionary() - { - { Aas.DataTypeIec61360.Date, "DATE" }, - { Aas.DataTypeIec61360.String, "STRING" }, - { Aas.DataTypeIec61360.StringTranslatable, "STRING_TRANSLATABLE" }, - { Aas.DataTypeIec61360.IntegerMeasure, "INTEGER_MEASURE" }, - { Aas.DataTypeIec61360.IntegerCount, "INTEGER_COUNT" }, - { Aas.DataTypeIec61360.IntegerCurrency, "INTEGER_CURRENCY" }, - { Aas.DataTypeIec61360.RealMeasure, "REAL_MEASURE" }, - { Aas.DataTypeIec61360.RealCount, "REAL_COUNT" }, - { Aas.DataTypeIec61360.RealCurrency, "REAL_CURRENCY" }, - { Aas.DataTypeIec61360.Boolean, "BOOLEAN" }, - { Aas.DataTypeIec61360.Iri, "IRI" }, - { Aas.DataTypeIec61360.Irdi, "IRDI" }, - { Aas.DataTypeIec61360.Rational, "RATIONAL" }, - { Aas.DataTypeIec61360.RationalMeasure, "RATIONAL_MEASURE" }, - { Aas.DataTypeIec61360.Time, "TIME" }, - { Aas.DataTypeIec61360.Timestamp, "TIMESTAMP" }, - { Aas.DataTypeIec61360.File, "FILE" }, - { Aas.DataTypeIec61360.Html, "HTML" }, - { Aas.DataTypeIec61360.Blob, "BLOB" } - }); - - /// - /// Retrieve the string representation of . - /// - /// - /// If is not a valid literal, return null. - /// - public static string? ToString(Aas.DataTypeIec61360? that) - { - if (!that.HasValue) - { - return null; - } - else - { - if (DataTypeIec61360ToString.TryGetValue(that.Value, out string? value)) - { - return value; - } - else - { - return null; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - private static readonly Dictionary _dataTypeIec61360FromString = ( - new Dictionary() - { - { "DATE", Aas.DataTypeIec61360.Date }, - { "STRING", Aas.DataTypeIec61360.String }, - { "STRING_TRANSLATABLE", Aas.DataTypeIec61360.StringTranslatable }, - { "INTEGER_MEASURE", Aas.DataTypeIec61360.IntegerMeasure }, - { "INTEGER_COUNT", Aas.DataTypeIec61360.IntegerCount }, - { "INTEGER_CURRENCY", Aas.DataTypeIec61360.IntegerCurrency }, - { "REAL_MEASURE", Aas.DataTypeIec61360.RealMeasure }, - { "REAL_COUNT", Aas.DataTypeIec61360.RealCount }, - { "REAL_CURRENCY", Aas.DataTypeIec61360.RealCurrency }, - { "BOOLEAN", Aas.DataTypeIec61360.Boolean }, - { "IRI", Aas.DataTypeIec61360.Iri }, - { "IRDI", Aas.DataTypeIec61360.Irdi }, - { "RATIONAL", Aas.DataTypeIec61360.Rational }, - { "RATIONAL_MEASURE", Aas.DataTypeIec61360.RationalMeasure }, - { "TIME", Aas.DataTypeIec61360.Time }, - { "TIMESTAMP", Aas.DataTypeIec61360.Timestamp }, - { "FILE", Aas.DataTypeIec61360.File }, - { "HTML", Aas.DataTypeIec61360.Html }, - { "BLOB", Aas.DataTypeIec61360.Blob } - }); - - /// - /// Parse the string representation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static Aas.DataTypeIec61360? DataTypeIec61360FromString(string text) - { - if (_dataTypeIec61360FromString.TryGetValue(text, out DataTypeIec61360 value)) - { - return value; - } - else - { - return null; - } - } - } // public static class Stringification -} // namespace AasCore.Aas3_0 - -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ diff --git a/src/AasCore.Aas3_0/types.cs b/src/AasCore.Aas3_0/types.cs deleted file mode 100644 index f72cd5894..000000000 --- a/src/AasCore.Aas3_0/types.cs +++ /dev/null @@ -1,13636 +0,0 @@ -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ -using AdminShellNS.DiaryData; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; // can't alias -using Aas = AasCore.Aas3_0; // renamed -using EnumMemberAttribute = System.Runtime.Serialization.EnumMemberAttribute; - -namespace AasCore.Aas3_0 -{ - /// - /// Represent a general class of an AAS model. - /// - public interface IClass - { - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce(); - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend(); - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor); - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context); - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer); - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context); - } - - /// - /// Element that can have a semantic definition plus some supplemental semantic - /// definitions. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-118: - /// If there are ID defined - /// then there shall be also a main semantic ID . - ///
  • - ///
- ///
- public interface IHasSemantics : IClass - { - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty(); - } - - /// - /// Single extension of an element. - /// - public interface IExtension : IHasSemantics - { - /// - /// Name of the extension. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-077: - /// The name of an extension (Extension/name) within needs - /// to be unique. - ///
  • - ///
- ///
- public string Name { get; set; } - - /// - /// Type of the value of the extension. - /// - /// - /// Default: - /// - public DataTypeDefXsd? ValueType { get; set; } - - /// - /// Value of the extension - /// - public string? Value { get; set; } - - /// - /// Reference to an element the extension refers to. - /// - public List? RefersTo { get; set; } - - public DataTypeDefXsd ValueTypeOrDefault(); - - /// - /// Iterate over RefersTo, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverRefersToOrEmpty(); - } - - /// - /// Single extension of an element. - /// - public class Extension : IExtension - { - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Name of the extension. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-077: - /// The name of an extension (Extension/name) within needs - /// to be unique. - ///
  • - ///
- ///
- public string Name { get; set; } - - /// - /// Type of the value of the extension. - /// - /// - /// Default: - /// - public DataTypeDefXsd? ValueType { get; set; } - - /// - /// Value of the extension - /// - public string? Value { get; set; } - - /// - /// Reference to an element the extension refers to. - /// - public List? RefersTo { get; set; } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over RefersTo, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverRefersToOrEmpty() - { - return RefersTo - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Return the or the default value - /// if it has not been set. - /// - public DataTypeDefXsd ValueTypeOrDefault() - { - return ValueType ?? DataTypeDefXsd.String; - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (RefersTo != null) - { - foreach (var anItem in RefersTo) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (RefersTo != null) - { - foreach (var anItem in RefersTo) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitExtension(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitExtension(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformExtension(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformExtension(this, context); - } - - public Extension( - string name, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - DataTypeDefXsd? valueType = null, - string? value = null, - List? refersTo = null) - { - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Name = name; - ValueType = valueType; - Value = value; - RefersTo = refersTo; - } - } - - /// - /// Element that can be extended by proprietary extensions. - /// - /// - /// Extensions are proprietary, i.e. they do not support global interoperability. - /// - public interface IHasExtensions : IClass - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty(); - } - - /// - /// An element that is referable by its . - /// - /// - /// This ID is not globally unique. - /// This ID is unique within the name space of the element. - /// - public interface IReferable : IHasExtensions, IDiaryData - { - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - #endregion - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty(); - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty(); - } - - /// - /// An element that has a globally unique identifier. - /// - public interface IIdentifiable : IReferable - { - /// - /// Administrative information of an identifiable element. - /// - /// - /// Some of the administrative information like the version number might need to - /// be part of the identification. - /// - public IAdministrativeInformation? Administration { get; set; } - - /// - /// The globally unique identification of the element. - /// - public string Id { get; set; } - } - - /// - /// Enumeration for denoting whether an element is a template or an instance. - /// - public enum ModellingKind - { - /// - /// Specification of the common features of a structured element in sufficient detail - /// that such a instance can be instantiated using it - /// - [EnumMember(Value = "Template")] - Template, - - /// - /// Concrete, clearly identifiable element instance. Its creation and validation - /// may be guided by a corresponding element template. - /// - [EnumMember(Value = "Instance")] - Instance - } - - /// - /// An element with a kind is an element that can either represent a template or an - /// instance. - /// - /// - /// Default for an element is that it is representing an instance. - /// - public interface IHasKind : IClass - { - /// - /// Kind of the element: either type or instance. - /// - /// - /// Default: - /// - public ModellingKind? Kind { get; set; } - - public ModellingKind KindOrDefault(); - } - - /// - /// Element that can be extended by using data specification templates. - /// - /// - /// A data specification template defines a named set of additional attributes an - /// element may or shall have. The data specifications used are explicitly specified - /// with their global ID. - /// - public interface IHasDataSpecification : IClass - { - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty(); - } - - /// - /// Administrative meta-information for an element like version - /// information. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-005: - /// If is not specified then also shall be - /// unspecified. This means, a revision requires a version. If there is no version - /// there is no revision neither. Revision is optional. - ///
  • - ///
- ///
- public interface IAdministrativeInformation : IHasDataSpecification - { - /// - /// Version of the element. - /// - public string? Version { get; set; } - - /// - /// Revision of the element. - /// - public string? Revision { get; set; } - - /// - /// The subject ID of the subject responsible for making the element. - /// - public IReference? Creator { get; set; } - - /// - /// Identifier of the template that guided the creation of the element. - /// - /// - /// - /// In case of a submodel the is the identifier - /// of the submodel template ID that guided the creation of the submodel - /// - /// - /// The is not relevant for validation in Submodels. - /// For validation the shall be used. - /// - /// - /// Usage of is not restricted to submodel instances. So also - /// the creation of submodel templates can be guided by another submodel template. - /// - /// - public string? TemplateId { get; set; } - } - - /// - /// Administrative meta-information for an element like version - /// information. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-005: - /// If is not specified then also shall be - /// unspecified. This means, a revision requires a version. If there is no version - /// there is no revision neither. Revision is optional. - ///
  • - ///
- ///
- public class AdministrativeInformation : IAdministrativeInformation - { - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Version of the element. - /// - public string? Version { get; set; } - - /// - /// Revision of the element. - /// - public string? Revision { get; set; } - - /// - /// The subject ID of the subject responsible for making the element. - /// - public IReference? Creator { get; set; } - - /// - /// Identifier of the template that guided the creation of the element. - /// - /// - /// - /// In case of a submodel the is the identifier - /// of the submodel template ID that guided the creation of the submodel - /// - /// - /// The is not relevant for validation in Submodels. - /// For validation the shall be used. - /// - /// - /// Usage of is not restricted to submodel instances. So also - /// the creation of submodel templates can be guided by another submodel template. - /// - /// - public string? TemplateId { get; set; } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - if (Creator != null) - { - yield return Creator; - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Creator != null) - { - yield return Creator; - - // Recurse - foreach (var anItem in Creator.Descend()) - { - yield return anItem; - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitAdministrativeInformation(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitAdministrativeInformation(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformAdministrativeInformation(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformAdministrativeInformation(this, context); - } - - public AdministrativeInformation( - List? embeddedDataSpecifications = null, - string? version = null, - string? revision = null, - IReference? creator = null, - string? templateId = null) - { - EmbeddedDataSpecifications = embeddedDataSpecifications; - Version = version; - Revision = revision; - Creator = creator; - TemplateId = templateId; - } - } - - /// - /// The value of a qualifiable element may be further qualified by one or more - /// qualifiers. - /// - /// - /// - /// This constraint is checked at . - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-119: - /// If any value of is - /// equal to and the qualified element - /// inherits from then the qualified element shall be of - /// kind Template ( = ). - ///
  • - ///
- ///
- public interface IQualifiable : IClass - { - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty(); - } - - /// - /// Enumeration for kinds of qualifiers. - /// - /// - /// This element is experimental and therefore may be subject to change or may be - /// removed completely in future versions of the meta-model. - /// - public enum QualifierKind - { - /// - /// qualifies the value of the element and can change during run-time. - /// - /// - /// Value qualifiers are only applicable to elements with kind - /// . - /// - [EnumMember(Value = "ValueQualifier")] - ValueQualifier, - - /// - /// qualifies the semantic definition the element is referring to - /// () - /// - [EnumMember(Value = "ConceptQualifier")] - ConceptQualifier, - - /// - /// qualifies the elements within a specific submodel on concept level. - /// - /// - /// Template qualifiers are only applicable to elements with kind - /// . - /// - [EnumMember(Value = "TemplateQualifier")] - TemplateQualifier - } - - /// - /// A qualifier is a type-value-pair that makes additional statements w.r.t. the value - /// of the element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-006: - /// If both the and the of - /// a are present then the needs - /// to be identical to the value of the referenced coded value - /// in . - ///
  • - ///
  • - /// Constraint AASd-020: - /// The value of shall be consistent to the data type as - /// defined in . - ///
  • - ///
- ///
- public interface IQualifier : IHasSemantics - { - /// - /// The qualifier kind describes the kind of the qualifier that is applied to the - /// element. - /// - /// - /// Default: - /// - public QualifierKind? Kind { get; set; } - - /// - /// The qualifier type describes the type of the qualifier that is applied to - /// the element. - /// - public string Type { get; set; } - - /// - /// Data type of the qualifier value. - /// - public DataTypeDefXsd ValueType { get; set; } - - /// - /// The qualifier value is the value of the qualifier. - /// - public string? Value { get; set; } - - /// - /// Reference to the global unique ID of a coded value. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? ValueId { get; set; } - - public QualifierKind KindOrDefault(); - } - - /// - /// A qualifier is a type-value-pair that makes additional statements w.r.t. the value - /// of the element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-006: - /// If both the and the of - /// a are present then the needs - /// to be identical to the value of the referenced coded value - /// in . - ///
  • - ///
  • - /// Constraint AASd-020: - /// The value of shall be consistent to the data type as - /// defined in . - ///
  • - ///
- ///
- public class Qualifier : IQualifier - { - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// The qualifier kind describes the kind of the qualifier that is applied to the - /// element. - /// - /// - /// Default: - /// - public QualifierKind? Kind { get; set; } - - /// - /// The qualifier type describes the type of the qualifier that is applied to - /// the element. - /// - public string Type { get; set; } - - /// - /// Data type of the qualifier value. - /// - public DataTypeDefXsd ValueType { get; set; } - - /// - /// The qualifier value is the value of the qualifier. - /// - public string? Value { get; set; } - - /// - /// Reference to the global unique ID of a coded value. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? ValueId { get; set; } - - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - #endregion - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Return the or the default value - /// if it has not been set. - /// - public QualifierKind KindOrDefault() - { - return Kind ?? QualifierKind.ConceptQualifier; - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (ValueId != null) - { - yield return ValueId; - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (ValueId != null) - { - yield return ValueId; - - // Recurse - foreach (var anItem in ValueId.Descend()) - { - yield return anItem; - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitQualifier(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitQualifier(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformQualifier(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformQualifier(this, context); - } - - public Qualifier( - string type, - DataTypeDefXsd valueType, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - QualifierKind? kind = null, - string? value = null, - IReference? valueId = null) - { - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Type = type; - ValueType = valueType; - Kind = kind; - Value = value; - ValueId = valueId; - } - } - - /// - /// An asset administration shell. - /// - public interface IAssetAdministrationShell : - IIdentifiable, - IHasDataSpecification - { - /// - /// The reference to the AAS the AAS was derived from. - /// - public IReference? DerivedFrom { get; set; } - - /// - /// Meta-information about the asset the AAS is representing. - /// - public IAssetInformation AssetInformation { get; set; } - - /// - /// References to submodels of the AAS. - /// - /// - /// - /// A submodel is a description of an aspect of the asset the AAS is representing. - /// - /// - /// The asset of an AAS is typically described by one or more submodels. - /// - /// - /// Temporarily no submodel might be assigned to the AAS. - /// - /// - public List? Submodels { get; set; } - - /// - /// Iterate over Submodels, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSubmodelsOrEmpty(); - } - - /// - /// An asset administration shell. - /// - public class AssetAdministrationShell : IAssetAdministrationShell - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Administrative information of an identifiable element. - /// - /// - /// Some of the administrative information like the version number might need to - /// be part of the identification. - /// - public IAdministrativeInformation? Administration { get; set; } - - /// - /// The globally unique identification of the element. - /// - public string Id { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// The reference to the AAS the AAS was derived from. - /// - public IReference? DerivedFrom { get; set; } - - /// - /// Meta-information about the asset the AAS is representing. - /// - public IAssetInformation AssetInformation { get; set; } - - /// - /// References to submodels of the AAS. - /// - /// - /// - /// A submodel is a description of an aspect of the asset the AAS is representing. - /// - /// - /// The asset of an AAS is typically described by one or more submodels. - /// - /// - /// Temporarily no submodel might be assigned to the AAS. - /// - /// - public List? Submodels { get; set; } - - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Submodels, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSubmodelsOrEmpty() - { - return Submodels - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (Administration != null) - { - yield return Administration; - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - if (DerivedFrom != null) - { - yield return DerivedFrom; - } - - yield return AssetInformation; - - if (Submodels != null) - { - foreach (var anItem in Submodels) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Administration != null) - { - yield return Administration; - - // Recurse - foreach (var anItem in Administration.Descend()) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DerivedFrom != null) - { - yield return DerivedFrom; - - // Recurse - foreach (var anItem in DerivedFrom.Descend()) - { - yield return anItem; - } - } - - yield return AssetInformation; - - // Recurse - foreach (var anItem in AssetInformation.Descend()) - { - yield return anItem; - } - - if (Submodels != null) - { - foreach (var anItem in Submodels) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitAssetAdministrationShell(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitAssetAdministrationShell(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformAssetAdministrationShell(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformAssetAdministrationShell(this, context); - } - - public AssetAdministrationShell( - string id, - IAssetInformation assetInformation, - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IAdministrativeInformation? administration = null, - List? embeddedDataSpecifications = null, - IReference? derivedFrom = null, - List? submodels = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - Id = id; - Administration = administration; - EmbeddedDataSpecifications = embeddedDataSpecifications; - DerivedFrom = derivedFrom; - AssetInformation = assetInformation; - Submodels = submodels; - } - } - - /// - /// In identifying meta data of the asset that is - /// represented by an AAS is defined. - /// - /// - /// - /// The asset may either represent an asset type or an asset instance. - /// - /// - /// The asset has a globally unique identifier plus – if needed – additional domain - /// specific (proprietary) identifiers. However, to support the corner case of very - /// first phase of lifecycle where a stabilised/constant_set global asset identifier - /// does not already exist, the corresponding attribute is - /// optional. - /// - /// - /// Constraint AASd-116 is important to enable a generic search across global - /// and specific asset IDs. - /// - /// - /// - /// In the book, Constraint AASd-116 imposes a - /// case-insensitive equality against globalAssetId. This is - /// culturally-dependent, and depends on the system settings. - /// For example, the case-folding for the letters "i" and "I" is - /// different in Turkish from English. - /// - /// - /// We implement the constraint as case-sensitive instead to allow - /// for interoperability across different culture settings. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-116: - /// globalAssetId is a reserved key. If used as value for - /// then shall be - /// identical to . - ///
  • - ///
  • - /// Constraint AASd-131: - /// For either the shall be - /// defined or at least one item in . - ///
  • - ///
- ///
- public interface IAssetInformation : IClass - { - /// - /// Denotes whether the Asset is of kind or - /// . - /// - public AssetKind AssetKind { get; set; } - - /// - /// Global identifier of the asset the AAS is representing. - /// - /// - /// - /// This attribute is required as soon as the AAS is exchanged via partners in the life - /// cycle of the asset. In a first phase of the life cycle the asset might not yet have - /// a global ID but already an internal identifier. The internal identifier would be - /// modelled via . - /// - /// - /// This is a global reference. - /// - /// - public string? GlobalAssetId { get; set; } - - /// - /// Additional domain-specific, typically proprietary identifier for the asset like - /// e.g., serial number etc. - /// - public List? SpecificAssetIds { get; set; } - - /// - /// In case is applicable the is the asset ID - /// of the type asset of the asset under consideration - /// as identified by . - /// - /// - /// In case is "Instance" than the denotes - /// which "Type" the asset is of. But it is also possible - /// to have an of an asset of kind "Type". - /// - public string? AssetType { get; set; } - - /// - /// Thumbnail of the asset represented by the Asset Administration Shell. - /// - /// - /// Used as default. - /// - public IResource? DefaultThumbnail { get; set; } - - /// - /// Iterate over SpecificAssetIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSpecificAssetIdsOrEmpty(); - } - - /// - /// In identifying meta data of the asset that is - /// represented by an AAS is defined. - /// - /// - /// - /// The asset may either represent an asset type or an asset instance. - /// - /// - /// The asset has a globally unique identifier plus – if needed – additional domain - /// specific (proprietary) identifiers. However, to support the corner case of very - /// first phase of lifecycle where a stabilised/constant_set global asset identifier - /// does not already exist, the corresponding attribute is - /// optional. - /// - /// - /// Constraint AASd-116 is important to enable a generic search across global - /// and specific asset IDs. - /// - /// - /// - /// In the book, Constraint AASd-116 imposes a - /// case-insensitive equality against globalAssetId. This is - /// culturally-dependent, and depends on the system settings. - /// For example, the case-folding for the letters "i" and "I" is - /// different in Turkish from English. - /// - /// - /// We implement the constraint as case-sensitive instead to allow - /// for interoperability across different culture settings. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-116: - /// globalAssetId is a reserved key. If used as value for - /// then shall be - /// identical to . - ///
  • - ///
  • - /// Constraint AASd-131: - /// For either the shall be - /// defined or at least one item in . - ///
  • - ///
- ///
- public class AssetInformation : IAssetInformation - { - /// - /// Denotes whether the Asset is of kind or - /// . - /// - public AssetKind AssetKind { get; set; } - - /// - /// Global identifier of the asset the AAS is representing. - /// - /// - /// - /// This attribute is required as soon as the AAS is exchanged via partners in the life - /// cycle of the asset. In a first phase of the life cycle the asset might not yet have - /// a global ID but already an internal identifier. The internal identifier would be - /// modelled via . - /// - /// - /// This is a global reference. - /// - /// - public string? GlobalAssetId { get; set; } - - /// - /// Additional domain-specific, typically proprietary identifier for the asset like - /// e.g., serial number etc. - /// - public List? SpecificAssetIds { get; set; } - - /// - /// In case is applicable the is the asset ID - /// of the type asset of the asset under consideration - /// as identified by . - /// - /// - /// In case is "Instance" than the denotes - /// which "Type" the asset is of. But it is also possible - /// to have an of an asset of kind "Type". - /// - public string? AssetType { get; set; } - - /// - /// Thumbnail of the asset represented by the Asset Administration Shell. - /// - /// - /// Used as default. - /// - public IResource? DefaultThumbnail { get; set; } - - /// - /// Iterate over SpecificAssetIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSpecificAssetIdsOrEmpty() - { - return SpecificAssetIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (SpecificAssetIds != null) - { - foreach (var anItem in SpecificAssetIds) - { - yield return anItem; - } - } - - if (DefaultThumbnail != null) - { - yield return DefaultThumbnail; - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (SpecificAssetIds != null) - { - foreach (var anItem in SpecificAssetIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DefaultThumbnail != null) - { - yield return DefaultThumbnail; - - // Recurse - foreach (var anItem in DefaultThumbnail.Descend()) - { - yield return anItem; - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitAssetInformation(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitAssetInformation(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformAssetInformation(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformAssetInformation(this, context); - } - - public AssetInformation( - AssetKind assetKind, - string? globalAssetId = null, - List? specificAssetIds = null, - string? assetType = null, - IResource? defaultThumbnail = null) - { - AssetKind = assetKind; - GlobalAssetId = globalAssetId; - SpecificAssetIds = specificAssetIds; - AssetType = assetType; - DefaultThumbnail = defaultThumbnail; - } - } - - /// - /// Resource represents an address to a file (a locator). The value is an URI that - /// can represent an absolute or relative path - /// - public interface IResource : IClass - { - /// - /// Path and name of the resource (with file extension). - /// - /// - /// The path can be absolute or relative. - /// - public string Path { get; set; } - - /// - /// Content type of the content of the file. - /// - /// - /// The content type states which file extensions the file can have. - /// - public string? ContentType { get; set; } - } - - /// - /// Resource represents an address to a file (a locator). The value is an URI that - /// can represent an absolute or relative path - /// - public class Resource : IResource - { - /// - /// Path and name of the resource (with file extension). - /// - /// - /// The path can be absolute or relative. - /// - public string Path { get; set; } - - /// - /// Content type of the content of the file. - /// - /// - /// The content type states which file extensions the file can have. - /// - public string? ContentType { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - // No descendable properties - yield break; - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - // No descendable properties - yield break; - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitResource(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitResource(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformResource(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformResource(this, context); - } - - public Resource( - string path, - string? contentType = null) - { - Path = path; - ContentType = contentType; - } - } - - /// - /// Enumeration for denoting whether an asset is a type asset or an instance asset. - /// - public enum AssetKind - { - /// - /// Type asset - /// - [EnumMember(Value = "Type")] - Type, - - /// - /// Instance asset - /// - [EnumMember(Value = "Instance")] - Instance, - - /// - /// Neither a type asset nor an instance asset - /// - [EnumMember(Value = "NotApplicable")] - NotApplicable - } - - /// - /// A specific asset ID describes a generic supplementary identifying attribute of the - /// asset. - /// - /// - /// - /// The specific asset ID is not necessarily globally unique. - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-133: - /// shall be an external reference, - /// i.e. = . - ///
  • - ///
- ///
- public interface ISpecificAssetId : IHasSemantics - { - /// - /// Name of the identifier - /// - public string Name { get; set; } - - /// - /// The value of the specific asset identifier with the corresponding name. - /// - public string Value { get; set; } - - /// - /// The (external) subject the key belongs to or has meaning to. - /// - /// - /// This is a global reference. - /// - public IReference? ExternalSubjectId { get; set; } - } - - /// - /// A specific asset ID describes a generic supplementary identifying attribute of the - /// asset. - /// - /// - /// - /// The specific asset ID is not necessarily globally unique. - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-133: - /// shall be an external reference, - /// i.e. = . - ///
  • - ///
- ///
- public class SpecificAssetId : ISpecificAssetId - { - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Name of the identifier - /// - public string Name { get; set; } - - /// - /// The value of the specific asset identifier with the corresponding name. - /// - public string Value { get; set; } - - /// - /// The (external) subject the key belongs to or has meaning to. - /// - /// - /// This is a global reference. - /// - public IReference? ExternalSubjectId { get; set; } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (ExternalSubjectId != null) - { - yield return ExternalSubjectId; - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (ExternalSubjectId != null) - { - yield return ExternalSubjectId; - - // Recurse - foreach (var anItem in ExternalSubjectId.Descend()) - { - yield return anItem; - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitSpecificAssetId(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitSpecificAssetId(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformSpecificAssetId(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformSpecificAssetId(this, context); - } - - public SpecificAssetId( - string name, - string value, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - IReference? externalSubjectId = null) - { - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Name = name; - Value = value; - ExternalSubjectId = externalSubjectId; - } - } - - /// - /// A submodel defines a specific aspect of the asset represented by the AAS. - /// - /// - /// A submodel is used to structure the digital representation and technical - /// functionality of an Administration Shell into distinguishable parts. Each submodel - /// refers to a well-defined domain or subject matter. Submodels can become - /// standardized and, thus, become submodels templates. - /// - public interface ISubmodel : - IIdentifiable, - IHasKind, - IHasSemantics, - IQualifiable, - IHasDataSpecification - { - /// - /// A submodel consists of zero or more submodel elements. - /// - public List? SubmodelElements { get; set; } - - /// - /// Iterate over SubmodelElements, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSubmodelElementsOrEmpty(); - } - - /// - /// A submodel defines a specific aspect of the asset represented by the AAS. - /// - /// - /// A submodel is used to structure the digital representation and technical - /// functionality of an Administration Shell into distinguishable parts. Each submodel - /// refers to a well-defined domain or subject matter. Submodels can become - /// standardized and, thus, become submodels templates. - /// - public class Submodel : ISubmodel - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Administrative information of an identifiable element. - /// - /// - /// Some of the administrative information like the version number might need to - /// be part of the identification. - /// - public IAdministrativeInformation? Administration { get; set; } - - /// - /// The globally unique identification of the element. - /// - public string Id { get; set; } - - /// - /// Kind of the element: either type or instance. - /// - /// - /// Default: - /// - public ModellingKind? Kind { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// A submodel consists of zero or more submodel elements. - /// - public List? SubmodelElements { get; set; } - - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SubmodelElements, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSubmodelElementsOrEmpty() - { - return SubmodelElements - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Return the or the default value - /// if it has not been set. - /// - public ModellingKind KindOrDefault() - { - return Kind ?? ModellingKind.Instance; - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (Administration != null) - { - yield return Administration; - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - if (SubmodelElements != null) - { - foreach (var anItem in SubmodelElements) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Administration != null) - { - yield return Administration; - - // Recurse - foreach (var anItem in Administration.Descend()) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SubmodelElements != null) - { - foreach (var anItem in SubmodelElements) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitSubmodel(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitSubmodel(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformSubmodel(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformSubmodel(this, context); - } - - public Submodel( - string id, - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IAdministrativeInformation? administration = null, - ModellingKind? kind = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null, - List? submodelElements = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - Id = id; - Administration = administration; - Kind = kind; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - SubmodelElements = submodelElements; - } - } - - /// - /// A submodel element is an element suitable for the description and differentiation of - /// assets. - /// - /// - /// - /// It is recommended to add a to a submodel element. - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-129: - /// If any value of (attribute qualifier - /// inherited via Qualifiable) is equal to - /// then the submodel element shall be part of a submodel template, i.e. - /// a Submodel with (attribute kind inherited via - /// ) value is equal to . - ///
  • - ///
- ///
- public interface ISubmodelElement : - IReferable, - IHasSemantics, - IQualifiable, - IHasDataSpecification - { - // Intentionally empty. - } - - /// - /// A relationship element is used to define a relationship between two elements - /// being either referable (model reference) or external (global reference). - /// - public interface IRelationshipElement : ISubmodelElement - { - /// - /// Reference to the first element in the relationship taking the role of the subject. - /// - public IReference First { get; set; } - - /// - /// Reference to the second element in the relationship taking the role of the object. - /// - public IReference Second { get; set; } - } - - /// - /// A relationship element is used to define a relationship between two elements - /// being either referable (model reference) or external (global reference). - /// - public class RelationshipElement : IRelationshipElement - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Reference to the first element in the relationship taking the role of the subject. - /// - public IReference First { get; set; } - - /// - /// Reference to the second element in the relationship taking the role of the object. - /// - public IReference Second { get; set; } - - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - yield return First; - - yield return Second; - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - yield return First; - - // Recurse - foreach (var anItem in First.Descend()) - { - yield return anItem; - } - - yield return Second; - - // Recurse - foreach (var anItem in Second.Descend()) - { - yield return anItem; - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitRelationshipElement(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitRelationshipElement(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformRelationshipElement(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformRelationshipElement(this, context); - } - - public RelationshipElement( - IReference first, - IReference second, - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - First = first; - Second = second; - } - } - - /// - /// Enumeration of all possible elements of a . - /// - public enum AasSubmodelElements - { - [EnumMember(Value = "AnnotatedRelationshipElement")] - AnnotatedRelationshipElement, - - [EnumMember(Value = "BasicEventElement")] - BasicEventElement, - - [EnumMember(Value = "Blob")] - Blob, - - [EnumMember(Value = "Capability")] - Capability, - - [EnumMember(Value = "DataElement")] - DataElement, - - [EnumMember(Value = "Entity")] - Entity, - - [EnumMember(Value = "EventElement")] - EventElement, - - [EnumMember(Value = "File")] - File, - - [EnumMember(Value = "MultiLanguageProperty")] - MultiLanguageProperty, - - [EnumMember(Value = "Operation")] - Operation, - - [EnumMember(Value = "Property")] - Property, - - [EnumMember(Value = "Range")] - Range, - - [EnumMember(Value = "ReferenceElement")] - ReferenceElement, - - [EnumMember(Value = "RelationshipElement")] - RelationshipElement, - - [EnumMember(Value = "SubmodelElement")] - SubmodelElement, - - [EnumMember(Value = "SubmodelElementList")] - SubmodelElementList, - - [EnumMember(Value = "SubmodelElementCollection")] - SubmodelElementCollection - } - - /// - /// A submodel element list is an ordered list of submodel elements. - /// - /// - /// - /// The numbering starts with zero (0). - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-107: - /// If a first level child element in a has - /// a it - /// shall be identical to . - ///
  • - ///
  • - /// Constraint AASd-114: - /// If two first level child elements in a have - /// a then they shall be identical. - ///
  • - ///
  • - /// Constraint AASd-115: - /// If a first level child element in a does not - /// specify a then the value is assumed to be - /// identical to . - ///
  • - ///
  • - /// Constraint AASd-108: - /// All first level child elements in a shall have - /// the same submodel element type as specified in . - ///
  • - ///
  • - /// Constraint AASd-109: - /// If is equal to - /// or - /// - /// shall be set and all first - /// level child elements in the shall have - /// the value type as specified in . - ///
  • - ///
- ///
- public interface ISubmodelElementList : ISubmodelElement - { - /// - /// Defines whether order in list is relevant. If = False - /// then the list is representing a set or a bag. - /// - /// - /// Default: True - /// - public bool? OrderRelevant { get; set; } - - /// - /// Semantic ID the submodel elements contained in the list match to. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticIdListElement { get; set; } - - /// - /// The submodel element type of the submodel elements contained in the list. - /// - public AasSubmodelElements TypeValueListElement { get; set; } - - /// - /// The value type of the submodel element contained in the list. - /// - public DataTypeDefXsd? ValueTypeListElement { get; set; } - - /// - /// Submodel element contained in the list. - /// - /// - /// The list is ordered. - /// - public List? Value { get; set; } - - public bool OrderRelevantOrDefault(); - - /// - /// Iterate over Value, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverValueOrEmpty(); - } - - /// - /// A submodel element list is an ordered list of submodel elements. - /// - /// - /// - /// The numbering starts with zero (0). - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-107: - /// If a first level child element in a has - /// a it - /// shall be identical to . - ///
  • - ///
  • - /// Constraint AASd-114: - /// If two first level child elements in a have - /// a then they shall be identical. - ///
  • - ///
  • - /// Constraint AASd-115: - /// If a first level child element in a does not - /// specify a then the value is assumed to be - /// identical to . - ///
  • - ///
  • - /// Constraint AASd-108: - /// All first level child elements in a shall have - /// the same submodel element type as specified in . - ///
  • - ///
  • - /// Constraint AASd-109: - /// If is equal to - /// or - /// - /// shall be set and all first - /// level child elements in the shall have - /// the value type as specified in . - ///
  • - ///
- ///
- public class SubmodelElementList : ISubmodelElementList - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Defines whether order in list is relevant. If = False - /// then the list is representing a set or a bag. - /// - /// - /// Default: True - /// - public bool? OrderRelevant { get; set; } - - /// - /// Semantic ID the submodel elements contained in the list match to. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticIdListElement { get; set; } - - /// - /// The submodel element type of the submodel elements contained in the list. - /// - public AasSubmodelElements TypeValueListElement { get; set; } - - /// - /// The value type of the submodel element contained in the list. - /// - public DataTypeDefXsd? ValueTypeListElement { get; set; } - - /// - /// Submodel element contained in the list. - /// - /// - /// The list is ordered. - /// - public List? Value { get; set; } - - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Value, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverValueOrEmpty() - { - return Value - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Return the or the default value - /// if it has not been set. - /// - public bool OrderRelevantOrDefault() - { - return OrderRelevant ?? true; - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - if (SemanticIdListElement != null) - { - yield return SemanticIdListElement; - } - - if (Value != null) - { - foreach (var anItem in Value) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticIdListElement != null) - { - yield return SemanticIdListElement; - - // Recurse - foreach (var anItem in SemanticIdListElement.Descend()) - { - yield return anItem; - } - } - - if (Value != null) - { - foreach (var anItem in Value) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitSubmodelElementList(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitSubmodelElementList(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformSubmodelElementList(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformSubmodelElementList(this, context); - } - - public SubmodelElementList( - AasSubmodelElements typeValueListElement, - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null, - bool? orderRelevant = null, - IReference? semanticIdListElement = null, - DataTypeDefXsd? valueTypeListElement = null, - List? value = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - TypeValueListElement = typeValueListElement; - OrderRelevant = orderRelevant; - SemanticIdListElement = semanticIdListElement; - ValueTypeListElement = valueTypeListElement; - Value = value; - } - } - - /// - /// A submodel element collection is a kind of struct, i.e. a a logical encapsulation - /// of multiple named values. It has a fixed number of submodel elements. - /// - public interface ISubmodelElementCollection : ISubmodelElement - { - /// - /// Submodel element contained in the collection. - /// - public List? Value { get; set; } - - /// - /// Iterate over Value, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverValueOrEmpty(); - } - - /// - /// A submodel element collection is a kind of struct, i.e. a a logical encapsulation - /// of multiple named values. It has a fixed number of submodel elements. - /// - public class SubmodelElementCollection : ISubmodelElementCollection - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Submodel element contained in the collection. - /// - public List? Value { get; set; } - - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Value, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverValueOrEmpty() - { - return Value - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - if (Value != null) - { - foreach (var anItem in Value) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Value != null) - { - foreach (var anItem in Value) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitSubmodelElementCollection(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitSubmodelElementCollection(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformSubmodelElementCollection(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformSubmodelElementCollection(this, context); - } - - public SubmodelElementCollection( - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null, - List? value = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - Value = value; - } - } - - /// - /// A data element is a submodel element that is not further composed out of - /// other submodel elements. - /// - /// - /// - /// A data element is a submodel element that has a value. The type of value differs - /// for different subtypes of data elements. - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// - /// Constraint AASd-090: - /// For data elements shall be one of the following - /// values: CONSTANT, PARAMETER or VARIABLE. - /// - /// - /// Default: VARIABLE - /// - ///
  • - ///
- ///
- public interface IDataElement : ISubmodelElement - { - public string CategoryOrDefault(); - } - - /// - /// A property is a data element that has a single value. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-007: - /// If both, the and the are - /// present then the value of needs to be identical to - /// the value of the referenced coded value in . - ///
  • - ///
- ///
- public interface IProperty : IDataElement - { - /// - /// Data type of the value - /// - public DataTypeDefXsd ValueType { get; set; } - - /// - /// The value of the property instance. - /// - public string? Value { get; set; } - - /// - /// Reference to the global unique ID of a coded value. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? ValueId { get; set; } - } - - /// - /// A property is a data element that has a single value. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-007: - /// If both, the and the are - /// present then the value of needs to be identical to - /// the value of the referenced coded value in . - ///
  • - ///
- ///
- public class Property : IProperty - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Data type of the value - /// - public DataTypeDefXsd ValueType { get; set; } - - /// - /// The value of the property instance. - /// - public string? Value { get; set; } - - /// - /// Reference to the global unique ID of a coded value. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? ValueId { get; set; } - - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Return the or the default value - /// if it has not been set. - /// - public string CategoryOrDefault() - { - string result = Category ?? "VARIABLE"; - -#if DEBUG - if (!Constants.ValidCategoriesForDataElement.Contains( - result)) - { - throw new System.InvalidOperationException( - $"Unexpected default category: {result}" - ); - } -#endif - - return result; - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - if (ValueId != null) - { - yield return ValueId; - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (ValueId != null) - { - yield return ValueId; - - // Recurse - foreach (var anItem in ValueId.Descend()) - { - yield return anItem; - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitProperty(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitProperty(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformProperty(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformProperty(this, context); - } - - public Property( - DataTypeDefXsd valueType, - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null, - string? value = null, - IReference? valueId = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - ValueType = valueType; - Value = value; - ValueId = valueId; - } - } - - /// - /// A property is a data element that has a multi-language value. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-012: - /// If both the and the are present then for each - /// string in a specific language the meaning must be the same as specified in - /// . - ///
  • - ///
- ///
- public interface IMultiLanguageProperty : IDataElement - { - /// - /// The value of the property instance. - /// - public List? Value { get; set; } - - /// - /// Reference to the global unique ID of a coded value. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? ValueId { get; set; } - - /// - /// Iterate over Value, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverValueOrEmpty(); - } - - /// - /// A property is a data element that has a multi-language value. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-012: - /// If both the and the are present then for each - /// string in a specific language the meaning must be the same as specified in - /// . - ///
  • - ///
- ///
- public class MultiLanguageProperty : IMultiLanguageProperty - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// The value of the property instance. - /// - public List? Value { get; set; } - - /// - /// Reference to the global unique ID of a coded value. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? ValueId { get; set; } - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Value, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverValueOrEmpty() - { - return Value - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Return the or the default value - /// if it has not been set. - /// - public string CategoryOrDefault() - { - string result = Category ?? "VARIABLE"; - -#if DEBUG - if (!Constants.ValidCategoriesForDataElement.Contains( - result)) - { - throw new System.InvalidOperationException( - $"Unexpected default category: {result}" - ); - } -#endif - - return result; - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - if (Value != null) - { - foreach (var anItem in Value) - { - yield return anItem; - } - } - - if (ValueId != null) - { - yield return ValueId; - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Value != null) - { - foreach (var anItem in Value) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (ValueId != null) - { - yield return ValueId; - - // Recurse - foreach (var anItem in ValueId.Descend()) - { - yield return anItem; - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitMultiLanguageProperty(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitMultiLanguageProperty(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformMultiLanguageProperty(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformMultiLanguageProperty(this, context); - } - - public MultiLanguageProperty( - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null, - List? value = null, - IReference? valueId = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - Value = value; - ValueId = valueId; - } - } - - /// - /// A range data element is a data element that defines a range with min and max. - /// - public interface IRange : IDataElement - { - /// - /// Data type of the min und max - /// - public DataTypeDefXsd ValueType { get; set; } - - /// - /// The minimum value of the range. - /// - /// - /// If the min value is missing, then the value is assumed to be negative infinite. - /// - public string? Min { get; set; } - - /// - /// The maximum value of the range. - /// - /// - /// If the max value is missing, then the value is assumed to be positive infinite. - /// - public string? Max { get; set; } - } - - /// - /// A range data element is a data element that defines a range with min and max. - /// - public class Range : IRange - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Data type of the min und max - /// - public DataTypeDefXsd ValueType { get; set; } - - /// - /// The minimum value of the range. - /// - /// - /// If the min value is missing, then the value is assumed to be negative infinite. - /// - public string? Min { get; set; } - - /// - /// The maximum value of the range. - /// - /// - /// If the max value is missing, then the value is assumed to be positive infinite. - /// - public string? Max { get; set; } - - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Return the or the default value - /// if it has not been set. - /// - public string CategoryOrDefault() - { - string result = Category ?? "VARIABLE"; - -#if DEBUG - if (!Constants.ValidCategoriesForDataElement.Contains( - result)) - { - throw new System.InvalidOperationException( - $"Unexpected default category: {result}" - ); - } -#endif - - return result; - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitRange(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitRange(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformRange(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformRange(this, context); - } - - public Range( - DataTypeDefXsd valueType, - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null, - string? min = null, - string? max = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - ValueType = valueType; - Min = min; - Max = max; - } - } - - /// - /// A reference element is a data element that defines a logical reference to another - /// element within the same or another AAS or a reference to an external object or - /// entity. - /// - public interface IReferenceElement : IDataElement - { - /// - /// Global reference to an external object or entity or a logical reference to - /// another element within the same or another AAS (i.e. a model reference to - /// a Referable). - /// - public IReference? Value { get; set; } - } - - /// - /// A reference element is a data element that defines a logical reference to another - /// element within the same or another AAS or a reference to an external object or - /// entity. - /// - public class ReferenceElement : IReferenceElement - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Global reference to an external object or entity or a logical reference to - /// another element within the same or another AAS (i.e. a model reference to - /// a Referable). - /// - public IReference? Value { get; set; } - - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Return the or the default value - /// if it has not been set. - /// - public string CategoryOrDefault() - { - string result = Category ?? "VARIABLE"; - -#if DEBUG - if (!Constants.ValidCategoriesForDataElement.Contains( - result)) - { - throw new System.InvalidOperationException( - $"Unexpected default category: {result}" - ); - } -#endif - - return result; - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - if (Value != null) - { - yield return Value; - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Value != null) - { - yield return Value; - - // Recurse - foreach (var anItem in Value.Descend()) - { - yield return anItem; - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitReferenceElement(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitReferenceElement(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformReferenceElement(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformReferenceElement(this, context); - } - - public ReferenceElement( - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null, - IReference? value = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - Value = value; - } - } - - /// - /// A is a data element that represents a file that is contained with its - /// source code in the value attribute. - /// - public interface IBlob : IDataElement - { - /// - /// The value of the instance of a blob data element. - /// - /// - /// In contrast to the file property the file content is stored directly as value - /// in the data element. - /// - public byte[]? Value { get; set; } - - /// - /// Content type of the content of the . - /// - /// - /// - /// The content type (MIME type) states which file extensions the file can have. - /// - /// - /// Valid values are content types like e.g. application/json, application/xls, - /// image/jpg. - /// - /// - /// The allowed values are defined as in RFC2046. - /// - /// - public string ContentType { get; set; } - } - - /// - /// A is a data element that represents a file that is contained with its - /// source code in the value attribute. - /// - public class Blob : IBlob - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// The value of the instance of a blob data element. - /// - /// - /// In contrast to the file property the file content is stored directly as value - /// in the data element. - /// - public byte[]? Value { get; set; } - - /// - /// Content type of the content of the . - /// - /// - /// - /// The content type (MIME type) states which file extensions the file can have. - /// - /// - /// Valid values are content types like e.g. application/json, application/xls, - /// image/jpg. - /// - /// - /// The allowed values are defined as in RFC2046. - /// - /// - public string ContentType { get; set; } - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Return the or the default value - /// if it has not been set. - /// - public string CategoryOrDefault() - { - string result = Category ?? "VARIABLE"; - -#if DEBUG - if (!Constants.ValidCategoriesForDataElement.Contains( - result)) - { - throw new System.InvalidOperationException( - $"Unexpected default category: {result}" - ); - } -#endif - - return result; - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitBlob(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitBlob(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformBlob(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformBlob(this, context); - } - - public Blob( - string contentType, - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null, - byte[]? value = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - ContentType = contentType; - Value = value; - } - } - - /// - /// A File is a data element that represents an address to a file (a locator). - /// - /// - /// The value is an URI that can represent an absolute or relative path. - /// - public interface IFile : IDataElement - { - /// - /// Path and name of the referenced file (with file extension). - /// - /// - /// The path can be absolute or relative. - /// - public string? Value { get; set; } - - /// - /// Content type of the content of the file. - /// - /// - /// The content type states which file extensions the file can have. - /// - public string ContentType { get; set; } - } - - /// - /// A File is a data element that represents an address to a file (a locator). - /// - /// - /// The value is an URI that can represent an absolute or relative path. - /// - public class File : IFile - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Path and name of the referenced file (with file extension). - /// - /// - /// The path can be absolute or relative. - /// - public string? Value { get; set; } - - /// - /// Content type of the content of the file. - /// - /// - /// The content type states which file extensions the file can have. - /// - public string ContentType { get; set; } - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Return the or the default value - /// if it has not been set. - /// - public string CategoryOrDefault() - { - string result = Category ?? "VARIABLE"; - -#if DEBUG - if (!Constants.ValidCategoriesForDataElement.Contains( - result)) - { - throw new System.InvalidOperationException( - $"Unexpected default category: {result}" - ); - } -#endif - - return result; - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitFile(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitFile(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformFile(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformFile(this, context); - } - - public File( - string contentType, - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null, - string? value = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - ContentType = contentType; - Value = value; - } - } - - /// - /// An annotated relationship element is a relationship element that can be annotated - /// with additional data elements. - /// - public interface IAnnotatedRelationshipElement : IRelationshipElement - { - /// - /// A data element that represents an annotation that holds for the relationship - /// between the two elements - /// - public List? Annotations { get; set; } - - /// - /// Iterate over Annotations, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverAnnotationsOrEmpty(); - } - - /// - /// An annotated relationship element is a relationship element that can be annotated - /// with additional data elements. - /// - public class AnnotatedRelationshipElement : IAnnotatedRelationshipElement - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Reference to the first element in the relationship taking the role of the subject. - /// - public IReference First { get; set; } - - /// - /// Reference to the second element in the relationship taking the role of the object. - /// - public IReference Second { get; set; } - - /// - /// A data element that represents an annotation that holds for the relationship - /// between the two elements - /// - public List? Annotations { get; set; } - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Annotations, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverAnnotationsOrEmpty() - { - return Annotations - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - yield return First; - - yield return Second; - - if (Annotations != null) - { - foreach (var anItem in Annotations) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - yield return First; - - // Recurse - foreach (var anItem in First.Descend()) - { - yield return anItem; - } - - yield return Second; - - // Recurse - foreach (var anItem in Second.Descend()) - { - yield return anItem; - } - - if (Annotations != null) - { - foreach (var anItem in Annotations) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitAnnotatedRelationshipElement(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitAnnotatedRelationshipElement(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformAnnotatedRelationshipElement(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformAnnotatedRelationshipElement(this, context); - } - - public AnnotatedRelationshipElement( - IReference first, - IReference second, - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null, - List? annotations = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - First = first; - Second = second; - Annotations = annotations; - } - } - - /// - /// An entity is a submodel element that is used to model entities. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-014: - /// Either the attribute or - /// of an must be set if is set to - /// . They are not existing otherwise. - ///
  • - ///
- ///
- public interface IEntity : ISubmodelElement - { - /// - /// Describes statements applicable to the entity by a set of submodel elements, - /// typically with a qualified value. - /// - public List? Statements { get; set; } - - /// - /// Describes whether the entity is a co-managed entity or a self-managed entity. - /// - public EntityType EntityType { get; set; } - - /// - /// Global identifier of the asset the entity is representing. - /// - /// - /// This is a global reference. - /// - public string? GlobalAssetId { get; set; } - - /// - /// Reference to a specific asset ID representing a supplementary identifier - /// of the asset represented by the Asset Administration Shell. - /// - public List? SpecificAssetIds { get; set; } - - /// - /// Iterate over Statements, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverStatementsOrEmpty(); - - /// - /// Iterate over SpecificAssetIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSpecificAssetIdsOrEmpty(); - } - - /// - /// An entity is a submodel element that is used to model entities. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-014: - /// Either the attribute or - /// of an must be set if is set to - /// . They are not existing otherwise. - ///
  • - ///
- ///
- public class Entity : IEntity - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Describes statements applicable to the entity by a set of submodel elements, - /// typically with a qualified value. - /// - public List? Statements { get; set; } - - /// - /// Describes whether the entity is a co-managed entity or a self-managed entity. - /// - public EntityType EntityType { get; set; } - - /// - /// Global identifier of the asset the entity is representing. - /// - /// - /// This is a global reference. - /// - public string? GlobalAssetId { get; set; } - - /// - /// Reference to a specific asset ID representing a supplementary identifier - /// of the asset represented by the Asset Administration Shell. - /// - public List? SpecificAssetIds { get; set; } - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Statements, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverStatementsOrEmpty() - { - return Statements - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SpecificAssetIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSpecificAssetIdsOrEmpty() - { - return SpecificAssetIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - if (Statements != null) - { - foreach (var anItem in Statements) - { - yield return anItem; - } - } - - if (SpecificAssetIds != null) - { - foreach (var anItem in SpecificAssetIds) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Statements != null) - { - foreach (var anItem in Statements) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SpecificAssetIds != null) - { - foreach (var anItem in SpecificAssetIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitEntity(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitEntity(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformEntity(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformEntity(this, context); - } - - public Entity( - EntityType entityType, - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null, - List? statements = null, - string? globalAssetId = null, - List? specificAssetIds = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - Statements = statements; - EntityType = entityType; - GlobalAssetId = globalAssetId; - SpecificAssetIds = specificAssetIds; - } - } - - /// - /// Enumeration for denoting whether an entity is a self-managed entity or a co-managed - /// entity. - /// - public enum EntityType - { - /// - /// For co-managed entities there is no separate AAS. Co-managed entities need to be - /// part of a self-managed entity. - /// - [EnumMember(Value = "CoManagedEntity")] - CoManagedEntity, - - /// - /// Self-Managed Entities have their own AAS but can be part of the bill of material of - /// a composite self-managed entity. - /// - /// - /// The asset of an I4.0 Component is a self-managed entity per definition. - /// - [EnumMember(Value = "SelfManagedEntity")] - SelfManagedEntity - } - - /// - /// Direction - /// - /// - /// This element is experimental and therefore may be subject to change or may be - /// removed completely in future versions of the meta-model. - /// - public enum Direction - { - /// - /// Input direction. - /// - [EnumMember(Value = "input")] - Input, - - /// - /// Output direction - /// - [EnumMember(Value = "output")] - Output - } - - /// - /// State of an event - /// - /// - /// This element is experimental and therefore may be subject to change or may be - /// removed completely in future versions of the meta-model. - /// - public enum StateOfEvent - { - /// - /// Event is on - /// - [EnumMember(Value = "on")] - On, - - /// - /// Event is off. - /// - [EnumMember(Value = "off")] - Off - } - - /// - /// Defines the necessary information of an event instance sent out or received. - /// - /// - /// This element is experimental and therefore may be subject to change or may be - /// removed completely in future versions of the meta-model. - /// - public interface IEventPayload : IClass - { - /// - /// Reference to the source event element, including identification of - /// , , - /// 's. - /// - public IReference Source { get; set; } - - /// - /// of the source event element, if available - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SourceSemanticId { get; set; } - - /// - /// Reference to the referable, which defines the scope of the event. - /// - /// - /// Can be , or - /// . - /// - public IReference ObservableReference { get; set; } - - /// - /// of the referable which defines the scope of - /// the event, if available. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? ObservableSemanticId { get; set; } - - /// - /// Information for the outer message infrastructure for scheduling the event to - /// the respective communication channel. - /// - public string? Topic { get; set; } - - /// - /// Subject, who/which initiated the creation. - /// - /// - /// This is an external reference. - /// - public IReference? SubjectId { get; set; } - - /// - /// Timestamp in UTC, when this event was triggered. - /// - public string TimeStamp { get; set; } - - /// - /// Event specific payload. - /// - public byte[]? Payload { get; set; } - } - - /// - /// Defines the necessary information of an event instance sent out or received. - /// - /// - /// This element is experimental and therefore may be subject to change or may be - /// removed completely in future versions of the meta-model. - /// - public class EventPayload : IEventPayload - { - /// - /// Reference to the source event element, including identification of - /// , , - /// 's. - /// - public IReference Source { get; set; } - - /// - /// of the source event element, if available - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SourceSemanticId { get; set; } - - /// - /// Reference to the referable, which defines the scope of the event. - /// - /// - /// Can be , or - /// . - /// - public IReference ObservableReference { get; set; } - - /// - /// of the referable which defines the scope of - /// the event, if available. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? ObservableSemanticId { get; set; } - - /// - /// Information for the outer message infrastructure for scheduling the event to - /// the respective communication channel. - /// - public string? Topic { get; set; } - - /// - /// Subject, who/which initiated the creation. - /// - /// - /// This is an external reference. - /// - public IReference? SubjectId { get; set; } - - /// - /// Timestamp in UTC, when this event was triggered. - /// - public string TimeStamp { get; set; } - - /// - /// Event specific payload. - /// - public byte[]? Payload { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - yield return Source; - - if (SourceSemanticId != null) - { - yield return SourceSemanticId; - } - - yield return ObservableReference; - - if (ObservableSemanticId != null) - { - yield return ObservableSemanticId; - } - - if (SubjectId != null) - { - yield return SubjectId; - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - yield return Source; - - // Recurse - foreach (var anItem in Source.Descend()) - { - yield return anItem; - } - - if (SourceSemanticId != null) - { - yield return SourceSemanticId; - - // Recurse - foreach (var anItem in SourceSemanticId.Descend()) - { - yield return anItem; - } - } - - yield return ObservableReference; - - // Recurse - foreach (var anItem in ObservableReference.Descend()) - { - yield return anItem; - } - - if (ObservableSemanticId != null) - { - yield return ObservableSemanticId; - - // Recurse - foreach (var anItem in ObservableSemanticId.Descend()) - { - yield return anItem; - } - } - - if (SubjectId != null) - { - yield return SubjectId; - - // Recurse - foreach (var anItem in SubjectId.Descend()) - { - yield return anItem; - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitEventPayload(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitEventPayload(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformEventPayload(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformEventPayload(this, context); - } - - public EventPayload( - IReference source, - IReference observableReference, - string timeStamp, - IReference? sourceSemanticId = null, - IReference? observableSemanticId = null, - string? topic = null, - IReference? subjectId = null, - byte[]? payload = null) - { - Source = source; - ObservableReference = observableReference; - TimeStamp = timeStamp; - SourceSemanticId = sourceSemanticId; - ObservableSemanticId = observableSemanticId; - Topic = topic; - SubjectId = subjectId; - Payload = payload; - } - } - - /// - /// An event element. - /// - /// - /// This element is experimental and therefore may be subject to change or may be - /// removed completely in future versions of the meta-model. - /// - public interface IEventElement : ISubmodelElement - { - // Intentionally empty. - } - - /// - /// A basic event element. - /// - /// - /// This element is experimental and therefore may be subject to change or may be - /// removed completely in future versions of the meta-model. - /// - public interface IBasicEventElement : IEventElement - { - /// - /// Reference to the , which defines the scope of the event. - /// Can be , , or - /// . - /// - /// - /// Reference to a referable, e.g., a data element or - /// a submodel, that is being observed. - /// - public IReference Observed { get; set; } - - /// - /// Direction of event. - /// - /// - /// Can be { Input, Output }. - /// - public Direction Direction { get; set; } - - /// - /// State of event. - /// - /// - /// Can be { On, Off }. - /// - public StateOfEvent State { get; set; } - - /// - /// Information for the outer message infrastructure for scheduling the event to the - /// respective communication channel. - /// - public string? MessageTopic { get; set; } - - /// - /// Information, which outer message infrastructure shall handle messages for - /// the . Refers to a , - /// , or - /// , which contains 's describing - /// the proprietary specification for the message broker. - /// - /// - /// For different message infrastructure, e.g., OPC UA or MQTT or AMQP, this - /// proprietary specification could be standardized by having respective Submodels. - /// - public IReference? MessageBroker { get; set; } - - /// - /// Timestamp in UTC, when the last event was received (input direction) or sent - /// (output direction). - /// - public string? LastUpdate { get; set; } - - /// - /// For input direction, reports on the maximum frequency, the software entity behind - /// the respective Referable can handle input events. - /// - /// - /// - /// For output events, specifies the maximum frequency of outputting this event to - /// an outer infrastructure. - /// - /// - /// Might be not specified, that is, there is no minimum interval. - /// - /// - public string? MinInterval { get; set; } - - /// - /// For input direction: not applicable. - /// - /// - /// - /// For output direction: maximum interval in time, the respective Referable shall send - /// an update of the status of the event, even if no other trigger condition for - /// the event was not met. - /// - /// - /// Might be not specified, that is, there is no maximum interval - /// - /// - public string? MaxInterval { get; set; } - } - - /// - /// A basic event element. - /// - /// - /// This element is experimental and therefore may be subject to change or may be - /// removed completely in future versions of the meta-model. - /// - public class BasicEventElement : IBasicEventElement - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Reference to the , which defines the scope of the event. - /// Can be , , or - /// . - /// - /// - /// Reference to a referable, e.g., a data element or - /// a submodel, that is being observed. - /// - public IReference Observed { get; set; } - - /// - /// Direction of event. - /// - /// - /// Can be { Input, Output }. - /// - public Direction Direction { get; set; } - - /// - /// State of event. - /// - /// - /// Can be { On, Off }. - /// - public StateOfEvent State { get; set; } - - /// - /// Information for the outer message infrastructure for scheduling the event to the - /// respective communication channel. - /// - public string? MessageTopic { get; set; } - - /// - /// Information, which outer message infrastructure shall handle messages for - /// the . Refers to a , - /// , or - /// , which contains 's describing - /// the proprietary specification for the message broker. - /// - /// - /// For different message infrastructure, e.g., OPC UA or MQTT or AMQP, this - /// proprietary specification could be standardized by having respective Submodels. - /// - public IReference? MessageBroker { get; set; } - - /// - /// Timestamp in UTC, when the last event was received (input direction) or sent - /// (output direction). - /// - public string? LastUpdate { get; set; } - - /// - /// For input direction, reports on the maximum frequency, the software entity behind - /// the respective Referable can handle input events. - /// - /// - /// - /// For output events, specifies the maximum frequency of outputting this event to - /// an outer infrastructure. - /// - /// - /// Might be not specified, that is, there is no minimum interval. - /// - /// - public string? MinInterval { get; set; } - - /// - /// For input direction: not applicable. - /// - /// - /// - /// For output direction: maximum interval in time, the respective Referable shall send - /// an update of the status of the event, even if no other trigger condition for - /// the event was not met. - /// - /// - /// Might be not specified, that is, there is no maximum interval - /// - /// - public string? MaxInterval { get; set; } - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - yield return Observed; - - if (MessageBroker != null) - { - yield return MessageBroker; - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - yield return Observed; - - // Recurse - foreach (var anItem in Observed.Descend()) - { - yield return anItem; - } - - if (MessageBroker != null) - { - yield return MessageBroker; - - // Recurse - foreach (var anItem in MessageBroker.Descend()) - { - yield return anItem; - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitBasicEventElement(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitBasicEventElement(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformBasicEventElement(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformBasicEventElement(this, context); - } - - public BasicEventElement( - IReference observed, - Direction direction, - StateOfEvent state, - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null, - string? messageTopic = null, - IReference? messageBroker = null, - string? lastUpdate = null, - string? minInterval = null, - string? maxInterval = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - Observed = observed; - Direction = direction; - State = state; - MessageTopic = messageTopic; - MessageBroker = messageBroker; - LastUpdate = lastUpdate; - MinInterval = minInterval; - MaxInterval = maxInterval; - } - } - - /// - /// An operation is a submodel element with input and output variables. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-134: - /// For an the of all - /// 's in - /// , - /// and shall be unique. - ///
  • - ///
- ///
- public interface IOperation : ISubmodelElement - { - /// - /// Input parameter of the operation. - /// - public List? InputVariables { get; set; } - - /// - /// Output parameter of the operation. - /// - public List? OutputVariables { get; set; } - - /// - /// Parameter that is input and output of the operation. - /// - public List? InoutputVariables { get; set; } - - /// - /// Iterate over InputVariables, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverInputVariablesOrEmpty(); - - /// - /// Iterate over OutputVariables, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverOutputVariablesOrEmpty(); - - /// - /// Iterate over InoutputVariables, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverInoutputVariablesOrEmpty(); - } - - /// - /// An operation is a submodel element with input and output variables. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-134: - /// For an the of all - /// 's in - /// , - /// and shall be unique. - ///
  • - ///
- ///
- public class Operation : IOperation - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Input parameter of the operation. - /// - public List? InputVariables { get; set; } - - /// - /// Output parameter of the operation. - /// - public List? OutputVariables { get; set; } - - /// - /// Parameter that is input and output of the operation. - /// - public List? InoutputVariables { get; set; } - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over InputVariables, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverInputVariablesOrEmpty() - { - return InputVariables - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over OutputVariables, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverOutputVariablesOrEmpty() - { - return OutputVariables - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over InoutputVariables, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverInoutputVariablesOrEmpty() - { - return InoutputVariables - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - if (InputVariables != null) - { - foreach (var anItem in InputVariables) - { - yield return anItem; - } - } - - if (OutputVariables != null) - { - foreach (var anItem in OutputVariables) - { - yield return anItem; - } - } - - if (InoutputVariables != null) - { - foreach (var anItem in InoutputVariables) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (InputVariables != null) - { - foreach (var anItem in InputVariables) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (OutputVariables != null) - { - foreach (var anItem in OutputVariables) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (InoutputVariables != null) - { - foreach (var anItem in InoutputVariables) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitOperation(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitOperation(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformOperation(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformOperation(this, context); - } - - public Operation( - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null, - List? inputVariables = null, - List? outputVariables = null, - List? inoutputVariables = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - InputVariables = inputVariables; - OutputVariables = outputVariables; - InoutputVariables = inoutputVariables; - } - } - - /// - /// The value of an operation variable is a submodel element that is used as input - /// and/or output variable of an operation. - /// - public interface IOperationVariable : IClass - { - /// - /// Describes an argument or result of an operation via a submodel element - /// - public ISubmodelElement Value { get; set; } - } - - /// - /// The value of an operation variable is a submodel element that is used as input - /// and/or output variable of an operation. - /// - public class OperationVariable : IOperationVariable - { - /// - /// Describes an argument or result of an operation via a submodel element - /// - public ISubmodelElement Value { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - yield return Value; - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - yield return Value; - - // Recurse - foreach (var anItem in Value.Descend()) - { - yield return anItem; - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitOperationVariable(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitOperationVariable(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformOperationVariable(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformOperationVariable(this, context); - } - - public OperationVariable(ISubmodelElement value) - { - Value = value; - } - } - - /// - /// A capability is the implementation-independent description of the potential of an - /// asset to achieve a certain effect in the physical or virtual world. - /// - /// - /// The of a capability is typically an ontology. - /// Thus, reasoning on capabilities is enabled. - /// - public interface ICapability : ISubmodelElement - { - // Intentionally empty. - } - - /// - /// A capability is the implementation-independent description of the potential of an - /// asset to achieve a certain effect in the physical or virtual world. - /// - /// - /// The of a capability is typically an ontology. - /// Thus, reasoning on capabilities is enabled. - /// - public class Capability : ICapability - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Identifier of the semantic definition of the element. It is called semantic ID - /// of the element or also main semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference? SemanticId { get; set; } - - /// - /// Identifier of a supplemental semantic definition of the element. - /// It is called supplemental semantic ID of the element. - /// - /// - /// It is recommended to use a global reference. - /// - public List? SupplementalSemanticIds { get; set; } - - /// - /// Additional qualification of a qualifiable element. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-021: - /// Every qualifiable can only have one qualifier with the same - /// . - ///
  • - ///
- ///
- public List? Qualifiers { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSupplementalSemanticIdsOrEmpty() - { - return SupplementalSemanticIds - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Qualifiers, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverQualifiersOrEmpty() - { - return Qualifiers - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (SemanticId != null) - { - yield return SemanticId; - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (SemanticId != null) - { - yield return SemanticId; - - // Recurse - foreach (var anItem in SemanticId.Descend()) - { - yield return anItem; - } - } - - if (SupplementalSemanticIds != null) - { - foreach (var anItem in SupplementalSemanticIds) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Qualifiers != null) - { - foreach (var anItem in Qualifiers) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitCapability(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitCapability(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformCapability(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformCapability(this, context); - } - - public Capability( - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IReference? semanticId = null, - List? supplementalSemanticIds = null, - List? qualifiers = null, - List? embeddedDataSpecifications = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - SemanticId = semanticId; - SupplementalSemanticIds = supplementalSemanticIds; - Qualifiers = qualifiers; - EmbeddedDataSpecifications = embeddedDataSpecifications; - } - } - - /// - /// The semantics of a property or other elements that may have a semantic description - /// is defined by a concept description. - /// - /// - /// - /// The description of the concept should follow a standardized schema (realized as - /// data specification template). - /// - /// - /// Note: categories are deprecated since V3.0 of Part 1a of the document series - /// "Details of the Asset Administration Shell". - /// - /// - /// Note: categories are deprecated since V3.0 of Part 1a of the document series - /// "Details of the Asset Administration Shell". - /// - /// - /// Categories are deprecated since V3.0 of Part 1a of the document series - /// "Details of the Asset Administration Shell". - /// - /// - /// Categories are deprecated since V3.0 of Part 1a of the document series - /// "Details of the Asset Administration Shell". - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// - /// Constraint AASc-3a-008: - /// For a using data specification template IEC61360, - /// is mandatory and shall be - /// defined at least in English. - /// - /// - /// Exception: The concept description describes a value, i.e. - /// is defined. - /// - ///
  • - ///
  • - /// Constraint AASc-3a-003: - /// For a using data specification template IEC61360, - /// referenced via - /// - /// the shall be set. - ///
  • - ///
- ///
- public interface IConceptDescription : - IIdentifiable, - IHasDataSpecification - { - /// - /// Reference to an external definition the concept is compatible to or was derived - /// from. - /// - /// - /// - /// It is recommended to use a global reference. - /// - /// - /// Compare to is-case-of relationship in ISO 13584-32 & IEC EN 61360 - /// - /// - public List? IsCaseOf { get; set; } - - /// - /// Iterate over IsCaseOf, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverIsCaseOfOrEmpty(); - } - - /// - /// The semantics of a property or other elements that may have a semantic description - /// is defined by a concept description. - /// - /// - /// - /// The description of the concept should follow a standardized schema (realized as - /// data specification template). - /// - /// - /// Note: categories are deprecated since V3.0 of Part 1a of the document series - /// "Details of the Asset Administration Shell". - /// - /// - /// Note: categories are deprecated since V3.0 of Part 1a of the document series - /// "Details of the Asset Administration Shell". - /// - /// - /// Categories are deprecated since V3.0 of Part 1a of the document series - /// "Details of the Asset Administration Shell". - /// - /// - /// Categories are deprecated since V3.0 of Part 1a of the document series - /// "Details of the Asset Administration Shell". - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// - /// Constraint AASc-3a-008: - /// For a using data specification template IEC61360, - /// is mandatory and shall be - /// defined at least in English. - /// - /// - /// Exception: The concept description describes a value, i.e. - /// is defined. - /// - ///
  • - ///
  • - /// Constraint AASc-3a-003: - /// For a using data specification template IEC61360, - /// referenced via - /// - /// the shall be set. - ///
  • - ///
- ///
- public class ConceptDescription : IConceptDescription - { - /// - /// An extension of the element. - /// - public List? Extensions { get; set; } - - /// - /// The category is a value that gives further meta information - /// w.r.t. to the class of the element. - /// It affects the expected existence of attributes and the applicability of - /// constraints. - /// - /// - /// The category is not identical to the semantic definition - /// () of an element. The category e.g. could denote that - /// the element is a measurement value whereas the semantic definition of - /// the element would denote that it is the measured temperature. - /// - public string? Category { get; set; } - - /// - /// In case of identifiables this attribute is a short name of the element. - /// In case of referable this ID is an identifying string of the element within - /// its name space. - /// - /// - /// In case the element is a property and the property has a semantic definition - /// () conformant to IEC61360 - /// the is typically identical to the short name in English. - /// - public string? IdShort { get; set; } - - /// - /// Display name. Can be provided in several languages. - /// - public List? DisplayName { get; set; } - - /// - /// Description or comments on the element. - /// - /// - /// - /// The description can be provided in several languages. - /// - /// - /// If no description is defined, then the definition of the concept - /// description that defines the semantics of the element is used. - /// - /// - /// Additional information can be provided, e.g., if the element is - /// qualified and which qualifier types can be expected in which - /// context or which additional data specification templates are - /// provided. - /// - /// - public List? Description { get; set; } - - /// - /// Administrative information of an identifiable element. - /// - /// - /// Some of the administrative information like the version number might need to - /// be part of the identification. - /// - public IAdministrativeInformation? Administration { get; set; } - - /// - /// The globally unique identification of the element. - /// - public string Id { get; set; } - - /// - /// Embedded data specification. - /// - public List? EmbeddedDataSpecifications { get; set; } - - /// - /// Reference to an external definition the concept is compatible to or was derived - /// from. - /// - /// - /// - /// It is recommended to use a global reference. - /// - /// - /// Compare to is-case-of relationship in ISO 13584-32 & IEC EN 61360 - /// - /// - public List? IsCaseOf { get; set; } - #region Parent - [JsonIgnore] - public IClass Parent { get; set; } - #endregion - - #region TimeStamp - [JsonIgnore] - public DateTime TimeStampCreate { get; set; } - [JsonIgnore] - public DateTime TimeStamp { get; set; } - [JsonIgnore] - public DateTime TimeStampTree { get; set; } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - #endregion - - /// - /// Iterate over Extensions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverExtensionsOrEmpty() - { - return Extensions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over DisplayName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDisplayNameOrEmpty() - { - return DisplayName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Description, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDescriptionOrEmpty() - { - return Description - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over EmbeddedDataSpecifications, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverEmbeddedDataSpecificationsOrEmpty() - { - return EmbeddedDataSpecifications - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over IsCaseOf, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverIsCaseOfOrEmpty() - { - return IsCaseOf - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - } - } - - if (Administration != null) - { - yield return Administration; - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - } - } - - if (IsCaseOf != null) - { - foreach (var anItem in IsCaseOf) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (Extensions != null) - { - foreach (var anItem in Extensions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (DisplayName != null) - { - foreach (var anItem in DisplayName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Description != null) - { - foreach (var anItem in Description) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Administration != null) - { - yield return Administration; - - // Recurse - foreach (var anItem in Administration.Descend()) - { - yield return anItem; - } - } - - if (EmbeddedDataSpecifications != null) - { - foreach (var anItem in EmbeddedDataSpecifications) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (IsCaseOf != null) - { - foreach (var anItem in IsCaseOf) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitConceptDescription(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitConceptDescription(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformConceptDescription(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformConceptDescription(this, context); - } - - public ConceptDescription( - string id, - List? extensions = null, - string? category = null, - string? idShort = null, - List? displayName = null, - List? description = null, - IAdministrativeInformation? administration = null, - List? embeddedDataSpecifications = null, - List? isCaseOf = null) - { - Extensions = extensions; - IdShort = idShort; - DisplayName = displayName; - Category = category; - Description = description; - Id = id; - Administration = administration; - EmbeddedDataSpecifications = embeddedDataSpecifications; - IsCaseOf = isCaseOf; - } - } - - /// - /// Reference types - /// - public enum ReferenceTypes - { - /// - /// External reference. - /// - [EnumMember(Value = "ExternalReference")] - ExternalReference, - - /// - /// Model reference. - /// - [EnumMember(Value = "ModelReference")] - ModelReference - } - - /// - /// Reference to either a model element of the same or another AAS or to an external - /// entity. - /// - /// - /// - /// A reference is an ordered list of keys. - /// - /// - /// A model reference is an ordered list of keys, each key referencing an element. The - /// complete list of keys may for example be concatenated to a path that then gives - /// unique access to an element. - /// - /// - /// An external reference is a reference to an external entity. - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-121: - /// For 's the value of of the first key of " - /// shall be one of . - ///
  • - ///
  • - /// Constraint AASd-122: - /// For external references, i.e. 's with - /// = , the value - /// of of the first key of shall be one of - /// . - ///
  • - ///
  • - /// Constraint AASd-123: - /// For model references, i.e. 's with - /// = , the value - /// of of the first key of shall be one of - /// . - ///
  • - ///
  • - /// Constraint AASd-124: - /// For external references, i.e. 's with - /// = , the last - /// key of shall be either one of - /// or one of - /// . - ///
  • - ///
  • - /// - /// Constraint AASd-125: - /// For model references, i.e. 's with - /// = , with more - /// than one key in the value of - /// of each of the keys following the first - /// key of shall be one of . - /// - /// - /// Constraint AASd-125 ensures that the shortest path is used. - /// - ///
  • - ///
  • - /// Constraint AASd-126: - /// For model references, i.e. 's with - /// = , with more - /// than one key in the value of - /// of the last key in the reference key chain may be - /// one of or no key at all - /// shall have a value out of . - ///
  • - ///
  • - /// - /// Constraint AASd-127: - /// For model references, i.e. 's with - /// = , with more - /// than one key in a key with - /// shall be preceded by a key with - /// or . All other - /// AAS fragments, i.e. values - /// out of , do not support fragments. - /// - /// - /// Which kind of fragments are supported depends on the content type and the - /// specification of allowed fragment identifiers for the corresponding resource - /// being referenced via the reference. - /// - ///
  • - ///
  • - /// Constraint AASd-128: - /// For model references, i.e. 's with - /// = , the - /// of a preceded by a with - /// = is an integer - /// number denoting the position in the array of the submodel element list. - ///
  • - ///
- ///
- public interface IReference : IClass - { - /// - /// Type of the reference. - /// - /// - /// Denotes, whether reference is an external reference or a model reference. - /// - public ReferenceTypes Type { get; set; } - - /// - /// of the referenced model element - /// ( = ). - /// - /// - /// - /// For external references there typically is no semantic ID. - /// - /// - /// It is recommended to use a external reference. - /// - /// - public IReference? ReferredSemanticId { get; set; } - - /// - /// Unique references in their name space. - /// - public List Keys { get; set; } - } - - /// - /// Reference to either a model element of the same or another AAS or to an external - /// entity. - /// - /// - /// - /// A reference is an ordered list of keys. - /// - /// - /// A model reference is an ordered list of keys, each key referencing an element. The - /// complete list of keys may for example be concatenated to a path that then gives - /// unique access to an element. - /// - /// - /// An external reference is a reference to an external entity. - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASd-121: - /// For 's the value of of the first key of " - /// shall be one of . - ///
  • - ///
  • - /// Constraint AASd-122: - /// For external references, i.e. 's with - /// = , the value - /// of of the first key of shall be one of - /// . - ///
  • - ///
  • - /// Constraint AASd-123: - /// For model references, i.e. 's with - /// = , the value - /// of of the first key of shall be one of - /// . - ///
  • - ///
  • - /// Constraint AASd-124: - /// For external references, i.e. 's with - /// = , the last - /// key of shall be either one of - /// or one of - /// . - ///
  • - ///
  • - /// - /// Constraint AASd-125: - /// For model references, i.e. 's with - /// = , with more - /// than one key in the value of - /// of each of the keys following the first - /// key of shall be one of . - /// - /// - /// Constraint AASd-125 ensures that the shortest path is used. - /// - ///
  • - ///
  • - /// Constraint AASd-126: - /// For model references, i.e. 's with - /// = , with more - /// than one key in the value of - /// of the last key in the reference key chain may be - /// one of or no key at all - /// shall have a value out of . - ///
  • - ///
  • - /// - /// Constraint AASd-127: - /// For model references, i.e. 's with - /// = , with more - /// than one key in a key with - /// shall be preceded by a key with - /// or . All other - /// AAS fragments, i.e. values - /// out of , do not support fragments. - /// - /// - /// Which kind of fragments are supported depends on the content type and the - /// specification of allowed fragment identifiers for the corresponding resource - /// being referenced via the reference. - /// - ///
  • - ///
  • - /// Constraint AASd-128: - /// For model references, i.e. 's with - /// = , the - /// of a preceded by a with - /// = is an integer - /// number denoting the position in the array of the submodel element list. - ///
  • - ///
- ///
- public class Reference : IReference - { - /// - /// Type of the reference. - /// - /// - /// Denotes, whether reference is an external reference or a model reference. - /// - public ReferenceTypes Type { get; set; } - - /// - /// of the referenced model element - /// ( = ). - /// - /// - /// - /// For external references there typically is no semantic ID. - /// - /// - /// It is recommended to use a external reference. - /// - /// - public IReference? ReferredSemanticId { get; set; } - - /// - /// Unique references in their name space. - /// - public List Keys { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (ReferredSemanticId != null) - { - yield return ReferredSemanticId; - } - - foreach (var anItem in Keys) - { - yield return anItem; - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (ReferredSemanticId != null) - { - yield return ReferredSemanticId; - - // Recurse - foreach (var anItem in ReferredSemanticId.Descend()) - { - yield return anItem; - } - } - - foreach (var anItem in Keys) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitReference(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitReference(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformReference(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformReference(this, context); - } - - public Reference( - ReferenceTypes type, - List keys, - IReference? referredSemanticId = null) - { - Type = type; - Keys = keys; - ReferredSemanticId = referredSemanticId; - } - } - - /// - /// A key is a reference to an element by its ID. - /// - public interface IKey : IClass - { - /// - /// Denotes which kind of entity is referenced. - /// - /// - /// - /// In case = the key represents - /// a bookmark or a similar local identifier within its parent element as specified - /// by the key that precedes this key. - /// - /// - /// In all other cases the key references a model element of the same or of another AAS. - /// The name of the model element is explicitly listed. - /// - /// - public KeyTypes Type { get; set; } - - /// - /// The key value, for example an IRDI or an URI - /// - public string Value { get; set; } - } - - /// - /// A key is a reference to an element by its ID. - /// - public class Key : IKey - { - /// - /// Denotes which kind of entity is referenced. - /// - /// - /// - /// In case = the key represents - /// a bookmark or a similar local identifier within its parent element as specified - /// by the key that precedes this key. - /// - /// - /// In all other cases the key references a model element of the same or of another AAS. - /// The name of the model element is explicitly listed. - /// - /// - public KeyTypes Type { get; set; } - - /// - /// The key value, for example an IRDI or an URI - /// - public string Value { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - // No descendable properties - yield break; - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - // No descendable properties - yield break; - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitKey(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitKey(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformKey(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformKey(this, context); - } - - public Key( - KeyTypes type, - string value) - { - Type = type; - Value = value; - } - } - - /// - /// Enumeration of different key value types within a key. - /// - public enum KeyTypes - { - [EnumMember(Value = "AnnotatedRelationshipElement")] - AnnotatedRelationshipElement, - - [EnumMember(Value = "AssetAdministrationShell")] - AssetAdministrationShell, - - [EnumMember(Value = "BasicEventElement")] - BasicEventElement, - - [EnumMember(Value = "Blob")] - Blob, - - [EnumMember(Value = "Capability")] - Capability, - - [EnumMember(Value = "ConceptDescription")] - ConceptDescription, - - /// - /// Data element. - /// - /// - /// Data Element is abstract, i.e. if a key uses - /// the reference may be a Property, a File etc. - /// - [EnumMember(Value = "DataElement")] - DataElement, - - [EnumMember(Value = "Entity")] - Entity, - - /// - /// Event. - /// - /// - /// is abstract. - /// - [EnumMember(Value = "EventElement")] - EventElement, - - [EnumMember(Value = "File")] - File, - - /// - /// Bookmark or a similar local identifier of a subordinate part of - /// a primary resource - /// - [EnumMember(Value = "FragmentReference")] - FragmentReference, - - [EnumMember(Value = "GlobalReference")] - GlobalReference, - - /// - /// Identifiable. - /// - /// - /// Identifiable is abstract, i.e. if a key uses “Identifiable” the reference - /// may be an Asset Administration Shell, a Submodel or a Concept Description. - /// - [EnumMember(Value = "Identifiable")] - Identifiable, - - /// - /// Property with a value that can be provided in multiple languages - /// - [EnumMember(Value = "MultiLanguageProperty")] - MultiLanguageProperty, - - [EnumMember(Value = "Operation")] - Operation, - - [EnumMember(Value = "Property")] - Property, - - /// - /// Range with min and max - /// - [EnumMember(Value = "Range")] - Range, - - [EnumMember(Value = "Referable")] - Referable, - - /// - /// Reference - /// - [EnumMember(Value = "ReferenceElement")] - ReferenceElement, - - /// - /// Relationship - /// - [EnumMember(Value = "RelationshipElement")] - RelationshipElement, - - [EnumMember(Value = "Submodel")] - Submodel, - - /// - /// Submodel Element - /// - /// - /// Submodel Element is abstract, i.e. if a key uses - /// the reference may be a , an etc. - /// - [EnumMember(Value = "SubmodelElement")] - SubmodelElement, - - /// - /// Struct of Submodel Elements - /// - [EnumMember(Value = "SubmodelElementCollection")] - SubmodelElementCollection, - - /// - /// List of Submodel Elements - /// - [EnumMember(Value = "SubmodelElementList")] - SubmodelElementList - } - - /// - /// Enumeration listing all XSD anySimpleTypes - /// - public enum DataTypeDefXsd - { - [EnumMember(Value = "xs:anyURI")] - AnyUri, - - [EnumMember(Value = "xs:base64Binary")] - Base64Binary, - - [EnumMember(Value = "xs:boolean")] - Boolean, - - [EnumMember(Value = "xs:byte")] - Byte, - - [EnumMember(Value = "xs:date")] - Date, - - [EnumMember(Value = "xs:dateTime")] - DateTime, - - [EnumMember(Value = "xs:decimal")] - Decimal, - - [EnumMember(Value = "xs:double")] - Double, - - [EnumMember(Value = "xs:duration")] - Duration, - - [EnumMember(Value = "xs:float")] - Float, - - [EnumMember(Value = "xs:gDay")] - GDay, - - [EnumMember(Value = "xs:gMonth")] - GMonth, - - [EnumMember(Value = "xs:gMonthDay")] - GMonthDay, - - [EnumMember(Value = "xs:gYear")] - GYear, - - [EnumMember(Value = "xs:gYearMonth")] - GYearMonth, - - [EnumMember(Value = "xs:hexBinary")] - HexBinary, - - [EnumMember(Value = "xs:int")] - Int, - - [EnumMember(Value = "xs:integer")] - Integer, - - [EnumMember(Value = "xs:long")] - Long, - - [EnumMember(Value = "xs:negativeInteger")] - NegativeInteger, - - [EnumMember(Value = "xs:nonNegativeInteger")] - NonNegativeInteger, - - [EnumMember(Value = "xs:nonPositiveInteger")] - NonPositiveInteger, - - [EnumMember(Value = "xs:positiveInteger")] - PositiveInteger, - - [EnumMember(Value = "xs:short")] - Short, - - [EnumMember(Value = "xs:string")] - String, - - [EnumMember(Value = "xs:time")] - Time, - - [EnumMember(Value = "xs:unsignedByte")] - UnsignedByte, - - [EnumMember(Value = "xs:unsignedInt")] - UnsignedInt, - - [EnumMember(Value = "xs:unsignedLong")] - UnsignedLong, - - [EnumMember(Value = "xs:unsignedShort")] - UnsignedShort - } - - /// - /// Strings with language tags - /// - public interface IAbstractLangString : IClass - { - /// - /// Language tag conforming to BCP 47 - /// - public string Language { get; set; } - - /// - /// Text in the - /// - public string Text { get; set; } - } - - /// - /// String with length 128 maximum and minimum 1 characters and with language tags - /// - public interface ILangStringNameType : IAbstractLangString - { - // Intentionally empty. - } - - /// - /// String with length 128 maximum and minimum 1 characters and with language tags - /// - public class LangStringNameType : ILangStringNameType - { - /// - /// Language tag conforming to BCP 47 - /// - public string Language { get; set; } - - /// - /// Text in the - /// - public string Text { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - // No descendable properties - yield break; - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - // No descendable properties - yield break; - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitLangStringNameType(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitLangStringNameType(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformLangStringNameType(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformLangStringNameType(this, context); - } - - public LangStringNameType( - string language, - string text) - { - Language = language; - Text = text; - } - } - - /// - /// String with length 1023 maximum and minimum 1 characters and with language tags - /// - public interface ILangStringTextType : IAbstractLangString - { - // Intentionally empty. - } - - /// - /// String with length 1023 maximum and minimum 1 characters and with language tags - /// - public class LangStringTextType : ILangStringTextType - { - /// - /// Language tag conforming to BCP 47 - /// - public string Language { get; set; } - - /// - /// Text in the - /// - public string Text { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - // No descendable properties - yield break; - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - // No descendable properties - yield break; - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitLangStringTextType(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitLangStringTextType(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformLangStringTextType(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformLangStringTextType(this, context); - } - - public LangStringTextType( - string language, - string text) - { - Language = language; - Text = text; - } - } - - /// - /// Container for the sets of different identifiables. - /// - /// - /// w.r.t. file exchange: There is exactly one environment independent on how many - /// files the contained elements are split. If the file is split then there - /// shall be no element with the same identifier in two different files. - /// - public interface IEnvironment : IClass, IDiaryData - { - /// - /// Asset administration shell - /// - public List? AssetAdministrationShells { get; set; } - - /// - /// Submodel - /// - public List? Submodels { get; set; } - - /// - /// Concept description - /// - public List? ConceptDescriptions { get; set; } - - /// - /// Iterate over AssetAdministrationShells, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverAssetAdministrationShellsOrEmpty(); - - /// - /// Iterate over Submodels, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSubmodelsOrEmpty(); - - /// - /// Iterate over ConceptDescriptions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverConceptDescriptionsOrEmpty(); - } - - /// - /// Container for the sets of different identifiables. - /// - /// - /// w.r.t. file exchange: There is exactly one environment independent on how many - /// files the contained elements are split. If the file is split then there - /// shall be no element with the same identifier in two different files. - /// - public class Environment : IEnvironment - { - /// - /// Asset administration shell - /// - public List? AssetAdministrationShells { get; set; } - - /// - /// Submodel - /// - public List? Submodels { get; set; } - - /// - /// Concept description - /// - public List? ConceptDescriptions { get; set; } - - /// - /// Iterate over AssetAdministrationShells, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverAssetAdministrationShellsOrEmpty() - { - return AssetAdministrationShells - ?? System.Linq.Enumerable.Empty(); - } - - [JsonIgnore] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [JsonIgnore] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - /// - /// Iterate over Submodels, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverSubmodelsOrEmpty() - { - return Submodels - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over ConceptDescriptions, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverConceptDescriptionsOrEmpty() - { - return ConceptDescriptions - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - if (AssetAdministrationShells != null) - { - foreach (var anItem in AssetAdministrationShells) - { - yield return anItem; - } - } - - if (Submodels != null) - { - foreach (var anItem in Submodels) - { - yield return anItem; - } - } - - if (ConceptDescriptions != null) - { - foreach (var anItem in ConceptDescriptions) - { - yield return anItem; - } - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - if (AssetAdministrationShells != null) - { - foreach (var anItem in AssetAdministrationShells) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (Submodels != null) - { - foreach (var anItem in Submodels) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (ConceptDescriptions != null) - { - foreach (var anItem in ConceptDescriptions) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitEnvironment(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitEnvironment(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformEnvironment(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformEnvironment(this, context); - } - - public Environment( - List? assetAdministrationShells = null, - List? submodels = null, - List? conceptDescriptions = null) - { - AssetAdministrationShells = assetAdministrationShells; - Submodels = submodels; - ConceptDescriptions = conceptDescriptions; - } - } - - /// - /// Data specification content is part of a data specification template and defines - /// which additional attributes shall be added to the element instance that references - /// the data specification template and meta information about the template itself. - /// - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASc-3a-050: - /// If the is used - /// for an element, the value of - /// - /// shall contain the global reference to the IRI of the corresponding - /// data specification template - /// https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0 - ///
  • - ///
- ///
- public interface IDataSpecificationContent : IClass - { - // Intentionally empty. - } - - /// - /// Embed the content of a data specification. - /// - public interface IEmbeddedDataSpecification : IClass - { - /// - /// Reference to the data specification - /// - public IReference DataSpecification { get; set; } - - /// - /// Actual content of the data specification - /// - public IDataSpecificationContent DataSpecificationContent { get; set; } - } - - /// - /// Embed the content of a data specification. - /// - public class EmbeddedDataSpecification : IEmbeddedDataSpecification - { - /// - /// Reference to the data specification - /// - public IReference DataSpecification { get; set; } - - /// - /// Actual content of the data specification - /// - public IDataSpecificationContent DataSpecificationContent { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - yield return DataSpecification; - - yield return DataSpecificationContent; - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - yield return DataSpecification; - - // Recurse - foreach (var anItem in DataSpecification.Descend()) - { - yield return anItem; - } - - yield return DataSpecificationContent; - - // Recurse - // TODO (MIHO, 2023-06-05): give to AAS core - if (DataSpecificationContent != null) - foreach (var anItem in DataSpecificationContent.Descend()) - { - yield return anItem; - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitEmbeddedDataSpecification(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitEmbeddedDataSpecification(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformEmbeddedDataSpecification(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformEmbeddedDataSpecification(this, context); - } - - public EmbeddedDataSpecification( - IReference dataSpecification, - IDataSpecificationContent dataSpecificationContent) - { - DataSpecification = dataSpecification; - DataSpecificationContent = dataSpecificationContent; - } - } - - public enum DataTypeIec61360 - { - /// - /// values containing a calendar date, conformant to ISO 8601:2004 Format yyyy-mm-dd - /// Example from IEC 61360-1:2017: "1999-05-31" is the [DATE] representation of: - /// "31 May 1999". - /// - [EnumMember(Value = "DATE")] - Date, - - /// - /// values consisting of sequence of characters but cannot be translated into other - /// languages - /// - [EnumMember(Value = "STRING")] - String, - - /// - /// values containing string but shall be represented as different string in different - /// languages - /// - [EnumMember(Value = "STRING_TRANSLATABLE")] - StringTranslatable, - - /// - /// values containing values that are measure of type INTEGER. In addition such a value - /// comes with a physical unit. - /// - [EnumMember(Value = "INTEGER_MEASURE")] - IntegerMeasure, - - /// - /// values containing values of type INTEGER but are no currencies or measures - /// - [EnumMember(Value = "INTEGER_COUNT")] - IntegerCount, - - /// - /// values containing values of type INTEGER that are currencies - /// - [EnumMember(Value = "INTEGER_CURRENCY")] - IntegerCurrency, - - /// - /// values containing values that are measures of type REAL. In addition such a value - /// comes with a physical unit. - /// - [EnumMember(Value = "REAL_MEASURE")] - RealMeasure, - - /// - /// values containing numbers that can be written as a terminating or non-terminating - /// decimal; a rational or irrational number but are no currencies or measures - /// - [EnumMember(Value = "REAL_COUNT")] - RealCount, - - /// - /// values containing values of type REAL that are currencies - /// - [EnumMember(Value = "REAL_CURRENCY")] - RealCurrency, - - /// - /// values representing truth of logic or Boolean algebra (TRUE, FALSE) - /// - [EnumMember(Value = "BOOLEAN")] - Boolean, - - /// - /// values containing values of type STRING conformant to Rfc 3987 - /// - /// - /// In IEC61360-1 (2017) only URI is supported. - /// An IRI type allows in particular to express an URL or an URI. - /// - [EnumMember(Value = "IRI")] - Iri, - - /// - /// values conforming to ISO/IEC 11179 series global identifier sequences - /// - /// - /// - /// IRDI can be used instead of the more specific data types ICID or ISO29002_IRDI. - /// - /// - /// ICID values are value conformant to an IRDI, where the delimiter between RAI and ID - /// is “#” while the delimiter between DI and VI is confined to “##” - /// - /// - /// ISO29002_IRDI values are values containing a global identifier that identifies an - /// administrated item in a registry. The structure of this identifier complies with - /// identifier syntax defined in ISO/TS 29002-5. The identifier shall fulfil the - /// requirements specified in ISO/TS 29002-5 for an "international registration data - /// identifier" (IRDI). - /// - /// - [EnumMember(Value = "IRDI")] - Irdi, - - /// - /// values containing values of type rational - /// - [EnumMember(Value = "RATIONAL")] - Rational, - - /// - /// values containing values of type rational. In addition such a value comes with a - /// physical unit. - /// - [EnumMember(Value = "RATIONAL_MEASURE")] - RationalMeasure, - - /// - /// values containing a time, conformant to ISO 8601:2004 but restricted to what is - /// allowed in the corresponding type in xml. - /// - /// - /// - /// Format hh:mm (ECLASS) - /// - /// - /// Example from IEC 61360-1:2017: "13:20:00-05:00" is the [TIME] representation of: - /// 1.20 p.m. for Eastern Standard Time, which is 5 hours behind Coordinated - /// Universal Time (UTC). - /// - /// - [EnumMember(Value = "TIME")] - Time, - - /// - /// values containing a time, conformant to ISO 8601:2004 but restricted to what is - /// allowed in the corresponding type in xml. - /// - /// - /// Format yyyy-mm-dd hh:mm (ECLASS) - /// - [EnumMember(Value = "TIMESTAMP")] - Timestamp, - - /// - /// values containing an address to a file. The values are of type URI and can represent - /// an absolute or relative path. - /// - /// - /// IEC61360 does not support the file type. - /// - [EnumMember(Value = "FILE")] - File, - - /// - /// Values containing string with any sequence of characters, using the syntax of HTML5 - /// (see W3C Recommendation 28:2014) - /// - [EnumMember(Value = "HTML")] - Html, - - /// - /// values containing the content of a file. Values may be binaries. - /// - /// - /// - /// HTML conformant to HTML5 is a special blob. - /// - /// - /// In IEC61360 binary is for a sequence of bits, each bit being represented by “0” and - /// “1” only. A binary is a blob but a blob may also contain other source code. - /// - /// - [EnumMember(Value = "BLOB")] - Blob - } - - /// - /// Value represented by up to four variants of a numeric value in a specific role: - /// MIN, NOM, TYP and MAX. True means that the value is available, - /// false means the value is not available. - /// - /// - /// - /// EXAMPLE from [IEC61360-1]: In the case of having a property which is - /// of the LEVEL_TYPE min/max − expressing a range − only those two values - /// need to be provided. - /// - /// - /// - /// This is how AAS deals with the following combinations of level types: - /// - ///
    - ///
  • - /// Either all attributes are false. In this case the concept is mapped - /// to a and level type is ignored. - ///
  • - ///
  • - /// At most one of the attributes is set to true. In this case - /// the concept is mapped to a . - ///
  • - ///
  • - /// Min and max are set to true. In this case the concept is mapped - /// to a . - ///
  • - ///
  • - /// More than one attribute is set to true but not min and max only - /// (see second case). In this case the concept is mapped - /// to a with the corresponding - /// number of Properties. - /// Example: If attribute and are set to true - /// then the concept is mapped to a - /// with two Properties within: min and nom. - /// The data type of both Properties is the same. - ///
  • - ///
- ///
- /// - /// In the cases 2. and 4. the of the Property - /// or Properties within the needs to include - /// information about the level type. Otherwise, the semantics is not described - /// in a unique way. Please refer to the specification. - /// - ///
- public interface ILevelType : IClass - { - /// - /// Minimum of the value - /// - public bool Min { get; set; } - - /// - /// Nominal value (value as designated) - /// - public bool Nom { get; set; } - - /// - /// Value as typically present - /// - public bool Typ { get; set; } - - /// - /// Maximum of the value - /// - public bool Max { get; set; } - } - - /// - /// Value represented by up to four variants of a numeric value in a specific role: - /// MIN, NOM, TYP and MAX. True means that the value is available, - /// false means the value is not available. - /// - /// - /// - /// EXAMPLE from [IEC61360-1]: In the case of having a property which is - /// of the LEVEL_TYPE min/max − expressing a range − only those two values - /// need to be provided. - /// - /// - /// - /// This is how AAS deals with the following combinations of level types: - /// - ///
    - ///
  • - /// Either all attributes are false. In this case the concept is mapped - /// to a and level type is ignored. - ///
  • - ///
  • - /// At most one of the attributes is set to true. In this case - /// the concept is mapped to a . - ///
  • - ///
  • - /// Min and max are set to true. In this case the concept is mapped - /// to a . - ///
  • - ///
  • - /// More than one attribute is set to true but not min and max only - /// (see second case). In this case the concept is mapped - /// to a with the corresponding - /// number of Properties. - /// Example: If attribute and are set to true - /// then the concept is mapped to a - /// with two Properties within: min and nom. - /// The data type of both Properties is the same. - ///
  • - ///
- ///
- /// - /// In the cases 2. and 4. the of the Property - /// or Properties within the needs to include - /// information about the level type. Otherwise, the semantics is not described - /// in a unique way. Please refer to the specification. - /// - ///
- public class LevelType : ILevelType - { - /// - /// Minimum of the value - /// - public bool Min { get; set; } - - /// - /// Nominal value (value as designated) - /// - public bool Nom { get; set; } - - /// - /// Value as typically present - /// - public bool Typ { get; set; } - - /// - /// Maximum of the value - /// - public bool Max { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - // No descendable properties - yield break; - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - // No descendable properties - yield break; - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitLevelType(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitLevelType(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformLevelType(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformLevelType(this, context); - } - - public LevelType( - bool min, - bool nom, - bool typ, - bool max) - { - Min = min; - Nom = nom; - Typ = typ; - Max = max; - } - } - - /// - /// A value reference pair within a value list. Each value has a global unique id - /// defining its semantic. - /// - public interface IValueReferencePair : IClass - { - /// - /// The value of the referenced concept definition of the value in . - /// - public string Value { get; set; } - - /// - /// Global unique id of the value. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference ValueId { get; set; } - } - - /// - /// A value reference pair within a value list. Each value has a global unique id - /// defining its semantic. - /// - public class ValueReferencePair : IValueReferencePair - { - /// - /// The value of the referenced concept definition of the value in . - /// - public string Value { get; set; } - - /// - /// Global unique id of the value. - /// - /// - /// It is recommended to use a global reference. - /// - public IReference ValueId { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - yield return ValueId; - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - yield return ValueId; - - // Recurse - foreach (var anItem in ValueId.Descend()) - { - yield return anItem; - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitValueReferencePair(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitValueReferencePair(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformValueReferencePair(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformValueReferencePair(this, context); - } - - public ValueReferencePair( - string value, - IReference valueId) - { - Value = value; - ValueId = valueId; - } - } - - /// - /// A set of value reference pairs. - /// - public interface IValueList : IClass - { - /// - /// A pair of a value together with its global unique id. - /// - public List ValueReferencePairs { get; set; } - } - - /// - /// A set of value reference pairs. - /// - public class ValueList : IValueList - { - /// - /// A pair of a value together with its global unique id. - /// - public List ValueReferencePairs { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - foreach (var anItem in ValueReferencePairs) - { - yield return anItem; - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - foreach (var anItem in ValueReferencePairs) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitValueList(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitValueList(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformValueList(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformValueList(this, context); - } - - public ValueList(List valueReferencePairs) - { - ValueReferencePairs = valueReferencePairs; - } - } - - /// - /// String with length 255 maximum and minimum 1 characters and with language tags - /// - /// - /// It is advised to keep the length of the name limited to 35 characters. - /// - public interface ILangStringPreferredNameTypeIec61360 : IAbstractLangString - { - // Intentionally empty. - } - - /// - /// String with length 255 maximum and minimum 1 characters and with language tags - /// - /// - /// It is advised to keep the length of the name limited to 35 characters. - /// - public class LangStringPreferredNameTypeIec61360 : ILangStringPreferredNameTypeIec61360 - { - /// - /// Language tag conforming to BCP 47 - /// - public string Language { get; set; } - - /// - /// Text in the - /// - public string Text { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - // No descendable properties - yield break; - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - // No descendable properties - yield break; - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitLangStringPreferredNameTypeIec61360(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitLangStringPreferredNameTypeIec61360(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformLangStringPreferredNameTypeIec61360(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformLangStringPreferredNameTypeIec61360(this, context); - } - - public LangStringPreferredNameTypeIec61360( - string language, - string text) - { - Language = language; - Text = text; - } - } - - /// - /// String with length 18 maximum and minimum 1 characters and with language tags - /// - public interface ILangStringShortNameTypeIec61360 : IAbstractLangString - { - // Intentionally empty. - } - - /// - /// String with length 18 maximum and minimum 1 characters and with language tags - /// - public class LangStringShortNameTypeIec61360 : ILangStringShortNameTypeIec61360 - { - /// - /// Language tag conforming to BCP 47 - /// - public string Language { get; set; } - - /// - /// Text in the - /// - public string Text { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - // No descendable properties - yield break; - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - // No descendable properties - yield break; - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitLangStringShortNameTypeIec61360(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitLangStringShortNameTypeIec61360(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformLangStringShortNameTypeIec61360(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformLangStringShortNameTypeIec61360(this, context); - } - - public LangStringShortNameTypeIec61360( - string language, - string text) - { - Language = language; - Text = text; - } - } - - /// - /// String with length 1023 maximum and minimum 1 characters and with language tags - /// - public interface ILangStringDefinitionTypeIec61360 : IAbstractLangString - { - // Intentionally empty. - } - - /// - /// String with length 1023 maximum and minimum 1 characters and with language tags - /// - public class LangStringDefinitionTypeIec61360 : ILangStringDefinitionTypeIec61360 - { - /// - /// Language tag conforming to BCP 47 - /// - public string Language { get; set; } - - /// - /// Text in the - /// - public string Text { get; set; } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - // No descendable properties - yield break; - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - // No descendable properties - yield break; - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitLangStringDefinitionTypeIec61360(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitLangStringDefinitionTypeIec61360(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformLangStringDefinitionTypeIec61360(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformLangStringDefinitionTypeIec61360(this, context); - } - - public LangStringDefinitionTypeIec61360( - string language, - string text) - { - Language = language; - Text = text; - } - } - - /// - /// Content of data specification template for concept descriptions for properties, - /// values and value lists conformant to IEC 61360. - /// - /// - /// - /// It is also possible that both and are empty. - /// This is the case for concept descriptions that define the semantics of a - /// property but do not have an enumeration () as data type. - /// - /// - /// Although it is possible to define a for a - /// :attr:´value_list`, - /// it is not possible to reuse this . - /// It is only possible to directly add a as data type - /// to a specific semantic definition of a property. - /// - /// - /// IEC61360 requires also a globally unique identifier for a concept - /// description. This ID is not part of the data specification template. - /// Instead the as inherited via - /// is used. Same holds for administrative - /// information like the version and revision. - /// - /// - /// and are very - /// similar. However, in this case the decision was to add - /// explicitly to the data specification. Same holds for - /// and - /// . Same holds for - /// and . - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASc-3a-009: - /// If one of: - /// , - /// , - /// , - /// , - /// , then or - /// shall be defined. - ///
  • - ///
- ///
- public interface IDataSpecificationIec61360 : IDataSpecificationContent - { - /// - /// Preferred name - /// - /// - /// - /// It is advised to keep the length of the name limited to 35 characters. - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASc-3a-002: - /// shall be provided at least in English. - ///
  • - ///
- ///
- public List PreferredName { get; set; } - - /// - /// Short name - /// - public List? ShortName { get; set; } - - /// - /// Unit - /// - public string? Unit { get; set; } - - /// - /// Unique unit id - /// - /// - /// - /// and need to be consistent if both attributes - /// are set - /// - /// - /// It is recommended to use an external reference ID. - /// - /// - public IReference? UnitId { get; set; } - - /// - /// Source of definition - /// - public string? SourceOfDefinition { get; set; } - - /// - /// Symbol - /// - public string? Symbol { get; set; } - - /// - /// Data Type - /// - public DataTypeIec61360? DataType { get; set; } - - /// - /// Definition in different languages - /// - public List? Definition { get; set; } - - /// - /// Value Format - /// - /// - /// The value format is based on ISO 13584-42 and IEC 61360-2. - /// - public string? ValueFormat { get; set; } - - /// - /// List of allowed values - /// - public IValueList? ValueList { get; set; } - - /// - /// Value - /// - public string? Value { get; set; } - - /// - /// Set of levels. - /// - public ILevelType? LevelType { get; set; } - - /// - /// Iterate over ShortName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverShortNameOrEmpty(); - - /// - /// Iterate over Definition, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDefinitionOrEmpty(); - } - - /// - /// Content of data specification template for concept descriptions for properties, - /// values and value lists conformant to IEC 61360. - /// - /// - /// - /// It is also possible that both and are empty. - /// This is the case for concept descriptions that define the semantics of a - /// property but do not have an enumeration () as data type. - /// - /// - /// Although it is possible to define a for a - /// :attr:´value_list`, - /// it is not possible to reuse this . - /// It is only possible to directly add a as data type - /// to a specific semantic definition of a property. - /// - /// - /// IEC61360 requires also a globally unique identifier for a concept - /// description. This ID is not part of the data specification template. - /// Instead the as inherited via - /// is used. Same holds for administrative - /// information like the version and revision. - /// - /// - /// and are very - /// similar. However, in this case the decision was to add - /// explicitly to the data specification. Same holds for - /// and - /// . Same holds for - /// and . - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASc-3a-009: - /// If one of: - /// , - /// , - /// , - /// , - /// , then or - /// shall be defined. - ///
  • - ///
- ///
- public class DataSpecificationIec61360 : IDataSpecificationIec61360 - { - /// - /// Preferred name - /// - /// - /// - /// It is advised to keep the length of the name limited to 35 characters. - /// - /// - /// Constraints: - /// - ///
    - ///
  • - /// Constraint AASc-3a-002: - /// shall be provided at least in English. - ///
  • - ///
- ///
- public List PreferredName { get; set; } - - /// - /// Short name - /// - public List? ShortName { get; set; } - - /// - /// Unit - /// - public string? Unit { get; set; } - - /// - /// Unique unit id - /// - /// - /// - /// and need to be consistent if both attributes - /// are set - /// - /// - /// It is recommended to use an external reference ID. - /// - /// - public IReference? UnitId { get; set; } - - /// - /// Source of definition - /// - public string? SourceOfDefinition { get; set; } - - /// - /// Symbol - /// - public string? Symbol { get; set; } - - /// - /// Data Type - /// - public DataTypeIec61360? DataType { get; set; } - - /// - /// Definition in different languages - /// - public List? Definition { get; set; } - - /// - /// Value Format - /// - /// - /// The value format is based on ISO 13584-42 and IEC 61360-2. - /// - public string? ValueFormat { get; set; } - - /// - /// List of allowed values - /// - public IValueList? ValueList { get; set; } - - /// - /// Value - /// - public string? Value { get; set; } - - /// - /// Set of levels. - /// - public ILevelType? LevelType { get; set; } - - /// - /// Iterate over ShortName, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverShortNameOrEmpty() - { - return ShortName - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over Definition, if set, and otherwise return an empty enumerable. - /// - public IEnumerable OverDefinitionOrEmpty() - { - return Definition - ?? System.Linq.Enumerable.Empty(); - } - - /// - /// Iterate over all the class instances referenced from this instance - /// without further recursion. - /// - public IEnumerable DescendOnce() - { - foreach (var anItem in PreferredName) - { - yield return anItem; - } - - if (ShortName != null) - { - foreach (var anItem in ShortName) - { - yield return anItem; - } - } - - if (UnitId != null) - { - yield return UnitId; - } - - if (Definition != null) - { - foreach (var anItem in Definition) - { - yield return anItem; - } - } - - if (ValueList != null) - { - yield return ValueList; - } - - if (LevelType != null) - { - yield return LevelType; - } - } - - /// - /// Iterate recursively over all the class instances referenced from this instance. - /// - public IEnumerable Descend() - { - foreach (var anItem in PreferredName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - - if (ShortName != null) - { - foreach (var anItem in ShortName) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (UnitId != null) - { - yield return UnitId; - - // Recurse - foreach (var anItem in UnitId.Descend()) - { - yield return anItem; - } - } - - if (Definition != null) - { - foreach (var anItem in Definition) - { - yield return anItem; - - // Recurse - foreach (var anotherItem in anItem.Descend()) - { - yield return anotherItem; - } - } - } - - if (ValueList != null) - { - yield return ValueList; - - // Recurse - foreach (var anItem in ValueList.Descend()) - { - yield return anItem; - } - } - - if (LevelType != null) - { - yield return LevelType; - - // Recurse - foreach (var anItem in LevelType.Descend()) - { - yield return anItem; - } - } - } - - /// - /// Accept the to visit this instance - /// for double dispatch. - /// - public void Accept(Visitation.IVisitor visitor) - { - visitor.VisitDataSpecificationIec61360(this); - } - - /// - /// Accept the visitor to visit this instance for double dispatch - /// with the . - /// - public void Accept( - Visitation.IVisitorWithContext visitor, - TContext context) - { - visitor.VisitDataSpecificationIec61360(this, context); - } - - /// - /// Accept the to transform this instance - /// for double dispatch. - /// - public T Transform(Visitation.ITransformer transformer) - { - return transformer.TransformDataSpecificationIec61360(this); - } - - /// - /// Accept the to visit this instance - /// for double dispatch with the . - /// - public T Transform( - Visitation.ITransformerWithContext transformer, - TContext context) - { - return transformer.TransformDataSpecificationIec61360(this, context); - } - - public DataSpecificationIec61360( - List preferredName, - List? shortName = null, - string? unit = null, - IReference? unitId = null, - string? sourceOfDefinition = null, - string? symbol = null, - DataTypeIec61360? dataType = null, - List? definition = null, - string? valueFormat = null, - IValueList? valueList = null, - string? value = null, - ILevelType? levelType = null) - { - PreferredName = preferredName; - ShortName = shortName; - Unit = unit; - UnitId = unitId; - SourceOfDefinition = sourceOfDefinition; - Symbol = symbol; - DataType = dataType; - Definition = definition; - ValueFormat = valueFormat; - ValueList = valueList; - Value = value; - LevelType = levelType; - } - } -} // namespace AasCore.Aas3_0 - -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ diff --git a/src/AasCore.Aas3_0/verification.cs b/src/AasCore.Aas3_0/verification.cs deleted file mode 100644 index 210accd5c..000000000 --- a/src/AasCore.Aas3_0/verification.cs +++ /dev/null @@ -1,10264 +0,0 @@ -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ - -using Aas = AasCore.Aas3_0; // renamed -using CodeAnalysis = System.Diagnostics.CodeAnalysis; -using Regex = System.Text.RegularExpressions.Regex; - -using System.Collections.Generic; // can't alias -using System.Linq; // can't alias - -namespace AasCore.Aas3_0 -{ - /// - /// Verify that the instances of the meta-model satisfy the invariants. - /// - /// - /// Here is an example how to verify an instance of IHasSemantics: - /// - /// var anInstance = new Aas.IHasSemantics( - /// // ... some constructor arguments ... - /// ); - /// foreach (var error in Verification.Verify(anInstance)) - /// { - /// System.Console.Writeln( - /// $"{error.Cause} at: " + - /// Reporting.GenerateJsonPath(error.PathSegments)); - /// } - /// - /// - public static class Verification - { - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesIdShort() - { - var pattern = "^[a-zA-Z][a-zA-Z0-9_]*$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesIdShort = _constructMatchesIdShort(); - - /// - /// Check that is a valid short ID. - /// - public static bool MatchesIdShort(string text) - { - return RegexMatchesIdShort.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesVersionType() - { - var pattern = "^(0|[1-9][0-9]*)$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesVersionType = _constructMatchesVersionType(); - - /// - /// Check that is a valid version string. - /// - public static bool MatchesVersionType(string text) - { - return RegexMatchesVersionType.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesRevisionType() - { - var pattern = "^(0|[1-9][0-9]*)$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesRevisionType = _constructMatchesRevisionType(); - - /// - /// Check that is a valid revision string. - /// - public static bool MatchesRevisionType(string text) - { - return RegexMatchesRevisionType.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsDateTimeUtc() - { - var digit = "[0-9]"; - var yearFrag = $"-?(([1-9]{digit}{digit}{digit}+)|(0{digit}{digit}{digit}))"; - var monthFrag = "((0[1-9])|(1[0-2]))"; - var dayFrag = $"((0[1-9])|([12]{digit})|(3[01]))"; - var hourFrag = $"(([01]{digit})|(2[0-3]))"; - var minuteFrag = $"[0-5]{digit}"; - var secondFrag = $"([0-5]{digit})(\\.{digit}+)?"; - var endOfDayFrag = "24:00:00(\\.0+)?"; - var timezoneFrag = "(Z|\\+00:00|-00:00)"; - var dateTimeLexicalRep = $"{yearFrag}-{monthFrag}-{dayFrag}T(({hourFrag}:{minuteFrag}:{secondFrag})|{endOfDayFrag}){timezoneFrag}"; - var pattern = $"^{dateTimeLexicalRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsDateTimeUtc = _constructMatchesXsDateTimeUtc(); - - /// - /// Check that conforms to the pattern of an xs:dateTime. - /// - /// - /// - /// The time zone must be fixed to UTC. We verify only that the text matches - /// a pre-defined pattern. We do not verify that the day of month is - /// correct nor do we check for leap seconds. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#dateTime - /// - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsDateTimeUtc(string text) - { - return RegexMatchesXsDateTimeUtc.IsMatch(text); - } - - /// - /// Check that is a xs:dateTime with - /// the time zone set to UTC. - /// - public static bool IsXsDateTimeUtc( - string value - ) - { - if (!MatchesXsDateTimeUtc(value)) - { - return false; - } - - return IsPrefixedWithValidDate(value); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesMimeType() - { - var tchar = "[!#$%&'*+\\-.^_`|~0-9a-zA-Z]"; - var token = $"({tchar})+"; - var type = $"{token}"; - var subtype = $"{token}"; - var ows = "[ \\t]*"; - var obsText = "[\\x80-\\xff]"; - var qdText = $"([\\t !#-\\[\\]-~]|{obsText})"; - var quotedPair = $"\\\\([\\t !-~]|{obsText})"; - var quotedString = $"\"({qdText}|{quotedPair})*\""; - var parameter = $"{token}=({token}|{quotedString})"; - var mediaType = $"^{type}/{subtype}({ows};{ows}{parameter})*$"; - - return new Regex(mediaType); - } - - private static readonly Regex RegexMatchesMimeType = _constructMatchesMimeType(); - - /// - /// Check that conforms to the pattern of MIME type. - /// - /// - /// The definition has been taken from: - /// https://www.rfc-editor.org/rfc/rfc7231#section-3.1.1.1, - /// https://www.rfc-editor.org/rfc/rfc7230#section-3.2.3 and - /// https://www.rfc-editor.org/rfc/rfc7230#section-3.2.6. - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesMimeType(string text) - { - return RegexMatchesMimeType.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesRfc8089Path() - { - var h16 = "[0-9A-Fa-f]{1,4}"; - var decOctet = "([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"; - var ipv4address = $"{decOctet}\\.{decOctet}\\.{decOctet}\\.{decOctet}"; - var ls32 = $"({h16}:{h16}|{ipv4address})"; - var 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})?::)"; - var unreserved = "[a-zA-Z0-9\\-._~]"; - var subDelims = "[!$&'()*+,;=]"; - var ipvfuture = $"[vV][0-9A-Fa-f]+\\.({unreserved}|{subDelims}|:)+"; - var ipLiteral = $"\\[({ipv6address}|{ipvfuture})\\]"; - var pctEncoded = "%[0-9A-Fa-f][0-9A-Fa-f]"; - var regName = $"({unreserved}|{pctEncoded}|{subDelims})*"; - var host = $"({ipLiteral}|{ipv4address}|{regName})"; - var fileAuth = $"(localhost|{host})"; - var pchar = $"({unreserved}|{pctEncoded}|{subDelims}|[:@])"; - var segmentNz = $"({pchar})+"; - var segment = $"({pchar})*"; - var pathAbsolute = $"/({segmentNz}(/{segment})*)?"; - var authPath = $"({fileAuth})?{pathAbsolute}"; - var localPath = $"{pathAbsolute}"; - var fileHierPart = $"(//{authPath}|{localPath})"; - var fileScheme = "file"; - var fileUri = $"{fileScheme}:{fileHierPart}"; - var pattern = $"^{fileUri}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesRfc8089Path = _constructMatchesRfc8089Path(); - - /// - /// Check that is a path conforming to the pattern of RFC 8089. - /// - /// - /// The definition has been taken from: - /// https://datatracker.ietf.org/doc/html/rfc8089 - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesRfc8089Path(string text) - { - return RegexMatchesRfc8089Path.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesBcp47() - { - var alphanum = "[a-zA-Z0-9]"; - var singleton = "[0-9A-WY-Za-wy-z]"; - var extension = $"{singleton}(-({alphanum}){{2,8}})+"; - var extlang = "[a-zA-Z]{3}(-[a-zA-Z]{3}){2}"; - var irregular = "(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)"; - var regular = "(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)"; - var grandfathered = $"({irregular}|{regular})"; - var language = $"([a-zA-Z]{{2,3}}(-{extlang})?|[a-zA-Z]{{4}}|[a-zA-Z]{{5,8}})"; - var script = "[a-zA-Z]{4}"; - var region = "([a-zA-Z]{2}|[0-9]{3})"; - var variant = $"(({alphanum}){{5,8}}|[0-9]({alphanum}){{3}})"; - var privateuse = $"[xX](-({alphanum}){{1,8}})+"; - var langtag = $"{language}(-{script})?(-{region})?(-{variant})*(-{extension})*(-{privateuse})?"; - var languageTag = $"({langtag}|{privateuse}|{grandfathered})"; - var pattern = $"^{languageTag}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesBcp47 = _constructMatchesBcp47(); - - /// - /// Check that is a valid BCP 47 language tag. - /// - /// - /// See: https://en.wikipedia.org/wiki/IETF_language_tag - /// - public static bool MatchesBcp47(string text) - { - return RegexMatchesBcp47.IsMatch(text); - } - - /// - /// Check that are specified each for a unique - /// language. - /// - public static bool LangStringsHaveUniqueLanguages( - IEnumerable langStrings - ) - { - var languageSet = new HashSet(); - foreach (var langString in langStrings) - { - if (languageSet.Contains(langString.Language)) - { - return false; - } - languageSet.Add(langString.Language); - } - return true; - } - - /// - /// Check that there are no duplicate 's - /// in the . - /// - public static bool QualifierTypesAreUnique( - IEnumerable qualifiers - ) - { - var typeSet = new HashSet(); - foreach (var qualifier in qualifiers) - { - if (typeSet.Contains(qualifier.Type)) - { - return false; - } - typeSet.Add(qualifier.Type); - } - return true; - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXmlSerializableString() - { - var pattern = "^([\\x09\\x0a\\x0d\\x20-\\ud7ff\\ue000-\\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXmlSerializableString = _constructMatchesXmlSerializableString(); - - /// - /// Check that conforms to the pattern of the Constraint AASd-130. - /// - /// - /// Ensures that encoding is possible and interoperability between different - /// serializations is possible. - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXmlSerializableString(string text) - { - return RegexMatchesXmlSerializableString.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsAnyUri() - { - var scheme = "[a-zA-Z][a-zA-Z0-9+\\-.]*"; - var ucschar = "([\\xa0-\\ud7ff\\uf900-\\ufdcf\\ufdf0-\\uffef]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\ud83e][\\udc00-\\udfff]|\\ud83f[\\udc" + - "00-\\udffd]|\\ud840[\\udc00-\\udfff]|[\\ud841-\\ud87e][\\udc00-\\udfff]|\\ud87f[\\udc00-\\udffd]|\\ud880[\\udc00-\\udfff]|[\\ud881-\\ud8" + - "be][\\udc00-\\udfff]|\\ud8bf[\\udc00-\\udffd]|\\ud8c0[\\udc00-\\udfff]|[\\ud8c1-\\ud8fe][\\udc00-\\udfff]|\\ud8ff[\\udc00-\\udffd]|\\ud9" + - "00[\\udc00-\\udfff]|[\\ud901-\\ud93e][\\udc00-\\udfff]|\\ud93f[\\udc00-\\udffd]|\\ud940[\\udc00-\\udfff]|[\\ud941-\\ud97e][\\udc00-\\udff" + - "f]|\\ud97f[\\udc00-\\udffd]|\\ud980[\\udc00-\\udfff]|[\\ud981-\\ud9be][\\udc00-\\udfff]|\\ud9bf[\\udc00-\\udffd]|\\ud9c0[\\udc00-\\udff" + - "f]|[\\ud9c1-\\ud9fe][\\udc00-\\udfff]|\\ud9ff[\\udc00-\\udffd]|\\uda00[\\udc00-\\udfff]|[\\uda01-\\uda3e][\\udc00-\\udfff]|\\uda3f[\\udc" + - "00-\\udffd]|\\uda40[\\udc00-\\udfff]|[\\uda41-\\uda7e][\\udc00-\\udfff]|\\uda7f[\\udc00-\\udffd]|\\uda80[\\udc00-\\udfff]|[\\uda81-\\uda" + - "be][\\udc00-\\udfff]|\\udabf[\\udc00-\\udffd]|\\udac0[\\udc00-\\udfff]|[\\udac1-\\udafe][\\udc00-\\udfff]|\\udaff[\\udc00-\\udffd]|\\ud" + - "b00[\\udc00-\\udfff]|[\\udb01-\\udb3e][\\udc00-\\udfff]|\\udb3f[\\udc00-\\udffd]|\\udb44[\\udc00-\\udfff]|[\\udb45-\\udb7e][\\udc00-\\udfff]|\\udb7f[\\udc00-\\udffd])"; - var iunreserved = $"([a-zA-Z0-9\\-._~]|{ucschar})"; - var pctEncoded = "%[0-9A-Fa-f][0-9A-Fa-f]"; - var subDelims = "[!$&'()*+,;=]"; - var iuserinfo = $"({iunreserved}|{pctEncoded}|{subDelims}|:)*"; - var h16 = "[0-9A-Fa-f]{1,4}"; - var decOctet = "([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"; - var ipv4address = $"{decOctet}\\.{decOctet}\\.{decOctet}\\.{decOctet}"; - var ls32 = $"({h16}:{h16}|{ipv4address})"; - var 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})?::)"; - var unreserved = "[a-zA-Z0-9\\-._~]"; - var ipvfuture = $"[vV][0-9A-Fa-f]+\\.({unreserved}|{subDelims}|:)+"; - var ipLiteral = $"\\[({ipv6address}|{ipvfuture})\\]"; - var iregName = $"({iunreserved}|{pctEncoded}|{subDelims})*"; - var ihost = $"({ipLiteral}|{ipv4address}|{iregName})"; - var port = "[0-9]*"; - var iauthority = $"({iuserinfo}@)?{ihost}(:{port})?"; - var ipchar = $"({iunreserved}|{pctEncoded}|{subDelims}|[:@])"; - var isegment = $"({ipchar})*"; - var ipathAbempty = $"(/{isegment})*"; - var isegmentNz = $"({ipchar})+"; - var ipathAbsolute = $"/({isegmentNz}(/{isegment})*)?"; - var ipathRootless = $"{isegmentNz}(/{isegment})*"; - var ipathEmpty = $"({ipchar}){{0}}"; - var ihierPart = $"(//{iauthority}{ipathAbempty}|{ipathAbsolute}|{ipathRootless}|{ipathEmpty})"; - var iprivate = "([\\ue000-\\uf8ff]|\\udb80[\\udc00-\\udfff]|[\\udb81-\\udbbe][\\udc00-\\udfff]|\\udbbf[\\udc00-\\udffd]|\\udbc0[\\udc00-\\udfff]|[\\udbc1-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udffd])"; - var iquery = $"({ipchar}|{iprivate}|[/?])*"; - var ifragment = $"({ipchar}|[/?])*"; - var isegmentNzNc = $"({iunreserved}|{pctEncoded}|{subDelims}|@)+"; - var ipathNoscheme = $"{isegmentNzNc}(/{isegment})*"; - var irelativePart = $"(//{iauthority}{ipathAbempty}|{ipathAbsolute}|{ipathNoscheme}|{ipathEmpty})"; - var irelativeRef = $"{irelativePart}(\\?{iquery})?(#{ifragment})?"; - var iri = $"{scheme}:{ihierPart}(\\?{iquery})?(#{ifragment})?"; - var iriReference = $"({iri}|{irelativeRef})"; - var pattern = $"^{iriReference}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsAnyUri = _constructMatchesXsAnyUri(); - - /// - /// Check that conforms to the pattern of an xs:anyURI. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#anyURI and - /// https://datatracker.ietf.org/doc/html/rfc3987 - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsAnyUri(string text) - { - return RegexMatchesXsAnyUri.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsBase64Binary() - { - var b04Char = "[AQgw]"; - var b04 = $"{b04Char}\\x20?"; - var b16Char = "[AEIMQUYcgkosw048]"; - var b16 = $"{b16Char}\\x20?"; - var b64Char = "[A-Za-z0-9+/]"; - var b64 = $"{b64Char}\\x20?"; - var b64quad = $"({b64}{b64}{b64}{b64})"; - var b64FinalQuad = $"({b64}{b64}{b64}{b64Char})"; - var padded8 = $"{b64}{b04}= ?="; - var padded16 = $"{b64}{b64}{b16}="; - var b64final = $"({b64FinalQuad}|{padded16}|{padded8})"; - var base64Binary = $"({b64quad}*{b64final})?"; - var pattern = $"^{base64Binary}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsBase64Binary = _constructMatchesXsBase64Binary(); - - /// - /// Check that conforms to the pattern of an xs:base64Binary. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#base64Binary - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsBase64Binary(string text) - { - return RegexMatchesXsBase64Binary.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsBoolean() - { - var pattern = "^(true|false|1|0)$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsBoolean = _constructMatchesXsBoolean(); - - /// - /// Check that conforms to the pattern of an xs:boolean. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#boolean - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsBoolean(string text) - { - return RegexMatchesXsBoolean.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsDate() - { - var digit = "[0-9]"; - var yearFrag = $"-?(([1-9]{digit}{digit}{digit}+)|(0{digit}{digit}{digit}))"; - var monthFrag = "((0[1-9])|(1[0-2]))"; - var dayFrag = $"((0[1-9])|([12]{digit})|(3[01]))"; - var minuteFrag = $"[0-5]{digit}"; - var timezoneFrag = $"(Z|(\\+|-)(0{digit}|1[0-3]):{minuteFrag}|14:00)"; - var dateLexicalRep = $"{yearFrag}-{monthFrag}-{dayFrag}{timezoneFrag}?"; - var pattern = $"^{dateLexicalRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsDate = _constructMatchesXsDate(); - - /// - /// Check that conforms to the pattern of an xs:date. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#date - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsDate(string text) - { - return RegexMatchesXsDate.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsDateTime() - { - var digit = "[0-9]"; - var yearFrag = $"-?(([1-9]{digit}{digit}{digit}+)|(0{digit}{digit}{digit}))"; - var monthFrag = "((0[1-9])|(1[0-2]))"; - var dayFrag = $"((0[1-9])|([12]{digit})|(3[01]))"; - var hourFrag = $"(([01]{digit})|(2[0-3]))"; - var minuteFrag = $"[0-5]{digit}"; - var secondFrag = $"([0-5]{digit})(\\.{digit}+)?"; - var endOfDayFrag = "24:00:00(\\.0+)?"; - var timezoneFrag = $"(Z|(\\+|-)(0{digit}|1[0-3]):{minuteFrag}|14:00)"; - var dateTimeLexicalRep = $"{yearFrag}-{monthFrag}-{dayFrag}T(({hourFrag}:{minuteFrag}:{secondFrag})|{endOfDayFrag}){timezoneFrag}?"; - var pattern = $"^{dateTimeLexicalRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsDateTime = _constructMatchesXsDateTime(); - - /// - /// Check that conforms to the pattern of an xs:dateTime. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#dateTime - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsDateTime(string text) - { - return RegexMatchesXsDateTime.IsMatch(text); - } - - private static readonly Regex RegexDatePrefix = ( - new Regex("^(-?[0-9]+)-([0-9]{2})-([0-9]{2})")); - - /// - /// Check whether the given year is a leap year. - /// - /// Year 1 BCE is a leap year. - /// to be checked - /// True if is a leap year - public static bool IsLeapYear(System.Numerics.BigInteger year) - { - // NOTE (mristin, 2023-03-16): - // We consider the years B.C. to be one-off. - // See the note at: https://www.w3.org/TR/xmlschema-2/#dateTime: - // "'-0001' is the lexical representation of the year 1 Before Common Era - // (1 BCE, sometimes written "1 BC")." - // - // Hence, -1 year in XML is 1 BCE, which is 0 year in astronomical years. - if (year < 0) - { - year = -year - 1; - } - - // See: See: https://en.wikipedia.org/wiki/Leap_year#Algorithm - if (year % 4 > 0) - { - return false; - } - - if (year % 100 > 0) - { - return true; - } - - if (year % 400 > 0) - { - return false; - } - - return true; - } - - /// - /// Check that the value starts with a valid date. - /// - /// - /// an xs:date, an xs:dateTime, - /// or an xs:dateTimeStamp - /// - /// true if the value starts with a valid date - /// - private static bool IsPrefixedWithValidDate(string value) - { - // NOTE (mristin, 2023-03-16): - // We can not use System.DateTime.ParseExact since it does not handle the zero and - // BCE years correctly. Therefore, we have to roll out our own date validator. - var match = RegexDatePrefix.Match(value); - if (!match.Success) - { - return false; - } - - bool ok = System.Numerics.BigInteger.TryParse( - match.Groups[1].Value, - out System.Numerics.BigInteger year); - if (!ok) - { - throw new System.InvalidOperationException( - $"Expected to parse the year from {match.Groups[1].Value}, " + - "but the parsing failed"); - } - - ok = System.SByte.TryParse(match.Groups[2].Value, out sbyte month); - if (!ok) - { - throw new System.InvalidOperationException( - $"Expected to parse the month from {match.Groups[2].Value}, " + - "but the parsing failed"); - } - - ok = System.SByte.TryParse(match.Groups[3].Value, out sbyte day); - if (!ok) - { - throw new System.InvalidOperationException( - $"Expected to parse the day from {match.Groups[3].Value}, " + - "but the parsing failed"); - } - - // Year zero does not exist, see: https://www.w3.org/TR/xmlschema-2/#dateTime - if (year == 0) - { - return false; - } - - if (day <= 0 || day > 31) - { - return false; - } - - if (month <= 0 || month >= 13) - { - return false; - } - - sbyte maxDaysInMonth; - switch (month) - { - case 1: - maxDaysInMonth = 31; - break; - case 2: - maxDaysInMonth = (IsLeapYear(year)) ? (sbyte)29 : (sbyte)28; - break; - case 3: - maxDaysInMonth = 31; - break; - case 4: - maxDaysInMonth = 30; - break; - case 5: - maxDaysInMonth = 31; - break; - case 6: - maxDaysInMonth = 30; - break; - case 7: - maxDaysInMonth = 31; - break; - case 8: - maxDaysInMonth = 31; - break; - case 9: - maxDaysInMonth = 30; - break; - case 10: - maxDaysInMonth = 31; - break; - case 11: - maxDaysInMonth = 30; - break; - case 12: - maxDaysInMonth = 31; - break; - default: - throw new System.InvalidOperationException($"Unexpected month: {month}"); - } - - if (day > maxDaysInMonth) - { - return false; - } - - return true; - } - - /// - /// Check that is a xs:dateTime with - /// the time zone set to UTC. - /// - public static bool IsXsDateTime( - string value - ) - { - if (!MatchesXsDateTime(value)) - { - return false; - } - - return IsPrefixedWithValidDate(value); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsDecimal() - { - var digit = "[0-9]"; - var unsignedNoDecimalPtNumeral = $"{digit}+"; - var noDecimalPtNumeral = $"(\\+|-)?{unsignedNoDecimalPtNumeral}"; - var fracFrag = $"{digit}+"; - var unsignedDecimalPtNumeral = $"({unsignedNoDecimalPtNumeral}\\.{fracFrag}|\\.{fracFrag})"; - var decimalPtNumeral = $"(\\+|-)?{unsignedDecimalPtNumeral}"; - var decimalLexicalRep = $"({decimalPtNumeral}|{noDecimalPtNumeral})"; - var pattern = $"^{decimalLexicalRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsDecimal = _constructMatchesXsDecimal(); - - /// - /// Check that conforms to the pattern of an xs:decimal. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#decimal - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsDecimal(string text) - { - return RegexMatchesXsDecimal.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsDouble() - { - var doubleRep = "((\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)([Ee](\\+|-)?[0-9]+)?|-?INF|NaN)"; - var pattern = $"^{doubleRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsDouble = _constructMatchesXsDouble(); - - /// - /// Check that conforms to the pattern of an xs:double. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#double - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsDouble(string text) - { - return RegexMatchesXsDouble.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsDuration() - { - var durationRep = "-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-" + - "9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S" + - ")?|([0-9]+(\\.[0-9]+)?S))))"; - var pattern = $"^{durationRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsDuration = _constructMatchesXsDuration(); - - /// - /// Check that conforms to the pattern of an xs:duration. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#duration - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsDuration(string text) - { - return RegexMatchesXsDuration.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsFloat() - { - var floatRep = "((\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)([Ee](\\+|-)?[0-9]+)?|-?INF|NaN)"; - var pattern = $"^{floatRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsFloat = _constructMatchesXsFloat(); - - /// - /// Check that conforms to the pattern of an xs:float. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#float - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsFloat(string text) - { - return RegexMatchesXsFloat.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsGDay() - { - var gDayLexicalRep = "---(0[1-9]|[12][0-9]|3[01])(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"; - var pattern = $"^{gDayLexicalRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsGDay = _constructMatchesXsGDay(); - - /// - /// Check that conforms to the pattern of an xs:gDay. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#gDay - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsGDay(string text) - { - return RegexMatchesXsGDay.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsGMonth() - { - var gMonthLexicalRep = "--(0[1-9]|1[0-2])(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"; - var pattern = $"^{gMonthLexicalRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsGMonth = _constructMatchesXsGMonth(); - - /// - /// Check that conforms to the pattern of an xs:gMonth. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#gMonth - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsGMonth(string text) - { - return RegexMatchesXsGMonth.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsGMonthDay() - { - var gMonthDayRep = "--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"; - var pattern = $"^{gMonthDayRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsGMonthDay = _constructMatchesXsGMonthDay(); - - /// - /// Check that conforms to the pattern of an xs:gMonthDay. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#gMonthDay - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsGMonthDay(string text) - { - return RegexMatchesXsGMonthDay.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsGYear() - { - var gYearRep = "-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"; - var pattern = $"^{gYearRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsGYear = _constructMatchesXsGYear(); - - /// - /// Check that conforms to the pattern of an xs:gYear. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#gYear - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsGYear(string text) - { - return RegexMatchesXsGYear.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsGYearMonth() - { - var gYearMonthRep = "-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"; - var pattern = $"^{gYearMonthRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsGYearMonth = _constructMatchesXsGYearMonth(); - - /// - /// Check that conforms to the pattern of an xs:gYearMonth. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#gYearMonth - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsGYearMonth(string text) - { - return RegexMatchesXsGYearMonth.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsHexBinary() - { - var hexBinary = "([0-9a-fA-F]{2})*"; - var pattern = $"^{hexBinary}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsHexBinary = _constructMatchesXsHexBinary(); - - /// - /// Check that conforms to the pattern of an xs:hexBinary. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#hexBinary - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsHexBinary(string text) - { - return RegexMatchesXsHexBinary.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsTime() - { - var timeRep = "(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?|(24:00:00(\\.0+)?))(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"; - var pattern = $"^{timeRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsTime = _constructMatchesXsTime(); - - /// - /// Check that conforms to the pattern of an xs:time. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#time - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsTime(string text) - { - return RegexMatchesXsTime.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsInteger() - { - var integerRep = "[-+]?[0-9]+"; - var pattern = $"^{integerRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsInteger = _constructMatchesXsInteger(); - - /// - /// Check that conforms to the pattern of an xs:integer. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#integer - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsInteger(string text) - { - return RegexMatchesXsInteger.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsLong() - { - var longRep = "[-+]?0*[0-9]{1,20}"; - var pattern = $"^{longRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsLong = _constructMatchesXsLong(); - - /// - /// Check that conforms to the pattern of an xs:long. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#long - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsLong(string text) - { - return RegexMatchesXsLong.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsInt() - { - var intRep = "[-+]?0*[0-9]{1,10}"; - var pattern = $"^{intRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsInt = _constructMatchesXsInt(); - - /// - /// Check that conforms to the pattern of an xs:int. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#int - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsInt(string text) - { - return RegexMatchesXsInt.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsShort() - { - var shortRep = "[-+]?0*[0-9]{1,5}"; - var pattern = $"^{shortRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsShort = _constructMatchesXsShort(); - - /// - /// Check that conforms to the pattern of an xs:short. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#short - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsShort(string text) - { - return RegexMatchesXsShort.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsByte() - { - var byteRep = "[-+]?0*[0-9]{1,3}"; - var pattern = $"^{byteRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsByte = _constructMatchesXsByte(); - - /// - /// Check that conforms to the pattern of an xs:byte. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#byte - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsByte(string text) - { - return RegexMatchesXsByte.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsNonNegativeInteger() - { - var nonNegativeIntegerRep = "(-0|\\+?[0-9]+)"; - var pattern = $"^{nonNegativeIntegerRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsNonNegativeInteger = _constructMatchesXsNonNegativeInteger(); - - /// - /// Check that conforms to the pattern of an xs:nonNegativeInteger. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#nonNegativeInteger - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsNonNegativeInteger(string text) - { - return RegexMatchesXsNonNegativeInteger.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsPositiveInteger() - { - var positiveIntegerRep = "\\+?0*[1-9][0-9]*"; - var pattern = $"^{positiveIntegerRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsPositiveInteger = _constructMatchesXsPositiveInteger(); - - /// - /// Check that conforms to the pattern of an xs:positiveInteger. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#positiveInteger - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsPositiveInteger(string text) - { - return RegexMatchesXsPositiveInteger.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsUnsignedLong() - { - var unsignedLongRep = "(-0|\\+?0*[0-9]{1,20})"; - var pattern = $"^{unsignedLongRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsUnsignedLong = _constructMatchesXsUnsignedLong(); - - /// - /// Check that conforms to the pattern of an xs:unsignedLong. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#unsignedLong - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsUnsignedLong(string text) - { - return RegexMatchesXsUnsignedLong.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsUnsignedInt() - { - var unsignedIntRep = "(-0|\\+?0*[0-9]{1,10})"; - var pattern = $"^{unsignedIntRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsUnsignedInt = _constructMatchesXsUnsignedInt(); - - /// - /// Check that conforms to the pattern of an xs:unsignedInt. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#unsignedInt - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsUnsignedInt(string text) - { - return RegexMatchesXsUnsignedInt.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsUnsignedShort() - { - var unsignedShortRep = "(-0|\\+?0*[0-9]{1,5})"; - var pattern = $"^{unsignedShortRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsUnsignedShort = _constructMatchesXsUnsignedShort(); - - /// - /// Check that conforms to the pattern of an xs:unsignedShort. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#unsignedShort - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsUnsignedShort(string text) - { - return RegexMatchesXsUnsignedShort.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsUnsignedByte() - { - var unsignedByteRep = "(-0|\\+?0*[0-9]{1,3})"; - var pattern = $"^{unsignedByteRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsUnsignedByte = _constructMatchesXsUnsignedByte(); - - /// - /// Check that conforms to the pattern of an xs:unsignedByte. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#unsignedByte - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsUnsignedByte(string text) - { - return RegexMatchesXsUnsignedByte.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsNonPositiveInteger() - { - var nonPositiveIntegerRep = "(\\+0|0|-[0-9]+)"; - var pattern = $"^{nonPositiveIntegerRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsNonPositiveInteger = _constructMatchesXsNonPositiveInteger(); - - /// - /// Check that conforms to the pattern of an xs:nonPositiveInteger. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#nonPositiveInteger - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsNonPositiveInteger(string text) - { - return RegexMatchesXsNonPositiveInteger.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsNegativeInteger() - { - var negativeIntegerRep = "(-0*[1-9][0-9]*)"; - var pattern = $"^{negativeIntegerRep}$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsNegativeInteger = _constructMatchesXsNegativeInteger(); - - /// - /// Check that conforms to the pattern of an xs:negativeInteger. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#negativeInteger - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsNegativeInteger(string text) - { - return RegexMatchesXsNegativeInteger.IsMatch(text); - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructMatchesXsString() - { - var pattern = "^([\\x09\\x0a\\x0d\\x20-\\ud7ff\\ue000-\\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexMatchesXsString = _constructMatchesXsString(); - - /// - /// Check that conforms to the pattern of an xs:string. - /// - /// - /// See: https://www.w3.org/TR/xmlschema-2/#string - /// - /// - /// Text to be checked - /// - /// - /// True if the conforms to the pattern - /// - public static bool MatchesXsString(string text) - { - return RegexMatchesXsString.IsMatch(text); - } - - /// - /// Check that the is consistent with - /// the given . - /// - public static bool ValueConsistentWithXsdType( - string value, - Aas.DataTypeDefXsd valueType - ) - { - switch (valueType) - { - case Aas.DataTypeDefXsd.AnyUri: - { - return MatchesXsAnyUri(value); - } - case Aas.DataTypeDefXsd.Base64Binary: - { - return MatchesXsBase64Binary(value); - } - case Aas.DataTypeDefXsd.Boolean: - { - return MatchesXsBoolean(value); - } - case Aas.DataTypeDefXsd.Byte: - { - try - { - // ReSharper disable once ReturnValueOfPureMethodIsNotUsed - System.Xml.XmlConvert.ToSByte(value); - return true; - } - catch (System.OverflowException) - { - return false; - } - catch (System.FormatException) - { - return false; - } - } - case Aas.DataTypeDefXsd.Date: - { - if (!MatchesXsDate(value)) - { - return false; - } - - return IsPrefixedWithValidDate(value); - } - case Aas.DataTypeDefXsd.DateTime: - { - if (!MatchesXsDateTime(value)) - { - return false; - } - - // The time part and the time zone part will be checked by - // MatchesXsDateTime. We need to check that the date part is - // correct in sense of the day/month combination. - return IsPrefixedWithValidDate(value); - } - case Aas.DataTypeDefXsd.Decimal: - { - return MatchesXsDecimal(value); - } - case Aas.DataTypeDefXsd.Double: - { - // We need to check explicitly for the regular expression since - // System.Xml.XmlConvert.ToDouble is too permissive. For example, - // it accepts "nan" although only "NaN" is valid. - // See: https://www.w3.org/TR/xmlschema-2/#double - if (!MatchesXsDouble(value)) - { - return false; - } - - double converted; - try - { - converted = System.Xml.XmlConvert.ToDouble(value); - } - catch (System.FormatException) - { - return false; - } - - if (System.Double.IsInfinity(converted)) - { - // Check that the value is either "INF" or "-INF". - // Otherwise, the value is a decimal which is too big - // to be represented as a double-precision floating point - // number. - // - // Earlier C# used to throw an exception in this case. Today it - // simply rounds the parsed value to infinity. In the context - // of data exchange formats (such as AAS), this can cause - // critical errors, so we check for this edge case explicitly. - if (value.Length == 3) - { - return value == "INF"; - } - else if (value.Length == 4) - { - return value == "-INF"; - } - else - { - return false; - } - } - return true; - } - case Aas.DataTypeDefXsd.Duration: - { - return MatchesXsDuration(value); - } - case Aas.DataTypeDefXsd.Float: - { - // We need to check explicitly for the regular expression since - // System.Xml.XmlConvert.ToSingle is too permissive. For example, - // it accepts "nan" although only "NaN" is valid. - // See: https://www.w3.org/TR/xmlschema-2/#float - if (!MatchesXsFloat(value)) - { - return false; - } - - float converted; - try - { - converted = System.Xml.XmlConvert.ToSingle(value); - } - catch (System.FormatException) - { - return false; - } - - if (System.Single.IsInfinity(converted)) - { - // Check that the value is either "INF" or "-INF". - // Otherwise, the value is a decimal which is too big - // to be represented as a single-precision floating point - // number. - // - // Earlier C# used to throw an exception in this case. Today it - // simply rounds the parsed value to infinity. In the context - // of data exchange formats (such as AAS), this can cause - // critical errors, so we check for this edge case explicitly. - if (value.Length == 3) - { - return value == "INF"; - } - else if (value.Length == 4) - { - return value == "-INF"; - } - else - { - return false; - } - } - return true; - } - case Aas.DataTypeDefXsd.GDay: - { - return MatchesXsGDay(value); - } - case Aas.DataTypeDefXsd.GMonth: - { - return MatchesXsGMonth(value); - } - case Aas.DataTypeDefXsd.GMonthDay: - { - if (!MatchesXsGMonthDay(value)) - { - return false; - } - - var month = int.Parse(value.Substring(2, 2)); - var day = int.Parse(value.Substring(5, 2)); - switch (month) - { - case 1: - case 3: - case 5: - case 7: - case 8: - case 10: - case 12: - return day <= 31; - case 4: - case 6: - case 9: - case 11: - return day <= 30; - case 2: - return day <= 29; - default: - throw new System.InvalidOperationException( - $"Unhandled month: {month}; " + - "is there maybe a bug in MatchesXsGMonthDay?" - ); - } - } - case Aas.DataTypeDefXsd.GYear: - { - return MatchesXsGYear(value); - } - case Aas.DataTypeDefXsd.GYearMonth: - { - return MatchesXsGYearMonth(value); - } - case Aas.DataTypeDefXsd.HexBinary: - { - return MatchesXsHexBinary(value); - } - case Aas.DataTypeDefXsd.Int: - { - try - { - // ReSharper disable once ReturnValueOfPureMethodIsNotUsed - System.Xml.XmlConvert.ToInt32(value); - return true; - } - catch (System.OverflowException) - { - return false; - } - catch (System.FormatException) - { - return false; - } - } - case Aas.DataTypeDefXsd.Integer: - { - return MatchesXsInteger(value); - } - case Aas.DataTypeDefXsd.Long: - { - try - { - // ReSharper disable once ReturnValueOfPureMethodIsNotUsed - System.Xml.XmlConvert.ToInt64(value); - return true; - } - catch (System.OverflowException) - { - return false; - } - catch (System.FormatException) - { - return false; - } - } - case Aas.DataTypeDefXsd.NegativeInteger: - { - return MatchesXsNegativeInteger(value); - } - case Aas.DataTypeDefXsd.NonNegativeInteger: - { - return MatchesXsNonNegativeInteger(value); - } - case Aas.DataTypeDefXsd.NonPositiveInteger: - { - return MatchesXsNonPositiveInteger(value); - } - case Aas.DataTypeDefXsd.PositiveInteger: - { - return MatchesXsPositiveInteger(value); - } - case Aas.DataTypeDefXsd.Short: - { - try - { - // ReSharper disable once ReturnValueOfPureMethodIsNotUsed - System.Xml.XmlConvert.ToInt16(value); - return true; - } - catch (System.OverflowException) - { - return false; - } - catch (System.FormatException) - { - return false; - } - } - case Aas.DataTypeDefXsd.String: - { - return MatchesXsString(value); - } - case Aas.DataTypeDefXsd.Time: - { - return MatchesXsTime(value); - } - case Aas.DataTypeDefXsd.UnsignedByte: - { - if (value.Length == 0) - { - return false; - } - - // We need to allow negative zeros which are allowed in the lexical - // representation of an unsigned byte, but System.Xml.XmlConvert.ToByte - // rejects it. - // See: https://www.w3.org/TR/xmlschema11-2/#unsignedByte - if (value == "-0") - { - return true; - } - - // We need to strip the prefix positive sign since - // System.Xml.XmlConvert.ToByte does not adhere to lexical representation - // of an unsigned byte. - // - // The positive sign is indeed allowed in the lexical representation, see: - // https://www.w3.org/TR/xmlschema11-2/#unsignedByte - string clipped = (value[0] == '+') - ? value.Substring(1, value.Length - 1) - : value; - - try - { - // ReSharper disable once ReturnValueOfPureMethodIsNotUsed - System.Xml.XmlConvert.ToByte(clipped); - return true; - } - catch (System.OverflowException) - { - return false; - } - catch (System.FormatException) - { - return false; - } - } - case Aas.DataTypeDefXsd.UnsignedInt: - { - if (value.Length == 0) - { - return false; - } - - // We need to allow negative zeros which are allowed in the lexical - // representation of an unsigned int, but System.Xml.XmlConvert.ToUInt32 - // rejects it. - // See: https://www.w3.org/TR/xmlschema11-2/#unsignedInt - if (value == "-0") - { - return true; - } - - // We need to strip the prefix positive sign since - // System.Xml.XmlConvert.ToUInt32 does not adhere to lexical representation - // of an unsigned int. - // - // The positive sign is indeed allowed in the lexical representation, see: - // https://www.w3.org/TR/xmlschema11-2/#unsignedInt - string clipped = (value[0] == '+') - ? value.Substring(1, value.Length - 1) - : value; - - try - { - // ReSharper disable once ReturnValueOfPureMethodIsNotUsed - System.Xml.XmlConvert.ToUInt32(clipped); - return true; - } - catch (System.OverflowException) - { - return false; - } - catch (System.FormatException) - { - return false; - } - } - case Aas.DataTypeDefXsd.UnsignedLong: - { - if (value.Length == 0) - { - return false; - } - - // We need to allow negative zeros which are allowed in the lexical - // representation of an unsigned long, but System.Xml.XmlConvert.ToUInt64 - // rejects it. - // See: https://www.w3.org/TR/xmlschema11-2/#unsignedLong - if (value == "-0") - { - return true; - } - - // We need to strip the prefix positive sign since - // System.Xml.XmlConvert.ToUInt64 does not adhere to lexical representation - // of an unsigned long. - // - // The positive sign is indeed allowed in the lexical representation, see: - // https://www.w3.org/TR/xmlschema11-2/#unsignedLong - string clipped = (value[0] == '+') - ? value.Substring(1, value.Length - 1) - : value; - - try - { - // ReSharper disable once ReturnValueOfPureMethodIsNotUsed - System.Xml.XmlConvert.ToUInt64(clipped); - return true; - } - catch (System.OverflowException) - { - return false; - } - catch (System.FormatException) - { - return false; - } - } - case Aas.DataTypeDefXsd.UnsignedShort: - { - if (value.Length == 0) - { - return false; - } - - // We need to allow negative zeros which are allowed in the lexical - // representation of an unsigned short, but System.Xml.XmlConvert.ToUInt16 - // rejects it. - // See: https://www.w3.org/TR/xmlschema11-2/#unsignedShort - if (value == "-0") - { - return true; - } - - // We need to strip the prefix positive sign since - // System.Xml.XmlConvert.ToUInt16 does not adhere to lexical representation - // of an unsigned short. - // - // The positive sign is indeed allowed in the lexical representation, see: - // https://www.w3.org/TR/xmlschema11-2/#unsignedShort - string clipped = (value[0] == '+') - ? value.Substring(1, value.Length - 1) - : value; - - try - { - // ReSharper disable once ReturnValueOfPureMethodIsNotUsed - System.Xml.XmlConvert.ToUInt16(clipped); - return true; - } - catch (System.OverflowException) - { - return false; - } - catch (System.FormatException) - { - return false; - } - } - default: - throw new System.ArgumentException( - $"valueType is an invalid DataTypeDefXsd: {valueType}" - ); - } - } - - /// - /// Check that the target of the model reference matches the . - /// - public static bool IsModelReferenceTo( - IReference reference, - KeyTypes expectedType - ) - { - return reference.Type == ReferenceTypes.ModelReference - && reference.Keys.Count != 0 - && reference.Keys[^1].Type == expectedType; - } // public static bool IsModelReferenceTo - - /// - /// Check that the target of the reference matches a . - /// - public static bool IsModelReferenceToReferable( - IReference reference - ) - { - return reference.Type == ReferenceTypes.ModelReference - && reference.Keys.Count != 0 - && Aas.Constants.AasReferables.Contains(reference.Keys[^1].Type); - } // public static bool IsModelReferenceToReferable - - /// - /// Check that all are unique among - /// . - /// - public static bool IdShortsAreUnique( - IEnumerable referables - ) - { - var idShortSet = new HashSet(); - foreach (var referable in referables) - { - if (referable.IdShort != null) - { - if (idShortSet.Contains(referable.IdShort)) - { - return false; - } - idShortSet.Add(referable.IdShort); - } - } - return true; - } - - /// - /// Check that all 's are among all the - /// , and - /// are unique. - /// - public static bool IdShortsOfVariablesAreUnique( - IEnumerable? inputVariables, - IEnumerable? outputVariables, - IEnumerable? inoutputVariables - ) - { - var idShortSet = new HashSet(); - - if (inputVariables != null) - { - foreach (var variable in inputVariables) - { - if (variable.Value.IdShort != null) - { - if (idShortSet.Contains(variable.Value.IdShort)) - { - return false; - } - idShortSet.Add(variable.Value.IdShort); - } - } - } - - if (outputVariables != null) - { - foreach (var variable in outputVariables) - { - if (variable.Value.IdShort != null) - { - if (idShortSet.Contains(variable.Value.IdShort)) - { - return false; - } - idShortSet.Add(variable.Value.IdShort); - } - } - } - - if (inoutputVariables != null) - { - foreach (var variable in inoutputVariables) - { - if (variable.Value.IdShort != null) - { - if (idShortSet.Contains(variable.Value.IdShort)) - { - return false; - } - idShortSet.Add(variable.Value.IdShort); - } - } - } - - return true; - } - - /// - /// Check that all are unique among - /// . - /// - public static bool ExtensionNamesAreUnique( - IEnumerable extensions - ) - { - var nameSet = new HashSet(); - foreach (var extension in extensions) - { - if (nameSet.Contains(extension.Name)) - { - return false; - } - nameSet.Add(extension.Name); - } - return true; - } - - /// - /// Check that all have the identical - /// 's. - /// - public static bool SubmodelElementsHaveIdenticalSemanticIds( - IEnumerable elements - ) - { - Aas.IReference? thatSemanticId = null; - - foreach (var element in elements) - { - if (element.SemanticId == null) - { - continue; - } - - if (thatSemanticId == null) - { - thatSemanticId = element.SemanticId; - continue; - } - - var thisSemanticId = element.SemanticId; - - if (thatSemanticId.Keys.Count != thisSemanticId.Keys.Count) - { - return false; - } - - for (int i = 0; i < thisSemanticId.Keys.Count; i++) - { - if (thatSemanticId.Keys[i].Value != thisSemanticId.Keys[i].Value) - { - return false; - } - } - } - - return true; - } - - public static bool SubmodelElementIsOfType( - Aas.ISubmodelElement element, - Aas.AasSubmodelElements expectedType - ) - { - switch (expectedType) - { - case Aas.AasSubmodelElements.AnnotatedRelationshipElement: - return element is Aas.IAnnotatedRelationshipElement; - - case Aas.AasSubmodelElements.BasicEventElement: - return element is Aas.IBasicEventElement; - - case Aas.AasSubmodelElements.Blob: - return element is Aas.IBlob; - - case Aas.AasSubmodelElements.Capability: - return element is Aas.ICapability; - - case Aas.AasSubmodelElements.DataElement: - return element is Aas.IDataElement; - - case Aas.AasSubmodelElements.Entity: - return element is Aas.IEntity; - - case Aas.AasSubmodelElements.EventElement: - return element is Aas.IEventElement; - - case Aas.AasSubmodelElements.File: - return element is Aas.IFile; - - case Aas.AasSubmodelElements.MultiLanguageProperty: - return element is Aas.IMultiLanguageProperty; - - case Aas.AasSubmodelElements.Operation: - return element is Aas.IOperation; - - case Aas.AasSubmodelElements.Property: - return element is Aas.IProperty; - - case Aas.AasSubmodelElements.Range: - return element is Aas.IRange; - - case Aas.AasSubmodelElements.ReferenceElement: - return element is Aas.IReferenceElement; - - case Aas.AasSubmodelElements.RelationshipElement: - return element is Aas.IRelationshipElement; - - case Aas.AasSubmodelElements.SubmodelElement: - // ReSharper disable once IsExpressionAlwaysTrue - // ReSharper disable once ConvertTypeCheckToNullCheck - return element is Aas.ISubmodelElement; - - case Aas.AasSubmodelElements.SubmodelElementList: - return element is Aas.ISubmodelElementList; - - case Aas.AasSubmodelElements.SubmodelElementCollection: - return element is Aas.ISubmodelElementCollection; - - default: - throw new System.ArgumentException( - $"expectedType is not a valid AasSubmodelElements: {expectedType}" - ); - } - } - - /// - /// Check that the which are - /// or - /// have the given . - /// - /// - /// We have to use nullable valueType since the compiler does not really handle - /// nullable C# value types. - /// - /// See https://endjin.com/blog/2022/02/csharp-10-generics-nullable-references-improvements-allownull - /// - public static bool PropertiesOrRangesHaveValueType( - IEnumerable elements, - Aas.DataTypeDefXsd? valueType - ) - { - foreach (var element in elements) - { - switch (element) - { - case Aas.IProperty prop: - if (prop.ValueType != valueType) - { - return false; - } - break; - case Aas.IRange range: - if (range.ValueType != valueType) - { - return false; - } - break; - } - } - return true; - } - - /// - /// Check that the two references, and - /// , are equal by comparing - /// their by - /// 's. - /// - public static bool ReferenceKeyValuesEqual( - Aas.IReference that, - Aas.IReference other - ) - { - if (that.Keys.Count != other.Keys.Count) - { - return false; - } - - for (int i = 0; i < that.Keys.Count; i++) - { - if (that.Keys[i].Value != other.Keys[i].Value) - { - return false; - } - } - - return true; - } - - /// - /// Check that the is defined - /// appropriately for all data specifications whose content is given as IEC 61360. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static bool DataSpecificationIec61360sForPropertyOrValueHaveAppropriateDataType( - IEnumerable embeddedDataSpecifications - ) - { - foreach (var embeddedDataSpecification in embeddedDataSpecifications) - { - var iec61360 = ( - embeddedDataSpecification.DataSpecificationContent - as Aas.IDataSpecificationIec61360 - ); - if (iec61360 != null) - { - if ( - iec61360.DataType == null - || !Constants.DataTypeIec61360ForPropertyOrValue.Contains( - iec61360.DataType) - ) - { - return false; - } - } - } - - return true; - } - - /// - /// Check that the is defined - /// appropriately for all data specifications whose content is given as IEC 61360. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static bool DataSpecificationIec61360sForReferenceHaveAppropriateDataType( - IEnumerable embeddedDataSpecifications - ) - { - foreach (var embeddedDataSpecification in embeddedDataSpecifications) - { - var iec61360 = ( - embeddedDataSpecification.DataSpecificationContent - as Aas.IDataSpecificationIec61360 - ); - if (iec61360 != null) - { - if ( - iec61360.DataType == null - || !Constants.DataTypeIec61360ForReference.Contains( - iec61360.DataType) - ) - { - return false; - } - } - } - - return true; - } - - /// - /// Check that the is defined - /// appropriately for all data specifications whose content is given as IEC 61360. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static bool DataSpecificationIec61360sForDocumentHaveAppropriateDataType( - IEnumerable embeddedDataSpecifications - ) - { - foreach (var embeddedDataSpecification in embeddedDataSpecifications) - { - var iec61360 = ( - embeddedDataSpecification.DataSpecificationContent - as Aas.IDataSpecificationIec61360 - ); - if (iec61360 != null) - { - if ( - iec61360.DataType == null - || !Constants.DataTypeIec61360ForDocument.Contains( - iec61360.DataType) - ) - { - return false; - } - } - } - - return true; - } - - /// - /// Check that the is defined - /// for all data specifications whose content is given as IEC 61360. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static bool DataSpecificationIec61360sHaveDataType( - IEnumerable embeddedDataSpecifications - ) - { - foreach (var embeddedDataSpecification in embeddedDataSpecifications) - { - var iec61360 = ( - embeddedDataSpecification.DataSpecificationContent - as Aas.IDataSpecificationIec61360 - ); - if (iec61360 != null) - { - if (iec61360.DataType == null) - { - return false; - } - } - } - - return true; - } - - /// - /// Check that the is defined - /// for all data specifications whose content is given as IEC 61360. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static bool DataSpecificationIec61360sHaveValue( - IEnumerable embeddedDataSpecifications - ) - { - foreach (var embeddedDataSpecification in embeddedDataSpecifications) - { - var iec61360 = ( - embeddedDataSpecification.DataSpecificationContent - as Aas.IDataSpecificationIec61360 - ); - if (iec61360 != null) - { - if (iec61360.Value == null) - { - return false; - } - } - } - - return true; - } - - /// - /// Check that the is defined - /// for all data specifications whose content is given as IEC 61360 at least in English. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static bool DataSpecificationIec61360sHaveDefinitionAtLeastInEnglish( - IEnumerable embeddedDataSpecifications - ) - { - foreach (var embeddedDataSpecification in embeddedDataSpecifications) - { - var iec61360 = ( - embeddedDataSpecification.DataSpecificationContent - as Aas.IDataSpecificationIec61360 - ); - if (iec61360 != null) - { - if (iec61360.Definition == null) - { - return false; - } - - var noDefinitionInEnglish = true; - foreach (var langString in iec61360.Definition) - { - if (IsBcp47ForEnglish(langString.Language)) - { - noDefinitionInEnglish = false; - break; - } - } - - if (noDefinitionInEnglish) - { - return false; - } - } - } - - return true; - } - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - [CodeAnalysis.SuppressMessageAttribute("ReSharper", "IdentifierTypo")] - [CodeAnalysis.SuppressMessage("ReSharper", "StringLiteralTypo")] - private static Regex _constructIsBcp47ForEnglish() - { - var pattern = "^(en|EN)(-.*)?$"; - - return new Regex(pattern); - } - - private static readonly Regex RegexIsBcp47ForEnglish = _constructIsBcp47ForEnglish(); - - /// - /// Check that the corresponds to a BCP47 code for english. - /// - public static bool IsBcp47ForEnglish(string text) - { - return RegexIsBcp47ForEnglish.IsMatch(text); - } - - /// - /// Hash allowed enum values for efficient validation of enums. - /// - internal static class EnumValueSet - { - internal static readonly HashSet ForModellingKind = new HashSet - { - - (int)Aas.ModellingKind.Template, - (int)Aas.ModellingKind.Instance - }; - - internal static readonly HashSet ForQualifierKind = new HashSet - { - - (int)Aas.QualifierKind.ValueQualifier, - (int)Aas.QualifierKind.ConceptQualifier, - (int)Aas.QualifierKind.TemplateQualifier - }; - - internal static readonly HashSet ForAssetKind = new HashSet - { - - (int)Aas.AssetKind.Type, - (int)Aas.AssetKind.Instance, - (int)Aas.AssetKind.NotApplicable - }; - - internal static readonly HashSet ForAasSubmodelElements = new HashSet - { - - (int)Aas.AasSubmodelElements.AnnotatedRelationshipElement, - (int)Aas.AasSubmodelElements.BasicEventElement, - (int)Aas.AasSubmodelElements.Blob, - (int)Aas.AasSubmodelElements.Capability, - (int)Aas.AasSubmodelElements.DataElement, - (int)Aas.AasSubmodelElements.Entity, - (int)Aas.AasSubmodelElements.EventElement, - (int)Aas.AasSubmodelElements.File, - (int)Aas.AasSubmodelElements.MultiLanguageProperty, - (int)Aas.AasSubmodelElements.Operation, - (int)Aas.AasSubmodelElements.Property, - (int)Aas.AasSubmodelElements.Range, - (int)Aas.AasSubmodelElements.ReferenceElement, - (int)Aas.AasSubmodelElements.RelationshipElement, - (int)Aas.AasSubmodelElements.SubmodelElement, - (int)Aas.AasSubmodelElements.SubmodelElementList, - (int)Aas.AasSubmodelElements.SubmodelElementCollection - }; - - internal static readonly HashSet ForEntityType = new HashSet - { - - (int)Aas.EntityType.CoManagedEntity, - (int)Aas.EntityType.SelfManagedEntity - }; - - internal static readonly HashSet ForDirection = new HashSet - { - - (int)Aas.Direction.Input, - (int)Aas.Direction.Output - }; - - internal static readonly HashSet ForStateOfEvent = new HashSet - { - - (int)Aas.StateOfEvent.On, - (int)Aas.StateOfEvent.Off - }; - - internal static readonly HashSet ForReferenceTypes = new HashSet - { - - (int)Aas.ReferenceTypes.ExternalReference, - (int)Aas.ReferenceTypes.ModelReference - }; - - internal static readonly HashSet ForKeyTypes = new HashSet - { - - (int)Aas.KeyTypes.AnnotatedRelationshipElement, - (int)Aas.KeyTypes.AssetAdministrationShell, - (int)Aas.KeyTypes.BasicEventElement, - (int)Aas.KeyTypes.Blob, - (int)Aas.KeyTypes.Capability, - (int)Aas.KeyTypes.ConceptDescription, - (int)Aas.KeyTypes.DataElement, - (int)Aas.KeyTypes.Entity, - (int)Aas.KeyTypes.EventElement, - (int)Aas.KeyTypes.File, - (int)Aas.KeyTypes.FragmentReference, - (int)Aas.KeyTypes.GlobalReference, - (int)Aas.KeyTypes.Identifiable, - (int)Aas.KeyTypes.MultiLanguageProperty, - (int)Aas.KeyTypes.Operation, - (int)Aas.KeyTypes.Property, - (int)Aas.KeyTypes.Range, - (int)Aas.KeyTypes.Referable, - (int)Aas.KeyTypes.ReferenceElement, - (int)Aas.KeyTypes.RelationshipElement, - (int)Aas.KeyTypes.Submodel, - (int)Aas.KeyTypes.SubmodelElement, - (int)Aas.KeyTypes.SubmodelElementCollection, - (int)Aas.KeyTypes.SubmodelElementList - }; - - internal static readonly HashSet ForDataTypeDefXsd = new HashSet - { - - (int)Aas.DataTypeDefXsd.AnyUri, - (int)Aas.DataTypeDefXsd.Base64Binary, - (int)Aas.DataTypeDefXsd.Boolean, - (int)Aas.DataTypeDefXsd.Byte, - (int)Aas.DataTypeDefXsd.Date, - (int)Aas.DataTypeDefXsd.DateTime, - (int)Aas.DataTypeDefXsd.Decimal, - (int)Aas.DataTypeDefXsd.Double, - (int)Aas.DataTypeDefXsd.Duration, - (int)Aas.DataTypeDefXsd.Float, - (int)Aas.DataTypeDefXsd.GDay, - (int)Aas.DataTypeDefXsd.GMonth, - (int)Aas.DataTypeDefXsd.GMonthDay, - (int)Aas.DataTypeDefXsd.GYear, - (int)Aas.DataTypeDefXsd.GYearMonth, - (int)Aas.DataTypeDefXsd.HexBinary, - (int)Aas.DataTypeDefXsd.Int, - (int)Aas.DataTypeDefXsd.Integer, - (int)Aas.DataTypeDefXsd.Long, - (int)Aas.DataTypeDefXsd.NegativeInteger, - (int)Aas.DataTypeDefXsd.NonNegativeInteger, - (int)Aas.DataTypeDefXsd.NonPositiveInteger, - (int)Aas.DataTypeDefXsd.PositiveInteger, - (int)Aas.DataTypeDefXsd.Short, - (int)Aas.DataTypeDefXsd.String, - (int)Aas.DataTypeDefXsd.Time, - (int)Aas.DataTypeDefXsd.UnsignedByte, - (int)Aas.DataTypeDefXsd.UnsignedInt, - (int)Aas.DataTypeDefXsd.UnsignedLong, - (int)Aas.DataTypeDefXsd.UnsignedShort - }; - - internal static readonly HashSet ForDataTypeIec61360 = new HashSet - { - - (int)Aas.DataTypeIec61360.Date, - (int)Aas.DataTypeIec61360.String, - (int)Aas.DataTypeIec61360.StringTranslatable, - (int)Aas.DataTypeIec61360.IntegerMeasure, - (int)Aas.DataTypeIec61360.IntegerCount, - (int)Aas.DataTypeIec61360.IntegerCurrency, - (int)Aas.DataTypeIec61360.RealMeasure, - (int)Aas.DataTypeIec61360.RealCount, - (int)Aas.DataTypeIec61360.RealCurrency, - (int)Aas.DataTypeIec61360.Boolean, - (int)Aas.DataTypeIec61360.Iri, - (int)Aas.DataTypeIec61360.Irdi, - (int)Aas.DataTypeIec61360.Rational, - (int)Aas.DataTypeIec61360.RationalMeasure, - (int)Aas.DataTypeIec61360.Time, - (int)Aas.DataTypeIec61360.Timestamp, - (int)Aas.DataTypeIec61360.File, - (int)Aas.DataTypeIec61360.Html, - (int)Aas.DataTypeIec61360.Blob - }; - } // internal static class EnumValueSet - - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - private static readonly Verification.Transformer _transformer = ( - new Verification.Transformer()); - - private class Transformer - : Visitation.AbstractTransformer> - { - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformExtension( - Aas.IExtension that - ) - { - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.RefersTo != null) - || (that.RefersTo.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Refers-to must be either not set or have at least one item."); - } - - if (!( - !(that.Value != null) - || Verification.ValueConsistentWithXsdType(that.Value, that.ValueTypeOrDefault()))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must match the value type."); - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - foreach (var error in Verification.VerifyNameType(that.Name)) - { - error.PrependSegment( - new Reporting.NameSegment( - "name")); - yield return error; - } - - if (that.ValueType != null) - { - // We need to help the static analyzer with a null coalescing. - Aas.DataTypeDefXsd value = that.ValueType - ?? throw new System.InvalidOperationException(); - foreach (var error in Verification.VerifyDataTypeDefXsd(value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - yield return error; - } - } - - if (that.Value != null) - { - foreach (var error in Verification.VerifyValueDataType(that.Value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - } - - if (that.RefersTo != null) - { - int indexRefersTo = 0; - foreach (var item in that.RefersTo) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexRefersTo)); - error.PrependSegment( - new Reporting.NameSegment( - "refersTo")); - yield return error; - } - indexRefersTo++; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformAdministrativeInformation( - Aas.IAdministrativeInformation that - ) - { - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - !(that.Revision != null) - || (that.Version != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-005: If version is not specified then also " + - "revision shall be unspecified. This means, a revision " + - "requires a version. If there is no version there is no " + - "revision either. Revision is optional."); - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - if (that.Version != null) - { - foreach (var error in Verification.VerifyVersionType(that.Version)) - { - error.PrependSegment( - new Reporting.NameSegment( - "version")); - yield return error; - } - } - - if (that.Revision != null) - { - foreach (var error in Verification.VerifyRevisionType(that.Revision)) - { - error.PrependSegment( - new Reporting.NameSegment( - "revision")); - yield return error; - } - } - - if (that.Creator != null) - { - foreach (var error in Verification.Verify(that.Creator)) - { - error.PrependSegment( - new Reporting.NameSegment( - "creator")); - yield return error; - } - } - - if (that.TemplateId != null) - { - foreach (var error in Verification.VerifyIdentifier(that.TemplateId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "templateId")); - yield return error; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformQualifier( - Aas.IQualifier that - ) - { - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Value != null) - || Verification.ValueConsistentWithXsdType(that.Value, that.ValueType))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-020: The value shall be consistent to " + - "the data type as defined in value type."); - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Kind != null) - { - // We need to help the static analyzer with a null coalescing. - Aas.QualifierKind value = that.Kind - ?? throw new System.InvalidOperationException(); - foreach (var error in Verification.VerifyQualifierKind(value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "kind")); - yield return error; - } - } - - foreach (var error in Verification.VerifyQualifierType(that.Type)) - { - error.PrependSegment( - new Reporting.NameSegment( - "type")); - yield return error; - } - - foreach (var error in Verification.VerifyDataTypeDefXsd(that.ValueType)) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - yield return error; - } - - if (that.Value != null) - { - foreach (var error in Verification.VerifyValueDataType(that.Value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - } - - if (that.ValueId != null) - { - foreach (var error in Verification.Verify(that.ValueId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueId")); - yield return error; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformAssetAdministrationShell( - Aas.IAssetAdministrationShell that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!(that.IdShort != null)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-117: ID-short of Referables not being " + - "a direct child of a Submodel element list shall be " + - "specified."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - !(that.Submodels != null) - || (that.Submodels.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Submodels must be either not set or have at least one item."); - } - - if (!( - !(that.DerivedFrom != null) - || Verification.IsModelReferenceTo( - that.DerivedFrom, - KeyTypes.AssetAdministrationShell))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Derived-from must be a model reference to an asset " + - "administration shell."); - } - - if (!( - !(that.Submodels != null) - || ( - that.Submodels.All( - reference => Verification.IsModelReferenceTo(reference, KeyTypes.Submodel)) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "All submodels must be model references to a submodel."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.Administration != null) - { - foreach (var error in Verification.Verify(that.Administration)) - { - error.PrependSegment( - new Reporting.NameSegment( - "administration")); - yield return error; - } - } - - foreach (var error in Verification.VerifyIdentifier(that.Id)) - { - error.PrependSegment( - new Reporting.NameSegment( - "id")); - yield return error; - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - if (that.DerivedFrom != null) - { - foreach (var error in Verification.Verify(that.DerivedFrom)) - { - error.PrependSegment( - new Reporting.NameSegment( - "derivedFrom")); - yield return error; - } - } - - foreach (var error in Verification.Verify(that.AssetInformation)) - { - error.PrependSegment( - new Reporting.NameSegment( - "assetInformation")); - yield return error; - } - - if (that.Submodels != null) - { - int indexSubmodels = 0; - foreach (var item in that.Submodels) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSubmodels)); - error.PrependSegment( - new Reporting.NameSegment( - "submodels")); - yield return error; - } - indexSubmodels++; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformAssetInformation( - Aas.IAssetInformation that - ) - { - if (!( - !(that.SpecificAssetIds != null) - || ( - that.SpecificAssetIds.All( - specificAssetId => specificAssetId.Name != "globalAssetId" - || ( - specificAssetId.Name == "globalAssetId" - && specificAssetId.Value == that.GlobalAssetId - )) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-116: ``globalAssetId`` is a reserved key. " + - "If used as value for the name of specific asset ID then " + - "the value of specific asset ID shall be identical to " + - "the global asset ID."); - } - - if (!( - ( - (that.GlobalAssetId != null) - && (that.SpecificAssetIds == null) - ) - || ( - (that.GlobalAssetId == null) - && (that.SpecificAssetIds != null) - && that.SpecificAssetIds.Count >= 1 - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-131: Either the global asset ID shall be " + - "defined or at least one specific asset ID."); - } - - if (!( - !(that.SpecificAssetIds != null) - || (that.SpecificAssetIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Specific asset IDs must be either not set or have at least " + - "one item."); - } - - foreach (var error in Verification.VerifyAssetKind(that.AssetKind)) - { - error.PrependSegment( - new Reporting.NameSegment( - "assetKind")); - yield return error; - } - - if (that.GlobalAssetId != null) - { - foreach (var error in Verification.VerifyIdentifier(that.GlobalAssetId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "globalAssetId")); - yield return error; - } - } - - if (that.SpecificAssetIds != null) - { - int indexSpecificAssetIds = 0; - foreach (var item in that.SpecificAssetIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSpecificAssetIds)); - error.PrependSegment( - new Reporting.NameSegment( - "specificAssetIds")); - yield return error; - } - indexSpecificAssetIds++; - } - } - - if (that.AssetType != null) - { - foreach (var error in Verification.VerifyIdentifier(that.AssetType)) - { - error.PrependSegment( - new Reporting.NameSegment( - "assetType")); - yield return error; - } - } - - if (that.DefaultThumbnail != null) - { - foreach (var error in Verification.Verify(that.DefaultThumbnail)) - { - error.PrependSegment( - new Reporting.NameSegment( - "defaultThumbnail")); - yield return error; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformResource( - Aas.IResource that - ) - { - foreach (var error in Verification.VerifyPathType(that.Path)) - { - error.PrependSegment( - new Reporting.NameSegment( - "path")); - yield return error; - } - - if (that.ContentType != null) - { - foreach (var error in Verification.VerifyContentType(that.ContentType)) - { - error.PrependSegment( - new Reporting.NameSegment( - "contentType")); - yield return error; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformSpecificAssetId( - Aas.ISpecificAssetId that - ) - { - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.ExternalSubjectId != null) - || (that.ExternalSubjectId.Type == ReferenceTypes.ExternalReference))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-133: External subject ID shall be " + - "an external reference."); - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - foreach (var error in Verification.VerifyLabelType(that.Name)) - { - error.PrependSegment( - new Reporting.NameSegment( - "name")); - yield return error; - } - - foreach (var error in Verification.VerifyIdentifier(that.Value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - - if (that.ExternalSubjectId != null) - { - foreach (var error in Verification.Verify(that.ExternalSubjectId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "externalSubjectId")); - yield return error; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformSubmodel( - Aas.ISubmodel that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!(that.IdShort != null)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-117: ID-short of Referables not being " + - "a direct child of a Submodel element list shall be " + - "specified."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - !(that.SubmodelElements != null) - || (that.SubmodelElements.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Submodel elements must be either not set or have at least " + - "one item."); - } - - if (!( - !(that.SubmodelElements != null) - || ( - that.SubmodelElements.All( - item => item.IdShort != null) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "ID-shorts need to be defined for all the items of submodel " + - "elements according to AASd-117 (ID-short of Referables not " + - "being a direct child of a Submodel element list shall be " + - "specified)."); - } - - if (!( - !(that.SubmodelElements != null) - || Verification.IdShortsAreUnique(that.SubmodelElements))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-022: ID-short of non-identifiable " + - "referables within the same name space shall be unique " + - "(case-sensitive)."); - } - - if (!( - !(that.SubmodelElements != null) - || ( - !(that.Kind != ModellingKind.Template) - || ( - that.SubmodelElements.All( - submodelElement => !(submodelElement.Qualifiers != null) - || ( - submodelElement.Qualifiers.All( - qualifier => qualifier.KindOrDefault() != QualifierKind.TemplateQualifier) - )) - ) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-129: If any qualifier kind value of " + - "a Submodel element qualifier (attribute qualifier inherited " + - "via Qualifiable) is equal to Template Qualifier then " + - "the submodel element shall be part of a submodel template, " + - "i.e. a Submodel with submodel kind (attribute kind " + - "inherited via Has-Kind) value is equal to Template."); - } - - if (!( - !(that.Qualifiers != null) - || ( - !( - that.Qualifiers.Any( - qualifier => qualifier.KindOrDefault() == QualifierKind.TemplateQualifier) - ) - || (that.KindOrDefault() == ModellingKind.Template) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-119: If any qualifier kind value of " + - "a qualifiable qualifier is equal to template qualifier and " + - "the qualified element has kind then the qualified element " + - "shall be of kind template."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.Administration != null) - { - foreach (var error in Verification.Verify(that.Administration)) - { - error.PrependSegment( - new Reporting.NameSegment( - "administration")); - yield return error; - } - } - - foreach (var error in Verification.VerifyIdentifier(that.Id)) - { - error.PrependSegment( - new Reporting.NameSegment( - "id")); - yield return error; - } - - if (that.Kind != null) - { - // We need to help the static analyzer with a null coalescing. - Aas.ModellingKind value = that.Kind - ?? throw new System.InvalidOperationException(); - foreach (var error in Verification.VerifyModellingKind(value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "kind")); - yield return error; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - if (that.SubmodelElements != null) - { - int indexSubmodelElements = 0; - foreach (var item in that.SubmodelElements) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSubmodelElements)); - error.PrependSegment( - new Reporting.NameSegment( - "submodelElements")); - yield return error; - } - indexSubmodelElements++; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformRelationshipElement( - Aas.IRelationshipElement that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!(that.IdShort != null)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-117: ID-short of Referables not being " + - "a direct child of a Submodel element list shall be " + - "specified."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - foreach (var error in Verification.Verify(that.First)) - { - error.PrependSegment( - new Reporting.NameSegment( - "first")); - yield return error; - } - - foreach (var error in Verification.Verify(that.Second)) - { - error.PrependSegment( - new Reporting.NameSegment( - "second")); - yield return error; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformSubmodelElementList( - Aas.ISubmodelElementList that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - !(that.Value != null) - || (that.Value.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Value must be either not set or have at least one item."); - } - - if (!( - !( - (that.Value != null) - && (that.SemanticIdListElement != null) - ) - || ( - that.Value.All( - child => !(child.SemanticId != null) - || Verification.ReferenceKeyValuesEqual(child.SemanticId, that.SemanticIdListElement)) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-107: If a first level child element has " + - "a semantic ID it shall be identical to semantic ID list " + - "element."); - } - - if (!( - !(that.Value != null) - || Verification.SubmodelElementsHaveIdenticalSemanticIds(that.Value))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-114: If two first level child elements have " + - "a semantic ID then they shall be identical."); - } - - if (!( - !(that.Value != null) - || ( - that.Value.All( - element => Verification.SubmodelElementIsOfType(element, that.TypeValueListElement)) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-108: All first level child elements shall " + - "have the same submodel element type as specified in type " + - "value list element."); - } - - if (!( - !( - (that.Value != null) - && ( - that.TypeValueListElement == AasSubmodelElements.Property - || that.TypeValueListElement == AasSubmodelElements.Range - ) - ) - || ( - (that.ValueTypeListElement != null) - && Verification.PropertiesOrRangesHaveValueType(that.Value, that.ValueTypeListElement) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-109: If type value list element is equal to " + - "Property or Range value type list element shall be set and " + - "all first level child elements shall have the value type as " + - "specified in value type list element."); - } - - if (!( - !(that.Value != null) - || ( - that.Value.All( - element => element.IdShort == null) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-120: ID-short of submodel elements being " + - "a direct child of a Submodel element list shall not be " + - "specified."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - if (that.SemanticIdListElement != null) - { - foreach (var error in Verification.Verify(that.SemanticIdListElement)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticIdListElement")); - yield return error; - } - } - - foreach ( - var error in Verification.VerifyAasSubmodelElements( - that.TypeValueListElement)) - { - error.PrependSegment( - new Reporting.NameSegment( - "typeValueListElement")); - yield return error; - } - - if (that.ValueTypeListElement != null) - { - // We need to help the static analyzer with a null coalescing. - Aas.DataTypeDefXsd value = that.ValueTypeListElement - ?? throw new System.InvalidOperationException(); - foreach (var error in Verification.VerifyDataTypeDefXsd(value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueTypeListElement")); - yield return error; - } - } - - if (that.Value != null) - { - int indexValue = 0; - foreach (var item in that.Value) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexValue)); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - indexValue++; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformSubmodelElementCollection( - Aas.ISubmodelElementCollection that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - !(that.Value != null) - || (that.Value.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Value must be either not set or have at least one item."); - } - - if (!( - !(that.Value != null) - || ( - that.Value.All( - item => item.IdShort != null) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "ID-shorts need to be defined for all the items of value " + - "according to AASd-117 (ID-short of Referables not being " + - "a direct child of a Submodel element list shall be " + - "specified)."); - } - - if (!( - !(that.Value != null) - || Verification.IdShortsAreUnique(that.Value))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "ID-shorts of the value must be unique."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - if (that.Value != null) - { - int indexValue = 0; - foreach (var item in that.Value) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexValue)); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - indexValue++; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformProperty( - Aas.IProperty that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - !(that.Category != null) - || Aas.Constants.ValidCategoriesForDataElement.Contains(that.Category))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-090: For data elements category shall be " + - "one of the following values: CONSTANT, PARAMETER or " + - "VARIABLE."); - } - - if (!( - !(that.Value != null) - || Verification.ValueConsistentWithXsdType(that.Value, that.ValueType))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Value must be consistent with the value type."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - foreach (var error in Verification.VerifyDataTypeDefXsd(that.ValueType)) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - yield return error; - } - - if (that.Value != null) - { - foreach (var error in Verification.VerifyValueDataType(that.Value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - } - - if (that.ValueId != null) - { - foreach (var error in Verification.Verify(that.ValueId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueId")); - yield return error; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformMultiLanguageProperty( - Aas.IMultiLanguageProperty that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - !(that.Category != null) - || Aas.Constants.ValidCategoriesForDataElement.Contains(that.Category))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-090: For data elements category shall be " + - "one of the following values: CONSTANT, PARAMETER or " + - "VARIABLE."); - } - - if (!( - !(that.Value != null) - || Verification.LangStringsHaveUniqueLanguages(that.Value))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Value specifies no duplicate languages."); - } - - if (!( - !(that.Value != null) - || (that.Value.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Value must be either not set or have at least one item."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - if (that.Value != null) - { - int indexValue = 0; - foreach (var item in that.Value) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexValue)); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - indexValue++; - } - } - - if (that.ValueId != null) - { - foreach (var error in Verification.Verify(that.ValueId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueId")); - yield return error; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformRange( - Aas.IRange that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - !(that.Category != null) - || Aas.Constants.ValidCategoriesForDataElement.Contains(that.Category))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-090: For data elements category shall be " + - "one of the following values: CONSTANT, PARAMETER or " + - "VARIABLE."); - } - - if (!( - !(that.Max != null) - || Verification.ValueConsistentWithXsdType(that.Max, that.ValueType))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Max must be consistent with the value type."); - } - - if (!( - !(that.Min != null) - || Verification.ValueConsistentWithXsdType(that.Min, that.ValueType))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Min must be consistent with the value type."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - foreach (var error in Verification.VerifyDataTypeDefXsd(that.ValueType)) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - yield return error; - } - - if (that.Min != null) - { - foreach (var error in Verification.VerifyValueDataType(that.Min)) - { - error.PrependSegment( - new Reporting.NameSegment( - "min")); - yield return error; - } - } - - if (that.Max != null) - { - foreach (var error in Verification.VerifyValueDataType(that.Max)) - { - error.PrependSegment( - new Reporting.NameSegment( - "max")); - yield return error; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformReferenceElement( - Aas.IReferenceElement that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - !(that.Category != null) - || Aas.Constants.ValidCategoriesForDataElement.Contains(that.Category))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-090: For data elements category shall be " + - "one of the following values: CONSTANT, PARAMETER or " + - "VARIABLE."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - if (that.Value != null) - { - foreach (var error in Verification.Verify(that.Value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformBlob( - Aas.IBlob that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - !(that.Category != null) - || Aas.Constants.ValidCategoriesForDataElement.Contains(that.Category))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-090: For data elements category shall be " + - "one of the following values: CONSTANT, PARAMETER or " + - "VARIABLE."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - if (that.Value != null) - { - foreach (var error in Verification.VerifyBlobType(that.Value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - } - - foreach (var error in Verification.VerifyContentType(that.ContentType)) - { - error.PrependSegment( - new Reporting.NameSegment( - "contentType")); - yield return error; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformFile( - Aas.IFile that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - !(that.Category != null) - || Aas.Constants.ValidCategoriesForDataElement.Contains(that.Category))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-090: For data elements category shall be " + - "one of the following values: CONSTANT, PARAMETER or " + - "VARIABLE."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - if (that.Value != null) - { - foreach (var error in Verification.VerifyPathType(that.Value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - } - - foreach (var error in Verification.VerifyContentType(that.ContentType)) - { - error.PrependSegment( - new Reporting.NameSegment( - "contentType")); - yield return error; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformAnnotatedRelationshipElement( - Aas.IAnnotatedRelationshipElement that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!(that.IdShort != null)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-117: ID-short of Referables not being " + - "a direct child of a Submodel element list shall be " + - "specified."); - } - - if (!( - !(that.Annotations != null) - || (that.Annotations.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Annotations must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Annotations != null) - || ( - that.Annotations.All( - item => item.IdShort != null) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "ID-shorts need to be defined for all the items of " + - "annotations according to AASd-117 (ID-short of Referables " + - "not being a direct child of a Submodel element list shall " + - "be specified)."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - foreach (var error in Verification.Verify(that.First)) - { - error.PrependSegment( - new Reporting.NameSegment( - "first")); - yield return error; - } - - foreach (var error in Verification.Verify(that.Second)) - { - error.PrependSegment( - new Reporting.NameSegment( - "second")); - yield return error; - } - - if (that.Annotations != null) - { - int indexAnnotations = 0; - foreach (var item in that.Annotations) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexAnnotations)); - error.PrependSegment( - new Reporting.NameSegment( - "annotations")); - yield return error; - } - indexAnnotations++; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformEntity( - Aas.IEntity that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - !(that.Statements != null) - || (that.Statements.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Statements must be either not set or have at least one item."); - } - - if (!( - !(that.Statements != null) - || ( - that.Statements.All( - item => item.IdShort != null) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "ID-shorts need to be defined for all the items of " + - "statements according to AASd-117 (ID-short of Referables " + - "not being a direct child of a Submodel element list shall " + - "be specified)."); - } - - if (!( - ( - that.EntityType == EntityType.SelfManagedEntity - && ( - ( - (that.GlobalAssetId != null) - && (that.SpecificAssetIds == null) - ) - || ( - (that.GlobalAssetId == null) - && (that.SpecificAssetIds != null) - && that.SpecificAssetIds.Count >= 1 - ) - ) - ) - || ( - (that.GlobalAssetId == null) - && (that.SpecificAssetIds == null) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-014: Either the attribute global asset ID " + - "or specific asset ID must be set if entity type is set to " + - "self-managed entity. They are not existing otherwise."); - } - - if (!( - !(that.SpecificAssetIds != null) - || (that.SpecificAssetIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Specific asset IDs must be either not set or have at least " + - "one item."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - if (that.Statements != null) - { - int indexStatements = 0; - foreach (var item in that.Statements) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexStatements)); - error.PrependSegment( - new Reporting.NameSegment( - "statements")); - yield return error; - } - indexStatements++; - } - } - - foreach (var error in Verification.VerifyEntityType(that.EntityType)) - { - error.PrependSegment( - new Reporting.NameSegment( - "entityType")); - yield return error; - } - - if (that.GlobalAssetId != null) - { - foreach (var error in Verification.VerifyIdentifier(that.GlobalAssetId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "globalAssetId")); - yield return error; - } - } - - if (that.SpecificAssetIds != null) - { - int indexSpecificAssetIds = 0; - foreach (var item in that.SpecificAssetIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSpecificAssetIds)); - error.PrependSegment( - new Reporting.NameSegment( - "specificAssetIds")); - yield return error; - } - indexSpecificAssetIds++; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformEventPayload( - Aas.IEventPayload that - ) - { - if (!( - Verification.IsModelReferenceTo(that.Source, KeyTypes.EventElement) - || Verification.IsModelReferenceTo(that.Source, KeyTypes.BasicEventElement))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Source must be a model reference to an Event element."); - } - - if (!( - Verification.IsModelReferenceToReferable(that.ObservableReference))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Observable reference must be a model reference to " + - "a referable."); - } - - foreach (var error in Verification.Verify(that.Source)) - { - error.PrependSegment( - new Reporting.NameSegment( - "source")); - yield return error; - } - - if (that.SourceSemanticId != null) - { - foreach (var error in Verification.Verify(that.SourceSemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "sourceSemanticId")); - yield return error; - } - } - - foreach (var error in Verification.Verify(that.ObservableReference)) - { - error.PrependSegment( - new Reporting.NameSegment( - "observableReference")); - yield return error; - } - - if (that.ObservableSemanticId != null) - { - foreach (var error in Verification.Verify(that.ObservableSemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "observableSemanticId")); - yield return error; - } - } - - if (that.Topic != null) - { - foreach (var error in Verification.VerifyMessageTopicType(that.Topic)) - { - error.PrependSegment( - new Reporting.NameSegment( - "topic")); - yield return error; - } - } - - if (that.SubjectId != null) - { - foreach (var error in Verification.Verify(that.SubjectId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "subjectId")); - yield return error; - } - } - - foreach (var error in Verification.VerifyDateTimeUtc(that.TimeStamp)) - { - error.PrependSegment( - new Reporting.NameSegment( - "timeStamp")); - yield return error; - } - - if (that.Payload != null) - { - foreach (var error in Verification.VerifyBlobType(that.Payload)) - { - error.PrependSegment( - new Reporting.NameSegment( - "payload")); - yield return error; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformBasicEventElement( - Aas.IBasicEventElement that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!(that.IdShort != null)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-117: ID-short of Referables not being " + - "a direct child of a Submodel element list shall be " + - "specified."); - } - - if (!( - !(that.Direction == Direction.Input) - || (that.MaxInterval == null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Max. interval is not applicable for input direction."); - } - - if (!( - Verification.IsModelReferenceToReferable(that.Observed))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Observed must be a model reference to a referable."); - } - - if (!( - !(that.MessageBroker != null) - || Verification.IsModelReferenceToReferable(that.MessageBroker))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Message broker must be a model reference to a referable."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - foreach (var error in Verification.Verify(that.Observed)) - { - error.PrependSegment( - new Reporting.NameSegment( - "observed")); - yield return error; - } - - foreach (var error in Verification.VerifyDirection(that.Direction)) - { - error.PrependSegment( - new Reporting.NameSegment( - "direction")); - yield return error; - } - - foreach (var error in Verification.VerifyStateOfEvent(that.State)) - { - error.PrependSegment( - new Reporting.NameSegment( - "state")); - yield return error; - } - - if (that.MessageTopic != null) - { - foreach (var error in Verification.VerifyMessageTopicType(that.MessageTopic)) - { - error.PrependSegment( - new Reporting.NameSegment( - "messageTopic")); - yield return error; - } - } - - if (that.MessageBroker != null) - { - foreach (var error in Verification.Verify(that.MessageBroker)) - { - error.PrependSegment( - new Reporting.NameSegment( - "messageBroker")); - yield return error; - } - } - - if (that.LastUpdate != null) - { - foreach (var error in Verification.VerifyDateTimeUtc(that.LastUpdate)) - { - error.PrependSegment( - new Reporting.NameSegment( - "lastUpdate")); - yield return error; - } - } - - if (that.MinInterval != null) - { - foreach (var error in Verification.VerifyDuration(that.MinInterval)) - { - error.PrependSegment( - new Reporting.NameSegment( - "minInterval")); - yield return error; - } - } - - if (that.MaxInterval != null) - { - foreach (var error in Verification.VerifyDuration(that.MaxInterval)) - { - error.PrependSegment( - new Reporting.NameSegment( - "maxInterval")); - yield return error; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformOperation( - Aas.IOperation that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - Verification.IdShortsOfVariablesAreUnique( - that.InputVariables, - that.OutputVariables, - that.InoutputVariables))) - { - yield return 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."); - } - - if (!( - !(that.InputVariables != null) - || (that.InputVariables.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Input variables must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.OutputVariables != null) - || (that.OutputVariables.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Output variables must be either not set or have at least " + - "one item."); - } - - if (!( - !(that.InoutputVariables != null) - || (that.InoutputVariables.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Inoutput variables must be either not set or have at least " + - "one item."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - if (that.InputVariables != null) - { - int indexInputVariables = 0; - foreach (var item in that.InputVariables) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexInputVariables)); - error.PrependSegment( - new Reporting.NameSegment( - "inputVariables")); - yield return error; - } - indexInputVariables++; - } - } - - if (that.OutputVariables != null) - { - int indexOutputVariables = 0; - foreach (var item in that.OutputVariables) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexOutputVariables)); - error.PrependSegment( - new Reporting.NameSegment( - "outputVariables")); - yield return error; - } - indexOutputVariables++; - } - } - - if (that.InoutputVariables != null) - { - int indexInoutputVariables = 0; - foreach (var item in that.InoutputVariables) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexInoutputVariables)); - error.PrependSegment( - new Reporting.NameSegment( - "inoutputVariables")); - yield return error; - } - indexInoutputVariables++; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformOperationVariable( - Aas.IOperationVariable that - ) - { - if (!(that.Value.IdShort != null)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Value must have the ID-short specified according to " + - "Constraint AASd-117 (ID-short of Referables not being " + - "a direct child of a Submodel element list shall be " + - "specified)."); - } - - foreach (var error in Verification.Verify(that.Value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformCapability( - Aas.ICapability that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SupplementalSemanticIds.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Supplemental semantic IDs must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.SupplementalSemanticIds != null) - || (that.SemanticId != null))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-118: If there are supplemental semantic IDs " + - "defined then there shall be also a main semantic ID."); - } - - if (!( - !(that.Qualifiers != null) - || (that.Qualifiers.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Qualifiers must be either not set or have at least one item."); - } - - if (!( - !(that.Qualifiers != null) - || Verification.QualifierTypesAreUnique(that.Qualifiers))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-021: Every qualifiable can only have one " + - "qualifier with the same type."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.SemanticId != null) - { - foreach (var error in Verification.Verify(that.SemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - yield return error; - } - } - - if (that.SupplementalSemanticIds != null) - { - int indexSupplementalSemanticIds = 0; - foreach (var item in that.SupplementalSemanticIds) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - yield return error; - } - indexSupplementalSemanticIds++; - } - } - - if (that.Qualifiers != null) - { - int indexQualifiers = 0; - foreach (var item in that.Qualifiers) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - yield return error; - } - indexQualifiers++; - } - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformConceptDescription( - Aas.IConceptDescription that - ) - { - if (!( - !(that.Extensions != null) - || (that.Extensions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Extensions must be either not set or have at least one item."); - } - - if (!( - !(that.Extensions != null) - || Verification.ExtensionNamesAreUnique(that.Extensions))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-077: The name of an extension within " + - "Has-Extensions needs to be unique."); - } - - if (!( - !(that.Description != null) - || (that.Description.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.Description != null) - || Verification.LangStringsHaveUniqueLanguages(that.Description))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Description specifies no duplicate languages."); - } - - if (!( - !(that.DisplayName != null) - || (that.DisplayName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name must be either not set or have at least one " + - "item."); - } - - if (!( - !(that.DisplayName != null) - || Verification.LangStringsHaveUniqueLanguages(that.DisplayName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Display name specifies no duplicate languages."); - } - - if (!(that.IdShort != null)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-117: ID-short of Referables not being " + - "a direct child of a Submodel element list shall be " + - "specified."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || (that.EmbeddedDataSpecifications.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Embedded data specifications must be either not set or have " + - "at least one item."); - } - - if (!( - !(that.IsCaseOf != null) - || (that.IsCaseOf.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Is-case-of must be either not set or have at least one item."); - } - - if (!( - !(that.EmbeddedDataSpecifications != null) - || ( - Verification.DataSpecificationIec61360sHaveDefinitionAtLeastInEnglish(that.EmbeddedDataSpecifications) - || Verification.DataSpecificationIec61360sHaveValue(that.EmbeddedDataSpecifications) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASc-3a-008: For a concept description using " + - "data specification template IEC 61360, the definition is " + - "mandatory and shall be defined at least in English. " + - "Exception: The concept description describes a value."); - } - - if (!( - !( - (that.Category != null) - && that.Category == "QUALIFIER_TYPE" - && (that.EmbeddedDataSpecifications != null) - ) - || Verification.DataSpecificationIec61360sHaveDataType(that.EmbeddedDataSpecifications))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASc-3a-007: For a concept description with " + - "category QUALIFIER_TYPE using data specification IEC 61360, " + - "the data type of the data specification is mandatory and " + - "shall be defined."); - } - - if (!( - !( - (that.Category != null) - && that.Category == "DOCUMENT" - && (that.EmbeddedDataSpecifications != null) - ) - || Verification.DataSpecificationIec61360sForDocumentHaveAppropriateDataType(that.EmbeddedDataSpecifications))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASc-3a-006: For a concept description with " + - "category DOCUMENT using data specification IEC 61360, " + - "the data type of the data specification shall be one of: " + - "FILE, BLOB, HTML."); - } - - if (!( - !( - (that.Category != null) - && that.Category == "REFERENCE" - && (that.EmbeddedDataSpecifications != null) - ) - || Verification.DataSpecificationIec61360sForReferenceHaveAppropriateDataType(that.EmbeddedDataSpecifications))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASc-3a-005: For a concept description with " + - "category REFERENCE using data specification IEC 61360, " + - "the data type of the data specification shall be one of: " + - "STRING, IRI, IRDI."); - } - - if (!( - !( - (that.Category != null) - && ( - that.Category == "PROPERTY" - || that.Category == "VALUE" - ) - && (that.EmbeddedDataSpecifications != null) - ) - || Verification.DataSpecificationIec61360sForPropertyOrValueHaveAppropriateDataType(that.EmbeddedDataSpecifications))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASc-3a-004: For a concept description with " + - "category PROPERTY or VALUE using data specification IEC " + - "61360, the data type of the data specification is mandatory " + - "and shall be one of: DATE, STRING, STRING_TRANSLATABLE, " + - "INTEGER_MEASURE, INTEGER_COUNT, INTEGER_CURRENCY, " + - "REAL_MEASURE, REAL_COUNT, REAL_CURRENCY, BOOLEAN, RATIONAL, " + - "RATIONAL_MEASURE, TIME, TIMESTAMP."); - } - - if (that.Extensions != null) - { - int indexExtensions = 0; - foreach (var item in that.Extensions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - yield return error; - } - indexExtensions++; - } - } - - if (that.Category != null) - { - foreach (var error in Verification.VerifyNameType(that.Category)) - { - error.PrependSegment( - new Reporting.NameSegment( - "category")); - yield return error; - } - } - - if (that.IdShort != null) - { - foreach (var error in Verification.VerifyIdShortType(that.IdShort)) - { - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - yield return error; - } - } - - if (that.DisplayName != null) - { - int indexDisplayName = 0; - foreach (var item in that.DisplayName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - yield return error; - } - indexDisplayName++; - } - } - - if (that.Description != null) - { - int indexDescription = 0; - foreach (var item in that.Description) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - yield return error; - } - indexDescription++; - } - } - - if (that.Administration != null) - { - foreach (var error in Verification.Verify(that.Administration)) - { - error.PrependSegment( - new Reporting.NameSegment( - "administration")); - yield return error; - } - } - - foreach (var error in Verification.VerifyIdentifier(that.Id)) - { - error.PrependSegment( - new Reporting.NameSegment( - "id")); - yield return error; - } - - if (that.EmbeddedDataSpecifications != null) - { - int indexEmbeddedDataSpecifications = 0; - foreach (var item in that.EmbeddedDataSpecifications) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - yield return error; - } - indexEmbeddedDataSpecifications++; - } - } - - if (that.IsCaseOf != null) - { - int indexIsCaseOf = 0; - foreach (var item in that.IsCaseOf) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexIsCaseOf)); - error.PrependSegment( - new Reporting.NameSegment( - "isCaseOf")); - yield return error; - } - indexIsCaseOf++; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformReference( - Aas.IReference that - ) - { - if (!(that.Keys.Count >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Keys must contain at least one item."); - } - - if (!( - !(that.Keys.Count >= 1) - || Aas.Constants.GloballyIdentifiables.Contains(that.Keys[0].Type))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-121: For References the value of type of " + - "the first key of keys shall be one of Globally " + - "Identifiables."); - } - - if (!( - !( - that.Type == ReferenceTypes.ExternalReference - && that.Keys.Count >= 1 - ) - || Aas.Constants.GenericGloballyIdentifiables.Contains(that.Keys[0].Type))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-122: For external references the value of " + - "type of the first key of keys shall be one of Generic " + - "Globally Identifiables."); - } - - if (!( - !( - that.Type == ReferenceTypes.ModelReference - && that.Keys.Count >= 1 - ) - || Aas.Constants.AasIdentifiables.Contains(that.Keys[0].Type))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-123: For model references the value of type " + - "of the first key of keys shall be one of AAS identifiables."); - } - - if (!( - !( - that.Type == ReferenceTypes.ExternalReference - && that.Keys.Count >= 1 - ) - || ( - Aas.Constants.GenericGloballyIdentifiables.Contains(that.Keys[^1].Type) - || Aas.Constants.GenericFragmentKeys.Contains(that.Keys[^1].Type) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-124: For external references the last key " + - "of keys shall be either one of Generic Globally " + - "Identifiables or one of Generic Fragment Keys."); - } - - if (!( - !( - that.Type == ReferenceTypes.ModelReference - && that.Keys.Count > 1 - ) - || ( - Enumerable.Range( - 1, - that.Keys.Count - 1 - ).All( - i => Aas.Constants.FragmentKeys.Contains(that.Keys[i].Type)) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-125: For model references with more than " + - "one key in keys the value of type of each of the keys " + - "following the first key of keys shall be one of Fragment " + - "Keys."); - } - - if (!( - !( - that.Type == ReferenceTypes.ModelReference - && that.Keys.Count > 1 - ) - || ( - Enumerable.Range( - 0, - that.Keys.Count - 1 - ).All( - i => !Aas.Constants.GenericFragmentKeys.Contains(that.Keys[i].Type)) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-126: For model references with more than " + - "one key in keys the value of type of the last key in " + - "the reference key chain may be one of Generic Fragment Keys " + - "or no key at all shall have a value out of Generic Fragment " + - "Keys."); - } - - if (!( - !( - that.Type == ReferenceTypes.ModelReference - && that.Keys.Count > 1 - && that.Keys[^1].Type == KeyTypes.FragmentReference - ) - || ( - that.Keys[^2].Type == KeyTypes.File - || that.Keys[^2].Type == KeyTypes.Blob - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-127: For model references, with more than " + - "one key in keys a key with type Fragment Reference shall be " + - "preceded by a key with type File or Blob."); - } - - if (!( - !( - that.Type == ReferenceTypes.ModelReference - && that.Keys.Count > 2 - ) - || ( - Enumerable.Range( - 0, - that.Keys.Count - 1 - ).All( - i => !(that.Keys[i].Type == KeyTypes.SubmodelElementList) - || Verification.MatchesXsPositiveInteger(that.Keys[i + 1].Value)) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-128: For model references, the value of " + - "a key preceded by a key with type Submodel element list is " + - "an integer number denoting the position in the array of " + - "the submodel element list."); - } - - foreach (var error in Verification.VerifyReferenceTypes(that.Type)) - { - error.PrependSegment( - new Reporting.NameSegment( - "type")); - yield return error; - } - - if (that.ReferredSemanticId != null) - { - foreach (var error in Verification.Verify(that.ReferredSemanticId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "referredSemanticId")); - yield return error; - } - } - - int indexKeys = 0; - foreach (var item in that.Keys) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexKeys)); - error.PrependSegment( - new Reporting.NameSegment( - "keys")); - yield return error; - } - indexKeys++; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformKey( - Aas.IKey that - ) - { - foreach (var error in Verification.VerifyKeyTypes(that.Type)) - { - error.PrependSegment( - new Reporting.NameSegment( - "type")); - yield return error; - } - - foreach (var error in Verification.VerifyIdentifier(that.Value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformLangStringNameType( - Aas.ILangStringNameType that - ) - { - if (!(that.Text.Length <= 128)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "String shall have a maximum length of 128 characters."); - } - - foreach (var error in Verification.VerifyBcp47LanguageTag(that.Language)) - { - error.PrependSegment( - new Reporting.NameSegment( - "language")); - yield return error; - } - - foreach ( - var error in Verification.VerifyNonEmptyXmlSerializableString( - that.Text)) - { - error.PrependSegment( - new Reporting.NameSegment( - "text")); - yield return error; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformLangStringTextType( - Aas.ILangStringTextType that - ) - { - if (!(that.Text.Length <= 1023)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "String shall have a maximum length of 1023 characters."); - } - - foreach (var error in Verification.VerifyBcp47LanguageTag(that.Language)) - { - error.PrependSegment( - new Reporting.NameSegment( - "language")); - yield return error; - } - - foreach ( - var error in Verification.VerifyNonEmptyXmlSerializableString( - that.Text)) - { - error.PrependSegment( - new Reporting.NameSegment( - "text")); - yield return error; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformEnvironment( - Aas.IEnvironment that - ) - { - if (!( - !(that.ConceptDescriptions != null) - || (that.ConceptDescriptions.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Concept descriptions must be either not set or have at " + - "least one item."); - } - - if (!( - !(that.Submodels != null) - || (that.Submodels.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Submodels must be either not set or have at least one item."); - } - - if (!( - !(that.AssetAdministrationShells != null) - || (that.AssetAdministrationShells.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Asset administration shells must be either not set or have " + - "at least one item."); - } - - if (that.AssetAdministrationShells != null) - { - int indexAssetAdministrationShells = 0; - foreach (var item in that.AssetAdministrationShells) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexAssetAdministrationShells)); - error.PrependSegment( - new Reporting.NameSegment( - "assetAdministrationShells")); - yield return error; - } - indexAssetAdministrationShells++; - } - } - - if (that.Submodels != null) - { - int indexSubmodels = 0; - foreach (var item in that.Submodels) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSubmodels)); - error.PrependSegment( - new Reporting.NameSegment( - "submodels")); - yield return error; - } - indexSubmodels++; - } - } - - if (that.ConceptDescriptions != null) - { - int indexConceptDescriptions = 0; - foreach (var item in that.ConceptDescriptions) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexConceptDescriptions)); - error.PrependSegment( - new Reporting.NameSegment( - "conceptDescriptions")); - yield return error; - } - indexConceptDescriptions++; - } - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformEmbeddedDataSpecification( - Aas.IEmbeddedDataSpecification that - ) - { - foreach (var error in Verification.Verify(that.DataSpecification)) - { - error.PrependSegment( - new Reporting.NameSegment( - "dataSpecification")); - yield return error; - } - - foreach (var error in Verification.Verify(that.DataSpecificationContent)) - { - error.PrependSegment( - new Reporting.NameSegment( - "dataSpecificationContent")); - yield return error; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformLevelType( - Aas.ILevelType that - ) - { - // No verification has been defined for LevelType. - yield break; - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformValueReferencePair( - Aas.IValueReferencePair that - ) - { - foreach (var error in Verification.VerifyValueTypeIec61360(that.Value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - - foreach (var error in Verification.Verify(that.ValueId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueId")); - yield return error; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformValueList( - Aas.IValueList that - ) - { - if (!(that.ValueReferencePairs.Count >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Value reference pair types must contain at least one item."); - } - - int indexValueReferencePairs = 0; - foreach (var item in that.ValueReferencePairs) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexValueReferencePairs)); - error.PrependSegment( - new Reporting.NameSegment( - "valueReferencePairs")); - yield return error; - } - indexValueReferencePairs++; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformLangStringPreferredNameTypeIec61360( - Aas.ILangStringPreferredNameTypeIec61360 that - ) - { - if (!(that.Text.Length <= 255)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "String shall have a maximum length of 1023 characters."); - } - - foreach (var error in Verification.VerifyBcp47LanguageTag(that.Language)) - { - error.PrependSegment( - new Reporting.NameSegment( - "language")); - yield return error; - } - - foreach ( - var error in Verification.VerifyNonEmptyXmlSerializableString( - that.Text)) - { - error.PrependSegment( - new Reporting.NameSegment( - "text")); - yield return error; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformLangStringShortNameTypeIec61360( - Aas.ILangStringShortNameTypeIec61360 that - ) - { - if (!(that.Text.Length <= 18)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "String shall have a maximum length of 1023 characters."); - } - - foreach (var error in Verification.VerifyBcp47LanguageTag(that.Language)) - { - error.PrependSegment( - new Reporting.NameSegment( - "language")); - yield return error; - } - - foreach ( - var error in Verification.VerifyNonEmptyXmlSerializableString( - that.Text)) - { - error.PrependSegment( - new Reporting.NameSegment( - "text")); - yield return error; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformLangStringDefinitionTypeIec61360( - Aas.ILangStringDefinitionTypeIec61360 that - ) - { - if (!(that.Text.Length <= 1023)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "String shall have a maximum length of 1023 characters."); - } - - foreach (var error in Verification.VerifyBcp47LanguageTag(that.Language)) - { - error.PrependSegment( - new Reporting.NameSegment( - "language")); - yield return error; - } - - foreach ( - var error in Verification.VerifyNonEmptyXmlSerializableString( - that.Text)) - { - error.PrependSegment( - new Reporting.NameSegment( - "text")); - yield return error; - } - } - - [CodeAnalysis.SuppressMessage("ReSharper", "NegativeEqualityExpression")] - public override IEnumerable TransformDataSpecificationIec61360( - Aas.IDataSpecificationIec61360 that - ) - { - if (!( - ( - (that.Value != null) - && (that.ValueList == null) - ) - || ( - (that.Value == null) - && (that.ValueList != null) - && that.ValueList.ValueReferencePairs.Count >= 1 - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASc-3a-010: If value is not empty then value " + - "list shall be empty and vice versa."); - } - - if (!( - !( - (that.DataType == null) - && Aas.Constants.Iec61360DataTypesWithUnit.Contains(that.DataType) - ) - || ( - (that.Unit != null) - || (that.UnitId != null) - ))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASc-3a-009: If data type is a an integer, real " + - "or rational with a measure or currency, unit or unit ID " + - "shall be defined."); - } - - if (!( - !(that.Definition != null) - || (that.Definition.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Definition must be either not set or have at least one item."); - } - - if (!( - !(that.Definition != null) - || Verification.LangStringsHaveUniqueLanguages(that.Definition))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Definition specifies no duplicate languages."); - } - - if (!( - !(that.ShortName != null) - || (that.ShortName.Count >= 1))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Short name must be either not set or have at least one item."); - } - - if (!( - !(that.ShortName != null) - || Verification.LangStringsHaveUniqueLanguages(that.ShortName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Short name specifies no duplicate languages."); - } - - if (!(that.PreferredName.Count >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Preferred name must have at least one item."); - } - - if (!( - Verification.LangStringsHaveUniqueLanguages(that.PreferredName))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Preferred name specifies no duplicate languages."); - } - - if (!( - that.PreferredName.Any( - langString => Verification.IsBcp47ForEnglish(langString.Language)))) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASc-002: preferred name shall be provided at " + - "least in English."); - } - - int indexPreferredName = 0; - foreach (var item in that.PreferredName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexPreferredName)); - error.PrependSegment( - new Reporting.NameSegment( - "preferredName")); - yield return error; - } - indexPreferredName++; - } - - if (that.ShortName != null) - { - int indexShortName = 0; - foreach (var item in that.ShortName) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexShortName)); - error.PrependSegment( - new Reporting.NameSegment( - "shortName")); - yield return error; - } - indexShortName++; - } - } - - if (that.Unit != null) - { - foreach ( - var error in Verification.VerifyNonEmptyXmlSerializableString( - that.Unit)) - { - error.PrependSegment( - new Reporting.NameSegment( - "unit")); - yield return error; - } - } - - if (that.UnitId != null) - { - foreach (var error in Verification.Verify(that.UnitId)) - { - error.PrependSegment( - new Reporting.NameSegment( - "unitId")); - yield return error; - } - } - - if (that.SourceOfDefinition != null) - { - foreach ( - var error in Verification.VerifyNonEmptyXmlSerializableString( - that.SourceOfDefinition)) - { - error.PrependSegment( - new Reporting.NameSegment( - "sourceOfDefinition")); - yield return error; - } - } - - if (that.Symbol != null) - { - foreach ( - var error in Verification.VerifyNonEmptyXmlSerializableString( - that.Symbol)) - { - error.PrependSegment( - new Reporting.NameSegment( - "symbol")); - yield return error; - } - } - - if (that.DataType != null) - { - // We need to help the static analyzer with a null coalescing. - Aas.DataTypeIec61360 value = that.DataType - ?? throw new System.InvalidOperationException(); - foreach (var error in Verification.VerifyDataTypeIec61360(value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "dataType")); - yield return error; - } - } - - if (that.Definition != null) - { - int indexDefinition = 0; - foreach (var item in that.Definition) - { - foreach (var error in Verification.Verify(item)) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDefinition)); - error.PrependSegment( - new Reporting.NameSegment( - "definition")); - yield return error; - } - indexDefinition++; - } - } - - if (that.ValueFormat != null) - { - foreach ( - var error in Verification.VerifyNonEmptyXmlSerializableString( - that.ValueFormat)) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueFormat")); - yield return error; - } - } - - if (that.ValueList != null) - { - foreach (var error in Verification.Verify(that.ValueList)) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueList")); - yield return error; - } - } - - if (that.Value != null) - { - foreach (var error in Verification.VerifyValueTypeIec61360(that.Value)) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - yield return error; - } - } - - if (that.LevelType != null) - { - foreach (var error in Verification.Verify(that.LevelType)) - { - error.PrependSegment( - new Reporting.NameSegment( - "levelType")); - yield return error; - } - } - } - } // private class Transformer - - /// - /// Verify the constraints of recursively. - /// - /// - /// The instance of the meta-model to be verified - /// - public static IEnumerable Verify(Aas.IClass that) - { - foreach (var error in _transformer.Transform(that)) - { - yield return error; - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyNonEmptyXmlSerializableString( - string that) - { - if (!Verification.MatchesXmlSerializableString(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-130: An attribute with data type 'string' " + - "shall consist of these characters only: " + - "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$."); - } - - if (!(that.Length >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must not be empty."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyDateTimeUtc( - string that) - { - if (!Verification.MatchesXsDateTimeUtc(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must match the pattern of xs:dateTime with " + - "the time zone fixed to UTC."); - } - - if (!Verification.IsXsDateTimeUtc(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must represent a valid xs:dateTime with the time " + - "zone fixed to UTC."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyDuration( - string that) - { - if (!Verification.MatchesXsDuration(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must match the pattern of xs:duration."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyBlobType( - byte[] that) - { - // There is no verification specified. - yield break; - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyIdentifier( - string that) - { - if (!Verification.MatchesXmlSerializableString(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-130: An attribute with data type 'string' " + - "shall consist of these characters only: " + - "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$."); - } - - if (!(that.Length >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must not be empty."); - } - - if (!(that.Length <= 2000)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Identifier shall have a maximum length of 2000 characters."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyValueTypeIec61360( - string that) - { - if (!Verification.MatchesXmlSerializableString(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-130: An attribute with data type 'string' " + - "shall consist of these characters only: " + - "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$."); - } - - if (!(that.Length >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must not be empty."); - } - - if (!(that.Length <= 2000)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Value type IEC 61360 shall have a maximum length of 2000 " + - "characters."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyNameType( - string that) - { - if (!Verification.MatchesXmlSerializableString(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-130: An attribute with data type 'string' " + - "shall consist of these characters only: " + - "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$."); - } - - if (!(that.Length >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must not be empty."); - } - - if (!(that.Length <= 128)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Name type shall have a maximum length of 128 characters."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyVersionType( - string that) - { - if (!Verification.MatchesXmlSerializableString(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-130: An attribute with data type 'string' " + - "shall consist of these characters only: " + - "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$."); - } - - if (!(that.Length >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must not be empty."); - } - - if (!Verification.MatchesVersionType(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Version type shall match the version pattern."); - } - - if (!(that.Length <= 4)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Version type shall have a maximum length of 4 characters."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyRevisionType( - string that) - { - if (!Verification.MatchesXmlSerializableString(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-130: An attribute with data type 'string' " + - "shall consist of these characters only: " + - "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$."); - } - - if (!(that.Length >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must not be empty."); - } - - if (!Verification.MatchesRevisionType(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Revision type shall match the revision pattern."); - } - - if (!(that.Length <= 4)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Revision type shall have a maximum length of 4 characters."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyLabelType( - string that) - { - if (!Verification.MatchesXmlSerializableString(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-130: An attribute with data type 'string' " + - "shall consist of these characters only: " + - "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$."); - } - - if (!(that.Length >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must not be empty."); - } - - if (!(that.Length <= 64)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Label type shall have a maximum length of 64 characters."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyMessageTopicType( - string that) - { - if (!Verification.MatchesXmlSerializableString(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-130: An attribute with data type 'string' " + - "shall consist of these characters only: " + - "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$."); - } - - if (!(that.Length >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must not be empty."); - } - - if (!(that.Length <= 255)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Message topic type shall have a maximum length of 255 " + - "characters."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyBcp47LanguageTag( - string that) - { - if (!Verification.MatchesBcp47(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must represent a value language tag conformant to " + - "BCP 47."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyContentType( - string that) - { - if (!Verification.MatchesXmlSerializableString(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-130: An attribute with data type 'string' " + - "shall consist of these characters only: " + - "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$."); - } - - if (!(that.Length >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must not be empty."); - } - - if (!(that.Length <= 100)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Content type shall have a maximum length of 100 characters."); - } - - if (!Verification.MatchesMimeType(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must represent a valid content MIME type " + - "according to RFC 2046."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyPathType( - string that) - { - if (!Verification.MatchesXmlSerializableString(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-130: An attribute with data type 'string' " + - "shall consist of these characters only: " + - "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$."); - } - - if (!(that.Length >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must not be empty."); - } - - if (!(that.Length <= 2000)) - { - yield return new Reporting.Error( - "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."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyQualifierType( - string that) - { - if (!Verification.MatchesXmlSerializableString(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-130: An attribute with data type 'string' " + - "shall consist of these characters only: " + - "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$."); - } - - if (!(that.Length >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must not be empty."); - } - - if (!(that.Length <= 128)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Name type shall have a maximum length of 128 characters."); - } - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyValueDataType( - string that) - { - // There is no verification specified. - yield break; - } - - /// - /// Verify the constraints of . - /// - public static IEnumerable VerifyIdShortType( - string that) - { - if (!Verification.MatchesXmlSerializableString(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Constraint AASd-130: An attribute with data type 'string' " + - "shall consist of these characters only: " + - "^[\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD\\U00010000-\\U0010FFFF]*$."); - } - - if (!(that.Length >= 1)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "The value must not be empty."); - } - - if (!(that.Length <= 128)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "Name type shall have a maximum length of 128 characters."); - } - - if (!Verification.MatchesIdShort(that)) - { - yield return new Reporting.Error( - "Invariant violated:\n" + - "ID-short of Referables shall only feature letters, digits, " + - "underscore (``_``); starting mandatory with a letter. " + - "*I.e.* ``[a-zA-Z][a-zA-Z0-9_]*``."); - } - } - - /// - /// Verify that is a valid enumeration value. - /// - public static IEnumerable VerifyModellingKind( - Aas.ModellingKind that) - { - if (!EnumValueSet.ForModellingKind.Contains( - (int)that)) - { - yield return new Reporting.Error( - $"Invalid ModellingKind: {that}"); - } - } - - /// - /// Verify that is a valid enumeration value. - /// - public static IEnumerable VerifyQualifierKind( - Aas.QualifierKind that) - { - if (!EnumValueSet.ForQualifierKind.Contains( - (int)that)) - { - yield return new Reporting.Error( - $"Invalid QualifierKind: {that}"); - } - } - - /// - /// Verify that is a valid enumeration value. - /// - public static IEnumerable VerifyAssetKind( - Aas.AssetKind that) - { - if (!EnumValueSet.ForAssetKind.Contains( - (int)that)) - { - yield return new Reporting.Error( - $"Invalid AssetKind: {that}"); - } - } - - /// - /// Verify that is a valid enumeration value. - /// - public static IEnumerable VerifyAasSubmodelElements( - Aas.AasSubmodelElements that) - { - if (!EnumValueSet.ForAasSubmodelElements.Contains( - (int)that)) - { - yield return new Reporting.Error( - $"Invalid AasSubmodelElements: {that}"); - } - } - - /// - /// Verify that is a valid enumeration value. - /// - public static IEnumerable VerifyEntityType( - Aas.EntityType that) - { - if (!EnumValueSet.ForEntityType.Contains( - (int)that)) - { - yield return new Reporting.Error( - $"Invalid EntityType: {that}"); - } - } - - /// - /// Verify that is a valid enumeration value. - /// - public static IEnumerable VerifyDirection( - Aas.Direction that) - { - if (!EnumValueSet.ForDirection.Contains( - (int)that)) - { - yield return new Reporting.Error( - $"Invalid Direction: {that}"); - } - } - - /// - /// Verify that is a valid enumeration value. - /// - public static IEnumerable VerifyStateOfEvent( - Aas.StateOfEvent that) - { - if (!EnumValueSet.ForStateOfEvent.Contains( - (int)that)) - { - yield return new Reporting.Error( - $"Invalid StateOfEvent: {that}"); - } - } - - /// - /// Verify that is a valid enumeration value. - /// - public static IEnumerable VerifyReferenceTypes( - Aas.ReferenceTypes that) - { - if (!EnumValueSet.ForReferenceTypes.Contains( - (int)that)) - { - yield return new Reporting.Error( - $"Invalid ReferenceTypes: {that}"); - } - } - - /// - /// Verify that is a valid enumeration value. - /// - public static IEnumerable VerifyKeyTypes( - Aas.KeyTypes that) - { - if (!EnumValueSet.ForKeyTypes.Contains( - (int)that)) - { - yield return new Reporting.Error( - $"Invalid KeyTypes: {that}"); - } - } - - /// - /// Verify that is a valid enumeration value. - /// - public static IEnumerable VerifyDataTypeDefXsd( - Aas.DataTypeDefXsd that) - { - if (!EnumValueSet.ForDataTypeDefXsd.Contains( - (int)that)) - { - yield return new Reporting.Error( - $"Invalid DataTypeDefXsd: {that}"); - } - } - - /// - /// Verify that is a valid enumeration value. - /// - public static IEnumerable VerifyDataTypeIec61360( - Aas.DataTypeIec61360 that) - { - if (!EnumValueSet.ForDataTypeIec61360.Contains( - (int)that)) - { - yield return new Reporting.Error( - $"Invalid DataTypeIec61360: {that}"); - } - } - } // public static class Verification -} // namespace AasCore.Aas3_0 - -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ diff --git a/src/AasCore.Aas3_0/visitation.cs b/src/AasCore.Aas3_0/visitation.cs deleted file mode 100644 index 4c1117d9c..000000000 --- a/src/AasCore.Aas3_0/visitation.cs +++ /dev/null @@ -1,1705 +0,0 @@ -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ - -namespace AasCore.Aas3_0 -{ - public static class Visitation - { - /// - /// Define the interface for a visitor which visits the instances of the model. - /// - /// - /// When you use the visitor, please always call the main dispatching method - /// . You should most probably never call the Visit* - /// methods directly. They are only made public so that model classes can access them. - /// - public interface IVisitor - { - public void Visit(IClass that); - public void VisitExtension( - IExtension that - ); - public void VisitAdministrativeInformation( - IAdministrativeInformation that - ); - public void VisitQualifier( - IQualifier that - ); - public void VisitAssetAdministrationShell( - IAssetAdministrationShell that - ); - public void VisitAssetInformation( - IAssetInformation that - ); - public void VisitResource( - IResource that - ); - public void VisitSpecificAssetId( - ISpecificAssetId that - ); - public void VisitSubmodel( - ISubmodel that - ); - public void VisitRelationshipElement( - IRelationshipElement that - ); - public void VisitSubmodelElementList( - ISubmodelElementList that - ); - public void VisitSubmodelElementCollection( - ISubmodelElementCollection that - ); - public void VisitProperty( - IProperty that - ); - public void VisitMultiLanguageProperty( - IMultiLanguageProperty that - ); - public void VisitRange( - IRange that - ); - public void VisitReferenceElement( - IReferenceElement that - ); - public void VisitBlob( - IBlob that - ); - public void VisitFile( - IFile that - ); - public void VisitAnnotatedRelationshipElement( - IAnnotatedRelationshipElement that - ); - public void VisitEntity( - IEntity that - ); - public void VisitEventPayload( - IEventPayload that - ); - public void VisitBasicEventElement( - IBasicEventElement that - ); - public void VisitOperation( - IOperation that - ); - public void VisitOperationVariable( - IOperationVariable that - ); - public void VisitCapability( - ICapability that - ); - public void VisitConceptDescription( - IConceptDescription that - ); - public void VisitReference( - IReference that - ); - public void VisitKey( - IKey that - ); - public void VisitLangStringNameType( - ILangStringNameType that - ); - public void VisitLangStringTextType( - ILangStringTextType that - ); - public void VisitEnvironment( - IEnvironment that - ); - public void VisitEmbeddedDataSpecification( - IEmbeddedDataSpecification that - ); - public void VisitLevelType( - ILevelType that - ); - public void VisitValueReferencePair( - IValueReferencePair that - ); - public void VisitValueList( - IValueList that - ); - public void VisitLangStringPreferredNameTypeIec61360( - ILangStringPreferredNameTypeIec61360 that - ); - public void VisitLangStringShortNameTypeIec61360( - ILangStringShortNameTypeIec61360 that - ); - public void VisitLangStringDefinitionTypeIec61360( - ILangStringDefinitionTypeIec61360 that - ); - public void VisitDataSpecificationIec61360( - IDataSpecificationIec61360 that - ); - } // public interface IVisitor - - /// - /// Just descend through the instances without any action. - /// - /// - /// This class is meaningless for itself. However, it is a good base if you - /// want to descend through instances and apply actions only on a subset of - /// classes. - /// - public class VisitorThrough : IVisitor - { - public virtual void Visit(IClass that) - { - that.Accept(this); - } - - public virtual void VisitExtension( - IExtension that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitAdministrativeInformation( - IAdministrativeInformation that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitQualifier( - IQualifier that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitAssetAdministrationShell( - IAssetAdministrationShell that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitAssetInformation( - IAssetInformation that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitResource( - IResource that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitSpecificAssetId( - ISpecificAssetId that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitSubmodel( - ISubmodel that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitRelationshipElement( - IRelationshipElement that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitSubmodelElementList( - ISubmodelElementList that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitSubmodelElementCollection( - ISubmodelElementCollection that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitProperty( - IProperty that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitMultiLanguageProperty( - IMultiLanguageProperty that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitRange( - IRange that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitReferenceElement( - IReferenceElement that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitBlob( - IBlob that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitFile( - IFile that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitAnnotatedRelationshipElement( - IAnnotatedRelationshipElement that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitEntity( - IEntity that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitEventPayload( - IEventPayload that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitBasicEventElement( - IBasicEventElement that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitOperation( - IOperation that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitOperationVariable( - IOperationVariable that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitCapability( - ICapability that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitConceptDescription( - IConceptDescription that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitReference( - IReference that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitKey( - IKey that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitLangStringNameType( - ILangStringNameType that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitLangStringTextType( - ILangStringTextType that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitEnvironment( - IEnvironment that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitEmbeddedDataSpecification( - IEmbeddedDataSpecification that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitLevelType( - ILevelType that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitValueReferencePair( - IValueReferencePair that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitValueList( - IValueList that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitLangStringPreferredNameTypeIec61360( - ILangStringPreferredNameTypeIec61360 that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitLangStringShortNameTypeIec61360( - ILangStringShortNameTypeIec61360 that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitLangStringDefinitionTypeIec61360( - ILangStringDefinitionTypeIec61360 that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - - public virtual void VisitDataSpecificationIec61360( - IDataSpecificationIec61360 that - ) - { - // Just descend through, do nothing with that - foreach (var something in that.DescendOnce()) - { - Visit(something); - } - } - } // public class VisitorThrough - - /// - /// Perform double-dispatch to visit the concrete instances. - /// - public abstract class AbstractVisitor : IVisitor - { - public virtual void Visit(IClass that) - { - that.Accept(this); - } - public abstract void VisitExtension( - IExtension that - ); - public abstract void VisitAdministrativeInformation( - IAdministrativeInformation that - ); - public abstract void VisitQualifier( - IQualifier that - ); - public abstract void VisitAssetAdministrationShell( - IAssetAdministrationShell that - ); - public abstract void VisitAssetInformation( - IAssetInformation that - ); - public abstract void VisitResource( - IResource that - ); - public abstract void VisitSpecificAssetId( - ISpecificAssetId that - ); - public abstract void VisitSubmodel( - ISubmodel that - ); - public abstract void VisitRelationshipElement( - IRelationshipElement that - ); - public abstract void VisitSubmodelElementList( - ISubmodelElementList that - ); - public abstract void VisitSubmodelElementCollection( - ISubmodelElementCollection that - ); - public abstract void VisitProperty( - IProperty that - ); - public abstract void VisitMultiLanguageProperty( - IMultiLanguageProperty that - ); - public abstract void VisitRange( - IRange that - ); - public abstract void VisitReferenceElement( - IReferenceElement that - ); - public abstract void VisitBlob( - IBlob that - ); - public abstract void VisitFile( - IFile that - ); - public abstract void VisitAnnotatedRelationshipElement( - IAnnotatedRelationshipElement that - ); - public abstract void VisitEntity( - IEntity that - ); - public abstract void VisitEventPayload( - IEventPayload that - ); - public abstract void VisitBasicEventElement( - IBasicEventElement that - ); - public abstract void VisitOperation( - IOperation that - ); - public abstract void VisitOperationVariable( - IOperationVariable that - ); - public abstract void VisitCapability( - ICapability that - ); - public abstract void VisitConceptDescription( - IConceptDescription that - ); - public abstract void VisitReference( - IReference that - ); - public abstract void VisitKey( - IKey that - ); - public abstract void VisitLangStringNameType( - ILangStringNameType that - ); - public abstract void VisitLangStringTextType( - ILangStringTextType that - ); - public abstract void VisitEnvironment( - IEnvironment that - ); - public abstract void VisitEmbeddedDataSpecification( - IEmbeddedDataSpecification that - ); - public abstract void VisitLevelType( - ILevelType that - ); - public abstract void VisitValueReferencePair( - IValueReferencePair that - ); - public abstract void VisitValueList( - IValueList that - ); - public abstract void VisitLangStringPreferredNameTypeIec61360( - ILangStringPreferredNameTypeIec61360 that - ); - public abstract void VisitLangStringShortNameTypeIec61360( - ILangStringShortNameTypeIec61360 that - ); - public abstract void VisitLangStringDefinitionTypeIec61360( - ILangStringDefinitionTypeIec61360 that - ); - public abstract void VisitDataSpecificationIec61360( - IDataSpecificationIec61360 that - ); - } // public abstract class AbstractVisitor - - /// - /// Define the interface for a visitor which visits the instances of the model. - /// - /// - /// When you use the visitor, please always call the main dispatching method - /// . You should most probably never call the Visit* - /// methods directly. They are only made public so that model classes can access them. - /// - /// Context type - public interface IVisitorWithContext - { - public void Visit(IClass that, TContext context); - public void VisitExtension( - IExtension that, - TContext context - ); - public void VisitAdministrativeInformation( - IAdministrativeInformation that, - TContext context - ); - public void VisitQualifier( - IQualifier that, - TContext context - ); - public void VisitAssetAdministrationShell( - IAssetAdministrationShell that, - TContext context - ); - public void VisitAssetInformation( - IAssetInformation that, - TContext context - ); - public void VisitResource( - IResource that, - TContext context - ); - public void VisitSpecificAssetId( - ISpecificAssetId that, - TContext context - ); - public void VisitSubmodel( - ISubmodel that, - TContext context - ); - public void VisitRelationshipElement( - IRelationshipElement that, - TContext context - ); - public void VisitSubmodelElementList( - ISubmodelElementList that, - TContext context - ); - public void VisitSubmodelElementCollection( - ISubmodelElementCollection that, - TContext context - ); - public void VisitProperty( - IProperty that, - TContext context - ); - public void VisitMultiLanguageProperty( - IMultiLanguageProperty that, - TContext context - ); - public void VisitRange( - IRange that, - TContext context - ); - public void VisitReferenceElement( - IReferenceElement that, - TContext context - ); - public void VisitBlob( - IBlob that, - TContext context - ); - public void VisitFile( - IFile that, - TContext context - ); - public void VisitAnnotatedRelationshipElement( - IAnnotatedRelationshipElement that, - TContext context - ); - public void VisitEntity( - IEntity that, - TContext context - ); - public void VisitEventPayload( - IEventPayload that, - TContext context - ); - public void VisitBasicEventElement( - IBasicEventElement that, - TContext context - ); - public void VisitOperation( - IOperation that, - TContext context - ); - public void VisitOperationVariable( - IOperationVariable that, - TContext context - ); - public void VisitCapability( - ICapability that, - TContext context - ); - public void VisitConceptDescription( - IConceptDescription that, - TContext context - ); - public void VisitReference( - IReference that, - TContext context - ); - public void VisitKey( - IKey that, - TContext context - ); - public void VisitLangStringNameType( - ILangStringNameType that, - TContext context - ); - public void VisitLangStringTextType( - ILangStringTextType that, - TContext context - ); - public void VisitEnvironment( - IEnvironment that, - TContext context - ); - public void VisitEmbeddedDataSpecification( - IEmbeddedDataSpecification that, - TContext context - ); - public void VisitLevelType( - ILevelType that, - TContext context - ); - public void VisitValueReferencePair( - IValueReferencePair that, - TContext context - ); - public void VisitValueList( - IValueList that, - TContext context - ); - public void VisitLangStringPreferredNameTypeIec61360( - ILangStringPreferredNameTypeIec61360 that, - TContext context - ); - public void VisitLangStringShortNameTypeIec61360( - ILangStringShortNameTypeIec61360 that, - TContext context - ); - public void VisitLangStringDefinitionTypeIec61360( - ILangStringDefinitionTypeIec61360 that, - TContext context - ); - public void VisitDataSpecificationIec61360( - IDataSpecificationIec61360 that, - TContext context - ); - } // public interface IVisitorWithContext - - /// - /// Perform double-dispatch to visit the concrete instances - /// with context. - /// - /// Context type - public abstract class AbstractVisitorWithContext - : IVisitorWithContext - { - public void Visit(IClass that, TContext context) - { - that.Accept(this, context); - } - public abstract void VisitExtension( - IExtension that, - TContext context - ); - public abstract void VisitAdministrativeInformation( - IAdministrativeInformation that, - TContext context - ); - public abstract void VisitQualifier( - IQualifier that, - TContext context - ); - public abstract void VisitAssetAdministrationShell( - IAssetAdministrationShell that, - TContext context - ); - public abstract void VisitAssetInformation( - IAssetInformation that, - TContext context - ); - public abstract void VisitResource( - IResource that, - TContext context - ); - public abstract void VisitSpecificAssetId( - ISpecificAssetId that, - TContext context - ); - public abstract void VisitSubmodel( - ISubmodel that, - TContext context - ); - public abstract void VisitRelationshipElement( - IRelationshipElement that, - TContext context - ); - public abstract void VisitSubmodelElementList( - ISubmodelElementList that, - TContext context - ); - public abstract void VisitSubmodelElementCollection( - ISubmodelElementCollection that, - TContext context - ); - public abstract void VisitProperty( - IProperty that, - TContext context - ); - public abstract void VisitMultiLanguageProperty( - IMultiLanguageProperty that, - TContext context - ); - public abstract void VisitRange( - IRange that, - TContext context - ); - public abstract void VisitReferenceElement( - IReferenceElement that, - TContext context - ); - public abstract void VisitBlob( - IBlob that, - TContext context - ); - public abstract void VisitFile( - IFile that, - TContext context - ); - public abstract void VisitAnnotatedRelationshipElement( - IAnnotatedRelationshipElement that, - TContext context - ); - public abstract void VisitEntity( - IEntity that, - TContext context - ); - public abstract void VisitEventPayload( - IEventPayload that, - TContext context - ); - public abstract void VisitBasicEventElement( - IBasicEventElement that, - TContext context - ); - public abstract void VisitOperation( - IOperation that, - TContext context - ); - public abstract void VisitOperationVariable( - IOperationVariable that, - TContext context - ); - public abstract void VisitCapability( - ICapability that, - TContext context - ); - public abstract void VisitConceptDescription( - IConceptDescription that, - TContext context - ); - public abstract void VisitReference( - IReference that, - TContext context - ); - public abstract void VisitKey( - IKey that, - TContext context - ); - public abstract void VisitLangStringNameType( - ILangStringNameType that, - TContext context - ); - public abstract void VisitLangStringTextType( - ILangStringTextType that, - TContext context - ); - public abstract void VisitEnvironment( - IEnvironment that, - TContext context - ); - public abstract void VisitEmbeddedDataSpecification( - IEmbeddedDataSpecification that, - TContext context - ); - public abstract void VisitLevelType( - ILevelType that, - TContext context - ); - public abstract void VisitValueReferencePair( - IValueReferencePair that, - TContext context - ); - public abstract void VisitValueList( - IValueList that, - TContext context - ); - public abstract void VisitLangStringPreferredNameTypeIec61360( - ILangStringPreferredNameTypeIec61360 that, - TContext context - ); - public abstract void VisitLangStringShortNameTypeIec61360( - ILangStringShortNameTypeIec61360 that, - TContext context - ); - public abstract void VisitLangStringDefinitionTypeIec61360( - ILangStringDefinitionTypeIec61360 that, - TContext context - ); - public abstract void VisitDataSpecificationIec61360( - IDataSpecificationIec61360 that, - TContext context - ); - } // public abstract class AbstractVisitorWithContext - - /// - /// Define the interface for a transformer which transforms recursively - /// the instances into something else. - /// - /// - /// When you use the transformer, please always call the main dispatching method - /// . You should most probably never call the Transform* - /// methods directly. They are only made public so that model classes can access them. - /// - /// The type of the transformation result - public interface ITransformer - { - public T Transform(IClass that); - public T TransformExtension( - IExtension that - ); - public T TransformAdministrativeInformation( - IAdministrativeInformation that - ); - public T TransformQualifier( - IQualifier that - ); - public T TransformAssetAdministrationShell( - IAssetAdministrationShell that - ); - public T TransformAssetInformation( - IAssetInformation that - ); - public T TransformResource( - IResource that - ); - public T TransformSpecificAssetId( - ISpecificAssetId that - ); - public T TransformSubmodel( - ISubmodel that - ); - public T TransformRelationshipElement( - IRelationshipElement that - ); - public T TransformSubmodelElementList( - ISubmodelElementList that - ); - public T TransformSubmodelElementCollection( - ISubmodelElementCollection that - ); - public T TransformProperty( - IProperty that - ); - public T TransformMultiLanguageProperty( - IMultiLanguageProperty that - ); - public T TransformRange( - IRange that - ); - public T TransformReferenceElement( - IReferenceElement that - ); - public T TransformBlob( - IBlob that - ); - public T TransformFile( - IFile that - ); - public T TransformAnnotatedRelationshipElement( - IAnnotatedRelationshipElement that - ); - public T TransformEntity( - IEntity that - ); - public T TransformEventPayload( - IEventPayload that - ); - public T TransformBasicEventElement( - IBasicEventElement that - ); - public T TransformOperation( - IOperation that - ); - public T TransformOperationVariable( - IOperationVariable that - ); - public T TransformCapability( - ICapability that - ); - public T TransformConceptDescription( - IConceptDescription that - ); - public T TransformReference( - IReference that - ); - public T TransformKey( - IKey that - ); - public T TransformLangStringNameType( - ILangStringNameType that - ); - public T TransformLangStringTextType( - ILangStringTextType that - ); - public T TransformEnvironment( - IEnvironment that - ); - public T TransformEmbeddedDataSpecification( - IEmbeddedDataSpecification that - ); - public T TransformLevelType( - ILevelType that - ); - public T TransformValueReferencePair( - IValueReferencePair that - ); - public T TransformValueList( - IValueList that - ); - public T TransformLangStringPreferredNameTypeIec61360( - ILangStringPreferredNameTypeIec61360 that - ); - public T TransformLangStringShortNameTypeIec61360( - ILangStringShortNameTypeIec61360 that - ); - public T TransformLangStringDefinitionTypeIec61360( - ILangStringDefinitionTypeIec61360 that - ); - public T TransformDataSpecificationIec61360( - IDataSpecificationIec61360 that - ); - } // public interface ITransformer - - /// - /// Perform double-dispatch to transform recursively - /// the instances into something else. - /// - /// The type of the transformation result - public abstract class AbstractTransformer : ITransformer - { - public T Transform(IClass that) - { - return that.Transform(this); - } - - public abstract T TransformExtension( - IExtension that - ); - - public abstract T TransformAdministrativeInformation( - IAdministrativeInformation that - ); - - public abstract T TransformQualifier( - IQualifier that - ); - - public abstract T TransformAssetAdministrationShell( - IAssetAdministrationShell that - ); - - public abstract T TransformAssetInformation( - IAssetInformation that - ); - - public abstract T TransformResource( - IResource that - ); - - public abstract T TransformSpecificAssetId( - ISpecificAssetId that - ); - - public abstract T TransformSubmodel( - ISubmodel that - ); - - public abstract T TransformRelationshipElement( - IRelationshipElement that - ); - - public abstract T TransformSubmodelElementList( - ISubmodelElementList that - ); - - public abstract T TransformSubmodelElementCollection( - ISubmodelElementCollection that - ); - - public abstract T TransformProperty( - IProperty that - ); - - public abstract T TransformMultiLanguageProperty( - IMultiLanguageProperty that - ); - - public abstract T TransformRange( - IRange that - ); - - public abstract T TransformReferenceElement( - IReferenceElement that - ); - - public abstract T TransformBlob( - IBlob that - ); - - public abstract T TransformFile( - IFile that - ); - - public abstract T TransformAnnotatedRelationshipElement( - IAnnotatedRelationshipElement that - ); - - public abstract T TransformEntity( - IEntity that - ); - - public abstract T TransformEventPayload( - IEventPayload that - ); - - public abstract T TransformBasicEventElement( - IBasicEventElement that - ); - - public abstract T TransformOperation( - IOperation that - ); - - public abstract T TransformOperationVariable( - IOperationVariable that - ); - - public abstract T TransformCapability( - ICapability that - ); - - public abstract T TransformConceptDescription( - IConceptDescription that - ); - - public abstract T TransformReference( - IReference that - ); - - public abstract T TransformKey( - IKey that - ); - - public abstract T TransformLangStringNameType( - ILangStringNameType that - ); - - public abstract T TransformLangStringTextType( - ILangStringTextType that - ); - - public abstract T TransformEnvironment( - IEnvironment that - ); - - public abstract T TransformEmbeddedDataSpecification( - IEmbeddedDataSpecification that - ); - - public abstract T TransformLevelType( - ILevelType that - ); - - public abstract T TransformValueReferencePair( - IValueReferencePair that - ); - - public abstract T TransformValueList( - IValueList that - ); - - public abstract T TransformLangStringPreferredNameTypeIec61360( - ILangStringPreferredNameTypeIec61360 that - ); - - public abstract T TransformLangStringShortNameTypeIec61360( - ILangStringShortNameTypeIec61360 that - ); - - public abstract T TransformLangStringDefinitionTypeIec61360( - ILangStringDefinitionTypeIec61360 that - ); - - public abstract T TransformDataSpecificationIec61360( - IDataSpecificationIec61360 that - ); - } // public abstract class AbstractTransformer - - /// - /// Define the interface for a transformer which recursively transforms - /// the instances into something else while the context is passed along. - /// - /// - /// When you use the transformer, please always call the main dispatching method - /// . You should most probably never call the Transform* - /// methods directly. They are only made public so that model classes can access them. - /// - /// Type of the transformation context - /// The type of the transformation result - public interface ITransformerWithContext - { - public T Transform(IClass that, TContext context); - public T TransformExtension( - IExtension that, - TContext context - ); - public T TransformAdministrativeInformation( - IAdministrativeInformation that, - TContext context - ); - public T TransformQualifier( - IQualifier that, - TContext context - ); - public T TransformAssetAdministrationShell( - IAssetAdministrationShell that, - TContext context - ); - public T TransformAssetInformation( - IAssetInformation that, - TContext context - ); - public T TransformResource( - IResource that, - TContext context - ); - public T TransformSpecificAssetId( - ISpecificAssetId that, - TContext context - ); - public T TransformSubmodel( - ISubmodel that, - TContext context - ); - public T TransformRelationshipElement( - IRelationshipElement that, - TContext context - ); - public T TransformSubmodelElementList( - ISubmodelElementList that, - TContext context - ); - public T TransformSubmodelElementCollection( - ISubmodelElementCollection that, - TContext context - ); - public T TransformProperty( - IProperty that, - TContext context - ); - public T TransformMultiLanguageProperty( - IMultiLanguageProperty that, - TContext context - ); - public T TransformRange( - IRange that, - TContext context - ); - public T TransformReferenceElement( - IReferenceElement that, - TContext context - ); - public T TransformBlob( - IBlob that, - TContext context - ); - public T TransformFile( - IFile that, - TContext context - ); - public T TransformAnnotatedRelationshipElement( - IAnnotatedRelationshipElement that, - TContext context - ); - public T TransformEntity( - IEntity that, - TContext context - ); - public T TransformEventPayload( - IEventPayload that, - TContext context - ); - public T TransformBasicEventElement( - IBasicEventElement that, - TContext context - ); - public T TransformOperation( - IOperation that, - TContext context - ); - public T TransformOperationVariable( - IOperationVariable that, - TContext context - ); - public T TransformCapability( - ICapability that, - TContext context - ); - public T TransformConceptDescription( - IConceptDescription that, - TContext context - ); - public T TransformReference( - IReference that, - TContext context - ); - public T TransformKey( - IKey that, - TContext context - ); - public T TransformLangStringNameType( - ILangStringNameType that, - TContext context - ); - public T TransformLangStringTextType( - ILangStringTextType that, - TContext context - ); - public T TransformEnvironment( - IEnvironment that, - TContext context - ); - public T TransformEmbeddedDataSpecification( - IEmbeddedDataSpecification that, - TContext context - ); - public T TransformLevelType( - ILevelType that, - TContext context - ); - public T TransformValueReferencePair( - IValueReferencePair that, - TContext context - ); - public T TransformValueList( - IValueList that, - TContext context - ); - public T TransformLangStringPreferredNameTypeIec61360( - ILangStringPreferredNameTypeIec61360 that, - TContext context - ); - public T TransformLangStringShortNameTypeIec61360( - ILangStringShortNameTypeIec61360 that, - TContext context - ); - public T TransformLangStringDefinitionTypeIec61360( - ILangStringDefinitionTypeIec61360 that, - TContext context - ); - public T TransformDataSpecificationIec61360( - IDataSpecificationIec61360 that, - TContext context - ); - } // public interface ITransformerWithContext - - /// - /// Perform double-dispatch to transform recursively - /// the instances into something else. - /// - /// - /// When you use the transformer, please always call the main dispatching method - /// . You should most probably never call the Transform* - /// methods directly. They are only made public so that model classes can access them. - /// - /// The type of the transformation context - /// The type of the transformation result - public abstract class AbstractTransformerWithContext - : ITransformerWithContext - { - public T Transform(IClass that, TContext context) - { - return that.Transform(this, context); - } - - public abstract T TransformExtension( - IExtension that, - TContext context - ); - - public abstract T TransformAdministrativeInformation( - IAdministrativeInformation that, - TContext context - ); - - public abstract T TransformQualifier( - IQualifier that, - TContext context - ); - - public abstract T TransformAssetAdministrationShell( - IAssetAdministrationShell that, - TContext context - ); - - public abstract T TransformAssetInformation( - IAssetInformation that, - TContext context - ); - - public abstract T TransformResource( - IResource that, - TContext context - ); - - public abstract T TransformSpecificAssetId( - ISpecificAssetId that, - TContext context - ); - - public abstract T TransformSubmodel( - ISubmodel that, - TContext context - ); - - public abstract T TransformRelationshipElement( - IRelationshipElement that, - TContext context - ); - - public abstract T TransformSubmodelElementList( - ISubmodelElementList that, - TContext context - ); - - public abstract T TransformSubmodelElementCollection( - ISubmodelElementCollection that, - TContext context - ); - - public abstract T TransformProperty( - IProperty that, - TContext context - ); - - public abstract T TransformMultiLanguageProperty( - IMultiLanguageProperty that, - TContext context - ); - - public abstract T TransformRange( - IRange that, - TContext context - ); - - public abstract T TransformReferenceElement( - IReferenceElement that, - TContext context - ); - - public abstract T TransformBlob( - IBlob that, - TContext context - ); - - public abstract T TransformFile( - IFile that, - TContext context - ); - - public abstract T TransformAnnotatedRelationshipElement( - IAnnotatedRelationshipElement that, - TContext context - ); - - public abstract T TransformEntity( - IEntity that, - TContext context - ); - - public abstract T TransformEventPayload( - IEventPayload that, - TContext context - ); - - public abstract T TransformBasicEventElement( - IBasicEventElement that, - TContext context - ); - - public abstract T TransformOperation( - IOperation that, - TContext context - ); - - public abstract T TransformOperationVariable( - IOperationVariable that, - TContext context - ); - - public abstract T TransformCapability( - ICapability that, - TContext context - ); - - public abstract T TransformConceptDescription( - IConceptDescription that, - TContext context - ); - - public abstract T TransformReference( - IReference that, - TContext context - ); - - public abstract T TransformKey( - IKey that, - TContext context - ); - - public abstract T TransformLangStringNameType( - ILangStringNameType that, - TContext context - ); - - public abstract T TransformLangStringTextType( - ILangStringTextType that, - TContext context - ); - - public abstract T TransformEnvironment( - IEnvironment that, - TContext context - ); - - public abstract T TransformEmbeddedDataSpecification( - IEmbeddedDataSpecification that, - TContext context - ); - - public abstract T TransformLevelType( - ILevelType that, - TContext context - ); - - public abstract T TransformValueReferencePair( - IValueReferencePair that, - TContext context - ); - - public abstract T TransformValueList( - IValueList that, - TContext context - ); - - public abstract T TransformLangStringPreferredNameTypeIec61360( - ILangStringPreferredNameTypeIec61360 that, - TContext context - ); - - public abstract T TransformLangStringShortNameTypeIec61360( - ILangStringShortNameTypeIec61360 that, - TContext context - ); - - public abstract T TransformLangStringDefinitionTypeIec61360( - ILangStringDefinitionTypeIec61360 that, - TContext context - ); - - public abstract T TransformDataSpecificationIec61360( - IDataSpecificationIec61360 that, - TContext context - ); - } // public abstract class AbstractTransformerWithContext - } // public static class Visitation -} // namespace AasCore.Aas3_0 - -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ diff --git a/src/AasCore.Aas3_0/xmlization.cs b/src/AasCore.Aas3_0/xmlization.cs deleted file mode 100644 index 7c34fa04c..000000000 --- a/src/AasCore.Aas3_0/xmlization.cs +++ /dev/null @@ -1,25391 +0,0 @@ -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ - -using System.Collections.Generic; // can't alias -using Aas = AasCore.Aas3_0; // renamed -using CodeAnalysis = System.Diagnostics.CodeAnalysis; -using Xml = System.Xml; - -namespace AasCore.Aas3_0 -{ - /// - /// Provide de/serialization of meta-model classes to/from XML. - /// - public static class Xmlization - { - /// The XML namespace of the meta-model - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static readonly string NS = ( - "https://admin-shell.io/aas/3/0"); - - /// - /// Implement the deserialization of meta-model classes from XML. - /// - /// - /// The implementation propagates an instead of - /// relying on exceptions. Under the assumption that incorrect data is much less - /// frequent than correct data, this makes the deserialization more - /// efficient. - /// - /// However, we do not want to force the client to deal with - /// the class as this is not intuitive. - /// Therefore we distinguish the implementation, realized in - /// , and the facade given in - /// class. - /// - internal static class DeserializeImplementation - { - internal static void SkipNoneWhitespaceAndComments( - Xml.XmlReader reader) - { - while ( - !reader.EOF - && ( - reader.NodeType == Xml.XmlNodeType.None - || reader.NodeType == Xml.XmlNodeType.Whitespace - || reader.NodeType == Xml.XmlNodeType.Comment)) - { - reader.Read(); - } - } - - /// - /// Read the whole content of an element into memory. - /// - private static byte[] ReadWholeContentAsBase64( - Xml.XmlReader reader) - { - // The capacity of 1024 bytes is an arbitrary, - // but plausible default capacity. - byte[] buffer = new byte[1024]; - using System.IO.MemoryStream stream = ( - new System.IO.MemoryStream(1024)); - int readBytes; - while ((readBytes = reader.ReadContentAsBase64(buffer, 0, 1024)) > 0) - { - stream.Write(buffer, 0, readBytes); - } - return stream.ToArray(); - } - - /// - /// Check the namespace and extract the element's name. - /// - private static string TryElementName( - Xml.XmlReader reader, - out Reporting.Error? error - ) - { - // Pre-condition - if (reader.NodeType != Xml.XmlNodeType.Element - && reader.NodeType != Xml.XmlNodeType.EndElement) - { - throw new System.InvalidOperationException( - "Expected to be at a start or an end element " + - $"in {nameof(TryElementName)}, " + - $"but got: {reader.NodeType}"); - } - - error = null; - if (reader.NamespaceURI != NS) - { - error = new Reporting.Error( - $"Expected an element within a namespace {NS}, " + - $"but got: {reader.NamespaceURI}"); - return ""; - } - - return reader.LocalName; - } - - /// - /// Deserialize an instance of IHasSemantics from an XML element. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal static Aas.IHasSemantics? IHasSemanticsFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element, but reached end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - switch (elementName) - { - case "relationshipElement": - return RelationshipElementFromElement( - reader, out error); - case "annotatedRelationshipElement": - return AnnotatedRelationshipElementFromElement( - reader, out error); - case "basicEventElement": - return BasicEventElementFromElement( - reader, out error); - case "blob": - return BlobFromElement( - reader, out error); - case "capability": - return CapabilityFromElement( - reader, out error); - case "entity": - return EntityFromElement( - reader, out error); - case "extension": - return ExtensionFromElement( - reader, out error); - case "file": - return FileFromElement( - reader, out error); - case "multiLanguageProperty": - return MultiLanguagePropertyFromElement( - reader, out error); - case "operation": - return OperationFromElement( - reader, out error); - case "property": - return PropertyFromElement( - reader, out error); - case "qualifier": - return QualifierFromElement( - reader, out error); - case "range": - return RangeFromElement( - reader, out error); - case "referenceElement": - return ReferenceElementFromElement( - reader, out error); - case "specificAssetId": - return SpecificAssetIdFromElement( - reader, out error); - case "submodel": - return SubmodelFromElement( - reader, out error); - case "submodelElementCollection": - return SubmodelElementCollectionFromElement( - reader, out error); - case "submodelElementList": - return SubmodelElementListFromElement( - reader, out error); - default: - error = new Reporting.Error( - $"Unexpected element with the name {elementName}"); - return null; - } - } // internal static Aas.IHasSemantics? IHasSemanticsFromElement - - /// - /// Deserialize an instance of class Extension from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.Extension? ExtensionFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - string? theName = null; - DataTypeDefXsd? theValueType = null; - string? theValue = null; - List? theRefersTo = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class Extension, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "name": - { - if (isEmptyProperty) - { - theName = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Name of an instance of class Extension, " + - "but reached the end-of-file"); - return null; - } - - try - { - theName = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Name of an instance of class Extension " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "name")); - return null; - } - - throw; - } - } - break; - } - case "valueType": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property ValueType of an instance of class Extension " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property ValueType of an instance of class Extension, " + - "but reached the end-of-file"); - return null; - } - - string textValueType; - try - { - textValueType = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property ValueType of an instance of class Extension " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - - theValueType = Stringification.DataTypeDefXsdFromString( - textValueType); - - if (theValueType == null) - { - error = new Reporting.Error( - "The property ValueType of an instance of class Extension " + - "could not be de-serialized from an unexpected enumeration literal: " + - textValueType); - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - break; - } - case "value": - { - if (isEmptyProperty) - { - theValue = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Value of an instance of class Extension, " + - "but reached the end-of-file"); - return null; - } - - try - { - theValue = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Value of an instance of class Extension " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - - throw; - } - } - break; - } - case "refersTo": - { - theRefersTo = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexRefersTo = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexRefersTo)); - error.PrependSegment( - new Reporting.NameSegment( - "refersTo")); - return null; - } - - theRefersTo.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexRefersTo++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class Extension, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Extension " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Extension " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Extension " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theName == null) - { - error = new Reporting.Error( - "The required property Name has not been given " + - "in the XML representation of an instance of class Extension"); - return null; - } - - return new Aas.Extension( - theName - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theSemanticId, - theSupplementalSemanticIds, - theValueType, - theValue, - theRefersTo); - } // internal static Aas.Extension? ExtensionFromSequence - - /// - /// Deserialize an instance of class Extension from an XML element. - /// - internal static Aas.Extension? ExtensionFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Extension, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Extension, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "extension") - { - error = new Reporting.Error( - "Expected an element representing an instance of class Extension " + - $"with element name extension, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.Extension? result = ( - ExtensionFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Extension, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Extension, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.Extension? ExtensionFromElement - - /// - /// Deserialize an instance of IHasExtensions from an XML element. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal static Aas.IHasExtensions? IHasExtensionsFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element, but reached end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - switch (elementName) - { - case "relationshipElement": - return RelationshipElementFromElement( - reader, out error); - case "annotatedRelationshipElement": - return AnnotatedRelationshipElementFromElement( - reader, out error); - case "assetAdministrationShell": - return AssetAdministrationShellFromElement( - reader, out error); - case "basicEventElement": - return BasicEventElementFromElement( - reader, out error); - case "blob": - return BlobFromElement( - reader, out error); - case "capability": - return CapabilityFromElement( - reader, out error); - case "conceptDescription": - return ConceptDescriptionFromElement( - reader, out error); - case "entity": - return EntityFromElement( - reader, out error); - case "file": - return FileFromElement( - reader, out error); - case "multiLanguageProperty": - return MultiLanguagePropertyFromElement( - reader, out error); - case "operation": - return OperationFromElement( - reader, out error); - case "property": - return PropertyFromElement( - reader, out error); - case "range": - return RangeFromElement( - reader, out error); - case "referenceElement": - return ReferenceElementFromElement( - reader, out error); - case "submodel": - return SubmodelFromElement( - reader, out error); - case "submodelElementCollection": - return SubmodelElementCollectionFromElement( - reader, out error); - case "submodelElementList": - return SubmodelElementListFromElement( - reader, out error); - default: - error = new Reporting.Error( - $"Unexpected element with the name {elementName}"); - return null; - } - } // internal static Aas.IHasExtensions? IHasExtensionsFromElement - - /// - /// Deserialize an instance of IReferable from an XML element. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal static Aas.IReferable? IReferableFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element, but reached end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - switch (elementName) - { - case "relationshipElement": - return RelationshipElementFromElement( - reader, out error); - case "annotatedRelationshipElement": - return AnnotatedRelationshipElementFromElement( - reader, out error); - case "assetAdministrationShell": - return AssetAdministrationShellFromElement( - reader, out error); - case "basicEventElement": - return BasicEventElementFromElement( - reader, out error); - case "blob": - return BlobFromElement( - reader, out error); - case "capability": - return CapabilityFromElement( - reader, out error); - case "conceptDescription": - return ConceptDescriptionFromElement( - reader, out error); - case "entity": - return EntityFromElement( - reader, out error); - case "file": - return FileFromElement( - reader, out error); - case "multiLanguageProperty": - return MultiLanguagePropertyFromElement( - reader, out error); - case "operation": - return OperationFromElement( - reader, out error); - case "property": - return PropertyFromElement( - reader, out error); - case "range": - return RangeFromElement( - reader, out error); - case "referenceElement": - return ReferenceElementFromElement( - reader, out error); - case "submodel": - return SubmodelFromElement( - reader, out error); - case "submodelElementCollection": - return SubmodelElementCollectionFromElement( - reader, out error); - case "submodelElementList": - return SubmodelElementListFromElement( - reader, out error); - default: - error = new Reporting.Error( - $"Unexpected element with the name {elementName}"); - return null; - } - } // internal static Aas.IReferable? IReferableFromElement - - /// - /// Deserialize an instance of IIdentifiable from an XML element. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal static Aas.IIdentifiable? IIdentifiableFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element, but reached end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - switch (elementName) - { - case "assetAdministrationShell": - return AssetAdministrationShellFromElement( - reader, out error); - case "conceptDescription": - return ConceptDescriptionFromElement( - reader, out error); - case "submodel": - return SubmodelFromElement( - reader, out error); - default: - error = new Reporting.Error( - $"Unexpected element with the name {elementName}"); - return null; - } - } // internal static Aas.IIdentifiable? IIdentifiableFromElement - - /// - /// Deserialize an instance of IHasKind from an XML element. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal static Aas.IHasKind? IHasKindFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element, but reached end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - switch (elementName) - { - case "submodel": - return SubmodelFromElement( - reader, out error); - default: - error = new Reporting.Error( - $"Unexpected element with the name {elementName}"); - return null; - } - } // internal static Aas.IHasKind? IHasKindFromElement - - /// - /// Deserialize an instance of IHasDataSpecification from an XML element. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal static Aas.IHasDataSpecification? IHasDataSpecificationFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element, but reached end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - switch (elementName) - { - case "administrativeInformation": - return AdministrativeInformationFromElement( - reader, out error); - case "relationshipElement": - return RelationshipElementFromElement( - reader, out error); - case "annotatedRelationshipElement": - return AnnotatedRelationshipElementFromElement( - reader, out error); - case "assetAdministrationShell": - return AssetAdministrationShellFromElement( - reader, out error); - case "basicEventElement": - return BasicEventElementFromElement( - reader, out error); - case "blob": - return BlobFromElement( - reader, out error); - case "capability": - return CapabilityFromElement( - reader, out error); - case "conceptDescription": - return ConceptDescriptionFromElement( - reader, out error); - case "entity": - return EntityFromElement( - reader, out error); - case "file": - return FileFromElement( - reader, out error); - case "multiLanguageProperty": - return MultiLanguagePropertyFromElement( - reader, out error); - case "operation": - return OperationFromElement( - reader, out error); - case "property": - return PropertyFromElement( - reader, out error); - case "range": - return RangeFromElement( - reader, out error); - case "referenceElement": - return ReferenceElementFromElement( - reader, out error); - case "submodel": - return SubmodelFromElement( - reader, out error); - case "submodelElementCollection": - return SubmodelElementCollectionFromElement( - reader, out error); - case "submodelElementList": - return SubmodelElementListFromElement( - reader, out error); - default: - error = new Reporting.Error( - $"Unexpected element with the name {elementName}"); - return null; - } - } // internal static Aas.IHasDataSpecification? IHasDataSpecificationFromElement - - /// - /// Deserialize an instance of class AdministrativeInformation from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.AdministrativeInformation? AdministrativeInformationFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theEmbeddedDataSpecifications = null; - string? theVersion = null; - string? theRevision = null; - IReference? theCreator = null; - string? theTemplateId = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class AdministrativeInformation, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "version": - { - if (isEmptyProperty) - { - theVersion = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Version of an instance of class AdministrativeInformation, " + - "but reached the end-of-file"); - return null; - } - - try - { - theVersion = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Version of an instance of class AdministrativeInformation " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "version")); - return null; - } - - throw; - } - } - break; - } - case "revision": - { - if (isEmptyProperty) - { - theRevision = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Revision of an instance of class AdministrativeInformation, " + - "but reached the end-of-file"); - return null; - } - - try - { - theRevision = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Revision of an instance of class AdministrativeInformation " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "revision")); - return null; - } - - throw; - } - } - break; - } - case "creator": - { - theCreator = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "creator")); - return null; - } - break; - } - case "templateId": - { - if (isEmptyProperty) - { - theTemplateId = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property TemplateId of an instance of class AdministrativeInformation, " + - "but reached the end-of-file"); - return null; - } - - try - { - theTemplateId = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property TemplateId of an instance of class AdministrativeInformation " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "templateId")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class AdministrativeInformation, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class AdministrativeInformation " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class AdministrativeInformation " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class AdministrativeInformation " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - return new Aas.AdministrativeInformation( - theEmbeddedDataSpecifications, - theVersion, - theRevision, - theCreator, - theTemplateId); - } // internal static Aas.AdministrativeInformation? AdministrativeInformationFromSequence - - /// - /// Deserialize an instance of class AdministrativeInformation from an XML element. - /// - internal static Aas.AdministrativeInformation? AdministrativeInformationFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class AdministrativeInformation, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class AdministrativeInformation, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "administrativeInformation") - { - error = new Reporting.Error( - "Expected an element representing an instance of class AdministrativeInformation " + - $"with element name administrativeInformation, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.AdministrativeInformation? result = ( - AdministrativeInformationFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class AdministrativeInformation, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class AdministrativeInformation, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.AdministrativeInformation? AdministrativeInformationFromElement - - /// - /// Deserialize an instance of IQualifiable from an XML element. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal static Aas.IQualifiable? IQualifiableFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element, but reached end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - switch (elementName) - { - case "relationshipElement": - return RelationshipElementFromElement( - reader, out error); - case "annotatedRelationshipElement": - return AnnotatedRelationshipElementFromElement( - reader, out error); - case "basicEventElement": - return BasicEventElementFromElement( - reader, out error); - case "blob": - return BlobFromElement( - reader, out error); - case "capability": - return CapabilityFromElement( - reader, out error); - case "entity": - return EntityFromElement( - reader, out error); - case "file": - return FileFromElement( - reader, out error); - case "multiLanguageProperty": - return MultiLanguagePropertyFromElement( - reader, out error); - case "operation": - return OperationFromElement( - reader, out error); - case "property": - return PropertyFromElement( - reader, out error); - case "range": - return RangeFromElement( - reader, out error); - case "referenceElement": - return ReferenceElementFromElement( - reader, out error); - case "submodel": - return SubmodelFromElement( - reader, out error); - case "submodelElementCollection": - return SubmodelElementCollectionFromElement( - reader, out error); - case "submodelElementList": - return SubmodelElementListFromElement( - reader, out error); - default: - error = new Reporting.Error( - $"Unexpected element with the name {elementName}"); - return null; - } - } // internal static Aas.IQualifiable? IQualifiableFromElement - - /// - /// Deserialize an instance of class Qualifier from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.Qualifier? QualifierFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - QualifierKind? theKind = null; - string? theType = null; - DataTypeDefXsd? theValueType = null; - string? theValue = null; - IReference? theValueId = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class Qualifier, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "kind": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property Kind of an instance of class Qualifier " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "kind")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Kind of an instance of class Qualifier, " + - "but reached the end-of-file"); - return null; - } - - string textKind; - try - { - textKind = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property Kind of an instance of class Qualifier " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "kind")); - return null; - } - - theKind = Stringification.QualifierKindFromString( - textKind); - - if (theKind == null) - { - error = new Reporting.Error( - "The property Kind of an instance of class Qualifier " + - "could not be de-serialized from an unexpected enumeration literal: " + - textKind); - error.PrependSegment( - new Reporting.NameSegment( - "kind")); - return null; - } - break; - } - case "type": - { - if (isEmptyProperty) - { - theType = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Type of an instance of class Qualifier, " + - "but reached the end-of-file"); - return null; - } - - try - { - theType = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Type of an instance of class Qualifier " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "type")); - return null; - } - - throw; - } - } - break; - } - case "valueType": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property ValueType of an instance of class Qualifier " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property ValueType of an instance of class Qualifier, " + - "but reached the end-of-file"); - return null; - } - - string textValueType; - try - { - textValueType = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property ValueType of an instance of class Qualifier " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - - theValueType = Stringification.DataTypeDefXsdFromString( - textValueType); - - if (theValueType == null) - { - error = new Reporting.Error( - "The property ValueType of an instance of class Qualifier " + - "could not be de-serialized from an unexpected enumeration literal: " + - textValueType); - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - break; - } - case "value": - { - if (isEmptyProperty) - { - theValue = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Value of an instance of class Qualifier, " + - "but reached the end-of-file"); - return null; - } - - try - { - theValue = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Value of an instance of class Qualifier " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - - throw; - } - } - break; - } - case "valueId": - { - theValueId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueId")); - return null; - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class Qualifier, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Qualifier " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Qualifier " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Qualifier " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theType == null) - { - error = new Reporting.Error( - "The required property Type has not been given " + - "in the XML representation of an instance of class Qualifier"); - return null; - } - - if (theValueType == null) - { - error = new Reporting.Error( - "The required property ValueType has not been given " + - "in the XML representation of an instance of class Qualifier"); - return null; - } - - return new Aas.Qualifier( - theType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theValueType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theSemanticId, - theSupplementalSemanticIds, - theKind, - theValue, - theValueId); - } // internal static Aas.Qualifier? QualifierFromSequence - - /// - /// Deserialize an instance of class Qualifier from an XML element. - /// - internal static Aas.Qualifier? QualifierFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Qualifier, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Qualifier, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "qualifier") - { - error = new Reporting.Error( - "Expected an element representing an instance of class Qualifier " + - $"with element name qualifier, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.Qualifier? result = ( - QualifierFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Qualifier, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Qualifier, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.Qualifier? QualifierFromElement - - /// - /// Deserialize an instance of class AssetAdministrationShell from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.AssetAdministrationShell? AssetAdministrationShellFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IAdministrativeInformation? theAdministration = null; - string? theId = null; - List? theEmbeddedDataSpecifications = null; - IReference? theDerivedFrom = null; - IAssetInformation? theAssetInformation = null; - List? theSubmodels = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class AssetAdministrationShell, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class AssetAdministrationShell, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class AssetAdministrationShell " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class AssetAdministrationShell, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class AssetAdministrationShell " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "administration": - { - theAdministration = AdministrativeInformationFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "administration")); - return null; - } - break; - } - case "id": - { - if (isEmptyProperty) - { - theId = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Id of an instance of class AssetAdministrationShell, " + - "but reached the end-of-file"); - return null; - } - - try - { - theId = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Id of an instance of class AssetAdministrationShell " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "id")); - return null; - } - - throw; - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "derivedFrom": - { - theDerivedFrom = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "derivedFrom")); - return null; - } - break; - } - case "assetInformation": - { - theAssetInformation = AssetInformationFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "assetInformation")); - return null; - } - break; - } - case "submodels": - { - theSubmodels = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSubmodels = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSubmodels)); - error.PrependSegment( - new Reporting.NameSegment( - "submodels")); - return null; - } - - theSubmodels.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSubmodels++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class AssetAdministrationShell, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class AssetAdministrationShell " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class AssetAdministrationShell " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class AssetAdministrationShell " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theId == null) - { - error = new Reporting.Error( - "The required property Id has not been given " + - "in the XML representation of an instance of class AssetAdministrationShell"); - return null; - } - - if (theAssetInformation == null) - { - error = new Reporting.Error( - "The required property AssetInformation has not been given " + - "in the XML representation of an instance of class AssetAdministrationShell"); - return null; - } - - return new Aas.AssetAdministrationShell( - theId - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theAssetInformation - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theAdministration, - theEmbeddedDataSpecifications, - theDerivedFrom, - theSubmodels); - } // internal static Aas.AssetAdministrationShell? AssetAdministrationShellFromSequence - - /// - /// Deserialize an instance of class AssetAdministrationShell from an XML element. - /// - internal static Aas.AssetAdministrationShell? AssetAdministrationShellFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class AssetAdministrationShell, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class AssetAdministrationShell, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "assetAdministrationShell") - { - error = new Reporting.Error( - "Expected an element representing an instance of class AssetAdministrationShell " + - $"with element name assetAdministrationShell, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.AssetAdministrationShell? result = ( - AssetAdministrationShellFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class AssetAdministrationShell, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class AssetAdministrationShell, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.AssetAdministrationShell? AssetAdministrationShellFromElement - - /// - /// Deserialize an instance of class AssetInformation from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.AssetInformation? AssetInformationFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - AssetKind? theAssetKind = null; - string? theGlobalAssetId = null; - List? theSpecificAssetIds = null; - string? theAssetType = null; - IResource? theDefaultThumbnail = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class AssetInformation, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "assetKind": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property AssetKind of an instance of class AssetInformation " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "assetKind")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property AssetKind of an instance of class AssetInformation, " + - "but reached the end-of-file"); - return null; - } - - string textAssetKind; - try - { - textAssetKind = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property AssetKind of an instance of class AssetInformation " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "assetKind")); - return null; - } - - theAssetKind = Stringification.AssetKindFromString( - textAssetKind); - - if (theAssetKind == null) - { - error = new Reporting.Error( - "The property AssetKind of an instance of class AssetInformation " + - "could not be de-serialized from an unexpected enumeration literal: " + - textAssetKind); - error.PrependSegment( - new Reporting.NameSegment( - "assetKind")); - return null; - } - break; - } - case "globalAssetId": - { - if (isEmptyProperty) - { - theGlobalAssetId = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property GlobalAssetId of an instance of class AssetInformation, " + - "but reached the end-of-file"); - return null; - } - - try - { - theGlobalAssetId = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property GlobalAssetId of an instance of class AssetInformation " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "globalAssetId")); - return null; - } - - throw; - } - } - break; - } - case "specificAssetIds": - { - theSpecificAssetIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSpecificAssetIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ISpecificAssetId? item = SpecificAssetIdFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSpecificAssetIds)); - error.PrependSegment( - new Reporting.NameSegment( - "specificAssetIds")); - return null; - } - - theSpecificAssetIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSpecificAssetIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "assetType": - { - if (isEmptyProperty) - { - theAssetType = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property AssetType of an instance of class AssetInformation, " + - "but reached the end-of-file"); - return null; - } - - try - { - theAssetType = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property AssetType of an instance of class AssetInformation " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "assetType")); - return null; - } - - throw; - } - } - break; - } - case "defaultThumbnail": - { - theDefaultThumbnail = ResourceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "defaultThumbnail")); - return null; - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class AssetInformation, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class AssetInformation " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class AssetInformation " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class AssetInformation " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theAssetKind == null) - { - error = new Reporting.Error( - "The required property AssetKind has not been given " + - "in the XML representation of an instance of class AssetInformation"); - return null; - } - - return new Aas.AssetInformation( - theAssetKind - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theGlobalAssetId, - theSpecificAssetIds, - theAssetType, - theDefaultThumbnail); - } // internal static Aas.AssetInformation? AssetInformationFromSequence - - /// - /// Deserialize an instance of class AssetInformation from an XML element. - /// - internal static Aas.AssetInformation? AssetInformationFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class AssetInformation, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class AssetInformation, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "assetInformation") - { - error = new Reporting.Error( - "Expected an element representing an instance of class AssetInformation " + - $"with element name assetInformation, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.AssetInformation? result = ( - AssetInformationFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class AssetInformation, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class AssetInformation, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.AssetInformation? AssetInformationFromElement - - /// - /// Deserialize an instance of class Resource from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.Resource? ResourceFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - string? thePath = null; - string? theContentType = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class Resource, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "path": - { - if (isEmptyProperty) - { - thePath = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Path of an instance of class Resource, " + - "but reached the end-of-file"); - return null; - } - - try - { - thePath = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Path of an instance of class Resource " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "path")); - return null; - } - - throw; - } - } - break; - } - case "contentType": - { - if (isEmptyProperty) - { - theContentType = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property ContentType of an instance of class Resource, " + - "but reached the end-of-file"); - return null; - } - - try - { - theContentType = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property ContentType of an instance of class Resource " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "contentType")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class Resource, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Resource " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Resource " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Resource " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (thePath == null) - { - error = new Reporting.Error( - "The required property Path has not been given " + - "in the XML representation of an instance of class Resource"); - return null; - } - - return new Aas.Resource( - thePath - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theContentType); - } // internal static Aas.Resource? ResourceFromSequence - - /// - /// Deserialize an instance of class Resource from an XML element. - /// - internal static Aas.Resource? ResourceFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Resource, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Resource, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "resource") - { - error = new Reporting.Error( - "Expected an element representing an instance of class Resource " + - $"with element name resource, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.Resource? result = ( - ResourceFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Resource, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Resource, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.Resource? ResourceFromElement - - /// - /// Deserialize an instance of class SpecificAssetId from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.SpecificAssetId? SpecificAssetIdFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - string? theName = null; - string? theValue = null; - IReference? theExternalSubjectId = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class SpecificAssetId, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "name": - { - if (isEmptyProperty) - { - theName = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Name of an instance of class SpecificAssetId, " + - "but reached the end-of-file"); - return null; - } - - try - { - theName = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Name of an instance of class SpecificAssetId " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "name")); - return null; - } - - throw; - } - } - break; - } - case "value": - { - if (isEmptyProperty) - { - theValue = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Value of an instance of class SpecificAssetId, " + - "but reached the end-of-file"); - return null; - } - - try - { - theValue = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Value of an instance of class SpecificAssetId " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - - throw; - } - } - break; - } - case "externalSubjectId": - { - theExternalSubjectId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "externalSubjectId")); - return null; - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class SpecificAssetId, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class SpecificAssetId " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class SpecificAssetId " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class SpecificAssetId " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theName == null) - { - error = new Reporting.Error( - "The required property Name has not been given " + - "in the XML representation of an instance of class SpecificAssetId"); - return null; - } - - if (theValue == null) - { - error = new Reporting.Error( - "The required property Value has not been given " + - "in the XML representation of an instance of class SpecificAssetId"); - return null; - } - - return new Aas.SpecificAssetId( - theName - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theValue - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theSemanticId, - theSupplementalSemanticIds, - theExternalSubjectId); - } // internal static Aas.SpecificAssetId? SpecificAssetIdFromSequence - - /// - /// Deserialize an instance of class SpecificAssetId from an XML element. - /// - internal static Aas.SpecificAssetId? SpecificAssetIdFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class SpecificAssetId, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class SpecificAssetId, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "specificAssetId") - { - error = new Reporting.Error( - "Expected an element representing an instance of class SpecificAssetId " + - $"with element name specificAssetId, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.SpecificAssetId? result = ( - SpecificAssetIdFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class SpecificAssetId, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class SpecificAssetId, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.SpecificAssetId? SpecificAssetIdFromElement - - /// - /// Deserialize an instance of class Submodel from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.Submodel? SubmodelFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IAdministrativeInformation? theAdministration = null; - string? theId = null; - ModellingKind? theKind = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - List? theSubmodelElements = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class Submodel, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class Submodel, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class Submodel " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class Submodel, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class Submodel " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "administration": - { - theAdministration = AdministrativeInformationFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "administration")); - return null; - } - break; - } - case "id": - { - if (isEmptyProperty) - { - theId = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Id of an instance of class Submodel, " + - "but reached the end-of-file"); - return null; - } - - try - { - theId = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Id of an instance of class Submodel " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "id")); - return null; - } - - throw; - } - } - break; - } - case "kind": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property Kind of an instance of class Submodel " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "kind")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Kind of an instance of class Submodel, " + - "but reached the end-of-file"); - return null; - } - - string textKind; - try - { - textKind = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property Kind of an instance of class Submodel " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "kind")); - return null; - } - - theKind = Stringification.ModellingKindFromString( - textKind); - - if (theKind == null) - { - error = new Reporting.Error( - "The property Kind of an instance of class Submodel " + - "could not be de-serialized from an unexpected enumeration literal: " + - textKind); - error.PrependSegment( - new Reporting.NameSegment( - "kind")); - return null; - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "submodelElements": - { - theSubmodelElements = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSubmodelElements = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ISubmodelElement? item = ISubmodelElementFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSubmodelElements)); - error.PrependSegment( - new Reporting.NameSegment( - "submodelElements")); - return null; - } - - theSubmodelElements.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSubmodelElements++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class Submodel, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Submodel " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Submodel " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Submodel " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theId == null) - { - error = new Reporting.Error( - "The required property Id has not been given " + - "in the XML representation of an instance of class Submodel"); - return null; - } - - return new Aas.Submodel( - theId - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theAdministration, - theKind, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theSubmodelElements); - } // internal static Aas.Submodel? SubmodelFromSequence - - /// - /// Deserialize an instance of class Submodel from an XML element. - /// - internal static Aas.Submodel? SubmodelFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Submodel, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Submodel, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "submodel") - { - error = new Reporting.Error( - "Expected an element representing an instance of class Submodel " + - $"with element name submodel, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.Submodel? result = ( - SubmodelFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Submodel, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Submodel, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.Submodel? SubmodelFromElement - - /// - /// Deserialize an instance of ISubmodelElement from an XML element. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal static Aas.ISubmodelElement? ISubmodelElementFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element, but reached end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - switch (elementName) - { - case "relationshipElement": - return RelationshipElementFromElement( - reader, out error); - case "annotatedRelationshipElement": - return AnnotatedRelationshipElementFromElement( - reader, out error); - case "basicEventElement": - return BasicEventElementFromElement( - reader, out error); - case "blob": - return BlobFromElement( - reader, out error); - case "capability": - return CapabilityFromElement( - reader, out error); - case "entity": - return EntityFromElement( - reader, out error); - case "file": - return FileFromElement( - reader, out error); - case "multiLanguageProperty": - return MultiLanguagePropertyFromElement( - reader, out error); - case "operation": - return OperationFromElement( - reader, out error); - case "property": - return PropertyFromElement( - reader, out error); - case "range": - return RangeFromElement( - reader, out error); - case "referenceElement": - return ReferenceElementFromElement( - reader, out error); - case "submodelElementCollection": - return SubmodelElementCollectionFromElement( - reader, out error); - case "submodelElementList": - return SubmodelElementListFromElement( - reader, out error); - default: - error = new Reporting.Error( - $"Unexpected element with the name {elementName}"); - return null; - } - } // internal static Aas.ISubmodelElement? ISubmodelElementFromElement - - /// - /// Deserialize an instance of class RelationshipElement from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.RelationshipElement? RelationshipElementFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - IReference? theFirst = null; - IReference? theSecond = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class RelationshipElement, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class RelationshipElement, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class RelationshipElement " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class RelationshipElement, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class RelationshipElement " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "first": - { - theFirst = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "first")); - return null; - } - break; - } - case "second": - { - theSecond = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "second")); - return null; - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class RelationshipElement, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class RelationshipElement " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class RelationshipElement " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class RelationshipElement " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theFirst == null) - { - error = new Reporting.Error( - "The required property First has not been given " + - "in the XML representation of an instance of class RelationshipElement"); - return null; - } - - if (theSecond == null) - { - error = new Reporting.Error( - "The required property Second has not been given " + - "in the XML representation of an instance of class RelationshipElement"); - return null; - } - - return new Aas.RelationshipElement( - theFirst - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theSecond - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications); - } // internal static Aas.RelationshipElement? RelationshipElementFromSequence - - /// - /// Deserialize an instance of IRelationshipElement from an XML element. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal static Aas.IRelationshipElement? IRelationshipElementFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element, but reached end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - switch (elementName) - { - case "annotatedRelationshipElement": - return AnnotatedRelationshipElementFromElement( - reader, out error); - case "relationshipElement": - return RelationshipElementFromElement( - reader, out error); - default: - error = new Reporting.Error( - $"Unexpected element with the name {elementName}"); - return null; - } - } // internal static Aas.IRelationshipElement? IRelationshipElementFromElement - - /// - /// Deserialize an instance of class RelationshipElement from an XML element. - /// - internal static Aas.RelationshipElement? RelationshipElementFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class RelationshipElement, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class RelationshipElement, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "relationshipElement") - { - error = new Reporting.Error( - "Expected an element representing an instance of class RelationshipElement " + - $"with element name relationshipElement, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.RelationshipElement? result = ( - RelationshipElementFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class RelationshipElement, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class RelationshipElement, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.RelationshipElement? RelationshipElementFromElement - - /// - /// Deserialize an instance of class SubmodelElementList from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.SubmodelElementList? SubmodelElementListFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - bool? theOrderRelevant = null; - IReference? theSemanticIdListElement = null; - AasSubmodelElements? theTypeValueListElement = null; - DataTypeDefXsd? theValueTypeListElement = null; - List? theValue = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class SubmodelElementList, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class SubmodelElementList, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class SubmodelElementList " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class SubmodelElementList, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class SubmodelElementList " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "orderRelevant": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property OrderRelevant of an instance of class SubmodelElementList " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "orderRelevant")); - return null; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property OrderRelevant of an instance of class SubmodelElementList, " + - "but reached the end-of-file"); - return null; - } - - try - { - theOrderRelevant = reader.ReadContentAsBoolean(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property OrderRelevant of an instance of class SubmodelElementList " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "orderRelevant")); - return null; - } - - throw; - } - } - break; - } - case "semanticIdListElement": - { - theSemanticIdListElement = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticIdListElement")); - return null; - } - break; - } - case "typeValueListElement": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property TypeValueListElement of an instance of class SubmodelElementList " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "typeValueListElement")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property TypeValueListElement of an instance of class SubmodelElementList, " + - "but reached the end-of-file"); - return null; - } - - string textTypeValueListElement; - try - { - textTypeValueListElement = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property TypeValueListElement of an instance of class SubmodelElementList " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "typeValueListElement")); - return null; - } - - theTypeValueListElement = Stringification.AasSubmodelElementsFromString( - textTypeValueListElement); - - if (theTypeValueListElement == null) - { - error = new Reporting.Error( - "The property TypeValueListElement of an instance of class SubmodelElementList " + - "could not be de-serialized from an unexpected enumeration literal: " + - textTypeValueListElement); - error.PrependSegment( - new Reporting.NameSegment( - "typeValueListElement")); - return null; - } - break; - } - case "valueTypeListElement": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property ValueTypeListElement of an instance of class SubmodelElementList " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "valueTypeListElement")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property ValueTypeListElement of an instance of class SubmodelElementList, " + - "but reached the end-of-file"); - return null; - } - - string textValueTypeListElement; - try - { - textValueTypeListElement = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property ValueTypeListElement of an instance of class SubmodelElementList " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "valueTypeListElement")); - return null; - } - - theValueTypeListElement = Stringification.DataTypeDefXsdFromString( - textValueTypeListElement); - - if (theValueTypeListElement == null) - { - error = new Reporting.Error( - "The property ValueTypeListElement of an instance of class SubmodelElementList " + - "could not be de-serialized from an unexpected enumeration literal: " + - textValueTypeListElement); - error.PrependSegment( - new Reporting.NameSegment( - "valueTypeListElement")); - return null; - } - break; - } - case "value": - { - theValue = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexValue = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ISubmodelElement? item = ISubmodelElementFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexValue)); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - - theValue.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexValue++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class SubmodelElementList, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class SubmodelElementList " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class SubmodelElementList " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class SubmodelElementList " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theTypeValueListElement == null) - { - error = new Reporting.Error( - "The required property TypeValueListElement has not been given " + - "in the XML representation of an instance of class SubmodelElementList"); - return null; - } - - return new Aas.SubmodelElementList( - theTypeValueListElement - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theOrderRelevant, - theSemanticIdListElement, - theValueTypeListElement, - theValue); - } // internal static Aas.SubmodelElementList? SubmodelElementListFromSequence - - /// - /// Deserialize an instance of class SubmodelElementList from an XML element. - /// - internal static Aas.SubmodelElementList? SubmodelElementListFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class SubmodelElementList, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class SubmodelElementList, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "submodelElementList") - { - error = new Reporting.Error( - "Expected an element representing an instance of class SubmodelElementList " + - $"with element name submodelElementList, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.SubmodelElementList? result = ( - SubmodelElementListFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class SubmodelElementList, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class SubmodelElementList, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.SubmodelElementList? SubmodelElementListFromElement - - /// - /// Deserialize an instance of class SubmodelElementCollection from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.SubmodelElementCollection? SubmodelElementCollectionFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - List? theValue = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class SubmodelElementCollection, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class SubmodelElementCollection, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class SubmodelElementCollection " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class SubmodelElementCollection, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class SubmodelElementCollection " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "value": - { - theValue = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexValue = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ISubmodelElement? item = ISubmodelElementFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexValue)); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - - theValue.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexValue++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class SubmodelElementCollection, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class SubmodelElementCollection " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class SubmodelElementCollection " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class SubmodelElementCollection " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - return new Aas.SubmodelElementCollection( - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue); - } // internal static Aas.SubmodelElementCollection? SubmodelElementCollectionFromSequence - - /// - /// Deserialize an instance of class SubmodelElementCollection from an XML element. - /// - internal static Aas.SubmodelElementCollection? SubmodelElementCollectionFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class SubmodelElementCollection, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class SubmodelElementCollection, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "submodelElementCollection") - { - error = new Reporting.Error( - "Expected an element representing an instance of class SubmodelElementCollection " + - $"with element name submodelElementCollection, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.SubmodelElementCollection? result = ( - SubmodelElementCollectionFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class SubmodelElementCollection, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class SubmodelElementCollection, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.SubmodelElementCollection? SubmodelElementCollectionFromElement - - /// - /// Deserialize an instance of IDataElement from an XML element. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal static Aas.IDataElement? IDataElementFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element, but reached end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - switch (elementName) - { - case "blob": - return BlobFromElement( - reader, out error); - case "file": - return FileFromElement( - reader, out error); - case "multiLanguageProperty": - return MultiLanguagePropertyFromElement( - reader, out error); - case "property": - return PropertyFromElement( - reader, out error); - case "range": - return RangeFromElement( - reader, out error); - case "referenceElement": - return ReferenceElementFromElement( - reader, out error); - default: - error = new Reporting.Error( - $"Unexpected element with the name {elementName}"); - return null; - } - } // internal static Aas.IDataElement? IDataElementFromElement - - /// - /// Deserialize an instance of class Property from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.Property? PropertyFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - DataTypeDefXsd? theValueType = null; - string? theValue = null; - IReference? theValueId = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class Property, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class Property, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class Property " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class Property, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class Property " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "valueType": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property ValueType of an instance of class Property " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property ValueType of an instance of class Property, " + - "but reached the end-of-file"); - return null; - } - - string textValueType; - try - { - textValueType = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property ValueType of an instance of class Property " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - - theValueType = Stringification.DataTypeDefXsdFromString( - textValueType); - - if (theValueType == null) - { - error = new Reporting.Error( - "The property ValueType of an instance of class Property " + - "could not be de-serialized from an unexpected enumeration literal: " + - textValueType); - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - break; - } - case "value": - { - if (isEmptyProperty) - { - theValue = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Value of an instance of class Property, " + - "but reached the end-of-file"); - return null; - } - - try - { - theValue = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Value of an instance of class Property " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - - throw; - } - } - break; - } - case "valueId": - { - theValueId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueId")); - return null; - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class Property, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Property " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Property " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Property " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theValueType == null) - { - error = new Reporting.Error( - "The required property ValueType has not been given " + - "in the XML representation of an instance of class Property"); - return null; - } - - return new Aas.Property( - theValueType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue, - theValueId); - } // internal static Aas.Property? PropertyFromSequence - - /// - /// Deserialize an instance of class Property from an XML element. - /// - internal static Aas.Property? PropertyFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Property, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Property, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "property") - { - error = new Reporting.Error( - "Expected an element representing an instance of class Property " + - $"with element name property, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.Property? result = ( - PropertyFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Property, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Property, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.Property? PropertyFromElement - - /// - /// Deserialize an instance of class MultiLanguageProperty from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.MultiLanguageProperty? MultiLanguagePropertyFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - List? theValue = null; - IReference? theValueId = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class MultiLanguageProperty, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class MultiLanguageProperty, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class MultiLanguageProperty " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class MultiLanguageProperty, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class MultiLanguageProperty " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "value": - { - theValue = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexValue = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexValue)); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - - theValue.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexValue++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "valueId": - { - theValueId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueId")); - return null; - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class MultiLanguageProperty, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class MultiLanguageProperty " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class MultiLanguageProperty " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class MultiLanguageProperty " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - return new Aas.MultiLanguageProperty( - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue, - theValueId); - } // internal static Aas.MultiLanguageProperty? MultiLanguagePropertyFromSequence - - /// - /// Deserialize an instance of class MultiLanguageProperty from an XML element. - /// - internal static Aas.MultiLanguageProperty? MultiLanguagePropertyFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class MultiLanguageProperty, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class MultiLanguageProperty, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "multiLanguageProperty") - { - error = new Reporting.Error( - "Expected an element representing an instance of class MultiLanguageProperty " + - $"with element name multiLanguageProperty, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.MultiLanguageProperty? result = ( - MultiLanguagePropertyFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class MultiLanguageProperty, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class MultiLanguageProperty, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.MultiLanguageProperty? MultiLanguagePropertyFromElement - - /// - /// Deserialize an instance of class Range from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.Range? RangeFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - DataTypeDefXsd? theValueType = null; - string? theMin = null; - string? theMax = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class Range, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class Range, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class Range " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class Range, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class Range " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "valueType": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property ValueType of an instance of class Range " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property ValueType of an instance of class Range, " + - "but reached the end-of-file"); - return null; - } - - string textValueType; - try - { - textValueType = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property ValueType of an instance of class Range " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - - theValueType = Stringification.DataTypeDefXsdFromString( - textValueType); - - if (theValueType == null) - { - error = new Reporting.Error( - "The property ValueType of an instance of class Range " + - "could not be de-serialized from an unexpected enumeration literal: " + - textValueType); - error.PrependSegment( - new Reporting.NameSegment( - "valueType")); - return null; - } - break; - } - case "min": - { - if (isEmptyProperty) - { - theMin = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Min of an instance of class Range, " + - "but reached the end-of-file"); - return null; - } - - try - { - theMin = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Min of an instance of class Range " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "min")); - return null; - } - - throw; - } - } - break; - } - case "max": - { - if (isEmptyProperty) - { - theMax = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Max of an instance of class Range, " + - "but reached the end-of-file"); - return null; - } - - try - { - theMax = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Max of an instance of class Range " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "max")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class Range, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Range " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Range " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Range " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theValueType == null) - { - error = new Reporting.Error( - "The required property ValueType has not been given " + - "in the XML representation of an instance of class Range"); - return null; - } - - return new Aas.Range( - theValueType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theMin, - theMax); - } // internal static Aas.Range? RangeFromSequence - - /// - /// Deserialize an instance of class Range from an XML element. - /// - internal static Aas.Range? RangeFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Range, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Range, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "range") - { - error = new Reporting.Error( - "Expected an element representing an instance of class Range " + - $"with element name range, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.Range? result = ( - RangeFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Range, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Range, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.Range? RangeFromElement - - /// - /// Deserialize an instance of class ReferenceElement from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.ReferenceElement? ReferenceElementFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - IReference? theValue = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class ReferenceElement, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class ReferenceElement, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class ReferenceElement " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class ReferenceElement, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class ReferenceElement " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "value": - { - theValue = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class ReferenceElement, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class ReferenceElement " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class ReferenceElement " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class ReferenceElement " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - return new Aas.ReferenceElement( - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue); - } // internal static Aas.ReferenceElement? ReferenceElementFromSequence - - /// - /// Deserialize an instance of class ReferenceElement from an XML element. - /// - internal static Aas.ReferenceElement? ReferenceElementFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class ReferenceElement, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class ReferenceElement, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "referenceElement") - { - error = new Reporting.Error( - "Expected an element representing an instance of class ReferenceElement " + - $"with element name referenceElement, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.ReferenceElement? result = ( - ReferenceElementFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class ReferenceElement, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class ReferenceElement, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.ReferenceElement? ReferenceElementFromElement - - /// - /// Deserialize an instance of class Blob from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.Blob? BlobFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - byte[]? theValue = null; - string? theContentType = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class Blob, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class Blob, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class Blob " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class Blob, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class Blob " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "value": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property Value of an instance of class Blob " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Value of an instance of class Blob, " + - "but reached the end-of-file"); - return null; - } - - try - { - theValue = DeserializeImplementation.ReadWholeContentAsBase64( - reader); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Value of an instance of class Blob " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - - throw; - } - } - break; - } - case "contentType": - { - if (isEmptyProperty) - { - theContentType = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property ContentType of an instance of class Blob, " + - "but reached the end-of-file"); - return null; - } - - try - { - theContentType = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property ContentType of an instance of class Blob " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "contentType")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class Blob, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Blob " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Blob " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Blob " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theContentType == null) - { - error = new Reporting.Error( - "The required property ContentType has not been given " + - "in the XML representation of an instance of class Blob"); - return null; - } - - return new Aas.Blob( - theContentType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue); - } // internal static Aas.Blob? BlobFromSequence - - /// - /// Deserialize an instance of class Blob from an XML element. - /// - internal static Aas.Blob? BlobFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Blob, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Blob, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "blob") - { - error = new Reporting.Error( - "Expected an element representing an instance of class Blob " + - $"with element name blob, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.Blob? result = ( - BlobFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Blob, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Blob, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.Blob? BlobFromElement - - /// - /// Deserialize an instance of class File from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.File? FileFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - string? theValue = null; - string? theContentType = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class File, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class File, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class File " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class File, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class File " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "value": - { - if (isEmptyProperty) - { - theValue = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Value of an instance of class File, " + - "but reached the end-of-file"); - return null; - } - - try - { - theValue = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Value of an instance of class File " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - - throw; - } - } - break; - } - case "contentType": - { - if (isEmptyProperty) - { - theContentType = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property ContentType of an instance of class File, " + - "but reached the end-of-file"); - return null; - } - - try - { - theContentType = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property ContentType of an instance of class File " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "contentType")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class File, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class File " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class File " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class File " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theContentType == null) - { - error = new Reporting.Error( - "The required property ContentType has not been given " + - "in the XML representation of an instance of class File"); - return null; - } - - return new Aas.File( - theContentType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theValue); - } // internal static Aas.File? FileFromSequence - - /// - /// Deserialize an instance of class File from an XML element. - /// - internal static Aas.File? FileFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class File, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class File, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "file") - { - error = new Reporting.Error( - "Expected an element representing an instance of class File " + - $"with element name file, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.File? result = ( - FileFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class File, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class File, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.File? FileFromElement - - /// - /// Deserialize an instance of class AnnotatedRelationshipElement from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.AnnotatedRelationshipElement? AnnotatedRelationshipElementFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - IReference? theFirst = null; - IReference? theSecond = null; - List? theAnnotations = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class AnnotatedRelationshipElement, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class AnnotatedRelationshipElement, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class AnnotatedRelationshipElement " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class AnnotatedRelationshipElement, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class AnnotatedRelationshipElement " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "first": - { - theFirst = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "first")); - return null; - } - break; - } - case "second": - { - theSecond = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "second")); - return null; - } - break; - } - case "annotations": - { - theAnnotations = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexAnnotations = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IDataElement? item = IDataElementFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexAnnotations)); - error.PrependSegment( - new Reporting.NameSegment( - "annotations")); - return null; - } - - theAnnotations.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexAnnotations++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class AnnotatedRelationshipElement, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class AnnotatedRelationshipElement " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class AnnotatedRelationshipElement " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class AnnotatedRelationshipElement " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theFirst == null) - { - error = new Reporting.Error( - "The required property First has not been given " + - "in the XML representation of an instance of class AnnotatedRelationshipElement"); - return null; - } - - if (theSecond == null) - { - error = new Reporting.Error( - "The required property Second has not been given " + - "in the XML representation of an instance of class AnnotatedRelationshipElement"); - return null; - } - - return new Aas.AnnotatedRelationshipElement( - theFirst - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theSecond - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theAnnotations); - } // internal static Aas.AnnotatedRelationshipElement? AnnotatedRelationshipElementFromSequence - - /// - /// Deserialize an instance of class AnnotatedRelationshipElement from an XML element. - /// - internal static Aas.AnnotatedRelationshipElement? AnnotatedRelationshipElementFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class AnnotatedRelationshipElement, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class AnnotatedRelationshipElement, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "annotatedRelationshipElement") - { - error = new Reporting.Error( - "Expected an element representing an instance of class AnnotatedRelationshipElement " + - $"with element name annotatedRelationshipElement, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.AnnotatedRelationshipElement? result = ( - AnnotatedRelationshipElementFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class AnnotatedRelationshipElement, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class AnnotatedRelationshipElement, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.AnnotatedRelationshipElement? AnnotatedRelationshipElementFromElement - - /// - /// Deserialize an instance of class Entity from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.Entity? EntityFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - List? theStatements = null; - EntityType? theEntityType = null; - string? theGlobalAssetId = null; - List? theSpecificAssetIds = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class Entity, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class Entity, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class Entity " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class Entity, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class Entity " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "statements": - { - theStatements = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexStatements = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ISubmodelElement? item = ISubmodelElementFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexStatements)); - error.PrependSegment( - new Reporting.NameSegment( - "statements")); - return null; - } - - theStatements.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexStatements++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "entityType": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property EntityType of an instance of class Entity " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "entityType")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property EntityType of an instance of class Entity, " + - "but reached the end-of-file"); - return null; - } - - string textEntityType; - try - { - textEntityType = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property EntityType of an instance of class Entity " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "entityType")); - return null; - } - - theEntityType = Stringification.EntityTypeFromString( - textEntityType); - - if (theEntityType == null) - { - error = new Reporting.Error( - "The property EntityType of an instance of class Entity " + - "could not be de-serialized from an unexpected enumeration literal: " + - textEntityType); - error.PrependSegment( - new Reporting.NameSegment( - "entityType")); - return null; - } - break; - } - case "globalAssetId": - { - if (isEmptyProperty) - { - theGlobalAssetId = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property GlobalAssetId of an instance of class Entity, " + - "but reached the end-of-file"); - return null; - } - - try - { - theGlobalAssetId = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property GlobalAssetId of an instance of class Entity " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "globalAssetId")); - return null; - } - - throw; - } - } - break; - } - case "specificAssetIds": - { - theSpecificAssetIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSpecificAssetIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ISpecificAssetId? item = SpecificAssetIdFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSpecificAssetIds)); - error.PrependSegment( - new Reporting.NameSegment( - "specificAssetIds")); - return null; - } - - theSpecificAssetIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSpecificAssetIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class Entity, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Entity " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Entity " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Entity " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theEntityType == null) - { - error = new Reporting.Error( - "The required property EntityType has not been given " + - "in the XML representation of an instance of class Entity"); - return null; - } - - return new Aas.Entity( - theEntityType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theStatements, - theGlobalAssetId, - theSpecificAssetIds); - } // internal static Aas.Entity? EntityFromSequence - - /// - /// Deserialize an instance of class Entity from an XML element. - /// - internal static Aas.Entity? EntityFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Entity, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Entity, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "entity") - { - error = new Reporting.Error( - "Expected an element representing an instance of class Entity " + - $"with element name entity, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.Entity? result = ( - EntityFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Entity, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Entity, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.Entity? EntityFromElement - - /// - /// Deserialize an instance of class EventPayload from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.EventPayload? EventPayloadFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - IReference? theSource = null; - IReference? theSourceSemanticId = null; - IReference? theObservableReference = null; - IReference? theObservableSemanticId = null; - string? theTopic = null; - IReference? theSubjectId = null; - string? theTimeStamp = null; - byte[]? thePayload = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class EventPayload, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "source": - { - theSource = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "source")); - return null; - } - break; - } - case "sourceSemanticId": - { - theSourceSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "sourceSemanticId")); - return null; - } - break; - } - case "observableReference": - { - theObservableReference = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "observableReference")); - return null; - } - break; - } - case "observableSemanticId": - { - theObservableSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "observableSemanticId")); - return null; - } - break; - } - case "topic": - { - if (isEmptyProperty) - { - theTopic = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Topic of an instance of class EventPayload, " + - "but reached the end-of-file"); - return null; - } - - try - { - theTopic = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Topic of an instance of class EventPayload " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "topic")); - return null; - } - - throw; - } - } - break; - } - case "subjectId": - { - theSubjectId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "subjectId")); - return null; - } - break; - } - case "timeStamp": - { - if (isEmptyProperty) - { - theTimeStamp = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property TimeStamp of an instance of class EventPayload, " + - "but reached the end-of-file"); - return null; - } - - try - { - theTimeStamp = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property TimeStamp of an instance of class EventPayload " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "timeStamp")); - return null; - } - - throw; - } - } - break; - } - case "payload": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property Payload of an instance of class EventPayload " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "payload")); - return null; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Payload of an instance of class EventPayload, " + - "but reached the end-of-file"); - return null; - } - - try - { - thePayload = DeserializeImplementation.ReadWholeContentAsBase64( - reader); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Payload of an instance of class EventPayload " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "payload")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class EventPayload, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class EventPayload " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class EventPayload " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class EventPayload " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theSource == null) - { - error = new Reporting.Error( - "The required property Source has not been given " + - "in the XML representation of an instance of class EventPayload"); - return null; - } - - if (theObservableReference == null) - { - error = new Reporting.Error( - "The required property ObservableReference has not been given " + - "in the XML representation of an instance of class EventPayload"); - return null; - } - - if (theTimeStamp == null) - { - error = new Reporting.Error( - "The required property TimeStamp has not been given " + - "in the XML representation of an instance of class EventPayload"); - return null; - } - - return new Aas.EventPayload( - theSource - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theObservableReference - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theTimeStamp - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theSourceSemanticId, - theObservableSemanticId, - theTopic, - theSubjectId, - thePayload); - } // internal static Aas.EventPayload? EventPayloadFromSequence - - /// - /// Deserialize an instance of class EventPayload from an XML element. - /// - internal static Aas.EventPayload? EventPayloadFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class EventPayload, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class EventPayload, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "eventPayload") - { - error = new Reporting.Error( - "Expected an element representing an instance of class EventPayload " + - $"with element name eventPayload, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.EventPayload? result = ( - EventPayloadFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class EventPayload, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class EventPayload, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.EventPayload? EventPayloadFromElement - - /// - /// Deserialize an instance of IEventElement from an XML element. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal static Aas.IEventElement? IEventElementFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element, but reached end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - switch (elementName) - { - case "basicEventElement": - return BasicEventElementFromElement( - reader, out error); - default: - error = new Reporting.Error( - $"Unexpected element with the name {elementName}"); - return null; - } - } // internal static Aas.IEventElement? IEventElementFromElement - - /// - /// Deserialize an instance of class BasicEventElement from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.BasicEventElement? BasicEventElementFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - IReference? theObserved = null; - Direction? theDirection = null; - StateOfEvent? theState = null; - string? theMessageTopic = null; - IReference? theMessageBroker = null; - string? theLastUpdate = null; - string? theMinInterval = null; - string? theMaxInterval = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class BasicEventElement, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class BasicEventElement, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class BasicEventElement " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class BasicEventElement, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class BasicEventElement " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "observed": - { - theObserved = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "observed")); - return null; - } - break; - } - case "direction": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property Direction of an instance of class BasicEventElement " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "direction")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Direction of an instance of class BasicEventElement, " + - "but reached the end-of-file"); - return null; - } - - string textDirection; - try - { - textDirection = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property Direction of an instance of class BasicEventElement " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "direction")); - return null; - } - - theDirection = Stringification.DirectionFromString( - textDirection); - - if (theDirection == null) - { - error = new Reporting.Error( - "The property Direction of an instance of class BasicEventElement " + - "could not be de-serialized from an unexpected enumeration literal: " + - textDirection); - error.PrependSegment( - new Reporting.NameSegment( - "direction")); - return null; - } - break; - } - case "state": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property State of an instance of class BasicEventElement " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "state")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property State of an instance of class BasicEventElement, " + - "but reached the end-of-file"); - return null; - } - - string textState; - try - { - textState = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property State of an instance of class BasicEventElement " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "state")); - return null; - } - - theState = Stringification.StateOfEventFromString( - textState); - - if (theState == null) - { - error = new Reporting.Error( - "The property State of an instance of class BasicEventElement " + - "could not be de-serialized from an unexpected enumeration literal: " + - textState); - error.PrependSegment( - new Reporting.NameSegment( - "state")); - return null; - } - break; - } - case "messageTopic": - { - if (isEmptyProperty) - { - theMessageTopic = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property MessageTopic of an instance of class BasicEventElement, " + - "but reached the end-of-file"); - return null; - } - - try - { - theMessageTopic = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property MessageTopic of an instance of class BasicEventElement " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "messageTopic")); - return null; - } - - throw; - } - } - break; - } - case "messageBroker": - { - theMessageBroker = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "messageBroker")); - return null; - } - break; - } - case "lastUpdate": - { - if (isEmptyProperty) - { - theLastUpdate = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property LastUpdate of an instance of class BasicEventElement, " + - "but reached the end-of-file"); - return null; - } - - try - { - theLastUpdate = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property LastUpdate of an instance of class BasicEventElement " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "lastUpdate")); - return null; - } - - throw; - } - } - break; - } - case "minInterval": - { - if (isEmptyProperty) - { - theMinInterval = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property MinInterval of an instance of class BasicEventElement, " + - "but reached the end-of-file"); - return null; - } - - try - { - theMinInterval = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property MinInterval of an instance of class BasicEventElement " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "minInterval")); - return null; - } - - throw; - } - } - break; - } - case "maxInterval": - { - if (isEmptyProperty) - { - theMaxInterval = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property MaxInterval of an instance of class BasicEventElement, " + - "but reached the end-of-file"); - return null; - } - - try - { - theMaxInterval = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property MaxInterval of an instance of class BasicEventElement " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "maxInterval")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class BasicEventElement, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class BasicEventElement " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class BasicEventElement " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class BasicEventElement " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theObserved == null) - { - error = new Reporting.Error( - "The required property Observed has not been given " + - "in the XML representation of an instance of class BasicEventElement"); - return null; - } - - if (theDirection == null) - { - error = new Reporting.Error( - "The required property Direction has not been given " + - "in the XML representation of an instance of class BasicEventElement"); - return null; - } - - if (theState == null) - { - error = new Reporting.Error( - "The required property State has not been given " + - "in the XML representation of an instance of class BasicEventElement"); - return null; - } - - return new Aas.BasicEventElement( - theObserved - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theDirection - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theState - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theMessageTopic, - theMessageBroker, - theLastUpdate, - theMinInterval, - theMaxInterval); - } // internal static Aas.BasicEventElement? BasicEventElementFromSequence - - /// - /// Deserialize an instance of class BasicEventElement from an XML element. - /// - internal static Aas.BasicEventElement? BasicEventElementFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class BasicEventElement, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class BasicEventElement, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "basicEventElement") - { - error = new Reporting.Error( - "Expected an element representing an instance of class BasicEventElement " + - $"with element name basicEventElement, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.BasicEventElement? result = ( - BasicEventElementFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class BasicEventElement, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class BasicEventElement, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.BasicEventElement? BasicEventElementFromElement - - /// - /// Deserialize an instance of class Operation from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.Operation? OperationFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - List? theInputVariables = null; - List? theOutputVariables = null; - List? theInoutputVariables = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class Operation, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class Operation, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class Operation " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class Operation, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class Operation " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "inputVariables": - { - theInputVariables = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexInputVariables = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IOperationVariable? item = OperationVariableFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexInputVariables)); - error.PrependSegment( - new Reporting.NameSegment( - "inputVariables")); - return null; - } - - theInputVariables.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexInputVariables++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "outputVariables": - { - theOutputVariables = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexOutputVariables = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IOperationVariable? item = OperationVariableFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexOutputVariables)); - error.PrependSegment( - new Reporting.NameSegment( - "outputVariables")); - return null; - } - - theOutputVariables.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexOutputVariables++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "inoutputVariables": - { - theInoutputVariables = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexInoutputVariables = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IOperationVariable? item = OperationVariableFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexInoutputVariables)); - error.PrependSegment( - new Reporting.NameSegment( - "inoutputVariables")); - return null; - } - - theInoutputVariables.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexInoutputVariables++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class Operation, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Operation " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Operation " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Operation " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - return new Aas.Operation( - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications, - theInputVariables, - theOutputVariables, - theInoutputVariables); - } // internal static Aas.Operation? OperationFromSequence - - /// - /// Deserialize an instance of class Operation from an XML element. - /// - internal static Aas.Operation? OperationFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Operation, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Operation, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "operation") - { - error = new Reporting.Error( - "Expected an element representing an instance of class Operation " + - $"with element name operation, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.Operation? result = ( - OperationFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Operation, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Operation, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.Operation? OperationFromElement - - /// - /// Deserialize an instance of class OperationVariable from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.OperationVariable? OperationVariableFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - ISubmodelElement? theValue = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class OperationVariable, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "value": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - $"Expected an XML element within the element {elementName} representing " + - "the property Value of an instance of class OperationVariable, " + - "but encountered a self-closing element {elementName}"); - return null; - } - - // We need to skip the whitespace here in order to be able to look ahead - // the discriminator element shortly. - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - $"Expected an XML element within the element {elementName} representing " + - "the property Value of an instance of class OperationVariable, " + - "but reached the end-of-file"); - return null; - } - - // Try to look ahead the discriminator name; - // we need this name only for the error reporting below. - // ISubmodelElementFromElement will perform more sophisticated - // checks. - string? discriminatorElementName = null; - if (reader.NodeType == Xml.XmlNodeType.Element) - { - discriminatorElementName = reader.LocalName; - } - - theValue = ISubmodelElementFromElement( - reader, out error); - - if (error != null) - { - if (discriminatorElementName != null) - { - error.PrependSegment( - new Reporting.NameSegment( - discriminatorElementName)); - } - - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class OperationVariable, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class OperationVariable " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class OperationVariable " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class OperationVariable " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theValue == null) - { - error = new Reporting.Error( - "The required property Value has not been given " + - "in the XML representation of an instance of class OperationVariable"); - return null; - } - - return new Aas.OperationVariable( - theValue - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static Aas.OperationVariable? OperationVariableFromSequence - - /// - /// Deserialize an instance of class OperationVariable from an XML element. - /// - internal static Aas.OperationVariable? OperationVariableFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class OperationVariable, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class OperationVariable, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "operationVariable") - { - error = new Reporting.Error( - "Expected an element representing an instance of class OperationVariable " + - $"with element name operationVariable, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.OperationVariable? result = ( - OperationVariableFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class OperationVariable, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class OperationVariable, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.OperationVariable? OperationVariableFromElement - - /// - /// Deserialize an instance of class Capability from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.Capability? CapabilityFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IReference? theSemanticId = null; - List? theSupplementalSemanticIds = null; - List? theQualifiers = null; - List? theEmbeddedDataSpecifications = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class Capability, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class Capability, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class Capability " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class Capability, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class Capability " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "semanticId": - { - theSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "semanticId")); - return null; - } - break; - } - case "supplementalSemanticIds": - { - theSupplementalSemanticIds = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSupplementalSemanticIds = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSupplementalSemanticIds)); - error.PrependSegment( - new Reporting.NameSegment( - "supplementalSemanticIds")); - return null; - } - - theSupplementalSemanticIds.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSupplementalSemanticIds++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "qualifiers": - { - theQualifiers = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexQualifiers = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IQualifier? item = QualifierFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexQualifiers)); - error.PrependSegment( - new Reporting.NameSegment( - "qualifiers")); - return null; - } - - theQualifiers.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexQualifiers++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class Capability, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Capability " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Capability " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Capability " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - return new Aas.Capability( - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theSemanticId, - theSupplementalSemanticIds, - theQualifiers, - theEmbeddedDataSpecifications); - } // internal static Aas.Capability? CapabilityFromSequence - - /// - /// Deserialize an instance of class Capability from an XML element. - /// - internal static Aas.Capability? CapabilityFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Capability, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Capability, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "capability") - { - error = new Reporting.Error( - "Expected an element representing an instance of class Capability " + - $"with element name capability, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.Capability? result = ( - CapabilityFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Capability, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Capability, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.Capability? CapabilityFromElement - - /// - /// Deserialize an instance of class ConceptDescription from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.ConceptDescription? ConceptDescriptionFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theExtensions = null; - string? theCategory = null; - string? theIdShort = null; - List? theDisplayName = null; - List? theDescription = null; - IAdministrativeInformation? theAdministration = null; - string? theId = null; - List? theEmbeddedDataSpecifications = null; - List? theIsCaseOf = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class ConceptDescription, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "extensions": - { - theExtensions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexExtensions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IExtension? item = ExtensionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexExtensions)); - error.PrependSegment( - new Reporting.NameSegment( - "extensions")); - return null; - } - - theExtensions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexExtensions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "category": - { - if (isEmptyProperty) - { - theCategory = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Category of an instance of class ConceptDescription, " + - "but reached the end-of-file"); - return null; - } - - try - { - theCategory = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Category of an instance of class ConceptDescription " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "category")); - return null; - } - - throw; - } - } - break; - } - case "idShort": - { - if (isEmptyProperty) - { - theIdShort = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property IdShort of an instance of class ConceptDescription, " + - "but reached the end-of-file"); - return null; - } - - try - { - theIdShort = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property IdShort of an instance of class ConceptDescription " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "idShort")); - return null; - } - - throw; - } - } - break; - } - case "displayName": - { - theDisplayName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDisplayName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringNameType? item = LangStringNameTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDisplayName)); - error.PrependSegment( - new Reporting.NameSegment( - "displayName")); - return null; - } - - theDisplayName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDisplayName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "description": - { - theDescription = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDescription = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringTextType? item = LangStringTextTypeFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDescription)); - error.PrependSegment( - new Reporting.NameSegment( - "description")); - return null; - } - - theDescription.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDescription++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "administration": - { - theAdministration = AdministrativeInformationFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "administration")); - return null; - } - break; - } - case "id": - { - if (isEmptyProperty) - { - theId = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Id of an instance of class ConceptDescription, " + - "but reached the end-of-file"); - return null; - } - - try - { - theId = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Id of an instance of class ConceptDescription " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "id")); - return null; - } - - throw; - } - } - break; - } - case "embeddedDataSpecifications": - { - theEmbeddedDataSpecifications = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexEmbeddedDataSpecifications = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IEmbeddedDataSpecification? item = EmbeddedDataSpecificationFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexEmbeddedDataSpecifications)); - error.PrependSegment( - new Reporting.NameSegment( - "embeddedDataSpecifications")); - return null; - } - - theEmbeddedDataSpecifications.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexEmbeddedDataSpecifications++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "isCaseOf": - { - theIsCaseOf = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexIsCaseOf = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IReference? item = ReferenceFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexIsCaseOf)); - error.PrependSegment( - new Reporting.NameSegment( - "isCaseOf")); - return null; - } - - theIsCaseOf.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexIsCaseOf++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class ConceptDescription, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class ConceptDescription " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class ConceptDescription " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class ConceptDescription " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theId == null) - { - error = new Reporting.Error( - "The required property Id has not been given " + - "in the XML representation of an instance of class ConceptDescription"); - return null; - } - - return new Aas.ConceptDescription( - theId - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theExtensions, - theCategory, - theIdShort, - theDisplayName, - theDescription, - theAdministration, - theEmbeddedDataSpecifications, - theIsCaseOf); - } // internal static Aas.ConceptDescription? ConceptDescriptionFromSequence - - /// - /// Deserialize an instance of class ConceptDescription from an XML element. - /// - internal static Aas.ConceptDescription? ConceptDescriptionFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class ConceptDescription, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class ConceptDescription, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "conceptDescription") - { - error = new Reporting.Error( - "Expected an element representing an instance of class ConceptDescription " + - $"with element name conceptDescription, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.ConceptDescription? result = ( - ConceptDescriptionFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class ConceptDescription, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class ConceptDescription, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.ConceptDescription? ConceptDescriptionFromElement - - /// - /// Deserialize an instance of class Reference from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.Reference? ReferenceFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - ReferenceTypes? theType = null; - IReference? theReferredSemanticId = null; - List? theKeys = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class Reference, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "type": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property Type of an instance of class Reference " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "type")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Type of an instance of class Reference, " + - "but reached the end-of-file"); - return null; - } - - string textType; - try - { - textType = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property Type of an instance of class Reference " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "type")); - return null; - } - - theType = Stringification.ReferenceTypesFromString( - textType); - - if (theType == null) - { - error = new Reporting.Error( - "The property Type of an instance of class Reference " + - "could not be de-serialized from an unexpected enumeration literal: " + - textType); - error.PrependSegment( - new Reporting.NameSegment( - "type")); - return null; - } - break; - } - case "referredSemanticId": - { - theReferredSemanticId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "referredSemanticId")); - return null; - } - break; - } - case "keys": - { - theKeys = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexKeys = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IKey? item = KeyFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexKeys)); - error.PrependSegment( - new Reporting.NameSegment( - "keys")); - return null; - } - - theKeys.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexKeys++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class Reference, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Reference " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Reference " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Reference " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theType == null) - { - error = new Reporting.Error( - "The required property Type has not been given " + - "in the XML representation of an instance of class Reference"); - return null; - } - - if (theKeys == null) - { - error = new Reporting.Error( - "The required property Keys has not been given " + - "in the XML representation of an instance of class Reference"); - return null; - } - - return new Aas.Reference( - theType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theKeys - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theReferredSemanticId); - } // internal static Aas.Reference? ReferenceFromSequence - - /// - /// Deserialize an instance of class Reference from an XML element. - /// - internal static Aas.Reference? ReferenceFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Reference, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Reference, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "reference") - { - error = new Reporting.Error( - "Expected an element representing an instance of class Reference " + - $"with element name reference, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.Reference? result = ( - ReferenceFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Reference, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Reference, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.Reference? ReferenceFromElement - - /// - /// Deserialize an instance of class Key from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.Key? KeyFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - KeyTypes? theType = null; - string? theValue = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class Key, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "type": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property Type of an instance of class Key " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "type")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Type of an instance of class Key, " + - "but reached the end-of-file"); - return null; - } - - string textType; - try - { - textType = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property Type of an instance of class Key " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "type")); - return null; - } - - theType = Stringification.KeyTypesFromString( - textType); - - if (theType == null) - { - error = new Reporting.Error( - "The property Type of an instance of class Key " + - "could not be de-serialized from an unexpected enumeration literal: " + - textType); - error.PrependSegment( - new Reporting.NameSegment( - "type")); - return null; - } - break; - } - case "value": - { - if (isEmptyProperty) - { - theValue = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Value of an instance of class Key, " + - "but reached the end-of-file"); - return null; - } - - try - { - theValue = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Value of an instance of class Key " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class Key, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Key " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Key " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Key " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theType == null) - { - error = new Reporting.Error( - "The required property Type has not been given " + - "in the XML representation of an instance of class Key"); - return null; - } - - if (theValue == null) - { - error = new Reporting.Error( - "The required property Value has not been given " + - "in the XML representation of an instance of class Key"); - return null; - } - - return new Aas.Key( - theType - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theValue - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static Aas.Key? KeyFromSequence - - /// - /// Deserialize an instance of class Key from an XML element. - /// - internal static Aas.Key? KeyFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Key, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Key, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "key") - { - error = new Reporting.Error( - "Expected an element representing an instance of class Key " + - $"with element name key, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.Key? result = ( - KeyFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Key, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Key, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.Key? KeyFromElement - - /// - /// Deserialize an instance of IAbstractLangString from an XML element. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal static Aas.IAbstractLangString? IAbstractLangStringFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element, but reached end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - switch (elementName) - { - case "langStringDefinitionTypeIec61360": - return LangStringDefinitionTypeIec61360FromElement( - reader, out error); - case "langStringNameType": - return LangStringNameTypeFromElement( - reader, out error); - case "langStringPreferredNameTypeIec61360": - return LangStringPreferredNameTypeIec61360FromElement( - reader, out error); - case "langStringShortNameTypeIec61360": - return LangStringShortNameTypeIec61360FromElement( - reader, out error); - case "langStringTextType": - return LangStringTextTypeFromElement( - reader, out error); - default: - error = new Reporting.Error( - $"Unexpected element with the name {elementName}"); - return null; - } - } // internal static Aas.IAbstractLangString? IAbstractLangStringFromElement - - /// - /// Deserialize an instance of class LangStringNameType from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.LangStringNameType? LangStringNameTypeFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - string? theLanguage = null; - string? theText = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class LangStringNameType, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "language": - { - if (isEmptyProperty) - { - theLanguage = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Language of an instance of class LangStringNameType, " + - "but reached the end-of-file"); - return null; - } - - try - { - theLanguage = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Language of an instance of class LangStringNameType " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "language")); - return null; - } - - throw; - } - } - break; - } - case "text": - { - if (isEmptyProperty) - { - theText = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Text of an instance of class LangStringNameType, " + - "but reached the end-of-file"); - return null; - } - - try - { - theText = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Text of an instance of class LangStringNameType " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "text")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class LangStringNameType, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringNameType " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringNameType " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringNameType " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theLanguage == null) - { - error = new Reporting.Error( - "The required property Language has not been given " + - "in the XML representation of an instance of class LangStringNameType"); - return null; - } - - if (theText == null) - { - error = new Reporting.Error( - "The required property Text has not been given " + - "in the XML representation of an instance of class LangStringNameType"); - return null; - } - - return new Aas.LangStringNameType( - theLanguage - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theText - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static Aas.LangStringNameType? LangStringNameTypeFromSequence - - /// - /// Deserialize an instance of class LangStringNameType from an XML element. - /// - internal static Aas.LangStringNameType? LangStringNameTypeFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class LangStringNameType, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class LangStringNameType, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "langStringNameType") - { - error = new Reporting.Error( - "Expected an element representing an instance of class LangStringNameType " + - $"with element name langStringNameType, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.LangStringNameType? result = ( - LangStringNameTypeFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class LangStringNameType, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class LangStringNameType, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.LangStringNameType? LangStringNameTypeFromElement - - /// - /// Deserialize an instance of class LangStringTextType from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.LangStringTextType? LangStringTextTypeFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - string? theLanguage = null; - string? theText = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class LangStringTextType, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "language": - { - if (isEmptyProperty) - { - theLanguage = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Language of an instance of class LangStringTextType, " + - "but reached the end-of-file"); - return null; - } - - try - { - theLanguage = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Language of an instance of class LangStringTextType " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "language")); - return null; - } - - throw; - } - } - break; - } - case "text": - { - if (isEmptyProperty) - { - theText = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Text of an instance of class LangStringTextType, " + - "but reached the end-of-file"); - return null; - } - - try - { - theText = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Text of an instance of class LangStringTextType " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "text")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class LangStringTextType, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringTextType " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringTextType " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringTextType " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theLanguage == null) - { - error = new Reporting.Error( - "The required property Language has not been given " + - "in the XML representation of an instance of class LangStringTextType"); - return null; - } - - if (theText == null) - { - error = new Reporting.Error( - "The required property Text has not been given " + - "in the XML representation of an instance of class LangStringTextType"); - return null; - } - - return new Aas.LangStringTextType( - theLanguage - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theText - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static Aas.LangStringTextType? LangStringTextTypeFromSequence - - /// - /// Deserialize an instance of class LangStringTextType from an XML element. - /// - internal static Aas.LangStringTextType? LangStringTextTypeFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class LangStringTextType, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class LangStringTextType, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "langStringTextType") - { - error = new Reporting.Error( - "Expected an element representing an instance of class LangStringTextType " + - $"with element name langStringTextType, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.LangStringTextType? result = ( - LangStringTextTypeFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class LangStringTextType, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class LangStringTextType, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.LangStringTextType? LangStringTextTypeFromElement - - /// - /// Deserialize an instance of class Environment from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.Environment? EnvironmentFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theAssetAdministrationShells = null; - List? theSubmodels = null; - List? theConceptDescriptions = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class Environment, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "assetAdministrationShells": - { - theAssetAdministrationShells = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexAssetAdministrationShells = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IAssetAdministrationShell? item = AssetAdministrationShellFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexAssetAdministrationShells)); - error.PrependSegment( - new Reporting.NameSegment( - "assetAdministrationShells")); - return null; - } - - theAssetAdministrationShells.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexAssetAdministrationShells++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "submodels": - { - theSubmodels = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexSubmodels = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ISubmodel? item = SubmodelFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexSubmodels)); - error.PrependSegment( - new Reporting.NameSegment( - "submodels")); - return null; - } - - theSubmodels.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexSubmodels++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "conceptDescriptions": - { - theConceptDescriptions = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexConceptDescriptions = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IConceptDescription? item = ConceptDescriptionFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexConceptDescriptions)); - error.PrependSegment( - new Reporting.NameSegment( - "conceptDescriptions")); - return null; - } - - theConceptDescriptions.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexConceptDescriptions++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class Environment, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Environment " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Environment " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class Environment " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - return new Aas.Environment( - theAssetAdministrationShells, - theSubmodels, - theConceptDescriptions); - } // internal static Aas.Environment? EnvironmentFromSequence - - /// - /// Deserialize an instance of class Environment from an XML element. - /// - internal static Aas.Environment? EnvironmentFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Environment, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class Environment, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "environment") - { - error = new Reporting.Error( - "Expected an element representing an instance of class Environment " + - $"with element name environment, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.Environment? result = ( - EnvironmentFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Environment, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class Environment, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.Environment? EnvironmentFromElement - - /// - /// Deserialize an instance of IDataSpecificationContent from an XML element. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - internal static Aas.IDataSpecificationContent? IDataSpecificationContentFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element, but reached end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - switch (elementName) - { - case "dataSpecificationIec61360": - return DataSpecificationIec61360FromElement( - reader, out error); - default: - error = new Reporting.Error( - $"Unexpected element with the name {elementName}"); - return null; - } - } // internal static Aas.IDataSpecificationContent? IDataSpecificationContentFromElement - - /// - /// Deserialize an instance of class EmbeddedDataSpecification from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.EmbeddedDataSpecification? EmbeddedDataSpecificationFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - IReference? theDataSpecification = null; - IDataSpecificationContent? theDataSpecificationContent = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class EmbeddedDataSpecification, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "dataSpecification": - { - theDataSpecification = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "dataSpecification")); - return null; - } - break; - } - case "dataSpecificationContent": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - $"Expected an XML element within the element {elementName} representing " + - "the property DataSpecificationContent of an instance of class EmbeddedDataSpecification, " + - "but encountered a self-closing element {elementName}"); - return null; - } - - // We need to skip the whitespace here in order to be able to look ahead - // the discriminator element shortly. - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - $"Expected an XML element within the element {elementName} representing " + - "the property DataSpecificationContent of an instance of class EmbeddedDataSpecification, " + - "but reached the end-of-file"); - return null; - } - - // Try to look ahead the discriminator name; - // we need this name only for the error reporting below. - // IDataSpecificationContentFromElement will perform more sophisticated - // checks. - string? discriminatorElementName = null; - if (reader.NodeType == Xml.XmlNodeType.Element) - { - discriminatorElementName = reader.LocalName; - } - - theDataSpecificationContent = IDataSpecificationContentFromElement( - reader, out error); - - if (error != null) - { - if (discriminatorElementName != null) - { - error.PrependSegment( - new Reporting.NameSegment( - discriminatorElementName)); - } - - error.PrependSegment( - new Reporting.NameSegment( - "dataSpecificationContent")); - return null; - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class EmbeddedDataSpecification, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class EmbeddedDataSpecification " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class EmbeddedDataSpecification " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class EmbeddedDataSpecification " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - //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; - //} - - //if (theDataSpecificationContent == null) - //{ - // error = new Reporting.Error( - // "The required property DataSpecificationContent has not been given " + - // "in the XML representation of an instance of class EmbeddedDataSpecification"); - // return null; - //} - - //return new Aas.EmbeddedDataSpecification( - // theDataSpecification - // ?? throw new System.InvalidOperationException( - // "Unexpected null, had to be handled before"), - // theDataSpecificationContent - // ?? throw new System.InvalidOperationException( - // "Unexpected null, had to be handled before")); - - return new EmbeddedDataSpecification(theDataSpecification, theDataSpecificationContent); - } // internal static Aas.EmbeddedDataSpecification? EmbeddedDataSpecificationFromSequence - - /// - /// Deserialize an instance of class EmbeddedDataSpecification from an XML element. - /// - internal static Aas.EmbeddedDataSpecification? EmbeddedDataSpecificationFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class EmbeddedDataSpecification, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class EmbeddedDataSpecification, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "embeddedDataSpecification") - { - error = new Reporting.Error( - "Expected an element representing an instance of class EmbeddedDataSpecification " + - $"with element name embeddedDataSpecification, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.EmbeddedDataSpecification? result = ( - EmbeddedDataSpecificationFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class EmbeddedDataSpecification, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class EmbeddedDataSpecification, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.EmbeddedDataSpecification? EmbeddedDataSpecificationFromElement - - /// - /// Deserialize an instance of class LevelType from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.LevelType? LevelTypeFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - bool? theMin = null; - bool? theNom = null; - bool? theTyp = null; - bool? theMax = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class LevelType, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "min": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property Min of an instance of class LevelType " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "min")); - return null; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Min of an instance of class LevelType, " + - "but reached the end-of-file"); - return null; - } - - try - { - theMin = reader.ReadContentAsBoolean(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Min of an instance of class LevelType " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "min")); - return null; - } - - throw; - } - } - break; - } - case "nom": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property Nom of an instance of class LevelType " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "nom")); - return null; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Nom of an instance of class LevelType, " + - "but reached the end-of-file"); - return null; - } - - try - { - theNom = reader.ReadContentAsBoolean(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Nom of an instance of class LevelType " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "nom")); - return null; - } - - throw; - } - } - break; - } - case "typ": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property Typ of an instance of class LevelType " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "typ")); - return null; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Typ of an instance of class LevelType, " + - "but reached the end-of-file"); - return null; - } - - try - { - theTyp = reader.ReadContentAsBoolean(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Typ of an instance of class LevelType " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "typ")); - return null; - } - - throw; - } - } - break; - } - case "max": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property Max of an instance of class LevelType " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "max")); - return null; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Max of an instance of class LevelType, " + - "but reached the end-of-file"); - return null; - } - - try - { - theMax = reader.ReadContentAsBoolean(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Max of an instance of class LevelType " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "max")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class LevelType, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LevelType " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LevelType " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LevelType " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theMin == null) - { - error = new Reporting.Error( - "The required property Min has not been given " + - "in the XML representation of an instance of class LevelType"); - return null; - } - - if (theNom == null) - { - error = new Reporting.Error( - "The required property Nom has not been given " + - "in the XML representation of an instance of class LevelType"); - return null; - } - - if (theTyp == null) - { - error = new Reporting.Error( - "The required property Typ has not been given " + - "in the XML representation of an instance of class LevelType"); - return null; - } - - if (theMax == null) - { - error = new Reporting.Error( - "The required property Max has not been given " + - "in the XML representation of an instance of class LevelType"); - return null; - } - - return new Aas.LevelType( - theMin - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theNom - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theTyp - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theMax - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static Aas.LevelType? LevelTypeFromSequence - - /// - /// Deserialize an instance of class LevelType from an XML element. - /// - internal static Aas.LevelType? LevelTypeFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class LevelType, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class LevelType, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "levelType") - { - error = new Reporting.Error( - "Expected an element representing an instance of class LevelType " + - $"with element name levelType, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.LevelType? result = ( - LevelTypeFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class LevelType, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class LevelType, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.LevelType? LevelTypeFromElement - - /// - /// Deserialize an instance of class ValueReferencePair from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.ValueReferencePair? ValueReferencePairFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - string? theValue = null; - IReference? theValueId = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class ValueReferencePair, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "value": - { - if (isEmptyProperty) - { - theValue = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Value of an instance of class ValueReferencePair, " + - "but reached the end-of-file"); - return null; - } - - try - { - theValue = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Value of an instance of class ValueReferencePair " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - - throw; - } - } - break; - } - case "valueId": - { - theValueId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueId")); - return null; - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class ValueReferencePair, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class ValueReferencePair " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class ValueReferencePair " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class ValueReferencePair " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theValue == null) - { - error = new Reporting.Error( - "The required property Value has not been given " + - "in the XML representation of an instance of class ValueReferencePair"); - return null; - } - - if (theValueId == null) - { - error = new Reporting.Error( - "The required property ValueId has not been given " + - "in the XML representation of an instance of class ValueReferencePair"); - return null; - } - - return new Aas.ValueReferencePair( - theValue - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theValueId - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static Aas.ValueReferencePair? ValueReferencePairFromSequence - - /// - /// Deserialize an instance of class ValueReferencePair from an XML element. - /// - internal static Aas.ValueReferencePair? ValueReferencePairFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class ValueReferencePair, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class ValueReferencePair, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "valueReferencePair") - { - error = new Reporting.Error( - "Expected an element representing an instance of class ValueReferencePair " + - $"with element name valueReferencePair, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.ValueReferencePair? result = ( - ValueReferencePairFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class ValueReferencePair, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class ValueReferencePair, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.ValueReferencePair? ValueReferencePairFromElement - - /// - /// Deserialize an instance of class ValueList from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.ValueList? ValueListFromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? theValueReferencePairs = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class ValueList, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "valueReferencePairs": - { - theValueReferencePairs = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexValueReferencePairs = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - IValueReferencePair? item = ValueReferencePairFromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexValueReferencePairs)); - error.PrependSegment( - new Reporting.NameSegment( - "valueReferencePairs")); - return null; - } - - theValueReferencePairs.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexValueReferencePairs++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class ValueList, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class ValueList " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class ValueList " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class ValueList " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theValueReferencePairs == null) - { - error = new Reporting.Error( - "The required property ValueReferencePairs has not been given " + - "in the XML representation of an instance of class ValueList"); - return null; - } - - return new Aas.ValueList( - theValueReferencePairs - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static Aas.ValueList? ValueListFromSequence - - /// - /// Deserialize an instance of class ValueList from an XML element. - /// - internal static Aas.ValueList? ValueListFromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class ValueList, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class ValueList, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "valueList") - { - error = new Reporting.Error( - "Expected an element representing an instance of class ValueList " + - $"with element name valueList, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.ValueList? result = ( - ValueListFromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class ValueList, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class ValueList, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.ValueList? ValueListFromElement - - /// - /// Deserialize an instance of class LangStringPreferredNameTypeIec61360 from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.LangStringPreferredNameTypeIec61360? LangStringPreferredNameTypeIec61360FromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - string? theLanguage = null; - string? theText = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class LangStringPreferredNameTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "language": - { - if (isEmptyProperty) - { - theLanguage = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Language of an instance of class LangStringPreferredNameTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - - try - { - theLanguage = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Language of an instance of class LangStringPreferredNameTypeIec61360 " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "language")); - return null; - } - - throw; - } - } - break; - } - case "text": - { - if (isEmptyProperty) - { - theText = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Text of an instance of class LangStringPreferredNameTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - - try - { - theText = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Text of an instance of class LangStringPreferredNameTypeIec61360 " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "text")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class LangStringPreferredNameTypeIec61360, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringPreferredNameTypeIec61360 " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringPreferredNameTypeIec61360 " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringPreferredNameTypeIec61360 " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theLanguage == null) - { - error = new Reporting.Error( - "The required property Language has not been given " + - "in the XML representation of an instance of class LangStringPreferredNameTypeIec61360"); - return null; - } - - if (theText == null) - { - error = new Reporting.Error( - "The required property Text has not been given " + - "in the XML representation of an instance of class LangStringPreferredNameTypeIec61360"); - return null; - } - - return new Aas.LangStringPreferredNameTypeIec61360( - theLanguage - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theText - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static Aas.LangStringPreferredNameTypeIec61360? LangStringPreferredNameTypeIec61360FromSequence - - /// - /// Deserialize an instance of class LangStringPreferredNameTypeIec61360 from an XML element. - /// - internal static Aas.LangStringPreferredNameTypeIec61360? LangStringPreferredNameTypeIec61360FromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class LangStringPreferredNameTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class LangStringPreferredNameTypeIec61360, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "langStringPreferredNameTypeIec61360") - { - error = new Reporting.Error( - "Expected an element representing an instance of class LangStringPreferredNameTypeIec61360 " + - $"with element name langStringPreferredNameTypeIec61360, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.LangStringPreferredNameTypeIec61360? result = ( - LangStringPreferredNameTypeIec61360FromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class LangStringPreferredNameTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class LangStringPreferredNameTypeIec61360, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.LangStringPreferredNameTypeIec61360? LangStringPreferredNameTypeIec61360FromElement - - /// - /// Deserialize an instance of class LangStringShortNameTypeIec61360 from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.LangStringShortNameTypeIec61360? LangStringShortNameTypeIec61360FromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - string? theLanguage = null; - string? theText = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class LangStringShortNameTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "language": - { - if (isEmptyProperty) - { - theLanguage = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Language of an instance of class LangStringShortNameTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - - try - { - theLanguage = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Language of an instance of class LangStringShortNameTypeIec61360 " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "language")); - return null; - } - - throw; - } - } - break; - } - case "text": - { - if (isEmptyProperty) - { - theText = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Text of an instance of class LangStringShortNameTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - - try - { - theText = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Text of an instance of class LangStringShortNameTypeIec61360 " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "text")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class LangStringShortNameTypeIec61360, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringShortNameTypeIec61360 " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringShortNameTypeIec61360 " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringShortNameTypeIec61360 " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theLanguage == null) - { - error = new Reporting.Error( - "The required property Language has not been given " + - "in the XML representation of an instance of class LangStringShortNameTypeIec61360"); - return null; - } - - if (theText == null) - { - error = new Reporting.Error( - "The required property Text has not been given " + - "in the XML representation of an instance of class LangStringShortNameTypeIec61360"); - return null; - } - - return new Aas.LangStringShortNameTypeIec61360( - theLanguage - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theText - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static Aas.LangStringShortNameTypeIec61360? LangStringShortNameTypeIec61360FromSequence - - /// - /// Deserialize an instance of class LangStringShortNameTypeIec61360 from an XML element. - /// - internal static Aas.LangStringShortNameTypeIec61360? LangStringShortNameTypeIec61360FromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class LangStringShortNameTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class LangStringShortNameTypeIec61360, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "langStringShortNameTypeIec61360") - { - error = new Reporting.Error( - "Expected an element representing an instance of class LangStringShortNameTypeIec61360 " + - $"with element name langStringShortNameTypeIec61360, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.LangStringShortNameTypeIec61360? result = ( - LangStringShortNameTypeIec61360FromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class LangStringShortNameTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class LangStringShortNameTypeIec61360, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.LangStringShortNameTypeIec61360? LangStringShortNameTypeIec61360FromElement - - /// - /// Deserialize an instance of class LangStringDefinitionTypeIec61360 from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.LangStringDefinitionTypeIec61360? LangStringDefinitionTypeIec61360FromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - string? theLanguage = null; - string? theText = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class LangStringDefinitionTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "language": - { - if (isEmptyProperty) - { - theLanguage = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Language of an instance of class LangStringDefinitionTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - - try - { - theLanguage = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Language of an instance of class LangStringDefinitionTypeIec61360 " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "language")); - return null; - } - - throw; - } - } - break; - } - case "text": - { - if (isEmptyProperty) - { - theText = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Text of an instance of class LangStringDefinitionTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - - try - { - theText = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Text of an instance of class LangStringDefinitionTypeIec61360 " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "text")); - return null; - } - - throw; - } - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class LangStringDefinitionTypeIec61360, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringDefinitionTypeIec61360 " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringDefinitionTypeIec61360 " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class LangStringDefinitionTypeIec61360 " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (theLanguage == null) - { - error = new Reporting.Error( - "The required property Language has not been given " + - "in the XML representation of an instance of class LangStringDefinitionTypeIec61360"); - return null; - } - - if (theText == null) - { - error = new Reporting.Error( - "The required property Text has not been given " + - "in the XML representation of an instance of class LangStringDefinitionTypeIec61360"); - return null; - } - - return new Aas.LangStringDefinitionTypeIec61360( - theLanguage - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theText - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before")); - } // internal static Aas.LangStringDefinitionTypeIec61360? LangStringDefinitionTypeIec61360FromSequence - - /// - /// Deserialize an instance of class LangStringDefinitionTypeIec61360 from an XML element. - /// - internal static Aas.LangStringDefinitionTypeIec61360? LangStringDefinitionTypeIec61360FromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class LangStringDefinitionTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class LangStringDefinitionTypeIec61360, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "langStringDefinitionTypeIec61360") - { - error = new Reporting.Error( - "Expected an element representing an instance of class LangStringDefinitionTypeIec61360 " + - $"with element name langStringDefinitionTypeIec61360, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.LangStringDefinitionTypeIec61360? result = ( - LangStringDefinitionTypeIec61360FromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class LangStringDefinitionTypeIec61360, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class LangStringDefinitionTypeIec61360, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.LangStringDefinitionTypeIec61360? LangStringDefinitionTypeIec61360FromElement - - /// - /// Deserialize an instance of class DataSpecificationIec61360 from a sequence of XML elements. - /// - /// - /// If is set, we should try to deserialize - /// the instance from an empty sequence. That is, the parent element - /// was a self-closing element. - /// - internal static Aas.DataSpecificationIec61360? DataSpecificationIec61360FromSequence( - Xml.XmlReader reader, - bool isEmptySequence, - out Reporting.Error? error) - { - error = null; - - List? thePreferredName = null; - List? theShortName = null; - string? theUnit = null; - IReference? theUnitId = null; - string? theSourceOfDefinition = null; - string? theSymbol = null; - DataTypeIec61360? theDataType = null; - List? theDefinition = null; - string? theValueFormat = null; - IValueList? theValueList = null; - string? theValue = null; - ILevelType? theLevelType = null; - - if (!isEmptySequence) - { - SkipNoneWhitespaceAndComments(reader); - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing " + - "a property of an instance of class DataSpecificationIec61360, " + - "but reached the end-of-file"); - return null; - } - while (reader.NodeType == Xml.XmlNodeType.Element) - { - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - bool isEmptyProperty = reader.IsEmptyElement; - - // Skip the expected element - reader.Read(); - - switch (elementName) - { - case "preferredName": - { - thePreferredName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexPreferredName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringPreferredNameTypeIec61360? item = LangStringPreferredNameTypeIec61360FromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexPreferredName)); - error.PrependSegment( - new Reporting.NameSegment( - "preferredName")); - return null; - } - - thePreferredName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexPreferredName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "shortName": - { - theShortName = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexShortName = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringShortNameTypeIec61360? item = LangStringShortNameTypeIec61360FromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexShortName)); - error.PrependSegment( - new Reporting.NameSegment( - "shortName")); - return null; - } - - theShortName.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexShortName++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "unit": - { - if (isEmptyProperty) - { - theUnit = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Unit of an instance of class DataSpecificationIec61360, " + - "but reached the end-of-file"); - return null; - } - - try - { - theUnit = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Unit of an instance of class DataSpecificationIec61360 " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "unit")); - return null; - } - - throw; - } - } - break; - } - case "unitId": - { - theUnitId = ReferenceFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "unitId")); - return null; - } - break; - } - case "sourceOfDefinition": - { - if (isEmptyProperty) - { - theSourceOfDefinition = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property SourceOfDefinition of an instance of class DataSpecificationIec61360, " + - "but reached the end-of-file"); - return null; - } - - try - { - theSourceOfDefinition = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property SourceOfDefinition of an instance of class DataSpecificationIec61360 " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "sourceOfDefinition")); - return null; - } - - throw; - } - } - break; - } - case "symbol": - { - if (isEmptyProperty) - { - theSymbol = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Symbol of an instance of class DataSpecificationIec61360, " + - "but reached the end-of-file"); - return null; - } - - try - { - theSymbol = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Symbol of an instance of class DataSpecificationIec61360 " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "symbol")); - return null; - } - - throw; - } - } - break; - } - case "dataType": - { - if (isEmptyProperty) - { - error = new Reporting.Error( - "The property DataType of an instance of class DataSpecificationIec61360 " + - "can not be de-serialized from a self-closing element " + - "since it needs content"); - error.PrependSegment( - new Reporting.NameSegment( - "dataType")); - return null; - } - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property DataType of an instance of class DataSpecificationIec61360, " + - "but reached the end-of-file"); - return null; - } - - string textDataType; - try - { - textDataType = reader.ReadContentAsString(); - } - catch (System.FormatException exception) - { - error = new Reporting.Error( - "The property DataType of an instance of class DataSpecificationIec61360 " + - $"could not be de-serialized as a string: {exception}"); - error.PrependSegment( - new Reporting.NameSegment( - "dataType")); - return null; - } - - theDataType = Stringification.DataTypeIec61360FromString( - textDataType); - - if (theDataType == null) - { - error = new Reporting.Error( - "The property DataType of an instance of class DataSpecificationIec61360 " + - "could not be de-serialized from an unexpected enumeration literal: " + - textDataType); - error.PrependSegment( - new Reporting.NameSegment( - "dataType")); - return null; - } - break; - } - case "definition": - { - theDefinition = new List(); - - if (!isEmptyProperty) - { - SkipNoneWhitespaceAndComments(reader); - - int indexDefinition = 0; - while (reader.NodeType == Xml.XmlNodeType.Element) - { - ILangStringDefinitionTypeIec61360? item = LangStringDefinitionTypeIec61360FromElement( - reader, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.IndexSegment( - indexDefinition)); - error.PrependSegment( - new Reporting.NameSegment( - "definition")); - return null; - } - - theDefinition.Add( - item - ?? throw new System.InvalidOperationException( - "Unexpected item null when error null")); - - indexDefinition++; - SkipNoneWhitespaceAndComments(reader); - } - } - break; - } - case "valueFormat": - { - if (isEmptyProperty) - { - theValueFormat = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property ValueFormat of an instance of class DataSpecificationIec61360, " + - "but reached the end-of-file"); - return null; - } - - try - { - theValueFormat = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property ValueFormat of an instance of class DataSpecificationIec61360 " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "valueFormat")); - return null; - } - - throw; - } - } - break; - } - case "valueList": - { - theValueList = ValueListFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "valueList")); - return null; - } - break; - } - case "value": - { - if (isEmptyProperty) - { - theValue = ""; - } - else - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML content representing " + - "the property Value of an instance of class DataSpecificationIec61360, " + - "but reached the end-of-file"); - return null; - } - - try - { - theValue = reader.ReadContentAsString(); - } - catch (System.Exception exception) - { - if (exception is System.FormatException - || exception is System.Xml.XmlException) - { - error = new Reporting.Error( - "The property Value of an instance of class DataSpecificationIec61360 " + - $"could not be de-serialized: {exception.Message}"); - error.PrependSegment( - new Reporting.NameSegment( - "value")); - return null; - } - - throw; - } - } - break; - } - case "levelType": - { - theLevelType = LevelTypeFromSequence( - reader, isEmptyProperty, out error); - - if (error != null) - { - error.PrependSegment( - new Reporting.NameSegment( - "levelType")); - return null; - } - break; - } - default: - error = new Reporting.Error( - "We expected properties of the class DataSpecificationIec61360, " + - "but got an unexpected element " + - $"with the name {elementName}"); - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyProperty) - { - // Read the end element - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class DataSpecificationIec61360 " + - $"with the element name {elementName}, " + - "but got the end-of-file."); - return null; - } - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class DataSpecificationIec61360 " + - $"with the element name {elementName}, " + - $"but got the node of type {reader.NodeType} " + - $"with the value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - "Expected an XML end element to conclude a property of class DataSpecificationIec61360 " + - $"with the element name {elementName}, " + - $"but got the end element with the name {reader.Name}"); - return null; - } - // Skip the expected end element - reader.Read(); - - SkipNoneWhitespaceAndComments(reader); - } - - if (reader.EOF) - { - break; - } - } - } - - if (thePreferredName == null) - { - error = new Reporting.Error( - "The required property PreferredName has not been given " + - "in the XML representation of an instance of class DataSpecificationIec61360"); - return null; - } - - return new Aas.DataSpecificationIec61360( - thePreferredName - ?? throw new System.InvalidOperationException( - "Unexpected null, had to be handled before"), - theShortName, - theUnit, - theUnitId, - theSourceOfDefinition, - theSymbol, - theDataType, - theDefinition, - theValueFormat, - theValueList, - theValue, - theLevelType); - } // internal static Aas.DataSpecificationIec61360? DataSpecificationIec61360FromSequence - - /// - /// Deserialize an instance of class DataSpecificationIec61360 from an XML element. - /// - internal static Aas.DataSpecificationIec61360? DataSpecificationIec61360FromElement( - Xml.XmlReader reader, - out Reporting.Error? error) - { - error = null; - - SkipNoneWhitespaceAndComments(reader); - - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class DataSpecificationIec61360, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.Element) - { - error = new Reporting.Error( - "Expected an XML element representing an instance of class DataSpecificationIec61360, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string elementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (elementName != "dataSpecificationIec61360") - { - error = new Reporting.Error( - "Expected an element representing an instance of class DataSpecificationIec61360 " + - $"with element name dataSpecificationIec61360, but got: {elementName}"); - return null; - } - - bool isEmptyElement = reader.IsEmptyElement; - - // Skip the element node and go to the content - reader.Read(); - - Aas.DataSpecificationIec61360? result = ( - DataSpecificationIec61360FromSequence( - reader, isEmptyElement, out error)); - if (error != null) - { - return null; - } - - SkipNoneWhitespaceAndComments(reader); - - if (!isEmptyElement) - { - if (reader.EOF) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class DataSpecificationIec61360, " + - "but reached the end-of-file"); - return null; - } - - if (reader.NodeType != Xml.XmlNodeType.EndElement) - { - error = new Reporting.Error( - "Expected an XML end element concluding an instance of class DataSpecificationIec61360, " + - $"but got a node of type {reader.NodeType} " + - $"with value {reader.Value}"); - return null; - } - - string endElementName = TryElementName( - reader, out error); - if (error != null) - { - return null; - } - - if (endElementName != elementName) - { - error = new Reporting.Error( - $"Expected an XML end element with an name {elementName}, " + - $"but got: {endElementName}"); - return null; - } - - // Skip the end element - reader.Read(); - } - - return result; - } // internal static Aas.DataSpecificationIec61360? DataSpecificationIec61360FromElement - } // internal static class DeserializeImplementation - - /// - /// Represent a critical error during the deserialization. - /// - public class Exception : System.Exception - { - public readonly string Path; - public readonly string Cause; - public Exception(string path, string cause) - : base($"{cause} at: {path}") - { - Path = path; - Cause = cause; - } - } - - /// - /// Deserialize instances of meta-model classes from XML. - /// - /// - /// Here is an example how to parse an instance of class IHasSemantics: - /// - /// var reader = new System.Xml.XmlReader(/* some arguments */); - /// Aas.IHasSemantics anInstance = Deserialize.IHasSemanticsFrom( - /// reader); - /// - /// - /// - /// - /// If the elements live in a namespace, you have to supply it. For example: - /// - /// var reader = new System.Xml.XmlReader(/* some arguments */); - /// Aas.IHasSemantics anInstance = Deserialize.IHasSemanticsFrom( - /// reader, - /// "http://www.example.com/5/12"); - /// - /// - public static class Deserialize - { - /// - /// Deserialize an instance of IHasSemantics from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of IHasSemantics. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IHasSemantics IHasSemanticsFrom( - Xml.XmlReader reader) - { - Aas.IHasSemantics? result = ( - DeserializeImplementation.IHasSemanticsFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Extension from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of Extension. - /// - public static Aas.Extension ExtensionFrom( - Xml.XmlReader reader) - { - Aas.Extension? result = ( - DeserializeImplementation.ExtensionFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IHasExtensions from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of IHasExtensions. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IHasExtensions IHasExtensionsFrom( - Xml.XmlReader reader) - { - Aas.IHasExtensions? result = ( - DeserializeImplementation.IHasExtensionsFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IReferable from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of IReferable. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IReferable IReferableFrom( - Xml.XmlReader reader) - { - Aas.IReferable? result = ( - DeserializeImplementation.IReferableFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IIdentifiable from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of IIdentifiable. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IIdentifiable IIdentifiableFrom( - Xml.XmlReader reader) - { - Aas.IIdentifiable? result = ( - DeserializeImplementation.IIdentifiableFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IHasKind from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of IHasKind. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IHasKind IHasKindFrom( - Xml.XmlReader reader) - { - Aas.IHasKind? result = ( - DeserializeImplementation.IHasKindFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IHasDataSpecification from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of IHasDataSpecification. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IHasDataSpecification IHasDataSpecificationFrom( - Xml.XmlReader reader) - { - Aas.IHasDataSpecification? result = ( - DeserializeImplementation.IHasDataSpecificationFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of AdministrativeInformation from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of AdministrativeInformation. - /// - public static Aas.AdministrativeInformation AdministrativeInformationFrom( - Xml.XmlReader reader) - { - Aas.AdministrativeInformation? result = ( - DeserializeImplementation.AdministrativeInformationFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IQualifiable from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of IQualifiable. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IQualifiable IQualifiableFrom( - Xml.XmlReader reader) - { - Aas.IQualifiable? result = ( - DeserializeImplementation.IQualifiableFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Qualifier from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of Qualifier. - /// - public static Aas.Qualifier QualifierFrom( - Xml.XmlReader reader) - { - Aas.Qualifier? result = ( - DeserializeImplementation.QualifierFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of AssetAdministrationShell from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of AssetAdministrationShell. - /// - public static Aas.AssetAdministrationShell AssetAdministrationShellFrom( - Xml.XmlReader reader) - { - Aas.AssetAdministrationShell? result = ( - DeserializeImplementation.AssetAdministrationShellFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of AssetInformation from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of AssetInformation. - /// - public static Aas.AssetInformation AssetInformationFrom( - Xml.XmlReader reader) - { - Aas.AssetInformation? result = ( - DeserializeImplementation.AssetInformationFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Resource from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of Resource. - /// - public static Aas.Resource ResourceFrom( - Xml.XmlReader reader) - { - Aas.Resource? result = ( - DeserializeImplementation.ResourceFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of SpecificAssetId from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of SpecificAssetId. - /// - public static Aas.SpecificAssetId SpecificAssetIdFrom( - Xml.XmlReader reader) - { - Aas.SpecificAssetId? result = ( - DeserializeImplementation.SpecificAssetIdFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Submodel from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of Submodel. - /// - public static Aas.Submodel SubmodelFrom( - Xml.XmlReader reader) - { - Aas.Submodel? result = ( - DeserializeImplementation.SubmodelFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of ISubmodelElement from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of ISubmodelElement. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.ISubmodelElement ISubmodelElementFrom( - Xml.XmlReader reader) - { - Aas.ISubmodelElement? result = ( - DeserializeImplementation.ISubmodelElementFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IRelationshipElement from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of IRelationshipElement. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IRelationshipElement IRelationshipElementFrom( - Xml.XmlReader reader) - { - Aas.IRelationshipElement? result = ( - DeserializeImplementation.IRelationshipElementFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of RelationshipElement from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of RelationshipElement. - /// - public static Aas.RelationshipElement RelationshipElementFrom( - Xml.XmlReader reader) - { - Aas.RelationshipElement? result = ( - DeserializeImplementation.RelationshipElementFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of SubmodelElementList from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of SubmodelElementList. - /// - public static Aas.SubmodelElementList SubmodelElementListFrom( - Xml.XmlReader reader) - { - Aas.SubmodelElementList? result = ( - DeserializeImplementation.SubmodelElementListFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of SubmodelElementCollection from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of SubmodelElementCollection. - /// - public static Aas.SubmodelElementCollection SubmodelElementCollectionFrom( - Xml.XmlReader reader) - { - Aas.SubmodelElementCollection? result = ( - DeserializeImplementation.SubmodelElementCollectionFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IDataElement from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of IDataElement. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IDataElement IDataElementFrom( - Xml.XmlReader reader) - { - Aas.IDataElement? result = ( - DeserializeImplementation.IDataElementFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Property from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of Property. - /// - public static Aas.Property PropertyFrom( - Xml.XmlReader reader) - { - Aas.Property? result = ( - DeserializeImplementation.PropertyFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of MultiLanguageProperty from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of MultiLanguageProperty. - /// - public static Aas.MultiLanguageProperty MultiLanguagePropertyFrom( - Xml.XmlReader reader) - { - Aas.MultiLanguageProperty? result = ( - DeserializeImplementation.MultiLanguagePropertyFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Range from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of Range. - /// - public static Aas.Range RangeFrom( - Xml.XmlReader reader) - { - Aas.Range? result = ( - DeserializeImplementation.RangeFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of ReferenceElement from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of ReferenceElement. - /// - public static Aas.ReferenceElement ReferenceElementFrom( - Xml.XmlReader reader) - { - Aas.ReferenceElement? result = ( - DeserializeImplementation.ReferenceElementFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Blob from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of Blob. - /// - public static Aas.Blob BlobFrom( - Xml.XmlReader reader) - { - Aas.Blob? result = ( - DeserializeImplementation.BlobFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of File from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of File. - /// - public static Aas.File FileFrom( - Xml.XmlReader reader) - { - Aas.File? result = ( - DeserializeImplementation.FileFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of AnnotatedRelationshipElement from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of AnnotatedRelationshipElement. - /// - public static Aas.AnnotatedRelationshipElement AnnotatedRelationshipElementFrom( - Xml.XmlReader reader) - { - Aas.AnnotatedRelationshipElement? result = ( - DeserializeImplementation.AnnotatedRelationshipElementFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Entity from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of Entity. - /// - public static Aas.Entity EntityFrom( - Xml.XmlReader reader) - { - Aas.Entity? result = ( - DeserializeImplementation.EntityFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of EventPayload from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of EventPayload. - /// - public static Aas.EventPayload EventPayloadFrom( - Xml.XmlReader reader) - { - Aas.EventPayload? result = ( - DeserializeImplementation.EventPayloadFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IEventElement from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of IEventElement. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IEventElement IEventElementFrom( - Xml.XmlReader reader) - { - Aas.IEventElement? result = ( - DeserializeImplementation.IEventElementFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of BasicEventElement from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of BasicEventElement. - /// - public static Aas.BasicEventElement BasicEventElementFrom( - Xml.XmlReader reader) - { - Aas.BasicEventElement? result = ( - DeserializeImplementation.BasicEventElementFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Operation from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of Operation. - /// - public static Aas.Operation OperationFrom( - Xml.XmlReader reader) - { - Aas.Operation? result = ( - DeserializeImplementation.OperationFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of OperationVariable from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of OperationVariable. - /// - public static Aas.OperationVariable OperationVariableFrom( - Xml.XmlReader reader) - { - Aas.OperationVariable? result = ( - DeserializeImplementation.OperationVariableFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Capability from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of Capability. - /// - public static Aas.Capability CapabilityFrom( - Xml.XmlReader reader) - { - Aas.Capability? result = ( - DeserializeImplementation.CapabilityFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of ConceptDescription from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of ConceptDescription. - /// - public static Aas.ConceptDescription ConceptDescriptionFrom( - Xml.XmlReader reader) - { - Aas.ConceptDescription? result = ( - DeserializeImplementation.ConceptDescriptionFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Reference from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of Reference. - /// - public static Aas.Reference ReferenceFrom( - Xml.XmlReader reader) - { - Aas.Reference? result = ( - DeserializeImplementation.ReferenceFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Key from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of Key. - /// - public static Aas.Key KeyFrom( - Xml.XmlReader reader) - { - Aas.Key? result = ( - DeserializeImplementation.KeyFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IAbstractLangString from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of IAbstractLangString. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IAbstractLangString IAbstractLangStringFrom( - Xml.XmlReader reader) - { - Aas.IAbstractLangString? result = ( - DeserializeImplementation.IAbstractLangStringFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of LangStringNameType from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of LangStringNameType. - /// - public static Aas.LangStringNameType LangStringNameTypeFrom( - Xml.XmlReader reader) - { - Aas.LangStringNameType? result = ( - DeserializeImplementation.LangStringNameTypeFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of LangStringTextType from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of LangStringTextType. - /// - public static Aas.LangStringTextType LangStringTextTypeFrom( - Xml.XmlReader reader) - { - Aas.LangStringTextType? result = ( - DeserializeImplementation.LangStringTextTypeFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of Environment from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of Environment. - /// - public static Aas.Environment EnvironmentFrom( - Xml.XmlReader reader) - { - Aas.Environment? result = ( - DeserializeImplementation.EnvironmentFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of IDataSpecificationContent from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of IDataSpecificationContent. - /// - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - public static Aas.IDataSpecificationContent IDataSpecificationContentFrom( - Xml.XmlReader reader) - { - Aas.IDataSpecificationContent? result = ( - DeserializeImplementation.IDataSpecificationContentFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of EmbeddedDataSpecification from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of EmbeddedDataSpecification. - /// - public static Aas.EmbeddedDataSpecification EmbeddedDataSpecificationFrom( - Xml.XmlReader reader) - { - Aas.EmbeddedDataSpecification? result = ( - DeserializeImplementation.EmbeddedDataSpecificationFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of LevelType from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of LevelType. - /// - public static Aas.LevelType LevelTypeFrom( - Xml.XmlReader reader) - { - Aas.LevelType? result = ( - DeserializeImplementation.LevelTypeFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of ValueReferencePair from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of ValueReferencePair. - /// - public static Aas.ValueReferencePair ValueReferencePairFrom( - Xml.XmlReader reader) - { - Aas.ValueReferencePair? result = ( - DeserializeImplementation.ValueReferencePairFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of ValueList from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of ValueList. - /// - public static Aas.ValueList ValueListFrom( - Xml.XmlReader reader) - { - Aas.ValueList? result = ( - DeserializeImplementation.ValueListFromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of LangStringPreferredNameTypeIec61360 from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of LangStringPreferredNameTypeIec61360. - /// - public static Aas.LangStringPreferredNameTypeIec61360 LangStringPreferredNameTypeIec61360From( - Xml.XmlReader reader) - { - Aas.LangStringPreferredNameTypeIec61360? result = ( - DeserializeImplementation.LangStringPreferredNameTypeIec61360FromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of LangStringShortNameTypeIec61360 from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of LangStringShortNameTypeIec61360. - /// - public static Aas.LangStringShortNameTypeIec61360 LangStringShortNameTypeIec61360From( - Xml.XmlReader reader) - { - Aas.LangStringShortNameTypeIec61360? result = ( - DeserializeImplementation.LangStringShortNameTypeIec61360FromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of LangStringDefinitionTypeIec61360 from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of LangStringDefinitionTypeIec61360. - /// - public static Aas.LangStringDefinitionTypeIec61360 LangStringDefinitionTypeIec61360From( - Xml.XmlReader reader) - { - Aas.LangStringDefinitionTypeIec61360? result = ( - DeserializeImplementation.LangStringDefinitionTypeIec61360FromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - - /// - /// Deserialize an instance of DataSpecificationIec61360 from . - /// - /// Initialized XML reader with cursor set to the element - /// - /// Thrown when the element is not a valid XML - /// representation of DataSpecificationIec61360. - /// - public static Aas.DataSpecificationIec61360 DataSpecificationIec61360From( - Xml.XmlReader reader) - { - Aas.DataSpecificationIec61360? result = ( - DeserializeImplementation.DataSpecificationIec61360FromElement( - reader, - out Reporting.Error? error)); - if (error != null) - { - throw new Xmlization.Exception( - Reporting.GenerateRelativeXPath(error.PathSegments), - error.Cause); - } - return result - ?? throw new System.InvalidOperationException( - "Unexpected output null when error is null"); - } - } // public static class Deserialize - - /// - /// Serialize recursively the instances as XML elements. - /// - internal class VisitorWithWriter - : Visitation.AbstractVisitorWithContext - { - private void ExtensionToSequence( - Aas.IExtension that, - Xml.XmlWriter writer) - { - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "name", - NS); - - writer.WriteValue( - that.Name); - - writer.WriteEndElement(); - - if (that.ValueType != null) - { - writer.WriteStartElement( - "valueType", - NS); - - string? textValueType = Stringification.ToString( - that.ValueType); - writer.WriteValue( - textValueType - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration DataTypeDefXsd: " + - that.ValueType.ToString())); - - writer.WriteEndElement(); - } - - if (that.Value != null) - { - writer.WriteStartElement( - "value", - NS); - - writer.WriteValue( - that.Value); - - writer.WriteEndElement(); - } - - if (that.RefersTo != null) - { - writer.WriteStartElement( - "refersTo", - NS); - - foreach (var item in that.RefersTo) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - } // private void ExtensionToSequence - - public override void VisitExtension( - Aas.IExtension that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "extension", - NS); - this.ExtensionToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void AdministrativeInformationToSequence( - Aas.IAdministrativeInformation that, - Xml.XmlWriter writer) - { - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Version != null) - { - writer.WriteStartElement( - "version", - NS); - - writer.WriteValue( - that.Version); - - writer.WriteEndElement(); - } - - if (that.Revision != null) - { - writer.WriteStartElement( - "revision", - NS); - - writer.WriteValue( - that.Revision); - - writer.WriteEndElement(); - } - - if (that.Creator != null) - { - writer.WriteStartElement( - "creator", - NS); - - this.ReferenceToSequence( - that.Creator, - writer); - - writer.WriteEndElement(); - } - - if (that.TemplateId != null) - { - writer.WriteStartElement( - "templateId", - NS); - - writer.WriteValue( - that.TemplateId); - - writer.WriteEndElement(); - } - } // private void AdministrativeInformationToSequence - - public override void VisitAdministrativeInformation( - Aas.IAdministrativeInformation that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "administrativeInformation", - NS); - this.AdministrativeInformationToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void QualifierToSequence( - Aas.IQualifier that, - Xml.XmlWriter writer) - { - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Kind != null) - { - writer.WriteStartElement( - "kind", - NS); - - string? textKind = Stringification.ToString( - that.Kind); - writer.WriteValue( - textKind - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration QualifierKind: " + - that.Kind.ToString())); - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "type", - NS); - - writer.WriteValue( - that.Type); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "valueType", - NS); - - string? textValueType = Stringification.ToString( - that.ValueType); - writer.WriteValue( - textValueType - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration DataTypeDefXsd: " + - that.ValueType.ToString())); - - writer.WriteEndElement(); - - if (that.Value != null) - { - writer.WriteStartElement( - "value", - NS); - - writer.WriteValue( - that.Value); - - writer.WriteEndElement(); - } - - if (that.ValueId != null) - { - writer.WriteStartElement( - "valueId", - NS); - - this.ReferenceToSequence( - that.ValueId, - writer); - - writer.WriteEndElement(); - } - } // private void QualifierToSequence - - public override void VisitQualifier( - Aas.IQualifier that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "qualifier", - NS); - this.QualifierToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void AssetAdministrationShellToSequence( - Aas.IAssetAdministrationShell that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Administration != null) - { - writer.WriteStartElement( - "administration", - NS); - - this.AdministrativeInformationToSequence( - that.Administration, - writer); - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "id", - NS); - - writer.WriteValue( - that.Id); - - writer.WriteEndElement(); - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.DerivedFrom != null) - { - writer.WriteStartElement( - "derivedFrom", - NS); - - this.ReferenceToSequence( - that.DerivedFrom, - writer); - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "assetInformation", - NS); - - this.AssetInformationToSequence( - that.AssetInformation, - writer); - - writer.WriteEndElement(); - - if (that.Submodels != null) - { - writer.WriteStartElement( - "submodels", - NS); - - foreach (var item in that.Submodels) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - } // private void AssetAdministrationShellToSequence - - public override void VisitAssetAdministrationShell( - Aas.IAssetAdministrationShell that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "assetAdministrationShell", - NS); - this.AssetAdministrationShellToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void AssetInformationToSequence( - Aas.IAssetInformation that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "assetKind", - NS); - - string? textAssetKind = Stringification.ToString( - that.AssetKind); - writer.WriteValue( - textAssetKind - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration AssetKind: " + - that.AssetKind.ToString())); - - writer.WriteEndElement(); - - if (that.GlobalAssetId != null) - { - writer.WriteStartElement( - "globalAssetId", - NS); - - writer.WriteValue( - that.GlobalAssetId); - - writer.WriteEndElement(); - } - - if (that.SpecificAssetIds != null) - { - writer.WriteStartElement( - "specificAssetIds", - NS); - - foreach (var item in that.SpecificAssetIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.AssetType != null) - { - writer.WriteStartElement( - "assetType", - NS); - - writer.WriteValue( - that.AssetType); - - writer.WriteEndElement(); - } - - if (that.DefaultThumbnail != null) - { - writer.WriteStartElement( - "defaultThumbnail", - NS); - - this.ResourceToSequence( - that.DefaultThumbnail, - writer); - - writer.WriteEndElement(); - } - } // private void AssetInformationToSequence - - public override void VisitAssetInformation( - Aas.IAssetInformation that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "assetInformation", - NS); - this.AssetInformationToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void ResourceToSequence( - Aas.IResource that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "path", - NS); - - writer.WriteValue( - that.Path); - - writer.WriteEndElement(); - - if (that.ContentType != null) - { - writer.WriteStartElement( - "contentType", - NS); - - writer.WriteValue( - that.ContentType); - - writer.WriteEndElement(); - } - } // private void ResourceToSequence - - public override void VisitResource( - Aas.IResource that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "resource", - NS); - this.ResourceToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void SpecificAssetIdToSequence( - Aas.ISpecificAssetId that, - Xml.XmlWriter writer) - { - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "name", - NS); - - writer.WriteValue( - that.Name); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "value", - NS); - - writer.WriteValue( - that.Value); - - writer.WriteEndElement(); - - if (that.ExternalSubjectId != null) - { - writer.WriteStartElement( - "externalSubjectId", - NS); - - this.ReferenceToSequence( - that.ExternalSubjectId, - writer); - - writer.WriteEndElement(); - } - } // private void SpecificAssetIdToSequence - - public override void VisitSpecificAssetId( - Aas.ISpecificAssetId that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "specificAssetId", - NS); - this.SpecificAssetIdToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void SubmodelToSequence( - Aas.ISubmodel that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Administration != null) - { - writer.WriteStartElement( - "administration", - NS); - - this.AdministrativeInformationToSequence( - that.Administration, - writer); - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "id", - NS); - - writer.WriteValue( - that.Id); - - writer.WriteEndElement(); - - if (that.Kind != null) - { - writer.WriteStartElement( - "kind", - NS); - - string? textKind = Stringification.ToString( - that.Kind); - writer.WriteValue( - textKind - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration ModellingKind: " + - that.Kind.ToString())); - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SubmodelElements != null) - { - writer.WriteStartElement( - "submodelElements", - NS); - - foreach (var item in that.SubmodelElements) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - } // private void SubmodelToSequence - - public override void VisitSubmodel( - Aas.ISubmodel that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "submodel", - NS); - this.SubmodelToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void RelationshipElementToSequence( - Aas.IRelationshipElement that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "first", - NS); - - this.ReferenceToSequence( - that.First, - writer); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "second", - NS); - - this.ReferenceToSequence( - that.Second, - writer); - - writer.WriteEndElement(); - } // private void RelationshipElementToSequence - - public override void VisitRelationshipElement( - Aas.IRelationshipElement that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "relationshipElement", - NS); - this.RelationshipElementToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void SubmodelElementListToSequence( - Aas.ISubmodelElementList that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.OrderRelevant.HasValue) - { - writer.WriteStartElement( - "orderRelevant", - NS); - - writer.WriteValue( - that.OrderRelevant.Value); - - writer.WriteEndElement(); - } - - if (that.SemanticIdListElement != null) - { - writer.WriteStartElement( - "semanticIdListElement", - NS); - - this.ReferenceToSequence( - that.SemanticIdListElement, - writer); - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "typeValueListElement", - NS); - - string? textTypeValueListElement = Stringification.ToString( - that.TypeValueListElement); - writer.WriteValue( - textTypeValueListElement - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration AasSubmodelElements: " + - that.TypeValueListElement.ToString())); - - writer.WriteEndElement(); - - if (that.ValueTypeListElement != null) - { - writer.WriteStartElement( - "valueTypeListElement", - NS); - - string? textValueTypeListElement = Stringification.ToString( - that.ValueTypeListElement); - writer.WriteValue( - textValueTypeListElement - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration DataTypeDefXsd: " + - that.ValueTypeListElement.ToString())); - - writer.WriteEndElement(); - } - - if (that.Value != null) - { - writer.WriteStartElement( - "value", - NS); - - foreach (var item in that.Value) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - } // private void SubmodelElementListToSequence - - public override void VisitSubmodelElementList( - Aas.ISubmodelElementList that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "submodelElementList", - NS); - this.SubmodelElementListToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void SubmodelElementCollectionToSequence( - Aas.ISubmodelElementCollection that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Value != null) - { - writer.WriteStartElement( - "value", - NS); - - foreach (var item in that.Value) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - } // private void SubmodelElementCollectionToSequence - - public override void VisitSubmodelElementCollection( - Aas.ISubmodelElementCollection that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "submodelElementCollection", - NS); - this.SubmodelElementCollectionToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void PropertyToSequence( - Aas.IProperty that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "valueType", - NS); - - string? textValueType = Stringification.ToString( - that.ValueType); - writer.WriteValue( - textValueType - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration DataTypeDefXsd: " + - that.ValueType.ToString())); - - writer.WriteEndElement(); - - if (that.Value != null) - { - writer.WriteStartElement( - "value", - NS); - - writer.WriteValue( - that.Value); - - writer.WriteEndElement(); - } - - if (that.ValueId != null) - { - writer.WriteStartElement( - "valueId", - NS); - - this.ReferenceToSequence( - that.ValueId, - writer); - - writer.WriteEndElement(); - } - } // private void PropertyToSequence - - public override void VisitProperty( - Aas.IProperty that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "property", - NS); - this.PropertyToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void MultiLanguagePropertyToSequence( - Aas.IMultiLanguageProperty that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Value != null) - { - writer.WriteStartElement( - "value", - NS); - - foreach (var item in that.Value) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.ValueId != null) - { - writer.WriteStartElement( - "valueId", - NS); - - this.ReferenceToSequence( - that.ValueId, - writer); - - writer.WriteEndElement(); - } - } // private void MultiLanguagePropertyToSequence - - public override void VisitMultiLanguageProperty( - Aas.IMultiLanguageProperty that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "multiLanguageProperty", - NS); - this.MultiLanguagePropertyToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void RangeToSequence( - Aas.IRange that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "valueType", - NS); - - string? textValueType = Stringification.ToString( - that.ValueType); - writer.WriteValue( - textValueType - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration DataTypeDefXsd: " + - that.ValueType.ToString())); - - writer.WriteEndElement(); - - if (that.Min != null) - { - writer.WriteStartElement( - "min", - NS); - - writer.WriteValue( - that.Min); - - writer.WriteEndElement(); - } - - if (that.Max != null) - { - writer.WriteStartElement( - "max", - NS); - - writer.WriteValue( - that.Max); - - writer.WriteEndElement(); - } - } // private void RangeToSequence - - public override void VisitRange( - Aas.IRange that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "range", - NS); - this.RangeToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void ReferenceElementToSequence( - Aas.IReferenceElement that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Value != null) - { - writer.WriteStartElement( - "value", - NS); - - this.ReferenceToSequence( - that.Value, - writer); - - writer.WriteEndElement(); - } - } // private void ReferenceElementToSequence - - public override void VisitReferenceElement( - Aas.IReferenceElement that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "referenceElement", - NS); - this.ReferenceElementToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void BlobToSequence( - Aas.IBlob that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Value != null) - { - writer.WriteStartElement( - "value", - NS); - - writer.WriteBase64( - that.Value, - 0, - that.Value.Length); - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "contentType", - NS); - - writer.WriteValue( - that.ContentType); - - writer.WriteEndElement(); - } // private void BlobToSequence - - public override void VisitBlob( - Aas.IBlob that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "blob", - NS); - this.BlobToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void FileToSequence( - Aas.IFile that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Value != null) - { - writer.WriteStartElement( - "value", - NS); - - writer.WriteValue( - that.Value); - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "contentType", - NS); - - writer.WriteValue( - that.ContentType); - - writer.WriteEndElement(); - } // private void FileToSequence - - public override void VisitFile( - Aas.IFile that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "file", - NS); - this.FileToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void AnnotatedRelationshipElementToSequence( - Aas.IAnnotatedRelationshipElement that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "first", - NS); - - this.ReferenceToSequence( - that.First, - writer); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "second", - NS); - - this.ReferenceToSequence( - that.Second, - writer); - - writer.WriteEndElement(); - - if (that.Annotations != null) - { - writer.WriteStartElement( - "annotations", - NS); - - foreach (var item in that.Annotations) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - } // private void AnnotatedRelationshipElementToSequence - - public override void VisitAnnotatedRelationshipElement( - Aas.IAnnotatedRelationshipElement that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "annotatedRelationshipElement", - NS); - this.AnnotatedRelationshipElementToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void EntityToSequence( - Aas.IEntity that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Statements != null) - { - writer.WriteStartElement( - "statements", - NS); - - foreach (var item in that.Statements) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "entityType", - NS); - - string? textEntityType = Stringification.ToString( - that.EntityType); - writer.WriteValue( - textEntityType - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration EntityType: " + - that.EntityType.ToString())); - - writer.WriteEndElement(); - - if (that.GlobalAssetId != null) - { - writer.WriteStartElement( - "globalAssetId", - NS); - - writer.WriteValue( - that.GlobalAssetId); - - writer.WriteEndElement(); - } - - if (that.SpecificAssetIds != null) - { - writer.WriteStartElement( - "specificAssetIds", - NS); - - foreach (var item in that.SpecificAssetIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - } // private void EntityToSequence - - public override void VisitEntity( - Aas.IEntity that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "entity", - NS); - this.EntityToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void EventPayloadToSequence( - Aas.IEventPayload that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "source", - NS); - - this.ReferenceToSequence( - that.Source, - writer); - - writer.WriteEndElement(); - - if (that.SourceSemanticId != null) - { - writer.WriteStartElement( - "sourceSemanticId", - NS); - - this.ReferenceToSequence( - that.SourceSemanticId, - writer); - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "observableReference", - NS); - - this.ReferenceToSequence( - that.ObservableReference, - writer); - - writer.WriteEndElement(); - - if (that.ObservableSemanticId != null) - { - writer.WriteStartElement( - "observableSemanticId", - NS); - - this.ReferenceToSequence( - that.ObservableSemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.Topic != null) - { - writer.WriteStartElement( - "topic", - NS); - - writer.WriteValue( - that.Topic); - - writer.WriteEndElement(); - } - - if (that.SubjectId != null) - { - writer.WriteStartElement( - "subjectId", - NS); - - this.ReferenceToSequence( - that.SubjectId, - writer); - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "timeStamp", - NS); - - writer.WriteValue( - that.TimeStamp); - - writer.WriteEndElement(); - - if (that.Payload != null) - { - writer.WriteStartElement( - "payload", - NS); - - writer.WriteBase64( - that.Payload, - 0, - that.Payload.Length); - - writer.WriteEndElement(); - } - } // private void EventPayloadToSequence - - public override void VisitEventPayload( - Aas.IEventPayload that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "eventPayload", - NS); - this.EventPayloadToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void BasicEventElementToSequence( - Aas.IBasicEventElement that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "observed", - NS); - - this.ReferenceToSequence( - that.Observed, - writer); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "direction", - NS); - - string? textDirection = Stringification.ToString( - that.Direction); - writer.WriteValue( - textDirection - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration Direction: " + - that.Direction.ToString())); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "state", - NS); - - string? textState = Stringification.ToString( - that.State); - writer.WriteValue( - textState - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration StateOfEvent: " + - that.State.ToString())); - - writer.WriteEndElement(); - - if (that.MessageTopic != null) - { - writer.WriteStartElement( - "messageTopic", - NS); - - writer.WriteValue( - that.MessageTopic); - - writer.WriteEndElement(); - } - - if (that.MessageBroker != null) - { - writer.WriteStartElement( - "messageBroker", - NS); - - this.ReferenceToSequence( - that.MessageBroker, - writer); - - writer.WriteEndElement(); - } - - if (that.LastUpdate != null) - { - writer.WriteStartElement( - "lastUpdate", - NS); - - writer.WriteValue( - that.LastUpdate); - - writer.WriteEndElement(); - } - - if (that.MinInterval != null) - { - writer.WriteStartElement( - "minInterval", - NS); - - writer.WriteValue( - that.MinInterval); - - writer.WriteEndElement(); - } - - if (that.MaxInterval != null) - { - writer.WriteStartElement( - "maxInterval", - NS); - - writer.WriteValue( - that.MaxInterval); - - writer.WriteEndElement(); - } - } // private void BasicEventElementToSequence - - public override void VisitBasicEventElement( - Aas.IBasicEventElement that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "basicEventElement", - NS); - this.BasicEventElementToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void OperationToSequence( - Aas.IOperation that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.InputVariables != null) - { - writer.WriteStartElement( - "inputVariables", - NS); - - foreach (var item in that.InputVariables) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.OutputVariables != null) - { - writer.WriteStartElement( - "outputVariables", - NS); - - foreach (var item in that.OutputVariables) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.InoutputVariables != null) - { - writer.WriteStartElement( - "inoutputVariables", - NS); - - foreach (var item in that.InoutputVariables) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - } // private void OperationToSequence - - public override void VisitOperation( - Aas.IOperation that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "operation", - NS); - this.OperationToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void OperationVariableToSequence( - Aas.IOperationVariable that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "value", - NS); - - this.Visit( - that.Value, - writer); - - writer.WriteEndElement(); - } // private void OperationVariableToSequence - - public override void VisitOperationVariable( - Aas.IOperationVariable that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "operationVariable", - NS); - this.OperationVariableToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void CapabilityToSequence( - Aas.ICapability that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.SemanticId != null) - { - writer.WriteStartElement( - "semanticId", - NS); - - this.ReferenceToSequence( - that.SemanticId, - writer); - - writer.WriteEndElement(); - } - - if (that.SupplementalSemanticIds != null) - { - writer.WriteStartElement( - "supplementalSemanticIds", - NS); - - foreach (var item in that.SupplementalSemanticIds) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Qualifiers != null) - { - writer.WriteStartElement( - "qualifiers", - NS); - - foreach (var item in that.Qualifiers) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - } // private void CapabilityToSequence - - public override void VisitCapability( - Aas.ICapability that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "capability", - NS); - this.CapabilityToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void ConceptDescriptionToSequence( - Aas.IConceptDescription that, - Xml.XmlWriter writer) - { - if (that.Extensions != null) - { - writer.WriteStartElement( - "extensions", - NS); - - foreach (var item in that.Extensions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Category != null) - { - writer.WriteStartElement( - "category", - NS); - - writer.WriteValue( - that.Category); - - writer.WriteEndElement(); - } - - if (that.IdShort != null) - { - writer.WriteStartElement( - "idShort", - NS); - - writer.WriteValue( - that.IdShort); - - writer.WriteEndElement(); - } - - if (that.DisplayName != null) - { - writer.WriteStartElement( - "displayName", - NS); - - foreach (var item in that.DisplayName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Description != null) - { - writer.WriteStartElement( - "description", - NS); - - foreach (var item in that.Description) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Administration != null) - { - writer.WriteStartElement( - "administration", - NS); - - this.AdministrativeInformationToSequence( - that.Administration, - writer); - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "id", - NS); - - writer.WriteValue( - that.Id); - - writer.WriteEndElement(); - - if (that.EmbeddedDataSpecifications != null) - { - writer.WriteStartElement( - "embeddedDataSpecifications", - NS); - - foreach (var item in that.EmbeddedDataSpecifications) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.IsCaseOf != null) - { - writer.WriteStartElement( - "isCaseOf", - NS); - - foreach (var item in that.IsCaseOf) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - } // private void ConceptDescriptionToSequence - - public override void VisitConceptDescription( - Aas.IConceptDescription that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "conceptDescription", - NS); - this.ConceptDescriptionToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void ReferenceToSequence( - Aas.IReference that, - Xml.XmlWriter writer) - { - if (that == null) - { - return; - } - writer.WriteStartElement( - "type", - NS); - - string? textType = Stringification.ToString( - that.Type); - writer.WriteValue( - textType - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration ReferenceTypes: " + - that.Type.ToString())); - - writer.WriteEndElement(); - - if (that.ReferredSemanticId != null) - { - writer.WriteStartElement( - "referredSemanticId", - NS); - - this.ReferenceToSequence( - that.ReferredSemanticId, - writer); - - writer.WriteEndElement(); - } - - writer.WriteStartElement( - "keys", - NS); - - foreach (var item in that.Keys) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } // private void ReferenceToSequence - - public override void VisitReference( - Aas.IReference that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "reference", - NS); - this.ReferenceToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void KeyToSequence( - Aas.IKey that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "type", - NS); - - string? textType = Stringification.ToString( - that.Type); - writer.WriteValue( - textType - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration KeyTypes: " + - that.Type.ToString())); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "value", - NS); - - writer.WriteValue( - that.Value); - - writer.WriteEndElement(); - } // private void KeyToSequence - - public override void VisitKey( - Aas.IKey that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "key", - NS); - this.KeyToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void LangStringNameTypeToSequence( - Aas.ILangStringNameType that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "language", - NS); - - writer.WriteValue( - that.Language); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "text", - NS); - - writer.WriteValue( - that.Text); - - writer.WriteEndElement(); - } // private void LangStringNameTypeToSequence - - public override void VisitLangStringNameType( - Aas.ILangStringNameType that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "langStringNameType", - NS); - this.LangStringNameTypeToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void LangStringTextTypeToSequence( - Aas.ILangStringTextType that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "language", - NS); - - writer.WriteValue( - that.Language); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "text", - NS); - - writer.WriteValue( - that.Text); - - writer.WriteEndElement(); - } // private void LangStringTextTypeToSequence - - public override void VisitLangStringTextType( - Aas.ILangStringTextType that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "langStringTextType", - NS); - this.LangStringTextTypeToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void EnvironmentToSequence( - Aas.IEnvironment that, - Xml.XmlWriter writer) - { - if (that.AssetAdministrationShells != null) - { - writer.WriteStartElement( - "assetAdministrationShells", - NS); - - foreach (var item in that.AssetAdministrationShells) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Submodels != null) - { - writer.WriteStartElement( - "submodels", - NS); - - foreach (var item in that.Submodels) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.ConceptDescriptions != null) - { - writer.WriteStartElement( - "conceptDescriptions", - NS); - - foreach (var item in that.ConceptDescriptions) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - } // private void EnvironmentToSequence - - public override void VisitEnvironment( - Aas.IEnvironment that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "environment", - NS); - this.EnvironmentToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void EmbeddedDataSpecificationToSequence( - Aas.IEmbeddedDataSpecification that, - Xml.XmlWriter writer) - { - if (that.DataSpecification != null) - { - writer.WriteStartElement( - "dataSpecification", - NS); - - this.ReferenceToSequence( - that.DataSpecification, - writer); - - writer.WriteEndElement(); - } - - if (that.DataSpecificationContent != null) - { - writer.WriteStartElement( - "dataSpecificationContent", - NS); - - this.Visit( - that.DataSpecificationContent, - writer); - - writer.WriteEndElement(); - } - - } // private void EmbeddedDataSpecificationToSequence - - public override void VisitEmbeddedDataSpecification( - Aas.IEmbeddedDataSpecification that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "embeddedDataSpecification", - NS); - this.EmbeddedDataSpecificationToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void LevelTypeToSequence( - Aas.ILevelType that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "min", - NS); - - writer.WriteValue( - that.Min); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "nom", - NS); - - writer.WriteValue( - that.Nom); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "typ", - NS); - - writer.WriteValue( - that.Typ); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "max", - NS); - - writer.WriteValue( - that.Max); - - writer.WriteEndElement(); - } // private void LevelTypeToSequence - - public override void VisitLevelType( - Aas.ILevelType that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "levelType", - NS); - this.LevelTypeToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void ValueReferencePairToSequence( - Aas.IValueReferencePair that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "value", - NS); - - writer.WriteValue( - that.Value); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "valueId", - NS); - - this.ReferenceToSequence( - that.ValueId, - writer); - - writer.WriteEndElement(); - } // private void ValueReferencePairToSequence - - public override void VisitValueReferencePair( - Aas.IValueReferencePair that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "valueReferencePair", - NS); - this.ValueReferencePairToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void ValueListToSequence( - Aas.IValueList that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "valueReferencePairs", - NS); - - foreach (var item in that.ValueReferencePairs) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } // private void ValueListToSequence - - public override void VisitValueList( - Aas.IValueList that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "valueList", - NS); - this.ValueListToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void LangStringPreferredNameTypeIec61360ToSequence( - Aas.ILangStringPreferredNameTypeIec61360 that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "language", - NS); - - writer.WriteValue( - that.Language); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "text", - NS); - - writer.WriteValue( - that.Text); - - writer.WriteEndElement(); - } // private void LangStringPreferredNameTypeIec61360ToSequence - - public override void VisitLangStringPreferredNameTypeIec61360( - Aas.ILangStringPreferredNameTypeIec61360 that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "langStringPreferredNameTypeIec61360", - NS); - this.LangStringPreferredNameTypeIec61360ToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void LangStringShortNameTypeIec61360ToSequence( - Aas.ILangStringShortNameTypeIec61360 that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "language", - NS); - - writer.WriteValue( - that.Language); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "text", - NS); - - writer.WriteValue( - that.Text); - - writer.WriteEndElement(); - } // private void LangStringShortNameTypeIec61360ToSequence - - public override void VisitLangStringShortNameTypeIec61360( - Aas.ILangStringShortNameTypeIec61360 that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "langStringShortNameTypeIec61360", - NS); - this.LangStringShortNameTypeIec61360ToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void LangStringDefinitionTypeIec61360ToSequence( - Aas.ILangStringDefinitionTypeIec61360 that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "language", - NS); - - writer.WriteValue( - that.Language); - - writer.WriteEndElement(); - - writer.WriteStartElement( - "text", - NS); - - writer.WriteValue( - that.Text); - - writer.WriteEndElement(); - } // private void LangStringDefinitionTypeIec61360ToSequence - - public override void VisitLangStringDefinitionTypeIec61360( - Aas.ILangStringDefinitionTypeIec61360 that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "langStringDefinitionTypeIec61360", - NS); - this.LangStringDefinitionTypeIec61360ToSequence( - that, - writer); - writer.WriteEndElement(); - } - - private void DataSpecificationIec61360ToSequence( - Aas.IDataSpecificationIec61360 that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "preferredName", - NS); - - foreach (var item in that.PreferredName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - - if (that.ShortName != null) - { - writer.WriteStartElement( - "shortName", - NS); - - foreach (var item in that.ShortName) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.Unit != null) - { - writer.WriteStartElement( - "unit", - NS); - - writer.WriteValue( - that.Unit); - - writer.WriteEndElement(); - } - - if (that.UnitId != null) - { - writer.WriteStartElement( - "unitId", - NS); - - this.ReferenceToSequence( - that.UnitId, - writer); - - writer.WriteEndElement(); - } - - if (that.SourceOfDefinition != null) - { - writer.WriteStartElement( - "sourceOfDefinition", - NS); - - writer.WriteValue( - that.SourceOfDefinition); - - writer.WriteEndElement(); - } - - if (that.Symbol != null) - { - writer.WriteStartElement( - "symbol", - NS); - - writer.WriteValue( - that.Symbol); - - writer.WriteEndElement(); - } - - if (that.DataType != null) - { - writer.WriteStartElement( - "dataType", - NS); - - string? textDataType = Stringification.ToString( - that.DataType); - writer.WriteValue( - textDataType - ?? throw new System.ArgumentException( - "Invalid literal for the enumeration DataTypeIec61360: " + - that.DataType.ToString())); - - writer.WriteEndElement(); - } - - if (that.Definition != null) - { - writer.WriteStartElement( - "definition", - NS); - - foreach (var item in that.Definition) - { - this.Visit( - item, - writer); - } - - writer.WriteEndElement(); - } - - if (that.ValueFormat != null) - { - writer.WriteStartElement( - "valueFormat", - NS); - - writer.WriteValue( - that.ValueFormat); - - writer.WriteEndElement(); - } - - if (that.ValueList != null) - { - writer.WriteStartElement( - "valueList", - NS); - - this.ValueListToSequence( - that.ValueList, - writer); - - writer.WriteEndElement(); - } - - if (that.Value != null) - { - writer.WriteStartElement( - "value", - NS); - - writer.WriteValue( - that.Value); - - writer.WriteEndElement(); - } - - if (that.LevelType != null) - { - writer.WriteStartElement( - "levelType", - NS); - - this.LevelTypeToSequence( - that.LevelType, - writer); - - writer.WriteEndElement(); - } - } // private void DataSpecificationIec61360ToSequence - - public override void VisitDataSpecificationIec61360( - Aas.IDataSpecificationIec61360 that, - Xml.XmlWriter writer) - { - writer.WriteStartElement( - "dataSpecificationIec61360", - NS); - this.DataSpecificationIec61360ToSequence( - that, - writer); - writer.WriteEndElement(); - } - } // internal class VisitorWithWriter - - /// - /// Serialize instances of meta-model classes to XML. - /// - /// - /// Here is an example how to serialize an instance of IHasSemantics: - /// - /// var anInstance = new Aas.IHasSemantics( - /// /* ... some constructor arguments ... */ - /// ); - /// var writer = new System.Xml.XmlWriter( /* some arguments */ ); - /// Serialize.To( - /// anInstance, - /// writer); - /// - /// - public static class Serialize - { - [CodeAnalysis.SuppressMessage("ReSharper", "InconsistentNaming")] - private static readonly VisitorWithWriter _visitorWithWriter = ( - new VisitorWithWriter()); - - /// - /// Serialize an instance of the meta-model to XML. - /// - public static void To( - Aas.IClass that, - Xml.XmlWriter writer) - { - Serialize._visitorWithWriter.Visit( - that, writer); - } - } // public static class Serialize - } // public static class Xmlization -} // namespace AasCore.Aas3_0 - -/* - * This code has been automatically generated by aas-core-codegen. - * Do NOT edit or append. - */ diff --git a/src/AasxAmlImExport/AasxAmlImExport.csproj b/src/AasxAmlImExport/AasxAmlImExport.csproj index 24af1f382..056ab9daa 100644 --- a/src/AasxAmlImExport/AasxAmlImExport.csproj +++ b/src/AasxAmlImExport/AasxAmlImExport.csproj @@ -6,7 +6,7 @@ false - + diff --git a/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V10/AdminShellV10.cs b/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V10/AdminShellV10.cs deleted file mode 100644 index 18999575b..000000000 --- a/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V10/AdminShellV10.cs +++ /dev/null @@ -1,4653 +0,0 @@ -/* -Copyright (c) 2018-2021 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.IO; -using System.IO.Packaging; -using System.Runtime; -using System.Text; -using System.Text.RegularExpressions; -using System.Xml; -using System.Xml.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -// ReSharper disable All .. as this is legacy code! - -#if !DoNotUseAasxCompatibilityModels - -namespace AasxCompatibilityModels -{ - #region Utils - // - // Utils - // - - public class AdminShellUtilV10 - { - public static string EvalToNonNullString(string fmt, object o, string elseString = "") - { - if (o == null) - return elseString; - return string.Format(fmt, o); - } - - public static string EvalToNonEmptyString(string fmt, string o, string elseString = "") - { - if (o == "") - return elseString; - return string.Format(fmt, o); - } - - public static string FilterFriendlyName(string src) - { - if (src == null) - return null; - return Regex.Replace(src, @"[^a-zA-Z0-9\-_]", "_"); - } - - public static bool HasWhitespace(string src) - { - if (src == null) - throw new ArgumentNullException(nameof(src)); - for (var i = 0; i < src.Length; i++) - foreach (var c in src) - if (char.IsWhiteSpace(c)) - return true; - return false; - } - - public static bool ComplyIdShort(string src) - { - if (src == null) - throw new ArgumentNullException(nameof(src)); - var res = true; - foreach (var c in src) - if (!Char.IsLetterOrDigit(c) && c != '_') - res = false; - if (src.Length > 0 && !Char.IsLetter(src[0])) - res = false; - return res; - } - - public static string ShortLocation(Exception ex) - { - if (ex == null || ex.StackTrace == null) - return ""; - string[] lines = ex.StackTrace.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None); - if (lines.Length < 1) - return ""; - // search for " in " - // as the most actual stacktrace might be a built-in function, this might not work and therefore - // go down in the stack - int currLine = 0; - while (true) - { - // nothing found at all - if (currLine >= lines.Length) - return ""; - // access current line - var p = lines[currLine].IndexOf(" in ", StringComparison.Ordinal); - if (p < 0) - { - // advance to next oldest line - currLine++; - continue; - } - // search last "\" or "/", to get only filename portion and position - p = lines[currLine].LastIndexOfAny(new[] { '\\', '/' }); - if (p < 0) - { - // advance to next oldest line - currLine++; - continue; - } - // return this - return lines[currLine].Substring(p); - } - } - - } - - #endregion - - - #region AdminShell_V1_0 - - /// - /// Version of Details of Administration Shell Part 1 V1.0 published Nov/Dec/Jan 2018/19 - /// - public class AdminShellV10 - { - - public class Identification - { - - // members - - [XmlAttribute] - public string idType = ""; - [XmlText] - public string id = ""; - - // constructors - - public Identification() { } - - public Identification(string idType, string id) - { - this.idType = idType; - this.id = id; - } - - public Identification(Identification src) - { - this.idType = src.idType; - this.id = src.id; - } - - // Creator with validation - - public static Identification CreateNew(string idType, string id) - { - if (idType == null || id == null) - return null; - var found = false; - foreach (var x in Key.IdentifierTypeNames) - found = found || idType.ToLower().Trim() == x.ToLower().Trim(); - if (!found) - return null; - return new Identification(idType, id); - } - - // further - - public bool IsEqual(Identification other) - { - return (this.idType.Trim().ToLower() == other.idType.Trim().ToLower() - && this.id.Trim().ToLower() == other.id.Trim().ToLower()); - } - - public override string ToString() - { - return $"[{this.idType}] {this.id}"; - } - } - - public class Administration - { - - // members - - public string version = ""; - public string revision = ""; - - // constructors - - public Administration() { } - - public Administration(Administration src) - { - this.version = src.version; - this.revision = src.revision; - } - - public Administration(string version, string revision) - { - this.version = version; - this.revision = revision; - } - - public override string ToString() - { - return $"R={this.version}, V={this.revision}"; - } - } - - public class Key - { - [XmlAttribute] - public string type = ""; - [XmlAttribute] - public bool local = false; - - [XmlAttribute] - [JsonIgnore] - public string idType = ""; - [XmlIgnore] - [JsonProperty(PropertyName = "idType")] - public string JsonIdType - { - get { return (idType == "idShort") ? "IdShort" : idType; } - set { if (value == "IdShort") idType = "idShort"; else idType = value; } - } - - [XmlText] - public string value = ""; - - [XmlIgnore] - [JsonProperty(PropertyName = "index")] - public int index = 0; - - public Key() - { - } - - public Key(Key src) - { - this.type = src.type; - this.local = src.local; - this.idType = src.idType; - this.value = src.value; - } - - public Key(string type, bool local, string idType, string value) - { - this.type = type; - this.local = local; - this.idType = idType; - this.value = value; - } - - public static Key CreateNew(string type, bool local, string idType, string value) - { - var k = new Key(); - k.type = type; - k.local = local; - k.idType = idType; - k.value = value; - return (k); - } - - public static Key GetFromRef(Reference r) - { - if (r == null || r.Count != 1) - return null; - return r[0]; - } - - public override string ToString() - { - var local = (this.local) ? "Local" : "not Local"; - return $"[{this.type}, {local}, {this.idType}, {this.value}]"; - } - - public static string KeyListToString(List keys) - { - if (keys == null || keys.Count < 1) - return ""; - // normally, exactly one key - if (keys.Count == 1) - return keys[0].ToString(); - // multiple! - var s = "[ "; - foreach (var k in keys) - { - if (s.Length > 0) - s += ", "; - s += k.ToString(); - } - return s + " ]"; - } - - public static string[] KeyElements = new string[] { - "GlobalReference", - "AccessPermissionRule", - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel", - "SubmodelRef", // not completely right, but used by Package Explorer - "Blob", - "ConceptDictionary", - "DataElement", - "File", - "Event", - "Operation", - "OperationVariable", - "Property", - "ReferenceElement", - "RelationshipElement", - "SubmodelElement", - "SubmodelElementCollection", - "View" }; - - public static string[] ReferableElements = new string[] { - "AccessPermissionRule", - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel", - "Blob", - "ConceptDictionary", - "DataElement", - "File", - "Event", - "Operation", - "OperationVariable", - "Property", - "ReferenceElement", - "RelationshipElement", - "SubmodelElement", - "SubmodelElementCollection", - "View" - }; - - public static string[] SubmodelElements = new string[] { - "DataElement", - "File", - "Event", - "Operation", - "Property", - "ReferenceElement", - "RelationshipElement", - "SubmodelElementCollection"}; - - public static string[] IdentifiableElements = new string[] { - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel" }; - - // use this in list to designate all of the above elements - public static string AllElements = "All"; - - // use this in list to designate the GlobalReference - public static string GlobalReference = "GlobalReference"; - public static string ConceptDescription = "ConceptDescription"; - public static string SubmodelRef = "SubmodelRef"; - public static string Submodel = "Submodel"; - public static string Asset = "Asset"; - public static string AAS = "AssetAdministrationShell"; - - public static string[] IdentifierTypeNames = new string[] { "IdShort", "Custom", "IRDI", "URI" }; - - public enum IdentifierType { IdShort = 0, Custom, IRDI, URI }; - - public static string GetIdentifierTypeName(IdentifierType t) - { - return IdentifierTypeNames[(int)t]; - } - - // some helpers - - public static bool IsInKeyElements(string ke) - { - var res = false; - foreach (var s in KeyElements) - if (s.Trim().ToLower() == ke.Trim().ToLower()) - res = true; - return res; - } - - } - - // the whole class shall not be serialized by having it private - public class KeyList - { - // members - - [XmlIgnore] // anyway, as it is privat - private List key = new List(); - - // getters / setters - - [XmlIgnore] - public List Keys { get { return key; } } - [XmlIgnore] - public bool IsEmpty { get { return key == null || key.Count < 1; } } - [XmlIgnore] - public int Count { get { if (key == null) return 0; return key.Count; } } - [XmlIgnore] - public Key this[int index] { get { return key[index]; } } - - // constructors / creators - - public void Add(Key k) - { - key.Add(k); - } - - public static KeyList CreateNew(Key k) - { - var kl = new KeyList(); - kl.Add(k); - return kl; - } - - public static KeyList CreateNew(string type, bool local, string idType, string value) - { - var kl = new KeyList(); - kl.Add(Key.CreateNew(type, local, idType, value)); - return kl; - } - - // other - - public void NumberIndices() - { - if (this.Keys == null) - return; - for (int i = 0; i < this.Keys.Count; i++) - this.Keys[i].index = i; - } - } - - [XmlType(TypeName = "reference")] - public class Reference - { - - // members - - [XmlIgnore] // anyway, as it is privat - [JsonIgnore] - private KeyList keys = new KeyList(); - - // getters / setters - - [XmlArray("keys")] - [XmlArrayItem("key")] - [JsonIgnore] - public List Keys { get { return keys?.Keys; } } - [XmlIgnore] - [JsonProperty(PropertyName = "keys")] - public List JsonKeys - { - get - { - keys?.NumberIndices(); - return keys.Keys; - } - } - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return keys == null || keys.Count < 1; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (keys == null) return 0; return keys.Count; } } - [XmlIgnore] - [JsonIgnore] - public Key this[int index] { get { return keys[index]; } } - - // constructors / creators - - public Reference() - { - } - - public Reference(Key k) - { - if (k != null) - keys.Keys.Add(k); - } - - public Reference(Reference src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(new Key(k)); - } - - public Reference(SemanticId src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(new Key(k)); - } - - public static Reference CreateNew(Key k) - { - if (k == null) - return null; - var r = new Reference(); - r.keys.Keys.Add(k); - return r; - } - - public static Reference CreateNew(List k) - { - if (k == null) - return null; - var r = new Reference(); - r.keys.Keys.AddRange(k); - return r; - } - - public static Reference CreateNew(string type, bool local, string idType, string value) - { - if (type == null || idType == null || value == null) - return null; - var r = new Reference(); - r.keys.Keys.Add(Key.CreateNew(type, local, idType, value)); - return r; - } - - public static Reference CreateIrdiReference(string irdi) - { - if (irdi == null) - return null; - var r = new Reference(); - r.keys.Keys.Add(new Key(Key.GlobalReference, false, "IRDI", irdi)); - return r; - } - - // further - - public bool IsExactlyOneKey(string type, bool local, string idType, string id) - { - if (keys == null || keys.Keys == null || keys.Count != 1) - return false; - var k = keys.Keys[0]; - return k.type == type && k.local == local && k.idType == idType && k.value == id; - } - - public bool MatchesTo(Identification other) - { - return (this.keys != null && this.keys.Count == 1 - && this.keys[0].idType.Trim().ToLower() == other.idType.Trim().ToLower() - && this.keys[0].value.Trim().ToLower() == other.id.Trim().ToLower()); - } - - public bool MatchesTo(Reference other) - { - if (this.keys == null || other == null || other.keys == null || other.Count != this.Count) - return false; - - var same = true; - for (int i = 0; i < this.Count; i++) - same = same - && this.keys[i].type.Trim().ToLower() == other.keys[i].type.Trim().ToLower() - && this.keys[i].local == other.keys[i].local - && this.keys[i].idType.Trim().ToLower() == other.keys[i].idType.Trim().ToLower() - && this.keys[i].value.Trim().ToLower() == other.keys[i].value.Trim().ToLower(); - - return same; - } - - public override string ToString() - { - var res = ""; - if (keys != null && keys.Keys != null) - foreach (var k in keys.Keys) - res += k.ToString() + ","; - return res.TrimEnd(','); - } - - public string ListOfValues(string delim) - { - string res = ""; - if (this.Keys != null) - foreach (var x in this.Keys) - { - if (x == null) - continue; - if (res != "") res += delim; - res += x.value; - } - return res; - } - - public virtual string GetElementName() - { - return "Reference"; - } - } - - [XmlType(TypeName = "derivedFrom")] - public class AssetAdministrationShellRef : Reference - { - // constructors - - public AssetAdministrationShellRef() : base() { } - - public AssetAdministrationShellRef(Key k) : base(k) { } - - public AssetAdministrationShellRef(Reference src) : base(src) { } - - // further methods - - public override string GetElementName() - { - return "AssetAdministrationShellRef"; - } - } - - [XmlType(TypeName = "assetRef")] - public class AssetRef : Reference - { - // constructors - - public AssetRef() : base() { } - - public AssetRef(AssetRef src) : base(src) { } - - // translation - - public static AssetRef CreateNew(Reference r) - { - return (AssetRef)new Reference(r); - } - - // further methods - - public override string GetElementName() - { - return "AssetRef"; - } - } - - [XmlType(TypeName = "submodelRef")] - public class SubmodelRef : Reference - { - // constructors - - public SubmodelRef() : base() { } - - public SubmodelRef(SubmodelRef src) : base(src) { } - - public static new SubmodelRef CreateNew(string type, bool local, string idType, string value) - { - var r = new SubmodelRef(); - r.Keys.Add(Key.CreateNew(type, local, idType, value)); - return r; - } - - public static SubmodelRef CreateNew(Reference src) - { - if (src == null || src.Keys == null) - return null; - var r = new SubmodelRef(); - r.Keys.AddRange(src.Keys); - return r; - } - - // further methods - - public override string GetElementName() - { - return "SubmodelRef"; - } - } - - [XmlType(TypeName = "conceptDescriptionRef")] - public class ConceptDescriptionRef : Reference - { - // constructors - - public ConceptDescriptionRef() : base() { } - - public ConceptDescriptionRef(ConceptDescriptionRef src) : base(src) { } - - // further methods - - public new static ConceptDescriptionRef CreateNew(string type, bool local, string idType, string value) - { - var r = new ConceptDescriptionRef(); - r.Keys.Add(Key.CreateNew(type, local, idType, value)); - return r; - } - - public override string GetElementName() - { - return "ConceptDescriptionRef"; - } - } - - [XmlType(TypeName = "dataSpecificationRef")] - public class DataSpecificationRef : Reference - { - // constructors - - public DataSpecificationRef() : base() { } - - public DataSpecificationRef(DataSpecificationRef src) : base(src) { } - - // further methods - - public static DataSpecificationRef CreateNew(Reference src) - { - if (src == null || src.Keys == null) - return null; - var res = new DataSpecificationRef(); - foreach (var k in src.Keys) - res.Keys.Add(new Key(k)); - return res; - } - - public override string GetElementName() - { - return "DataSpecificationRef"; - } - } - - [XmlType(TypeName = "conceptDescriptions")] - public class ConceptDescriptionRefs - { - [XmlElement(ElementName = "conceptDescriptionRef")] - public List conceptDescriptions = new List(); - - // constructors - - public ConceptDescriptionRefs() { } - - public ConceptDescriptionRefs(ConceptDescriptionRefs src) - { - if (src.conceptDescriptions != null) - foreach (var cdr in src.conceptDescriptions) - this.conceptDescriptions.Add(new ConceptDescriptionRef(cdr)); - } - } - - [XmlType(TypeName = "containedElementRef")] - public class ContainedElementRef : Reference - { - // constructors - - public ContainedElementRef() { } - public ContainedElementRef(ContainedElementRef src) : base(src) { } - - public static ContainedElementRef CreateNew(Reference src) - { - if (src == null || src.Keys == null) - return null; - var r = new ContainedElementRef(); - r.Keys.AddRange(src.Keys); - return r; - } - - // further methods - - public override string GetElementName() - { - return "ContainedElementRef"; - } - } - - [XmlType(TypeName = "hasDataSpecification")] - public class HasDataSpecification - { - [XmlElement(ElementName = "reference")] // make "reference" go away by magic?! - public List reference = new List(); - - public HasDataSpecification() { } - - public HasDataSpecification(HasDataSpecification src) - { - foreach (var r in src.reference) - reference.Add(new Reference(r)); - } - } - - [XmlType(TypeName = "ContainedElements")] - public class ContainedElements - { - - // members - - [XmlElement(ElementName = "containedElementRef")] // make "reference" go away by magic?! - public List reference = new List(); - - // getter / setter - - public bool IsEmpty { get { return reference == null || reference.Count < 1; } } - public int Count { get { if (reference == null) return 0; return reference.Count; } } - public ContainedElementRef this[int index] { get { return reference[index]; } } - - // Creators - - public ContainedElements() { } - - public ContainedElements(ContainedElements src) - { - if (src.reference != null) - foreach (var r in src.reference) - this.reference.Add(new ContainedElementRef(r)); - } - - public static ContainedElements CreateOrSetInner(ContainedElements outer, ContainedElementRef[] inner) - { - var res = outer; - if (res == null) - res = new ContainedElements(); - if (inner == null) - { - res.reference = null; - return res; - } - res.reference = new List(inner); - return res; - } - - } - - [XmlType(TypeName = "langString", Namespace = "http://www.admin-shell.io/1/0")] - public class LangStr - { - - // members - - [XmlAttribute(Namespace = "http://www.admin-shell.io/1/0")] - [JsonProperty(PropertyName = "language")] - public string lang = ""; - [XmlText] - [JsonProperty(PropertyName = "text")] - public string str = ""; - - // constructors - - public LangStr() { } - - public LangStr(LangStr src) - { - this.lang = src.lang; - this.str = src.str; - } - - public static LangStr CreateNew(string lang, string str) - { - var l = new LangStr(); - l.lang = lang; - l.str = str; - return (l); - } - - public static List CreateManyFromStringArray(string[] s) - { - var r = new List(); - var i = 0; - while ((i + 1) < s.Length) - { - r.Add(LangStr.CreateNew(s[i], s[i + 1])); - i += 2; - } - return r; - } - } - - public class Description - { - - // members - - [XmlElement(ElementName = "langString")] - public List langString = new List(); - - // constructors - - public Description() { } - - public Description(Description src) - { - if (src != null) - foreach (var ls in src.langString) - langString.Add(new LangStr(ls)); - } - } - - public class Kind - { - [XmlText] - public string kind = "Instance"; - - // getters / setters - - [XmlIgnore] - [JsonIgnore] - public bool IsInstance { get { return kind == null || kind.Trim().ToLower() == "instance"; } } - - [XmlIgnore] - [JsonIgnore] - public bool IsType { get { return kind != null && kind.Trim().ToLower() == "type"; } } - - // constructors / creators - - public Kind() { } - - public Kind(Kind src) - { - kind = src.kind; - } - - public Kind(string kind) - { - this.kind = kind; - } - - public static Kind CreateFrom(Kind k) - { - var res = new Kind(); - res.kind = k.kind; - return res; - } - - public static Kind CreateAsType() - { - var res = new Kind(); - res.kind = "Type"; - return res; - } - - public static Kind CreateAsInstance() - { - var res = new Kind(); - res.kind = "Instance"; - return res; - } - } - - public class SemanticId - { - - // members - - [XmlIgnore] - [JsonIgnore] - private KeyList keys = new KeyList(); - - // getters / setters - - [XmlArray("keys")] - [XmlArrayItem("key")] - [JsonIgnore] - public List Keys { get { return keys?.Keys; } } - [XmlIgnore] - [JsonProperty(PropertyName = "keys")] - public List JsonKeys - { - get - { - keys?.NumberIndices(); - return keys.Keys; - } - } - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return keys == null || keys.IsEmpty; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (keys == null) return 0; return keys.Count; } } - [XmlIgnore] - [JsonIgnore] - public Key this[int index] { get { return keys[index]; } } - - public override string ToString() - { - return Key.KeyListToString(keys.Keys); - } - - // constructors / creators - - public SemanticId() - { - } - - public SemanticId(SemanticId src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(k); - } - - public static SemanticId CreateFromKey(Key key) - { - if (key == null) - return null; - var res = new SemanticId(); - res.Keys.Add(key); - return res; - } - - public static SemanticId CreateFromKeys(List keys) - { - if (keys == null) - return null; - var res = new SemanticId(); - res.Keys.AddRange(keys); - return res; - } - - // matching - - public bool Matches(string type, bool local, string idType, string value) - { - if (this.Count == 1 - && this.keys[0].type.ToLower().Trim() == type.ToLower().Trim() - && this.keys[0].local == local - && this.keys[0].idType.ToLower().Trim() == idType.ToLower().Trim() - && this.keys[0].value.ToLower().Trim() == value.ToLower().Trim()) - return true; - return false; - } - } - - public class Referable - { - - // members - - public string idShort = null; - public string category = null; - - [XmlElement(ElementName = "description")] - [JsonIgnore] - public Description description = null; - [XmlIgnore] - [JsonProperty(PropertyName = "descriptions")] - public List JsonDescription - { - get - { - if (description == null) - return null; - return description.langString; - } - set - { - if (description == null) - description = new Description(); - description.langString = value; - } - } - - [XmlIgnore] - [JsonIgnore] - public Referable parent = null; - - public static string[] ReferableCategoryNames = new string[] { "CONSTANT", "PARAMETER", "VARIABLE" }; - - // constructors - - public Referable() { } - - public Referable(Referable src) - { - this.idShort = src.idShort; - this.category = src.category; - if (src.description != null) - this.description = new Description(src.description); - } - - public void AddDescription(string lang, string str) - { - if (description == null) - description = new Description(); - description.langString.Add(LangStr.CreateNew(lang, str)); - } - - public virtual string GetElementName() - { - return "GlobalReference"; // not correct, but this method wasn't overridden correctly - } - - public string GetFriendlyName() - { - return AdminShellUtilV10.FilterFriendlyName(this.idShort); - } - - public void CollectReferencesByParent(List refs) - { - // check, if this is identifiable - if (this is Identifiable) - { - var idf = this as Identifiable; - var k = Key.CreateNew( - idf.GetElementName(), true, idf.identification.idType, idf.identification.id); - refs.Insert(0, k); - } - else - { - var k = Key.CreateNew(this.GetElementName(), true, "idShort", this.idShort); - refs.Insert(0, k); - // recurse upwards! - if (parent != null && parent is Referable) - (this.parent).CollectReferencesByParent(refs); - } - } - - public string CollectIdShortByParent() - { - // recurse first - var head = ""; - if (!(this is Identifiable) && this.parent != null && this.parent is Referable) - // can go up - head = this.parent.CollectIdShortByParent() + "/"; - // add own - var myid = ""; - if (this.idShort != null && this.idShort.Trim() != "") - myid = this.idShort.Trim(); - // together - return head + myid; - } - } - - public class Identifiable : Referable - { - - // members - - public Identification identification = new Identification(); - public Administration administration = null; - - // constructors - - public Identifiable() : base() { } - - public Identifiable(Identifiable src) - : base(src) - { - if (src.identification != null) - this.identification = new Identification(src.identification); - if (src.administration != null) - this.administration = new Administration(src.administration); - } - - public void SetIdentification(string idType, string id, string idShort = null) - { - identification.idType = idType; - identification.id = id; - if (idShort != null) - this.idShort = idShort; - } - - public void SetAdminstration(string version, string revision) - { - if (administration == null) - administration = new Administration(); - administration.version = version; - administration.revision = revision; - } - - public new string GetFriendlyName() - { - if (identification != null && identification.id != "") - return AdminShellUtilV10.FilterFriendlyName(this.identification.id); - return AdminShellUtilV10.FilterFriendlyName(this.idShort); - } - - } - - public class JsonModelTypeWrapper - { - public string name = ""; - - public JsonModelTypeWrapper(string name = "") { this.name = name; } - } - - public class AdministrationShell : Identifiable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // from hasDataSpecification: - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // from this very class - public AssetAdministrationShellRef derivedFrom = null; - - [JsonProperty(PropertyName = "asset")] - public AssetRef assetRef = new AssetRef(); - - [JsonProperty(PropertyName = "submodels")] - public List submodelRefs = new List(); - - [JsonIgnore] - public Views views = null; - [XmlIgnore] - [JsonProperty(PropertyName = "views")] - public View[] JsonViews - { - get { return views?.views.ToArray(); } - set { views = Views.CreateOrSetInnerViews(views, value); } - } - - [JsonProperty(PropertyName = "conceptDictionaries")] - public List conceptDictionaries = null; - - // constructurs - - public AdministrationShell() { } - - public AdministrationShell(AdministrationShell src) - : base(src) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - - if (src.derivedFrom != null) - this.derivedFrom = new AssetAdministrationShellRef(src.derivedFrom); - - if (src.assetRef != null) - this.assetRef = new AssetRef(src.assetRef); - - if (src.submodelRefs != null) - foreach (var smr in src.submodelRefs) - this.submodelRefs.Add(new SubmodelRef(smr)); - - if (src.views != null) - this.views = new Views(src.views); - - if (src.conceptDictionaries != null) - { - this.conceptDictionaries = new List(); - foreach (var cdd in src.conceptDictionaries) - this.conceptDictionaries.Add(new ConceptDictionary(cdd)); - } - } - - public static AdministrationShell CreateNew( - string idType, string id, string version = null, string revision = null) - { - var s = new AdministrationShell(); - s.identification.idType = idType; - s.identification.id = id; - if (version != null) - s.SetAdminstration(version, revision); - return (s); - } - - // add - - public void AddView(View v) - { - if (views == null) - views = new Views(); - views.views.Add(v); - } - - public void AddConceptDictionary(ConceptDictionary d) - { - if (conceptDictionaries == null) - conceptDictionaries = new List(); - conceptDictionaries.Add(d); - } - - public void AddDataSpecification(Key k) - { - if (hasDataSpecification == null) - hasDataSpecification = new HasDataSpecification(); - var r = new Reference(); - r.Keys.Add(k); - hasDataSpecification.reference.Add(r); - } - - public override string GetElementName() - { - return "AssetAdministrationShell"; - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV10.EvalToNonNullString("\"{0}\" ", idShort, "\"AAS\""); - if (administration != null) - caption += "V" + administration.version + "." + administration.revision; - - var info = ""; - if (identification != null) - info = $"[{identification.idType}, {identification.id}]"; - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - public SubmodelRef FindSubmodelRef(Identification refid) - { - if (this.submodelRefs == null) - return null; - foreach (var r in this.submodelRefs) - if (r.MatchesTo(refid)) - return r; - return null; - } - - public bool HasSubmodelRef(SubmodelRef newref) - { - // check, if existing - if (this.submodelRefs == null) - return false; - var found = false; - foreach (var r in this.submodelRefs) - if (r.MatchesTo(newref)) - found = true; - - return found; - } - - public void AddSubmodelRef(SubmodelRef newref) - { - if (this.submodelRefs == null) - this.submodelRefs = new List(); - this.submodelRefs.Add(newref); - } - } - - public class Asset : Identifiable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // from hasDataSpecification: - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - // from HasKind - [XmlElement(ElementName = "kind")] - [JsonIgnore] - public Kind kind = new Kind(); - [XmlIgnore] - [JsonProperty(PropertyName = "kind")] - public string JsonKind - { - get - { - if (kind == null) - return null; - return kind.kind; - } - set - { - if (kind == null) - kind = new Kind(); - kind.kind = value; - } - } - // from this very class - [XmlElement(ElementName = "assetIdentificationModelRef")] - public SubmodelRef assetIdentificationModelRef = null; - - // constructors - - public Asset() { } - - public Asset(Asset src) - : base(src) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.kind != null) - this.kind = new Kind(src.kind); - if (src.assetIdentificationModelRef != null) - this.assetIdentificationModelRef = new SubmodelRef(src.assetIdentificationModelRef); - } - - // Getter & setters - - public AssetRef GetReference() - { - var r = new AssetRef(); - r.Keys.Add( - Key.CreateNew(this.GetElementName(), true, this.identification.idType, this.identification.id)); - return r; - } - - public override string GetElementName() - { - return "Asset"; - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV10.EvalToNonNullString("\"{0}\" ", idShort, ""); - if (administration != null) - caption += "V" + administration.version + "." + administration.revision; - - var info = ""; - if (identification != null) - info = $"[{identification.idType}, {identification.id}]"; - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - } - - public class View : Referable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // from hasSemanticId: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = null; - // from hasDataSpecification - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // from this very class - [JsonIgnore] - public ContainedElements containedElements = null; - [XmlIgnore] - [JsonProperty(PropertyName = "containedElements")] - public ContainedElementRef[] JsonContainedElements - { - get { return containedElements?.reference.ToArray(); } - set { containedElements = ContainedElements.CreateOrSetInner(containedElements, value); } - } - - // getter / setter - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return containedElements == null || containedElements.Count < 1; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (containedElements == null) return 0; return containedElements.Count; } } - - public ContainedElementRef this[int index] - { - get - { - if ( -containedElements == null) return null; return containedElements[index]; - } - } - - // constructors / creators - - public View() { } - - public View(View src) - : base(src) - { - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.containedElements != null) - this.containedElements = new ContainedElements(src.containedElements); - } - - public static View CreateNew(string idShort) - { - var v = new View(); - v.idShort = idShort; - return (v); - } - - public void AddDataSpecification(Key k) - { - if (hasDataSpecification == null) - hasDataSpecification = new HasDataSpecification(); - var r = new Reference(); - r.Keys.Add(k); - hasDataSpecification.reference.Add(r); - } - - public void AddContainedElement(Key k) - { - if (containedElements == null) - containedElements = new ContainedElements(); - var r = new ContainedElementRef(); - r.Keys.Add(k); - containedElements.reference.Add(r); - } - - public void AddContainedElement(List keys) - { - if (containedElements == null) - containedElements = new ContainedElements(); - var r = new ContainedElementRef(); - foreach (var k in keys) - r.Keys.Add(k); - containedElements.reference.Add(r); - } - - public void AddContainedElement(Reference r) - { - if (containedElements == null) - containedElements = new ContainedElements(); - containedElements.reference.Add(ContainedElementRef.CreateNew(r)); - } - - public void AddContainedElement(List rlist) - { - if (containedElements == null) - containedElements = new ContainedElements(); - foreach (var r in rlist) - containedElements.reference.Add(ContainedElementRef.CreateNew(r)); - } - - public override string GetElementName() - { - return "View"; - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV10.EvalToNonNullString("\"{0}\" ", idShort, ""); - var info = ""; - if (this.semanticId != null) - info = Key.KeyListToString(this.semanticId.Keys); - if (this.containedElements != null && this.containedElements.reference != null) - info = - (info + " ").Trim() + String.Format("({0} elements)", this.containedElements.reference.Count); - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - } - - public class Views - { - [XmlElement(ElementName = "view")] - [JsonIgnore] - public List views = new List(); - - // constructors - - public Views() { } - - public Views(Views src) - { - if (src != null && src.views != null) - foreach (var v in src.views) - this.views.Add(new View(v)); - } - - public static Views CreateOrSetInnerViews(Views outer, View[] inner) - { - var res = outer; - if (res == null) - res = new Views(); - if (inner == null) - { - res.views = null; - return res; - } - res.views = new List(inner); - return res; - } - } - - public class LangStringIEC61360 - { - - // members - - [XmlElement(ElementName = "langString", Namespace = "http://www.admin-shell.io/aas/1/0")] - public List langString = new List(); - - // getters / setters - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return langString == null || langString.Count < 1; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (langString == null) return 0; return langString.Count; } } - [XmlIgnore] - [JsonIgnore] - public LangStr this[int index] { get { return langString[index]; } } - - // constructors - - public LangStringIEC61360() { } - - public LangStringIEC61360(LangStringIEC61360 src) - { - if (src.langString != null) - foreach (var ls in src.langString) - this.langString.Add(new LangStr(ls)); - } - - // converter - - public static LangStringIEC61360 CreateFrom(List src) - { - var res = new LangStringIEC61360(); - if (src != null) - foreach (var ls in src) - res.langString.Add(new LangStr(ls)); - return res; - } - - } - - public class UnitId - { - - // members - - [XmlIgnore] - [JsonIgnore] - public KeyList keys = new KeyList(); - - // getter / setters - - [XmlArray("keys")] - [XmlArrayItem("key")] - [JsonIgnore] - public List Keys { get { return keys?.Keys; } } - [XmlIgnore] - [JsonProperty(PropertyName = "keys")] - public List JsonKeys - { - get - { - keys?.NumberIndices(); - return keys.Keys; - } - } - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return keys == null || keys.IsEmpty; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (keys == null) return 0; return keys.Count; } } - [XmlIgnore] - [JsonIgnore] - public Key this[int index] { get { return keys.Keys[index]; } } - - // constructors / creators - - public UnitId() { } - - public UnitId(UnitId src) - { - if (src.keys != null) - foreach (var k in src.Keys) - this.keys.Add(new Key(k)); - } - - public static UnitId CreateNew(string type, bool local, string idType, string value) - { - var u = new UnitId(); - u.keys.Keys.Add(Key.CreateNew(type, local, idType, value)); - return u; - } - - public static UnitId CreateNew(Reference src) - { - var res = new UnitId(); - if (src != null && src.Keys != null) - foreach (var k in src.Keys) - res.keys.Add(k); - return res; - } - } - - [XmlRoot(Namespace = "http://www.admin-shell.io/IEC61360/1/0")] - public class DataSpecificationIEC61360 - { - // static member - [XmlIgnore] - [JsonIgnore] - public static string[] DataTypeNames = { - "STRING", - "STRING_TRANSLATABLE", - "REAL_MEASURE", - "REAL_COUNT", - "REAL_CURRENCY", - "INTEGER_MEASURE", - "INTEGER_COUNT", - "INTEGER_CURRENCY", - "BOOLEAN", - "URL", - "RATIONAL", - "RATIONAL_MEASURE", - "TIME", - "TIMESTAMP", - "DATE" }; - - // members - public LangStringIEC61360 preferredName = new LangStringIEC61360(); - public string shortName = ""; - public string unit = ""; - public UnitId unitId = null; - public string valueFormat = null; - public List sourceOfDefinition = new List(); - public string symbol = null; - public string dataType = ""; - public LangStringIEC61360 definition = new LangStringIEC61360(); - - // getter / setters - - // constructors - - public DataSpecificationIEC61360() { } - - public DataSpecificationIEC61360(DataSpecificationIEC61360 src) - { - if (src.preferredName != null) - this.preferredName = new LangStringIEC61360(src.preferredName); - this.shortName = src.shortName; - this.unit = src.unit; - if (src.unitId != null) - this.unitId = new UnitId(src.unitId); - this.valueFormat = src.valueFormat; - if (src.sourceOfDefinition != null) - foreach (var sod in src.sourceOfDefinition) - this.sourceOfDefinition.Add(sod); - this.symbol = src.symbol; - this.dataType = src.dataType; - if (src.definition != null) - this.definition = new LangStringIEC61360(src.definition); - } - - public static DataSpecificationIEC61360 CreateNew( - string[] preferredName = null, - string shortName = "", - string unit = "", - UnitId unitId = null, - string valueFormat = null, - string[] sourceOfDefinition = null, - string symbol = null, - string dataType = "", - string[] definition = null - ) - { - var d = new DataSpecificationIEC61360(); - if (preferredName != null) - d.preferredName.langString = LangStr.CreateManyFromStringArray(preferredName); - d.shortName = shortName; - d.unit = unit; - d.unitId = unitId; - d.valueFormat = valueFormat; - if (sourceOfDefinition != null) - d.sourceOfDefinition = LangStr.CreateManyFromStringArray(sourceOfDefinition); - d.symbol = symbol; - d.dataType = dataType; - if (definition != null) - d.definition.langString = LangStr.CreateManyFromStringArray(definition); - return (d); - } - } - - public class DataSpecificationISO99999 - { - } - - public class DataSpecificationContent - { - - // members - - public DataSpecificationIEC61360 dataSpecificationIEC61360 = new DataSpecificationIEC61360(); - public DataSpecificationISO99999 dataSpecificationISO99999 = null; - - // constructors - - public DataSpecificationContent() { } - - public DataSpecificationContent(DataSpecificationContent src) - { - if (src.dataSpecificationIEC61360 != null) - this.dataSpecificationIEC61360 = new DataSpecificationIEC61360(src.dataSpecificationIEC61360); - } - } - - public class EmbeddedDataSpecification - { - // members - - public DataSpecificationRef hasDataSpecification = new DataSpecificationRef(); - public DataSpecificationContent dataSpecificationContent = new DataSpecificationContent(); - - // constructors - - public EmbeddedDataSpecification() { } - - public EmbeddedDataSpecification(EmbeddedDataSpecification src) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new DataSpecificationRef(src.hasDataSpecification); - if (src.dataSpecificationContent != null) - this.dataSpecificationContent = new DataSpecificationContent(src.dataSpecificationContent); - } - } - - public class ConceptDescription : Identifiable, System.IDisposable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // do this in order to be IDisposable, that is: suitable for (using) - void System.IDisposable.Dispose() { } - public void GetData() { } - // from HasDataSpecification - // TODO (Michael Hoffmeister, 1970-01-01): in V1.0, shall be a list of embeddedDataSpecification - [XmlElement(ElementName = "embeddedDataSpecification")] - [JsonIgnore] - public EmbeddedDataSpecification embeddedDataSpecification = new EmbeddedDataSpecification(); - [XmlIgnore] - [JsonProperty(PropertyName = "embeddedDataSpecifications")] - public EmbeddedDataSpecification[] JsonEmbeddedDataSpecifications - { - get - { - if (embeddedDataSpecification == null) - return null; - return new EmbeddedDataSpecification[] { embeddedDataSpecification }; - } - set - { - if (value == null) - embeddedDataSpecification = null; - else - embeddedDataSpecification = value[0]; - } - } - - // this class - [XmlIgnore] - private List isCaseOf = null; - - // getter / setter - - [XmlElement(ElementName = "isCaseOf")] - [JsonProperty(PropertyName = "isCaseOf")] - public List IsCaseOf - { - get { return isCaseOf; } - set { isCaseOf = value; } - } - - // constructors / creators - - public ConceptDescription() : base() { } - - public ConceptDescription(ConceptDescription src) - : base(src) - { - if (src.embeddedDataSpecification != null) - this.embeddedDataSpecification = new EmbeddedDataSpecification(src.embeddedDataSpecification); - if (src.isCaseOf != null) - foreach (var ico in src.isCaseOf) - { - if (this.isCaseOf == null) - this.isCaseOf = new List(); - this.isCaseOf.Add(new Reference(ico)); - } - } - - public static ConceptDescription CreateNew( - string idType, string id, string version = null, string revision = null) - { - var cd = new ConceptDescription(); - cd.identification.idType = idType; - cd.identification.id = id; - if (version != null) - { - if (cd.administration == null) - cd.administration = new Administration(); - cd.administration.version = version; - cd.administration.revision = revision; - } - return (cd); - } - - public ConceptDescriptionRef GetReference() - { - var r = new ConceptDescriptionRef(); - r.Keys.Add( - Key.CreateNew(this.GetElementName(), true, this.identification.idType, this.identification.id)); - return r; - } - - public Key GetGlobalDataSpecRef() - { - if (embeddedDataSpecification.hasDataSpecification.Count != 1) - return null; - return (embeddedDataSpecification.hasDataSpecification[0]); - } - - public void SetIEC61360Spec( - string[] preferredNames = null, - string shortName = "", - string unit = "", - UnitId unitId = null, - string valueFormat = null, - string[] sourceOfDefinition = null, - string symbol = null, - string dataType = "", - string[] definition = null - ) - { - this.embeddedDataSpecification = new EmbeddedDataSpecification(); - this.embeddedDataSpecification.hasDataSpecification.Keys.Add( - Key.CreateNew("GlobalReference", false, "URI", - "www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360")); - this.embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360 = - AdminShellV10.DataSpecificationIEC61360.CreateNew( - preferredNames, shortName, unit, unitId, valueFormat, sourceOfDefinition, symbol, dataType, - definition); - this.AddIsCaseOf( - Reference.CreateNew(new Key( - "ConceptDescription", false, this.identification.idType, this.identification.id))); - } - - public DataSpecificationIEC61360 GetIEC61360() - { - if (embeddedDataSpecification != null && - embeddedDataSpecification.dataSpecificationContent != null && - embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360 != null) - return embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360; - return null; - } - - public string GetShortName() - { - if (embeddedDataSpecification != null && - embeddedDataSpecification.dataSpecificationContent != null && - embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360 != null) - return embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360.shortName; - return ""; - } - - public override string GetElementName() - { - return "ConceptDescription"; - } - - public Tuple ToCaptionInfo() - { - var caption = ""; - if (this.idShort != null && this.idShort.Trim() != "") - caption = $"\"{this.idShort.Trim()}\""; - if (this.identification != null) - caption = (caption + " " + this.identification).Trim(); - - var info = ""; - if (embeddedDataSpecification != null && - embeddedDataSpecification.dataSpecificationContent != null && - embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360 != null) - info += embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360.shortName; - - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - public void AddIsCaseOf(Reference ico) - { - if (isCaseOf == null) - isCaseOf = new List(); - isCaseOf.Add(ico); - } - - public static IDisposable CreateNew() - { - throw new NotImplementedException(); - } - } - - public class ConceptDictionary : Referable - { - [XmlElement(ElementName = "conceptDescriptions")] - public ConceptDescriptionRefs conceptDescriptionsRefs = null; - - // constructors - - public ConceptDictionary() { } - - public ConceptDictionary(ConceptDictionary src) - { - if (src.conceptDescriptionsRefs != null) - this.conceptDescriptionsRefs = new ConceptDescriptionRefs(src.conceptDescriptionsRefs); - } - - public static ConceptDictionary CreateNew(string idShort = null) - { - var d = new ConceptDictionary(); - if (idShort != null) - d.idShort = idShort; - return (d); - } - - // add - - public void AddReference(Reference r) - { - var cdr = (ConceptDescriptionRef)(ConceptDescriptionRef.CreateNew(r.Keys)); - if (conceptDescriptionsRefs == null) - conceptDescriptionsRefs = new ConceptDescriptionRefs(); - conceptDescriptionsRefs.conceptDescriptions.Add(cdr); - } - - public override string GetElementName() - { - return "ConceptDictionary"; - } - } - - [XmlRoot(ElementName = "aasenv", Namespace = "http://www.admin-shell.io/aas/1/0")] - public class AdministrationShellEnv - { - [XmlAttribute(Namespace = System.Xml.Schema.XmlSchema.InstanceNamespace)] - public string schemaLocation = - "http://www.admin-shell.io/aas/1/0 AAS.xsd http://www.admin-shell.io/IEC61360/1/0 IEC61360.xsd"; - - /// [XmlElement(ElementName="assetAdministrationShells")] - [XmlIgnore] // will be ignored, anyway - private List administrationShells = new List(); - [XmlIgnore] // will be ignored, anyway - private List assets = new List(); - [XmlIgnore] // will be ignored, anyway - private List submodels = new List(); - [XmlIgnore] // will be ignored, anyway - private List conceptDescriptions = new List(); - - // getter / setters - - [XmlArray("assetAdministrationShells")] - [XmlArrayItem("assetAdministrationShell")] - [JsonProperty(PropertyName = "assetAdministrationShells")] - public List AdministrationShells - { - get { return administrationShells; } - set { administrationShells = value; } - } - - [XmlArray("assets")] - [XmlArrayItem("asset")] - [JsonProperty(PropertyName = "assets")] - public List Assets - { - get { return assets; } - set { assets = value; } - } - - [XmlArray("submodels")] - [XmlArrayItem("submodel")] - [JsonProperty(PropertyName = "submodels")] - public List Submodels - { - get { return submodels; } - set { submodels = value; } - } - - [XmlArray("conceptDescriptions")] - [XmlArrayItem("conceptDescription")] - [JsonProperty(PropertyName = "conceptDescriptions")] - public List ConceptDescriptions - { - get { return conceptDescriptions; } - set { conceptDescriptions = value; } - } - - // finders - - public AdministrationShell FindAAS(Identification id) - { - if (id == null) - return null; - foreach (var aas in this.AdministrationShells) - if (aas.identification != null && aas.identification.IsEqual(id)) - return aas; - return null; - } - - public AdministrationShell FindAAS(string idShort) - { - if (idShort == null) - return null; - foreach (var aas in this.AdministrationShells) - if (aas.idShort != null && aas.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - return aas; - return null; - } - - public AdministrationShell FindAASwithSubmodel(Identification smid) - { - if (smid == null) - return null; - foreach (var aas in this.AdministrationShells) - if (aas.submodelRefs != null) - foreach (var smref in aas.submodelRefs) - if (smref.MatchesTo(smid)) - return aas; - return null; - } - - public Asset FindAsset(Identification id) - { - if (id == null) - return null; - foreach (var asset in this.Assets) - if (asset.identification != null && asset.identification.IsEqual(id)) - return asset; - return null; - } - - public Asset FindAsset(AssetRef aref) - { - // trivial - if (aref == null) - return null; - // can only refs with 1 key - if (aref.Count != 1) - return null; - // and we're picky - var key = aref[0]; - if (!key.local || key.type.ToLower().Trim() != "asset") - return null; - // brute force - foreach (var a in assets) - if (a.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && a.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return a; - // uups - return null; - } - - public Submodel FindSubmodel(Identification id) - { - if (id == null) - return null; - foreach (var sm in this.Submodels) - if (sm.identification != null && sm.identification.IsEqual(id)) - return sm; - return null; - } - - public Submodel FindSubmodel(SubmodelRef smref) - { - // trivial - if (smref == null) - return null; - // can only refs with 1 key - if (smref.Count != 1) - return null; - // and we're picky - var key = smref.Keys[0]; - if (!key.local || key.type.ToLower().Trim() != "submodel") - return null; - // brute force - foreach (var sm in this.Submodels) - if (sm.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && sm.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return sm; - // uups - return null; - } - - public Referable FindReferableByReference(Reference rf, int keyIndex = 0) - { - // first index needs to exist .. - if (rf == null || keyIndex >= rf.Count) - return null; - - // which type? - var firstType = rf[keyIndex].type.Trim().ToLower(); - var firstIdentification = new Identification(rf[keyIndex].idType, rf[keyIndex].value); - - if (firstType == Key.AAS.Trim().ToLower()) - return this.FindAAS(firstIdentification); - - if (firstType == Key.Asset.Trim().ToLower()) - return this.FindAsset(firstIdentification); - - if (firstType == Key.ConceptDescription.Trim().ToLower()) - return this.FindConceptDescription(firstIdentification); - - if (firstType == Key.Submodel.Trim().ToLower()) - { - // ok, search Submodel - var sm = this.FindSubmodel(new Identification(rf[keyIndex].idType, rf[keyIndex].value)); - if (sm == null) - return null; - - // at our end? - if (keyIndex >= rf.Count - 1) - return sm; - - // go inside - return SubmodelElementWrapper.FindReferableByReference(sm.submodelElements, rf, keyIndex + 1); - } - - // nothing in this Environment - return null; - } - - - public ConceptDescription FindConceptDescription(ConceptDescriptionRef cdr) - { - if (cdr == null) - return null; - return FindConceptDescription(cdr.Keys); - } - - public ConceptDescription FindConceptDescription(Identification id) - { - var cdr = ConceptDescriptionRef.CreateNew("Conceptdescription", true, id.idType, id.id); - return FindConceptDescription(cdr); - } - - public ConceptDescription FindConceptDescription(List keys) - { - // trivial - if (keys == null) - return null; - // can only refs with 1 key - if (keys.Count != 1) - return null; - // and we're picky - var key = keys[0]; - if (!key.local || key.type.ToLower().Trim() != "conceptdescription") - return null; - // brute force - foreach (var cd in conceptDescriptions) - if (cd.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && cd.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return cd; - // uups - return null; - } - - public ConceptDescription FindConceptDescription(Key key) - { - if (key == null) - return null; - var l = new List(); - l.Add(key); - return (FindConceptDescription(l)); - } - - // creators - - private void CopyConceptDescriptionsFrom( - AdministrationShellEnv srcEnv, SubmodelElement src, bool shallowCopy = false) - { - // access - if (srcEnv == null || src == null || src.semanticId == null) - return; - // check for this SubmodelElement in Source - var cdSrc = srcEnv.FindConceptDescription(src.semanticId.Keys); - if (cdSrc == null) - return; - // check for this SubmodelElement in Destnation (this!) - var cdDest = this.FindConceptDescription(src.semanticId.Keys); - if (cdDest != null) - return; - // copy new - this.ConceptDescriptions.Add(new ConceptDescription(cdSrc)); - // recurse? - if (!shallowCopy && src is SubmodelElementCollection) - foreach (var m in (src as SubmodelElementCollection).value) - CopyConceptDescriptionsFrom(srcEnv, m.submodelElement, shallowCopy); - - } - - public SubmodelElementWrapper CopySubmodelElementAndCD( - AdministrationShellEnv srcEnv, SubmodelElement srcElem, bool copyCD = false, bool shallowCopy = false) - { - // access - if (srcEnv == null || srcElem == null) - return null; - - // 1st result pretty easy (calling function will add this to the appropriate Submodel) - var res = new SubmodelElementWrapper(srcElem); - - // copy the CDs.. - if (copyCD) - CopyConceptDescriptionsFrom(srcEnv, srcElem, shallowCopy); - - // give back - return res; - } - - public SubmodelRef CopySubmodelRefAndCD( - AdministrationShellEnv srcEnv, SubmodelRef srcSubRef, bool copySubmodel = false, bool copyCD = false, - bool shallowCopy = false) - { - // access - if (srcEnv == null || srcSubRef == null) - return null; - - // need to have the source Submodel - var srcSub = srcEnv.FindSubmodel(srcSubRef); - if (srcSub == null) - return null; - - // 1st result pretty easy (calling function will add this to the appropriate AAS) - var dstSubRef = new SubmodelRef(srcSubRef); - - // get the destination and shall src != dst - var dstSub = this.FindSubmodel(dstSubRef); - if (srcSub == dstSub) - return null; - - // maybe we need the Submodel in our environment, as well - if (dstSub == null && copySubmodel) - { - dstSub = new Submodel(srcSub, shallowCopy); - this.Submodels.Add(dstSub); - } - else - { - // there is already an submodel, just add members - if (!shallowCopy && srcSub.submodelElements != null) - { - if (dstSub.submodelElements == null) - dstSub.submodelElements = new List(); - foreach (var smw in srcSub.submodelElements) - dstSub.submodelElements.Add(new SubmodelElementWrapper(smw.submodelElement, shallowCopy)); - } - } - - // copy the CDs.. - if (copyCD && srcSub.submodelElements != null) - foreach (var smw in srcSub.submodelElements) - CopyConceptDescriptionsFrom(srcEnv, smw.submodelElement, shallowCopy); - - // give back - return dstSubRef; - } - - // serializations - - public void SerializeXmlToStream(StreamWriter s) - { - var serializer = new XmlSerializer(typeof(AdminShellV10.AdministrationShellEnv)); - var nss = new XmlSerializerNamespaces(); - nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - nss.Add("aas", "http://www.admin-shell.io/aas/1/0"); - nss.Add("IEC61360", "http://www.admin-shell.io/IEC61360/1/0"); - serializer.Serialize(s, this, nss); - } - - public JsonWriter SerialiazeJsonToStream(StreamWriter sw, bool leaveJsonWriterOpen = false) - { - sw.AutoFlush = true; - - JsonSerializer serializer = new JsonSerializer(); - serializer.NullValueHandling = NullValueHandling.Ignore; - serializer.ReferenceLoopHandling = ReferenceLoopHandling.Serialize; - serializer.Formatting = Newtonsoft.Json.Formatting.Indented; - - JsonWriter writer = new JsonTextWriter(sw); - serializer.Serialize(writer, this); - if (leaveJsonWriterOpen) - return writer; - writer.Close(); - return null; - } - - public AdministrationShellEnv DeserializeFromXmlStream(TextReader reader) - { - XmlSerializer serializer = new XmlSerializer( - typeof(AdminShellV10.AdministrationShellEnv), "http://www.admin-shell.io/aas/1/0"); - var res = serializer.Deserialize(reader) as AdminShellV10.AdministrationShellEnv; - return res; - } - - public AdministrationShellEnv DeserializeFromJsonStream(TextReader reader) - { - JsonSerializer serializer = new JsonSerializer(); - serializer.Converters.Add(new AdminShellV10.JsonAasxConverter("modelType", "name")); - var res = (AdministrationShellEnv)serializer.Deserialize(reader, typeof(AdministrationShellEnv)); - return res; - } - - // special functions - - private static void CreateFromExistingEnvRecurseForCDs( - AdministrationShellEnv src, List wrappers, - ref List filterForCD) - { - if (wrappers == null || filterForCD == null) - return; - - foreach (var w in wrappers) - { - // include in filter .. - if (w.submodelElement.semanticId != null) - { - var cd = src.FindConceptDescription(w.submodelElement.semanticId.Keys); - if (cd != null) - filterForCD.Add(cd); - } - - // recurse? - if (w.submodelElement is SubmodelElementCollection) - CreateFromExistingEnvRecurseForCDs( - src, (w.submodelElement as SubmodelElementCollection).value, ref filterForCD); - - if (w.submodelElement is Operation) - for (int i = 0; i < 2; i++) - { - var w2s = Operation.GetWrappers((w.submodelElement as Operation)[i]); - CreateFromExistingEnvRecurseForCDs(src, w2s, ref filterForCD); - } - - } - } - - public static AdministrationShellEnv CreateFromExistingEnv(AdministrationShellEnv src, - List filterForAas = null, - List filterForAsset = null, - List filterForSubmodel = null, - List filterForCD = null) - { - // prepare defaults - if (filterForAas == null) - filterForAas = new List(); - if (filterForAsset == null) - filterForAsset = new List(); - if (filterForSubmodel == null) - filterForSubmodel = new List(); - if (filterForCD == null) - filterForCD = new List(); - - // make new - var res = new AdministrationShellEnv(); - - // take over AAS - foreach (var aas in src.administrationShells) - if (filterForAas.Contains(aas)) - { - // take over - res.administrationShells.Add(new AdministrationShell(aas)); - - // consequences - if (aas.assetRef != null) - { - var asset = src.FindAsset(aas.assetRef); - if (asset != null) - filterForAsset.Add(asset); - } - - if (aas.submodelRefs != null) - foreach (var smr in aas.submodelRefs) - { - var sm = src.FindSubmodel(smr); - if (sm != null) - filterForSubmodel.Add(sm); - } - - if (aas.conceptDictionaries != null) - foreach (var cdd in aas.conceptDictionaries) - if (cdd.conceptDescriptionsRefs != null && - cdd.conceptDescriptionsRefs.conceptDescriptions != null) - foreach (var cdr in cdd.conceptDescriptionsRefs.conceptDescriptions) - { - var cd = src.FindConceptDescription(cdr); - if (cd != null) - filterForCD.Add(cd); - } - } - - // take over Assets - foreach (var asset in src.assets) - if (filterForAsset.Contains(asset)) - { - // take over - res.assets.Add(new Asset(asset)); - } - - // take over Submodels - foreach (var sm in src.Submodels) - if (filterForSubmodel.Contains(sm)) - { - // take over - res.submodels.Add(new Submodel(sm)); - - // recursion in order to find used CDs - CreateFromExistingEnvRecurseForCDs(src, sm.submodelElements, ref filterForCD); - } - - // ConceptDescriptions - foreach (var cd in src.ConceptDescriptions) - if (filterForCD.Contains(cd)) - { - // take over - res.conceptDescriptions.Add(new ConceptDescription(cd)); - } - - // ok - return res; - } - } - - // - // Submodel + Submodel elements - // - - public interface IGetReference - { - Reference GetReference(); - } - - public class Qualifier - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // member - - // from hasSemantics: - [XmlElement(ElementName = "semanticId")] - // TODO (Michael Hoffmeister, 1970-01-01): Qualifiers not working! - // 190410: test-wise enable them again, everyhing works fine .. - public SemanticId semanticId = null; - - // this class - public string qualifierType = null; - public string qualifierValue = null; - public Reference qualifierValueId = null; - - // constructors - - public Qualifier() { } - - public Qualifier(Qualifier src) - { - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - this.qualifierType = src.qualifierType; - this.qualifierValue = src.qualifierValue; - if (src.qualifierValueId != null) - this.qualifierValueId = new Reference(src.qualifierValueId); - } - - public string GetElementName() - { - return "Qualifier"; - } - } - - public class SubmodelElement : Referable, System.IDisposable, IGetReference - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // do this in order to be IDisposable, that is: suitable for (using) - void System.IDisposable.Dispose() { } - public void GetData() { } - // from hasDataSpecification: - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - // from hasSemantics: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = null; - // from hasKind: - [XmlElement(ElementName = "kind")] - [JsonIgnore] - public Kind kind = null; - [XmlIgnore] - [JsonProperty(PropertyName = "kind")] - public string JsonKind - { - get - { - if (kind == null) - return null; - return kind.kind; - } - set - { - if (kind == null) - kind = new Kind(); - kind.kind = value; - } - } - // from Qualifiable: - [XmlArray("qualifier")] - [XmlArrayItem("qualifier")] - [JsonProperty(PropertyName = "constraints")] - public List qualifiers = null; - - // getter / setter - - // constructors / creators - - public SubmodelElement() - : base() { } - - public SubmodelElement(SubmodelElement src) - : base(src) - { - if (src.hasDataSpecification != null) - hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.semanticId != null) - semanticId = new SemanticId(src.semanticId); - if (src.kind != null) - kind = new Kind(src.kind); - if (src.qualifiers != null) - { - if (qualifiers == null) - qualifiers = new List(); - foreach (var q in src.qualifiers) - qualifiers.Add(new Qualifier(q)); - } - } - - public void CreateNewLogic(string idShort = null, string category = null, Key semanticIdKey = null) - { - if (idShort != null) - this.idShort = idShort; - if (category != null) - this.category = category; - if (semanticIdKey != null) - { - if (this.semanticId == null) - this.semanticId = new SemanticId(); - this.semanticId.Keys.Add(semanticIdKey); - } - } - - public void AddQualifier( - string qualifierType = null, string qualifierValue = null, KeyList semanticKeys = null, - Reference qualifierValueId = null) - { - if (this.qualifiers == null) - this.qualifiers = new List(); - var q = new Qualifier(); - q.qualifierType = qualifierType; - q.qualifierValue = qualifierValue; - q.qualifierValueId = qualifierValueId; - if (semanticKeys != null) - q.semanticId = SemanticId.CreateFromKeys(semanticKeys.Keys); - this.qualifiers.Add(q); - } - - public Qualifier HasQualifierOfType(string qualifierType) - { - if (this.qualifiers == null || qualifierType == null) - return null; - foreach (var q in this.qualifiers) - if (q.qualifierType.Trim().ToLower() == qualifierType.Trim().ToLower()) - return q; - return null; - } - - public override string GetElementName() - { - return "SubmodelElement"; - } - - public Reference GetReference() - { - Reference r = new Reference(); - // this is the tail of our referencing chain .. - r.Keys.Add(Key.CreateNew(GetElementName(), true, "idShort", this.idShort)); - // try to climb up .. - var current = this.parent; - while (current != null) - { - if (current is Identifiable) - { - // add big information set - r.Keys.Insert(0, Key.CreateNew( - current.GetElementName(), - true, - (current as Identifiable).identification.idType, - (current as Identifiable).identification.id)); - } - else - { - // reference via idShort - r.Keys.Insert(0, Key.CreateNew( - current.GetElementName(), - true, - "idShort", this.idShort)); - } - current = current.parent; - } - return r; - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV10.EvalToNonNullString("\"{0}\" ", idShort, ""); - var info = ""; - if (semanticId != null) - info = AdminShellUtilV10.EvalToNonEmptyString("\u21e8 {0}", semanticId.ToString(), ""); - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - - } - - [XmlType(TypeName = "submodelElement")] - public class SubmodelElementWrapper - { - - // members - - [XmlElement(ElementName = "property", Type = typeof(Property))] - [XmlElement(ElementName = "file", Type = typeof(File))] - [XmlElement(ElementName = "blob", Type = typeof(Blob))] - [XmlElement(ElementName = "referenceElement", Type = typeof(ReferenceElement))] - [XmlElement(ElementName = "relationshipElement", Type = typeof(RelationshipElement))] - [XmlElement(ElementName = "submodelElementCollection", Type = typeof(SubmodelElementCollection))] - [XmlElement(ElementName = "operation", Type = typeof(Operation))] - public SubmodelElement submodelElement; - - // element names - public static string[] AdequateElementNames = { - "SubmodelElementCollection", "Property", "File", "Blob", "ReferenceElement", - "RelationshipElement", "Operation", "OperationVariable" }; - - // constructors - - public SubmodelElementWrapper() { } - - // for cloning - public SubmodelElementWrapper(SubmodelElement src, bool shallowCopy = false) - { - if (src is Property) - this.submodelElement = new Property(src as Property); - if (src is File) - this.submodelElement = new File(src as File); - if (src is Blob) - this.submodelElement = new Blob(src as Blob); - if (src is ReferenceElement) - this.submodelElement = new ReferenceElement(src as ReferenceElement); - if (src is RelationshipElement) - this.submodelElement = new RelationshipElement(src as RelationshipElement); - if (src is SubmodelElementCollection) - this.submodelElement = new SubmodelElementCollection( - src as SubmodelElementCollection, shallowCopy: shallowCopy); - if (src is Operation) - this.submodelElement = new Operation(src as Operation); - } - - /// - /// Introduced for JSON serialization, can create SubModelElements based on a string name - /// - /// string name (standard PascalCased) - /// SubmodelElement - public static SubmodelElement CreateAdequateType(string elementName) - { - if (elementName == "Property") - return new Property(); - if (elementName == "File") - return new File(); - if (elementName == "Blob") - return new Blob(); - if (elementName == "ReferenceElement") - return new ReferenceElement(); - if (elementName == "RelationshipElement") - return new RelationshipElement(); - if (elementName == "SubmodelElementCollection") - return new SubmodelElementCollection(); - if (elementName == "Operation") - return new Operation(); - if (elementName == "OperationVariable") - return new OperationVariable(); - return null; - } - - /// - /// Can create SubmodelElements based on a numerical index - /// - /// Index 0..7 (6+7 are Operation..!) - /// SubmodelElement - public static SubmodelElement CreateAdequateType(int index) - { - AdminShellV10.SubmodelElement sme = null; - switch (index) - { - case 0: - sme = new AdminShellV10.Property(); - break; - case 1: - sme = new AdminShellV10.File(); - break; - case 2: - sme = new AdminShellV10.Blob(); - break; - case 3: - sme = new AdminShellV10.ReferenceElement(); - break; - case 4: - sme = new AdminShellV10.SubmodelElementCollection(); - break; - case 5: - sme = new AdminShellV10.RelationshipElement(); - break; - case 6: - sme = new AdminShellV10.Operation(); - break; - case 7: - sme = new AdminShellV10.OperationVariable(); - break; - } - return sme; - } - - public string GetFourDigitCode() - { - if (submodelElement == null) - return ("Null"); - if (submodelElement is AdminShellV10.Property) return ("Prop"); - if (submodelElement is AdminShellV10.File) return ("File"); - if (submodelElement is AdminShellV10.Blob) return ("Blob"); - if (submodelElement is AdminShellV10.ReferenceElement) return ("Ref"); - if (submodelElement is AdminShellV10.RelationshipElement) return ("Rel"); - if (submodelElement is AdminShellV10.SubmodelElementCollection) return ("Coll"); - if (submodelElement is AdminShellV10.Operation) return ("Opr"); - return ("Elem"); - } - - public static List ListOfWrappersToListOfElems(List wrappers) - { - var res = new List(); - if (wrappers == null) - return res; - foreach (var w in wrappers) - if (w.submodelElement != null) - res.Add(w.submodelElement); - return res; - } - - public static SubmodelElementWrapper CreateFor(SubmodelElement sme) - { - var res = new SubmodelElementWrapper(); - res.submodelElement = sme; - return res; - } - - public static Referable FindReferableByReference( - List wrappers, Reference rf, int keyIndex) - { - // first index needs to exist .. - if (wrappers == null || rf == null || keyIndex >= rf.Count) - return null; - - // as SubmodelElements are not Identifiables, the actual key shall be IdSHort - if (rf[keyIndex].idType.Trim().ToLower() != - Key.GetIdentifierTypeName(Key.IdentifierType.IdShort).Trim().ToLower()) - return null; - - // over all wrappers - if (wrappers != null) - foreach (var smw in wrappers) - if (smw.submodelElement != null && - smw.submodelElement.idShort.Trim().ToLower() == rf[keyIndex].value.Trim().ToLower()) - { - // match on this level. Did we find a leaf element? - if ((keyIndex + 1) >= rf.Count) - return smw.submodelElement; - - // ok, not a leaf, must be a recursion - // int SMEC - if (smw.submodelElement is SubmodelElementCollection) - return FindReferableByReference( - (smw.submodelElement as SubmodelElementCollection).value, rf, keyIndex + 1); - - // TODO (Michael Hoffmeister, 1970-01-01): Operation - - // else: - return null; - } - - // no? - return null; - } - } - - public class Submodel : Identifiable, System.IDisposable, IGetReference - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // do this in order to be IDisposable, that is: suitable for (using) - void System.IDisposable.Dispose() { } - public void GetData() { } - // from hasDataSpecification: - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - // from hasSemanticId: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = new SemanticId(); - // from Kindable - [XmlElement(ElementName = "kind")] - [JsonIgnore] - public Kind kind = new Kind(); - [XmlIgnore] - [JsonProperty(PropertyName = "kind")] - public string JsonKind - { - get - { - if (kind == null) - return null; - return kind.kind; - } - set - { - if (kind == null) - kind = new Kind(); - kind.kind = value; - } - } - // from Qualifiable: - [XmlArray("qualifier")] - [XmlArrayItem("qualifier")] - public List qualifiers = null; - - // from this very class - [JsonIgnore] - public List submodelElements = null; - [XmlIgnore] - [JsonProperty(PropertyName = "submodelElements")] - public SubmodelElement[] JsonSubmodelElements - { - get - { - var res = new List(); - if (submodelElements != null) - foreach (var smew in submodelElements) - res.Add(smew.submodelElement); - return res.ToArray(); - } - set - { - if (value != null) - { - this.submodelElements = new List(); - foreach (var x in value) - { - var smew = new SubmodelElementWrapper(); - smew.submodelElement = x; - this.submodelElements.Add(smew); - } - } - } - } - - // getter / setter - - // constructors / creators - - public Submodel() : base() { } - - public Submodel(Submodel src, bool shallowCopy = false) - : base(src) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - if (src.kind != null) - this.kind = new Kind(src.kind); - if (!shallowCopy && src.submodelElements != null) - { - if (this.submodelElements == null) - this.submodelElements = new List(); - foreach (var smw in src.submodelElements) - this.submodelElements.Add(new SubmodelElementWrapper(smw.submodelElement, shallowCopy)); - } - } - - public static Submodel CreateNew(string idType, string id, string version = null, string revision = null) - { - var s = new Submodel(); - s.identification.idType = idType; - s.identification.id = id; - if (version != null) - { - if (s.administration == null) - s.administration = new Administration(); - s.administration.version = version; - s.administration.revision = revision; - } - return (s); - } - - public override string GetElementName() - { - return "Submodel"; - } - - public Reference GetReference() - { - SubmodelRef l = new SubmodelRef(); - l.Keys.Add( - Key.CreateNew(this.GetElementName(), true, this.identification.idType, this.identification.id)); - return l; - } - - public void Add(SubmodelElement se) - { - if (submodelElements == null) - submodelElements = new List(); - var sew = new SubmodelElementWrapper(); - se.parent = this; // track parent here! - sew.submodelElement = se; - submodelElements.Add(sew); - } - - public void AddDataSpecification(Key k) - { - if (hasDataSpecification == null) - hasDataSpecification = new HasDataSpecification(); - var r = new Reference(); - r.Keys.Add(k); - hasDataSpecification.reference.Add(r); - } - - public SubmodelElementWrapper FindSubmodelElementWrapper(string idShort) - { - if (this.submodelElements == null) - return null; - foreach (var smw in this.submodelElements) - if (smw.submodelElement != null) - if (smw.submodelElement.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - return smw; - return null; - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV10.EvalToNonNullString("\"{0}\" ", idShort, ""); - if (administration != null) - caption += "V" + administration.version + "." + administration.revision; - var info = ""; - if (identification != null) - info = $"[{identification.idType}, {identification.id}]"; - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - // Recursing - - private void RecurseOnSubmodelElementsRecurse( - List wrappers, object state, List parents, - Action, SubmodelElement> lambda) - { - // trivial - if (wrappers == null || parents == null || lambda == null) - return; - - // over all elements - foreach (var smw in wrappers) - { - var current = smw.submodelElement; - if (current == null) - continue; - - // call lambda for this element - lambda(state, parents, current); - - // add to parents - parents.Add(current); - - // dive into? - if (current is SubmodelElementCollection) - { - var smc = current as SubmodelElementCollection; - RecurseOnSubmodelElementsRecurse(smc.value, state, parents, lambda); - } - - if (current is Operation) - { - var op = current as Operation; - for (int i = 0; i < 2; i++) - RecurseOnSubmodelElementsRecurse(Operation.GetWrappers(op[i]), state, parents, lambda); - } - - // remove from parents - parents.RemoveAt(parents.Count - 1); - } - } - - public void RecurseOnSubmodelElements( - object state, Action, SubmodelElement> lambda) - { - RecurseOnSubmodelElementsRecurse(this.submodelElements, state, new List(), lambda); - } - - // Parents stuff - - private static void SetParentsForSME(Referable parent, SubmodelElement se) - { - se.parent = parent; - var smc = se as SubmodelElementCollection; - if (smc != null) - foreach (var sme in smc.value) - SetParentsForSME(se, sme.submodelElement); - } - - public void SetAllParents() - { - if (this.submodelElements != null) - foreach (var sme in this.submodelElements) - SetParentsForSME(this, sme.submodelElement); - } - - } - - // - // Derived from SubmodelElements - // - - public class DataElement : SubmodelElement - { - - public DataElement() { } - - public DataElement(DataElement src) - : base(src) - { } - - public override string GetElementName() - { - return "DataElement"; - } - } - - public class JsonValueTypeCast - { - - public class JsonDataObjectType - { - [JsonProperty(PropertyName = "name")] - public string name = ""; - } - - [JsonProperty(PropertyName = "dataObjectType")] - public JsonDataObjectType dataObjectType = new JsonDataObjectType(); - - public JsonValueTypeCast(string name) - { - this.dataObjectType.name = name; - } - } - - public class Property : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - [JsonIgnore] - public string valueType = ""; - [XmlIgnore] - [JsonProperty(PropertyName = "valueType")] - public JsonValueTypeCast JsonValueType - { - get { return new JsonValueTypeCast(this.valueType); } - set { this.valueType = value?.dataObjectType?.name; } - } - - - public string value = ""; - public Reference valueId = null; - - // constructors - - public Property() { } - - public Property(Property src) - : base(src) - { - this.valueType = src.valueType; - this.value = src.value; - if (src.valueId != null) - src.valueId = new Reference(src.valueId); - } - - public static Property CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new Property(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(string valueType = "", string value = "") - { - this.valueType = valueType; - this.value = value; - } - - public void Set(string type, bool local, string idType, string value) - { - this.valueId = Reference.CreateNew(Key.CreateNew(type, local, idType, value)); - } - - public override string GetElementName() - { - return "Property"; - } - } - - public class Blob : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public string mimeType = ""; - public string value = ""; - - // constructors - - public Blob() { } - - public Blob(Blob src) - : base(src) - { - this.mimeType = src.mimeType; - this.value = src.value; - } - - public static Blob CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new Blob(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(string mimeType = "", string value = "") - { - this.mimeType = mimeType; - this.value = value; - } - - public override string GetElementName() - { - return "Blob"; - } - - } - - public class File : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public string mimeType = ""; - public string value = ""; - - // constructors - - public File() { } - - public File(File src) - : base(src) - { - this.mimeType = src.mimeType; - this.value = src.value; - } - - public static File CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new File(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(string mimeType = "", string value = "") - { - this.mimeType = mimeType; - this.value = value; - } - - public override string GetElementName() - { - return "File"; - } - - public static string[] GetPopularMimeTypes() - { - return - new string[] { - System.Net.Mime.MediaTypeNames.Text.Plain, - System.Net.Mime.MediaTypeNames.Text.Xml, - System.Net.Mime.MediaTypeNames.Text.Html, - "application/json", - "application/rdf+xml", - System.Net.Mime.MediaTypeNames.Application.Pdf, - System.Net.Mime.MediaTypeNames.Image.Jpeg, - "image/png", - System.Net.Mime.MediaTypeNames.Image.Gif, - "application/iges", - "application/step" - }; - } - } - - public class ReferenceElement : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public Reference value = new Reference(); - - // constructors - - public ReferenceElement() { } - - public ReferenceElement(ReferenceElement src) - : base(src) - { - if (src.value != null) - this.value = new Reference(src.value); - } - - public static ReferenceElement CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new ReferenceElement(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(Reference value = null) - { - this.value = value; - } - - public override string GetElementName() - { - return "ReferenceElement"; - } - - } - - public class RelationshipElement : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public Reference first = new Reference(); - public Reference second = new Reference(); - - // constructors - - public RelationshipElement() { } - - public RelationshipElement(RelationshipElement src) - : base(src) - { - if (src.first != null) - this.first = new Reference(src.first); - if (src.second != null) - this.second = new Reference(src.second); - } - - public static RelationshipElement CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new RelationshipElement(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(Reference first = null, Reference second = null) - { - this.first = first; - this.second = second; - } - - public override string GetElementName() - { - return "RelationshipElement"; - } - } - - public class SubmodelElementCollection : SubmodelElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - [JsonIgnore] - public List value = new List(); - - [XmlIgnore] - [JsonProperty(PropertyName = "value")] - public SubmodelElement[] JsonValue - { - get - { - var res = new List(); - if (value != null) - foreach (var smew in value) - res.Add(smew.submodelElement); - return res.ToArray(); - } - set - { - if (value != null) - { - this.value = new List(); - foreach (var x in value) - { - var smew = new SubmodelElementWrapper(); - smew.submodelElement = x; - this.value.Add(smew); - } - } - } - } - - // further members - public bool ordered = false; - public bool allowDuplicates = false; - - // constructors - - public SubmodelElementCollection() { } - - public SubmodelElementCollection(SubmodelElementCollection src, bool shallowCopy = false) - : base(src) - { - this.ordered = src.ordered; - this.allowDuplicates = src.allowDuplicates; - if (!shallowCopy) - foreach (var smw in src.value) - value.Add(new SubmodelElementWrapper(smw.submodelElement)); - } - - public static SubmodelElementCollection CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new SubmodelElementCollection(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(bool allowDuplicates = false, bool ordered = false) - { - this.allowDuplicates = allowDuplicates; - this.ordered = ordered; - } - - public void Add(SubmodelElement se) - { - if (value == null) - value = new List(); - var sew = new SubmodelElementWrapper(); - se.parent = this; // track parent here! - sew.submodelElement = se; - value.Add(sew); - } - - public SubmodelElementWrapper FindSubmodelElementWrapper(string idShort) - { - if (this.value == null) - return null; - foreach (var smw in this.value) - if (smw.submodelElement != null) - if (smw.submodelElement.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - return smw; - return null; - } - - public override string GetElementName() - { - return "SubmodelElementCollection"; - } - } - - public class OperationVariable : SubmodelElement - { - public enum Direction { In, Out }; - - // Note: for OperationVariable, the values of the SubmodelElement itself ARE NOT TO BE USED! - // only the SME attributes of "value" are counting - - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - public SubmodelElementWrapper value = null; - - // constructors - - public OperationVariable() - { - this.kind = new Kind("Type"); - } - - public OperationVariable(OperationVariable src, bool shallowCopy = false) - : base(src) - { - this.value = new SubmodelElementWrapper(src.value.submodelElement, shallowCopy); - } - - public OperationVariable(SubmodelElement elem) - : base() - { - this.value = new SubmodelElementWrapper(elem); - } - - public override string GetElementName() - { - return "OperationVariable"; - } - } - - public class Operation : SubmodelElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - [JsonIgnore] - [XmlElement(ElementName = "in")] - public List valueIn = new List(); - - [JsonIgnore] - [XmlElement(ElementName = "out")] - public List valueOut = new List(); - - [XmlIgnore] - // MICHA 190504: enabled JSON operation variables! - [JsonProperty(PropertyName = "in")] - public OperationVariable[] JsonValueIn - { - get { return valueIn?.ToArray(); } - set { valueIn = (value != null) ? new List(value) : null; } - } - - [XmlIgnore] - [JsonProperty(PropertyName = "out")] - // MICHA 190504: enabled JSON operation variables! - public OperationVariable[] JsonValueOut - { - get { return valueOut?.ToArray(); } - set { valueOut = (value != null) ? new List(value) : null; } - } - - public List this[OperationVariable.Direction dir] - { - get - { - return (dir == OperationVariable.Direction.In) ? valueIn : valueOut; - } - set - { - if (dir == OperationVariable.Direction.In) - valueIn = value; - else - valueOut = value; - } - } - - public List this[int dir] - { - get - { - return (dir == 0) ? valueIn : valueOut; - } - set - { - if (dir == 0) - valueIn = value; - else - valueOut = value; - } - } - - public static List GetWrappers(List ovl) - { - var res = new List(); - foreach (var ov in ovl) - if (ov.value != null) - res.Add(ov.value); - return res; - } - - // constructors - - public Operation() { } - - public Operation(Operation src) - : base(src) - { - for (int i = 0; i < 2; i++) - if (src[i] != null) - { - if (this[i] == null) - this[i] = new List(); - foreach (var ov in src[i]) - this[i].Add(ov); - } - } - - - public override string GetElementName() - { - return "Operation"; - } - } - - // - // Handling of packages - // - - /// - /// This converter is used for reading JSON files; it claims to be responsible for - /// "SubmodelElements" (the base class) - /// and decides, which sub-class of the base class shall be populated. - /// The decision, shich special sub-class to create is done in a factory - /// AdminShell.SubmodelElementWrapper.CreateAdequateType(), - /// in order to have all sub-class specific decisions in one place (SubmodelElementWrapper) - /// Remark: There is a NuGet package JsonSubTypes, which could have done the job, except the fact of having - /// "modelType" being a class property with a contained property "name". - /// - public class JsonAasxConverter : JsonConverter - { - private string UpperClassProperty = "modelType"; - private string LowerClassProperty = "name"; - - public JsonAasxConverter() : base() - { - } - - public JsonAasxConverter(string UpperClassProperty, string LowerClassProperty) : base() - { - this.UpperClassProperty = UpperClassProperty; - this.LowerClassProperty = LowerClassProperty; - } - - public override bool CanConvert(Type objectType) - { - if (typeof(AdminShellV10.SubmodelElement).IsAssignableFrom(objectType)) - return true; - return false; - } - - public override bool CanWrite - { - get { return false; } - } - - public override object ReadJson(JsonReader reader, - Type objectType, - object existingValue, - JsonSerializer serializer) - { - // Load JObject from stream - JObject jObject = JObject.Load(reader); - - // Create target object based on JObject - object target = new AdminShellV10.SubmodelElement(); - - if (jObject.ContainsKey(UpperClassProperty)) - { - var j2 = jObject[UpperClassProperty]; - foreach (var c in j2.Children()) - { - var cprop = c as Newtonsoft.Json.Linq.JProperty; - if (cprop == null) - continue; - if (cprop.Name == LowerClassProperty && - cprop.Value != null && - cprop.Value.Type.ToString() == "String") - { - var cpval = cprop.Value.ToObject(); - if (cpval == null) - continue; - var o = AdminShellV10.SubmodelElementWrapper.CreateAdequateType(cpval); - if (o != null) - target = o; - } - } - } - - // Populate the object properties - serializer.Populate(jObject.CreateReader(), target); - - return target; - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - throw new NotImplementedException(); - } - } - - /// - /// This class lets an outer functionality keep track on the supplementary files, which are in or - /// are pending to be added or deleted to an Package. - /// - public class PackageSupplementaryFile : Referable - { - public enum LocationType { InPackage, AddPending, DeletePending } - - public enum SpecialHandlingType { None, EmbedAsThumbnail } - - public Uri uri = null; - public string sourcePath = null; - public LocationType location = LocationType.InPackage; - public SpecialHandlingType specialHandling = SpecialHandlingType.None; - - public PackageSupplementaryFile( - Uri uri, string sourcePath = null, LocationType location = LocationType.InPackage, - SpecialHandlingType specialHandling = SpecialHandlingType.None) - { - this.uri = uri; - this.sourcePath = sourcePath; - this.location = location; - this.specialHandling = specialHandling; - } - - // class derives from Referable in order to provide GetElementName - public override string GetElementName() - { - return "File"; - } - - } - - /// - /// This class encapsulates an AdminShellEnvironment and supplementary files into an AASX Package. - /// Specifically has the capability to load, update and store .XML, .JSON and .AASX packages. - /// - public class PackageEnv - { - private string fn = "New Package"; - private AdministrationShellEnv aasenv = new AdministrationShellEnv(); - private Package openPackage = null; - private List pendingFilesToAdd = new List(); - private List pendingFilesToDelete = new List(); - - public PackageEnv() - { - } - - public PackageEnv(AdministrationShellEnv env) - { - if (env != null) - this.aasenv = env; - } - - public PackageEnv(string fn) - { - Load(fn); - } - - public bool IsOpen - { - get - { - return openPackage != null; - } - } - - public string Filename - { - get - { - return fn; - } - } - - public AdminShellV10.AdministrationShellEnv AasEnv - { - get - { - return aasenv; - } - } - - public bool Load(string fn) - { - this.fn = fn; - if (this.openPackage != null) - this.openPackage.Close(); - this.openPackage = null; - - if (fn.ToLower().EndsWith(".xml")) - { - // load only XML - try - { - // TODO (Michael Hoffmeister, 1970-01-01): use aasenv serialzers here! - XmlSerializer serializer = new XmlSerializer( - typeof(AdminShellV10.AdministrationShellEnv), "http://www.admin-shell.io/aas/1/0"); - TextReader reader = new StreamReader(fn); - this.aasenv = serializer.Deserialize(reader) as AdminShellV10.AdministrationShellEnv; - if (this.aasenv == null) - throw (new Exception("Type error for XML file!")); - reader.Close(); - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While reading AAS {0} at {1} gave: {2}", fn, - AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - if (fn.ToLower().EndsWith(".json")) - { - // load only JSON - try - { - using (StreamReader file = System.IO.File.OpenText(fn)) - { - // TODO (Michael Hoffmeister, 1970-01-01): use aasenv serialzers here! - JsonSerializer serializer = new JsonSerializer(); - serializer.Converters.Add(new AdminShellV10.JsonAasxConverter("modelType", "name")); - this.aasenv = (AdministrationShellEnv)serializer.Deserialize( - file, typeof(AdministrationShellEnv)); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While reading AAS {0} at {1} gave: {2}", - fn, AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - if (fn.ToLower().EndsWith(".aasx")) - { - // load package AASX - try - { - var package = Package.Open(fn, FileMode.Open); - - // get the origin from the package - PackagePart originPart = null; - var xs = package.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - originPart = package.GetPart(x.TargetUri); - break; - } - if (originPart == null) - throw (new Exception(string.Format("Unable to find AASX origin. Aborting!"))); - - // get the specs from the package - PackagePart specPart = null; - xs = originPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-spec"); - foreach (var x in xs) - { - specPart = package.GetPart(x.TargetUri); - break; - } - if (specPart == null) - throw (new Exception(string.Format("Unable to find AASX spec(s). Aborting!"))); - - // open spec part to read - try - { - if (specPart.Uri.ToString().ToLower().Trim().EndsWith("json")) - { - using (var s = specPart.GetStream(FileMode.Open)) - { - using (StreamReader file = new StreamReader(s)) - { - JsonSerializer serializer = new JsonSerializer(); - serializer.Converters.Add( - new AdminShellV10.JsonAasxConverter("modelType", "name")); - this.aasenv = (AdministrationShellEnv)serializer.Deserialize( - file, typeof(AdministrationShellEnv)); - } - } - } - else - { - using (var s = specPart.GetStream(FileMode.Open)) - { - // own catch loop to be more specific - XmlSerializer serializer = new XmlSerializer( - typeof(AdminShellV10.AdministrationShellEnv), - "http://www.admin-shell.io/aas/1/0"); - this.aasenv = serializer.Deserialize(s) as AdminShellV10.AdministrationShellEnv; - this.openPackage = package; - if (this.aasenv == null) - throw (new Exception("Type error for XML file!")); - s.Close(); - } - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While reading AAS {0} spec at {1} gave: {2}", - fn, AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While reading AASX {0} at {1} gave: {2}", fn, - AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - // Don't know to handle - throw (new Exception(string.Format($"Not able to handle {fn}."))); - } - - public bool LoadFromAasEnvString(string content) - { - try - { - using (var file = new StringReader(content)) - { - // TODO (Michael Hoffmeister, 1970-01-01): use aasenv serialzers here! - JsonSerializer serializer = new JsonSerializer(); - serializer.Converters.Add(new AdminShellV10.JsonAasxConverter("modelType", "name")); - this.aasenv = (AdministrationShellEnv)serializer.Deserialize( - file, typeof(AdministrationShellEnv)); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While reading AASENV string {0} gave: {1}", - AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - public enum PreferredFormat { None, Xml, Json }; - - public bool SaveAs(string fn, bool writeFreshly = false, PreferredFormat prefFmt = PreferredFormat.None) - { - - if (fn.ToLower().EndsWith(".xml")) - { - // save only XML - this.fn = fn; - try - { - using (var s = new StreamWriter(this.fn)) - { - // TODO (Michael Hoffmeister, 1970-01-01): use aasenv serialzers here! - var serializer = new XmlSerializer(typeof(AdminShellV10.AdministrationShellEnv)); - var nss = new XmlSerializerNamespaces(); - nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - nss.Add("aas", "http://www.admin-shell.io/aas/1/0"); - nss.Add("IEC61360", "http://www.admin-shell.io/IEC61360/1/0"); - serializer.Serialize(s, this.aasenv, nss); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While writing AAS {0} at {1} gave: {2}", - fn, AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - if (fn.ToLower().EndsWith(".json")) - { - // save only JSON - // this funcitonality is a initial test - this.fn = fn; - try - { - using (var sw = new StreamWriter(fn)) - { - // TODO (Michael Hoffmeister, 1970-01-01): use aasenv serialzers here! - - sw.AutoFlush = true; - - JsonSerializer serializer = new JsonSerializer(); - serializer.NullValueHandling = NullValueHandling.Ignore; - serializer.ReferenceLoopHandling = ReferenceLoopHandling.Serialize; - serializer.Formatting = Newtonsoft.Json.Formatting.Indented; - using (JsonWriter writer = new JsonTextWriter(sw)) - { - serializer.Serialize(writer, this.aasenv); - } - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While writing AAS {0} at {1} gave: {2}", - fn, AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - if (fn.ToLower().EndsWith(".aasx")) - { - // save package AASX - try - { - // we want existing contents to be preserved, but no possiblity to change file name - // therefore: copy file to new name, re-open! - // fn could be changed, therefore close "old" package first - if (this.openPackage != null) - { - try - { - this.openPackage.Close(); - if (!writeFreshly) - System.IO.File.Copy(this.fn, fn); - } - catch { } - this.openPackage = null; - } - - // approach is to utilize the existing package, if possible. If not, create from scratch - var package = Package.Open(fn, (writeFreshly) ? FileMode.Create : FileMode.OpenOrCreate); - this.fn = fn; - - // get the origin from the package - PackagePart originPart = null; - var xs = package.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - originPart = package.GetPart(x.TargetUri); - break; - } - if (originPart == null) - { - // create, as not existing - originPart = package.CreatePart( - new Uri( - "/aasx/aasx-origin", UriKind.RelativeOrAbsolute), - System.Net.Mime.MediaTypeNames.Text.Plain, CompressionOption.Maximum); - using (var s = originPart.GetStream(FileMode.Create)) - { - var bytes = System.Text.Encoding.ASCII.GetBytes("Intentionally empty."); - s.Write(bytes, 0, bytes.Length); - } - package.CreateRelationship( - originPart.Uri, TargetMode.Internal, - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - } - - // get the specs from the package - PackagePart specPart = null; - PackageRelationship specRel = null; - xs = originPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-spec"); - foreach (var x in xs) - { - specRel = x; - specPart = package.GetPart(x.TargetUri); - break; - } - - // check, if we have to change the spec part - if (specPart != null && specRel != null) - { - var name = System.IO.Path.GetFileNameWithoutExtension( - specPart.Uri.ToString()).ToLower().Trim(); - var ext = System.IO.Path.GetExtension(specPart.Uri.ToString()).ToLower().Trim(); - if ((ext == ".json" && prefFmt == PreferredFormat.Xml) - || (ext == ".xml" && prefFmt == PreferredFormat.Json) - || (name.StartsWith("aasenv-with-no-id"))) - { - // try kill specpart - try - { - originPart.DeleteRelationship(specRel.Id); - package.DeletePart(specPart.Uri); - } - catch { } - finally { specPart = null; specRel = null; } - } - } - - if (specPart == null) - { - // create, as not existing - var frn = "aasenv-with-no-id"; - if (this.aasenv.AdministrationShells.Count > 0) - frn = this.aasenv.AdministrationShells[0].GetFriendlyName() ?? frn; - var aas_spec_fn = "/aasx/#/#.aas"; - if (prefFmt == PreferredFormat.Json) - aas_spec_fn += ".json"; - else - aas_spec_fn += ".xml"; - aas_spec_fn = aas_spec_fn.Replace("#", "" + frn); - specPart = package.CreatePart( - new Uri( - aas_spec_fn, UriKind.RelativeOrAbsolute), System.Net.Mime.MediaTypeNames.Text.Xml, - CompressionOption.Maximum); - originPart.CreateRelationship( - specPart.Uri, TargetMode.Internal, - "http://www.admin-shell.io/aasx/relationships/aas-spec"); - } - - // now, specPart shall be != null! - if (specPart.Uri.ToString().ToLower().Trim().EndsWith("json")) - { - using (var s = specPart.GetStream(FileMode.Create)) - { - JsonSerializer serializer = new JsonSerializer(); - serializer.NullValueHandling = NullValueHandling.Ignore; - serializer.ReferenceLoopHandling = ReferenceLoopHandling.Serialize; - serializer.Formatting = Newtonsoft.Json.Formatting.Indented; - using (var sw = new StreamWriter(s)) - { - using (JsonWriter writer = new JsonTextWriter(sw)) - { - serializer.Serialize(writer, this.aasenv); - } - } - } - } - else - { - using (var s = specPart.GetStream(FileMode.Create)) - { - var serializer = new XmlSerializer(typeof(AdminShellV10.AdministrationShellEnv)); - var nss = new XmlSerializerNamespaces(); - nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - nss.Add("aas", "http://www.admin-shell.io/aas/1/0"); - nss.Add("IEC61360", "http://www.admin-shell.io/IEC61360/1/0"); - serializer.Serialize(s, this.aasenv, nss); - } - } - - // there might be pending files to be deleted (first delete, then add, in case of identical - // files in both categories) - foreach (var psfDel in pendingFilesToDelete) - { - // try find an existing part for that file .. - var found = false; - - // normal files - xs = specPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-suppl"); - foreach (var x in xs) - if (x.TargetUri == psfDel.uri) - { - // try to delete - specPart.DeleteRelationship(x.Id); - package.DeletePart(psfDel.uri); - found = true; - break; - } - - // thumbnails - xs = package.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.TargetUri == psfDel.uri) - { - // try to delete - package.DeleteRelationship(x.Id); - package.DeletePart(psfDel.uri); - found = true; - break; - } - - if (!found) - throw (new Exception( - $"Not able to delete pending file {psfDel.uri} in saving package {fn}")); - } - - // after this, there are no more pending for delete files - pendingFilesToDelete.Clear(); - - // write pending supplementary files - foreach (var psfAdd in pendingFilesToAdd) - { - // make sure .. - if (psfAdd.sourcePath == null || - psfAdd.location != PackageSupplementaryFile.LocationType.AddPending) - continue; - - // normal file? - if (psfAdd.specialHandling == PackageSupplementaryFile.SpecialHandlingType.None) - { - - // try find an existing part for that file .. - PackagePart filePart = null; - xs = specPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-suppl"); - foreach (var x in xs) - if (x.TargetUri == psfAdd.uri) - { - filePart = package.GetPart(x.TargetUri); - break; - } - - if (filePart == null) - { - // create new part and link - filePart = package.CreatePart( - psfAdd.uri, AdminShellV10.PackageEnv.GuessMimeType(psfAdd.sourcePath), - CompressionOption.Maximum); - specPart.CreateRelationship( - filePart.Uri, TargetMode.Internal, - "http://www.admin-shell.io/aasx/relationships/aas-suppl"); - } - - // now should be able to write - using (var s = filePart.GetStream(FileMode.Create)) - { - var bytes = System.IO.File.ReadAllBytes(psfAdd.sourcePath); - s.Write(bytes, 0, bytes.Length); - } - } - - // thumbnail file? - if (psfAdd.specialHandling == - PackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail) - { - // try find an existing part for that file .. - PackagePart filePart = null; - xs = package.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/" && x.TargetUri == psfAdd.uri) - { - filePart = package.GetPart(x.TargetUri); - break; - } - - if (filePart == null) - { - // create new part and link - filePart = package.CreatePart( - psfAdd.uri, AdminShellV10.PackageEnv.GuessMimeType(psfAdd.sourcePath), - CompressionOption.Maximum); - package.CreateRelationship( - filePart.Uri, TargetMode.Internal, - "http://schemas.openxmlformats.org/package/2006/" + - "relationships/metadata/thumbnail"); - } - - // now should be able to write - using (var s = filePart.GetStream(FileMode.Create)) - { - var bytes = System.IO.File.ReadAllBytes(psfAdd.sourcePath); - s.Write(bytes, 0, bytes.Length); - } - } - } - - // after this, there are no more pending for add files - pendingFilesToAdd.Clear(); - - // flush, but leave open - package.Flush(); - this.openPackage = package; - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While write AASX {0} at {1} gave: {2}", - fn, AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - // Don't know to handle - throw (new Exception(string.Format($"Not able to handle {fn}."))); - } - - private int BackupIndex = 0; - - public void BackupInDir(string backupDir, int maxFiles) - { - // access - if (backupDir == null || maxFiles < 1) - return; - - // we do it not caring on any errors - try - { - // get index in form - if (BackupIndex == 0) - { - // do not always start at 0!! - var rnd = new Random(); - BackupIndex = rnd.Next(maxFiles); - } - var ndx = BackupIndex % maxFiles; - BackupIndex += 1; - - // build a filename - var fn = Path.Combine(backupDir, $"backup{ndx:000}.xml"); - - // raw save - using (var s = new StreamWriter(fn)) - { - var serializer = new XmlSerializer(typeof(AdminShellV10.AdministrationShellEnv)); - var nss = new XmlSerializerNamespaces(); - nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - nss.Add("aas", "http://www.admin-shell.io/aas/1/0"); - nss.Add("IEC61360", "http://www.admin-shell.io/IEC61360/1/0"); - serializer.Serialize(s, this.aasenv, nss); - } - } - catch { } - } - - public Stream GetLocalStreamFromPackage(string uriString) - { - // access - if (this.openPackage == null) - throw (new Exception(string.Format($"AASX Package {this.fn} not opened. Aborting!"))); - var part = this.openPackage.GetPart(new Uri(uriString, UriKind.RelativeOrAbsolute)); - if (part == null) - throw (new Exception( - string.Format( - $"Cannot access URI {uriString} in {this.fn} not opened. Aborting!"))); - return part.GetStream(FileMode.Open); - } - - public long GetStreamSizeFromPackage(string uriString) - { - long res = 0; - try - { - if (this.openPackage == null) - return 0; - var part = this.openPackage.GetPart(new Uri(uriString, UriKind.RelativeOrAbsolute)); - if (part == null) - return 0; - using (var s = part.GetStream(FileMode.Open)) - { - res = s.Length; - } - } - catch { return 0; } - return res; - } - - public Stream GetLocalThumbnailStream(ref Uri thumbUri) - { - // access - if (this.openPackage == null) - throw (new Exception(string.Format($"AASX Package {this.fn} not opened. Aborting!"))); - // get the thumbnail over the relationship - PackagePart thumbPart = null; - var xs = this.openPackage.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - thumbPart = this.openPackage.GetPart(x.TargetUri); - thumbUri = x.TargetUri; - break; - } - if (thumbPart == null) - throw (new Exception(string.Format("Unable to find AASX thumbnail. Aborting!"))); - return thumbPart.GetStream(FileMode.Open); - } - - public Stream GetLocalThumbnailStream() - { - Uri dummy = null; - return GetLocalThumbnailStream(ref dummy); - } - - public List GetListOfSupplementaryFiles() - { - // new result - var result = new List(); - - // access - if (this.openPackage != null) - { - - // get the thumbnail(s) from the package - var xs = this.openPackage.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - result.Add(new PackageSupplementaryFile( - x.TargetUri, - location: PackageSupplementaryFile.LocationType.InPackage, - specialHandling: PackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail)); - } - - // get the origin from the package - PackagePart originPart = null; - xs = this.openPackage.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - originPart = this.openPackage.GetPart(x.TargetUri); - break; - } - - if (originPart != null) - { - // get the specs from the origin - PackagePart specPart = null; - xs = originPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-spec"); - foreach (var x in xs) - { - specPart = this.openPackage.GetPart(x.TargetUri); - break; - } - - if (specPart != null) - { - // get the supplementaries from the package, derived from spec - xs = specPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-suppl"); - foreach (var x in xs) - { - result.Add( - new PackageSupplementaryFile( - x.TargetUri, location: PackageSupplementaryFile.LocationType.InPackage)); - } - } - } - } - - // add or modify the files to delete - foreach (var psfDel in pendingFilesToDelete) - { - // already in - var found = result.Find(x => { return x.uri == psfDel.uri; }); - if (found != null) - found.location = PackageSupplementaryFile.LocationType.DeletePending; - else - { - psfDel.location = PackageSupplementaryFile.LocationType.DeletePending; - result.Add(psfDel); - } - } - - // add the files to store as well - foreach (var psfAdd in pendingFilesToAdd) - { - // already in (should not happen ?!) - var found = result.Find(x => { return x.uri == psfAdd.uri; }); - if (found != null) - found.location = PackageSupplementaryFile.LocationType.AddPending; - else - { - psfAdd.location = PackageSupplementaryFile.LocationType.AddPending; - result.Add(psfAdd); - } - } - - // done - return result; - } - - public static string GuessMimeType(string fn) - { - var file_ext = System.IO.Path.GetExtension(fn).ToLower().Trim(); - var content_type = System.Net.Mime.MediaTypeNames.Text.Plain; - if (file_ext == ".pdf") content_type = System.Net.Mime.MediaTypeNames.Application.Pdf; - if (file_ext == ".xml") content_type = System.Net.Mime.MediaTypeNames.Text.Xml; - if (file_ext == ".txt") content_type = System.Net.Mime.MediaTypeNames.Text.Plain; - if (file_ext == ".igs") content_type = "application/iges"; - if (file_ext == ".iges") content_type = "application/iges"; - if (file_ext == ".stp") content_type = "application/step"; - if (file_ext == ".step") content_type = "application/step"; - if (file_ext == ".jpg") content_type = System.Net.Mime.MediaTypeNames.Image.Jpeg; - if (file_ext == ".jpeg") content_type = System.Net.Mime.MediaTypeNames.Image.Jpeg; - if (file_ext == ".png") content_type = "image/png"; - if (file_ext == ".gif") content_type = System.Net.Mime.MediaTypeNames.Image.Gif; - return content_type; - } - - public void AddSupplementaryFileToStore( - string sourcePath, string targetDir, string targetFn, bool embedAsThumb) - { - // beautify parameters - sourcePath = sourcePath.Trim(); - targetDir = targetDir.Trim(); - if (!targetDir.EndsWith("/")) - targetDir += "/"; - targetDir = targetDir.Replace(@"\", "/"); - targetFn = targetFn.Trim(); - if (sourcePath == "" || targetDir == "" || targetFn == "") - throw (new Exception(string.Format("Trying add supplementary file with empty name or path!"))); - - var file_fn = "" + targetDir.Trim() + targetFn.Trim(); - - // add record - pendingFilesToAdd.Add( - new PackageSupplementaryFile( - new Uri(file_fn, UriKind.RelativeOrAbsolute), - sourcePath, - location: PackageSupplementaryFile.LocationType.AddPending, - specialHandling: ( - embedAsThumb - ? PackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail - : PackageSupplementaryFile.SpecialHandlingType.None) - )); - } - - public void DeleteSupplementaryFile(PackageSupplementaryFile psf) - { - if (psf == null) - throw (new Exception(string.Format("No supplementary file given!"))); - - if (psf.location == PackageSupplementaryFile.LocationType.AddPending) - { - // is still pending in add list -> remove - pendingFilesToAdd.RemoveAll((x) => { return x.uri == psf.uri; }); - } - - if (psf.location == PackageSupplementaryFile.LocationType.InPackage) - { - // add to pending delete list - pendingFilesToDelete.Add(psf); - } - } - - public void Close() - { - if (this.openPackage != null) - this.openPackage.Close(); - this.openPackage = null; - this.fn = ""; - this.aasenv = null; - } - } - - } - - #endregion -} - -#endif diff --git a/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V20/AdminShell.cs b/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V20/AdminShell.cs deleted file mode 100644 index 5aa491279..000000000 --- a/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V20/AdminShell.cs +++ /dev/null @@ -1,8899 +0,0 @@ -/* -Copyright (c) 2018-2021 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Globalization; -using System.IO; -using System.IO.Packaging; -using System.Linq; -using System.Reflection; -using System.Runtime; -using System.Text; -using System.Text.RegularExpressions; -using System.Xml; -using System.Xml.Serialization; -using AdminShell_V20; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -//namespace AdminShellNS -//namespace AdminShell_V20 -namespace AasxCompatibilityModels -{ - /// - /// This empty class derives always from the current version of the Administration Shell class hierarchy. - /// - public class AdminShell : AdminShellV20 { } - - #region AdminShell_V2_0 - - /// - /// Version of Details of Administration Shell Part 1 V1.0 published Nov/Dec/Jan 2018/19 - /// - public class AdminShellV20 - { - public class Identification - { - - // members - - [XmlAttribute] - [CountForHash] - public string idType = ""; - - [XmlText] - [CountForHash] - public string id = ""; - - // some constants - - public static string IRDI = "IRDI"; - public static string IRI = "IRI"; - public static string IdShort = "IdShort"; - - // constructors - - public Identification() { } - - public Identification(Identification src) - { - this.idType = src.idType; - this.id = src.id; - } - -#if !DoNotUseAasxCompatibilityModels - public Identification(AasxCompatibilityModels.AdminShellV10.Identification src) - { - this.idType = src.idType; - if (this.idType.Trim().ToLower() == "uri") - this.idType = Identification.IRI; - this.id = src.id; - } -#endif - - public Identification(string idType, string id) - { - this.idType = idType; - this.id = id; - } - - public Identification(Key key) - { - this.idType = key.idType; - this.id = key.value; - } - - // Creator with validation - - public static Identification CreateNew(string idType, string id) - { - if (idType == null || id == null) - return null; - var found = false; - foreach (var x in Key.IdentifierTypeNames) - found = found || idType.ToLower().Trim() == x.ToLower().Trim(); - if (!found) - return null; - return new Identification(idType, id); - } - - // further - - public bool IsEqual(Identification other) - { - return (this.idType.Trim().ToLower() == other.idType.Trim().ToLower() - && this.id.Trim().ToLower() == other.id.Trim().ToLower()); - } - - public bool IsIRI() - { - return idType?.Trim().ToUpper() == "URI" - || idType?.Trim().ToUpper() == IRI; - } - - public bool IsIRDI() - { - return idType?.Trim().ToUpper() == IRDI; - } - - public override string ToString() - { - return $"[{this.idType}] {this.id}"; - } - } - - public class Administration - { - - // members - - [MetaModelName("Administration.version")] - [TextSearchable] - [CountForHash] - public string version = ""; - - [MetaModelName("Administration.revision")] - [TextSearchable] - [CountForHash] - public string revision = ""; - - // constructors - - public Administration() { } - - public Administration(Administration src) - { - this.version = src.version; - this.revision = src.revision; - } - -#if !DoNotUseAasxCompatibilityModels - public Administration(AasxCompatibilityModels.AdminShellV10.Administration src) - { - this.version = src.version; - this.revision = src.revision; - } -#endif - - public Administration(string version, string revision) - { - this.version = version; - this.revision = revision; - } - - public override string ToString() - { - return $"R={this.version}, V={this.revision}"; - } - } - - public class Key - { - // Constants - - public enum MatchMode { Strict, Relaxed, Identification }; - - // Members - - [MetaModelName("Key.type")] - [TextSearchable] - [XmlAttribute] - [CountForHash] - public string type = ""; - - [XmlAttribute] - [CountForHash] - public bool local = false; - - [MetaModelName("Key.idType")] - [TextSearchable] - [XmlAttribute] - [JsonIgnore] - [CountForHash] - public string idType = ""; - - [XmlIgnore] - [JsonProperty(PropertyName = "idType")] - public string JsonIdType - { - // adapt idShort <-> IdShort - get => (idType == "idShort") ? "IdShort" : idType; - set => idType = (value == "idShort") ? "IdShort" : value; - } - - [MetaModelName("Key.value")] - [TextSearchable] - [XmlText] - [CountForHash] - public string value = ""; - - [XmlIgnore] - [JsonProperty(PropertyName = "index")] - [CountForHash] - public int index = 0; - - public Key() - { - } - - public Key(Key src) - { - this.type = src.type; - this.local = src.local; - this.idType = src.idType; - this.value = src.value; - } - -#if !DoNotUseAasxCompatibilityModels - public Key(AasxCompatibilityModels.AdminShellV10.Key src) - { - this.type = src.type; - this.local = src.local; - this.idType = src.idType; - if (this.idType.Trim().ToLower() == "uri") - this.idType = Identification.IRI; - if (this.idType.Trim().ToLower() == "idshort") - this.idType = Identification.IdShort; - this.value = src.value; - } -#endif - - public Key(string type, bool local, string idType, string value) - { - this.type = type; - this.local = local; - this.idType = idType; - this.value = value; - } - - public static Key CreateNew(string type, bool local, string idType, string value) - { - var k = new Key() - { - type = type, - local = local, - idType = idType, - value = value - }; - return (k); - } - - public static Key GetFromRef(Reference r) - { - if (r == null || r.Count != 1) - return null; - return r[0]; - } - - public Identification ToId() - { - return new Identification(this); - } - - public string ToString(int format = 0) - { - if (format == 1) - { - return String.Format( - "({0})({1})[{2}]{3}", this.type, this.local ? "local" : "no-local", this.idType, this.value); - } - if (format == 2) - { - return String.Format("[{0}]{1}", this.idType, this.value); - } - - // (old) default - var tlc = (this.local) ? "Local" : "not Local"; - return $"[{this.type}, {tlc}, {this.idType}, {this.value}]"; - } - - public static Key Parse(string cell, string typeIfNotSet = null, - bool allowFmtAll = false, bool allowFmt0 = false, - bool allowFmt1 = false, bool allowFmt2 = false) - { - // access and defaults? - if (cell == null || cell.Trim().Length < 1) - return null; - if (typeIfNotSet == null) - typeIfNotSet = Key.GlobalReference; - - // format == 1 - if (allowFmtAll || allowFmt1) - { - var m = Regex.Match(cell, @"\((\w+)\)\((\S+)\)\[(\w+)\]( ?)(.*)$"); - if (m.Success) - { - return new AdminShell.Key( - m.Groups[1].ToString(), m.Groups[2].ToString() == "local", - m.Groups[3].ToString(), m.Groups[5].ToString()); - } - } - - // format == 2 - if (allowFmtAll || allowFmt2) - { - var m = Regex.Match(cell, @"\[(\w+)\]( ?)(.*)$"); - if (m.Success) - { - return new AdminShell.Key( - typeIfNotSet, true, - m.Groups[1].ToString(), m.Groups[3].ToString()); - } - } - - // format == 0 - if (allowFmtAll || allowFmt0) - { - var m = Regex.Match(cell, @"\[(\w+),( ?)([^,]+),( ?)\[(\w+)\],( ?)(.*)\]"); - if (m.Success) - { - return new AdminShell.Key( - m.Groups[1].ToString(), !m.Groups[3].ToString().Contains("not"), - m.Groups[5].ToString(), m.Groups[7].ToString()); - } - } - - // no - return null; - } - - public static string KeyListToString(List keys) - { - if (keys == null || keys.Count < 1) - return ""; - // normally, exactly one key - if (keys.Count == 1) - return keys[0].ToString(); - // multiple! - var s = "[ "; - foreach (var k in keys) - { - if (s.Length > 0) - s += ", "; - s += k.ToString(); - } - return s + " ]"; - } - - public static string[] KeyElements = new string[] { - "GlobalReference", - "FragmentReference", - "AccessPermissionRule", - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel", - "SubmodelRef", // not completely right, but used by Package Explorer - "Blob", - "ConceptDictionary", - "DataElement", - "File", - "Operation", - "OperationVariable", - "BasicEvent", - "Entity", - "Property", - "MultiLanguageProperty", - "Range", - "ReferenceElement", - "RelationshipElement", - "AnnotatedRelationshipElement", - "Capability", - "SubmodelElement", - "SubmodelElementCollection", - "View" }; - - public static string[] ReferableElements = new string[] { - "AccessPermissionRule", - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel", - "Blob", - "ConceptDictionary", - "DataElement", - "File", - "Operation", - "OperationVariable", - "Entity", - "BasicEvent", - "Property", - "MultiLanguageProperty", - "Range", - "ReferenceElement", - "RelationshipElement", - "AnnotatedRelationshipElement", - "Capability", - "SubmodelElement", - "SubmodelElementCollection", - "View" }; - - public static string[] SubmodelElements = new string[] { - "DataElement", - "File", - "Event", - "Operation", - "Property", - "MultiLanguageProperty", - "Range", - "ReferenceElement", - "RelationshipElement", - "AnnotatedRelationshipElement", - "Capability", - "BasicEvent", - "Entity", - "SubmodelElementCollection"}; - - public static string[] IdentifiableElements = new string[] { - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel" }; - - // use this in list to designate all of the above elements - public static string AllElements = "All"; - - // use this in list to designate the GlobalReference - // Resharper disable MemberHidesStaticFromOuterClass - public static string GlobalReference = "GlobalReference"; - public static string FragmentReference = "FragmentReference"; - public static string ConceptDescription = "ConceptDescription"; - public static string SubmodelRef = "SubmodelRef"; - public static string Submodel = "Submodel"; - public static string SubmodelElement = "SubmodelElement"; - public static string Asset = "Asset"; - public static string AAS = "AssetAdministrationShell"; - public static string Entity = "Entity"; - public static string View = "View"; - // Resharper enable MemberHidesStaticFromOuterClass - - public static string[] IdentifierTypeNames = new string[] { - Identification.IdShort, "FragmentId", "Custom", Identification.IRDI, Identification.IRI }; - - public enum IdentifierType { IdShort = 0, FragmentId, Custom, IRDI, IRI }; - - public static string GetIdentifierTypeName(IdentifierType t) - { - return IdentifierTypeNames[(int)t]; - } - - public static string IdShort = "IdShort"; - public static string FragmentId = "FragmentId"; - public static string Custom = "Custom"; - - // some helpers - - public static bool IsInKeyElements(string ke) - { - var res = false; - foreach (var s in KeyElements) - if (s.Trim().ToLower() == ke.Trim().ToLower()) - res = true; - return res; - } - - public bool IsIdType(string[] value) - { - if (value == null || idType == null || idType.Trim() == "") - return false; - return value.Contains(idType.Trim()); - } - - public bool IsIdType(string value) - { - if (value == null || idType == null || idType.Trim() == "") - return false; - return value.Trim().Equals(idType.Trim()); - } - - public bool IsType(string value) - { - if (value == null || type == null || type.Trim() == "") - return false; - return value.Trim().ToLower().Equals(type.Trim().ToLower()); - } - - public bool IsAbsolute() - { - return IsType(Key.GlobalReference) - || IsType(Key.AAS) - || IsType(Key.Asset) - || IsType(Key.Submodel); - } - - public bool Matches( - string type, bool local, string idType, string id, MatchMode matchMode = MatchMode.Strict) - { - if (matchMode == MatchMode.Strict) - return this.type == type && this.local == local && this.idType == idType && this.value == id; - - if (matchMode == MatchMode.Relaxed) - return (this.type == type || this.type == Key.GlobalReference || type == Key.GlobalReference) - && this.idType == idType && this.value == id; - - if (matchMode == MatchMode.Identification) - return this.idType == idType && this.value == id; - - return false; - } - - public bool Matches(Identification id) - { - if (id == null) - return false; - return this.Matches(Key.GlobalReference, false, id.idType, id.id, MatchMode.Identification); - } - - public bool Matches(Key key, MatchMode matchMode = MatchMode.Strict) - { - if (key == null) - return false; - return this.Matches(key.type, key.local, key.idType, key.value, matchMode); - } - - // validation - - public static AasValidationAction Validate(AasValidationRecordList results, Key k, Referable container) - { - // access - if (results == null || container == null) - return AasValidationAction.No; - - var res = AasValidationAction.No; - - // check - if (k == null) - { - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SpecViolation, container, - "Key: is null", - () => - { - res = AasValidationAction.ToBeDeleted; - })); - } - else - { - // check IdType - var idf = AdminShellUtilV20.CheckIfInConstantStringArray(IdentifierTypeNames, k.idType); - if (idf == AdminShellUtilV20.ConstantFoundEnum.No) - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - "Key: idType is not in allowed enumeration values", - () => - { - k.idType = Custom; - })); - if (idf == AdminShellUtilV20.ConstantFoundEnum.AnyCase) - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - "Key: idType in wrong casing", - () => - { - k.idType = AdminShellUtilV20.CorrectCasingForConstantStringArray( - IdentifierTypeNames, k.idType); - })); - - // check type - var tf = AdminShellUtilV20.CheckIfInConstantStringArray(KeyElements, k.type); - if (tf == AdminShellUtilV20.ConstantFoundEnum.No) - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - "Key: type is not in allowed enumeration values", - () => - { - k.type = GlobalReference; - })); - if (tf == AdminShellUtilV20.ConstantFoundEnum.AnyCase) - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - "Key: type in wrong casing", - () => - { - k.idType = AdminShellUtilV20.CorrectCasingForConstantStringArray( - KeyElements, k.type); - })); - } - - // may give result "to be deleted" - return res; - } - } - - public class KeyList : List - { - // getters / setters - - [XmlIgnore] - public bool IsEmpty { get { return this.Count < 1; } } - - // constructors / creators - - public KeyList() { } - - public KeyList(KeyList src) - { - if (src != null) - foreach (var k in src) - this.Add(new Key(k)); - } - - public static KeyList CreateNew(Key k) - { - var kl = new KeyList { k }; - return kl; - } - - public static KeyList CreateNew(string type, bool local, string idType, string value) - { - var kl = new KeyList() { - Key.CreateNew(type, local, idType, value) - }; - return kl; - } - - public static KeyList CreateNew(string type, bool local, string idType, string[] valueItems) - { - // access - if (valueItems == null) - return null; - - // prepare - var kl = new AdminShell.KeyList(); - foreach (var x in valueItems) - kl.Add(new AdminShell.Key(type, local, idType, "" + x)); - return kl; - } - - // matches - - public bool Matches(KeyList other, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (other == null || other.Count != this.Count) - return false; - - var same = true; - for (int i = 0; i < this.Count; i++) - same = same && this[i].Matches(other[i], matchMode); - - return same; - } - - // other - - public void NumberIndices() - { - for (int i = 0; i < this.Count; i++) - this[i].index = i; - } - - public string ToString(int format = 0, string delimiter = ",") - { - var res = string.Join(delimiter, this.Select((k) => k.ToString(format))); - return res; - } - - public static KeyList Parse(string input) - { - // access - if (input == null) - return null; - - // split - var parts = input.Split(',', ';'); - var kl = new KeyList(); - - foreach (var p in parts) - { - var k = Key.Parse(p); - if (k != null) - kl.Add(k); - } - - return kl; - } - - public string MostSignificantInfo() - { - if (this.Count < 1) - return "-"; - var i = this.Count - 1; - var res = this[i].value; - if (this[i].IsIdType(new[] { Key.FragmentId }) && i > 0) - res += this[i - 1].value; - return res; - } - - // validation - - public static void Validate(AasValidationRecordList results, KeyList kl, - Referable container) - { - // access - if (results == null || kl == null || container == null) - return; - - // iterate thru - var idx = 0; - while (idx < kl.Count) - { - var act = Key.Validate(results, kl[idx], container); - if (act == AasValidationAction.ToBeDeleted) - { - kl.RemoveAt(idx); - continue; - } - idx++; - } - } - - public bool StartsWith(KeyList head, bool emptyIsTrue = false, - Key.MatchMode matchMode = Key.MatchMode.Strict) - { - // access - if (head == null) - return false; - if (head.Count == 0) - return emptyIsTrue; - - // simply test element-wise - for (int i = 0; i < head.Count; i++) - { - // does head have more elements than this list? - if (i >= this.Count) - return false; - - if (!head[i].Matches(this[i], matchMode)) - return false; - } - - // ok! - return true; - } - - // arithmetics - - public static KeyList operator +(KeyList a, Key b) - { - var res = new KeyList(a); - if (b != null) - res.Add(b); - return res; - } - - public static KeyList operator +(KeyList a, KeyList b) - { - var res = new KeyList(a); - if (b != null) - res.AddRange(b); - return res; - } - - public KeyList SubList(int startPos, int count = int.MaxValue) - { - var res = new KeyList(); - if (startPos >= this.Count) - return res; - int nr = 0; - for (int i = startPos; i < this.Count && nr < count; i++) - { - nr++; - res.Add(this[i]); - } - return res; - } - - public KeyList ReplaceLastKey(KeyList newKeys) - { - var res = new KeyList(this); - if (res.Count < 1 || newKeys == null || newKeys.Count < 1) - return res; - - res.Remove(res.Last()); - res = res + newKeys; - - return res; - } - - // other - - /// - /// Take only idShort, ignore all other key-types and create a '/'-separated list - /// - /// Empty string or list of idShorts - public string BuildIdShortPath(int startPos = 0, int count = int.MaxValue) - { - if (startPos >= this.Count) - return ""; - int nr = 0; - var res = ""; - for (int i = startPos; i < this.Count && nr < count; i++) - { - nr++; - if (this[i].idType.Trim().ToLower() == Key.IdShort.Trim().ToLower()) - { - if (res != "") - res += "/"; - res += this[i].value; - } - } - return res; - } - } - - public class AasElementSelfDescription - { - public string ElementName = ""; - public string ElementAbbreviation = ""; - public SubmodelElementWrapper.AdequateElementEnum ElementEnum = - SubmodelElementWrapper.AdequateElementEnum.Unknown; - - public AasElementSelfDescription() { } - - public AasElementSelfDescription( - string ElementName, string ElementAbbreviation, - SubmodelElementWrapper.AdequateElementEnum elementEnum - = SubmodelElementWrapper.AdequateElementEnum.Unknown) - { - this.ElementName = ElementName; - this.ElementAbbreviation = ElementAbbreviation; - this.ElementEnum = elementEnum; - } - } - - /// - /// Extends understanding of Referable to further elements, which can be related to - /// - public interface IAasElement - { - AasElementSelfDescription GetSelfDescription(); - string GetElementName(); - } - - [XmlType(TypeName = "reference")] - public class Reference : IAasElement - { - - // members - - [XmlIgnore] // anyway, as it is private - [JsonIgnore] - private KeyList keys = new KeyList(); - - // getters / setters - - [XmlArray("keys")] - [XmlArrayItem("key")] - [JsonIgnore] - public KeyList Keys { get { return keys; } } - [XmlIgnore] - [JsonProperty(PropertyName = "keys")] - public KeyList JsonKeys - { - get - { - keys?.NumberIndices(); - return keys; - } - } - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return keys == null || keys.Count < 1; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (keys == null) return 0; return keys.Count; } } - [XmlIgnore] - [JsonIgnore] - public Key this[int index] { get { return keys[index]; } } - - [XmlIgnore] - [JsonIgnore] - public Key First { get { return this.Count < 1 ? null : this.keys[0]; } } - - [XmlIgnore] - [JsonIgnore] - public Key Last { get { return this.Count < 1 ? null : this.keys[this.keys.Count - 1]; } } - - // constructors / creators - - public Reference() - { - } - - public Reference(Key k) - { - if (k != null) - keys.Add(k); - } - - public Reference(Reference src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(new Key(k)); - } - -#if !DoNotUseAasxCompatibilityModels - public Reference(AasxCompatibilityModels.AdminShellV10.Reference src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(new Key(k)); - } -#endif - - public Reference(SemanticId src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(new Key(k)); - } - -#if !DoNotUseAasxCompatibilityModels - public Reference(AasxCompatibilityModels.AdminShellV10.SemanticId src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(new Key(k)); - } -#endif - public static Reference CreateNew(Key k) - { - if (k == null) - return null; - var r = new Reference(); - r.keys.Add(k); - return r; - } - - public static Reference CreateNew(List k) - { - if (k == null) - return null; - var r = new Reference(); - r.keys.AddRange(k); - return r; - } - - public static Reference CreateNew(string type, bool local, string idType, string value) - { - if (type == null || idType == null || value == null) - return null; - var r = new Reference(); - r.keys.Add(Key.CreateNew(type, local, idType, value)); - return r; - } - - public static Reference CreateIrdiReference(string irdi) - { - if (irdi == null) - return null; - var r = new Reference(); - r.keys.Add(new Key(Key.GlobalReference, false, Identification.IRDI, irdi)); - return r; - } - - // additions - - public static Reference operator +(Reference a, Key b) - { - var res = new Reference(a); - res.Keys?.Add(b); - return res; - } - - public static Reference operator +(Reference a, Reference b) - { - var res = new Reference(a); - res.Keys?.AddRange(b?.Keys); - return res; - } - - // further - - public Key GetAsExactlyOneKey() - { - if (keys == null || keys.Count != 1) - return null; - var k = keys[0]; - return new Key(k.type, k.local, k.idType, k.value); - } - - public bool MatchesExactlyOneKey( - string type, bool local, string idType, string id, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (keys == null || keys.Count != 1) - return false; - var k = keys[0]; - return k.Matches(type, local, idType, id, matchMode); - } - - public bool MatchesExactlyOneKey(Key key, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (key == null) - return false; - return this.MatchesExactlyOneKey(key.type, key.local, key.idType, key.value, matchMode); - } - - public bool Matches( - string type, bool local, string idType, string id, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (this.Count == 1) - { - var k = keys[0]; - return k.Matches(type, local, idType, id, matchMode); - } - return false; - } - - public bool Matches(Key key, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (this.Count == 1) - { - var k = keys[0]; - return k.Matches(key, matchMode); - } - return false; - } - - public bool Matches(Identification other) - { - if (other == null) - return false; - if (this.Count == 1) - { - var k = keys[0]; - return k.Matches(Key.GlobalReference, false, other.idType, other.id, Key.MatchMode.Identification); - } - return false; - } - - public bool Matches(Reference other, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (this.keys == null || other == null || other.keys == null || other.Count != this.Count) - return false; - - var same = true; - for (int i = 0; i < this.Count; i++) - same = same && this.keys[i].Matches(other.keys[i], matchMode); - - return same; - } - - public bool Matches(SemanticId other, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - return Matches(new Reference(other), matchMode); - } - - public bool Matches(ConceptDescription cd, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - return Matches(cd?.GetReference(), matchMode); - } - - public string ToString(int format = 0, string delimiter = ",") - { - return keys?.ToString(format, delimiter); - } - - public static Reference Parse(string input) - { - return CreateNew(KeyList.Parse(input)); - } - - public string ListOfValues(string delim) - { - string res = ""; - if (this.Keys != null) - foreach (var x in this.Keys) - { - if (x == null) - continue; - if (res != "") res += delim; - res += x.value; - } - return res; - } - - // self description - - public virtual AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Reference", "Rfc"); - } - - public virtual string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - } - - [XmlType(TypeName = "derivedFrom")] - public class AssetAdministrationShellRef : Reference - { - // constructors - - public AssetAdministrationShellRef() : base() { } - - public AssetAdministrationShellRef(Key k) : base(k) { } - - public AssetAdministrationShellRef(Reference src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public AssetAdministrationShellRef(AasxCompatibilityModels.AdminShellV10.Reference src) : base(src) { } -#endif - - // further methods - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("AssetAdministrationShellRef", "AasRef"); - } - } - - [XmlType(TypeName = "assetRef")] - public class AssetRef : Reference - { - // constructors - - public AssetRef() : base() { } - - public AssetRef(AssetRef src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public AssetRef(AasxCompatibilityModels.AdminShellV10.AssetRef src) : base(src) { } -#endif - - public AssetRef(Reference r) - : base(r) - { - } - - // further methods - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("AssetRef", "AssetRef"); - } - } - - [XmlType(TypeName = "submodelRef")] - public class SubmodelRef : Reference - { - // constructors - - public SubmodelRef() : base() { } - - public SubmodelRef(SubmodelRef src) : base(src) { } - - public SubmodelRef(Reference src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public SubmodelRef(AasxCompatibilityModels.AdminShellV10.SubmodelRef src) : base(src) { } -#endif - - public new static SubmodelRef CreateNew(string type, bool local, string idType, string value) - { - var r = new SubmodelRef(); - r.Keys.Add(Key.CreateNew(type, local, idType, value)); - return r; - } - - public static SubmodelRef CreateNew(Reference src) - { - if (src == null || src.Keys == null) - return null; - var r = new SubmodelRef(); - r.Keys.AddRange(src.Keys); - return r; - } - - // further methods - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("SubmodelRef", "SMRef"); - } - } - - [XmlType(TypeName = "conceptDescriptionRef")] - public class ConceptDescriptionRef : Reference - { - // constructors - - public ConceptDescriptionRef() : base() { } - - public ConceptDescriptionRef(ConceptDescriptionRef src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public ConceptDescriptionRef( - AasxCompatibilityModels.AdminShellV10.ConceptDescriptionRef src) : base(src) { } -#endif - - // further methods - - public new static ConceptDescriptionRef CreateNew(string type, bool local, string idType, string value) - { - var r = new ConceptDescriptionRef(); - r.Keys.Add(Key.CreateNew(type, local, idType, value)); - return r; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("ConceptDescriptionRef", "CDRef"); - } - - } - - [XmlType(TypeName = "dataSpecificationRef")] - public class DataSpecificationRef : Reference - { - // constructors - - public DataSpecificationRef() : base() { } - - public DataSpecificationRef(DataSpecificationRef src) : base(src) { } - - public DataSpecificationRef(Reference src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public DataSpecificationRef(AasxCompatibilityModels.AdminShellV10.DataSpecificationRef src) : base(src) { } - - public DataSpecificationRef(AasxCompatibilityModels.AdminShellV10.Reference src) : base(src) { } -#endif - - // further methods - - public static DataSpecificationRef CreateNew(Reference src) - { - if (src == null || src.Keys == null) - return null; - var res = new DataSpecificationRef(); - foreach (var k in src.Keys) - res.Keys.Add(new Key(k)); - return res; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("DataSpecificationRef", "DSRef"); - } - - } - - [XmlType(TypeName = "conceptDescriptions")] - public class ConceptDescriptionRefs - { - [XmlElement(ElementName = "conceptDescriptionRef")] - public List conceptDescriptions = new List(); - - // constructors - - public ConceptDescriptionRefs() { } - - public ConceptDescriptionRefs(ConceptDescriptionRefs src) - { - if (src.conceptDescriptions != null) - foreach (var cdr in src.conceptDescriptions) - this.conceptDescriptions.Add(new ConceptDescriptionRef(cdr)); - } - -#if !DoNotUseAasxCompatibilityModels - public ConceptDescriptionRefs(AasxCompatibilityModels.AdminShellV10.ConceptDescriptionRefs src) - { - if (src.conceptDescriptions != null) - foreach (var cdr in src.conceptDescriptions) - this.conceptDescriptions.Add(new ConceptDescriptionRef(cdr)); - } -#endif - } - - [XmlType(TypeName = "containedElementRef")] - public class ContainedElementRef : Reference - { - // constructors - - public ContainedElementRef() { } - - public ContainedElementRef(ContainedElementRef src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public ContainedElementRef(AasxCompatibilityModels.AdminShellV10.ContainedElementRef src) : base(src) { } -#endif - - public static ContainedElementRef CreateNew(Reference src) - { - if (src == null || src.Keys == null) - return null; - var r = new ContainedElementRef(); - r.Keys.AddRange(src.Keys); - return r; - } - - // further methods - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("ContainedElementRef", "CERef"); - } - - } - -#if __not_valid_anymore - [XmlType(TypeName = "hasDataSpecification")] - public class HasDataSpecification - { - [XmlElement(ElementName = "reference")] // make "reference" go away by magic?! - public List reference = new List(); - - public HasDataSpecification() { } - - public HasDataSpecification(HasDataSpecification src) - { - foreach (var r in src.reference) - reference.Add(new Reference(r)); - } - -#if !DoNotUseAasxCompatibilityModels - public HasDataSpecification(AasxCompatibilityModels.AdminShellV10.HasDataSpecification src) - { - foreach (var r in src.reference) - reference.Add(new Reference(r)); - } -#endif - } -#else - // Note: In versions prior to V2.0.1, the SDK has "HasDataSpecification" containing only a Reference. - // Iv 2.0.1, theoretically each entity with HasDataSpecification could also conatin a - // EmbeddedDataSpecification. - - [XmlType(TypeName = "hasDataSpecification")] - public class HasDataSpecification : List - { - public HasDataSpecification() { } - - public HasDataSpecification(HasDataSpecification src) - { - foreach (var r in src) - this.Add(new EmbeddedDataSpecification(r)); - } - - public HasDataSpecification(IEnumerable src) - { - foreach (var r in src) - this.Add(new EmbeddedDataSpecification(r)); - } - -#if !DoNotUseAasxCompatibilityModels - public HasDataSpecification(AasxCompatibilityModels.AdminShellV10.HasDataSpecification src) - { - foreach (var r in src.reference) - this.Add(new EmbeddedDataSpecification(r)); - } -#endif - - // make some explicit and easy to use getter, setters - - [XmlIgnore] - [JsonIgnore] - public EmbeddedDataSpecification IEC61360 - { - get - { - foreach (var eds in this) - if (eds?.dataSpecificationContent?.dataSpecificationIEC61360 != null - || eds?.dataSpecification?.MatchesExactlyOneKey( - DataSpecificationIEC61360.GetKey(), Key.MatchMode.Identification) == true) - return eds; - return null; - } - set - { - // search existing first? - var eds = this.IEC61360; - if (eds != null) - { - // replace this - /* TODO (MIHO, 2020-08-30): this does not prevent the corner case, that we could have - * multiple dataSpecificationIEC61360 in this list, which would be an error */ - this.Remove(eds); - this.Add(value); - return; - } - - // no? .. add! - this.Add(value); - } - } - - [XmlIgnore] - [JsonIgnore] - public DataSpecificationIEC61360 IEC61360Content - { - get - { - return this.IEC61360?.dataSpecificationContent?.dataSpecificationIEC61360; - } - set - { - // search existing first? - var eds = this.IEC61360; - if (eds != null) - { - // replace this - eds.dataSpecificationContent.dataSpecificationIEC61360 = value; - return; - } - // no? .. add! - var edsnew = new EmbeddedDataSpecification(); - edsnew.dataSpecificationContent.dataSpecificationIEC61360 = value; - this.Add(edsnew); - } - } - - } -#endif - - [XmlType(TypeName = "ContainedElements")] - public class ContainedElements - { - - // members - - [XmlElement(ElementName = "containedElementRef")] // make "reference" go away by magic?! - public List reference = new List(); - - // getter / setter - - public bool IsEmpty { get { return reference == null || reference.Count < 1; } } - public int Count { get { if (reference == null) return 0; return reference.Count; } } - public ContainedElementRef this[int index] { get { return reference[index]; } } - - // Creators - - public ContainedElements() { } - - public ContainedElements(ContainedElements src) - { - if (src.reference != null) - foreach (var r in src.reference) - this.reference.Add(new ContainedElementRef(r)); - } - -#if !DoNotUseAasxCompatibilityModels - public ContainedElements(AasxCompatibilityModels.AdminShellV10.ContainedElements src) - { - if (src.reference != null) - foreach (var r in src.reference) - this.reference.Add(new ContainedElementRef(r)); - } -#endif - - public static ContainedElements CreateOrSetInner(ContainedElements outer, ContainedElementRef[] inner) - { - var res = outer; - if (res == null) - res = new ContainedElements(); - if (inner == null) - { - res.reference = null; - return res; - } - res.reference = new List(inner); - return res; - } - - } - - [XmlType(TypeName = "langString", Namespace = "http://www.admin-shell.io/2/0")] - public class LangStr - { - // constants - public static string LANG_DEFAULT = "en"; - - // members - - [MetaModelName("LangStr.lang")] - [TextSearchable] - [XmlAttribute(Namespace = "http://www.admin-shell.io/2/0")] - [JsonProperty(PropertyName = "language")] - [CountForHash] - public string lang = ""; - - [MetaModelName("LangStr.str")] - [TextSearchable] - [XmlText] - [JsonProperty(PropertyName = "text")] - [CountForHash] - public string str = ""; - - // constructors - - public LangStr() { } - - public LangStr(LangStr src) - { - this.lang = src.lang; - this.str = src.str; - } - -#if !DoNotUseAasxCompatibilityModels - public LangStr(AasxCompatibilityModels.AdminShellV10.LangStr src) - { - this.lang = src.lang; - this.str = src.str; - } -#endif - - public LangStr(string lang, string str) - { - this.lang = lang; - this.str = str; - } - - public static ListOfLangStr CreateManyFromStringArray(string[] s) - { - var r = new ListOfLangStr(); - var i = 0; - while ((i + 1) < s.Length) - { - r.Add(new LangStr(s[i], s[i + 1])); - i += 2; - } - return r; - } - - public override string ToString() - { - return $"{str}@{lang}"; - } - } - - public class ListOfLangStr : List - { - public ListOfLangStr() { } - - public ListOfLangStr(LangStr ls) - { - if (ls != null) - this.Add(ls); - } - - public ListOfLangStr(ListOfLangStr src) - { - if (src != null) - foreach (var ls in src) - this.Add(ls); - } - - public string this[string lang] - { - get - { - return GetDefaultStr(lang); - } - set - { - foreach (var ls in this) - if (ls.lang.Trim().ToLower() == lang?.Trim().ToLower()) - { - ls.str = value; - return; - } - this.Add(new LangStr(lang, value)); - } - } - - public string GetDefaultStr(string defaultLang = null) - { - // start - if (defaultLang == null) - defaultLang = LangStr.LANG_DEFAULT; - defaultLang = defaultLang.Trim().ToLower(); - string res = null; - - // search - foreach (var ls in this) - if (ls.lang.Trim().ToLower() == defaultLang) - res = ls.str; - if (res == null && this.Count > 0) - res = this[0].str; - - // found? - return res; - } - - public string GetExactStrForLang(string lang) - { - // start - if (lang == null) - return null; - string res = null; - - // exact search - foreach (var ls in this) - if (ls.lang.Trim().ToLower() == lang) - res = ls.str; - - // found? - return res; - } - - public bool ContainsLang(string lang) - { - return GetExactStrForLang(lang) != null; - } - - public bool AllLangSameString() - { - if (this.Count < 2) - return true; - - for (int i = 1; i < this.Count; i++) - if (this[0]?.str != null && this[0]?.str?.Trim() != this[i]?.str?.Trim()) - return false; - - return true; - } - - public override string ToString() - { - return string.Join(", ", this.Select((ls) => ls.ToString())); - } - - public static ListOfLangStr Parse(string cell) - { - // access - if (cell == null) - return null; - - // iterative approach - var res = new ListOfLangStr(); - while (true) - { - // trivial case and finite end - if (!cell.Contains("@")) - { - if (cell.Trim() != "") - res.Add(new LangStr(LangStr.LANG_DEFAULT, cell)); - break; - } - - // OK, pick the next couple - var m = Regex.Match(cell, @"(.*?)@(\w+)", RegexOptions.Singleline); - if (!m.Success) - { - // take emergency exit? - res.Add(new LangStr("??", cell)); - break; - } - - // use the match and shorten cell .. - res.Add(new LangStr(m.Groups[2].ToString(), m.Groups[1].ToString().Trim())); - cell = cell.Substring(m.Index + m.Length); - } - - return res; - } - } - - public class Description - { - - // members - - [XmlElement(ElementName = "langString")] - public ListOfLangStr langString = new ListOfLangStr(); - - // constructors - - public Description() { } - - public Description(Description src) - { - if (src != null && src.langString != null) - foreach (var ls in src.langString) - langString.Add(new LangStr(ls)); - } - - public Description(LangStringSet src) - { - if (src != null && src.langString != null) - foreach (var ls in src.langString) - langString.Add(new LangStr(ls)); - } - -#if !DoNotUseAasxCompatibilityModels - public Description(AasxCompatibilityModels.AdminShellV10.Description src) - { - if (src != null) - foreach (var ls in src.langString) - langString.Add(new LangStr(ls)); - } -#endif - - // single string representation - public string GetDefaultStr(string defaultLang = null) - { - return this.langString?.GetDefaultStr(defaultLang); - } - - } - - public class AssetKind - { - // constants - public static string Type = "Type"; - public static string Instance = "Instance"; - - [MetaModelName("AssetKind.kind")] - [TextSearchable] - [XmlText] - [CountForHash] - public string kind = "Instance"; - - // getters / setters - - [XmlIgnore] - [JsonIgnore] - public bool IsInstance { get { return kind == null || kind.Trim().ToLower() == "instance"; } } - - [XmlIgnore] - [JsonIgnore] - public bool IsType { get { return kind != null && kind.Trim().ToLower() == "type"; } } - - // constructors / creators - - public AssetKind() { } - - public AssetKind(AssetKind src) - { - kind = src.kind; - } - -#if !DoNotUseAasxCompatibilityModels - public AssetKind(AasxCompatibilityModels.AdminShellV10.Kind src) - { - kind = src.kind; - } -#endif - - public AssetKind(string kind) - { - this.kind = kind; - } - - public static AssetKind CreateAsType() - { - var res = new AssetKind() { kind = AssetKind.Type }; - return res; - } - - public static AssetKind CreateAsInstance() - { - var res = new AssetKind() { kind = AssetKind.Instance }; - return res; - } - } - - public class ModelingKind - { - // constants - public static string Template = "Template"; - public static string Instance = "Instance"; - - [MetaModelName("ModelingKind.kind")] - [TextSearchable] - [XmlText] - [CountForHash] - public string kind = Instance; - - // getters / setters - - [XmlIgnore] - [JsonIgnore] - public bool IsInstance { get { return kind == null || kind.Trim().ToLower() == Instance.ToLower(); } } - - [XmlIgnore] - [JsonIgnore] - public bool IsTemplate { get { return kind != null && kind.Trim().ToLower() == Template.ToLower(); } } - - // constructors / creators - - public ModelingKind() { } - - public ModelingKind(ModelingKind src) - { - kind = src.kind; - } - -#if !DoNotUseAasxCompatibilityModels - public ModelingKind(AasxCompatibilityModels.AdminShellV10.Kind src) - { - kind = src.kind; - } -#endif - - public ModelingKind(string kind) - { - this.kind = kind; - } - - public static ModelingKind CreateAsTemplate() - { - var res = new ModelingKind() { kind = Template }; - return res; - } - - public static ModelingKind CreateAsInstance() - { - var res = new ModelingKind() { kind = Instance }; - return res; - } - - // validation - - public static void Validate(AasValidationRecordList results, ModelingKind mk, Referable container) - { - // access - if (results == null || container == null) - return; - - // check - if (mk == null || mk.kind == null) - { - // warning - results.Add(new AasValidationRecord( - AasValidationSeverity.Warning, container, - "ModelingKind: is null", - () => - { - })); - } - else - { - var k = mk.kind.Trim(); - var kl = k.ToLower(); - if (kl != Template.ToLower() && kl != Instance.ToLower()) - { - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - $"ModelingKind: enumeration value neither {Template} nor {Instance}", - () => - { - mk.kind = Instance; - })); - } - else if (k != Template && k != Instance) - { - // warning - results.Add(new AasValidationRecord( - AasValidationSeverity.Warning, container, - "ModelingKind: enumeration value in wrong casing", - () => - { - if (kl == Template.ToLower()) - mk.kind = Template; - else - mk.kind = Instance; - })); - } - } - } - } - - public class SemanticId : Reference - { - - // constructors / creators - - public SemanticId() - : base() - { - } - - public SemanticId(SemanticId src) - : base(src) - { - } - - public SemanticId(Reference src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public SemanticId(AasxCompatibilityModels.AdminShellV10.SemanticId src) - : base(src) - { - } -#endif - public SemanticId(Key key) : base(key) { } - - public static SemanticId CreateFromKey(Key key) - { - if (key == null) - return null; - var res = new SemanticId(); - res.Keys.Add(key); - return res; - } - - public static SemanticId CreateFromKeys(List keys) - { - if (keys == null) - return null; - var res = new SemanticId(); - res.Keys.AddRange(keys); - return res; - } - - public new static SemanticId Parse(string input) - { - return (SemanticId)CreateNew(KeyList.Parse(input)); - } - } - - /// - /// This class allows to describe further data (in derived classes) when enumerating Children. - /// - public class EnumerationPlacmentBase - { - } - - public interface IEnumerateChildren - { - IEnumerable EnumerateChildren(); - EnumerationPlacmentBase GetChildrenPlacement(SubmodelElement child); - object AddChild(SubmodelElementWrapper smw, EnumerationPlacmentBase placement = null); - } - - public interface IValidateEntity - { - void Validate(AasValidationRecordList results); - } - - /// - /// This attribute indicates, that it should e.g. serialized in JSON. - /// - [System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple = true)] - public class CountForHash : System.Attribute - { - } - - /// - /// This attribute indicates, that evaluation shall not count following field or not dive into references. - /// - [System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple = true)] - public class SkipForHash : System.Attribute - { - } - - /// - /// This attribute indicates, that the field / property is searchable - /// - [System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)] - public class MetaModelName : System.Attribute - { - public string name; - public MetaModelName(string name) - { - this.name = name; - } - } - - /// - /// This attribute indicates, that the field / property shall be skipped for reflection - /// in order to avoid cycles - /// - [System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)] - public class SkipForReflection : System.Attribute - { - } - - /// - /// This attribute indicates, that the field / property shall be skipped for searching, because it is not - /// directly displayed in Package Explorer - /// - [System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)] - public class SkipForSearch : System.Attribute - { - } - - /// - /// This attribute indicates, that the field / property is searchable - /// - [System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)] - public class TextSearchable : System.Attribute - { - } - - /// - /// Result of FindReferable in Environment - /// - public class ReferableRootInfo - { - public AdministrationShell AAS = null; - public Asset Asset = null; - public Submodel Submodel = null; - - public int NrOfRootKeys = 0; - - public bool IsValid - { - get - { - return NrOfRootKeys > 0 && (AAS != null || Submodel != null || Asset != null); - } - } - } - - /// - /// Marks an object, preferaby a payload item, which might be featured by the diary collection - /// - public interface IAasDiaryEntry - { - } - - public class DiaryDataDef - { - public enum TimeStampKind { Create, Update } - - [XmlIgnore] - [JsonIgnore] - private DateTime[] _timeStamp = new DateTime[2]; - - [XmlIgnore] - [JsonIgnore] - public DateTime[] TimeStamp { get { return _timeStamp; } } - - /// - /// List of entries, timewise one after each other (entries are timestamped). - /// Note: Default is Entries = null, as handling of many many AAS elements does not - /// create additional overhead of creating empty lists. An empty list shall be avoided. - /// - public List Entries = null; - - public static void AddAndSetTimestamps(Referable element, IAasDiaryEntry de, bool isCreate = false) - { - // trivial - if (element == null || de == null || element.DiaryData == null) - return; - - // add entry - if (element.DiaryData.Entries == null) - element.DiaryData.Entries = new List(); - element.DiaryData.Entries.Add(de); - - // figure out which timestamp - var tsk = TimeStampKind.Update; - if (isCreate) - { - tsk = TimeStampKind.Create; - } - - // set this timestamp (and for the parents, as well) - IDiaryData el = element; - while (el?.DiaryData != null) - { - // itself - el.DiaryData.TimeStamp[(int)tsk] = DateTime.UtcNow; - - // go up - el = (el as Referable)?.parent as IDiaryData; - } - } - } - - public interface IDiaryData - { - DiaryDataDef DiaryData { get; } - } - - public class ListOfReferable : List - { - // conversion to other list - - public KeyList ToKeyList() - { - var res = new KeyList(); - foreach (var rf in this) - res.Add(rf.ToKey()); - return res; - } - - public Reference GetReference() - { - return Reference.CreateNew(ToKeyList()); - } - } - - public interface IRecurseOnReferables - { - void RecurseOnReferables( - object state, Func lambda, - bool includeThis = false); - } - - public class Referable : IValidateEntity, IAasElement, IDiaryData, IGetReference, IRecurseOnReferables - { - // diary - - [XmlIgnore] - [JsonIgnore] - [SkipForHash] - [SkipForReflection] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [XmlIgnore] - [JsonIgnore] - [SkipForReflection] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - // members - - [MetaModelName("Referable.IdShort")] - [TextSearchable] - [CountForHash] - public string idShort = ""; - - [MetaModelName("Referable.category")] - [TextSearchable] - [CountForHash] - public string category = null; - - [XmlElement(ElementName = "description")] - [JsonIgnore] - [CountForHash] - public Description description = null; - - [XmlIgnore] - [JsonProperty(PropertyName = "descriptions")] - public ListOfLangStr JsonDescription - { - get - { - return description?.langString; - } - set - { - if (value == null) - { - description = null; - return; - } - - if (description == null) - description = new Description(); - description.langString = value; - } - } - - [XmlIgnore] - [JsonIgnore] - [SkipForHash] // important to skip, as recursion elsewise will go in cycles! - [SkipForReflection] // important to skip, as recursion elsewise will go in cycles! - public IAasElement parent = null; - - public static string CONSTANT = "CONSTANT"; - public static string Category_PARAMETER = "PARAMETER"; - public static string VARIABLE = "VARIABLE"; - - public static string[] ReferableCategoryNames = new string[] { CONSTANT, Category_PARAMETER, VARIABLE }; - - // constructors - - public Referable() { } - - public Referable(string idShort) - { - this.idShort = idShort; - } - - public Referable(Referable src) - { - if (src == null) - return; - this.idShort = src.idShort; - this.category = src.category; - if (src.description != null) - this.description = new Description(src.description); - } - -#if !DoNotUseAasxCompatibilityModels - public Referable(AasxCompatibilityModels.AdminShellV10.Referable src) - { - if (src == null) - return; - this.idShort = src.idShort; - if (this.idShort == null) - // change in V2.0 -> mandatory - this.idShort = ""; - this.category = src.category; - if (src.description != null) - this.description = new Description(src.description); - } -#endif - - /// - /// Introduced for JSON serialization, can create Referables based on a string name - /// - /// string name (standard PascalCased) - public static Referable CreateAdequateType(string elementName) - { - if (elementName == Key.AAS) - return new AdministrationShell(); - if (elementName == Key.Asset) - return new Asset(); - if (elementName == Key.ConceptDescription) - return new ConceptDescription(); - if (elementName == Key.Submodel) - return new Submodel(); - if (elementName == Key.View) - return new View(); - return SubmodelElementWrapper.CreateAdequateType(elementName); - } - - public void AddDescription(string lang, string str) - { - if (description == null) - description = new Description(); - description.langString.Add(new LangStr(lang, str)); - } - - public virtual AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Referable", "Ref"); - } - - public virtual string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - - public string GetFriendlyName() - { - return AdminShellUtilV20.FilterFriendlyName(this.idShort); - } - - public virtual Reference GetReference(bool includeParents = true) - { - return new Reference( - new AdminShell.Key( - this.GetElementName(), false, Key.IdShort, "" + this.idShort)); - } - - public void CollectReferencesByParent(List refs) - { - // access - if (refs == null) - return; - - // check, if this is identifiable - if (this is Identifiable) - { - var idf = this as Identifiable; - if (idf != null) - { - var k = Key.CreateNew( - idf.GetElementName(), true, idf.identification?.idType, idf.identification?.id); - refs.Insert(0, k); - } - } - else - { - var k = Key.CreateNew(this.GetElementName(), true, "IdShort", this.idShort); - refs.Insert(0, k); - // recurse upwards! - if (this.parent is Referable prf) - prf.CollectReferencesByParent(refs); - } - } - - public string CollectIdShortByParent() - { - // recurse first - var head = ""; - if (!(this is Identifiable) && this.parent is Referable prf) - // can go up - head = prf.CollectIdShortByParent() + "/"; - // add own - var myid = ""; - if (this.idShort != null && this.idShort.Trim() != "") - myid = this.idShort.Trim(); - // together - return head + myid; - } - - // string functions - - public string ToIdShortString() - { - if (this.idShort == null || this.idShort.Trim().Length < 1) - return (""); - return this.idShort.Trim(); - } - - public override string ToString() - { - return "" + this.idShort; - } - - public virtual Key ToKey() - { - return new Key(GetElementName(), true, Key.IdShort, idShort); - } - - // hash functionality - - public class ObjectFieldInfo - { - public object o; - public FieldInfo fi; - public ObjectFieldInfo() { } - public ObjectFieldInfo(object o, FieldInfo fi) - { - this.o = o; - this.fi = fi; - } - } - - public List RecursivelyFindFields(object o, Type countAttribute, Type skipAttribute) - { - // access - var res = new List(); - if (o == null || countAttribute == null) - return res; - - // find fields for this object - var t = o.GetType(); - var l = t.GetFields(BindingFlags.Instance | BindingFlags.Public); - foreach (var f in l) - { - // Skip this field?? - if (skipAttribute != null && f.GetCustomAttribute(skipAttribute) != null) - continue; - - // add directly? - if (f.GetCustomAttribute(countAttribute) != null) - res.Add(new ObjectFieldInfo(o, f)); - - // object - if (f.FieldType.IsClass) - { - var oo = f.GetValue(o); - var r = RecursivelyFindFields(oo, countAttribute, skipAttribute); - res.AddRange(r); - } - - // try cast in IList to check further - var elems = f.GetValue(o) as IList; - if (elems != null) - foreach (var e in elems) - { - var r = RecursivelyFindFields(e, countAttribute, skipAttribute); - res.AddRange(r); - } - - } - // OK - return res; - } - - public byte[] ComputeByteArray() - { - // use memory stream for effcient behaviour - var mems = new MemoryStream(); - - // TEST - var xxx = RecursivelyFindFields(this, typeof(CountForHash), typeof(SkipForHash)); - - foreach (var ofi in xxx) - { - var a = ofi.fi.GetCustomAttribute(); - if (a != null) - { - // found an accountable field, get bytes - var o = ofi.fi.GetValue(ofi.o); - byte[] bs = null; - - // optimize for probabilities - - if (o is string) - bs = System.Text.Encoding.UTF8.GetBytes((string)o); - else if (o is char[]) - bs = System.Text.Encoding.UTF8.GetBytes((char[])o); - else if (o is double) - bs = BitConverter.GetBytes((double)o); - else if (o is float) - bs = BitConverter.GetBytes((float)o); - else if (o is char) - bs = BitConverter.GetBytes((char)o); - else if (o is byte) - bs = BitConverter.GetBytes((byte)o); - else if (o is int) - bs = BitConverter.GetBytes((int)o); - else if (o is long) - bs = BitConverter.GetBytes((long)o); - else if (o is short) - bs = BitConverter.GetBytes((short)o); - else if (o is uint) - bs = BitConverter.GetBytes((uint)o); - else if (o is ulong) - bs = BitConverter.GetBytes((ulong)o); - else if (o is ushort) - bs = BitConverter.GetBytes((ushort)o); - - if (bs != null) - mems.Write(bs, 0, bs.Length); - } - } - - return mems.ToArray(); - } - - private static System.Security.Cryptography.SHA256 HashProvider = - System.Security.Cryptography.SHA256.Create(); - - public string ComputeHashcode() - { - var dataBytes = this.ComputeByteArray(); - var hashBytes = Referable.HashProvider.ComputeHash(dataBytes); - - StringBuilder sb = new StringBuilder(); - foreach (var hb in hashBytes) - sb.Append(hb.ToString("X2")); - return sb.ToString(); - } - - // sorting - - public class ComparerIdShort : IComparer - { - public int Compare(Referable a, Referable b) - { - return String.Compare(a?.idShort, b?.idShort, - CultureInfo.InvariantCulture, CompareOptions.IgnoreCase); - } - } - - public class ComparerIndexed : IComparer - { - public int NullIndex = int.MaxValue; - public Dictionary Index = new Dictionary(); - - public int Compare(Referable a, Referable b) - { - var ca = Index.ContainsKey(a); - var cb = Index.ContainsKey(b); - - if (!ca && !cb) - return 0; - // make CDs without usage to appear at end of list - if (!ca) - return +1; - if (!cb) - return -1; - - var ia = Index[a]; - var ib = Index[b]; - - if (ia == ib) - return 0; - if (ia < ib) - return -1; - return +1; - } - } - - // validation - - public virtual void Validate(AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check - if (this.idShort == null || this.idShort.Trim() == "") - results.Add(new AasValidationRecord( - AasValidationSeverity.SpecViolation, this, - "Referable: missing idShort", - () => - { - this.idShort = "TO_FIX"; - })); - - if (this.description != null && (this.description.langString == null - || this.description.langString.Count < 1)) - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, this, - "Referable: existing description with missing langString", - () => - { - this.description = null; - })); - } - - // hierarchy & recursion (by derived elements) - - public virtual void RecurseOnReferables( - object state, Func lambda, - bool includeThis = false) - { - if (includeThis) - lambda(state, null, this); - } - - public Identifiable FindParentFirstIdentifiable() - { - Referable curr = this; - while (curr != null) - { - if (curr is Identifiable curri) - return curri; - curr = curr.parent as Referable; - } - return null; - } - } - - public class Identifiable : Referable, IGetReference - { - - // members - - public Identification identification = new Identification(); - public Administration administration = null; - - // constructors - - public Identifiable() : base() { } - - public Identifiable(string idShort) : base(idShort) { } - - public Identifiable(Identifiable src) - : base(src) - { - if (src == null) - return; - if (src.identification != null) - this.identification = new Identification(src.identification); - if (src.administration != null) - this.administration = new Administration(src.administration); - } - -#if !DoNotUseAasxCompatibilityModels - public Identifiable(AasxCompatibilityModels.AdminShellV10.Identifiable src) - : base(src) - { - if (src.identification != null) - this.identification = new Identification(src.identification); - if (src.administration != null) - this.administration = new Administration(src.administration); - } -#endif - - public void SetIdentification(string idType, string id, string idShort = null) - { - identification.idType = idType; - identification.id = id; - if (idShort != null) - this.idShort = idShort; - } - - public void SetAdminstration(string version, string revision) - { - if (administration == null) - administration = new Administration(); - administration.version = version; - administration.revision = revision; - } - - public new string GetFriendlyName() - { - if (identification != null && identification.id != "") - return AdminShellUtilV20.FilterFriendlyName(this.identification.id); - return AdminShellUtilV20.FilterFriendlyName(this.idShort); - } - - public override string ToString() - { - return ("" + identification?.ToString() + " " + administration?.ToString()).Trim(); - } - - public override Key ToKey() - { - return new Key(GetElementName(), true, "" + identification?.idType, "" + identification?.id); - } - - // self description - - public override Reference GetReference(bool includeParents = true) - { - var r = new Reference(); - r.Keys.Add( - Key.CreateNew( - this.GetElementName(), true, this.identification.idType, this.identification.id)); - return r; - } - - // sorting - - public class ComparerIdentification : IComparer - { - public int Compare(Identifiable a, Identifiable b) - { - if (a?.identification == null && b?.identification == null) - return 0; - if (a?.identification == null) - return +1; - if (b?.identification == null) - return -1; - - var vc = String.Compare(a.identification.idType, b.identification.idType, - CultureInfo.InvariantCulture, CompareOptions.IgnoreCase); - if (vc != 0) - return vc; - - return String.Compare(a.identification.id, b.identification.id, - CultureInfo.InvariantCulture, CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace); - } - } - - } - - public class JsonModelTypeWrapper - { - public string name = ""; - - public JsonModelTypeWrapper(string name = "") { this.name = name; } - } - - public interface IFindAllReferences - { - IEnumerable FindAllReferences(); - } - - public interface IGetSemanticId - { - SemanticId GetSemanticId(); - } - - public class AdministrationShell : Identifiable, IFindAllReferences - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // from hasDataSpecification: - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // from this very class - public AssetAdministrationShellRef derivedFrom = null; - - [JsonProperty(PropertyName = "asset")] - public AssetRef assetRef = new AssetRef(); - - [JsonProperty(PropertyName = "submodels")] - [SkipForSearch] - public List submodelRefs = new List(); - - [JsonIgnore] - public Views views = null; - [XmlIgnore] - [JsonProperty(PropertyName = "views")] - public View[] JsonViews - { - get { return views?.views.ToArray(); } - set { views = Views.CreateOrSetInnerViews(views, value); } - } - - [JsonProperty(PropertyName = "conceptDictionaries")] - public List conceptDictionaries = null; - - // constructors - - public AdministrationShell() { } - - public AdministrationShell(string idShort) : base(idShort) { } - - public AdministrationShell(AdministrationShell src) - : base(src) - { - if (src != null) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - - if (src.derivedFrom != null) - this.derivedFrom = new AssetAdministrationShellRef(src.derivedFrom); - - if (src.assetRef != null) - this.assetRef = new AssetRef(src.assetRef); - - if (src.submodelRefs != null) - foreach (var smr in src.submodelRefs) - this.submodelRefs.Add(new SubmodelRef(smr)); - - if (src.views != null) - this.views = new Views(src.views); - - if (src.conceptDictionaries != null) - { - this.conceptDictionaries = new List(); - foreach (var cdd in src.conceptDictionaries) - this.conceptDictionaries.Add(new ConceptDictionary(cdd)); - } - } - } - -#if !DoNotUseAasxCompatibilityModels - public AdministrationShell(AasxCompatibilityModels.AdminShellV10.AdministrationShell src) - : base(src) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - - if (src.derivedFrom != null) - this.derivedFrom = new AssetAdministrationShellRef(src.derivedFrom); - - if (src.assetRef != null) - this.assetRef = new AssetRef(src.assetRef); - - if (src.submodelRefs != null) - foreach (var smr in src.submodelRefs) - this.submodelRefs.Add(new SubmodelRef(smr)); - - if (src.views != null) - this.views = new Views(src.views); - - if (src.conceptDictionaries != null) - { - this.conceptDictionaries = new List(); - foreach (var cdd in src.conceptDictionaries) - this.conceptDictionaries.Add(new ConceptDictionary(cdd)); - } - } -#endif - - public static AdministrationShell CreateNew( - string idShort, string idType, string id, string version = null, string revision = null) - { - var s = new AdministrationShell(); - s.idShort = idShort; - if (version != null) - s.SetAdminstration(version, revision); - s.identification.idType = idType; - s.identification.id = id; - return (s); - } - - // add - - public void AddView(View v) - { - if (views == null) - views = new Views(); - views.views.Add(v); - } - - public void AddConceptDictionary(ConceptDictionary d) - { - if (conceptDictionaries == null) - conceptDictionaries = new List(); - conceptDictionaries.Add(d); - } - - public void AddDataSpecification(Key k) - { - if (hasDataSpecification == null) - hasDataSpecification = new HasDataSpecification(); - var r = new Reference(); - r.Keys.Add(k); - hasDataSpecification.Add(new EmbeddedDataSpecification(r)); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("AssetAdministrationShell", "AAS"); - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV20.EvalToNonNullString("\"{0}\" ", idShort, "\"AAS\""); - if (administration != null) - caption += "V" + administration.version + "." + administration.revision; - - var info = ""; - if (identification != null) - info = $"[{identification.idType}, {identification.id}]"; - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - public SubmodelRef FindSubmodelRef(Identification refid) - { - if (this.submodelRefs == null) - return null; - foreach (var r in this.submodelRefs) - if (r.Matches(refid)) - return r; - return null; - } - - public bool HasSubmodelRef(SubmodelRef newref) - { - // check, if existing - if (this.submodelRefs == null) - return false; - var found = false; - foreach (var r in this.submodelRefs) - if (r.Matches(newref)) - found = true; - - return found; - } - - public void AddSubmodelRef(SubmodelRef newref) - { - if (this.submodelRefs == null) - this.submodelRefs = new List(); - this.submodelRefs.Add(newref); - } - - public IEnumerable FindAllReferences() - { - // Asset - if (this.assetRef != null) - yield return new LocatedReference(this, this.assetRef); - - // Submodel references - if (this.submodelRefs != null) - foreach (var r in this.submodelRefs) - yield return new LocatedReference(this, r); - - // Views - if (this.views?.views != null) - foreach (var vw in this.views.views) - if (vw?.containedElements?.reference != null) - foreach (var r in vw.containedElements.reference) - yield return new LocatedReference(this, r); - } - } - - public class ListOfAdministrationShells : List, IAasElement - { - // self decscription - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("AssetAdministrationShells", "AASs"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - } - - public class Asset : Identifiable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // from hasDataSpecification: - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // from this very class - [XmlElement(ElementName = "assetIdentificationModelRef")] - public SubmodelRef assetIdentificationModelRef = null; - - [XmlElement(ElementName = "billOfMaterialRef")] - public SubmodelRef billOfMaterialRef = null; - - // from HasKind - [XmlElement(ElementName = "kind")] - [JsonIgnore] - public AssetKind kind = new AssetKind(); - [XmlIgnore] - [JsonProperty(PropertyName = "kind")] - public string JsonKind - { - get - { - if (kind == null) - return null; - return kind.kind; - } - set - { - if (kind == null) - kind = new AssetKind(); - kind.kind = value; - } - } - - // constructors - - public Asset() { } - - public Asset(string idShort) : base(idShort) { } - - public Asset(Asset src) - : base(src) - { - if (src != null) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.kind != null) - this.kind = new AssetKind(src.kind); - if (src.assetIdentificationModelRef != null) - this.assetIdentificationModelRef = new SubmodelRef(src.assetIdentificationModelRef); - } - } - -#if !DoNotUseAasxCompatibilityModels - public Asset(AasxCompatibilityModels.AdminShellV10.Asset src) - : base(src) - { - if (src != null) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.kind != null) - this.kind = new AssetKind(src.kind); - if (src.assetIdentificationModelRef != null) - this.assetIdentificationModelRef = new SubmodelRef(src.assetIdentificationModelRef); - } - } -#endif - - // Getter & setters - - public AssetRef GetAssetReference() - { - var r = new AssetRef(); - r.Keys.Add( - Key.CreateNew( - this.GetElementName(), true, this.identification.idType, this.identification.id)); - return r; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Asset", "Asset"); - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV20.EvalToNonNullString("\"{0}\" ", idShort, ""); - if (administration != null) - caption += "V" + administration.version + "." + administration.revision; - - var info = ""; - if (identification != null) - info = $"[{identification.idType}, {identification.id}]"; - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - public IEnumerable FindAllReferences() - { - if (this.assetIdentificationModelRef != null) - yield return this.assetIdentificationModelRef; - if (this.billOfMaterialRef != null) - yield return this.billOfMaterialRef; - } - } - - public class ListOfAssets : List, IAasElement - { - // self decscription - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Assets", "Assets"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - - } - - public class View : Referable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // from hasSemanticId: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = null; - - // from hasDataSpecification - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // from this very class - [JsonIgnore] - [SkipForSearch] - public ContainedElements containedElements = null; - [XmlIgnore] - [SkipForSearch] - [JsonProperty(PropertyName = "containedElements")] - public ContainedElementRef[] JsonContainedElements - { - get { return containedElements?.reference.ToArray(); } - set { containedElements = ContainedElements.CreateOrSetInner(containedElements, value); } - } - - // getter / setter - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return containedElements == null || containedElements.Count < 1; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (containedElements == null) return 0; return containedElements.Count; } } - - public ContainedElementRef this[int index] - { - get { if (containedElements == null) return null; return containedElements[index]; } - } - - // constructors / creators - - public View() { } - - public View(View src) - : base(src) - { - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.containedElements != null) - this.containedElements = new ContainedElements(src.containedElements); - } - -#if !DoNotUseAasxCompatibilityModels - public View(AasxCompatibilityModels.AdminShellV10.View src) - : base(src) - { - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.containedElements != null) - this.containedElements = new ContainedElements(src.containedElements); - } -#endif - - public static View CreateNew(string idShort) - { - var v = new View() { idShort = idShort }; - return (v); - } - - public void AddDataSpecification(Key k) - { - if (hasDataSpecification == null) - hasDataSpecification = new HasDataSpecification(); - var r = new Reference(); - r.Keys.Add(k); - hasDataSpecification.Add(new EmbeddedDataSpecification(r)); - } - - public void AddContainedElement(Key k) - { - if (containedElements == null) - containedElements = new ContainedElements(); - var r = new ContainedElementRef(); - r.Keys.Add(k); - containedElements.reference.Add(r); - } - - public void AddContainedElement(List keys) - { - if (containedElements == null) - containedElements = new ContainedElements(); - var r = new ContainedElementRef(); - foreach (var k in keys) - r.Keys.Add(k); - containedElements.reference.Add(r); - } - - public void AddContainedElement(Reference r) - { - if (containedElements == null) - containedElements = new ContainedElements(); - containedElements.reference.Add(ContainedElementRef.CreateNew(r)); - } - - public void AddContainedElement(List rlist) - { - if (containedElements == null) - containedElements = new ContainedElements(); - foreach (var r in rlist) - containedElements.reference.Add(ContainedElementRef.CreateNew(r)); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("View", "View"); - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV20.EvalToNonNullString("\"{0}\" ", idShort, ""); - var info = ""; - if (this.semanticId != null) - info = Key.KeyListToString(this.semanticId.Keys); - if (this.containedElements != null && this.containedElements.reference != null) - info = (info + " ").Trim() + - String.Format("({0} elements)", this.containedElements.reference.Count); - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - // validation - - public override void Validate(AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check - base.Validate(results); - KeyList.Validate(results, semanticId?.Keys, this); - } - } - - public class Views - { - [XmlElement(ElementName = "view")] - [JsonIgnore] - public List views = new List(); - - // constructors - - public Views() { } - - public Views(Views src) - { - if (src != null && src.views != null) - foreach (var v in src.views) - this.views.Add(new View(v)); - } - -#if !DoNotUseAasxCompatibilityModels - public Views(AasxCompatibilityModels.AdminShellV10.Views src) - { - if (src != null && src.views != null) - foreach (var v in src.views) - this.views.Add(new View(v)); - } -#endif - - public static Views CreateOrSetInnerViews(Views outer, View[] inner) - { - var res = outer; - if (res == null) - res = new Views(); - if (inner == null) - { - res.views = null; - return res; - } - res.views = new List(inner); - return res; - } - } - - /// - /// Multiple lang string for the AAS namespace - /// - public class LangStringSet - { - - // members - - [XmlElement(ElementName = "langString", Namespace = "http://www.admin-shell.io/aas/2/0")] - public ListOfLangStr langString = new ListOfLangStr(); - - // getters / setters - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return langString == null || langString.Count < 1; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (langString == null) return 0; return langString.Count; } } - [XmlIgnore] - [JsonIgnore] - public LangStr this[int index] { get { return langString[index]; } } - - // constructors - - public LangStringSet() { } - - public LangStringSet(LangStringSet src) - { - if (src.langString != null) - foreach (var ls in src.langString) - this.langString.Add(new LangStr(ls)); - } - - public LangStringSet(ListOfLangStr src) - { - if (src != null) - foreach (var ls in src) - this.langString.Add(new LangStr(ls)); - } - -#if !DoNotUseAasxCompatibilityModels - // not available in V1.0 -#endif - public LangStringSet(string lang, string str) - { - if (str == null || str.Trim() == "") - return; - this.langString.Add(new LangStr(lang, str)); - } - - // converter - - public static LangStringSet CreateFrom(List src) - { - var res = new LangStringSet(); - if (src != null) - foreach (var ls in src) - res.langString.Add(new LangStr(ls)); - return res; - } - - // add - - public LangStr Add(LangStr ls) - { - this.langString.Add(ls); - return ls; - } - - public LangStr Add(string lang, string str) - { - var ls = new LangStr(lang, str); - this.langString.Add(ls); - return ls; - } - - // single string representation - public string GetDefaultStr(string defaultLang = null) - { - return this.langString?.GetDefaultStr(defaultLang); - } - } - - /// - /// Multiple lang string for the IEC61360 namespace - /// - public class LangStringSetIEC61360 : ListOfLangStr - { - - // getters / setters - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return this.Count < 1; } } - - // constructors - - public LangStringSetIEC61360() { } - - public LangStringSetIEC61360(ListOfLangStr lol) : base(lol) { } - - public LangStringSetIEC61360(LangStringSetIEC61360 src) - { - foreach (var ls in src) - this.Add(new LangStr(ls)); - } - -#if !DoNotUseAasxCompatibilityModels - public LangStringSetIEC61360(AasxCompatibilityModels.AdminShellV10.LangStringIEC61360 src) - { - if (src.langString != null) - foreach (var ls in src.langString) - this.Add(new LangStr(ls)); - } -#endif - public LangStringSetIEC61360(string lang, string str) - { - if (str == null || str.Trim() == "") - return; - this.Add(new LangStr(lang, str)); - } - - // converter - - public static LangStringSetIEC61360 CreateFrom(List src) - { - var res = new LangStringSetIEC61360(); - if (src != null) - foreach (var ls in src) - res.Add(new LangStr(ls)); - return res; - } - - } - - public class UnitId - { - - // members - - [XmlIgnore] - [JsonIgnore] - public KeyList keys = new KeyList(); - - // getter / setters - - [XmlArray("keys")] - [XmlArrayItem("key")] - [JsonIgnore] - public KeyList Keys { get { return keys; } } - [XmlIgnore] - [JsonProperty(PropertyName = "keys")] - public KeyList JsonKeys - { - get - { - keys?.NumberIndices(); - return keys; - } - } - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return keys == null || keys.IsEmpty; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (keys == null) return 0; return keys.Count; } } - [XmlIgnore] - [JsonIgnore] - public Key this[int index] { get { return keys[index]; } } - - // constructors / creators - - public UnitId() { } - - public UnitId(UnitId src) - { - if (src.keys != null) - foreach (var k in src.Keys) - this.keys.Add(new Key(k)); - } - -#if !DoNotUseAasxCompatibilityModels - public UnitId(AasxCompatibilityModels.AdminShellV10.UnitId src) - { - if (src.keys != null) - foreach (var k in src.Keys) - this.keys.Add(new Key(k)); - } -#endif - - public static UnitId CreateNew(string type, bool local, string idType, string value) - { - var u = new UnitId(); - u.keys.Add(Key.CreateNew(type, local, idType, value)); - return u; - } - - public static UnitId CreateNew(Reference src) - { - if (src == null) - return null; - var res = new UnitId(); - if (src.Keys != null) - foreach (var k in src.Keys) - res.keys.Add(k); - return res; - } - } - - [XmlRoot(Namespace = "http://www.admin-shell.io/IEC61360/2/0")] - public class DataSpecificationIEC61360 - { - // static member - [XmlIgnore] - [JsonIgnore] - public static string[] DataTypeNames = { - "STRING", - "STRING_TRANSLATABLE", - "REAL_MEASURE", - "REAL_COUNT", - "REAL_CURRENCY", - "INTEGER_MEASURE", - "INTEGER_COUNT", - "INTEGER_CURRENCY", - "BOOLEAN", - "URL", - "RATIONAL", - "RATIONAL_MEASURE", - "TIME", - "TIMESTAMP", - "DATE" }; - - // members - // TODO (MIHO, 2020-08-27): According to spec, cardinality is [1..1][1..n] - // these cardinalities are NOT MAINTAINED in ANY WAY by the system - public LangStringSetIEC61360 preferredName = new LangStringSetIEC61360(); - - // TODO (MIHO, 2020-08-27): According to spec, cardinality is [0..1][1..n] - // these cardinalities are NOT MAINTAINED in ANY WAY by the system - public LangStringSetIEC61360 shortName = null; - - [MetaModelName("DataSpecificationIEC61360.unit")] - [TextSearchable] - [CountForHash] - public string unit = ""; - - public UnitId unitId = null; - - [MetaModelName("DataSpecificationIEC61360.valueFormat")] - [TextSearchable] - [CountForHash] - public string valueFormat = null; - - [MetaModelName("DataSpecificationIEC61360.sourceOfDefinition")] - [TextSearchable] - [CountForHash] - public string sourceOfDefinition = null; - - [MetaModelName("DataSpecificationIEC61360.symbol")] - [TextSearchable] - [CountForHash] - public string symbol = null; - - [MetaModelName("DataSpecificationIEC61360.dataType")] - [TextSearchable] - [CountForHash] - public string dataType = ""; - - // TODO (MIHO, 2020-08-27): According to spec, cardinality is [0..1][1..n] - // these cardinalities are NOT MAINTAINED in ANY WAY by the system - public LangStringSetIEC61360 definition = null; - - // getter / setters - - // constructors - - public DataSpecificationIEC61360() { } - - public DataSpecificationIEC61360(DataSpecificationIEC61360 src) - { - if (src.preferredName != null) - this.preferredName = new LangStringSetIEC61360(src.preferredName); - this.shortName = src.shortName; - this.unit = src.unit; - if (src.unitId != null) - this.unitId = new UnitId(src.unitId); - this.valueFormat = src.valueFormat; - this.sourceOfDefinition = src.sourceOfDefinition; - this.symbol = src.symbol; - this.dataType = src.dataType; - if (src.definition != null) - this.definition = new LangStringSetIEC61360(src.definition); - } - -#if !DoNotUseAasxCompatibilityModels - public DataSpecificationIEC61360(AasxCompatibilityModels.AdminShellV10.DataSpecificationIEC61360 src) - { - if (src.preferredName != null) - this.preferredName = new LangStringSetIEC61360(src.preferredName); - this.shortName = new LangStringSetIEC61360("EN?", src.shortName); - this.unit = src.unit; - if (src.unitId != null) - this.unitId = new UnitId(src.unitId); - this.valueFormat = src.valueFormat; - if (src.sourceOfDefinition != null && src.sourceOfDefinition.Count > 0) - this.sourceOfDefinition = src.sourceOfDefinition[0].str; - this.symbol = src.symbol; - this.dataType = src.dataType; - if (src.definition != null) - this.definition = new LangStringSetIEC61360(src.definition); - } -#endif - - public static DataSpecificationIEC61360 CreateNew( - string[] preferredName = null, - string shortName = "", - string unit = "", - UnitId unitId = null, - string valueFormat = null, - string sourceOfDefinition = null, - string symbol = null, - string dataType = "", - string[] definition = null - ) - { - var d = new DataSpecificationIEC61360(); - if (preferredName != null) - { - d.preferredName = new LangStringSetIEC61360(LangStr.CreateManyFromStringArray(preferredName)); - } - d.shortName = new LangStringSetIEC61360("EN?", shortName); - d.unit = unit; - d.unitId = unitId; - d.valueFormat = valueFormat; - d.sourceOfDefinition = sourceOfDefinition; - d.symbol = symbol; - d.dataType = dataType; - if (definition != null) - { - if (d.definition == null) - d.definition = new LangStringSetIEC61360(); - d.definition = new LangStringSetIEC61360(LangStr.CreateManyFromStringArray(definition)); - } - return (d); - } - - // "constants" - - public static Key GetKey() - { - return Key.CreateNew( - "GlobalReference", false, "IRI", - "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0"); - } - - // validation - - public void Validate(AasValidationRecordList results, ConceptDescription cd) - { - // access - if (results == null || cd == null) - return; - - // check IEC61360 spec - if (this.preferredName == null || this.preferredName.Count < 1) - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, cd, - "ConceptDescription: missing preferredName", - () => - { - this.preferredName = new AdminShell.LangStringSetIEC61360("EN?", - AdminShellUtilV20.EvalToNonEmptyString("{0}", cd.idShort, "UNKNOWN")); - })); - - if (this.shortName != null && this.shortName.Count < 1) - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, cd, - "ConceptDescription: existing shortName with missing langString", - () => - { - this.shortName = null; - })); - - if (this.definition != null && this.definition.Count < 1) - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, cd, - "ConceptDescription: existing definition with missing langString", - () => - { - this.definition = null; - })); - - // check data type - string foundDataType = null; - if (this.dataType != null) - foreach (var dtn in DataTypeNames) - if (this.dataType.Trim() == dtn.Trim()) - foundDataType = this.dataType; - if (foundDataType == null) - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, cd, - "ConceptDescription: dataType does not match allowed enumeration values", - () => - { - this.dataType = "STRING"; - })); - } - } - - // ReSharper disable ClassNeverInstantiated.Global .. class is important to show potential for ISO! - - public class DataSpecificationISO99999 - { - } - - // ReSharper enable ClassNeverInstantiated.Global - - public class DataSpecificationContent - { - - // members - - public DataSpecificationIEC61360 dataSpecificationIEC61360 = null; - public DataSpecificationISO99999 dataSpecificationISO99999 = null; - - // constructors - - public DataSpecificationContent() { } - - public DataSpecificationContent(DataSpecificationContent src) - { - if (src.dataSpecificationIEC61360 != null) - this.dataSpecificationIEC61360 = new DataSpecificationIEC61360(src.dataSpecificationIEC61360); - } - -#if !DoNotUseAasxCompatibilityModels - public DataSpecificationContent(AasxCompatibilityModels.AdminShellV10.DataSpecificationContent src) - { - if (src.dataSpecificationIEC61360 != null) - this.dataSpecificationIEC61360 = new DataSpecificationIEC61360(src.dataSpecificationIEC61360); - } -#endif - } - - public class EmbeddedDataSpecification - { - // members - - [JsonIgnore] - public DataSpecificationContent dataSpecificationContent = null; - - [XmlIgnore] - [JsonProperty("dataSpecificationContent")] - public DataSpecificationIEC61360 JsonWrongDataSpec61360 - { - get { return dataSpecificationContent?.dataSpecificationIEC61360; } - set - { - if (dataSpecificationContent == null) - dataSpecificationContent = new DataSpecificationContent(); - dataSpecificationContent.dataSpecificationIEC61360 = value; - } - } - - public DataSpecificationRef dataSpecification = null; - - // constructors - - public EmbeddedDataSpecification() { } - - public EmbeddedDataSpecification( - DataSpecificationRef dataSpecification, - DataSpecificationContent dataSpecificationContent) - { - this.dataSpecification = dataSpecification; - this.dataSpecificationContent = dataSpecificationContent; - } - - public EmbeddedDataSpecification(EmbeddedDataSpecification src) - { - if (src.dataSpecification != null) - this.dataSpecification = new DataSpecificationRef(src.dataSpecification); - if (src.dataSpecificationContent != null) - this.dataSpecificationContent = new DataSpecificationContent(src.dataSpecificationContent); - } - - public EmbeddedDataSpecification(Reference src) - { - if (src != null) - this.dataSpecification = new DataSpecificationRef(src); - } - -#if !DoNotUseAasxCompatibilityModels - public EmbeddedDataSpecification(AasxCompatibilityModels.AdminShellV10.EmbeddedDataSpecification src) - { - if (src.hasDataSpecification != null) - this.dataSpecification = new DataSpecificationRef(src.hasDataSpecification); - if (src.dataSpecificationContent != null) - this.dataSpecificationContent = new DataSpecificationContent(src.dataSpecificationContent); - } - - public EmbeddedDataSpecification(AasxCompatibilityModels.AdminShellV10.Reference src) - { - if (src != null) - this.dataSpecification = new DataSpecificationRef(src); - } -#endif - - public static EmbeddedDataSpecification CreateIEC61360WithContent() - { - var eds = new EmbeddedDataSpecification(new DataSpecificationRef(), new DataSpecificationContent()); - - eds.dataSpecification.Keys.Add(DataSpecificationIEC61360.GetKey()); - - eds.dataSpecificationContent.dataSpecificationIEC61360 = - AdminShell.DataSpecificationIEC61360.CreateNew(); - - return eds; - } - - public DataSpecificationIEC61360 GetIEC61360() - { - return this.dataSpecificationContent?.dataSpecificationIEC61360; - } - } - - public class ConceptDescription : Identifiable, System.IDisposable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // do this in order to be IDisposable, that is: suitable for (using) - void System.IDisposable.Dispose() { } - public void GetData() { } - // from HasDataSpecification - -#if __not_anymore - - [XmlElement(ElementName = "embeddedDataSpecification")] - [JsonIgnore] - public EmbeddedDataSpecification embeddedDataSpecification = new EmbeddedDataSpecification(); -#else - // According to Spec V2.0.1, a ConceptDescription might feature alos multiple data specifications - /* TODO (MIHO, 2020-08-30): align wording of the member ("embeddedDataSpecification") with the - * wording of the other entities ("hasDataSpecification") */ - [XmlElement(ElementName = "embeddedDataSpecification")] - [JsonIgnore] - public HasDataSpecification embeddedDataSpecification = null; -#endif - - [XmlIgnore] - [JsonProperty(PropertyName = "embeddedDataSpecifications")] - public EmbeddedDataSpecification[] JsonEmbeddedDataSpecifications - { - get - { - return this.embeddedDataSpecification?.ToArray(); - } - set - { - embeddedDataSpecification = new HasDataSpecification(value); - } - } - - // old - - // this class - [XmlIgnore] - private List isCaseOf = null; - - // getter / setter - - [XmlElement(ElementName = "isCaseOf")] - [JsonProperty(PropertyName = "isCaseOf")] - public List IsCaseOf - { - get { return isCaseOf; } - set { isCaseOf = value; } - } - - // constructors / creators - - public ConceptDescription() : base() { } - - public ConceptDescription(ConceptDescription src) - : base(src) - { - if (src.embeddedDataSpecification != null) - this.embeddedDataSpecification = new HasDataSpecification(src.embeddedDataSpecification); - if (src.isCaseOf != null) - foreach (var ico in src.isCaseOf) - { - if (this.isCaseOf == null) - this.isCaseOf = new List(); - this.isCaseOf.Add(new Reference(ico)); - } - } - -#if !DoNotUseAasxCompatibilityModels - public ConceptDescription(AasxCompatibilityModels.AdminShellV10.ConceptDescription src) - : base(src) - { - if (src.embeddedDataSpecification != null) - { - this.embeddedDataSpecification = new HasDataSpecification(); - this.embeddedDataSpecification.Add(new EmbeddedDataSpecification(src.embeddedDataSpecification)); - } - if (src.IsCaseOf != null) - foreach (var ico in src.IsCaseOf) - { - if (this.isCaseOf == null) - this.isCaseOf = new List(); - this.isCaseOf.Add(new Reference(ico)); - } - } -#endif - - public static ConceptDescription CreateNew( - string idShort, string idType, string id, string version = null, string revision = null) - { - var cd = new ConceptDescription(); - cd.idShort = idShort; - cd.identification.idType = idType; - cd.identification.id = id; - if (version != null) - { - if (cd.administration == null) - cd.administration = new Administration(); - cd.administration.version = version; - cd.administration.revision = revision; - } - return (cd); - } - - public Key GetSingleKey() - { - return Key.CreateNew(this.GetElementName(), true, this.identification.idType, this.identification.id); - } - - public ConceptDescriptionRef GetCdReference() - { - var r = new ConceptDescriptionRef(); - r.Keys.Add( - Key.CreateNew( - this.GetElementName(), true, this.identification.idType, this.identification.id)); - return r; - } - - public void SetIEC61360Spec( - string[] preferredNames = null, - string shortName = "", - string unit = "", - UnitId unitId = null, - string valueFormat = null, - string sourceOfDefinition = null, - string symbol = null, - string dataType = "", - string[] definition = null - ) - { - var eds = new EmbeddedDataSpecification(new DataSpecificationRef(), new DataSpecificationContent()); - eds.dataSpecification.Keys.Add( - DataSpecificationIEC61360.GetKey()); - eds.dataSpecificationContent.dataSpecificationIEC61360 = - AdminShell.DataSpecificationIEC61360.CreateNew( - preferredNames, shortName, unit, unitId, valueFormat, sourceOfDefinition, symbol, - dataType, definition); - - this.embeddedDataSpecification = new HasDataSpecification(); - this.embeddedDataSpecification.Add(eds); - - this.AddIsCaseOf( - Reference.CreateNew( - new Key("ConceptDescription", false, this.identification.idType, this.identification.id))); - } - - public DataSpecificationIEC61360 GetIEC61360() - { - return this.embeddedDataSpecification?.IEC61360Content; - } - - // as experimental approach, forward the IEC getter/sett of hasDataSpec directly - - [XmlIgnore] - [JsonIgnore] - public EmbeddedDataSpecification IEC61360DataSpec - { - get - { - return this.embeddedDataSpecification?.IEC61360; - } - set - { - // add embeddedDataSpecification first? - if (this.embeddedDataSpecification == null) - this.embeddedDataSpecification = new HasDataSpecification(); - this.embeddedDataSpecification.IEC61360 = value; - } - } - - [XmlIgnore] - [JsonIgnore] - public DataSpecificationIEC61360 IEC61360Content - { - get - { - return this.embeddedDataSpecification?.IEC61360Content; - } - set - { - // add embeddedDataSpecification first? - if (this.embeddedDataSpecification == null) - this.embeddedDataSpecification = new HasDataSpecification(); - - // check, if e IEC61360 can be found - var eds = this.embeddedDataSpecification.IEC61360; - - // if already there, update - if (eds != null) - { - eds.dataSpecificationContent = new DataSpecificationContent(); - eds.dataSpecificationContent.dataSpecificationIEC61360 = value; - return; - } - - // no: add a full record - eds = EmbeddedDataSpecification.CreateIEC61360WithContent(); - eds.dataSpecificationContent.dataSpecificationIEC61360 = value; - this.embeddedDataSpecification.Add(eds); - } - } - - public DataSpecificationIEC61360 CreateDataSpecWithContentIec61360() - { - var eds = AdminShell.EmbeddedDataSpecification.CreateIEC61360WithContent(); - if (this.embeddedDataSpecification == null) - this.embeddedDataSpecification = new HasDataSpecification(); - this.embeddedDataSpecification.Add(eds); - return eds.dataSpecificationContent?.dataSpecificationIEC61360; - } - - public string GetDefaultPreferredName(string defaultLang = null) - { - return "" + - GetIEC61360()? - .preferredName?.GetDefaultStr(defaultLang); - } - - public string GetDefaultShortName(string defaultLang = null) - { - return "" + - GetIEC61360()? - .shortName?.GetDefaultStr(defaultLang); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("ConceptDescription", "CD"); - } - - public Tuple ToCaptionInfo() - { - var caption = ""; - if (this.idShort != null && this.idShort.Trim() != "") - caption = $"\"{this.idShort.Trim()}\""; - if (this.identification != null) - caption = (caption + " " + this.identification).Trim(); - - var info = "" + GetDefaultShortName(); - - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - public void AddIsCaseOf(Reference ico) - { - if (isCaseOf == null) - isCaseOf = new List(); - isCaseOf.Add(ico); - } - - public static IDisposable CreateNew() - { - throw new NotImplementedException(); - } - - // validation - - public override void Validate(AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check CD itself - base.Validate(results); - - // check IEC61360 spec - var eds61360 = this.IEC61360DataSpec; - if (eds61360 != null) - { - // check data spec - if (eds61360.dataSpecification == null || - !(eds61360.dataSpecification.MatchesExactlyOneKey(DataSpecificationIEC61360.GetKey()))) - results.Add(new AasValidationRecord( - AasValidationSeverity.SpecViolation, this, - "HasDataSpecification: data specification content set to IEC61360, but no " + - "data specification reference set!", - () => - { - eds61360.dataSpecification = new DataSpecificationRef( - new Reference( - DataSpecificationIEC61360.GetKey())); - })); - - // validate content - if (eds61360.dataSpecificationContent?.dataSpecificationIEC61360 == null) - { - results.Add(new AasValidationRecord( - AasValidationSeverity.SpecViolation, this, - "HasDataSpecification: data specification reference set to IEC61360, but no " + - "data specification content set!", - () => - { - eds61360.dataSpecificationContent = new DataSpecificationContent(); - eds61360.dataSpecificationContent.dataSpecificationIEC61360 = - new DataSpecificationIEC61360(); - })); - } - else - { - // validate - eds61360.dataSpecificationContent.dataSpecificationIEC61360.Validate(results, this); - } - } - } - - // more find - - public IEnumerable FindAllReferences() - { - yield break; - } - } - - public class ListOfConceptDescriptions : List, IAasElement - { - // finding - - public ConceptDescription Find(ConceptDescriptionRef cdr) - { - if (cdr == null) - return null; - return Find(cdr.Keys); - } - - public ConceptDescription Find(Identification id) - { - var cdr = ConceptDescriptionRef.CreateNew("Conceptdescription", true, id.idType, id.id); - return Find(cdr); - } - - public ConceptDescription Find(List keys) - { - // trivial - if (keys == null) - return null; - // can only refs with 1 key - if (keys.Count != 1) - return null; - // and we're picky - var key = keys[0]; - if (!key.local || key.type.ToLower().Trim() != "conceptdescription") - return null; - // brute force - foreach (var cd in this) - if (cd.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && cd.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return cd; - // uups - return null; - } - - // item management - - public ConceptDescription AddIfNew(ConceptDescription cd) - { - if (cd == null) - return null; - - var exist = this.Find(cd.identification); - if (exist != null) - return exist; - - this.Add(cd); - return cd; - } - - // self decscription - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("ConceptDescriptions", "CDS"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - - // sorting - - - } - - public class ConceptDictionary : Referable - { - [XmlElement(ElementName = "conceptDescriptions")] - public ConceptDescriptionRefs conceptDescriptionsRefs = null; - - // constructors - - public ConceptDictionary() { } - - public ConceptDictionary(ConceptDictionary src) - { - if (src.conceptDescriptionsRefs != null) - this.conceptDescriptionsRefs = new ConceptDescriptionRefs(src.conceptDescriptionsRefs); - } - -#if !DoNotUseAasxCompatibilityModels - public ConceptDictionary(AasxCompatibilityModels.AdminShellV10.ConceptDictionary src) - { - if (src.conceptDescriptionsRefs != null) - this.conceptDescriptionsRefs = new ConceptDescriptionRefs(src.conceptDescriptionsRefs); - } -#endif - - public static ConceptDictionary CreateNew(string idShort = null) - { - var d = new ConceptDictionary(); - if (idShort != null) - d.idShort = idShort; - return (d); - } - - // add - - public void AddReference(Reference r) - { - var cdr = (ConceptDescriptionRef)(ConceptDescriptionRef.CreateNew(r.Keys)); - if (conceptDescriptionsRefs == null) - conceptDescriptionsRefs = new ConceptDescriptionRefs(); - conceptDescriptionsRefs.conceptDescriptions.Add(cdr); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("ConceptDictionary", "CDic"); - } - } - - /// - /// Use by FindAllReference to provide a enumeration of referenced with location - /// info, where they are contained - /// - public class LocatedReference - { - public Identifiable Identifiable; - public Reference Reference; - - public LocatedReference() { } - public LocatedReference(Identifiable identifiable, Reference reference) - { - Identifiable = identifiable; - Reference = reference; - } - } - - [XmlRoot(ElementName = "aasenv", Namespace = "http://www.admin-shell.io/aas/2/0")] - public class AdministrationShellEnv : IFindAllReferences, IAasElement, IDiaryData, IRecurseOnReferables - { - - // diary (as e.g. deleted AASes need to be listed somewhere) - - [XmlIgnore] - [JsonIgnore] - [SkipForHash] - [SkipForReflection] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [XmlIgnore] - [JsonIgnore] - [SkipForReflection] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - // members - - [XmlAttribute(Namespace = System.Xml.Schema.XmlSchema.InstanceNamespace)] - [JsonIgnore] - public string schemaLocation = - "http://www.admin-shell.io/aas/2/0 AAS.xsd http://www.admin-shell.io/IEC61360/2/0 IEC61360.xsd"; - - [XmlIgnore] // will be ignored, anyway - private ListOfAdministrationShells administrationShells = new ListOfAdministrationShells(); - [XmlIgnore] // will be ignored, anyway - private ListOfAssets assets = new ListOfAssets(); - [XmlIgnore] // will be ignored, anyway - private ListOfSubmodels submodels = new ListOfSubmodels(); - [XmlIgnore] // will be ignored, anyway - private ListOfConceptDescriptions conceptDescriptions = new ListOfConceptDescriptions(); - - // getter / setters - - [XmlArray("assetAdministrationShells")] - [XmlArrayItem("assetAdministrationShell")] - [JsonProperty(PropertyName = "assetAdministrationShells")] - public ListOfAdministrationShells AdministrationShells - { - get { return administrationShells; } - set { administrationShells = value; } - } - - [XmlArray("assets")] - [XmlArrayItem("asset")] - [JsonProperty(PropertyName = "assets")] - public ListOfAssets Assets - { - get { return assets; } - set { assets = value; } - } - - [XmlArray("submodels")] - [XmlArrayItem("submodel")] - [JsonProperty(PropertyName = "submodels")] - public ListOfSubmodels Submodels - { - get { return submodels; } - set { submodels = value; } - } - - [XmlArray("conceptDescriptions")] - [XmlArrayItem("conceptDescription")] - [JsonProperty(PropertyName = "conceptDescriptions")] - public ListOfConceptDescriptions ConceptDescriptions - { - get { return conceptDescriptions; } - set { conceptDescriptions = value; } - } - - // constructors - - public AdministrationShellEnv() { } - -#if !DoNotUseAasxCompatibilityModels - public AdministrationShellEnv(AasxCompatibilityModels.AdminShellV10.AdministrationShellEnv src) - { - if (src.AdministrationShells != null) - foreach (var aas in src.AdministrationShells) - this.administrationShells.Add(new AdministrationShell(aas)); - - if (src.Assets != null) - foreach (var asset in src.Assets) - this.assets.Add(new Asset(asset)); - - if (src.Submodels != null) - foreach (var sm in src.Submodels) - this.submodels.Add(new Submodel(sm)); - - if (src.ConceptDescriptions != null) - foreach (var cd in src.ConceptDescriptions) - this.conceptDescriptions.Add(new ConceptDescription(cd)); - } -#endif - - // to String - - public override string ToString() - { - var res = "AAS-ENV"; - if (AdministrationShells != null) - res += $" {AdministrationShells.Count} AAS"; - if (Assets != null) - res += $" {Assets.Count} Assets"; - if (Submodels != null) - res += $" {Submodels.Count} Submodels"; - if (ConceptDescriptions != null) - res += $" {ConceptDescriptions.Count} CDs"; - return res; - } - - // self decscription - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("AdministrationShellEnv", "Env"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - - // finders - - public AdministrationShell FindAAS(Identification id) - { - if (id == null) - return null; - foreach (var aas in this.AdministrationShells) - if (aas.identification != null && aas.identification.IsEqual(id)) - return aas; - return null; - } - - public AdministrationShell FindAAS(string idShort) - { - if (idShort == null) - return null; - foreach (var aas in this.AdministrationShells) - if (aas.idShort != null && aas.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - return aas; - return null; - } - - public AdministrationShell FindAASwithSubmodel(Identification smid) - { - if (smid == null) - return null; - foreach (var aas in this.AdministrationShells) - if (aas.submodelRefs != null) - foreach (var smref in aas.submodelRefs) - if (smref.Matches(smid)) - return aas; - return null; - } - - public IEnumerable FindAllAAS( - Predicate p = null) - { - if (this.administrationShells == null) - yield break; - foreach (var x in this.administrationShells) - if (p == null || p(x)) - yield return x; - } - - public IEnumerable FindAllSubmodelGroupedByAAS( - Func p = null) - { - if (this.administrationShells == null || this.submodels == null) - yield break; - foreach (var aas in this.administrationShells) - { - if (aas?.submodelRefs == null) - continue; - foreach (var smref in aas.submodelRefs) - { - var sm = this.FindSubmodel(smref); - if (sm != null && (p == null || p(aas, sm))) - yield return sm; - } - } - } - - public Asset FindAsset(Identification id) - { - if (id == null) - return null; - foreach (var asset in this.Assets) - if (asset.identification != null && asset.identification.IsEqual(id)) - return asset; - return null; - } - - public Asset FindAsset(AssetRef aref) - { - // trivial - if (aref == null) - return null; - // can only refs with 1 key - if (aref.Count != 1) - return null; - // and we're picky - var key = aref[0]; - if (!key.local || key.type.ToLower().Trim() != "asset") - return null; - // brute force - foreach (var a in assets) - if (a.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && a.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return a; - // uups - return null; - } - - public Submodel FindSubmodel(Identification id) - { - if (id == null) - return null; - foreach (var sm in this.Submodels) - if (sm.identification != null && sm.identification.IsEqual(id)) - return sm; - return null; - } - - public Submodel FindSubmodel(SubmodelRef smref) - { - // trivial - if (smref == null) - return null; - // can only refs with 1 key - if (smref.Count != 1) - return null; - // and we're picky - var key = smref.Keys[0]; - if (!key.local || key.type.ToLower().Trim() != "submodel") - return null; - // brute force - foreach (var sm in this.Submodels) - if (sm.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && sm.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return sm; - // uups - return null; - } - - public Submodel FindFirstSubmodelBySemanticId(Key semId) - { - // access - if (semId == null) - return null; - - // brute force - foreach (var sm in this.Submodels) - if (true == sm.semanticId?.MatchesExactlyOneKey(semId)) - return sm; - - return null; - } - - public IEnumerable FindAllSubmodelBySemanticId( - Key semId, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - // access - if (semId == null) - yield break; - - // brute force - foreach (var sm in this.Submodels) - if (true == sm.semanticId?.MatchesExactlyOneKey(semId, matchMode)) - yield return sm; - } - - public IEnumerable FindAllReferable(Predicate p) - { - if (p == null) - yield break; - - foreach (var r in this.FindAllReferable()) - if (r != null && p(r)) - yield return r; - } - - public IEnumerable FindAllReferable(bool onlyIdentifiables = false) - { - if (this.AdministrationShells != null) - foreach (var aas in this.AdministrationShells) - if (aas != null) - { - // AAS itself - yield return aas; - - if (!onlyIdentifiables) - { - // Views - if (aas.views?.views != null) - foreach (var view in aas.views.views) - yield return view; - } - } - - if (this.Assets != null) - foreach (var asset in this.Assets) - if (asset != null) - yield return asset; - - if (this.Submodels != null) - foreach (var sm in this.Submodels) - if (sm != null) - { - yield return sm; - - if (!onlyIdentifiables) - { - // TODO (MIHO, 2020-08-26): not very elegant, yet. Avoid temporary collection - var allsme = new ListOfSubmodelElement(); - sm.RecurseOnSubmodelElements(null, (state, parents, sme) => - { - allsme.Add(sme); return true; - }); - foreach (var sme in allsme) - yield return sme; - } - } - - if (this.ConceptDescriptions != null) - foreach (var cd in this.ConceptDescriptions) - if (cd != null) - yield return cd; - } - - // - // Reference handling - // - - public Referable FindReferableByReference(Reference rf, int keyIndex = 0, bool exactMatch = false) - { - return FindReferableByReference(rf?.Keys); - } - - public Referable FindReferableByReference(KeyList kl, int keyIndex = 0, bool exactMatch = false, - ReferableRootInfo rootInfo = null) - { - // first index needs to exist .. - if (kl == null || keyIndex >= kl.Count) - return null; - - // which type? - var firstType = kl[keyIndex].type.Trim().ToLower(); - var firstIdentification = new Identification(kl[keyIndex].idType, kl[keyIndex].value); - AdministrationShell aasToFollow = null; - - if (firstType == Key.AAS.Trim().ToLower()) - { - // search aas - var aas = this.FindAAS(firstIdentification); - - // not found or already at end with our search? - if (aas == null || keyIndex >= kl.Count - 1) - return aas; - - // side info? - if (rootInfo != null) - { - rootInfo.AAS = aas; - rootInfo.NrOfRootKeys = 1 + keyIndex; - } - - // follow up - aasToFollow = aas; - } - - if (firstType == Key.Asset.Trim().ToLower()) - { - // search asset - var asset = this.FindAsset(firstIdentification); - - // not found or already at end with our search? - if (asset == null || keyIndex >= kl.Count - 1) - return exactMatch ? null : asset; - - // try find aas for it - var aas = this.FindAllAAS((a) => - { - return a?.assetRef?.Matches(asset.identification) == true; - }).FirstOrDefault(); - if (aas == null) - return exactMatch ? null : asset; - - // side info? - if (rootInfo != null) - { - rootInfo.Asset = asset; - rootInfo.NrOfRootKeys = 1 + keyIndex; - } - - // follow up - aasToFollow = aas; - } - - // try - if (aasToFollow != null) - { - // search different entities - if (kl[keyIndex + 1].type.Trim().ToLower() == Key.Submodel.ToLower() - || kl[keyIndex + 1].type.Trim().ToLower() == Key.SubmodelRef.ToLower()) - { - // ok, search SubmodelRef - var smref = aasToFollow.FindSubmodelRef(kl[keyIndex + 1].ToId()); - if (smref == null) - return exactMatch ? null : aasToFollow; - - // validate matching submodel - var sm = this.FindSubmodel(smref); - if (sm == null) - return exactMatch ? null : aasToFollow; - - // side info - // side info? - if (rootInfo != null) - { - rootInfo.Submodel = sm; - rootInfo.NrOfRootKeys = 2 + keyIndex; - } - - // at our end? - if (keyIndex >= kl.Count - 2) - return sm; - - // go inside - return SubmodelElementWrapper.FindReferableByReference(sm.submodelElements, kl, keyIndex + 2); - } - } - - if (firstType == Key.ConceptDescription.Trim().ToLower()) - return this.FindConceptDescription(firstIdentification); - - if (firstType == Key.Submodel.Trim().ToLower()) - { - // ok, search Submodel - var sm = this.FindSubmodel(new Identification(kl[keyIndex].idType, kl[keyIndex].value)); - if (sm == null) - return null; - - // notice in side info - if (rootInfo != null) - { - rootInfo.Submodel = sm; - rootInfo.NrOfRootKeys = 1 + keyIndex; - - // add even more info - if (rootInfo.AAS == null) - { - foreach (var aas2 in this.AdministrationShells) - { - var smref2 = aas2.FindSubmodelRef(sm.identification); - if (smref2 != null) - { - rootInfo.AAS = aas2; - break; - } - } - } - } - - // at our end? - if (keyIndex >= kl.Count - 1) - return sm; - - // go inside - return SubmodelElementWrapper.FindReferableByReference(sm.submodelElements, kl, keyIndex + 1); - } - - // nothing in this Environment - return null; - } - - // - // Handling of CDs - // - - public ConceptDescription FindConceptDescription(ConceptDescriptionRef cdr) - { - if (cdr == null) - return null; - return FindConceptDescription(cdr.Keys); - } - - public ConceptDescription FindConceptDescription(SemanticId semId) - { - if (semId == null) - return null; - return FindConceptDescription(semId.Keys); - } - - public ConceptDescription FindConceptDescription(Reference rf) - { - if (rf == null) - return null; - return FindConceptDescription(rf.Keys); - } - - public ConceptDescription FindConceptDescription(Identification id) - { - var cdr = ConceptDescriptionRef.CreateNew("Conceptdescription", true, id.idType, id.id); - return FindConceptDescription(cdr); - } - - public ConceptDescription FindConceptDescription(List keys) - { - // trivial - if (keys == null) - return null; - // can only refs with 1 key - if (keys.Count != 1) - return null; - // and we're picky - var key = keys[0]; - if (!key.local || key.type.ToLower().Trim() != "conceptdescription") - return null; - // brute force - foreach (var cd in conceptDescriptions) - if (cd.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && cd.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return cd; - // uups - return null; - } - - public IEnumerable FindAllSubmodelElements( - Predicate match = null, AdministrationShell onlyForAAS = null) where T : SubmodelElement - { - // more or less two different schemes - if (onlyForAAS != null) - { - if (onlyForAAS.submodelRefs == null) - yield break; - foreach (var smr in onlyForAAS.submodelRefs) - { - var sm = this.FindSubmodel(smr); - if (sm?.submodelElements != null) - foreach (var x in sm.submodelElements.FindDeep(match)) - yield return x; - } - } - else - { - if (this.Submodels != null) - foreach (var sm in this.Submodels) - if (sm?.submodelElements != null) - foreach (var x in sm.submodelElements.FindDeep(match)) - yield return x; - } - } - - public ConceptDescription FindConceptDescription(Key key) - { - if (key == null) - return null; - var l = new List { key }; - return (FindConceptDescription(l)); - } - - public IEnumerable FindAllReferences() - { - if (this.AdministrationShells != null) - foreach (var aas in this.AdministrationShells) - if (aas != null) - foreach (var r in aas.FindAllReferences()) - yield return r; - - if (this.Assets != null) - foreach (var asset in this.Assets) - if (asset != null) - foreach (var r in asset.FindAllReferences()) - yield return new LocatedReference(asset, r); - - if (this.Submodels != null) - foreach (var sm in this.Submodels) - if (sm != null) - foreach (var r in sm.FindAllReferences()) - yield return r; - - if (this.ConceptDescriptions != null) - foreach (var cd in this.ConceptDescriptions) - if (cd != null) - foreach (var r in cd.FindAllReferences()) - yield return new LocatedReference(cd, r); - } - - // creators - - private void CopyConceptDescriptionsFrom( - AdministrationShellEnv srcEnv, SubmodelElement src, bool shallowCopy = false) - { - // access - if (srcEnv == null || src == null || src.semanticId == null) - return; - // check for this SubmodelElement in Source - var cdSrc = srcEnv.FindConceptDescription(src.semanticId.Keys); - if (cdSrc == null) - return; - // check for this SubmodelElement in Destnation (this!) - var cdDest = this.FindConceptDescription(src.semanticId.Keys); - if (cdDest != null) - return; - // copy new - this.ConceptDescriptions.Add(new ConceptDescription(cdSrc)); - // recurse? - if (!shallowCopy && src is SubmodelElementCollection) - foreach (var m in (src as SubmodelElementCollection).value) - CopyConceptDescriptionsFrom(srcEnv, m.submodelElement, shallowCopy: false); - - } - - public SubmodelElementWrapper CopySubmodelElementAndCD( - AdministrationShellEnv srcEnv, SubmodelElement srcElem, bool copyCD = false, bool shallowCopy = false) - { - // access - if (srcEnv == null || srcElem == null) - return null; - - // 1st result pretty easy (calling function will add this to the appropriate Submodel) - var res = new SubmodelElementWrapper(srcElem); - - // copy the CDs.. - if (copyCD) - CopyConceptDescriptionsFrom(srcEnv, srcElem, shallowCopy); - - // give back - return res; - } - - public SubmodelRef CopySubmodelRefAndCD( - AdministrationShellEnv srcEnv, SubmodelRef srcSubRef, bool copySubmodel = false, bool copyCD = false, - bool shallowCopy = false) - { - // access - if (srcEnv == null || srcSubRef == null) - return null; - - // need to have the source Submodel - var srcSub = srcEnv.FindSubmodel(srcSubRef); - if (srcSub == null) - return null; - - // 1st result pretty easy (calling function will add this to the appropriate AAS) - var dstSubRef = new SubmodelRef(srcSubRef); - - // get the destination and shall src != dst - var dstSub = this.FindSubmodel(dstSubRef); - if (srcSub == dstSub) - return null; - - // maybe we need the Submodel in our environment, as well - if (dstSub == null && copySubmodel) - { - dstSub = new Submodel(srcSub, shallowCopy); - this.Submodels.Add(dstSub); - } - else - if (dstSub != null) - { - // there is already an submodel, just add members - if (!shallowCopy && srcSub.submodelElements != null) - { - if (dstSub.submodelElements == null) - dstSub.submodelElements = new SubmodelElementWrapperCollection(); - foreach (var smw in srcSub.submodelElements) - dstSub.submodelElements.Add( - new SubmodelElementWrapper( - smw.submodelElement, shallowCopy: false)); - } - } - - // copy the CDs.. - if (copyCD && srcSub.submodelElements != null) - foreach (var smw in srcSub.submodelElements) - CopyConceptDescriptionsFrom(srcEnv, smw.submodelElement, shallowCopy); - - // give back - return dstSubRef; - } - - /// - /// Tries renaming an Identifiable, specifically: the identification of an Identifiable and - /// all references to it. - /// Currently supported: ConceptDescriptions - /// Returns a list of Referables, which were changed or null in case of error - /// - public List RenameIdentifiable(Identification oldId, Identification newId) - where T : Identifiable - { - // access - if (oldId == null || newId == null || oldId.IsEqual(newId)) - return null; - - var res = new List(); - - if (typeof(T) == typeof(ConceptDescription)) - { - // check, if exist or not exist - var cdOld = FindConceptDescription(oldId); - if (cdOld == null || FindConceptDescription(newId) != null) - return null; - - // rename old cd - cdOld.identification = newId; - res.Add(cdOld); - - // search all SMEs referring to this CD - foreach (var sme in this.FindAllSubmodelElements(match: (s) => - { - return (s != null && s.semanticId != null && s.semanticId.Matches(oldId)); - })) - { - sme.semanticId[0].idType = newId.idType; - sme.semanticId[0].value = newId.id; - res.Add(sme); - } - - // seems fine - return res; - } - - if (typeof(T) == typeof(Submodel)) - { - // check, if exist or not exist - var smOld = FindSubmodel(oldId); - if (smOld == null || FindSubmodel(newId) != null) - return null; - - // recurse all possible Referenes in the aas env - foreach (var lr in this.FindAllReferences()) - { - var r = lr?.Reference; - if (r != null) - for (int i = 0; i < r.Count; i++) - if (r[i].Matches(Key.Submodel, false, oldId.idType, oldId.id, Key.MatchMode.Relaxed)) - { - // directly replace - r[i].idType = newId.idType; - r[i].value = newId.id; - if (res.Contains(lr.Identifiable)) - res.Add(lr.Identifiable); - } - } - - // rename old Submodel - smOld.identification = newId; - - // seems fine - return res; - } - - if (typeof(T) == typeof(Asset)) - { - // check, if exist or not exist - var assetOld = FindAsset(oldId); - if (assetOld == null || FindAsset(newId) != null) - return null; - - // recurse all possible Referenes in the aas env - foreach (var lr in this.FindAllReferences()) - { - var r = lr?.Reference; - if (r != null) - for (int i = 0; i < r.Count; i++) - if (r[i].Matches(Key.Asset, false, oldId.idType, oldId.id, Key.MatchMode.Relaxed)) - { - // directly replace - r[i].idType = newId.idType; - r[i].value = newId.id; - if (res.Contains(lr.Identifiable)) - res.Add(lr.Identifiable); - } - } - - // rename old Submodel - assetOld.identification = newId; - - // seems fine - return res; - } - - // no result is false, as well - return null; - } - - // serializations - - public void SerializeXmlToStream(StreamWriter s) - { - var serializer = new XmlSerializer(typeof(AdminShell.AdministrationShellEnv)); - var nss = new XmlSerializerNamespaces(); - nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - nss.Add("aas", "http://www.admin-shell.io/aas/2/0"); - nss.Add("IEC61360", "http://www.admin-shell.io/IEC61360/2/0"); - serializer.Serialize(s, this, nss); - } - - public JsonWriter SerialiazeJsonToStream(StreamWriter sw, bool leaveJsonWriterOpen = false) - { - sw.AutoFlush = true; - - JsonSerializer serializer = new JsonSerializer() - { - NullValueHandling = NullValueHandling.Ignore, - ReferenceLoopHandling = ReferenceLoopHandling.Serialize, - Formatting = Newtonsoft.Json.Formatting.Indented - }; - - JsonWriter writer = new JsonTextWriter(sw); - serializer.Serialize(writer, this); - if (leaveJsonWriterOpen) - return writer; - writer.Close(); - return null; - } - - public AdministrationShellEnv DeserializeFromXmlStream(TextReader reader) - { - XmlSerializer serializer = new XmlSerializer( - typeof(AdminShell.AdministrationShellEnv), "http://www.admin-shell.io/aas/2/0"); - var res = serializer.Deserialize(reader) as AdminShell.AdministrationShellEnv; - return res; - } - - public AdministrationShellEnv DeserializeFromJsonStream(TextReader reader) - { - JsonSerializer serializer = new JsonSerializer(); - serializer.Converters.Add(new AdminShellConverters.JsonAasxConverter("modelType", "name")); - var res = (AdministrationShellEnv)serializer.Deserialize(reader, typeof(AdministrationShellEnv)); - return res; - } - - // special functions - - private static void CreateFromExistingEnvRecurseForCDs( - AdministrationShellEnv src, List wrappers, - ref List filterForCD) - { - if (wrappers == null || filterForCD == null) - return; - - foreach (var w in wrappers) - { - // access - if (w == null) - continue; - - // include in filter .. - if (w.submodelElement.semanticId != null) - { - var cd = src.FindConceptDescription(w.submodelElement.semanticId.Keys); - if (cd != null) - filterForCD.Add(cd); - } - - // recurse? - if (w.submodelElement is SubmodelElementCollection smec) - CreateFromExistingEnvRecurseForCDs(src, smec.value, ref filterForCD); - - if (w.submodelElement is Operation op) - for (int i = 0; i < 2; i++) - { - var w2s = Operation.GetWrappers(op[i]); - CreateFromExistingEnvRecurseForCDs(src, w2s, ref filterForCD); - } - - if (w.submodelElement is Entity smee) - CreateFromExistingEnvRecurseForCDs(src, smee.statements, ref filterForCD); - - if (w.submodelElement is AnnotatedRelationshipElement smea) - CreateFromExistingEnvRecurseForCDs(src, smea.annotations, ref filterForCD); - } - } - - public static AdministrationShellEnv CreateFromExistingEnv(AdministrationShellEnv src, - List filterForAas = null, - List filterForAsset = null, - ListOfSubmodels filterForSubmodel = null, - List filterForCD = null) - { - // prepare defaults - if (filterForAas == null) - filterForAas = new List(); - if (filterForAsset == null) - filterForAsset = new List(); - if (filterForSubmodel == null) - filterForSubmodel = new ListOfSubmodels(); - if (filterForCD == null) - filterForCD = new List(); - - // make new - var res = new AdministrationShellEnv(); - - // take over AAS - foreach (var aas in src.administrationShells) - if (filterForAas.Contains(aas)) - { - // take over - res.administrationShells.Add(new AdministrationShell(aas)); - - // consequences - if (aas.assetRef != null) - { - var asset = src.FindAsset(aas.assetRef); - if (asset != null) - filterForAsset.Add(asset); - } - - if (aas.submodelRefs != null) - foreach (var smr in aas.submodelRefs) - { - var sm = src.FindSubmodel(smr); - if (sm != null) - filterForSubmodel.Add(sm); - } - - if (aas.conceptDictionaries != null) - foreach (var cdd in aas.conceptDictionaries) - if (cdd.conceptDescriptionsRefs != null && - cdd.conceptDescriptionsRefs.conceptDescriptions != null) - foreach (var cdr in cdd.conceptDescriptionsRefs.conceptDescriptions) - { - var cd = src.FindConceptDescription(cdr); - if (cd != null) - filterForCD.Add(cd); - } - } - - // take over Assets - foreach (var asset in src.assets) - if (filterForAsset.Contains(asset)) - { - // take over - res.assets.Add(new Asset(asset)); - } - - // take over Submodels - foreach (var sm in src.Submodels) - if (filterForSubmodel.Contains(sm)) - { - // take over - res.submodels.Add(new Submodel(sm)); - - // recursion in order to find used CDs - CreateFromExistingEnvRecurseForCDs(src, sm.submodelElements, ref filterForCD); - } - - // ConceptDescriptions - foreach (var cd in src.ConceptDescriptions) - if (filterForCD.Contains(cd)) - { - // take over - res.conceptDescriptions.Add(new ConceptDescription(cd)); - } - - // ok - return res; - } - - // Sorting - - public Referable.ComparerIndexed CreateIndexedComparerCdsForSmUsage() - { - var cmp = new Referable.ComparerIndexed(); - int nr = 0; - foreach (var sm in FindAllSubmodelGroupedByAAS()) - foreach (var sme in sm.FindDeep()) - { - if (sme.semanticId == null) - continue; - var cd = this.FindConceptDescription(sme.semanticId); - if (cd == null) - continue; - if (cmp.Index.ContainsKey(cd)) - continue; - cmp.Index[cd] = nr++; - } - return cmp; - } - - // Validation - - public AasValidationRecordList ValidateAll() - { - // collect results - var results = new AasValidationRecordList(); - - // all entities - foreach (var rf in this.FindAllReferable()) - rf.Validate(results); - - // give back - return results; - } - - public int AutoFix(IEnumerable records) - { - // access - if (records == null) - return -1; - - // collect Referables (expensive safety measure) - var allowedReferables = this.FindAllReferable().ToList(); - - // go thru records - int res = 0; - foreach (var rec in records) - { - // access - if (rec == null || rec.Fix == null || rec.Source == null) - continue; - - // minimal safety measure - if (!allowedReferables.Contains(rec.Source)) - continue; - - // apply fix - res++; - try - { - rec.Fix.Invoke(); - } - catch - { - res--; - } - } - - // return number of applied fixes - return res; - } - - public void RecurseOnReferables( - object state, Func lambda, bool includeThis = false) - { - // includeThis does not make sense, as no Referable - // just use the others - foreach (var idf in this.FindAllReferable(onlyIdentifiables: true)) - idf?.RecurseOnReferables(state, lambda, includeThis); - } - } - - // - // Submodel + Submodel elements - // - - public interface IGetReference - { - Reference GetReference(bool includeParents = true); - } - - public interface IGetQualifiers - { - QualifierCollection GetQualifiers(); - } - - public class Qualifier : IAasElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // member - // from hasSemantics: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = null; - - // this class - // TODO (Michael Hoffmeister, 2020-08-01): check, if Json has Qualifiers or not - - [MetaModelName("Qualifier.type")] - [TextSearchable] - [CountForHash] - public string type = ""; - - [MetaModelName("Qualifier.valueType")] - [TextSearchable] - [CountForHash] - public string valueType = ""; - - [CountForHash] - public Reference valueId = null; - - [MetaModelName("Qualifier.value")] - [TextSearchable] - [CountForHash] - public string value = null; - - // dead-csharp off - // Remark: due to publication of v2.0.1, the order of elements has changed!!! - // from hasSemantics: - // [XmlElement(ElementName = "semanticId")] - // [JsonIgnore] - // public SemanticId semanticId = null; - // dead-csharp on - - // constructors - - public Qualifier() { } - - public Qualifier(Qualifier src) - { - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - this.type = src.type; - this.value = src.value; - if (src.valueId != null) - this.valueId = new Reference(src.valueId); - } - - public Qualifier(string type, string value) - { - this.type = type; - this.value = value; - } - -#if !DoNotUseAasxCompatibilityModels - public Qualifier(AasxCompatibilityModels.AdminShellV10.Qualifier src) - { - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - this.type = src.qualifierType; - this.value = src.qualifierValue; - if (src.qualifierValueId != null) - this.valueId = new Reference(src.qualifierValueId); - } -#endif - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Qualifier", "Qfr"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - - // ReSharper disable MethodOverloadWithOptionalParameter .. this seems to work, anyhow - // ReSharper disable RedundantArgumentDefaultValue - public string ToString(int format = 0, string delimiter = ",") - { - var res = "" + type; - if (res == "") - res += "" + semanticId?.ToString(format, delimiter); - - if (value != null) - res += " = " + value; - else if (valueId != null) - res += " = " + valueId?.ToString(format, delimiter); - - return res; - } - - public override string ToString() - { - return this.ToString(0); - } - // ReSharper enable MethodOverloadWithOptionalParameter - // ReSharper enable RedundantArgumentDefaultValue - - public static Qualifier Parse(string input) - { - var m = Regex.Match(input, @"\s*([^,]*)(,[^=]+){0,1}\s*=\s*([^,]*)(,.+){0,1}\s*"); - if (!m.Success) - return null; - - return new Qualifier() - { - type = m.Groups[1].ToString().Trim(), - semanticId = SemanticId.Parse(m.Groups[1].ToString().Trim()), - value = m.Groups[3].ToString().Trim(), - valueId = Reference.Parse(m.Groups[1].ToString().Trim()) - }; - } - } - - /// - /// This class holds some convenience functions for Qualifiers - /// - public class QualifierCollection : List - { - public QualifierCollection() - { - - } - -#if !DoNotUseAasxCompatibilityModels - public QualifierCollection( - List src, bool shallowCopy = false) - - { - if (src != null && src.Count != 0) - { - foreach (var q in src) - { - this.Add(new Qualifier(q)); - } - } - } -#endif - - /// - /// Add qualifier. If null, do nothing - /// - public new void Add(Qualifier q) - { - if (q == null) - return; - base.Add(q); - } - - public Qualifier FindType(string type) - { - if (type == null) - return null; - foreach (var q in this) - if (q != null && q.type != null && q.type.Trim() == type.Trim()) - return q; - return null; - } - - public Qualifier FindSemanticId(SemanticId semId) - { - if (semId == null) - return null; - foreach (var q in this) - if (q != null && q.semanticId != null && q.semanticId.Matches(semId)) - return q; - return null; - } - - // ReSharper disable MethodOverloadWithOptionalParameter .. this seems to work, anyhow - // ReSharper disable RedundantArgumentDefaultValue - public string ToString(int format = 0, string delimiter = ";", string referencesDelimiter = ",") - { - var res = ""; - foreach (var q in this) - { - if (res != "") - res += delimiter; - res += q.ToString(format, referencesDelimiter); - } - return res; - } - - public override string ToString() - { - return this.ToString(0); - } - // ReSharper enable MethodOverloadWithOptionalParameter - // ReSharper enable RedundantArgumentDefaultValue - - // for convenience methods of Submodel, SubmodelElement - - public static void AddQualifier( - ref QualifierCollection qualifiers, - Qualifier q) - { - if (q == null) - return; - if (qualifiers == null) - qualifiers = new QualifierCollection(); - qualifiers.Add(q); - } - - public static void AddQualifier( - ref QualifierCollection qualifiers, - string qualifierType = null, string qualifierValue = null, KeyList semanticKeys = null, - Reference qualifierValueId = null) - { - if (qualifiers == null) - qualifiers = new QualifierCollection(); - var q = new Qualifier() - { - type = qualifierType, - value = qualifierValue, - valueId = qualifierValueId, - }; - if (semanticKeys != null) - q.semanticId = SemanticId.CreateFromKeys(semanticKeys); - qualifiers.Add(q); - } - - public static Qualifier HasQualifierOfType( - QualifierCollection qualifiers, - string qualifierType) - { - if (qualifiers == null || qualifierType == null) - return null; - foreach (var q in qualifiers) - if (q.type.Trim().ToLower() == qualifierType.Trim().ToLower()) - return q; - return null; - } - - public IEnumerable FindAllQualifierType(string qualifierType) - { - if (qualifierType == null) - yield break; - foreach (var q in this) - if (q.type.Trim().ToLower() == qualifierType.Trim().ToLower()) - yield return q; - } - } - - public class ListOfSubmodelElement : List - { - // conversion to other list - - public KeyList ToKeyList() - { - var res = new KeyList(); - foreach (var sme in this) - res.Add(sme.ToKey()); - return res; - } - - public Reference GetReference() - { - return Reference.CreateNew(ToKeyList()); - } - } - - public class SubmodelElement : Referable, System.IDisposable, IGetReference, IGetSemanticId, IGetQualifiers - { - // constants - public static Type[] PROP_MLP = new Type[] { - typeof(AdminShell.MultiLanguageProperty), typeof(AdminShell.Property) }; - - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // do this in order to be IDisposable, that is: suitable for (using) - void System.IDisposable.Dispose() { } - public void GetData() { } - - // from HasKind - [XmlElement(ElementName = "kind")] - [JsonIgnore] - public ModelingKind kind = new ModelingKind(); - [XmlIgnore] - [JsonProperty(PropertyName = "kind")] - public string JsonKind - { - get - { - if (kind == null) - return null; - return kind.kind; - } - set - { - if (kind == null) - kind = new ModelingKind(); - kind.kind = value; - } - } - - // from hasSemanticId: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = new SemanticId(); - public SemanticId GetSemanticId() { return semanticId; } - - // from Qualifiable: - [XmlArray("qualifier")] - [XmlArrayItem("qualifier")] - [JsonProperty(PropertyName = "constraints")] - public QualifierCollection qualifiers = null; - public QualifierCollection GetQualifiers() => qualifiers; - - // from hasDataSpecification: - [XmlElement(ElementName = "embeddedDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // getter / setter - - // constructors / creators - - public SubmodelElement() - : base() { } - - public SubmodelElement(SubmodelElement src) - : base(src) - { - if (src == null) - return; - if (src.hasDataSpecification != null) - hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.semanticId != null) - semanticId = new SemanticId(src.semanticId); - if (src.kind != null) - kind = new ModelingKind(src.kind); - if (src.qualifiers != null) - { - if (qualifiers == null) - qualifiers = new QualifierCollection(); - foreach (var q in src.qualifiers) - qualifiers.Add(new Qualifier(q)); - } - } - -#if !DoNotUseAasxCompatibilityModels - public SubmodelElement(AasxCompatibilityModels.AdminShellV10.SubmodelElement src) - : base(src) - { - if (src.hasDataSpecification != null) - hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.semanticId != null) - semanticId = new SemanticId(src.semanticId); - if (src.kind != null) - kind = new ModelingKind(src.kind); - if (src.qualifiers != null) - { - if (qualifiers == null) - qualifiers = new QualifierCollection(src.qualifiers); - foreach (var q in src.qualifiers) - qualifiers.Add(new Qualifier(q)); - } - } -#endif - - public static T CreateNew(string idShort = null, string category = null, Reference semanticId = null) - where T : SubmodelElement, new() - { - var res = new T(); - if (idShort != null) - res.idShort = idShort; - if (category != null) - res.category = category; - if (semanticId != null) - res.semanticId = new SemanticId(semanticId); - return res; - } - - public void CreateNewLogic(string idShort = null, string category = null, Key semanticIdKey = null) - { - if (idShort != null) - this.idShort = idShort; - if (category != null) - this.category = category; - if (semanticIdKey != null) - { - if (this.semanticId == null) - this.semanticId = new SemanticId(); - this.semanticId.Keys.Add(semanticIdKey); - } - } - - public void AddQualifier( - Qualifier q) - { - QualifierCollection.AddQualifier( - ref this.qualifiers, q); - } - - public void AddQualifier( - string qualifierType = null, string qualifierValue = null, KeyList semanticKeys = null, - Reference qualifierValueId = null) - { - QualifierCollection.AddQualifier( - ref this.qualifiers, qualifierType, qualifierValue, semanticKeys, qualifierValueId); - } - - public Qualifier HasQualifierOfType(string qualifierType) - { - return QualifierCollection.HasQualifierOfType(this.qualifiers, qualifierType); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("SubmodelElement", "SME"); - } - - public override Reference GetReference(bool includeParents = true) - { - Reference r = new Reference(); - // this is the tail of our referencing chain .. - r.Keys.Add(Key.CreateNew(GetElementName(), true, "IdShort", this.idShort)); - // try to climb up .. - var current = this.parent; - while (includeParents && current != null) - { - if (current is Identifiable cid) - { - // add big information set - r.Keys.Insert(0, Key.CreateNew( - current.GetElementName(), - true, - cid.identification.idType, - cid.identification.id)); - } - else - if (current is Referable crf) - { - // reference via idShort - r.Keys.Insert(0, Key.CreateNew( - current.GetElementName(), - true, - "IdShort", crf.idShort)); - } - - if (current is Referable crf2) - current = crf2.parent; - else - current = null; - } - return r; - } - - public IEnumerable FindAllParents( - Predicate p, - bool includeThis = false, bool includeSubmodel = false, - bool passOverMiss = false) - { - // call for this? - if (includeThis) - { - if (p == null || p.Invoke(this)) - yield return this; - else - if (!passOverMiss) - yield break; - } - - // daisy chain all parents .. - if (this.parent != null) - { - if (this.parent is SubmodelElement psme) - { - foreach (var q in psme.FindAllParents(p, includeThis: true, - passOverMiss: passOverMiss)) - yield return q; - } - else if (includeSubmodel && this.parent is Submodel psm) - { - if (p == null || p.Invoke(psm)) - yield return this; - } - } - } - - public IEnumerable FindAllParentsWithSemanticId( - SemanticId semId, - bool includeThis = false, bool includeSubmodel = false, bool passOverMiss = false) - { - return (FindAllParents( - (rf) => (true == (rf as IGetSemanticId)?.GetSemanticId()?.Matches(semId, - matchMode: Key.MatchMode.Relaxed)), - includeThis: includeThis, includeSubmodel: includeSubmodel, passOverMiss: passOverMiss)); - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV20.EvalToNonNullString("\"{0}\" ", idShort, ""); - var info = ""; - // TODO (MIHO, 2021-07-08): obvious error .. info should receive semanticId .. but would change - // display presentation .. therefore to be checked again - if (semanticId != null) - AdminShellUtilV20.EvalToNonEmptyString("\u21e8 {0}", semanticId.ToString(), ""); - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - public virtual string ValueAsText(string defaultLang = null) - { - return ""; - } - - public virtual double? ValueAsDouble() - { - return null; - } - - public virtual void ValueFromText(string text, string defaultLang = null) - { - } - - // validation - - public override void Validate(AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check - base.Validate(results); - ModelingKind.Validate(results, kind, this); - KeyList.Validate(results, semanticId?.Keys, this); - } - } - - [XmlType(TypeName = "submodelElement")] - public class SubmodelElementWrapper - { - - // members - - [XmlElement(ElementName = "property", Type = typeof(Property))] - [XmlElement(ElementName = "multiLanguageProperty", Type = typeof(MultiLanguageProperty))] - [XmlElement(ElementName = "range", Type = typeof(Range))] - [XmlElement(ElementName = "file", Type = typeof(File))] - [XmlElement(ElementName = "blob", Type = typeof(Blob))] - [XmlElement(ElementName = "referenceElement", Type = typeof(ReferenceElement))] - [XmlElement(ElementName = "relationshipElement", Type = typeof(RelationshipElement))] - [XmlElement(ElementName = "annotatedRelationshipElement", Type = typeof(AnnotatedRelationshipElement))] - [XmlElement(ElementName = "capability", Type = typeof(Capability))] - [XmlElement(ElementName = "submodelElementCollection", Type = typeof(SubmodelElementCollection))] - [XmlElement(ElementName = "operation", Type = typeof(Operation))] - [XmlElement(ElementName = "basicEvent", Type = typeof(BasicEvent))] - [XmlElement(ElementName = "entity", Type = typeof(Entity))] - public SubmodelElement submodelElement; - - // element names - public enum AdequateElementEnum - { - Unknown = 0, SubmodelElementCollection, Property, MultiLanguageProperty, Range, File, Blob, - ReferenceElement, RelationshipElement, AnnotatedRelationshipElement, Capability, Operation, - BasicEvent, Entity - } - - public static AdequateElementEnum[] AdequateElementsDataElement = - { - AdequateElementEnum.SubmodelElementCollection, AdequateElementEnum.RelationshipElement, - AdequateElementEnum.AnnotatedRelationshipElement, AdequateElementEnum.Capability, - AdequateElementEnum.Operation, AdequateElementEnum.BasicEvent, AdequateElementEnum.Entity - }; - - public static string[] AdequateElementNames = { "Unknown", "SubmodelElementCollection", "Property", - "MultiLanguageProperty", "Range", "File", "Blob", "ReferenceElement", "RelationshipElement", - "AnnotatedRelationshipElement", "Capability", "Operation", "BasicEvent", "Entity" }; - - public static string[] AdequateElementShortName = { null, "SMC", null, - "MLP", null, null, null, "Ref", "Rel", - "ARel", null, null, "Event", "Entity" }; - - // constructors - - public SubmodelElementWrapper() { } - - // cloning - - public SubmodelElementWrapper(SubmodelElement src, bool shallowCopy = false) - { - /* TODO (MIHO, 2021-08-12): consider using: - Activator.CreateInstance(pl.GetType(), new object[] { pl }) */ - - if (src is SubmodelElementCollection) - this.submodelElement = new SubmodelElementCollection( - src as SubmodelElementCollection, shallowCopy: shallowCopy); - if (src is Property) - this.submodelElement = new Property(src as Property); - if (src is MultiLanguageProperty) - this.submodelElement = new MultiLanguageProperty(src as MultiLanguageProperty); - if (src is Range) - this.submodelElement = new Range(src as Range); - if (src is File) - this.submodelElement = new File(src as File); - if (src is Blob) - this.submodelElement = new Blob(src as Blob); - if (src is ReferenceElement) - this.submodelElement = new ReferenceElement(src as ReferenceElement); - if (src is RelationshipElement) - this.submodelElement = new RelationshipElement(src as RelationshipElement); - if (src is AnnotatedRelationshipElement) - this.submodelElement = new AnnotatedRelationshipElement(src as AnnotatedRelationshipElement); - if (src is Capability) - this.submodelElement = new Capability(src as Capability); - if (src is Operation) - this.submodelElement = new Operation(src as Operation); - if (src is BasicEvent) - this.submodelElement = new BasicEvent(src as BasicEvent); - if (src is Entity) - this.submodelElement = new Entity(src as Entity); - } - -#if !DoNotUseAasxCompatibilityModels - public SubmodelElementWrapper( - AasxCompatibilityModels.AdminShellV10.SubmodelElement src, bool shallowCopy = false) - { - if (src is AasxCompatibilityModels.AdminShellV10.SubmodelElementCollection) - this.submodelElement = new SubmodelElementCollection( - src as AasxCompatibilityModels.AdminShellV10.SubmodelElementCollection, - shallowCopy: shallowCopy); - if (src is AasxCompatibilityModels.AdminShellV10.Property) - this.submodelElement = new Property(src as AasxCompatibilityModels.AdminShellV10.Property); - if (src is AasxCompatibilityModels.AdminShellV10.File) - this.submodelElement = new File(src as AasxCompatibilityModels.AdminShellV10.File); - if (src is AasxCompatibilityModels.AdminShellV10.Blob) - this.submodelElement = new Blob(src as AasxCompatibilityModels.AdminShellV10.Blob); - if (src is AasxCompatibilityModels.AdminShellV10.ReferenceElement) - this.submodelElement = new ReferenceElement( - src as AasxCompatibilityModels.AdminShellV10.ReferenceElement); - if (src is AasxCompatibilityModels.AdminShellV10.RelationshipElement) - this.submodelElement = new RelationshipElement( - src as AasxCompatibilityModels.AdminShellV10.RelationshipElement); - if (src is AasxCompatibilityModels.AdminShellV10.Operation) - this.submodelElement = new Operation(src as AasxCompatibilityModels.AdminShellV10.Operation); - } -#endif - - public static string GetAdequateName(AdequateElementEnum ae) - { - return AdequateElementNames[(int)ae]; - } - - /// - /// Deprecated. See below. - /// - public static AdequateElementEnum GetAdequateEnum(string adequateName) - { - if (adequateName == null) - return AdequateElementEnum.Unknown; - - foreach (var en in (AdequateElementEnum[])Enum.GetValues(typeof(AdequateElementEnum))) - if (Enum.GetName(typeof(AdequateElementEnum), en)?.Trim().ToLower() == - adequateName.Trim().ToLower()) - return en; - - return AdequateElementEnum.Unknown; - } - - /// - /// This version uses the element name array and allows using ShortName - /// - public static AdequateElementEnum GetAdequateEnum2(string adequateName, bool useShortName = false) - { - if (adequateName == null) - return AdequateElementEnum.Unknown; - - foreach (var en in (AdequateElementEnum[])Enum.GetValues(typeof(AdequateElementEnum))) - if (((int)en < AdequateElementNames.Length - && AdequateElementNames[(int)en].Trim().ToLower() == adequateName.Trim().ToLower()) - || (useShortName - && (int)en < AdequateElementShortName.Length - && AdequateElementShortName[(int)en] != null - && AdequateElementShortName[(int)en].Trim().ToLower() == adequateName.Trim().ToLower())) - return en; - - return AdequateElementEnum.Unknown; - } - - public static IEnumerable GetAdequateEnums( - AdequateElementEnum[] excludeValues = null, AdequateElementEnum[] includeValues = null) - { - if (includeValues != null) - { - foreach (var en in includeValues) - yield return en; - } - else - { - foreach (var en in (AdequateElementEnum[])Enum.GetValues(typeof(AdequateElementEnum))) - { - if (en == AdequateElementEnum.Unknown) - continue; - if (excludeValues != null && excludeValues.Contains(en)) - continue; - yield return en; - } - } - } - - /// - /// Introduced for JSON serialization, can create SubModelElements based on a string name - /// - public static SubmodelElement CreateAdequateType(AdequateElementEnum ae, SubmodelElement src = null) - { - if (ae == AdequateElementEnum.Property) - return new Property(src); - if (ae == AdequateElementEnum.MultiLanguageProperty) - return new MultiLanguageProperty(src); - if (ae == AdequateElementEnum.Range) - return new Range(src); - if (ae == AdequateElementEnum.File) - return new File(src); - if (ae == AdequateElementEnum.Blob) - return new Blob(src); - if (ae == AdequateElementEnum.ReferenceElement) - return new ReferenceElement(src); - if (ae == AdequateElementEnum.RelationshipElement) - return new RelationshipElement(src); - if (ae == AdequateElementEnum.AnnotatedRelationshipElement) - return new AnnotatedRelationshipElement(src); - if (ae == AdequateElementEnum.Capability) - return new Capability(src); - if (ae == AdequateElementEnum.SubmodelElementCollection) - return new SubmodelElementCollection(src); - if (ae == AdequateElementEnum.Operation) - return new Operation(src); - if (ae == AdequateElementEnum.BasicEvent) - return new BasicEvent(src); - if (ae == AdequateElementEnum.Entity) - return new Entity(src); - return null; - } - - /// - /// Introduced for JSON serialization, can create SubModelElements based on a string name - /// - /// string name (standard PascalCased) - public static SubmodelElement CreateAdequateType(string elementName) - { - return CreateAdequateType(GetAdequateEnum(elementName)); - } - - /// - /// Can create SubmodelElements based on a given type information - /// - /// Type of the SME to be created - /// SubmodelElement or null - public static SubmodelElement CreateAdequateType(Type t) - { - if (t == null || !t.IsSubclassOf(typeof(AdminShell.SubmodelElement))) - return null; - var sme = Activator.CreateInstance(t) as SubmodelElement; - return sme; - } - - public string GetElementAbbreviation() - { - if (submodelElement == null) - return ("Null"); - var dsc = submodelElement.GetSelfDescription(); - if (dsc?.ElementAbbreviation == null) - return ("Null"); - return dsc.ElementAbbreviation; - } - - public static string GetElementNameByAdequateType(SubmodelElement sme) - { - // access - var sd = sme.GetSelfDescription(); - if (sd == null || sd.ElementEnum == AdequateElementEnum.Unknown) - return null; - var en = sd.ElementEnum; - - // get the names - string res = null; - if ((int)en < AdequateElementNames.Length) - res = AdequateElementNames[(int)en].Trim(); - if ((int)en < AdequateElementShortName.Length && AdequateElementShortName[(int)en] != null) - res = AdequateElementShortName[(int)en].Trim(); - return res; - } - - public static ListOfSubmodelElement ListOfWrappersToListOfElems(List wrappers) - { - var res = new ListOfSubmodelElement(); - if (wrappers == null) - return res; - foreach (var w in wrappers) - if (w.submodelElement != null) - res.Add(w.submodelElement); - return res; - } - - public static SubmodelElementWrapper CreateFor(SubmodelElement sme) - { - var res = new SubmodelElementWrapper() { submodelElement = sme }; - return res; - } - - public static Referable FindReferableByReference( - List wrappers, Reference rf, int keyIndex) - { - return FindReferableByReference(wrappers, rf?.Keys, keyIndex); - } - - public static Referable FindReferableByReference( - List wrappers, KeyList rf, int keyIndex) - { - // first index needs to exist .. - if (wrappers == null || rf == null || keyIndex >= rf.Count) - return null; - - // as SubmodelElements are not Identifiables, the actual key shall be IdShort - if (rf[keyIndex].idType.Trim().ToLower() != Key.GetIdentifierTypeName( - Key.IdentifierType.IdShort).Trim().ToLower()) - return null; - - // over all wrappers - foreach (var smw in wrappers) - if (smw.submodelElement != null && - smw.submodelElement.idShort.Trim().ToLower() == rf[keyIndex].value.Trim().ToLower()) - { - // match on this level. Did we find a leaf element? - if ((keyIndex + 1) >= rf.Count) - return smw.submodelElement; - - // dive into SMC? - if (smw.submodelElement is SubmodelElementCollection smc) - { - var found = FindReferableByReference(smc.value, rf, keyIndex + 1); - if (found != null) - return found; - } - - // dive into Entity statements? - if (smw.submodelElement is Entity ent) - { - var found = FindReferableByReference(ent.statements, rf, keyIndex + 1); - if (found != null) - return found; - } - - // else: - return null; - } - - // no? - return null; - } - - // typecasting wrapper into specific type - public T GetAs() where T : SubmodelElement - { - var x = (this.submodelElement) as T; - return x; - } - - } - - public class SubmodelElementWrapperCollection : BaseSubmodelElementWrapperCollection - { - public SubmodelElementWrapperCollection() : base() { } - - public SubmodelElementWrapperCollection(SubmodelElementWrapper smw) : base(smw) { } - - public SubmodelElementWrapperCollection(SubmodelElement sme) : base(sme) { } - - public SubmodelElementWrapperCollection(SubmodelElementWrapperCollection other) : base(other) { } - } - - public class DataElementWrapperCollection : BaseSubmodelElementWrapperCollection - { - public DataElementWrapperCollection() : base() { } - - public DataElementWrapperCollection(SubmodelElementWrapperCollection other) - : base(other) - { - } - - public DataElementWrapperCollection(DataElementWrapperCollection other) - : base() - { - foreach (var wo in other) - this.Add(wo); - } - } - - /// - /// Provides some more functionalities for searching specific elements, e.g. in a SMEC - /// - // OZ - // Resharper disable UnusedTypeParameter - public class BaseSubmodelElementWrapperCollection : List - where ELEMT : SubmodelElement - { - // Resharper enable UnusedTypeParameter - - // member: Parent - // will be held correctly by the containing class - public Referable Parent = null; - - // constructors - - public BaseSubmodelElementWrapperCollection() : base() { } - - public BaseSubmodelElementWrapperCollection(SubmodelElementWrapperCollection other) - : base() - { - if (other == null) - return; - - foreach (var smw in other) - this.Add(new SubmodelElementWrapper(smw.submodelElement)); - } - - public BaseSubmodelElementWrapperCollection(SubmodelElementWrapper smw) - : base() - { - if (smw != null) - this.Add(smw); - } - - public BaseSubmodelElementWrapperCollection(SubmodelElement sme) - : base() - { - if (sme != null) - this.Add(new SubmodelElementWrapper(sme)); - } - - // better find functions - - public IEnumerable FindDeep(Predicate match = null) where T : SubmodelElement - { - foreach (var smw in this) - { - var current = smw.submodelElement; - if (current == null) - continue; - - // call lambda for this element - if (current is T) - if (match == null || match.Invoke(current as T)) - yield return current as T; - - // dive into? - // TODO (MIHO, 2020-07-31): would be nice to use IEnumerateChildren for this .. - if (current is SubmodelElementCollection smc && smc.value != null) - foreach (var x in smc.value.FindDeep(match)) - yield return x; - - if (current is AnnotatedRelationshipElement are && are.annotations != null) - foreach (var x in are.annotations.FindDeep(match)) - yield return x; - - if (current is Entity ent && ent.statements != null) - foreach (var x in ent.statements.FindDeep(match)) - yield return x; - - if (current is Operation op) - for (int i = 0; i < 2; i++) - if (Operation.GetWrappers(op[i]) != null) - foreach (var x in Operation.GetWrappers(op[i]).FindDeep(match)) - yield return x; - } - } - - public IEnumerable FindAllIdShort(string idShort) - { - foreach (var smw in this) - if (smw.submodelElement != null) - if (smw.submodelElement.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - yield return smw; - } - - public IEnumerable FindAllIdShortAs(string idShort) where T : SubmodelElement - { - foreach (var smw in this) - if (smw.submodelElement != null && smw.submodelElement is T) - if (smw.submodelElement.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - yield return smw.submodelElement as T; - } - - public SubmodelElementWrapper FindFirstIdShort(string idShort) - { - return FindAllIdShort(idShort)?.FirstOrDefault(); - } - - public T FindFirstIdShortAs(string idShort) where T : SubmodelElement - { - return FindAllIdShortAs(idShort)?.FirstOrDefault(); - } - - public IEnumerable FindAllSemanticId( - Key semId, Type[] allowedTypes = null, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - foreach (var smw in this) - if (smw.submodelElement != null && smw.submodelElement.semanticId != null) - { - if (smw.submodelElement == null) - continue; - - if (allowedTypes != null) - { - var smwt = smw.submodelElement.GetType(); - if (!allowedTypes.Contains(smwt)) - continue; - } - - if (smw.submodelElement.semanticId.MatchesExactlyOneKey(semId, matchMode)) - yield return smw; - } - } - - public IEnumerable FindAllSemanticIdAs(Key semId, Key.MatchMode matchMode = Key.MatchMode.Strict) - where T : SubmodelElement - { - foreach (var smw in this) - if (smw.submodelElement != null && smw.submodelElement is T - && smw.submodelElement.semanticId != null) - if (smw.submodelElement.semanticId.MatchesExactlyOneKey(semId, matchMode)) - yield return smw.submodelElement as T; - } - - public IEnumerable FindAllSemanticIdAs(Reference semId, - Key.MatchMode matchMode = Key.MatchMode.Strict) - where T : SubmodelElement - { - foreach (var smw in this) - if (smw.submodelElement != null && smw.submodelElement is T - && smw.submodelElement.semanticId != null) - if (smw.submodelElement.semanticId.Matches(semId, matchMode)) - yield return smw.submodelElement as T; - } - - public IEnumerable FindAllSemanticIdAs(ConceptDescription cd, - Key.MatchMode matchMode = Key.MatchMode.Strict) - where T : SubmodelElement - { - foreach (var x in FindAllSemanticIdAs(cd.GetReference(), matchMode)) - yield return x; - } - - public SubmodelElementWrapper FindFirstSemanticId( - Key semId, Type[] allowedTypes = null, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - return FindAllSemanticId(semId, allowedTypes, matchMode)?.FirstOrDefault(); - } - - public SubmodelElementWrapper FindFirstAnySemanticId( - Key[] semId, Type[] allowedTypes = null, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (semId == null) - return null; - foreach (var si in semId) - { - var found = FindAllSemanticId(si, allowedTypes, matchMode)? - .FirstOrDefault(); - if (found != null) - return found; - } - return null; - } - - public T FindFirstSemanticIdAs(Key semId, Key.MatchMode matchMode = Key.MatchMode.Strict) - where T : SubmodelElement - { - return FindAllSemanticIdAs(semId, matchMode)?.FirstOrDefault(); - } - - public T FindFirstAnySemanticIdAs(Key[] semId, Key.MatchMode matchMode = Key.MatchMode.Strict) - where T : SubmodelElement - { - if (semId == null) - return null; - foreach (var si in semId) - { - var found = FindAllSemanticIdAs(si, matchMode)?.FirstOrDefault(); - if (found != null) - return found; - } - return null; - } - - public T FindFirstSemanticIdAs(Reference semId, Key.MatchMode matchMode = Key.MatchMode.Strict) - where T : SubmodelElement - { - return FindAllSemanticIdAs(semId, matchMode)?.FirstOrDefault(); - } - - /* TODO (MIHO, 2021-10-18): there are overlaps of this new function with - * this old function: FindFirstAnySemanticId(Key[] semId .. - * clarify/ refactor */ - public IEnumerable FindAllSemanticId( - Key[] allowedSemId, Key.MatchMode matchMode = Key.MatchMode.Strict, - bool invertAllowed = false) - where T : SubmodelElement - { - if (allowedSemId == null || allowedSemId.Length < 1) - yield break; - - foreach (var smw in this) - { - if (smw.submodelElement == null || !(smw.submodelElement is T)) - continue; - - if (smw.submodelElement.semanticId == null || smw.submodelElement.semanticId.Count < 1) - { - if (invertAllowed) - yield return smw.submodelElement as T; - continue; - } - - var found = false; - foreach (var semId in allowedSemId) - if (smw.submodelElement.semanticId.MatchesExactlyOneKey(semId, matchMode)) - { - found = true; - break; - } - - if (invertAllowed) - found = !found; - - if (found) - yield return smw.submodelElement as T; - } - } - - public T FindFirstAnySemanticId( - Key[] allowedSemId, Key.MatchMode matchMode = Key.MatchMode.Strict, - bool invertAllowed = false) - where T : SubmodelElement - { - return FindAllSemanticId(allowedSemId, matchMode, invertAllowed)?.FirstOrDefault(); - } - - // recursion - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. Also a list of parents will be provided to - /// the lambda. This list of parents can be initialized or simply set to null - /// in order to be created automatically. - /// - /// State object to be provided to lambda. Could be null. - /// List of already existing parents to be provided to lambda. - /// Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// - public void RecurseOnReferables( - object state, ListOfReferable parents, - Func lambda) - { - // trivial - if (lambda == null) - return; - if (parents == null) - parents = new ListOfReferable(); - - // over all elements - foreach (var smw in this) - { - var current = smw.submodelElement; - if (current == null) - continue; - - // call lambda for this element - // AND decide, if to recurse! - var goDeeper = lambda(state, parents, current); - - if (goDeeper) - { - // add to parents - parents.Add(current); - - // dive into? - if (current is SubmodelElementCollection smc) - smc.value?.RecurseOnReferables(state, parents, lambda); - - if (current is Entity ent) - ent.statements?.RecurseOnReferables(state, parents, lambda); - - if (current is Operation op) - for (int i = 0; i < 2; i++) - Operation.GetWrappers(op[i])?.RecurseOnReferables(state, parents, lambda); - - if (current is AnnotatedRelationshipElement arel) - arel.annotations?.RecurseOnReferables(state, parents, lambda); - - // remove from parents - parents.RemoveAt(parents.Count - 1); - } - } - } - - // idShort management - - /// - /// Checks, if given idShort is already existing in the collection of SubmodelElements. - /// Trims the string, but does not ignore upper/ lowercase. An empty idShort returns false. - /// - public bool CheckIdShortIsUnique(string idShort) - { - idShort = idShort?.Trim(); - if (idShort == null || idShort.Length < 1) - return false; - - var res = true; - foreach (var smw in this) - if (smw.submodelElement != null && smw.submodelElement.idShort != null && - smw.submodelElement.idShort == idShort) - { - res = false; - break; - } - - return res; - } - - /// - /// The string idShortTemplate shall contain Format.String partt such as {0}. - /// A int-Parameter is as long incremented, until the resulting idShort proves - /// to be unique in the collection of SubmodelElements or maxNum is reached. - /// Returns null in case of any error. - /// - public string IterateIdShortTemplateToBeUnique(string idShortTemplate, int maxNum) - { - if (idShortTemplate == null || maxNum < 1 || !idShortTemplate.Contains("{0")) - return null; - - int i = 1; - while (i < maxNum) - { - var ids = String.Format(idShortTemplate, i); - if (this.CheckIdShortIsUnique(ids)) - return ids; - i++; - } - - return null; - } - - // give more direct access to SMEs - - /// - /// Add sme by creating a SubmodelElementWrapper for it and adding to this collection. - /// - public void Add(SubmodelElement sme) - { - if (sme == null) - return; - sme.parent = this.Parent; - this.Add(SubmodelElementWrapper.CreateFor(sme)); - } - - /// - /// Add sme by creating a SubmodelElementWrapper for it and adding to this collection. - /// - public void Insert(int index, SubmodelElement sme) - { - if (sme == null || index < 0 || index >= this.Count) - return; - sme.parent = this.Parent; - this.Insert(index, SubmodelElementWrapper.CreateFor(sme)); - } - - /// - /// Finds the first (shall be only 1!) SubmodelElementWrapper with SubmodelElement sme. - /// - public SubmodelElementWrapper FindSubModelElement(SubmodelElement sme) - { - if (sme != null) - foreach (var smw in this) - if (smw?.submodelElement == sme) - return smw; - return null; - } - - /// - /// Removes the first (shall be only 1!) SubmodelElementWrapper with SubmodelElement sme. - /// - public void Remove(SubmodelElement sme) - { - if (sme == null) - return; - var found = FindSubModelElement(sme); - if (found != null) - this.Remove(found); - } - - // a little more business logic - - public T CreateSMEForCD(ConceptDescription cd, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false, bool isTemplate = false) - where T : SubmodelElement, new() - { - // access - if (cd == null) - return null; - - // try to potentially figure out idShort - var ids = cd.idShort; - if ((ids == null || ids.Trim() == "") && cd.GetIEC61360() != null) - ids = cd.GetIEC61360().shortName? - .GetDefaultStr(); - if (idShort != null) - ids = idShort; - if (ids == null) - return null; - - // unique? - if (idxTemplate != null) - ids = this.IterateIdShortTemplateToBeUnique(idxTemplate, maxNum); - - // make a new instance - var sme = new T() - { - idShort = ids, - semanticId = new SemanticId(cd.GetCdReference()) - }; - if (category != null) - sme.category = category; - if (isTemplate) - sme.kind = ModelingKind.CreateAsTemplate(); - - // if its a SMC, make sure its accessible - if (sme is SubmodelElementCollection smc) - smc.value = new SubmodelElementWrapperCollection(); - - // instantanously add it? - if (addSme) - this.Add(sme); - - // give back - return sme; - } - - public T CreateSMEForIdShort(string idShort, string category = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - // access - if (idShort == null) - return null; - - // try to potentially figure out idShort - var ids = idShort; - - // unique? - if (idxTemplate != null) - ids = this.IterateIdShortTemplateToBeUnique(idxTemplate, maxNum); - - // make a new instance - var sme = new T() { idShort = ids }; - if (category != null) - sme.category = category; - - // instantanously add it? - if (addSme) - this.Add(sme); - - // give back - return sme; - } - - // for conversion - - public T AdaptiveConvertTo( - SubmodelElement anySrc, - ConceptDescription createDefault = null, - string idShort = null, bool addSme = false) where T : SubmodelElement, new() - { - if (typeof(T) == typeof(MultiLanguageProperty) - && anySrc is Property srcProp) - { - var res = this.CreateSMEForCD(createDefault, idShort: idShort, addSme: addSme); - if (res is MultiLanguageProperty mlp) - { - mlp.value = new LangStringSet("EN?", srcProp.value); - mlp.valueId = srcProp.valueId; - return res; - } - } - - if (typeof(T) == typeof(Property) - && anySrc is MultiLanguageProperty srcMlp) - { - var res = this.CreateSMEForCD(createDefault, idShort: idShort, addSme: addSme); - if (res is Property prp) - { - prp.value = "" + srcMlp.value?.GetDefaultStr(); - prp.valueId = srcMlp.valueId; - return res; - } - } - - return null; - } - - public T CopyOneSMEbyCopy(Key destSemanticId, - SubmodelElementWrapperCollection sourceSmc, Key[] sourceSemanticId, - ConceptDescription createDefault = null, Action setDefault = null, - Key.MatchMode matchMode = Key.MatchMode.Relaxed, - string idShort = null, bool addSme = false) where T : SubmodelElement, new() - { - // get source - var src = sourceSmc?.FindFirstAnySemanticIdAs(sourceSemanticId, matchMode); - - // may be make an adaptive conversion - if (src == null) - { - var anySrc = sourceSmc?.FindFirstAnySemanticId(sourceSemanticId, matchMode: matchMode); - src = AdaptiveConvertTo(anySrc?.submodelElement, createDefault, - idShort: idShort, addSme: false); - } - - // proceed - var aeSrc = SubmodelElementWrapper.GetAdequateEnum(src?.GetElementName()); - if (src == null || aeSrc == SubmodelElementWrapper.AdequateElementEnum.Unknown) - { - // create a default? - if (createDefault == null) - return null; - - // ok, default - var dflt = this.CreateSMEForCD(createDefault, idShort: idShort, addSme: addSme); - - // set default? - setDefault?.Invoke(dflt); - - // return - return dflt; - } - - // ok, create new one - var dst = SubmodelElementWrapper.CreateAdequateType(aeSrc, src) as T; - if (dst == null) - return null; - - // make same things sure - dst.idShort = src.idShort; - dst.category = src.category; - dst.semanticId = new SemanticId(destSemanticId); - - // instantanously add it? - if (addSme) - this.Add(dst); - - // give back - return dst; - } - - public T CopyOneSMEbyCopy(ConceptDescription destCD, - SubmodelElementWrapperCollection sourceSmc, ConceptDescription sourceCD, - bool createDefault = false, Action setDefault = null, - Key.MatchMode matchMode = Key.MatchMode.Relaxed, - string idShort = null, bool addSme = false) where T : SubmodelElement, new() - { - return this.CopyOneSMEbyCopy(destCD?.GetSingleKey(), sourceSmc, new[] { sourceCD?.GetSingleKey() }, - createDefault ? destCD : null, setDefault, matchMode, idShort, addSme); - } - - public T CopyOneSMEbyCopy(ConceptDescription destCD, - SubmodelElementWrapperCollection sourceSmc, Key[] sourceKeys, - bool createDefault = false, Action setDefault = null, - Key.MatchMode matchMode = Key.MatchMode.Relaxed, - string idShort = null, bool addSme = false) where T : SubmodelElement, new() - { - return this.CopyOneSMEbyCopy(destCD?.GetSingleKey(), sourceSmc, sourceKeys, - createDefault ? destCD : null, setDefault, matchMode, idShort, addSme); - } - - public void CopyManySMEbyCopy(Key destSemanticId, - SubmodelElementWrapperCollection sourceSmc, Key sourceSemanticId, - ConceptDescription createDefault = null, Action setDefault = null, - Key.MatchMode matchMode = Key.MatchMode.Relaxed) where T : SubmodelElement, new() - { - // bool find possible sources - bool foundSrc = false; - if (sourceSmc == null) - return; - foreach (var src in sourceSmc.FindAllSemanticIdAs(sourceSemanticId, matchMode)) - { - // type of found src? - var aeSrc = SubmodelElementWrapper.GetAdequateEnum(src?.GetElementName()); - - // ok? - if (src == null || aeSrc == SubmodelElementWrapper.AdequateElementEnum.Unknown) - continue; - foundSrc = true; - - // ok, create new one - var dst = SubmodelElementWrapper.CreateAdequateType(aeSrc, src) as T; - if (dst != null) - { - // make same things sure - dst.idShort = src.idShort; - dst.category = src.category; - dst.semanticId = new SemanticId(destSemanticId); - - // instantanously add it? - this.Add(dst); - } - } - - // default? - if (createDefault != null && !foundSrc) - { - // ok, default - var dflt = this.CreateSMEForCD(createDefault, addSme: true); - - // set default? - setDefault?.Invoke(dflt); - } - } - - public void CopyManySMEbyCopy(ConceptDescription destCD, - SubmodelElementWrapperCollection sourceSmc, ConceptDescription sourceCD, - bool createDefault = false, Action setDefault = null, - Key.MatchMode matchMode = Key.MatchMode.Relaxed) where T : SubmodelElement, new() - { - CopyManySMEbyCopy(destCD.GetSingleKey(), sourceSmc, sourceCD.GetSingleKey(), - createDefault ? destCD : null, setDefault, matchMode); - } - } - - public interface IManageSubmodelElements - { - void Add(SubmodelElement sme); - void Insert(int index, SubmodelElement sme); - void Remove(SubmodelElement sme); - } - - public class Submodel : Identifiable, IManageSubmodelElements, - System.IDisposable, IEnumerateChildren, IFindAllReferences, - IGetSemanticId, IGetQualifiers - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // do this in order to be IDisposable, that is: suitable for (using) - void System.IDisposable.Dispose() { } - public void GetData() { } - - // from HasKind - [XmlElement(ElementName = "kind")] - [JsonIgnore] - public ModelingKind kind = new ModelingKind(); - [XmlIgnore] - [JsonProperty(PropertyName = "kind")] - public string JsonKind - { - get - { - if (kind == null) - return null; - return kind.kind; - } - set - { - if (kind == null) - kind = new ModelingKind(); - kind.kind = value; - } - } - - // from hasSemanticId: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = new SemanticId(); - public SemanticId GetSemanticId() { return semanticId; } - - // from Qualifiable: - [XmlArray("qualifier")] - [XmlArrayItem("qualifier")] - public QualifierCollection qualifiers = null; - public QualifierCollection GetQualifiers() => qualifiers; - - // from hasDataSpecification: - [XmlElement(ElementName = "embeddedDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // from this very class - [XmlIgnore] - [JsonIgnore] - private SubmodelElementWrapperCollection _submodelElements = null; - - [JsonIgnore] - public SubmodelElementWrapperCollection submodelElements - { - get { return _submodelElements; } - set { _submodelElements = value; _submodelElements.Parent = this; } - } - - [XmlIgnore] - [JsonProperty(PropertyName = "submodelElements")] - public SubmodelElement[] JsonSubmodelElements - { - get - { - var res = new ListOfSubmodelElement(); - if (submodelElements != null) - foreach (var smew in submodelElements) - res.Add(smew.submodelElement); - return res.ToArray(); - } - set - { - if (value != null) - { - this.submodelElements = new SubmodelElementWrapperCollection(); - foreach (var x in value) - { - var smew = new SubmodelElementWrapper() { submodelElement = x }; - this.submodelElements.Add(smew); - } - } - } - } - - // getter / setter - - // constructors / creators - - public Submodel() : base() { } - - public Submodel(Submodel src, bool shallowCopy = false) - : base(src) - { - if (src == null) - return; - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - if (src.kind != null) - this.kind = new ModelingKind(src.kind); - if (!shallowCopy && src.submodelElements != null) - { - if (this.submodelElements == null) - this.submodelElements = new SubmodelElementWrapperCollection(); - foreach (var smw in src.submodelElements) - this.submodelElements.Add(new SubmodelElementWrapper(smw.submodelElement, shallowCopy: false)); - } - } - -#if !DoNotUseAasxCompatibilityModels - public Submodel(AasxCompatibilityModels.AdminShellV10.Submodel src, bool shallowCopy = false) - : base(src) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - if (src.kind != null) - this.kind = new ModelingKind(src.kind); - if (src.qualifiers != null) - this.qualifiers = new QualifierCollection(src.qualifiers); - if (!shallowCopy && src.submodelElements != null) - { - if (this.submodelElements == null) - this.submodelElements = new SubmodelElementWrapperCollection(); - foreach (var smw in src.submodelElements) - this.submodelElements.Add(new SubmodelElementWrapper(smw.submodelElement, shallowCopy: false)); - } - } -#endif - - public static Submodel CreateNew(string idType, string id, string version = null, string revision = null) - { - var s = new Submodel() { identification = new Identification(idType, id) }; - if (version != null) - { - if (s.administration == null) - s.administration = new Administration(); - s.administration.version = version; - s.administration.revision = revision; - } - return (s); - } - - [JsonIgnore] - [XmlIgnore] - public SubmodelElementWrapperCollection SmeForWrite - { - get - { - if (this.submodelElements == null) - this.submodelElements = new SubmodelElementWrapperCollection(); - return this.submodelElements; - } - } - - // from IEnumarateChildren - public IEnumerable EnumerateChildren() - { - if (this.submodelElements != null) - foreach (var smw in this.submodelElements) - yield return smw; - } - - public EnumerationPlacmentBase GetChildrenPlacement(SubmodelElement child) - { - return null; - } - - public object AddChild(SubmodelElementWrapper smw, EnumerationPlacmentBase placement = null) - { - if (smw == null) - return null; - if (this.submodelElements == null) - this.submodelElements = new SubmodelElementWrapperCollection(); - if (smw.submodelElement != null) - smw.submodelElement.parent = this; - this.submodelElements.Add(smw); - return smw; - } - - // from IManageSubmodelElements - public void Add(SubmodelElement sme) - { - if (submodelElements == null) - submodelElements = new SubmodelElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - submodelElements.Add(sew); - } - - public void Insert(int index, SubmodelElement sme) - { - if (submodelElements == null) - submodelElements = new SubmodelElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - if (index < 0 || index >= submodelElements.Count) - return; - submodelElements.Insert(index, sew); - } - - public void Remove(SubmodelElement sme) - { - if (submodelElements != null) - submodelElements.Remove(sme); - } - - // further - - public void AddQualifier( - string qualifierType = null, string qualifierValue = null, KeyList semanticKeys = null, - Reference qualifierValueId = null) - { - QualifierCollection.AddQualifier( - ref this.qualifiers, qualifierType, qualifierValue, semanticKeys, qualifierValueId); - } - - public Qualifier HasQualifierOfType(string qualifierType) - { - return QualifierCollection.HasQualifierOfType(this.qualifiers, qualifierType); - } - - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Submodel", "SM"); - } - - public SubmodelRef GetSubmodelRef() - { - SubmodelRef l = new SubmodelRef(); - l.Keys.Add( - Key.CreateNew( - this.GetElementName(), true, this.identification.idType, this.identification.id)); - return l; - } - - /// - /// If instance, return semanticId as on key. - /// If template, return identification as key. - /// - /// - public Key GetSemanticKey() - { - if (true == this.kind?.IsTemplate) - return new Key(this.GetElementName(), true, this.identification?.idType, this.identification?.id); - else - return this.semanticId?.GetAsExactlyOneKey(); - } - - public void AddDataSpecification(Key k) - { - if (hasDataSpecification == null) - hasDataSpecification = new HasDataSpecification(); - var r = new Reference(); - r.Keys.Add(k); - hasDataSpecification.Add(new EmbeddedDataSpecification(r)); - } - - public SubmodelElementWrapper FindSubmodelElementWrapper(string idShort) - { - if (this.submodelElements == null) - return null; - foreach (var smw in this.submodelElements) - if (smw.submodelElement != null) - if (smw.submodelElement.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - return smw; - return null; - } - - public IEnumerable FindDeep(Predicate match = null) where T : SubmodelElement - { - if (this.submodelElements == null) - yield break; - foreach (var x in this.submodelElements.FindDeep(match)) - yield return x; - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV20.EvalToNonNullString("\"{0}\" ", idShort, ""); - if (administration != null) - caption += "V" + administration.version + "." + administration.revision; - var info = ""; - if (identification != null) - info = $"[{identification.idType}, {identification.id}]"; - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - // Recursing - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// - public void RecurseOnSubmodelElements( - object state, Func lambda) - { - this.submodelElements?.RecurseOnReferables(state, null, (o, par, rf) => - { - if (rf is SubmodelElement sme) - return lambda(o, par, sme); - else - return true; - }); - } - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. Include this element, as well. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// Include this element as well. parents will then - /// include this element as well! - public override void RecurseOnReferables( - object state, Func lambda, - bool includeThis = false) - { - var parents = new ListOfReferable(); - if (includeThis) - { - lambda(state, null, this); - parents.Add(this); - } - this.submodelElements?.RecurseOnReferables(state, parents, lambda); - } - - // Parents stuff - - public static void SetParentsForSME(Referable parent, SubmodelElement se) - { - if (se == null) - return; - - se.parent = parent; - - // via interface enumaration - if (se is IEnumerateChildren) - { - var childs = (se as IEnumerateChildren).EnumerateChildren(); - if (childs != null) - foreach (var c in childs) - SetParentsForSME(se, c.submodelElement); - } - } - - public void SetAllParents() - { - if (this.submodelElements != null) - foreach (var sme in this.submodelElements) - SetParentsForSME(this, sme.submodelElement); - } - - public T CreateSMEForCD(ConceptDescription cd, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - if (this.submodelElements == null) - this.submodelElements = new SubmodelElementWrapperCollection(); - return this.submodelElements.CreateSMEForCD(cd, category, idShort, idxTemplate, maxNum, addSme); - } - - public T CreateSMEForIdShort(string idShort, string category = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - if (this.submodelElements == null) - this.submodelElements = new SubmodelElementWrapperCollection(); - return this.submodelElements.CreateSMEForIdShort(idShort, category, idxTemplate, maxNum, addSme); - } - - // validation - - public override void Validate(AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check - base.Validate(results); - ModelingKind.Validate(results, kind, this); - KeyList.Validate(results, semanticId?.Keys, this); - } - - // find - - public IEnumerable FindAllReferences() - { - // not nice: use temp list - var temp = new List(); - - // recurse - this.RecurseOnSubmodelElements(null, (state, parents, sme) => - { - if (sme is ReferenceElement re) - if (re.value != null) - temp.Add(re.value); - if (sme is RelationshipElement rl) - { - if (rl.first != null) - temp.Add(rl.first); - if (rl.second != null) - temp.Add(rl.second); - } - // recurse - return true; - }); - - // now, give back - foreach (var r in temp) - yield return new LocatedReference(this, r); - } - } - - public class ListOfSubmodels : List, IAasElement - { - // self decscription - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Submodels", "SMS"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - } - - // - // Derived from SubmodelElements - // - - public class DataElement : SubmodelElement - { - public static string ValueType_STRING = "string"; - public static string ValueType_DATE = "date"; - public static string ValueType_BOOLEAN = "boolean"; - - public static string[] ValueTypeItems = new string[] { - "anyType", "complexType", "anySimpleType", "anyAtomicType", "anyURI", "base64Binary", - "boolean", "date", "dateTime", - "dateTimeStamp", "decimal", "integer", "long", "int", "short", "byte", "nonNegativeInteger", - "positiveInteger", - "unsignedLong", "unsignedInt", "unsignedShort", "unsignedByte", "nonPositiveInteger", - "negativeInteger", "double", "duration", - "dayTimeDuration", "yearMonthDuration", "float", "hexBinary", "string", "langString", "time" }; - - public static string[] ValueTypes_Number = new[] { - "decimal", "integer", "long", "int", "short", "byte", "nonNegativeInteger", - "positiveInteger", - "unsignedLong", "unsignedInt", "unsignedShort", "unsignedByte", "nonPositiveInteger", - "negativeInteger", "double", "float" }; - - public DataElement() { } - - public DataElement(SubmodelElement src) : base(src) { } - - public DataElement(DataElement src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public DataElement(AasxCompatibilityModels.AdminShellV10.DataElement src) - : base(src) - { } -#endif - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("DataElement", "DE"); - } - } - - public class JsonValueTypeCast - { - - public class JsonDataObjectType - { - [JsonProperty(PropertyName = "name")] - public string name = ""; - } - - [JsonProperty(PropertyName = "dataObjectType")] - public JsonDataObjectType dataObjectType = new JsonDataObjectType(); - - public JsonValueTypeCast(string name) - { - this.dataObjectType.name = name; - } - } - - public class Property : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - [MetaModelName("Property.valueType")] - [TextSearchable] - [JsonIgnore] - public string valueType = ""; - [XmlIgnore] - [JsonProperty(PropertyName = "valueType")] - public JsonValueTypeCast JsonValueType - { - get { return new JsonValueTypeCast(this.valueType); } - set { this.valueType = value?.dataObjectType?.name; } - } - - - [MetaModelName("Property.value")] - [TextSearchable] - public string value = ""; - public Reference valueId = null; - - // constructors - - public Property() { } - - public Property(SubmodelElement src) - : base(src) - { - if (!(src is Property p)) - return; - this.valueType = p.valueType; - this.value = p.value; - if (p.valueId != null) - valueId = new Reference(p.valueId); - } - -#if !DoNotUseAasxCompatibilityModels - public Property(AasxCompatibilityModels.AdminShellV10.Property src) - : base(src) - { - if (src == null) - return; - - this.valueType = src.valueType; - this.value = src.value; - if (src.valueId != null) - this.valueId = new Reference(src.valueId); - } -#endif - - public static Property CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new Property(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public Property Set(string valueType = "", string value = "") - { - this.valueType = valueType; - this.value = value; - return this; - } - - public Property Set(string type, bool local, string idType, string value) - { - this.valueId = Reference.CreateNew(Key.CreateNew(type, local, idType, value)); - return this; - } - - public Property Set(Qualifier q) - { - if (q != null) - this.AddQualifier(q); - return this; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Property", "Prop", - SubmodelElementWrapper.AdequateElementEnum.Property); - } - - public override string ValueAsText(string defaultLang = null) - { - return "" + value; - } - - public override void ValueFromText(string text, string defaultLang = null) - { - value = "" + text; - } - - public bool IsTrue() - { - if (this.valueType?.Trim().ToLower() == "boolean") - { - var v = "" + this.value?.Trim().ToLower(); - if (v == "true" || v == "1") - return true; - } - return false; - } - - public override double? ValueAsDouble() - { - // pointless - if (this.value == null || this.value.Trim() == "" || this.valueType == null) - return null; - - // type? - var vt = this.valueType.Trim().ToLower(); - if (!DataElement.ValueTypes_Number.Contains(vt)) - return null; - - // try convert - if (double.TryParse(this.value, NumberStyles.Any, CultureInfo.InvariantCulture, out double dbl)) - return dbl; - - // no - return null; - } - - } - - public class MultiLanguageProperty : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public LangStringSet value = new LangStringSet(); - public Reference valueId = null; - - // constructors - - public MultiLanguageProperty() { } - - public MultiLanguageProperty(SubmodelElement src) - : base(src) - { - if (!(src is MultiLanguageProperty mlp)) - return; - - this.value = new LangStringSet(mlp.value); - if (mlp.valueId != null) - valueId = new Reference(mlp.valueId); - } - -#if !DoNotUseAasxCompatibilityModels - // not available in V1.0 -#endif - - public static MultiLanguageProperty CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new MultiLanguageProperty(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("MultiLanguageProperty", "MLP", - SubmodelElementWrapper.AdequateElementEnum.MultiLanguageProperty); - } - - public MultiLanguageProperty Set(LangStringSet ls) - { - this.value = ls; - return this; - } - - public MultiLanguageProperty Set(ListOfLangStr ls) - { - this.value = new LangStringSet(ls); - return this; - } - - public MultiLanguageProperty Set(LangStr ls) - { - if (ls == null) - return this; - if (this.value?.langString == null) - this.value = new LangStringSet(); - this.value.langString[ls.lang] = ls.str; - return this; - } - - public MultiLanguageProperty Set(string lang, string str) - { - return this.Set(new LangStr(lang, str)); - } - - public override string ValueAsText(string defaultLang = null) - { - return "" + value?.GetDefaultStr(defaultLang); - } - - public override void ValueFromText(string text, string defaultLang = null) - { - Set(defaultLang, text); - } - - } - - public class Range : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - [MetaModelName("Range.valueType")] - [TextSearchable] - [JsonIgnore] - [CountForHash] - public string valueType = ""; - - [XmlIgnore] - [JsonProperty(PropertyName = "valueType")] - public JsonValueTypeCast JsonValueType - { - get { return new JsonValueTypeCast(this.valueType); } - set { this.valueType = value?.dataObjectType?.name; } - } - - [MetaModelName("Range.min")] - [TextSearchable] - [CountForHash] - public string min = ""; - - [MetaModelName("Range.max")] - [TextSearchable] - [CountForHash] - public string max = ""; - - // constructors - - public Range() { } - - public Range(SubmodelElement src) - : base(src) - { - if (!(src is Range rng)) - return; - - this.valueType = rng.valueType; - this.min = rng.min; - this.max = rng.max; - } - -#if !DoNotUseAasxCompatibilityModels - // not available in V1.0 -#endif - - public static Range CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new Range(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Range", "Range", - SubmodelElementWrapper.AdequateElementEnum.Range); - } - - public override string ValueAsText(string defaultLang = null) - { - return "" + min + " .. " + max; - } - - } - - public class Blob : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - [MetaModelName("Blob.mimeType")] - [TextSearchable] - [CountForHash] - public string mimeType = ""; - - [MetaModelName("Blob.value")] - [TextSearchable] - [CountForHash] - public string value = ""; - - // constructors - - public Blob() { } - - public Blob(SubmodelElement src) - : base(src) - { - if (!(src is Blob blb)) - return; - - this.mimeType = blb.mimeType; - this.value = blb.value; - } - -#if !DoNotUseAasxCompatibilityModels - public Blob(AasxCompatibilityModels.AdminShellV10.Blob src) - : base(src) - { - if (src == null) - return; - - this.mimeType = src.mimeType; - this.value = src.value; - } -#endif - - public static Blob CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new Blob(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(string mimeType = "", string value = "") - { - this.mimeType = mimeType; - this.value = value; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Blob", "Blob", - SubmodelElementWrapper.AdequateElementEnum.Blob); - } - - } - - public class File : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - [MetaModelName("File.mimeType")] - [TextSearchable] - [CountForHash] - public string mimeType = ""; - - [MetaModelName("File.value")] - [TextSearchable] - [CountForHash] - public string value = ""; - - // constructors - - public File() { } - - public File(SubmodelElement src) - : base(src) - { - if (!(src is File fil)) - return; - - this.mimeType = fil.mimeType; - this.value = fil.value; - } - -#if !DoNotUseAasxCompatibilityModels - public File(AasxCompatibilityModels.AdminShellV10.File src) - : base(src) - { - if (src == null) - return; - - this.mimeType = src.mimeType; - this.value = src.value; - } -#endif - - public static File CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new File(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(string mimeType = "", string value = "") - { - this.mimeType = mimeType; - this.value = value; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("File", "File", - SubmodelElementWrapper.AdequateElementEnum.File); - } - - public static string[] GetPopularMimeTypes() - { - return - new[] { - System.Net.Mime.MediaTypeNames.Text.Plain, - System.Net.Mime.MediaTypeNames.Text.Xml, - System.Net.Mime.MediaTypeNames.Text.Html, - "application/json", - "application/rdf+xml", - System.Net.Mime.MediaTypeNames.Application.Pdf, - System.Net.Mime.MediaTypeNames.Image.Jpeg, - "image/png", - System.Net.Mime.MediaTypeNames.Image.Gif, - "application/iges", - "application/step" - }; - } - - public override string ValueAsText(string defaultLang = null) - { - return "" + value; - } - } - - public class ReferenceElement : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public Reference value = new Reference(); - - // constructors - - public ReferenceElement() { } - - public ReferenceElement(SubmodelElement src) - : base(src) - { - if (!(src is ReferenceElement re)) - return; - - if (re.value != null) - this.value = new Reference(re.value); - } - -#if !DoNotUseAasxCompatibilityModels - public ReferenceElement(AasxCompatibilityModels.AdminShellV10.ReferenceElement src) - : base(src) - { - if (src == null) - return; - - if (src.value != null) - this.value = new Reference(src.value); - } -#endif - - public static ReferenceElement CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new ReferenceElement(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(Reference value = null) - { - this.value = value; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("ReferenceElement", "Ref", - SubmodelElementWrapper.AdequateElementEnum.ReferenceElement); - } - - } - - public class RelationshipElement : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public Reference first = new Reference(); - public Reference second = new Reference(); - - // constructors - - public RelationshipElement() { } - - public RelationshipElement(SubmodelElement src) - : base(src) - { - if (!(src is RelationshipElement rel)) - return; - - if (rel.first != null) - this.first = new Reference(rel.first); - if (rel.second != null) - this.second = new Reference(rel.second); - } - -#if !DoNotUseAasxCompatibilityModels - public RelationshipElement(AasxCompatibilityModels.AdminShellV10.RelationshipElement src) - : base(src) - { - if (src == null) - return; - - if (src.first != null) - this.first = new Reference(src.first); - if (src.second != null) - this.second = new Reference(src.second); - } -#endif - - public static RelationshipElement CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null, Reference first = null, - Reference second = null) - { - var x = new RelationshipElement(); - x.CreateNewLogic(idShort, category, semanticIdKey); - x.first = first; - x.second = second; - return (x); - } - - public void Set(Reference first = null, Reference second = null) - { - this.first = first; - this.second = second; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("RelationshipElement", "Rel", - SubmodelElementWrapper.AdequateElementEnum.RelationshipElement); - } - } - - public class AnnotatedRelationshipElement : RelationshipElement, IManageSubmodelElements, IEnumerateChildren - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - // from this very class - - [JsonIgnore] - [SkipForHash] // do NOT count children! - [XmlArray("annotations")] - [XmlArrayItem("dataElement")] - public DataElementWrapperCollection annotations = null; - - [XmlIgnore] - [JsonProperty(PropertyName = "annotations")] - public DataElement[] JsonAnotations - { - get - { - var res = new List(); - if (annotations != null) - foreach (var smew in annotations) - if (smew.submodelElement is DataElement de) - res.Add(de); - return res.ToArray(); - } - set - { - if (value != null) - { - this.annotations = new DataElementWrapperCollection(); - foreach (var x in value) - { - var smew = new SubmodelElementWrapper() { submodelElement = x }; - this.annotations.Add(smew); - } - } - } - } - - // constructors - - public AnnotatedRelationshipElement() { } - - public AnnotatedRelationshipElement(SubmodelElement src) - : base(src) - { - if (!(src is AnnotatedRelationshipElement arel)) - return; - if (arel.first != null) - this.first = new Reference(arel.first); - if (arel.second != null) - this.second = new Reference(arel.second); - if (arel.annotations != null) - this.annotations = new DataElementWrapperCollection(arel.annotations); - } - - public new static AnnotatedRelationshipElement CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null, - Reference first = null, Reference second = null) - { - var x = new AnnotatedRelationshipElement(); - x.CreateNewLogic(idShort, category, semanticIdKey); - x.first = first; - x.second = second; - return (x); - } - - // enumerates its children - - public IEnumerable EnumerateChildren() - { - if (this.annotations != null) - foreach (var smw in this.annotations) - yield return smw; - } - - public EnumerationPlacmentBase GetChildrenPlacement(SubmodelElement child) - { - return null; - } - - public object AddChild(SubmodelElementWrapper smw, EnumerationPlacmentBase placement = null) - { - if (smw == null || !(smw.submodelElement is DataElement)) - return null; - if (this.annotations == null) - this.annotations = new DataElementWrapperCollection(); - if (smw.submodelElement != null) - smw.submodelElement.parent = this; - this.annotations.Add(smw); - return smw; - } - - // from IManageSubmodelElements - public void Add(SubmodelElement sme) - { - if (annotations == null) - annotations = new DataElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - annotations.Add(sew); - } - - public void Insert(int index, SubmodelElement sme) - { - if (annotations == null) - annotations = new DataElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - if (index < 0 || index >= annotations.Count) - return; - annotations.Insert(index, sew); - } - - public void Remove(SubmodelElement sme) - { - if (annotations != null) - annotations.Remove(sme); - } - - // further - - public new void Set(Reference first = null, Reference second = null) - { - this.first = first; - this.second = second; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("AnnotatedRelationshipElement", "RelA", - SubmodelElementWrapper.AdequateElementEnum.AnnotatedRelationshipElement); - } - - - } - - public class Capability : SubmodelElement - { - public Capability() { } - - public Capability(SubmodelElement src) - : base(src) - { } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Capability", "Cap", - SubmodelElementWrapper.AdequateElementEnum.Capability); - } - } - - - public class SubmodelElementCollection : SubmodelElement, IManageSubmodelElements, IEnumerateChildren - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // values == SMEs - [XmlIgnore] - [JsonIgnore] - [SkipForHash] // do NOT count children! - private SubmodelElementWrapperCollection _value = null; - - [JsonIgnore] - public SubmodelElementWrapperCollection value - { - get { return _value; } - set { _value = value; _value.Parent = this; } - } - - [XmlIgnore] - [JsonProperty(PropertyName = "value")] - public SubmodelElement[] JsonValue - { - get - { - var res = new ListOfSubmodelElement(); - if (value != null) - foreach (var smew in value) - res.Add(smew.submodelElement); - return res.ToArray(); - } - set - { - if (value != null) - { - this.value = new SubmodelElementWrapperCollection(); - foreach (var x in value) - { - var smew = new SubmodelElementWrapper() { submodelElement = x }; - this.value.Add(smew); - } - } - } - } - - // constant members - public bool ordered = false; - public bool allowDuplicates = false; - - // enumartes its children - - public IEnumerable EnumerateChildren() - { - if (this.value != null) - foreach (var smw in this.value) - yield return smw; - } - - public EnumerationPlacmentBase GetChildrenPlacement(SubmodelElement child) - { - return null; - } - - public object AddChild(SubmodelElementWrapper smw, EnumerationPlacmentBase placement = null) - { - if (smw == null) - return null; - if (this.value == null) - this.value = new SubmodelElementWrapperCollection(); - if (smw.submodelElement != null) - smw.submodelElement.parent = this; - this.value.Add(smw); - return smw; - } - - // constructors - - public SubmodelElementCollection() { } - - public SubmodelElementCollection(SubmodelElement src, bool shallowCopy = false) - : base(src) - { - if (!(src is SubmodelElementCollection smc)) - return; - - this.ordered = smc.ordered; - this.allowDuplicates = smc.allowDuplicates; - this.value = new SubmodelElementWrapperCollection(); - if (!shallowCopy) - foreach (var smw in smc.value) - value.Add(new SubmodelElementWrapper(smw.submodelElement)); - } - -#if !DoNotUseAasxCompatibilityModels - public SubmodelElementCollection( - AasxCompatibilityModels.AdminShellV10.SubmodelElementCollection src, bool shallowCopy = false) - : base(src) - { - if (src == null) - return; - - this.ordered = src.ordered; - this.allowDuplicates = src.allowDuplicates; - this.value = new SubmodelElementWrapperCollection(); - if (!shallowCopy) - foreach (var smw in src.value) - value.Add(new SubmodelElementWrapper(smw.submodelElement)); - } -#endif - - public static SubmodelElementCollection CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new SubmodelElementCollection(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - // from IManageSubmodelElements - public void Add(SubmodelElement sme) - { - if (value == null) - value = new SubmodelElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - value.Add(sew); - } - - public void Insert(int index, SubmodelElement sme) - { - if (value == null) - value = new SubmodelElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - if (index < 0 || index >= value.Count) - return; - value.Insert(index, sew); - } - - public void Remove(SubmodelElement sme) - { - if (value != null) - value.Remove(sme); - } - - // further - - public void Set(bool allowDuplicates = false, bool ordered = false) - { - this.allowDuplicates = allowDuplicates; - this.ordered = ordered; - } - - public SubmodelElementWrapper FindFirstIdShort(string idShort) - { - return this.value?.FindFirstIdShort(idShort); - } - - public T CreateSMEForCD(ConceptDescription cd, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - if (this.value == null) - this.value = new SubmodelElementWrapperCollection(); - return this.value.CreateSMEForCD(cd, category, idShort, idxTemplate, maxNum, addSme); - } - - public T CreateSMEForIdShort(string idShort, string category = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - if (this.value == null) - this.value = new SubmodelElementWrapperCollection(); - return this.value.CreateSMEForIdShort(idShort, category, idxTemplate, maxNum, addSme); - } - - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("SubmodelElementCollection", "SMC", - SubmodelElementWrapper.AdequateElementEnum.SubmodelElementCollection); - } - - // Recursing - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// - public void RecurseOnSubmodelElements( - object state, Func lambda) - { - this.value?.RecurseOnReferables(state, null, (o, par, rf) => - { - if (rf is SubmodelElement sme) - return lambda(o, par, sme); - else - return true; - }); - } - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. Include this element, as well. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// Include this element as well. parents will then - /// include this element as well! - public override void RecurseOnReferables( - object state, Func lambda, - bool includeThis = false) - { - var parents = new ListOfReferable(); - if (includeThis) - { - lambda(state, null, this); - parents.Add(this); - } - this.value?.RecurseOnReferables(state, parents, lambda); - } - } - - public class OperationVariable : IAasElement - { - public enum Direction { In, Out, InOut }; - - // Note: for OperationVariable, the values of the SubmodelElement itself ARE NOT TO BE USED! - // only the SME attributes of "value" are counting - - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - public SubmodelElementWrapper value = null; - - // constructors - - public OperationVariable() - { - } - - public OperationVariable(OperationVariable src, bool shallowCopy = false) - { - this.value = new SubmodelElementWrapper(src?.value?.submodelElement, shallowCopy); - } - -#if !DoNotUseAasxCompatibilityModels - public OperationVariable( - AasxCompatibilityModels.AdminShellV10.OperationVariable src, bool shallowCopy = false) - { - this.value = new SubmodelElementWrapper(src.value.submodelElement, shallowCopy); - } -#endif - - public OperationVariable(SubmodelElement elem) - : base() - { - this.value = new SubmodelElementWrapper(elem); - } - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("OperationVariable", "OprVar"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - } - - public class Operation : SubmodelElement, IEnumerateChildren - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - [JsonIgnore] - [XmlElement(ElementName = "inputVariable")] - [SkipForHash] // do NOT count children! - public List inputVariable = new List(); - - [JsonIgnore] - [XmlElement(ElementName = "outputVariable")] - [SkipForHash] // do NOT count children! - public List outputVariable = new List(); - - [JsonIgnore] - [XmlElement(ElementName = "inoutputVariable")] - [SkipForHash] // do NOT count children! - public List inoutputVariable = new List(); - - [XmlIgnore] - // MICHA 190504: enabled JSON operation variables! - [JsonProperty(PropertyName = "inputVariable")] - public OperationVariable[] JsonInputVariable - { - get { return inputVariable?.ToArray(); } - set { inputVariable = (value != null) ? new List(value) : null; } - } - - [XmlIgnore] - [JsonProperty(PropertyName = "outputVariable")] - // MICHA 190504: enabled JSON operation variables! - public OperationVariable[] JsonOutputVariable - { - get { return outputVariable?.ToArray(); } - set { outputVariable = (value != null) ? new List(value) : null; } - } - - [XmlIgnore] - [JsonProperty(PropertyName = "inoutputVariable")] - // MICHA 190504: enabled JSON operation variables! - public OperationVariable[] JsonInOutputVariable - { - get { return inoutputVariable?.ToArray(); } - set { inoutputVariable = (value != null) ? new List(value) : null; } - } - - public List this[OperationVariable.Direction dir] - { - get - { - if (dir == OperationVariable.Direction.In) - return inputVariable; - else - if (dir == OperationVariable.Direction.Out) - return outputVariable; - else - return inoutputVariable; - } - set - { - if (dir == OperationVariable.Direction.In) - inputVariable = value; - else - if (dir == OperationVariable.Direction.Out) - outputVariable = value; - else - inoutputVariable = value; - } - } - - public List this[int dir] - { - get - { - if (dir == 0) - return inputVariable; - else - if (dir == 1) - return outputVariable; - else - return inoutputVariable; - } - set - { - if (dir == 0) - inputVariable = value; - else - if (dir == 1) - outputVariable = value; - else - inoutputVariable = value; - } - } - - public static SubmodelElementWrapperCollection GetWrappers(List ovl) - { - var res = new SubmodelElementWrapperCollection(); - foreach (var ov in ovl) - if (ov.value != null) - res.Add(ov.value); - return res; - } - - // enumartes its children - public IEnumerable EnumerateChildren() - { - if (this.inputVariable != null) - foreach (var smw in this.inputVariable) - yield return smw?.value; - - if (this.outputVariable != null) - foreach (var smw in this.outputVariable) - yield return smw?.value; - - if (this.inoutputVariable != null) - foreach (var smw in this.inoutputVariable) - yield return smw?.value; - } - - public class EnumerationPlacmentOperationVariable : EnumerationPlacmentBase - { - public OperationVariable.Direction Direction; - public OperationVariable OperationVariable; - } - - public EnumerationPlacmentBase GetChildrenPlacement(SubmodelElement child) - { - // trivial - if (child == null) - return null; - - // search - OperationVariable.Direction? dir = null; - OperationVariable opvar = null; - if (this.inputVariable != null) - foreach (var ov in this.inputVariable) - if (ov?.value?.submodelElement == child) - { - dir = OperationVariable.Direction.In; - opvar = ov; - } - - if (this.outputVariable != null) - foreach (var ov in this.outputVariable) - if (ov?.value?.submodelElement == child) - { - dir = OperationVariable.Direction.Out; - opvar = ov; - } - - if (this.inoutputVariable != null) - foreach (var ov in this.inoutputVariable) - if (ov?.value?.submodelElement == child) - { - dir = OperationVariable.Direction.InOut; - opvar = ov; - } - - // found - if (!dir.HasValue) - return null; - return new EnumerationPlacmentOperationVariable() - { - Direction = dir.Value, - OperationVariable = opvar - }; - } - - public object AddChild(SubmodelElementWrapper smw, EnumerationPlacmentBase placement = null) - { - // not enough information to select list of children? - var pl = placement as EnumerationPlacmentOperationVariable; - if (smw == null || pl == null) - return null; - - // ok, use information - var ov = new OperationVariable(); - ov.value = smw; - - if (smw.submodelElement != null) - smw.submodelElement.parent = this; - - if (pl.Direction == OperationVariable.Direction.In) - { - if (inputVariable == null) - inputVariable = new List(); - inputVariable.Add(ov); - } - - if (pl.Direction == OperationVariable.Direction.Out) - { - if (outputVariable == null) - outputVariable = new List(); - outputVariable.Add(ov); - } - - if (pl.Direction == OperationVariable.Direction.InOut) - { - if (inoutputVariable == null) - inoutputVariable = new List(); - inoutputVariable.Add(ov); - } - - return ov; - } - - // constructors - - public Operation() { } - - public Operation(SubmodelElement src) - : base(src) - { - if (!(src is Operation op)) - return; - - for (int i = 0; i < 2; i++) - if (op[i] != null) - { - if (this[i] == null) - this[i] = new List(); - foreach (var ov in op[i]) - this[i].Add(new OperationVariable(ov)); - } - } - -#if !DoNotUseAasxCompatibilityModels - public Operation(AasxCompatibilityModels.AdminShellV10.Operation src) - : base(src) - { - for (int i = 0; i < 2; i++) - if (src[i] != null) - { - if (this[i] == null) - this[i] = new List(); - foreach (var ov in src[i]) - this[i].Add(new OperationVariable(ov)); - } - } -#endif - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Operation", "Opr", - SubmodelElementWrapper.AdequateElementEnum.Operation); - } - } - - public class Entity : SubmodelElement, IManageSubmodelElements, IEnumerateChildren - { - public enum EntityTypeEnum { CoManagedEntity = 0, SelfManagedEntity = 1, Undef = 3 } - public static string[] EntityTypeNames = new string[] { "CoManagedEntity", "SelfManagedEntity" }; - - // for JSON only - - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // from this very class - [XmlIgnore] - [JsonIgnore] - [SkipForHash] // do NOT count children! - private SubmodelElementWrapperCollection _statements = null; - - [JsonIgnore] - public SubmodelElementWrapperCollection statements - { - get { return _statements; } - set { _statements = value; _statements.Parent = this; } - } - - [XmlIgnore] - [JsonProperty(PropertyName = "statements")] - public SubmodelElement[] JsonStatements - { - get - { - var res = new ListOfSubmodelElement(); - if (statements != null) - foreach (var smew in statements) - res.Add(smew.submodelElement); - return res.ToArray(); - } - set - { - if (value != null) - { - this.statements = new SubmodelElementWrapperCollection(); - foreach (var x in value) - { - var smew = new SubmodelElementWrapper() { submodelElement = x }; - this.statements.Add(smew); - } - } - } - } - - // further members - - [CountForHash] - public string entityType = ""; - - [JsonProperty(PropertyName = "asset")] - public AssetRef assetRef = null; - - // enumerates its children - - public IEnumerable EnumerateChildren() - { - if (this.statements != null) - foreach (var smw in this.statements) - yield return smw; - } - - public EnumerationPlacmentBase GetChildrenPlacement(SubmodelElement child) - { - return null; - } - - public object AddChild(SubmodelElementWrapper smw, EnumerationPlacmentBase placement = null) - { - if (smw == null) - return null; - if (this.statements == null) - this.statements = new SubmodelElementWrapperCollection(); - if (smw.submodelElement != null) - smw.submodelElement.parent = this; - this.statements.Add(smw); - return smw; - } - - // constructors - - public Entity() { } - - public Entity(SubmodelElement src) - : base(src) - { - if (!(src is Entity ent)) - return; - - if (ent.statements != null) - { - this.statements = new SubmodelElementWrapperCollection(); - foreach (var smw in ent.statements) - this.statements.Add(new SubmodelElementWrapper(smw.submodelElement)); - } - this.entityType = ent.entityType; - if (ent.assetRef != null) - this.assetRef = new AssetRef(ent.assetRef); - } - - public Entity(EntityTypeEnum entityType, string idShort = null, AssetRef assetRef = null, - string category = null, Key semanticIdKey = null) - { - CreateNewLogic(idShort, null, semanticIdKey); - - this.entityType = EntityTypeNames[(int)entityType]; - this.assetRef = assetRef; - } - -#if !DoNotUseAasxCompatibilityModels - // not available in V1.0 -#endif - - public static Entity CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new Entity(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - // from IManageSubmodelElements - public void Add(SubmodelElement sme) - { - if (statements == null) - statements = new SubmodelElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - statements.Add(sew); - } - - public void Insert(int index, SubmodelElement sme) - { - if (statements == null) - statements = new SubmodelElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - if (index < 0 || index >= statements.Count) - return; - statements.Insert(index, sew); - } - - public void Remove(SubmodelElement sme) - { - if (statements != null) - statements.Remove(sme); - } - - // management of elememts - - public SubmodelElementWrapper FindSubmodelElementWrapper(string idShort) - { - if (this.statements == null) - return null; - foreach (var smw in this.statements) - if (smw.submodelElement != null) - if (smw.submodelElement.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - return smw; - return null; - } - - public T CreateSMEForCD(ConceptDescription cd, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - if (this.statements == null) - this.statements = new SubmodelElementWrapperCollection(); - return this.statements.CreateSMEForCD(cd, category, idShort, idxTemplate, maxNum, addSme); - } - - public T CreateSMEForIdShort(string idShort, string category = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - if (this.statements == null) - this.statements = new SubmodelElementWrapperCollection(); - return this.statements.CreateSMEForIdShort(idShort, category, idxTemplate, maxNum, addSme); - } - - // entity type - - public EntityTypeEnum GetEntityType() - { - EntityTypeEnum res = EntityTypeEnum.Undef; - if (this.entityType != null && this.entityType.Trim().ToLower() == EntityTypeNames[0].ToLower()) - res = EntityTypeEnum.CoManagedEntity; - if (this.entityType != null && this.entityType.Trim().ToLower() == EntityTypeNames[1].ToLower()) - res = EntityTypeEnum.SelfManagedEntity; - return res; - } - - // name - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Entity", "Ent", - SubmodelElementWrapper.AdequateElementEnum.Entity); - } - } - - public class BasicEvent : SubmodelElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // from this very class - public Reference observed = new Reference(); - - // constructors - - public BasicEvent() { } - - public BasicEvent(SubmodelElement src) - : base(src) - { - if (!(src is BasicEvent be)) - return; - - if (be.observed != null) - this.observed = new Reference(be.observed); - } - -#if !DoNotUseAasxCompatibilityModels - // not available in V1.0 -#endif - - public static BasicEvent CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new BasicEvent(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("BasicEvent", "Evt", - SubmodelElementWrapper.AdequateElementEnum.BasicEvent); - } - } - - // - // Handling of packages - // - } - - #endregion -} - diff --git a/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V20/AdminShellConverters.cs b/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V20/AdminShellConverters.cs deleted file mode 100644 index 63dd76d92..000000000 --- a/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V20/AdminShellConverters.cs +++ /dev/null @@ -1,174 +0,0 @@ -/* -Copyright (c) 2018-2021 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using AasxCompatibilityModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Newtonsoft.Json.Serialization; - -//namespace AdminShellNS -namespace AdminShell_V20 -{ - public static class AdminShellConverters - { - /// - /// This converter is used for reading JSON files; it claims to be responsible for - /// "Referable" (the base class) - /// and decides, which sub-class of the base class shall be populated. - /// If the object is SubmodelElement, the decision, shich special sub-class to create is done in a factory - /// AdminShell.SubmodelElementWrapper.CreateAdequateType(), - /// in order to have all sub-class specific decisions in one place (SubmodelElementWrapper) - /// Remark: There is a NuGet package JsonSubTypes, which could have done the job, except the fact of having - /// "modelType" being a class property with a contained property "name". - /// - public class JsonAasxConverter : JsonConverter - { - private string UpperClassProperty = "modelType"; - private string LowerClassProperty = "name"; - - public JsonAasxConverter() : base() - { - } - - public JsonAasxConverter(string UpperClassProperty, string LowerClassProperty) : base() - { - this.UpperClassProperty = UpperClassProperty; - this.LowerClassProperty = LowerClassProperty; - } - - public override bool CanConvert(Type objectType) - { - // Info MIHO 21 APR 2020: changed this from SubmodelElement to Referable - if (typeof(AdminShell.Referable).IsAssignableFrom(objectType)) - return true; - return false; - } - - public override bool CanWrite - { - get { return false; } - } - - public override object ReadJson(JsonReader reader, - Type objectType, - object existingValue, - JsonSerializer serializer) - { - // Load JObject from stream - JObject jObject = JObject.Load(reader); - - // Create target object based on JObject - object target = new AdminShell.Referable(); - - if (jObject.ContainsKey(UpperClassProperty)) - { - var j2 = jObject[UpperClassProperty]; - if (j2 != null) - foreach (var c in j2.Children()) - { - var cprop = c as Newtonsoft.Json.Linq.JProperty; - if (cprop == null) - continue; - if (cprop.Name == LowerClassProperty && cprop.Value.Type.ToString() == "String") - { - var cpval = cprop.Value.ToObject(); - if (cpval == null) - continue; - // Info MIHO 21 APR 2020: use Referable.CreateAdequateType instead of SMW... - var o = AdminShell.Referable.CreateAdequateType(cpval); - if (o != null) - target = o; - } - } - } - - // Populate the object properties - serializer.Populate(jObject.CreateReader(), target); - - return target; - } - - /// - /// Introduced for JSON serialization, can create Referables based on a string name - /// - /// string name (standard PascalCased) - - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - throw new NotImplementedException(); - } - } - - /// - /// This converter / contract resolver for Json.NET adaptively filters different levels of depth - /// of nested AASX structures. - /// - public class AdaptiveFilterContractResolver : DefaultContractResolver - { - public bool AasHasViews = true; - public bool BlobHasValue = true; - public bool SubmodelHasElements = true; - public bool SmcHasValue = true; - public bool OpHasVariables = true; - - public AdaptiveFilterContractResolver() { } - - public AdaptiveFilterContractResolver(bool deep = true, bool complete = true) - { - if (!deep) - { - this.SubmodelHasElements = false; - this.SmcHasValue = false; - this.OpHasVariables = false; - } - if (!complete) - { - this.AasHasViews = false; - this.BlobHasValue = false; - } - - } - - protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) - { - JsonProperty property = base.CreateProperty(member, memberSerialization); - - if (!BlobHasValue && property.DeclaringType == typeof(AdminShell.Blob) && - property.PropertyName == "value") - property.ShouldSerialize = instance => { return false; }; - - if (!SubmodelHasElements && property.DeclaringType == typeof(AdminShell.Submodel) && - property.PropertyName == "submodelElements") - property.ShouldSerialize = instance => { return false; }; - - if (!SmcHasValue && property.DeclaringType == typeof(AdminShell.SubmodelElementCollection) && - property.PropertyName == "value") - property.ShouldSerialize = instance => { return false; }; - - if (!OpHasVariables && property.DeclaringType == typeof(AdminShell.Operation) && - (property.PropertyName == "in" || property.PropertyName == "out")) - property.ShouldSerialize = instance => { return false; }; - - if (!AasHasViews && property.DeclaringType == typeof(AdminShell.AdministrationShell) && - property.PropertyName == "views") - property.ShouldSerialize = instance => { return false; }; - - return property; - } - } - - } -} diff --git a/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V20/AdminShellUtil.cs b/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V20/AdminShellUtil.cs deleted file mode 100644 index 81b80b9c5..000000000 --- a/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V20/AdminShellUtil.cs +++ /dev/null @@ -1,636 +0,0 @@ -/* -Copyright (c) 2018-2021 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using AasxCompatibilityModels; -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -//namespace AdminShellNS -namespace AdminShell_V20 -{ - public static class AdminShellUtilV20 - { - public static string EvalToNonNullString(string fmt, object o, string elseString = "") - { - if (o == null) - return elseString; - return string.Format(fmt, o); - } - - public static string EvalToNonEmptyString(string fmt, string o, string elseString = "") - { - if (o == null || o == "") - return elseString; - return string.Format(fmt, o); - } - - /// Creates a filter-friendly name from the source. - /// - /// Assert.AreEqual("", AdminShellUtil.FilterFriendlyName("")); - /// Assert.AreEqual("someName", AdminShellUtil.FilterFriendlyName("someName")); - /// Assert.AreEqual("some__name", AdminShellUtil.FilterFriendlyName("some!;name")); - /// - public static string FilterFriendlyName(string src) - { - if (src == null) - return null; - return Regex.Replace(src, @"[^a-zA-Z0-9\-_]", "_"); - } - - /// - /// Assert.IsFalse(AdminShellUtil.HasWhitespace("")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace(" ")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace("aa bb")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace(" aabb")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace("aabb ")); - /// Assert.IsFalse(AdminShellUtil.HasWhitespace("aabb")); - /// - public static bool HasWhitespace(string src) - { - if (src == null) - throw new ArgumentNullException(nameof(src)); - foreach (var s in src) - if (char.IsWhiteSpace(s)) - return true; - return false; - } - - /// Assert.IsTrue(AdminShellUtil.ComplyIdShort("")); - public static bool ComplyIdShort(string src) - { - if (src == null) - throw new ArgumentNullException(nameof(src)); - var res = true; - foreach (var s in src) - if (!Char.IsLetterOrDigit(s) && s != '_') - res = false; - if (src.Length > 0 && !Char.IsLetter(src[0])) - res = false; - return res; - } - - public static string ByteSizeHumanReadable(long len) - { - // see: https://stackoverflow.com/questions/281640/ - // how-do-i-get-a-human-readable-file-size-in-bytes-abbreviation-using-net - string[] sizes = { "B", "KB", "MB", "GB", "TB" }; - int order = 0; - while (len >= 1024 && order < sizes.Length - 1) - { - order++; - len = len / 1024; - } - // Adjust the format string to your preferences. For example "{0:0.#}{1}" would - // show a single decimal place, and no space. - string res = String.Format("{0:0.##} {1}", len, sizes[order]); - return res; - } - - public static string ExtractPascalCasingLetters(string src) - { - // access - src = src?.Trim(); - if (src == null || src.Length < 1) - return null; - - // walk through - var res = ""; - var arm = true; - foreach (var c in src) - { - // take? - if (arm && Char.IsUpper(c)) - res += c; - // state for next iteration - arm = !Char.IsUpper(c); - } - - // result - return res; - } - - public static int CountHeadingSpaces(string line) - { - if (line == null) - return 0; - int j; - for (j = 0; j < line.Length; j++) - if (!Char.IsWhiteSpace(line[j])) - break; - return j; - } - - /// - /// Used to re-reformat a C# here string, which is multiline string introduced by @" ... "; - /// - public static string[] CleanHereStringToArray(string here) - { - if (here == null) - return null; - - // convert all weird breaks to pure new lines - here = here.Replace("\r\n", "\n"); - here = here.Replace("\n\r", "\n"); - - // convert all tabs to spaces - here = here.Replace("\t", " "); - - // split these - var lines = new List(here.Split('\n')); - if (lines.Count < 1) - return lines.ToArray(); - - // the first line could be special - string firstLine = null; - if (lines[0].Trim() != "") - { - firstLine = lines[0].Trim(); - lines.RemoveAt(0); - } - - // detect an constant amount of heading spaces - var headSpaces = int.MaxValue; - foreach (var line in lines) - if (line.Trim() != "") - headSpaces = Math.Min(headSpaces, CountHeadingSpaces(line)); - - // multi line trim possible? - if (headSpaces != int.MaxValue && headSpaces > 0) - for (int i = 0; i < lines.Count; i++) - if (lines[i].Length > headSpaces) - lines[i] = lines[i].Substring(headSpaces); - - // re-compose again - if (firstLine != null) - lines.Insert(0, firstLine); - - // return - return lines.ToArray(); - } - - /// - /// Used to re-reformat a C# here string, which is multiline string introduced by @" ... "; - /// - public static string CleanHereStringWithNewlines(string here, string nl = null) - { - if (nl == null) - nl = Environment.NewLine; - var lines = CleanHereStringToArray(here); - if (lines == null) - return null; - return String.Join(nl, lines); - } - - public static string ShortLocation(Exception ex) - { - if (ex == null || ex.StackTrace == null) - return ""; - string[] lines = ex.StackTrace.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None); - if (lines.Length < 1) - return ""; - // search for " in " - // as the most actual stacktrace might be a built-in function, this might not work and therefore - // go down in the stack - int currLine = 0; - while (true) - { - // nothing found at all - if (currLine >= lines.Length) - return ""; - // access current line - /* TODO (MIHO, 2020-11-12): replace with Regex for multi language. Ideally have Exception messages - always as English. */ - var p = lines[currLine].IndexOf(" in ", StringComparison.Ordinal); - if (p < 0) - p = lines[currLine].IndexOf(" bei ", StringComparison.Ordinal); - if (p < 0) - { - // advance to next oldest line - currLine++; - continue; - } - // search last "\" or "/", to get only filename portion and position - p = lines[currLine].LastIndexOfAny(new[] { '\\', '/' }); - if (p < 0) - { - // advance to next oldest line - currLine++; - continue; - } - // return this - return lines[currLine].Substring(p); - } - } - - public enum ConstantFoundEnum { No, AnyCase, ExactCase } - - public static ConstantFoundEnum CheckIfInConstantStringArray(string[] arr, string str) - { - if (arr == null || str == null) - return ConstantFoundEnum.No; - - bool anyCaseFound = false; - bool exactCaseFound = false; - foreach (var a in arr) - { - anyCaseFound = anyCaseFound || str.ToLower() == a.ToLower(); - exactCaseFound = exactCaseFound || str == a; - } - if (exactCaseFound) - return ConstantFoundEnum.ExactCase; - if (anyCaseFound) - return ConstantFoundEnum.AnyCase; - return ConstantFoundEnum.No; - } - - public static string CorrectCasingForConstantStringArray(string[] arr, string str) - { - if (arr == null || str == null) - return str; - - foreach (var a in arr) - if (str.ToLower() == a.ToLower()) - return a; - - return str; - } - - // - // - // - // - // - - public static void PrintSearchableProperties(object obj, int indent) - { - if (obj == null) return; - string indentString = new string(' ', indent); - Type objType = obj.GetType(); - PropertyInfo[] properties = objType.GetProperties(); - foreach (PropertyInfo property in properties) - { - object propValue = property.GetValue(obj, null); - var elems = propValue as IList; - if (elems != null) - { - foreach (var item in elems) - { - PrintSearchableProperties(item, indent + 3); - } - } - else - { - // This will not cut-off System.Collections because of the first check - if (property.PropertyType.Assembly == objType.Assembly) - { - Console.WriteLine("{0}{1}:", indentString, property.Name); - - PrintSearchableProperties(propValue, indent + 2); - } - else - { - Console.WriteLine("{0}{1}: {2}", indentString, property.Name, propValue); - } - } - } - } - - public class SearchOptions - { - public Assembly[] allowedAssemblies = null; - public int maxDepth = int.MaxValue; - public bool findFirst = false; - public int skipFirstResults = 0; - public string findText = null; - public bool isIgnoreCase = false; - public bool isRegex = false; - } - - public class SearchResultItem : IEquatable - { - public SearchOptions searchOptions; - public string qualifiedNameHead; - public string metaModelName; - public object businessObject; - public string foundText; - public object foundObject; - public object containingObject; - public int foundHash; - - public bool Equals(SearchResultItem other) - { - if (other == null) - return false; - - return this.qualifiedNameHead == other.qualifiedNameHead && - this.metaModelName == other.metaModelName && - this.businessObject == other.businessObject && - this.containingObject == other.containingObject && - this.foundText == other.foundText && - this.foundHash == other.foundHash; - } - } - - public class SearchResults - { - public int foundIndex = 0; - public List foundResults = new List(); - - public void Clear() - { - foundIndex = -1; - foundResults.Clear(); - } - } - - public static void CheckSearchable( - SearchResults results, SearchOptions options, string qualifiedNameHead, object businessObject, - MemberInfo mi, object memberValue, object containingObject, Func getMemberHash) - { - // try get a speaking name - var metaModelName = ""; - var x1 = mi.GetCustomAttribute(); - if (x1 != null && x1.name != null) - metaModelName = x1.name; - - // check if this object is searchable - var x2 = mi.GetCustomAttribute(); - if (x2 != null) - { - // what to check? - string foundText = "" + memberValue?.ToString(); - - // find options - var found = true; - if (options.findText != null) - found = foundText.IndexOf( - options.findText, options.isIgnoreCase ? StringComparison.CurrentCultureIgnoreCase : 0) >= 0; - - // add? - if (found) - { - var sri = new SearchResultItem(); - sri.searchOptions = options; - sri.qualifiedNameHead = qualifiedNameHead; - sri.metaModelName = metaModelName; - sri.businessObject = businessObject; - sri.foundText = foundText; - sri.foundObject = memberValue; - sri.containingObject = containingObject; - if (getMemberHash != null) - sri.foundHash = getMemberHash(); - - // avoid duplicates - if (!results.foundResults.Contains(sri)) - results.foundResults.Add(sri); - } - } - } - - public static void EnumerateSearchable( - SearchResults results, object obj, string qualifiedNameHead, int depth, SearchOptions options, - object businessObject = null) - { - // access - if (results == null || obj == null || options == null) - return; - Type objType = obj.GetType(); - - // depth - if (depth > options.maxDepth) - return; - - // try to get element name of an AAS entity - string elName = null; - if (obj is AdminShell.Referable) - { - elName = (obj as AdminShell.Referable).GetElementName(); - businessObject = obj; - } - - // enrich qualified name, accordingly - var qualifiedName = qualifiedNameHead; - if (elName != null) - qualifiedName = qualifiedName + (qualifiedName.Length > 0 ? "." : "") + elName; - - // do NOT dive into objects, which are not in the reight assembly - if (options.allowedAssemblies == null || !options.allowedAssemblies.Contains(objType.Assembly)) - return; - - // do not dive into enums - if (objType.IsEnum) - return; - - // look at fields, first - var fields = objType.GetFields(); - foreach (var fi in fields) - { - // is the object marked to be skipped? - var x3 = fi.GetCustomAttribute(); - if (x3 != null) - continue; - - var x4 = fi.GetCustomAttribute(); - if (x4 != null) - continue; - - // get value(s) - var fieldValue = fi.GetValue(obj); - if (fieldValue == null) - continue; - var valueElems = fieldValue as IList; - if (valueElems != null) - { - // field is a collection .. dive deeper, if allowed - foreach (var el in valueElems) - EnumerateSearchable(results, el, qualifiedName, depth + 1, options, businessObject); - } - else - { - // field is a single entity .. check it - CheckSearchable( - results, options, qualifiedName, businessObject, fi, fieldValue, obj, - () => { return fieldValue.GetHashCode(); }); - - // dive deeper .. - EnumerateSearchable(results, fieldValue, qualifiedName, depth + 1, options, businessObject); - } - } - - // properties & objects behind - var properties = objType.GetProperties(); - foreach (var pi in properties) - { - var gip = pi.GetIndexParameters(); - if (gip.Length > 0) - // no indexed properties, yet - continue; - - // is the object marked to be skipped? - var x3 = pi.GetCustomAttribute(); - if (x3 != null) - continue; - - var x4 = pi.GetCustomAttribute(); - if (x4 != null) - continue; - - // get value(s) - var propValue = pi.GetValue(obj, null); - if (propValue == null) - continue; - var valueElems = propValue as IList; - if (valueElems != null) - { - // property is a collection .. dive deeper, if allowed - foreach (var el in valueElems) - EnumerateSearchable(results, el, qualifiedName, depth + 1, options, businessObject); - } - else - { - // field is a single entity .. check it - CheckSearchable( - results, options, qualifiedName, businessObject, pi, propValue, obj, - () => { return propValue.GetHashCode(); }); - - // dive deeper .. - EnumerateSearchable(results, propValue, qualifiedName, depth + 1, options, businessObject); - } - } - } - - // - // String manipulations - // - - public static string ReplacePercentPlaceholder( - string input, - string searchFor, - Func substLamda, - StringComparison comparisonType = StringComparison.InvariantCulture) - { - // access - if (input == null || searchFor == null || searchFor == "") - return input; - - // find - while (true) - { - // any occurence - var p = input.IndexOf(searchFor, comparisonType); - if (p < 0) - break; - - // split - var left = input.Substring(0, p); - var right = ""; - var rp = p + searchFor.Length; - if (rp < input.Length) - right = input.Substring(rp); - - // lambda - var repl = "" + substLamda?.Invoke(); - - // build new - input = left + repl + right; - } - - // ok - return input; - } - - // - // Base 64 - // - - public static string Base64Encode(string plainText) - { - var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); - return System.Convert.ToBase64String(plainTextBytes); - } - - public static string Base64Decode(string base64EncodedData) - { - var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData); - return System.Text.Encoding.UTF8.GetString(base64EncodedBytes); - } - - // - // Generation of Ids - // - - private static Random MyRnd = new Random(); - - public static string GenerateIdAccordingTemplate(string tpl) - { - // generate a deterministic decimal digit string - var decimals = String.Format("{0:ffffyyMMddHHmmss}", DateTime.UtcNow); - decimals = new string(decimals.Reverse().ToArray()); - // convert this to an int - if (!Int64.TryParse(decimals, out Int64 decii)) - decii = MyRnd.Next(Int32.MaxValue); - // make an hex out of this - string hexamals = decii.ToString("X"); - // make an alphanumeric string out of this - string alphamals = ""; - var dii = decii; - while (dii >= 1) - { - var m = dii % 26; - alphamals += Convert.ToChar(65 + m); - dii = dii / 26; - } - - // now, "salt" the strings - for (int i = 0; i < 32; i++) - { - var c = Convert.ToChar(48 + MyRnd.Next(10)); - decimals += c; - hexamals += c; - alphamals += c; - } - - // now, can just use the template - var id = ""; - foreach (var tpli in tpl) - { - if (tpli == 'D' && decimals.Length > 0) - { - id += decimals[0]; - decimals = decimals.Remove(0, 1); - } - else - if (tpli == 'X' && hexamals.Length > 0) - { - id += hexamals[0]; - hexamals = hexamals.Remove(0, 1); - } - else - if (tpli == 'A' && alphamals.Length > 0) - { - id += alphamals[0]; - alphamals = alphamals.Remove(0, 1); - } - else - id += tpli; - } - - // ok - return id; - } - - } -} diff --git a/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V20/AdminShellValidate.cs b/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V20/AdminShellValidate.cs deleted file mode 100644 index 524683e57..000000000 --- a/src/AasxCsharpLib_bkp/AasxCompatibilityModels/V20/AdminShellValidate.cs +++ /dev/null @@ -1,326 +0,0 @@ -/* -Copyright (c) 2018-2021 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.ComponentModel.Design; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using System.Xml; -using System.Xml.Schema; -using JetBrains.Annotations; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Newtonsoft.Json.Schema; - -//namespace AdminShellNS -namespace AdminShell_V20 -{ - /// - /// validates the XML content against the AASX XML schema. - /// - /// Please produce instances with . - /// - public class XmlValidator - { - private System.Xml.Schema.XmlSchemaSet xmlSchemaSet; - - internal XmlValidator(XmlSchemaSet xmlSchemaSet) - { - this.xmlSchemaSet = xmlSchemaSet; - } - - /// - /// validates the given XML content and stores the results in the . - /// - /// Validation records - /// Content to be validated - public void Validate(AasValidationRecordList recs, Stream xmlContent) - { - if (recs == null) - throw new ArgumentException($"Unexpected null {nameof(recs)}"); - - if (xmlContent == null) - throw new ArgumentException($"Unexpected null {nameof(xmlContent)}"); - - // load/ validate on same records - var settings = new System.Xml.XmlReaderSettings(); - settings.ValidationType = System.Xml.ValidationType.Schema; - settings.Schemas = xmlSchemaSet; - - settings.ValidationEventHandler += - (object sender, System.Xml.Schema.ValidationEventArgs e) => - { - recs.Add( - new AasValidationRecord( - AasValidationSeverity.Serialization, null, - $"XML: {e?.Exception?.LineNumber}, {e?.Exception?.LinePosition}: {e?.Message}")); - }; - - // use the xml stream - using (var reader = System.Xml.XmlReader.Create(xmlContent, settings)) - { - while (reader.Read()) - { - // Invoke callbacks - }; - } - } - } - - public enum AasValidationSeverity - { - Hint, Warning, SpecViolation, SchemaViolation, Serialization - } - - [UsedImplicitlyAttribute] // for eventual use - public enum AasValidationAction - { - No, ToBeDeleted - } - - public class AasValidationRecord - { - public AasValidationSeverity Severity = AasValidationSeverity.Hint; - public AasxCompatibilityModels.AdminShellV20.Referable Source = null; - public string Message = ""; - - public Action Fix = null; - - public AasValidationRecord(AasValidationSeverity Severity, AasxCompatibilityModels.AdminShellV20.Referable Source, - string Message, Action Fix = null) - { - this.Severity = Severity; - this.Source = Source; - this.Message = Message; - this.Fix = Fix; - } - - public override string ToString() - { - return $"[{Severity.ToString()}] in {"" + Source?.ToString()}: {"" + Message}"; - } - - public string DisplaySeverity { get { return "" + Severity.ToString(); } } - public string DisplaySource - { - get - { - return "" + ((Source != null) ? Source.ToString() : "(whole content)"); - } - } - public string DisplayMessage { get { return "" + Message?.ToString(); } } - } - - public class AasValidationRecordList : List - { - } - - public static class AasSchemaValidation - { - public enum SerializationFormat { XML, JSON } - - public static string[] GetSchemaResources(SerializationFormat fmt) - { - if (fmt == SerializationFormat.XML) - { - return new[] - { - "AdminShellNS.Resources.schemaV201.AAS.xsd", - "AdminShellNS.Resources.schemaV201.AAS_ABAC.xsd", - "AdminShellNS.Resources.schemaV201.IEC61360.xsd" - }; - } - if (fmt == SerializationFormat.JSON) - { - return new[] - { - "AdminShellNS.Resources.schemaV201.aas.json" - }; - } - return null; - } - - /// - /// produces a validator which validates XML AASX files. - /// - /// initialized validator - public static XmlValidator NewXmlValidator() - { - // Load the schema files - var files = GetSchemaResources(SerializationFormat.XML); - if (files == null) - throw new InvalidOperationException("No XML schema files could be found in the resources."); - - var xmlSchemaSet = new System.Xml.Schema.XmlSchemaSet(); - xmlSchemaSet.XmlResolver = new System.Xml.XmlUrlResolver(); - - try - { - Assembly myAssembly = Assembly.GetExecutingAssembly(); - foreach (var schemaFn in files) - { - using (Stream schemaStream = myAssembly.GetManifestResourceStream(schemaFn)) - { - using (XmlReader schemaReader = XmlReader.Create(schemaStream)) - { - xmlSchemaSet.Add(null, schemaReader); - } - } - } - } - catch (Exception ex) - { - throw new FileNotFoundException( - $"Error accessing embedded resource schema files: {ex.Message}"); - } - - var newRecs = new AasValidationRecordList(); - - // set up messages - xmlSchemaSet.ValidationEventHandler += (object sender, System.Xml.Schema.ValidationEventArgs e) => - { - newRecs.Add( - new AasValidationRecord( - AasValidationSeverity.Serialization, null, - $"{e?.Exception?.LineNumber}, {e?.Exception?.LinePosition}: {e?.Message}")); - }; - - // compile - try - { - xmlSchemaSet.Compile(); - } - catch (Exception ex) - { - throw new InvalidOperationException( - $"Error compiling schema files: {ex.Message}"); - } - - if (newRecs.Count > 0) - { - var parts = new List { $"Failed to compile the schema files:" }; - parts.AddRange(newRecs.Select((r) => r.Message)); - throw new InvalidOperationException(string.Join(Environment.NewLine, parts)); - } - - return new XmlValidator(xmlSchemaSet); - } - - /// - /// creates an XML validator and applies it on the given content. - /// - /// If you repeatedly need to validate XML against a schema, re-use an instance of - /// produced with . - /// - /// Validation records - /// Content to be validated - public static void ValidateXML(AasValidationRecordList recs, Stream xmlContent) - { - var validator = NewXmlValidator(); - validator.Validate(recs, xmlContent); - } - - public static int ValidateJSONAlternative(AasValidationRecordList recs, Stream jsonContent) - { - // see: https://github.com/RicoSuter/NJsonSchema/wiki/JsonSchemaValidator - var newRecs = new AasValidationRecordList(); - - // access - if (recs == null || jsonContent == null) - return -1; - - // Load the schema files - // right now: exactly ONE schema file - var files = GetSchemaResources(SerializationFormat.JSON); - if (files == null || files.Length != 1) - return -1; - - NJsonSchema.JsonSchema schema = null; - - try - { - Assembly myAssembly = Assembly.GetExecutingAssembly(); - foreach (var schemaFn in files) - { - using (Stream schemaStream = myAssembly.GetManifestResourceStream(schemaFn)) - { - using (var streamReader = new StreamReader(schemaStream)) - { - var allTxt = streamReader.ReadToEnd(); - schema = NJsonSchema.JsonSchema.FromJsonAsync(allTxt).GetAwaiter().GetResult(); - break; - } - } - } - } - catch (Exception ex) - { - throw new FileNotFoundException("ValidateJSON: Error loading schema: " + - ex.Message); - } - - if (schema == null) - { - throw new FileNotFoundException("ValidateJSON: Schema not found properly."); - } - - // create validator - var validator = new NJsonSchema.Validation.JsonSchemaValidator(); - - // load the JSON content - string jsonTxt = null; - try - { - using (var streamReader = new StreamReader(jsonContent)) - { - jsonTxt = streamReader.ReadToEnd(); - } - } - catch (Exception ex) - { - throw new InvalidOperationException("ValidateJSON: Error loading JSON content: " + - ex.Message); - } - - if (jsonTxt == null || jsonTxt == "") - throw new InvalidOperationException("ValidateJSON: Error loading JSON content gave null."); - - // validate - ICollection errors; - try - { - errors = validator.Validate(jsonTxt, schema); - } - catch (Exception ex) - { - throw new InvalidOperationException("ValidateJSON: Error when validating: " + - ex.Message); - } - - // re-format messages - if (errors != null) - foreach (var ve in errors) - { - var msg = ("" + ve.ToString()); - msg = Regex.Replace(msg, @"\s+", " "); - newRecs.Add(new AasValidationRecord(AasValidationSeverity.Serialization, null, - $"JSON: {ve.LineNumber,5},{ve.LinePosition:3}: {msg}")); - } - - // result - recs.AddRange(newRecs); - return newRecs.Count; - } - } -} diff --git a/src/AasxCsharpLib_bkp/AasxCsharpLibrary.csproj b/src/AasxCsharpLib_bkp/AasxCsharpLibrary.csproj deleted file mode 100644 index 2c3c19237..000000000 --- a/src/AasxCsharpLib_bkp/AasxCsharpLibrary.csproj +++ /dev/null @@ -1,42 +0,0 @@ - - - net6.0 - Library - AdminShellNS - false - - - TRACE;UseAasxCompatibilityModels - - - false - - - - PreserveNewest - - - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - - - - - - - - - - diff --git a/src/AasxCsharpLib_bkp/AdminShellCollections.cs b/src/AasxCsharpLib_bkp/AdminShellCollections.cs deleted file mode 100644 index 26fc3f837..000000000 --- a/src/AasxCsharpLib_bkp/AdminShellCollections.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright (c) 2018-2021 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AdminShellNS -{ - public class MultiValueDictionary - { - private Dictionary> dict = new Dictionary>(); - public void Add(K key, V value) - { - if (dict.TryGetValue(key, out var list)) - list.Add(value); - else - dict.Add(key, new List { value }); - } - - public bool ContainsKey(K key) => dict.ContainsKey(key); - - public List this[K key] => dict[key]; - - public IEnumerable> Keys - { - get - { - return dict.Values; - } - } - } - - public class DoubleSidedDict - { - private Dictionary _forward = new Dictionary(); - private Dictionary _backward = new Dictionary(); - - public void AddPair(T1 item1, T2 item2) - { - _forward.Add(item1, item2); - _backward.Add(item2, item1); - } - - public bool Contains1(T1 key1) => _forward.ContainsKey(key1); - public bool Contains2(T2 key2) => _backward.ContainsKey(key2); - - public T2 Get2(T1 key1) => _forward[key1]; - public T1 Get1(T2 key2) => _backward[key2]; - - public T2 Get2OrDefault(T1 key1) - => (key1 != null && _forward.ContainsKey(key1)) ? _forward[key1] : default(T2); - public T1 Get1OrDefault(T2 key2) - => (key2 != null && _backward.ContainsKey(key2)) ? _backward[key2] : default(T1); - - public void Clear() { _forward.Clear(); _backward.Clear(); } - } -} diff --git a/src/AasxCsharpLib_bkp/AdminShellConverters.cs b/src/AasxCsharpLib_bkp/AdminShellConverters.cs deleted file mode 100644 index fd30b6ec7..000000000 --- a/src/AasxCsharpLib_bkp/AdminShellConverters.cs +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright (c) 2018-2021 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using AasCore.Aas3_0_RC02; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Newtonsoft.Json.Serialization; - -namespace AdminShellNS -{ - public static class AdminShellConverters - { - /// - /// This converter is used for reading JSON files; it claims to be responsible for - /// "Referable" (the base class) - /// and decides, which sub-class of the base class shall be populated. - /// If the object is SubmodelElement, the decision, shich special sub-class to create is done in a factory - /// SubmodelElementWrapper.CreateAdequateType(), - /// in order to have all sub-class specific decisions in one place (SubmodelElementWrapper) - /// Remark: There is a NuGet package JsonSubTypes, which could have done the job, except the fact of having - /// "modelType" being a class property with a contained property "name". - /// - public class JsonAasxConverter : JsonConverter - { - private string UpperClassProperty = "modelType"; - private string LowerClassProperty = "name"; - - public JsonAasxConverter() : base() - { - } - - public JsonAasxConverter(string UpperClassProperty, string LowerClassProperty) : base() - { - this.UpperClassProperty = UpperClassProperty; - this.LowerClassProperty = LowerClassProperty; - } - - public override bool CanConvert(Type objectType) - { - // Info MIHO 21 APR 2020: changed this from SubmodelElement to Referable - if (typeof(IReferable).IsAssignableFrom(objectType)) - return true; - return false; - } - - public override bool CanWrite - { - get { return false; } - } - - public override object ReadJson(JsonReader reader, - Type objectType, - object existingValue, - JsonSerializer serializer) - { - // Load JObject from stream - JObject jObject = JObject.Load(reader); - - // Create target object based on JObject - IReferable target = null; - - if (jObject.ContainsKey(UpperClassProperty)) - { - var j2 = jObject[UpperClassProperty]; - if (j2 != null) - foreach (var c in j2.Children()) - { - var cprop = c as Newtonsoft.Json.Linq.JProperty; - if (cprop == null) - continue; - if (cprop.Name == LowerClassProperty && cprop.Value.Type.ToString() == "String") - { - var cpval = cprop.Value.ToObject(); - if (cpval == null) - continue; - // Info MIHO 21 APR 2020: use Referable.CreateAdequateType instead of SMW... - var o = CreateAdequateType(cpval); - if (o != null) - target = o; - } - } - } - - // Populate the object properties - serializer.Populate(jObject.CreateReader(), target); - - return target; - } - - public static IReferable CreateAdequateType(string elementName) - { - if (elementName == KeyTypes.AssetAdministrationShell.ToString()) - return new AssetAdministrationShell("", null); //TODO: jtikekar: refactor default - //if (elementName == "Asset") //TODO: jtikekar Change - // return new AssetInformation(AssetKind.Instance); - if (elementName == KeyTypes.ConceptDescription.ToString()) - return new ConceptDescription(""); - if (elementName == KeyTypes.Submodel.ToString()) - return new Submodel(""); - //if (elementName == KeyTypes.View) - // return new View(); - return CreateSubmodelElementIstance(elementName); - } - - private static ISubmodelElement CreateSubmodelElementIstance(string typeName) - { - //TODO: jtikekar Need to test - Type type = Type.GetType(typeName); - if (type == null || !type.IsSubclassOf(typeof(ISubmodelElement))) - return null; - var sme = Activator.CreateInstance(type) as ISubmodelElement; - return sme; - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - throw new NotImplementedException(); - } - } - - /// - /// This converter / contract resolver for Json.NET adaptively filters different levels of depth - /// of nested AASX structures. - /// - public class AdaptiveFilterContractResolver : DefaultContractResolver - { - public bool AasHasViews = true; - public bool BlobHasValue = true; - public bool SubmodelHasElements = true; - public bool SmcHasValue = true; - public bool OpHasVariables = true; - - public AdaptiveFilterContractResolver() { } - - public AdaptiveFilterContractResolver(bool deep = true, bool complete = true) - { - if (!deep) - { - this.SubmodelHasElements = false; - this.SmcHasValue = false; - this.OpHasVariables = false; - } - if (!complete) - { - this.AasHasViews = false; - this.BlobHasValue = false; - } - - } - - protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) - { - JsonProperty property = base.CreateProperty(member, memberSerialization); - - if (!BlobHasValue && property.DeclaringType == typeof(Blob) && - property.PropertyName == "value") - property.ShouldSerialize = instance => { return false; }; - - if (!SubmodelHasElements && property.DeclaringType == typeof(Submodel) && - property.PropertyName == "submodelElements") - property.ShouldSerialize = instance => { return false; }; - - if (!SmcHasValue && property.DeclaringType == typeof(SubmodelElementCollection) && - property.PropertyName == "value") - property.ShouldSerialize = instance => { return false; }; - - if (!OpHasVariables && property.DeclaringType == typeof(Operation) && - (property.PropertyName == "in" || property.PropertyName == "out")) - property.ShouldSerialize = instance => { return false; }; - - if (!AasHasViews && property.DeclaringType == typeof(AssetAdministrationShell) && - property.PropertyName == "views") - property.ShouldSerialize = instance => { return false; }; - - return property; - } - } - - } -} diff --git a/src/AasxCsharpLib_bkp/AdminShellPackageEnv.cs b/src/AasxCsharpLib_bkp/AdminShellPackageEnv.cs deleted file mode 100644 index d0953358f..000000000 --- a/src/AasxCsharpLib_bkp/AdminShellPackageEnv.cs +++ /dev/null @@ -1,1454 +0,0 @@ -/* -Copyright (c) 2018-2021 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.IO.Packaging; -using System.Linq; -using System.Text.RegularExpressions; -using System.Xml; -using System.Xml.Serialization; -using AasCore.Aas3_0_RC02; -using AdminShellNS; -using Extensions; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace AdminShellNS -{ - /// - /// This class lets an outer functionality keep track on the supplementary files, which are in or - /// are pending to be added or deleted to an Package. - /// - public class AdminShellPackageSupplementaryFile /*: IReferable*/ - { - public delegate byte[] SourceGetByteChunk(); - - public enum LocationType { InPackage, AddPending, DeletePending } - - public enum SpecialHandlingType { None, EmbedAsThumbnail } - - public readonly Uri Uri = null; - - public readonly string UseMimeType = null; - - public readonly string SourceLocalPath = null; - public readonly SourceGetByteChunk SourceGetBytesDel = null; - - public LocationType Location; - public readonly SpecialHandlingType SpecialHandling; - - public AdminShellPackageSupplementaryFile( - Uri uri, string sourceLocalPath = null, LocationType location = LocationType.InPackage, - SpecialHandlingType specialHandling = SpecialHandlingType.None, - SourceGetByteChunk sourceGetBytesDel = null, string useMimeType = null) - { - Uri = uri; - UseMimeType = useMimeType; - SourceLocalPath = sourceLocalPath; - SourceGetBytesDel = sourceGetBytesDel; - Location = location; - SpecialHandling = specialHandling; - } - - // class derives from Referable in order to provide GetElementName - public string GetElementName() - { - return "File"; - } - - } - - public class ListOfAasSupplementaryFile : List - { - public AdminShellPackageSupplementaryFile FindByUri(string path) - { - if (path == null) - return null; - - return this.FirstOrDefault( - x => x?.Uri?.ToString().Trim() == path.Trim()); - } - } - - /// - /// Provides (static?) helpers for serializing AAS.. - /// - public static class AdminShellSerializationHelper - { - - public static string TryReadXmlFirstElementNamespaceURI(Stream s) - { - string res = null; - try - { - var xr = System.Xml.XmlReader.Create(s); - int i = 0; - while (xr.Read()) - { - // limit amount of read - i++; - if (i > 99) - // obviously not found - break; - - // find element - if (xr.NodeType == System.Xml.XmlNodeType.Element) - { - res = xr.NamespaceURI; - break; - } - } - xr.Close(); - } - catch (Exception ex) - { - LogInternally.That.SilentlyIgnoredError(ex); - } - - // return to zero pos - s.Seek(0, SeekOrigin.Begin); - - // give back - return res; - } - - /// - /// Skips first few tokens of an XML content until first "real" element is encountered - /// - /// - public static void XmlSkipHeader(XmlReader xmlReader) - { - while (xmlReader.NodeType == XmlNodeType.XmlDeclaration || - xmlReader.NodeType == XmlNodeType.Whitespace || - xmlReader.NodeType == XmlNodeType.Comment || - xmlReader.NodeType == XmlNodeType.None) - xmlReader.Read(); - } - - /// - /// De-serialize an open stream into Environment. Does version/ compatibility management. - /// - /// Open for read stream - /// - public static AasCore.Aas3_0_RC02.Environment DeserializeXmlFromStreamWithCompat(Stream s) - { - // not sure - AasCore.Aas3_0_RC02.Environment res = null; - - // try get first element - var nsuri = TryReadXmlFirstElementNamespaceURI(s); - - // read V1.0? - if (nsuri != null && nsuri.Trim() == "http://www.admin-shell.io/aas/1/0") - { -#if !DoNotUseAasxCompatibilityModels - XmlSerializer serializer = new XmlSerializer( - typeof(AasxCompatibilityModels.AdminShellV10.AdministrationShellEnv), - "http://www.admin-shell.io/aas/1/0"); - var v10 = serializer.Deserialize(s) as AasxCompatibilityModels.AdminShellV10.AdministrationShellEnv; - //res = new AdministrationShellEnv(v10); - res = new AasCore.Aas3_0_RC02.Environment(new List(), new List(), new List()); - res.ConvertFromV10(v10); - return res; -#else - throw (new Exception("Cannot handle AAS file format http://www.admin-shell.io/aas/1/0 !")); -#endif - } - - // read V2.0? - if (nsuri != null && nsuri.Trim() == "http://www.admin-shell.io/aas/2/0") - { -#if !DoNotUseAasxCompatibilityModels - XmlSerializer serializer = new XmlSerializer( - typeof(AasxCompatibilityModels.AdminShellV20.AdministrationShellEnv), - "http://www.admin-shell.io/aas/2/0"); - var v20 = serializer.Deserialize(s) as AasxCompatibilityModels.AdminShellV20.AdministrationShellEnv; - //res = new AdministrationShellEnv(v20); - res = new AasCore.Aas3_0_RC02.Environment(new List(), new List(), new List()); - res.ConvertFromV20(v20); - return res; -#else - throw (new Exception("Cannot handle AAS file format http://www.admin-shell.io/aas/1/0 !")); -#endif - } - - // read V3.0? - if (nsuri != null && nsuri.Trim() == Xmlization.NS) - { - //XmlSerializer serializer = new XmlSerializer( - // typeof(AasCore.Aas3_0_RC02.Environment), "http://www.admin-shell.io/aas/3/0"); - //res = serializer.Deserialize(s) as AasCore.Aas3_0_RC02.Environment; - - using (var xmlReader = XmlReader.Create(s)) - { - // TODO (MIHO, 2022-12-26): check if could be feature of AAS core - XmlSkipHeader(xmlReader); - res = Xmlization.Deserialize.EnvironmentFrom(xmlReader); - return res; - } - } - - // nope! - return null; - } - - //public static JsonSerializer BuildDefaultAasxJsonSerializer() - //{ - // var serializer = new JsonSerializer(); - // serializer.Converters.Add( - // new AdminShellConverters.JsonAasxConverter( - // "modelType", "name")); - // return serializer; - //} - - public static T DeserializeFromJSON(string data) where T : IReferable - { - //using (var tr = new StringReader(data)) - //{ - //var serializer = BuildDefaultAasxJsonSerializer(); - //var rf = (T)serializer.Deserialize(tr, typeof(T)); - - var node = System.Text.Json.Nodes.JsonNode.Parse(data); - var rf = Jsonization.Deserialize.IReferableFrom(node); - - return (T)rf; - //} - } - - //public static T DeserializeFromJSON(JToken obj) where T : IReferable - //{ - // if (obj == null) - // return default(T); - // var serializer = BuildDefaultAasxJsonSerializer(); - // var rf = obj.ToObject(serializer); - // return rf; - //} - - ///// - ///// Use this, if DeserializeFromJSON is too tight. - ///// - //public static T DeserializePureObjectFromJSON(string data) - //{ - // using (var tr = new StringReader(data)) - // { - // //var serializer = BuildDefaultAasxJsonSerializer(); - // //var rf = (T)serializer.Deserialize(tr, typeof(T)); - // return null; - // } - //} - } - - /// - /// This class encapsulates an AdminShellEnvironment and supplementary files into an AASX Package. - /// Specifically has the capability to load, update and store .XML, .JSON and .AASX packages. - /// - public class AdminShellPackageEnv : IDisposable - { - private string _fn = "New Package"; - - private string _tempFn = null; - - private AasCore.Aas3_0_RC02.Environment _aasEnv = new AasCore.Aas3_0_RC02.Environment(new List(), new List(), new List()); - private Package _openPackage = null; - private readonly ListOfAasSupplementaryFile _pendingFilesToAdd = new ListOfAasSupplementaryFile(); - private readonly ListOfAasSupplementaryFile _pendingFilesToDelete = new ListOfAasSupplementaryFile(); - - public AdminShellPackageEnv() { } - - public AdminShellPackageEnv(AasCore.Aas3_0_RC02.Environment env) - { - if (env != null) - _aasEnv = env; - } - - public AdminShellPackageEnv(string fn, bool indirectLoadSave = false) - { - Load(fn, indirectLoadSave); - } - - public bool IsOpen - { - get - { - return _openPackage != null; - } - } - - public string Filename - { - get - { - return _fn; - } - } - - public AasCore.Aas3_0_RC02.Environment AasEnv - { - get - { - return _aasEnv; - } - } - - private static AasCore.Aas3_0_RC02.Environment LoadXml(string fn) - { - try - { - using (var reader = new StreamReader(fn)) - { - var aasEnv = AdminShellSerializationHelper.DeserializeXmlFromStreamWithCompat( - reader.BaseStream); - - if (aasEnv == null) - throw new Exception("Type error for XML file"); - - return aasEnv; - } - } - catch (Exception ex) - { - throw new Exception( - $"While reading AAS {fn} at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}"); - } - } - - private static AasCore.Aas3_0_RC02.Environment LoadJson(string fn) - { - try - { - using (var file = System.IO.File.OpenRead(fn)) - { - //// TODO (Michael Hoffmeister, 2020-08-01): use a unified function to create a serializer - //var serializer = new JsonSerializer(); - //serializer.Converters.Add( - // new AdminShellConverters.JsonAasxConverter( - // "modelType", "name")); - - //var aasEnv = (AasCore.Aas3_0_RC02.Environment)serializer.Deserialize( - // file, typeof(AasCore.Aas3_0_RC02.Environment)); - - var node = System.Text.Json.Nodes.JsonNode.Parse(file); - var aasEnv = Jsonization.Deserialize.EnvironmentFrom(node); - - return aasEnv; - } - } - catch (Exception ex) - { - throw new Exception( - $"While reading AAS {fn} at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}"); - } - } - - /// is unequal if indirectLoadSave is used. - private static (AasCore.Aas3_0_RC02.Environment, Package) LoadPackageAasx(string fn, string fnToLoad) - { - AasCore.Aas3_0_RC02.Environment aasEnv; - Package openPackage = null; - - Package package; - try - { - package = Package.Open(fnToLoad, FileMode.Open); - } - catch (Exception ex) - { - throw new Exception( - fn == fnToLoad - ? $"While opening the package to read AASX {fn} " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}" - : $"While opening the package to read AASX {fn} indirectly from {fnToLoad} " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}"); - } - - try - { - // get the origin from the package - PackagePart originPart = null; - var xs = package.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - originPart = package.GetPart(x.TargetUri); - break; - } - - if (originPart == null) - throw (new Exception("Unable to find AASX origin. Aborting!")); - - // get the specs from the package - PackagePart specPart = null; - xs = originPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-spec"); - foreach (var x in xs) - { - specPart = package.GetPart(x.TargetUri); - break; - } - - if (specPart == null) - throw (new Exception("Unable to find AASX spec(s). Aborting!")); - - // open spec part to read - try - { - if (specPart.Uri.ToString().ToLower().Trim().EndsWith("json")) - { - using (var s = specPart.GetStream(FileMode.Open)) - { - //using (var file = new StreamReader(s)) - //{ - //JsonSerializer serializer = new JsonSerializer(); - //serializer.Converters.Add( - // new AdminShellConverters.JsonAasxConverter( - // "modelType", "name")); - - //aasEnv = (AasCore.Aas3_0_RC02.Environment)serializer.Deserialize( - // file, typeof(AasCore.Aas3_0_RC02.Environment)); - - var node = System.Text.Json.Nodes.JsonNode.Parse(s); - aasEnv = Jsonization.Deserialize.EnvironmentFrom(node); - //} - } - } - else - { - using (var s = specPart.GetStream(FileMode.Open)) - { - // own catch loop to be more specific - aasEnv = AdminShellSerializationHelper.DeserializeXmlFromStreamWithCompat(s); - openPackage = package; - - if (aasEnv == null) - throw new Exception("Type error for XML file!"); - } - } - } - catch (Exception ex) - { - throw new Exception( - fn == fnToLoad - ? $"While reading spec from the AASX {fn} " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}" - : $"While reading spec from the {fn} (and indirectly over {fnToLoad}) " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}"); - } - } - catch (Exception ex) - { - throw new Exception( - fn == fnToLoad - ? $"While reading the AASX {fn} " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}" - : $"While reading the {fn} (and indirectly over {fnToLoad}) " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}"); - } - finally - { - if (openPackage == null) - { - package.Close(); - } - } - - return (aasEnv, openPackage); - } - - public void Load(string fn, bool indirectLoadSave = false) - { - _fn = fn; - _openPackage?.Close(); - _openPackage = null; - - string extension = Path.GetExtension(fn).ToLower(); - switch (extension) - { - case ".xml": - { - _aasEnv = LoadXml(fn); - break; - } - case ".json": - { - _aasEnv = LoadJson(fn); - break; - } - case ".aasx": - { - var fnToLoad = fn; - _tempFn = null; - if (indirectLoadSave) - { - try - { - _tempFn = System.IO.Path.GetTempFileName().Replace(".tmp", ".aasx"); - System.IO.File.Copy(fn, _tempFn); - fnToLoad = _tempFn; - - } - catch (Exception ex) - { - throw new Exception( - $"While copying AASX {fn} for indirect load to {fnToLoad} " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}"); - } - } - - // load package AASX - (_aasEnv, _openPackage) = LoadPackageAasx(fn, fnToLoad); - break; - } - default: - throw new Exception( - $"Does not know how to handle the extension {extension} of the file: {fn}"); - } - } - - public void LoadFromAasEnvString(string content) - { - try - { - //using (var file = new StringReader(content)) - //{ - // TODO (Michael Hoffmeister, 2020-08-01): use a unified function to create a serializer - //JsonSerializer serializer = new JsonSerializer(); - //serializer.Converters.Add(new AdminShellConverters.JsonAasxConverter("modelType", "name")); - //_aasEnv = (AasCore.Aas3_0_RC02.Environment)serializer.Deserialize( - // file, typeof(AasCore.Aas3_0_RC02.Environment)); - - var node = System.Text.Json.Nodes.JsonNode.Parse(content); - _aasEnv = Jsonization.Deserialize.EnvironmentFrom(node); - //} - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While reading AASENV string {0} gave: {1}", - AdminShellUtil.ShortLocation(ex), ex.Message))); - } - } - - public enum SerializationFormat { None, Xml, Json }; - - //public static XmlSerializerNamespaces GetXmlDefaultNamespaces() - //{ - // var nss = new XmlSerializerNamespaces(); - // nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - // nss.Add("aas", "http://www.admin-shell.io/aas/2/0"); - // nss.Add("IEC", "http://www.admin-shell.io/IEC61360/2/0"); - // nss.Add("abac", "http://www.admin-shell.io/aas/abac/2/0"); - // return nss; - //} - - public bool SaveAs(string fn, bool writeFreshly = false, SerializationFormat prefFmt = SerializationFormat.None, - MemoryStream useMemoryStream = null, bool saveOnlyCopy = false) - { - if (fn.ToLower().EndsWith(".xml")) - { - // save only XML - if (!saveOnlyCopy) - _fn = fn; - try - { - Stream s = (useMemoryStream != null) - ? (Stream)useMemoryStream - : System.IO.File.Open(fn, FileMode.Create, FileAccess.Write); - - try - { - // TODO (Michael Hoffmeister, 2020-08-01): use a unified function to create a serializer - //var serializer = new XmlSerializer(typeof(AasCore.Aas3_0_RC02.Environment)); - //var nss = GetXmlDefaultNamespaces(); - //serializer.Serialize(s, _aasEnv, nss); - - var writer = XmlWriter.Create(s, new XmlWriterSettings() { Indent = true }); - Xmlization.Serialize.To( - _aasEnv, writer); - writer.Flush(); - writer.Close(); - s.Flush(); - } - finally - { - // close? - if (useMemoryStream == null) - s.Close(); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While writing AAS {0} at {1} gave: {2}", - fn, AdminShellUtil.ShortLocation(ex), ex.Message))); - } - return true; - } - - if (fn.ToLower().EndsWith(".json")) - { - // save only JSON - // This functionality is an initial test. - if (!saveOnlyCopy) - _fn = fn; - try - { - Stream s = (useMemoryStream != null) ? (Stream)useMemoryStream - : System.IO.File.Open(fn, FileMode.Create, FileAccess.Write); - - try - { - //// TODO (Michael Hoffmeister, 2020-08-01): use a unified function to create a serializer - //JsonSerializer serializer = new JsonSerializer() - //{ - // NullValueHandling = NullValueHandling.Ignore, - // ReferenceLoopHandling = ReferenceLoopHandling.Serialize, - // Formatting = Newtonsoft.Json.Formatting.Indented - //}; - - //var sw = new StreamWriter(s); - //var writer = new JsonTextWriter(sw); - - //serializer.Serialize(writer, _aasEnv); - //writer.Flush(); - //sw.Flush(); - //s.Flush(); - - //if (useMemoryStream == null) - //{ - // writer.Close(); - // sw.Close(); - //} - - using (var wr = new System.Text.Json.Utf8JsonWriter(s)) - { - Jsonization.Serialize.ToJsonObject(_aasEnv).WriteTo(wr, - new System.Text.Json.JsonSerializerOptions() - { - WriteIndented = true - }); - wr.Flush(); - s.Flush(); - } - } - finally - { - // close? - if (useMemoryStream == null) - s.Close(); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While writing AAS {0} at {1} gave: {2}", - fn, AdminShellUtil.ShortLocation(ex), ex.Message))); - } - return true; - } - - if (fn.ToLower().EndsWith(".aasx")) - { - // save package AASX - try - { - // We want existing contents to be preserved, but do not want to allow the change of the file name. - // Therefore: copy the file to a new name, then re-open. - // fn could be changed, therefore close "old" package first - if (_openPackage != null) - { - try - { - _openPackage.Close(); - if (!writeFreshly) - { - if (_tempFn != null) - System.IO.File.Copy(_tempFn, fn); - else - { - /* TODO (MIHO, 2021-01-02): check again. - * Revisiting this code after a while, and after - * the code has undergo some changes by MR, the following copy command needed - * to be amended with a if to protect against self-copy. */ - if (_fn != fn) - System.IO.File.Copy(_fn, fn); - } - } - } - catch (Exception ex) - { - LogInternally.That.SilentlyIgnoredError(ex); - } - _openPackage = null; - } - - // approach is to utilize the existing package, if possible. If not, create from scratch - Package package = null; - if (useMemoryStream != null) - { - package = Package.Open( - useMemoryStream, (writeFreshly) ? FileMode.Create : FileMode.OpenOrCreate); - } - else - { - package = Package.Open( - (_tempFn != null) ? _tempFn : fn, - (writeFreshly) ? FileMode.Create : FileMode.OpenOrCreate); - } - _fn = fn; - - // get the origin from the package - PackagePart originPart = null; - var xs = package.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - originPart = package.GetPart(x.TargetUri); - break; - } - if (originPart == null) - { - // create, as not existing - originPart = package.CreatePart( - new Uri("/aasx/aasx-origin", UriKind.RelativeOrAbsolute), - System.Net.Mime.MediaTypeNames.Text.Plain, CompressionOption.Maximum); - using (var s = originPart.GetStream(FileMode.Create)) - { - var bytes = System.Text.Encoding.ASCII.GetBytes("Intentionally empty."); - s.Write(bytes, 0, bytes.Length); - } - package.CreateRelationship( - originPart.Uri, TargetMode.Internal, - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - } - - // get the specs from the package - PackagePart specPart = null; - PackageRelationship specRel = null; - xs = originPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-spec"); - foreach (var x in xs) - { - specRel = x; - specPart = package.GetPart(x.TargetUri); - break; - } - - // check, if we have to change the spec part - if (specPart != null && specRel != null) - { - var name = System.IO.Path.GetFileNameWithoutExtension( - specPart.Uri.ToString()).ToLower().Trim(); - var ext = System.IO.Path.GetExtension(specPart.Uri.ToString()).ToLower().Trim(); - if ((ext == ".json" && prefFmt == SerializationFormat.Xml) - || (ext == ".xml" && prefFmt == SerializationFormat.Json) - || (name.StartsWith("aasenv-with-no-id"))) - { - // try kill specpart - try - { - originPart.DeleteRelationship(specRel.Id); - package.DeletePart(specPart.Uri); - } - catch (Exception ex) - { - LogInternally.That.SilentlyIgnoredError(ex); - } - finally { specPart = null; specRel = null; } - } - } - - if (specPart == null) - { - // create, as not existing - var frn = "aasenv-with-no-id"; - if (_aasEnv.AssetAdministrationShells.Count > 0) - frn = _aasEnv.AssetAdministrationShells[0].GetFriendlyName() ?? frn; - var aas_spec_fn = "/aasx/#/#.aas"; - if (prefFmt == SerializationFormat.Json) - aas_spec_fn += ".json"; - else - aas_spec_fn += ".xml"; - aas_spec_fn = aas_spec_fn.Replace("#", "" + frn); - specPart = package.CreatePart( - new Uri(aas_spec_fn, UriKind.RelativeOrAbsolute), - System.Net.Mime.MediaTypeNames.Text.Xml, CompressionOption.Maximum); - originPart.CreateRelationship( - specPart.Uri, TargetMode.Internal, - "http://www.admin-shell.io/aasx/relationships/aas-spec"); - } - - // now, specPart shall be != null! - if (specPart.Uri.ToString().ToLower().Trim().EndsWith("json")) - { - using (var s = specPart.GetStream(FileMode.Create)) - { - JsonSerializer serializer = new JsonSerializer(); - serializer.NullValueHandling = NullValueHandling.Ignore; - serializer.ReferenceLoopHandling = ReferenceLoopHandling.Serialize; - serializer.Formatting = Newtonsoft.Json.Formatting.Indented; - using (var sw = new StreamWriter(s)) - { - using (JsonWriter writer = new JsonTextWriter(sw)) - { - serializer.Serialize(writer, _aasEnv); - } - } - } - } - else - { - using (var s = specPart.GetStream(FileMode.Create)) - { - //var serializer = new XmlSerializer(typeof(AasCore.Aas3_0_RC02.Environment)); - //var nss = GetXmlDefaultNamespaces(); - //serializer.Serialize(s, _aasEnv, nss); - - var writer = XmlWriter.Create(s, new XmlWriterSettings() { Indent = true }); - Xmlization.Serialize.To( - _aasEnv, writer); - writer.Flush(); - writer.Close(); - s.Flush(); - } - } - - // there might be pending files to be deleted (first delete, then add, - // in case of identical files in both categories) - foreach (var psfDel in _pendingFilesToDelete) - { - // try find an existing part for that file .. - var found = false; - - // normal files - xs = specPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-suppl"); - foreach (var x in xs) - if (x.TargetUri == psfDel.Uri) - { - // try to delete - specPart.DeleteRelationship(x.Id); - package.DeletePart(psfDel.Uri); - found = true; - break; - } - - // thumbnails - xs = package.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.TargetUri == psfDel.Uri) - { - // try to delete - package.DeleteRelationship(x.Id); - package.DeletePart(psfDel.Uri); - found = true; - break; - } - - if (!found) - throw (new Exception( - $"Not able to delete pending file {psfDel.Uri} in saving package {fn}")); - } - - // after this, there are no more pending for delete files - _pendingFilesToDelete.Clear(); - - // write pending supplementary files - foreach (var psfAdd in _pendingFilesToAdd) - { - // make sure .. - if ((psfAdd.SourceLocalPath == null && psfAdd.SourceGetBytesDel == null) || - psfAdd.Location != AdminShellPackageSupplementaryFile.LocationType.AddPending) - continue; - - // normal file? - if (psfAdd.SpecialHandling == AdminShellPackageSupplementaryFile.SpecialHandlingType.None || - psfAdd.SpecialHandling == - AdminShellPackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail) - { - - // try find an existing part for that file .. - PackagePart filePart = null; - if (psfAdd.SpecialHandling == AdminShellPackageSupplementaryFile.SpecialHandlingType.None) - { - xs = specPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-suppl"); - foreach (var x in xs) - if (x.TargetUri == psfAdd.Uri) - { - filePart = package.GetPart(x.TargetUri); - break; - } - } - if (psfAdd.SpecialHandling == - AdminShellPackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail) - { - xs = package.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/" && x.TargetUri == psfAdd.Uri) - { - filePart = package.GetPart(x.TargetUri); - break; - } - } - - if (filePart == null) - { - // determine mimeType - var mimeType = psfAdd.UseMimeType; - // reconcile mime - if (mimeType == null && psfAdd.SourceLocalPath != null) - mimeType = AdminShellPackageEnv.GuessMimeType(psfAdd.SourceLocalPath); - // still null? - if (mimeType == null) - // see: https://stackoverflow.com/questions/6783921/ - // which-mime-type-to-use-for-a-binary-file-thats-specific-to-my-program - mimeType = "application/octet-stream"; - - // create new part and link - filePart = package.CreatePart(psfAdd.Uri, mimeType, CompressionOption.Maximum); - if (psfAdd.SpecialHandling == - AdminShellPackageSupplementaryFile.SpecialHandlingType.None) - specPart.CreateRelationship( - filePart.Uri, TargetMode.Internal, - "http://www.admin-shell.io/aasx/relationships/aas-suppl"); - if (psfAdd.SpecialHandling == - AdminShellPackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail) - package.CreateRelationship( - filePart.Uri, TargetMode.Internal, - "http://schemas.openxmlformats.org/package/2006/" + - "relationships/metadata/thumbnail"); - } - - // now should be able to write - using (var s = filePart.GetStream(FileMode.Create)) - { - if (psfAdd.SourceLocalPath != null) - { - var bytes = System.IO.File.ReadAllBytes(psfAdd.SourceLocalPath); - s.Write(bytes, 0, bytes.Length); - } - - if (psfAdd.SourceGetBytesDel != null) - { - var bytes = psfAdd.SourceGetBytesDel(); - if (bytes != null) - s.Write(bytes, 0, bytes.Length); - } - } - } - } - - // after this, there are no more pending for add files - _pendingFilesToAdd.Clear(); - - // flush, but leave open - package.Flush(); - _openPackage = package; - - // if in temp fn, close the package, copy to original fn, re-open the package - if (_tempFn != null) - try - { - package.Close(); - System.IO.File.Copy(_tempFn, _fn, overwrite: true); - _openPackage = Package.Open(_tempFn, FileMode.OpenOrCreate); - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While write AASX {0} indirectly at {1} gave: {2}", - fn, AdminShellUtil.ShortLocation(ex), ex.Message))); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While write AASX {0} at {1} gave: {2}", - fn, AdminShellUtil.ShortLocation(ex), ex.Message))); - } - return true; - } - - // Don't know to handle - throw new Exception($"Does not know how to handle the file: {fn}"); - } - - /// - /// Temporariyl saves & closes package and executes lambda. Afterwards, the package is re-opened - /// under the same file name - /// - /// Action which is to be executed while the file is CLOSED - /// Format for the saved file - public void TemporarilySaveCloseAndReOpenPackage( - Action lambda, - AdminShellPackageEnv.SerializationFormat prefFmt = AdminShellPackageEnv.SerializationFormat.None) - { - // access - if (!this.IsOpen) - throw (new Exception( - string.Format("Could not temporarily close and re-open AASX {0}, because package" + - "not open as expected!", Filename))); - - try - { - // save (it will be open, still) - SaveAs(this.Filename, prefFmt: prefFmt); - - // close - _openPackage.Flush(); - _openPackage.Close(); - - // execute lambda - lambda?.Invoke(); - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While temporarily close and re-open AASX {0} at {1} gave: {2}", - Filename, AdminShellUtil.ShortLocation(ex), ex.Message))); - } - finally - { - // even after failing of the lambda, the package shall be re-opened - _openPackage = Package.Open(Filename, FileMode.OpenOrCreate); - } - } - - private int BackupIndex = 0; - - public void BackupInDir(string backupDir, int maxFiles) - { - // access - if (backupDir == null || maxFiles < 1) - return; - - // we do it not caring on any errors - try - { - // get index in form - if (BackupIndex == 0) - { - // do not always start at 0!! - var rnd = new Random(); - BackupIndex = rnd.Next(maxFiles); - } - var ndx = BackupIndex % maxFiles; - BackupIndex += 1; - - // build a filename - var bdfn = Path.Combine(backupDir, $"backup{ndx:000}.xml"); - - // raw save - using (var s = new StreamWriter(bdfn)) - { - //var serializer = new XmlSerializer(typeof(AasCore.Aas3_0_RC02.Environment)); - //var nss = new XmlSerializerNamespaces(); - //nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - //nss.Add("aas", "http://www.admin-shell.io/aas/2/0"); - //nss.Add("IEC61360", "http://www.admin-shell.io/IEC61360/2/0"); - //serializer.Serialize(s, _aasEnv, nss); - - var writer = XmlWriter.Create(s, new XmlWriterSettings() { Indent = true }); - Xmlization.Serialize.To( - _aasEnv, writer); - writer.Flush(); - writer.Close(); - s.Flush(); - } - } - catch (Exception ex) - { - LogInternally.That.SilentlyIgnoredError(ex); - } - } - - public Stream GetStreamFromUriOrLocalPackage(string uriString, - FileMode mode = FileMode.Open, - FileAccess access = FileAccess.Read) - { - // local - if (IsLocalFile(uriString)) - return GetLocalStreamFromPackage(uriString, mode, access); - - // no .. - return System.IO.File.Open(uriString, mode, access); - } - - public byte[] GetByteArrayFromUriOrLocalPackage(string uriString) - { - try - { - using (var input = GetStreamFromUriOrLocalPackage(uriString)) - { - using (MemoryStream ms = new MemoryStream()) - { - input.CopyTo(ms); - return ms.ToArray(); - } - } - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - return null; - } - } - - public bool IsLocalFile(string uriString) - { - // access - if (_openPackage == null) - return false; - if (uriString == null || uriString == "" || !uriString.StartsWith("/")) - return false; - - // check - var isLocal = _openPackage.PartExists(new Uri(uriString, UriKind.RelativeOrAbsolute)); - return isLocal; - } - - public Stream GetLocalStreamFromPackage(string uriString, FileMode mode = FileMode.Open, FileAccess access = FileAccess.Read) - { - // access - if (_openPackage == null) - throw (new Exception(string.Format($"AASX Package {_fn} not opened. Aborting!"))); - - // exist - var puri = new Uri(uriString, UriKind.RelativeOrAbsolute); - if (!_openPackage.PartExists(puri)) - throw (new Exception(string.Format($"AASX Package has no part {uriString}. Aborting!"))); - - // get part - var part = _openPackage.GetPart(puri); - if (part == null) - throw (new Exception( - string.Format($"Cannot access part {uriString} in {_fn}. Aborting!"))); - return part.GetStream(mode, access); - } - - public long GetStreamSizeFromPackage(string uriString) - { - long res = 0; - try - { - if (_openPackage == null) - return 0; - var part = _openPackage.GetPart(new Uri(uriString, UriKind.RelativeOrAbsolute)); - using (var s = part.GetStream(FileMode.Open)) - { - res = s.Length; - } - } - catch (Exception ex) - { - LogInternally.That.SilentlyIgnoredError(ex); - return 0; - } - return res; - } - - /// - /// Ensures: - ///
  • result == null || result.CanRead
- ///
- public Stream GetLocalThumbnailStream(ref Uri thumbUri) - { - // access - if (_openPackage == null) - throw (new Exception(string.Format($"AASX Package {_fn} not opened. Aborting!"))); - // get the thumbnail over the relationship - PackagePart thumbPart = null; - var xs = _openPackage.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - thumbPart = _openPackage.GetPart(x.TargetUri); - thumbUri = x.TargetUri; - break; - } - if (thumbPart == null) - throw (new Exception("Unable to find AASX thumbnail. Aborting!")); - - var result = thumbPart.GetStream(FileMode.Open); - - // Post-condition - if (!(result == null || result.CanRead)) - { - throw new InvalidOperationException("Unexpected unreadable result stream"); - } - - return result; - } - - /// - /// Ensures: - ///
  • result == null || result.CanRead
- ///
- public Stream GetLocalThumbnailStream() - { - Uri dummy = null; - var result = GetLocalThumbnailStream(ref dummy); - - // Post-condition - if (!(result == null || result.CanRead)) - { - throw new InvalidOperationException("Unexpected unreadable result stream"); - } - - return result; - } - - public ListOfAasSupplementaryFile GetListOfSupplementaryFiles() - { - // new result - var result = new ListOfAasSupplementaryFile(); - - // access - if (_openPackage != null) - { - - // get the thumbnail(s) from the package - var xs = _openPackage.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - result.Add(new AdminShellPackageSupplementaryFile( - x.TargetUri, - location: AdminShellPackageSupplementaryFile.LocationType.InPackage, - specialHandling: AdminShellPackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail)); - } - - // get the origin from the package - PackagePart originPart = null; - xs = _openPackage.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - originPart = _openPackage.GetPart(x.TargetUri); - break; - } - - if (originPart != null) - { - // get the specs from the origin - PackagePart specPart = null; - xs = originPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-spec"); - foreach (var x in xs) - { - specPart = _openPackage.GetPart(x.TargetUri); - break; - } - - if (specPart != null) - { - // get the supplementaries from the package, derived from spec - xs = specPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-suppl"); - foreach (var x in xs) - { - result.Add( - new AdminShellPackageSupplementaryFile( - x.TargetUri, location: AdminShellPackageSupplementaryFile.LocationType.InPackage)); - } - } - } - } - - // add or modify the files to delete - foreach (var psfDel in _pendingFilesToDelete) - { - // already in - var found = result.Find(x => { return x.Uri == psfDel.Uri; }); - if (found != null) - found.Location = AdminShellPackageSupplementaryFile.LocationType.DeletePending; - else - { - psfDel.Location = AdminShellPackageSupplementaryFile.LocationType.DeletePending; - result.Add(psfDel); - } - } - - // add the files to store as well - foreach (var psfAdd in _pendingFilesToAdd) - { - // already in (should not happen ?!) - var found = result.Find(x => { return x.Uri == psfAdd.Uri; }); - if (found != null) - found.Location = AdminShellPackageSupplementaryFile.LocationType.AddPending; - else - { - psfAdd.Location = AdminShellPackageSupplementaryFile.LocationType.AddPending; - result.Add(psfAdd); - } - } - - // done - return result; - } - - public static string GuessMimeType(string fn) - { - var file_ext = System.IO.Path.GetExtension(fn).ToLower().Trim(); - var content_type = System.Net.Mime.MediaTypeNames.Text.Plain; - if (file_ext == ".pdf") content_type = System.Net.Mime.MediaTypeNames.Application.Pdf; - if (file_ext == ".xml") content_type = System.Net.Mime.MediaTypeNames.Text.Xml; - if (file_ext == ".txt") content_type = System.Net.Mime.MediaTypeNames.Text.Plain; - if (file_ext == ".igs") content_type = "application/iges"; - if (file_ext == ".iges") content_type = "application/iges"; - if (file_ext == ".stp") content_type = "application/step"; - if (file_ext == ".step") content_type = "application/step"; - if (file_ext == ".jpg") content_type = System.Net.Mime.MediaTypeNames.Image.Jpeg; - if (file_ext == ".jpeg") content_type = System.Net.Mime.MediaTypeNames.Image.Jpeg; - if (file_ext == ".png") content_type = "image/png"; - if (file_ext == ".gif") content_type = System.Net.Mime.MediaTypeNames.Image.Gif; - return content_type; - } - - public void PrepareSupplementaryFileParameters(ref string targetDir, ref string targetFn) - { - // re-work target dir - if (targetDir != null) - targetDir = targetDir.Replace(@"\", "/"); - - // rework targetFn - if (targetFn != null) - targetFn = Regex.Replace(targetFn, @"[^A-Za-z0-9-.]+", "_"); - } - - /// - /// Add a file as supplementary file to package. Operation will be pending, package needs to be saved in order - /// materialize embedding. - /// - /// Target path of file in package - public string AddSupplementaryFileToStore( - string sourcePath, string targetDir, string targetFn, bool embedAsThumb, - AdminShellPackageSupplementaryFile.SourceGetByteChunk sourceGetBytesDel = null, string useMimeType = null) - { - // beautify parameters - if ((sourcePath == null && sourceGetBytesDel == null) || targetDir == null || targetFn == null) - return null; - - // build target path - targetDir = targetDir.Trim(); - if (!targetDir.EndsWith("/")) - targetDir += "/"; - targetFn = targetFn.Trim(); - if (sourcePath == "" || targetDir == "" || targetFn == "") - throw (new Exception("Trying add supplementary file with empty name or path!")); - - var targetPath = "" + targetDir.Trim() + targetFn.Trim(); - - // base function - AddSupplementaryFileToStore(sourcePath, targetPath, embedAsThumb, sourceGetBytesDel, useMimeType); - - // return target path - return targetPath; - } - - public void AddSupplementaryFileToStore(string sourcePath, string targetPath, bool embedAsThumb, - AdminShellPackageSupplementaryFile.SourceGetByteChunk sourceGetBytesDel = null, string useMimeType = null) - { - // beautify parameters - if ((sourcePath == null && sourceGetBytesDel == null) || targetPath == null) - return; - - sourcePath = sourcePath?.Trim(); - targetPath = targetPath.Trim(); - - // add record - _pendingFilesToAdd.Add( - new AdminShellPackageSupplementaryFile( - new Uri(targetPath, UriKind.RelativeOrAbsolute), - sourcePath, - location: AdminShellPackageSupplementaryFile.LocationType.AddPending, - specialHandling: (embedAsThumb - ? AdminShellPackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail - : AdminShellPackageSupplementaryFile.SpecialHandlingType.None), - sourceGetBytesDel: sourceGetBytesDel, - useMimeType: useMimeType) - ); - - } - - public void DeleteSupplementaryFile(AdminShellPackageSupplementaryFile psf) - { - if (psf == null) - throw (new Exception("No supplementary file given!")); - - if (psf.Location == AdminShellPackageSupplementaryFile.LocationType.AddPending) - { - // is still pending in add list -> remove - _pendingFilesToAdd.RemoveAll((x) => { return x.Uri == psf.Uri; }); - } - - if (psf.Location == AdminShellPackageSupplementaryFile.LocationType.InPackage) - { - // add to pending delete list - _pendingFilesToDelete.Add(psf); - } - } - - public void Close() - { - _openPackage?.Close(); - _openPackage = null; - _fn = ""; - _aasEnv = null; - } - - public void Flush() - { - if (_openPackage != null) - _openPackage.Flush(); - } - - public void Dispose() - { - Close(); - } - - public string MakePackageFileAvailableAsTempFile(string packageUri, bool keepFilename = false) - { - // access - if (packageUri == null) - return null; - - // get input stream - using (var input = GetLocalStreamFromPackage(packageUri)) - { - // generate tempfile name - string tempext = System.IO.Path.GetExtension(packageUri); - string temppath = System.IO.Path.GetTempFileName().Replace(".tmp", tempext); - - // maybe modify tempfile name? - if (keepFilename) - { - var masterFn = System.IO.Path.GetFileNameWithoutExtension(packageUri); - var tmpDir = System.IO.Path.GetDirectoryName(temppath); - var tmpFnExt = System.IO.Path.GetFileName(temppath); - - temppath = System.IO.Path.Combine(tmpDir, "" + masterFn + "_" + tmpFnExt); - } - - // copy to temp file - using (var temp = System.IO.File.OpenWrite(temppath)) - { - input.CopyTo(temp); - return temppath; - } - } - } - - } -} diff --git a/src/AasxCsharpLib_bkp/AdminShellUtil.cs b/src/AasxCsharpLib_bkp/AdminShellUtil.cs deleted file mode 100644 index 66be9718e..000000000 --- a/src/AasxCsharpLib_bkp/AdminShellUtil.cs +++ /dev/null @@ -1,705 +0,0 @@ -/* -Copyright (c) 2018-2021 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using AasCore.Aas3_0_RC02; -using Extensions; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using static AasxCompatibilityModels.AdminShellV20.SubmodelElementWrapper; -using static Extensions.ExtendIDataSpecificationContent; - -namespace AdminShellNS -{ - public static class AdminShellUtil - { - - #region Various utilities - // ------------------------------------------------------------------------------------ - - public static T[] GetEnumValues() where T : Enum - => (T[])Enum.GetValues(typeof(T)); - - public static IEnumerable GetEnumValues(T[] excludes) where T : Enum - { - foreach (var v in (T[])Enum.GetValues(typeof(T))) - if (!excludes.Contains(v)) - yield return v; - } - - #endregion - - #region V3 Methods - - public static string[] GetPopularMimeTypes() - { - return - new[] { - System.Net.Mime.MediaTypeNames.Text.Plain, - System.Net.Mime.MediaTypeNames.Text.Xml, - System.Net.Mime.MediaTypeNames.Text.Html, - "application/json", - "application/rdf+xml", - System.Net.Mime.MediaTypeNames.Application.Pdf, - System.Net.Mime.MediaTypeNames.Image.Jpeg, - "image/png", - System.Net.Mime.MediaTypeNames.Image.Gif, - "application/iges", - "application/step" - }; - } - - public static IEnumerable GetAdequateEnums(AasSubmodelElements[] excludeValues = null, AasSubmodelElements[] includeValues = null) - { - if (includeValues != null) - { - foreach (var en in includeValues) - yield return en; - } - else - { - foreach (var en in (AasSubmodelElements[])Enum.GetValues(typeof(AasSubmodelElements))) - { - if (en == AasSubmodelElements.SubmodelElement) - continue; - if (excludeValues != null && excludeValues.Contains(en)) - continue; - yield return en; - } - } - } - - public static AasSubmodelElements? AasSubmodelElementsFrom() where T : ISubmodelElement - { - if (typeof(T) == typeof(Property)) - return AasSubmodelElements.Property; - if (typeof(T) == typeof(MultiLanguageProperty)) - return AasSubmodelElements.MultiLanguageProperty; - if (typeof(T) == typeof(AasCore.Aas3_0_RC02.Range)) - return AasSubmodelElements.Range; - if (typeof(T) == typeof(AasCore.Aas3_0_RC02.File)) - return AasSubmodelElements.File; - if (typeof(T) == typeof(Blob)) - return AasSubmodelElements.Blob; - if (typeof(T) == typeof(ReferenceElement)) - return AasSubmodelElements.ReferenceElement; - if (typeof(T) == typeof(RelationshipElement)) - return AasSubmodelElements.RelationshipElement; - if (typeof(T) == typeof(AnnotatedRelationshipElement)) - return AasSubmodelElements.AnnotatedRelationshipElement; - if (typeof(T) == typeof(Capability)) - return AasSubmodelElements.Capability; - if (typeof(T) == typeof(SubmodelElementCollection)) - return AasSubmodelElements.SubmodelElementCollection; - if (typeof(T) == typeof(Operation)) - return AasSubmodelElements.Operation; - if (typeof(T) == typeof(BasicEventElement)) - return AasSubmodelElements.BasicEventElement; - if (typeof(T) == typeof(Entity)) - return AasSubmodelElements.Entity; - return null; - } - - - public static ISubmodelElement CreateSubmodelElementFromEnum(AasSubmodelElements smeEnum, ISubmodelElement sourceSme = null) - { - switch(smeEnum) - { - case AasSubmodelElements.Property: - { - return new Property(DataTypeDefXsd.String).UpdateFrom(sourceSme); - } - case AasSubmodelElements.MultiLanguageProperty: - { - return new MultiLanguageProperty().UpdateFrom(sourceSme); - } - case AasSubmodelElements.Range: - { - return new AasCore.Aas3_0_RC02.Range(DataTypeDefXsd.String).UpdateFrom(sourceSme); - } - case AasSubmodelElements.File: - { - return new AasCore.Aas3_0_RC02.File("").UpdateFrom(sourceSme); - } - case AasSubmodelElements.Blob: - { - return new Blob("").UpdateFrom(sourceSme); - } - case AasSubmodelElements.ReferenceElement: - { - return new ReferenceElement().UpdateFrom(sourceSme); - } - case AasSubmodelElements.RelationshipElement: - { - return new RelationshipElement(null, null).UpdateFrom(sourceSme); - } - case AasSubmodelElements.AnnotatedRelationshipElement: - { - return new AnnotatedRelationshipElement(null, null).UpdateFrom(sourceSme); - } - case AasSubmodelElements.Capability: - { - return new Capability(); - } - case AasSubmodelElements.SubmodelElementCollection: - { - return new SubmodelElementCollection().UpdateFrom(sourceSme); - } - case AasSubmodelElements.SubmodelElementList: - { - return new SubmodelElementList(AasSubmodelElements.SubmodelElement).UpdateFrom(sourceSme); - } - case AasSubmodelElements.Operation: - { - return new Operation().UpdateFrom(sourceSme); - } - case AasSubmodelElements.BasicEventElement: - { - return new BasicEventElement(null, Direction.Input, StateOfEvent.Off); - } - case AasSubmodelElements.Entity: - { - return new Entity(EntityType.SelfManagedEntity); - } - default: - { - return null; - } - } - } - - #endregion - public static string EvalToNonNullString(string fmt, object o, string elseString = "") - { - if (o == null) - return elseString; - return string.Format(fmt, o); - } - - public static string EvalToNonEmptyString(string fmt, string o, string elseString = "") - { - if (o == null || o == "") - return elseString; - return string.Format(fmt, o); - } - - /// - /// If len of exceeds then - /// string is shortened and returned with an ellipsis(…) at the end. - /// - /// Shortened string - public static string ShortenWithEllipses(string str, int maxLen) - { - if (str == null) - return null; - if (maxLen >= 0 && str.Length > maxLen) - str = str.Substring(0, maxLen) + "\u2026"; - return str; - } - - /// - /// Returns a string without newlines and shortened (with ellipsis) - /// to a certain length - /// - /// Single-line, shortened string - public static string ToSingleLineShortened(string str, int maxLen, string textNewLine = " ") - { - str = str.ReplaceLineEndings(textNewLine); - return ShortenWithEllipses(str, maxLen); - } - - /// Creates a filter-friendly name from the source. - /// - /// Assert.AreEqual("", AdminShellUtil.FilterFriendlyName("")); - /// Assert.AreEqual("someName", AdminShellUtil.FilterFriendlyName("someName")); - /// Assert.AreEqual("some__name", AdminShellUtil.FilterFriendlyName("some!;name")); - /// - public static string FilterFriendlyName(string src) - { - if (src == null) - return null; - return Regex.Replace(src, @"[^a-zA-Z0-9\-_]", "_"); - } - - /// - /// Assert.IsFalse(AdminShellUtil.HasWhitespace("")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace(" ")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace("aa bb")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace(" aabb")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace("aabb ")); - /// Assert.IsFalse(AdminShellUtil.HasWhitespace("aabb")); - /// - public static bool HasWhitespace(string src) - { - if (src == null) - throw new ArgumentNullException(nameof(src)); - foreach (var s in src) - if (char.IsWhiteSpace(s)) - return true; - return false; - } - - /// Assert.IsTrue(AdminShellUtil.ComplyIdShort("")); - public static bool ComplyIdShort(string src) - { - if (src == null) - throw new ArgumentNullException(nameof(src)); - var res = true; - foreach (var s in src) - if (!Char.IsLetterOrDigit(s) && s != '_') - res = false; - if (src.Length > 0 && !Char.IsLetter(src[0])) - res = false; - return res; - } - - public static string ByteSizeHumanReadable(long len) - { - // see: https://stackoverflow.com/questions/281640/ - // how-do-i-get-a-human-readable-file-size-in-bytes-abbreviation-using-net - string[] sizes = { "B", "KB", "MB", "GB", "TB" }; - int order = 0; - while (len >= 1024 && order < sizes.Length - 1) - { - order++; - len = len / 1024; - } - // Adjust the format string to your preferences. For example "{0:0.#}{1}" would - // show a single decimal place, and no space. - string res = String.Format("{0:0.##} {1}", len, sizes[order]); - return res; - } - - public static string ExtractPascalCasingLetters(string src) - { - // access - src = src?.Trim(); - if (src == null || src.Length < 1) - return null; - - // walk through - var res = ""; - var arm = true; - foreach (var c in src) - { - // take? - if (arm && Char.IsUpper(c)) - res += c; - // state for next iteration - arm = !Char.IsUpper(c); - } - - // result - return res; - } - - public static int CountHeadingSpaces(string line) - { - if (line == null) - return 0; - int j; - for (j = 0; j < line.Length; j++) - if (!Char.IsWhiteSpace(line[j])) - break; - return j; - } - - /// - /// Used to re-reformat a C# here string, which is multiline string introduced by @" ... "; - /// - public static string[] CleanHereStringToArray(string here) - { - if (here == null) - return null; - - // convert all weird breaks to pure new lines - here = here.Replace("\r\n", "\n"); - here = here.Replace("\n\r", "\n"); - - // convert all tabs to spaces - here = here.Replace("\t", " "); - - // split these - var lines = new List(here.Split('\n')); - if (lines.Count < 1) - return lines.ToArray(); - - // the first line could be special - string firstLine = null; - if (lines[0].Trim() != "") - { - firstLine = lines[0].Trim(); - lines.RemoveAt(0); - } - - // detect an constant amount of heading spaces - var headSpaces = int.MaxValue; - foreach (var line in lines) - if (line.Trim() != "") - headSpaces = Math.Min(headSpaces, CountHeadingSpaces(line)); - - // multi line trim possible? - if (headSpaces != int.MaxValue && headSpaces > 0) - for (int i = 0; i < lines.Count; i++) - if (lines[i].Length > headSpaces) - lines[i] = lines[i].Substring(headSpaces); - - // re-compose again - if (firstLine != null) - lines.Insert(0, firstLine); - - // return - return lines.ToArray(); - } - - /// - /// Used to re-reformat a C# here string, which is multiline string introduced by @" ... "; - /// - public static string CleanHereStringWithNewlines(string here, string nl = null) - { - if (nl == null) - nl = System.Environment.NewLine; - var lines = CleanHereStringToArray(here); - if (lines == null) - return null; - return String.Join(nl, lines); - } - - public static string ShortLocation(Exception ex) - { - if (ex == null || ex.StackTrace == null) - return ""; - string[] lines = ex.StackTrace.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None); - if (lines.Length < 1) - return ""; - // search for " in " - // as the most actual stacktrace might be a built-in function, this might not work and therefore - // go down in the stack - int currLine = 0; - while (true) - { - // nothing found at all - if (currLine >= lines.Length) - return ""; - // access current line - /* TODO (MIHO, 2020-11-12): replace with Regex for multi language. Ideally have Exception messages - always as English. */ - var p = lines[currLine].IndexOf(" in ", StringComparison.Ordinal); - if (p < 0) - p = lines[currLine].IndexOf(" bei ", StringComparison.Ordinal); - if (p < 0) - { - // advance to next oldest line - currLine++; - continue; - } - // search last "\" or "/", to get only filename portion and position - p = lines[currLine].LastIndexOfAny(new[] { '\\', '/' }); - if (p < 0) - { - // advance to next oldest line - currLine++; - continue; - } - // return this - return lines[currLine].Substring(p); - } - } - - public enum ConstantFoundEnum { No, AnyCase, ExactCase } - - public static ConstantFoundEnum CheckIfInConstantStringArray(string[] arr, string str) - { - if (arr == null || str == null) - return ConstantFoundEnum.No; - - bool anyCaseFound = false; - bool exactCaseFound = false; - foreach (var a in arr) - { - anyCaseFound = anyCaseFound || str.ToLower() == a.ToLower(); - exactCaseFound = exactCaseFound || str == a; - } - if (exactCaseFound) - return ConstantFoundEnum.ExactCase; - if (anyCaseFound) - return ConstantFoundEnum.AnyCase; - return ConstantFoundEnum.No; - } - - public static string CorrectCasingForConstantStringArray(string[] arr, string str) - { - if (arr == null || str == null) - return str; - - foreach (var a in arr) - if (str.ToLower() == a.ToLower()) - return a; - - return str; - } - - // - // String manipulations - // - - public static string ReplacePercentPlaceholder( - string input, - string searchFor, - Func substLamda, - StringComparison comparisonType = StringComparison.InvariantCulture) - { - // access - if (input == null || searchFor == null || searchFor == "") - return input; - - // find - while (true) - { - // any occurence - var p = input.IndexOf(searchFor, comparisonType); - if (p < 0) - break; - - // split - var left = input.Substring(0, p); - var right = ""; - var rp = p + searchFor.Length; - if (rp < input.Length) - right = input.Substring(rp); - - // lambda - var repl = "" + substLamda?.Invoke(); - - // build new - input = left + repl + right; - } - - // ok - return input; - } - - // - // Reflection - // - - public static void SetFieldLazyValue(FieldInfo f, object obj, object value) - { - // access - if (f == null || obj == null) - return; - - switch (Type.GetTypeCode(f.FieldType)) - { - case TypeCode.String: - f.SetValue(obj, "" + value); - break; - - case TypeCode.Byte: - if (Byte.TryParse("" + value, out var ui8)) - f.SetValue(obj, ui8); - break; - - case TypeCode.SByte: - if (SByte.TryParse("" + value, out var i8)) - f.SetValue(obj, i8); - break; - - case TypeCode.Int16: - if (Int16.TryParse("" + value, out var i16)) - f.SetValue(obj, i16); - break; - - case TypeCode.Int32: - if (Int32.TryParse("" + value, out var i32)) - f.SetValue(obj, i32); - break; - - case TypeCode.Int64: - if (Int64.TryParse("" + value, out var i64)) - f.SetValue(obj, i64); - break; - - case TypeCode.UInt16: - if (UInt16.TryParse("" + value, out var ui16)) - f.SetValue(obj, ui16); - break; - - case TypeCode.UInt32: - if (UInt32.TryParse("" + value, out var ui32)) - f.SetValue(obj, ui32); - break; - - case TypeCode.UInt64: - if (UInt64.TryParse("" + value, out var ui64)) - f.SetValue(obj, ui64); - break; - - case TypeCode.Single: - if (Single.TryParse("" + value, NumberStyles.Float, - CultureInfo.InvariantCulture, out var sgl)) - f.SetValue(obj, sgl); - break; - - case TypeCode.Double: - if (Double.TryParse("" + value, NumberStyles.Float, - CultureInfo.InvariantCulture, out var dbl)) - f.SetValue(obj, dbl); - break; - - case TypeCode.Boolean: - var isFalse = value == null - || (value is int vi && vi == 0) - || (value is string vs && vs == "") - || (value is bool vb && !vb); - f.SetValue(obj, isFalse); - break; - } - } - - // - // some URL enabled path handling - // - - /// - /// Uses System.IO.Path.GetExtension() to determine the extension part - /// of a path. If a URL based query is added to the extension, remove this. - /// - public static string GetExtensionWoQuery(string fn) - { - // access - if (fn == null) - return null; - - // use system function - var ext = System.IO.Path.GetExtension(fn).ToLower().Trim(); - - // as URLs *might* have an extension, but a loto f query string afterwards, - // lets try to cut of it - var extMatch = Regex.Match(ext, @"([._A-Za-z0-9]+)"); - if (extMatch.Success) - ext = extMatch.Groups[1].ToString(); - - // ok - return ext; - } - - // - // Base 64 - // - - public static string Base64Encode(string plainText) - { - var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); - return System.Convert.ToBase64String(plainTextBytes); - } - - public static string Base64Decode(string base64EncodedData) - { - var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData); - return System.Text.Encoding.UTF8.GetString(base64EncodedBytes); - } - - // - // Generation of Ids - // - - private static Random MyRnd = new Random(); - - public static string GenerateIdAccordingTemplate(string tpl) - { - // generate a deterministic decimal digit string - var decimals = String.Format("{0:ffffyyMMddHHmmss}", DateTime.UtcNow); - decimals = new string(decimals.Reverse().ToArray()); - // convert this to an int - if (!Int64.TryParse(decimals, out Int64 decii)) - decii = MyRnd.Next(Int32.MaxValue); - // make an hex out of this - string hexamals = decii.ToString("X"); - // make an alphanumeric string out of this - string alphamals = ""; - var dii = decii; - while (dii >= 1) - { - var m = dii % 26; - alphamals += Convert.ToChar(65 + m); - dii = dii / 26; - } - - // now, "salt" the strings - for (int i = 0; i < 32; i++) - { - var c = Convert.ToChar(48 + MyRnd.Next(10)); - decimals += c; - hexamals += c; - alphamals += c; - } - - // now, can just use the template - var id = ""; - foreach (var tpli in tpl) - { - if (tpli == 'D' && decimals.Length > 0) - { - id += decimals[0]; - decimals = decimals.Remove(0, 1); - } - else - if (tpli == 'X' && hexamals.Length > 0) - { - id += hexamals[0]; - hexamals = hexamals.Remove(0, 1); - } - else - if (tpli == 'A' && alphamals.Length > 0) - { - id += alphamals[0]; - alphamals = alphamals.Remove(0, 1); - } - else - id += tpli; - } - - // ok - return id; - } - - public static string RemoveNewLinesAndLimit(string input, int maxLength = -1, string ellipsis = "..") - { - // access - if (input == null) - return null; - - // maybe do a generouse limit first - if (maxLength >= 1 && input.Length > 2 * maxLength) - input = input.Substring(0, 2 * maxLength); - - // now do expensive operations - input = input.Replace('\r', ' '); - input = input.Replace('\n', ' '); - input = Regex.Replace(input, @"\s+", " ", RegexOptions.Compiled); - - // now apply exact limit - if (maxLength >= 1 && input.Length > maxLength) - input = input.Substring(0, maxLength) + ellipsis; - - // ok - return input; - } - - - } -} diff --git a/src/AasxCsharpLib_bkp/AdminShellValidate.cs b/src/AasxCsharpLib_bkp/AdminShellValidate.cs deleted file mode 100644 index 938c91c57..000000000 --- a/src/AasxCsharpLib_bkp/AdminShellValidate.cs +++ /dev/null @@ -1,327 +0,0 @@ -/* -Copyright (c) 2018-2021 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.ComponentModel.Design; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using System.Xml; -using System.Xml.Schema; -using JetBrains.Annotations; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Newtonsoft.Json.Schema; -using AasCore.Aas3_0_RC02; -using Environment = System.Environment; - -namespace AdminShellNS -{ - /// - /// validates the XML content against the AASX XML schema. - /// - /// Please produce instances with . - /// - public class XmlValidator - { - private System.Xml.Schema.XmlSchemaSet xmlSchemaSet; - - internal XmlValidator(XmlSchemaSet xmlSchemaSet) - { - this.xmlSchemaSet = xmlSchemaSet; - } - - /// - /// validates the given XML content and stores the results in the . - /// - /// Validation records - /// Content to be validated - public void Validate(AasValidationRecordList recs, Stream xmlContent) - { - if (recs == null) - throw new ArgumentException($"Unexpected null {nameof(recs)}"); - - if (xmlContent == null) - throw new ArgumentException($"Unexpected null {nameof(xmlContent)}"); - - // load/ validate on same records - var settings = new System.Xml.XmlReaderSettings(); - settings.ValidationType = System.Xml.ValidationType.Schema; - settings.Schemas = xmlSchemaSet; - - settings.ValidationEventHandler += - (object sender, System.Xml.Schema.ValidationEventArgs e) => - { - recs.Add( - new AasValidationRecord( - AasValidationSeverity.Serialization, null, - $"XML: {e?.Exception?.LineNumber}, {e?.Exception?.LinePosition}: {e?.Message}")); - }; - - // use the xml stream - using (var reader = System.Xml.XmlReader.Create(xmlContent, settings)) - { - while (reader.Read()) - { - // Invoke callbacks - }; - } - } - } - - public enum AasValidationSeverity - { - Hint, Warning, SpecViolation, SchemaViolation, Serialization - } - - [UsedImplicitlyAttribute] // for eventual use - public enum AasValidationAction - { - No, ToBeDeleted - } - - public class AasValidationRecord - { - public AasValidationSeverity Severity = AasValidationSeverity.Hint; - public IReferable Source = null; - public string Message = ""; - - public Action Fix = null; - - public AasValidationRecord(AasValidationSeverity Severity, IReferable Source, - string Message, Action Fix = null) - { - this.Severity = Severity; - this.Source = Source; - this.Message = Message; - this.Fix = Fix; - } - - public override string ToString() - { - return $"[{Severity.ToString()}] in {"" + Source?.ToString()}: {"" + Message}"; - } - - public string DisplaySeverity { get { return "" + Severity.ToString(); } } - public string DisplaySource - { - get - { - return "" + ((Source != null) ? Source.ToString() : "(whole content)"); - } - } - public string DisplayMessage { get { return "" + Message?.ToString(); } } - } - - public class AasValidationRecordList : List - { - } - - public static class AasSchemaValidation - { - public enum SerializationFormat { XML, JSON } - - public static string[] GetSchemaResources(SerializationFormat fmt) - { - if (fmt == SerializationFormat.XML) - { - return new[] - { - "AdminShellNS.Resources.schemaV201.AAS.xsd", - "AdminShellNS.Resources.schemaV201.AAS_ABAC.xsd", - "AdminShellNS.Resources.schemaV201.IEC61360.xsd" - }; - } - if (fmt == SerializationFormat.JSON) - { - return new[] - { - "AdminShellNS.Resources.schemaV201.aas.json" - }; - } - return null; - } - - /// - /// produces a validator which validates XML AASX files. - /// - /// initialized validator - public static XmlValidator NewXmlValidator() - { - // Load the schema files - var files = GetSchemaResources(SerializationFormat.XML); - if (files == null) - throw new InvalidOperationException("No XML schema files could be found in the resources."); - - var xmlSchemaSet = new System.Xml.Schema.XmlSchemaSet(); - xmlSchemaSet.XmlResolver = new System.Xml.XmlUrlResolver(); - - try - { - Assembly myAssembly = Assembly.GetExecutingAssembly(); - foreach (var schemaFn in files) - { - using (Stream schemaStream = myAssembly.GetManifestResourceStream(schemaFn)) - { - using (XmlReader schemaReader = XmlReader.Create(schemaStream)) - { - xmlSchemaSet.Add(null, schemaReader); - } - } - } - } - catch (Exception ex) - { - throw new FileNotFoundException( - $"Error accessing embedded resource schema files: {ex.Message}"); - } - - var newRecs = new AasValidationRecordList(); - - // set up messages - xmlSchemaSet.ValidationEventHandler += (object sender, System.Xml.Schema.ValidationEventArgs e) => - { - newRecs.Add( - new AasValidationRecord( - AasValidationSeverity.Serialization, null, - $"{e?.Exception?.LineNumber}, {e?.Exception?.LinePosition}: {e?.Message}")); - }; - - // compile - try - { - xmlSchemaSet.Compile(); - } - catch (Exception ex) - { - throw new InvalidOperationException( - $"Error compiling schema files: {ex.Message}"); - } - - if (newRecs.Count > 0) - { - var parts = new List { $"Failed to compile the schema files:" }; - parts.AddRange(newRecs.Select((r) => r.Message)); - throw new InvalidOperationException(string.Join(Environment.NewLine, parts)); - } - - return new XmlValidator(xmlSchemaSet); - } - - /// - /// creates an XML validator and applies it on the given content. - /// - /// If you repeatedly need to validate XML against a schema, re-use an instance of - /// produced with . - /// - /// Validation records - /// Content to be validated - public static void ValidateXML(AasValidationRecordList recs, Stream xmlContent) - { - var validator = NewXmlValidator(); - validator.Validate(recs, xmlContent); - } - - public static int ValidateJSONAlternative(AasValidationRecordList recs, Stream jsonContent) - { - // see: https://github.com/RicoSuter/NJsonSchema/wiki/JsonSchemaValidator - var newRecs = new AasValidationRecordList(); - - // access - if (recs == null || jsonContent == null) - return -1; - - // Load the schema files - // right now: exactly ONE schema file - var files = GetSchemaResources(SerializationFormat.JSON); - if (files == null || files.Length != 1) - return -1; - - NJsonSchema.JsonSchema schema = null; - - try - { - Assembly myAssembly = Assembly.GetExecutingAssembly(); - foreach (var schemaFn in files) - { - using (Stream schemaStream = myAssembly.GetManifestResourceStream(schemaFn)) - { - using (var streamReader = new StreamReader(schemaStream)) - { - var allTxt = streamReader.ReadToEnd(); - schema = NJsonSchema.JsonSchema.FromJsonAsync(allTxt).GetAwaiter().GetResult(); - break; - } - } - } - } - catch (Exception ex) - { - throw new FileNotFoundException("ValidateJSON: Error loading schema: " + - ex.Message); - } - - if (schema == null) - { - throw new FileNotFoundException("ValidateJSON: Schema not found properly."); - } - - // create validator - var validator = new NJsonSchema.Validation.JsonSchemaValidator(); - - // load the JSON content - string jsonTxt = null; - try - { - using (var streamReader = new StreamReader(jsonContent)) - { - jsonTxt = streamReader.ReadToEnd(); - } - } - catch (Exception ex) - { - throw new InvalidOperationException("ValidateJSON: Error loading JSON content: " + - ex.Message); - } - - if (jsonTxt == null || jsonTxt == "") - throw new InvalidOperationException("ValidateJSON: Error loading JSON content gave null."); - - // validate - ICollection errors; - try - { - errors = validator.Validate(jsonTxt, schema); - } - catch (Exception ex) - { - throw new InvalidOperationException("ValidateJSON: Error when validating: " + - ex.Message); - } - - // re-format messages - if (errors != null) - foreach (var ve in errors) - { - var msg = ("" + ve.ToString()); - msg = Regex.Replace(msg, @"\s+", " "); - newRecs.Add(new AasValidationRecord(AasValidationSeverity.Serialization, null, - $"JSON: {ve.LineNumber,5},{ve.LinePosition:3}: {msg}")); - } - - // result - recs.AddRange(newRecs); - return newRecs.Count; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Display/EnumerationPlacmentBase.cs b/src/AasxCsharpLib_bkp/Display/EnumerationPlacmentBase.cs deleted file mode 100644 index 5920e6f6d..000000000 --- a/src/AasxCsharpLib_bkp/Display/EnumerationPlacmentBase.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AdminShellNS.Display -{ - public class EnumerationPlacmentBase - { - - } -} diff --git a/src/AasxCsharpLib_bkp/Display/EnumerationPlacmentOperationVariable.cs b/src/AasxCsharpLib_bkp/Display/EnumerationPlacmentOperationVariable.cs deleted file mode 100644 index b6d0e3a0a..000000000 --- a/src/AasxCsharpLib_bkp/Display/EnumerationPlacmentOperationVariable.cs +++ /dev/null @@ -1,15 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AdminShellNS.Display -{ - public class EnumerationPlacmentOperationVariable : EnumerationPlacmentBase - { - public OperationVariableDirection Direction; - public OperationVariable OperationVariable; - } -} diff --git a/src/AasxCsharpLib_bkp/Display/OperationVariableDirection.cs b/src/AasxCsharpLib_bkp/Display/OperationVariableDirection.cs deleted file mode 100644 index d64f9c794..000000000 --- a/src/AasxCsharpLib_bkp/Display/OperationVariableDirection.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AdminShellNS.Display -{ - public enum OperationVariableDirection - { - In, - Out, - InOut - } -} diff --git a/src/AasxCsharpLib_bkp/Exceptions/NullValueException.cs b/src/AasxCsharpLib_bkp/Exceptions/NullValueException.cs deleted file mode 100644 index 7d44af167..000000000 --- a/src/AasxCsharpLib_bkp/Exceptions/NullValueException.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AdminShellNS.Exceptions -{ - public class NullValueException: Exception - { - public NullValueException(string field) : base($"The field {field} is null!!") - { - - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/AasElementSelfDescription.cs b/src/AasxCsharpLib_bkp/Extensions/AasElementSelfDescription.cs deleted file mode 100644 index 8ac8f2ed2..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/AasElementSelfDescription.cs +++ /dev/null @@ -1,29 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public class AasElementSelfDescription - { - public string AasElementName { get; set; } - - public string ElementAbbreviation { get; set; } - - public KeyTypes? KeyType { get; set; } - - public AasSubmodelElements? SmeType { get; set; } - - public AasElementSelfDescription(string aasElementName, string elementAbbreviation, - KeyTypes? keyType, AasSubmodelElements? smeType) - { - AasElementName = aasElementName; - ElementAbbreviation = elementAbbreviation; - KeyType = keyType; - SmeType = smeType; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ComparerUtils.cs b/src/AasxCsharpLib_bkp/Extensions/ComparerUtils.cs deleted file mode 100644 index 7becf56cb..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ComparerUtils.cs +++ /dev/null @@ -1,57 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public class ComparerIdShort : IComparer - { - public int Compare(IReferable a, IReferable b) - { - return string.Compare(a?.IdShort, b?.IdShort, - CultureInfo.InvariantCulture, CompareOptions.IgnoreCase); - } - } - - public class ComparerIdentification : IComparer - { - public int Compare(IIdentifiable a, IIdentifiable b) - { - return string.Compare(a.Id, b.Id, - CultureInfo.InvariantCulture, CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace); - } - } - - public class ComparerIndexed : IComparer - { - public int NullIndex = int.MaxValue; - public Dictionary Index = new(); - - public int Compare(IReferable a, IReferable b) - { - var ca = Index.ContainsKey(a); - var cb = Index.ContainsKey(b); - - if (!ca && !cb) - return 0; - // make CDs without usage to appear at end of list - if (!ca) - return +1; - if (!cb) - return -1; - - var ia = Index[a]; - var ib = Index[b]; - - if (ia == ib) - return 0; - if (ia < ib) - return -1; - return +1; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendAnnotatedRelationshipElement.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendAnnotatedRelationshipElement.cs deleted file mode 100644 index 0a9c9f212..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendAnnotatedRelationshipElement.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasCore.Aas3_0_RC02; -using Extensions; -using AdminShellNS.Display; - -namespace Extensions -{ - public static class ExtendAnnotatedRelationshipElement - { - #region AasxPackageExplorer - - public static void Add(this AnnotatedRelationshipElement annotatedRelationshipElement, ISubmodelElement submodelElement) - { - if (annotatedRelationshipElement != null) - { - annotatedRelationshipElement.Annotations ??= new(); - - submodelElement.Parent = annotatedRelationshipElement; - - annotatedRelationshipElement.Annotations.Add((IDataElement)submodelElement); - } - } - - public static void Remove(this AnnotatedRelationshipElement annotatedRelationshipElement, ISubmodelElement submodelElement) - { - if(annotatedRelationshipElement != null) - { - if(annotatedRelationshipElement.Annotations != null) - { - annotatedRelationshipElement.Annotations.Remove((IDataElement)submodelElement); - } - } - } - - public static object AddChild(this AnnotatedRelationshipElement annotatedRelationshipElement, ISubmodelElement childSubmodelElement, EnumerationPlacmentBase placement = null) - { - if (childSubmodelElement == null || childSubmodelElement is not IDataElement) - return null; - - annotatedRelationshipElement.Annotations ??= new (); - - if (childSubmodelElement != null) - childSubmodelElement.Parent = annotatedRelationshipElement; - - annotatedRelationshipElement.Annotations.Add((IDataElement)childSubmodelElement); - return childSubmodelElement; - } - - #endregion - public static AnnotatedRelationshipElement ConvertAnnotationsFromV20(this AnnotatedRelationshipElement annotatedRelationshipElement, AasxCompatibilityModels.AdminShellV20.AnnotatedRelationshipElement sourceAnnotedRelElement) - { - if (sourceAnnotedRelElement == null) - { - return null; - } - - if (sourceAnnotedRelElement.annotations != null) - { - annotatedRelationshipElement.Annotations ??= new List(); - foreach (var submodelElementWrapper in sourceAnnotedRelElement.annotations) - { - var sourceSubmodelElement = submodelElementWrapper.submodelElement; - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelElement != null) - { - outputSubmodelElement = outputSubmodelElement.ConvertFromV20(sourceSubmodelElement); - } - annotatedRelationshipElement.Annotations.Add((IDataElement)outputSubmodelElement); - } - } - - return annotatedRelationshipElement; - } - - public static T FindFirstIdShortAs(this AnnotatedRelationshipElement annotedRelationshipElement, string idShort) where T : ISubmodelElement - { - - var submodelElements = annotedRelationshipElement.Annotations.Where(sme => sme != null && sme is T && sme.IdShort.Equals(idShort, StringComparison.OrdinalIgnoreCase)); - - if (submodelElements.Any()) - { - return (T)submodelElements.First(); - } - - return default; - } - - public static AnnotatedRelationshipElement Set(this AnnotatedRelationshipElement elem, - Reference first, Reference second) - { - elem.First = first; - elem.Second = second; - return elem; - } - - public static AnnotatedRelationshipElement UpdateFrom( - this AnnotatedRelationshipElement elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is ReferenceElement srcRef) - { - if (srcRef.Value != null) - elem.First = srcRef.Value.Copy(); - } - - if (source is RelationshipElement srcRel) - { - if (srcRel.First != null) - elem.First = srcRel.First.Copy(); - } - - return elem; - } - - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendAssetAdministrationShell.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendAssetAdministrationShell.cs deleted file mode 100644 index be4051ee3..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendAssetAdministrationShell.cs +++ /dev/null @@ -1,242 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AdminShellNS; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendAssetAdministrationShell - { - #region AasxPackageExplorer - - public static Tuple ToCaptionInfo(this AssetAdministrationShell assetAdministrationShell) - { - var caption = AdminShellUtil.EvalToNonNullString("\"{0}\" ", assetAdministrationShell.IdShort, "\"AAS\""); - if (assetAdministrationShell.Administration != null) - caption += "V" + assetAdministrationShell.Administration.Version + "." + assetAdministrationShell.Administration.Revision; - - var info = ""; - if (assetAdministrationShell.Id != null) - info = $"[{assetAdministrationShell.Id}]"; - return Tuple.Create(caption, info); - } - - public static IEnumerable FindAllReferences(this AssetAdministrationShell assetAdministrationShell) - { - // Asset - //TODO:jtikekar support asset - //if (assetAdministrationShell.AssetInformation != null) - // yield return new LocatedReference(assetAdministrationShell, assetAdministrationShell.AssetInformation); - - // Submodel references - if (assetAdministrationShell.Submodels != null) - foreach (var r in assetAdministrationShell.Submodels) - yield return new LocatedReference(assetAdministrationShell, r); - - } - - #endregion - - public static bool HasSubmodelReference(this AssetAdministrationShell assetAdministrationShell, Reference submodelReference) - { - if (submodelReference == null) - { - return false; - } - - foreach (var aasSubmodelReference in assetAdministrationShell.Submodels) - { - if (aasSubmodelReference.Matches(submodelReference)) - { - return true; - } - } - - return false; - } - - public static void AddSubmodelReference(this AssetAdministrationShell assetAdministrationShell, Reference newSubmodelReference) - { - if (assetAdministrationShell.Submodels == null) - { - assetAdministrationShell.Submodels = new List(); - } - - assetAdministrationShell.Submodels.Add(newSubmodelReference); - } - - //TODO:jtikekar: Change the name, currently based on older implementation - public static string GetFriendlyName(this AssetAdministrationShell assetAdministrationShell) - { - if (string.IsNullOrEmpty(assetAdministrationShell.IdShort)) - { - return null; - } - - return Regex.Replace(assetAdministrationShell.IdShort, @"[^a-zA-Z0-9\-_]", "_"); - } - - public static AssetAdministrationShell ConvertFromV10(this AssetAdministrationShell assetAdministrationShell, AasxCompatibilityModels.AdminShellV10.AdministrationShell sourceAas) - { - if (sourceAas == null) - { - return null; - } - - if (string.IsNullOrEmpty(sourceAas.idShort)) - { - assetAdministrationShell.IdShort = ""; - } - else - { - assetAdministrationShell.IdShort = sourceAas.idShort; - } - - if (sourceAas.description != null) - { - assetAdministrationShell.Description = ExtensionsUtil.ConvertDescriptionFromV10(sourceAas.description); - } - - if (sourceAas.administration != null) - { - assetAdministrationShell.Administration = new AdministrativeInformation(version: sourceAas.administration.version, revision: sourceAas.administration.revision); - } - - if (sourceAas.derivedFrom != null) - { - var key = new Key(KeyTypes.AssetAdministrationShell, sourceAas.identification.id); - assetAdministrationShell.DerivedFrom = new Reference(ReferenceTypes.ModelReference, new List() { key }); - } - - if (sourceAas.submodelRefs != null || sourceAas.submodelRefs.Count != 0) - { - foreach (var submodelRef in sourceAas.submodelRefs) - { - var keyList = new List(); - foreach (var refKey in submodelRef.Keys) - { - //keyList.Add(new Key(ExtensionsUtil.GetKeyTypeFromString(refKey.type), refKey.value)); - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - if (assetAdministrationShell.Submodels == null) - { - assetAdministrationShell.Submodels = new List(); - } - assetAdministrationShell.Submodels.Add(new Reference(ReferenceTypes.ModelReference, keyList)); - } - } - - if (sourceAas.hasDataSpecification != null) - { - //TODO: jtikekar : EmbeddedDataSpecification?? (as per old implementation) - if (assetAdministrationShell.EmbeddedDataSpecifications == null) - { - assetAdministrationShell.EmbeddedDataSpecifications = new List(); - } - foreach (var dataSpecification in sourceAas.hasDataSpecification.reference) - { - assetAdministrationShell.EmbeddedDataSpecifications.Add(new EmbeddedDataSpecification( - ExtensionsUtil.ConvertReferenceFromV10(dataSpecification, ReferenceTypes.GlobalReference), - null)); - } - } - - return assetAdministrationShell; - } - - public static AssetAdministrationShell ConvertFromV20(this AssetAdministrationShell assetAdministrationShell, AasxCompatibilityModels.AdminShellV20.AdministrationShell sourceAas) - { - if (sourceAas == null) - { - return null; - } - - if (string.IsNullOrEmpty(sourceAas.idShort)) - { - assetAdministrationShell.IdShort = ""; - } - else - { - assetAdministrationShell.IdShort = sourceAas.idShort; - } - - if (sourceAas.description != null) - { - assetAdministrationShell.Description = ExtensionsUtil.ConvertDescriptionFromV20(sourceAas.description); - } - - if (sourceAas.administration != null) - { - assetAdministrationShell.Administration = new AdministrativeInformation(version: sourceAas.administration.version, revision: sourceAas.administration.revision); - } - - if (sourceAas.derivedFrom != null) - { - var key = new Key(KeyTypes.AssetAdministrationShell, sourceAas.identification.id); - assetAdministrationShell.DerivedFrom = new Reference(ReferenceTypes.ModelReference, new List() { key }); - } - - if (sourceAas.submodelRefs != null || sourceAas.submodelRefs.Count != 0) - { - foreach (var submodelRef in sourceAas.submodelRefs) - { - var keyList = new List(); - foreach (var refKey in submodelRef.Keys) - { - //keyList.Add(new Key(ExtensionsUtil.GetKeyTypeFromString(refKey.type), refKey.value)); - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - if (assetAdministrationShell.Submodels == null) - { - assetAdministrationShell.Submodels = new List(); - } - assetAdministrationShell.Submodels.Add(new Reference(ReferenceTypes.ModelReference, keyList)); - } - } - - if (sourceAas.hasDataSpecification != null) - { - //TODO: jtikekar : EmbeddedDataSpecification?? (as per old implementation) - if (assetAdministrationShell.EmbeddedDataSpecifications == null) - { - assetAdministrationShell.EmbeddedDataSpecifications = new List(); - } - - //TODO: jtikekar: DataSpecificationContent?? (as per old implementation) - foreach (var sourceDataSpec in sourceAas.hasDataSpecification) - { - if (sourceDataSpec.dataSpecification != null) - { - assetAdministrationShell.EmbeddedDataSpecifications.Add( - new EmbeddedDataSpecification( - ExtensionsUtil.ConvertReferenceFromV20(sourceDataSpec.dataSpecification, ReferenceTypes.GlobalReference), - null)); - } - } - } - - return assetAdministrationShell; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendAssetInformation.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendAssetInformation.cs deleted file mode 100644 index 41fb5b0c4..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendAssetInformation.cs +++ /dev/null @@ -1,62 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendAssetInformation - { - #region AasxPackageExplorer - - public static Tuple ToCaptionInfo(this AssetInformation assetInformation) - { - //TODO:jtikekar support KeyType.AssetInformation - //var caption = Key.AssetInformation; - var caption = "AssetInformation"; - var info = "" + assetInformation.GlobalAssetId?.ToStringExtended(); - return Tuple.Create(caption, info); - } - - #endregion - public static AssetInformation ConvertFromV10(this AssetInformation assetInformation, AasxCompatibilityModels.AdminShellV10.Asset sourceAsset) - { - //Determine AssetKind - var assetKind = AssetKind.Instance; - if (sourceAsset.kind.IsType) - { - assetKind = AssetKind.Type; - } - - assetInformation.AssetKind = assetKind; - - - //Assign GlobalAssetId - var key = new Key(KeyTypes.GlobalReference, sourceAsset.identification.id); - assetInformation.GlobalAssetId = new Reference(ReferenceTypes.GlobalReference, new List { key }); - - return assetInformation; - } - - public static AssetInformation ConvertFromV20(this AssetInformation assetInformation, AasxCompatibilityModels.AdminShellV20.Asset sourceAsset) - { - //Determine AssetKind - var assetKind = AssetKind.Instance; - if (sourceAsset.kind.IsType) - { - assetKind = AssetKind.Type; - } - - assetInformation.AssetKind = assetKind; - - - //Assign GlobalAssetId - var key = new Key(KeyTypes.GlobalReference, sourceAsset.identification.id); - assetInformation.GlobalAssetId = new Reference(ReferenceTypes.GlobalReference, new List { key }); - - return assetInformation; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendBlob.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendBlob.cs deleted file mode 100644 index b49adce56..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendBlob.cs +++ /dev/null @@ -1,69 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendBlob - { - public static void Set(this Blob blob, - string contentType = "", byte[]? value = null) - { - blob.ContentType = contentType; - blob.Value = value; - } - - public static Blob ConvertFromV10(this Blob blob, AasxCompatibilityModels.AdminShellV10.Blob sourceBlob) - { - blob.ContentType = sourceBlob.mimeType; - blob.Value = Encoding.ASCII.GetBytes(sourceBlob.value); - return blob; - } - - public static Blob ConvertFromV20(this Blob blob, AasxCompatibilityModels.AdminShellV20.Blob sourceBlob) - { - blob.ContentType = sourceBlob.mimeType; - blob.Value = Encoding.ASCII.GetBytes(sourceBlob.value); - return blob; - } - - public static Blob UpdateFrom(this Blob elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is Property srcProp) - { - if (srcProp.Value != null) - elem.Value = Encoding.Default.GetBytes(srcProp.Value); - } - - if (source is AasCore.Aas3_0_RC02.Range srcRng) - { - if (srcRng.Min != null) - elem.Value = Encoding.Default.GetBytes(srcRng.Min); - } - - if (source is MultiLanguageProperty srcMlp) - { - var s = srcMlp.Value?.GetDefaultString(); - if (s != null) - elem.Value = Encoding.Default.GetBytes(s); - } - - if (source is File srcFile) - { - if (srcFile.Value != null) - elem.Value = Encoding.Default.GetBytes(srcFile.Value); - } - - return elem; - } - - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendConceptDescription.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendConceptDescription.cs deleted file mode 100644 index c7bc38ce9..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendConceptDescription.cs +++ /dev/null @@ -1,299 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AasxCompatibilityModels; -using AdminShellNS; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection.Metadata; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendConceptDescription - { - #region AasxPackageExplorer - - public static string GetDefaultPreferredName(this ConceptDescription conceptDescription,string defaultLang = null) - { - return "" + - conceptDescription.GetIEC61360()? - .PreferredName?.GetDefaultString(defaultLang); - } - - public static EmbeddedDataSpecification SetIEC61360Spec(this ConceptDescription conceptDescription, - string[] preferredNames = null, - string shortName = "", - string unit = "", - Reference unitId = null, - string valueFormat = null, - string sourceOfDefinition = null, - string symbol = null, - string dataType = "", - string[] definition = null - ) - { - var eds = new EmbeddedDataSpecification( - new Reference(ReferenceTypes.GlobalReference, - new List { ExtendIDataSpecificationContent.GetKeyForIec61360() }), - new DataSpecificationIec61360( - ExtendLangStringSet.CreateManyFromStringArray(preferredNames), - new List { new LangString("EN?", shortName)}, - unit, - unitId, - sourceOfDefinition, - symbol, - Stringification.DataTypeIec61360FromString(dataType), - ExtendLangStringSet.CreateManyFromStringArray(definition) - )); - - conceptDescription.EmbeddedDataSpecifications = new List { eds }; - - // TODO (MIHO, 2022-12-22): Check, but I think it makes no sense - // conceptDescription.IsCaseOf ??= new List(); - // conceptDescription.IsCaseOf.Add(new Reference(ReferenceTypes.ModelReference, new List() { new Key(KeyTypes.ConceptDescription, conceptDescription.Id) })); - - return eds; - } - - /* - - public static DataSpecificationIec61360 CreateDataSpecWithContentIec61360(this ConceptDescription conceptDescription) - { - var eds = EmbeddedDataSpecification.CreateIEC61360WithContent(); - conceptDescription.EmbeddedDataSpecification ??= new HasDataSpecification(); - conceptDescription.EmbeddedDataSpecification.Add(eds); - return eds.DataSpecificationContent?.DataSpecificationIEC61360; - } - - */ - - public static Tuple ToCaptionInfo(this ConceptDescription conceptDescription) - { - var caption = ""; - if (!string.IsNullOrEmpty(conceptDescription.IdShort)) - caption = $"\"{conceptDescription.IdShort.Trim()}\""; - if (conceptDescription.Id != null) - caption = (caption + " " + conceptDescription.Id).Trim(); - - var info = "" + conceptDescription.GetDefaultShortName(); - - return Tuple.Create(caption, info); - } - - public static string GetDefaultShortName(this ConceptDescription conceptDescription, string defaultLang = null) - { - return "" + - conceptDescription.GetIEC61360()? - .ShortName?.GetDefaultString(defaultLang); - } - - public static DataSpecificationIec61360 GetIEC61360(this ConceptDescription conceptDescription) - { - return conceptDescription.EmbeddedDataSpecifications?.GetIEC61360Content(); - } - - public static DataSpecificationPhysicalUnit GetPhysicalUnit(this ConceptDescription conceptDescription) - { - return conceptDescription.EmbeddedDataSpecifications?.GetPhysicalUnitContent(); - } - - public static IEnumerable FindAllReferences(this ConceptDescription conceptDescription) - { - yield break; - } - - #endregion - #region ListOfConceptDescription - public static ConceptDescription AddConceptDescriptionOrReturnExisting(this List conceptDescriptions, ConceptDescription newConceptDescription) - { - if(newConceptDescription == null) - { - return null; - } - if(conceptDescriptions != null) - { - var existingCd = conceptDescriptions.Where(c => c.Id == newConceptDescription.Id).First(); - if(existingCd != null) - { - return existingCd; - } - else - { - conceptDescriptions.Add(newConceptDescription); - } - } - - return newConceptDescription; - } - #endregion - - public static void Validate(this ConceptDescription conceptDescription,AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check CD itself - //Handled by BaseValidation Method - //conceptDescription.Validate(results); - - // check IEC61360 spec - - //TODO:jtikekar Temporarily Removed - //var eds61360 = this.IEC61360DataSpec; - //if (eds61360 != null) - //{ - // // check data spec - // if (eds61360.dataSpecification == null || - // !(eds61360.dataSpecification.MatchesExactlyOneKey(DataSpecificationIEC61360.GetKey()))) - // results.Add(new AasValidationRecord( - // AasValidationSeverity.SpecViolation, this, - // "HasDataSpecification: data specification content set to IEC61360, but no " + - // "data specification reference set!", - // () => - // { - // eds61360.dataSpecification = new DataSpecificationRef( - // new Reference( - // DataSpecificationIEC61360.GetKey())); - // })); - - // // validate content - // if (eds61360.dataSpecificationContent?.dataSpecificationIEC61360 == null) - // { - // results.Add(new AasValidationRecord( - // AasValidationSeverity.SpecViolation, this, - // "HasDataSpecification: data specification reference set to IEC61360, but no " + - // "data specification content set!", - // () => - // { - // eds61360.dataSpecificationContent = new DataSpecificationContent(); - // eds61360.dataSpecificationContent.dataSpecificationIEC61360 = - // new DataSpecificationIEC61360(); - // })); - // } - // else - // { - // // validate - // eds61360.dataSpecificationContent.dataSpecificationIEC61360.Validate(results, this); - // } - } - - public static Key GetSingleKey(this ConceptDescription conceptDescription) - { - return new Key(KeyTypes.ConceptDescription, conceptDescription.Id); - } - public static ConceptDescription ConvertFromV10(this ConceptDescription conceptDescription, AasxCompatibilityModels.AdminShellV10.ConceptDescription sourceConceptDescription) - { - if (sourceConceptDescription == null) - { - return null; - } - - if (string.IsNullOrEmpty(sourceConceptDescription.idShort)) - { - conceptDescription.IdShort = ""; - } - else - { - conceptDescription.IdShort = sourceConceptDescription.idShort; - } - - if (sourceConceptDescription.description != null) - { - conceptDescription.Description = ExtensionsUtil.ConvertDescriptionFromV10(sourceConceptDescription.description); - } - - if (sourceConceptDescription.administration != null) - { - conceptDescription.Administration = new AdministrativeInformation(version: sourceConceptDescription.administration.version, revision: sourceConceptDescription.administration.revision); - } - - if (sourceConceptDescription.IsCaseOf != null && sourceConceptDescription.IsCaseOf.Count != 0) - { - if (conceptDescription.IsCaseOf == null) - { - conceptDescription.IsCaseOf = new List(); - } - foreach (var caseOf in sourceConceptDescription.IsCaseOf) - { - conceptDescription.IsCaseOf.Add(ExtensionsUtil.ConvertReferenceFromV10(caseOf, ReferenceTypes.ModelReference)); - } - } - - return conceptDescription; - } - - public static ConceptDescription ConvertFromV20(this ConceptDescription cd, AasxCompatibilityModels.AdminShellV20.ConceptDescription srcCD) - { - if (srcCD == null) - return null; - - if (string.IsNullOrEmpty(srcCD.idShort)) - cd.IdShort = ""; - else - cd.IdShort = srcCD.idShort; - - if (srcCD.identification?.id != null) - cd.Id = srcCD.identification.id; - - if (srcCD.description != null) - cd.Description = ExtensionsUtil.ConvertDescriptionFromV20(srcCD.description); - - if (srcCD.administration != null) - cd.Administration = new AdministrativeInformation( - version: srcCD.administration.version, revision: srcCD.administration.revision); - - if (srcCD.IsCaseOf != null && srcCD.IsCaseOf.Count != 0) - { - if (cd.IsCaseOf == null) - { - cd.IsCaseOf = new List(); - } - foreach (var caseOf in srcCD.IsCaseOf) - { - cd.IsCaseOf.Add(ExtensionsUtil.ConvertReferenceFromV20(caseOf, ReferenceTypes.ModelReference)); - } - } - - //jtikekar:as per old implementation - if(srcCD.embeddedDataSpecification != null) - { - foreach (var sourceEsd in srcCD.embeddedDataSpecification) - { - var esd = new EmbeddedDataSpecification(null, null); - esd.ConvertFromV20(sourceEsd); - cd.AddEmbeddedDataSpecification(esd); - } - } - - return cd; - } - - public static EmbeddedDataSpecification AddEmbeddedDataSpecification(this ConceptDescription cd, EmbeddedDataSpecification eds) - { - if (cd == null) - return null; - if (cd.EmbeddedDataSpecifications == null) - cd.EmbeddedDataSpecifications = new List(); - if (eds == null) - return null; - cd.EmbeddedDataSpecifications.Add(eds); - return eds; - } - - public static Reference GetCdReference(this ConceptDescription conceptDescription) - { - var key = new Key(KeyTypes.ConceptDescription, conceptDescription.Id); - return new Reference(ReferenceTypes.ModelReference, new List { key }); - } - - public static void AddIsCaseOf(this ConceptDescription cd, - Reference ico) - { - if (cd.IsCaseOf == null) - cd.IsCaseOf = new List(); - cd.IsCaseOf.Add(ico); - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendDataElement.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendDataElement.cs deleted file mode 100644 index 299e3b350..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendDataElement.cs +++ /dev/null @@ -1,19 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendDataElement - { - public static DataTypeDefXsd[] ValueTypes_Number = - new[] { DataTypeDefXsd.Decimal, DataTypeDefXsd.Double, DataTypeDefXsd.Float, - DataTypeDefXsd.Integer, DataTypeDefXsd.Long, DataTypeDefXsd.Int, DataTypeDefXsd.Short, - DataTypeDefXsd.Byte, DataTypeDefXsd.NonNegativeInteger, DataTypeDefXsd.NonPositiveInteger, - DataTypeDefXsd.UnsignedInt, DataTypeDefXsd.Integer, DataTypeDefXsd.UnsignedByte, - DataTypeDefXsd.UnsignedLong, DataTypeDefXsd.UnsignedShort, DataTypeDefXsd.NegativeInteger }; - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendDataSpecificationIEC61360.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendDataSpecificationIEC61360.cs deleted file mode 100644 index 28da474ba..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendDataSpecificationIEC61360.cs +++ /dev/null @@ -1,40 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendDataSpecificationIEC61360 - { - public static DataSpecificationIec61360 ConvertFromV20(this DataSpecificationIec61360 ds61360, AasxCompatibilityModels.AdminShellV20.DataSpecificationIEC61360 src616360) - { - if (src616360.preferredName != null) - ds61360.PreferredName = new List().ConvertFromV20(src616360.preferredName); - - if (src616360.shortName != null) - ds61360.ShortName = new List().ConvertFromV20(src616360.shortName); - - ds61360.Unit = src616360.unit; - if (src616360.unitId != null) - ds61360.UnitId = ExtensionsUtil.ConvertReferenceFromV20(AasxCompatibilityModels.AdminShellV20.Reference.CreateNew(src616360.unitId.keys), ReferenceTypes.GlobalReference); - - ds61360.ValueFormat = src616360.valueFormat; - ds61360.SourceOfDefinition = src616360.sourceOfDefinition; - ds61360.Symbol = src616360.symbol; - if (!(string.IsNullOrEmpty(src616360.dataType))) - { - var dt = src616360.dataType; - if (!dt.StartsWith("xs:")) - dt = "xs:" + dt; - ds61360.DataType = Stringification.DataTypeIec61360FromString(dt); - } - if (src616360.definition != null) - ds61360.Definition = new List().ConvertFromV20(src616360.definition); - - return ds61360; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendEmbeddedDataSpecification.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendEmbeddedDataSpecification.cs deleted file mode 100644 index e89dd5ad5..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendEmbeddedDataSpecification.cs +++ /dev/null @@ -1,108 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -// using DataSpecificationContent = HasDataSpecification.DataSpecificationContent; - -namespace Extensions -{ - // TODO (Jui, 2022-12-21): I do not know, if to put the List<> extension here or in a separate file - public static class ExtendListOfEmbeddedDataSpecification - { - - - public static EmbeddedDataSpecification FindFirstIEC61360Spec(this List list) - { - foreach (var eds in list) - if (eds?.DataSpecificationContent is DataSpecificationIec61360 - || eds?.DataSpecification?.MatchesExactlyOneKey( - ExtendIDataSpecificationContent.GetKeyForIec61360()) == true) - return eds; - return null; - } - - public static DataSpecificationIec61360 GetIEC61360Content(this List list) - { - foreach (var eds in list) - if (eds?.DataSpecificationContent is DataSpecificationIec61360 dsiec) - return dsiec; - return null; - } - - public static DataSpecificationPhysicalUnit GetPhysicalUnitContent(this List list) - { - foreach (var eds in list) - if (eds?.DataSpecificationContent is DataSpecificationPhysicalUnit dspu) - return dspu; - return null; - } - } - - public static class ExtendEmbeddedDataSpecification - { - public static EmbeddedDataSpecification ConvertFromV20(this EmbeddedDataSpecification embeddedDataSpecification, AasxCompatibilityModels.AdminShellV20.EmbeddedDataSpecification sourceEmbeddedSpec) - { - if(sourceEmbeddedSpec != null) - { - embeddedDataSpecification.DataSpecification = ExtensionsUtil.ConvertReferenceFromV20(sourceEmbeddedSpec.dataSpecification, ReferenceTypes.GlobalReference); - - // TODO (MIHO, 2022-19-12): check again, see questions - var o2id = "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360"; - var oldid = "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0"; - var newid = "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0"; - - if (sourceEmbeddedSpec.dataSpecification?.Matches("", false, "IRI", oldid, - AasxCompatibilityModels.AdminShellV20.Key.MatchMode.Identification) == true) - { - embeddedDataSpecification.DataSpecification.Keys[0].Value = newid; - } - - if (sourceEmbeddedSpec.dataSpecification?.Matches("", false, "IRI", o2id, - AasxCompatibilityModels.AdminShellV20.Key.MatchMode.Identification) == true) - { - embeddedDataSpecification.DataSpecification.Keys[0].Value = newid; - } - } - - if(sourceEmbeddedSpec.dataSpecificationContent?.dataSpecificationIEC61360 != null) - { - embeddedDataSpecification.DataSpecificationContent = - new DataSpecificationIec61360(null).ConvertFromV20( - sourceEmbeddedSpec.dataSpecificationContent.dataSpecificationIEC61360); - } - return embeddedDataSpecification; - } - - public static EmbeddedDataSpecification CreateIec61360WithContent(DataSpecificationIec61360 content = null) - { - if (content == null) - content = new DataSpecificationIec61360(null); - - var res = new EmbeddedDataSpecification( - new Reference(ReferenceTypes.GlobalReference, - new List( new[] { ExtendIDataSpecificationContent.GetKeyForIec61360() })), - content); - return res; - } - - public static bool FixReferenceWrtContent(this EmbeddedDataSpecification eds) - { - // does content tell something? - var ctc = ExtendIDataSpecificationContent.GuessContentTypeFor(eds?.DataSpecificationContent); - var ctr = ExtendIDataSpecificationContent.GuessContentTypeFor(eds?.DataSpecification); - - if (ctc == ExtendIDataSpecificationContent.ContentTypes.NoInfo) - return false; - - if (ctr == ctc) - return false; - - // ok, fix - eds.DataSpecification = new Reference(ReferenceTypes.GlobalReference, - new List { ExtendIDataSpecificationContent.GetKeyFor(ctc) }); - return true; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendEntity.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendEntity.cs deleted file mode 100644 index 4b520e1cf..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendEntity.cs +++ /dev/null @@ -1,108 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AdminShellNS.Display; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendEntity - { - #region AasxPackageExplorer - - public static void Add(this Entity entity, ISubmodelElement submodelElement) - { - if (entity != null) - { - entity.Statements ??= new(); - - submodelElement.Parent = entity; - - entity.Statements.Add(submodelElement); - } - } - - public static void Remove(this Entity entity, ISubmodelElement submodelElement) - { - if(entity != null) - { - if(entity.Statements != null) - { - entity.Statements.Remove(submodelElement); - } - } - } - - public static object AddChild(this Entity entity, ISubmodelElement childSubmodelElement, EnumerationPlacmentBase placement = null) - { - if (childSubmodelElement == null) - return null; - if (entity.Statements == null) - entity.Statements = new (); - if (childSubmodelElement != null) - childSubmodelElement.Parent = entity; - entity.Statements.Add(childSubmodelElement); - return childSubmodelElement; - } - - #endregion - public static Entity ConvertFromV20(this Entity entity, AasxCompatibilityModels.AdminShellV20.Entity sourceEntity) - { - if (sourceEntity == null) - { - return null; - } - - if (sourceEntity.statements != null) - { - entity.Statements ??= new List(); - foreach (var submodelElementWrapper in sourceEntity.statements) - { - var sourceSubmodelElement = submodelElementWrapper.submodelElement; - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelElement != null) - { - outputSubmodelElement = outputSubmodelElement.ConvertFromV20(sourceSubmodelElement); - } - entity.Statements.Add(outputSubmodelElement); - } - } - - if (sourceEntity.assetRef != null) - { - //TODO:jtikekar whether to convert to Global or specific asset id - var assetRef = ExtensionsUtil.ConvertReferenceFromV20(sourceEntity.assetRef, ReferenceTypes.GlobalReference); - entity.GlobalAssetId = assetRef; - } - - return entity; - } - - public static T FindFirstIdShortAs(this Entity entity, string idShort) where T : ISubmodelElement - { - - var submodelElements = entity.Statements.Where(sme => (sme != null) && (sme is T) && sme.IdShort.Equals(idShort, StringComparison.OrdinalIgnoreCase)); - - if (submodelElements.Any()) - { - return (T)submodelElements.First(); - } - - return default; - } - - public static T CreateSMEForCD( - this Entity ent, - ConceptDescription conceptDescription, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false, bool isTemplate = false) - where T : ISubmodelElement - { - if (ent.Statements == null) - ent.Statements = new List(); - return ent.Statements.CreateSMEForCD( - conceptDescription, category, idShort, idxTemplate, maxNum, addSme, isTemplate); - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendEnvironment.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendEnvironment.cs deleted file mode 100644 index 1dc5111e5..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendEnvironment.cs +++ /dev/null @@ -1,1052 +0,0 @@ -using AasCore.Aas3_0_RC02; -using Extensions; -using AdminShellNS; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.CompilerServices; - -namespace Extensions -{ - public static class ExtendEnvironment - { - #region Environment - - #region AasxPackageExplorer - - public static void RecurseOnReferables(this AasCore.Aas3_0_RC02.Environment environment, - object state, Func, IReferable, bool> lambda, bool includeThis = false) - { - // includeThis does not make sense, as no Referable - // just use the others - foreach (var idf in environment.FindAllReferable(onlyIdentifiables: true)) - idf?.RecurseOnReferables(state, lambda, includeThis); - } - - #endregion - - public static AasValidationRecordList ValidateAll(this AasCore.Aas3_0_RC02.Environment environment) - { - // collect results - var results = new AasValidationRecordList(); - - // all entities - foreach (var rf in environment.FindAllReferable()) - rf.Validate(results); - - // give back - return results; - } - - public static int AutoFix(this AasCore.Aas3_0_RC02.Environment environment, IEnumerable records) - { - // access - if (records == null) - return -1; - - // collect Referables (expensive safety measure) - var allowedReferables = environment.FindAllReferable().ToList(); - - // go thru records - int res = 0; - foreach (var rec in records) - { - // access - if (rec == null || rec.Fix == null || rec.Source == null) - continue; - - // minimal safety measure - if (!allowedReferables.Contains(rec.Source)) - continue; - - // apply fix - res++; - try - { - rec.Fix.Invoke(); - } - catch - { - res--; - } - } - - // return number of applied fixes - return res; - } - - public static IEnumerable FindAllReferable(this AasCore.Aas3_0_RC02.Environment environment, bool onlyIdentifiables = false) - { - if (environment.AssetAdministrationShells != null) - foreach (var aas in environment.AssetAdministrationShells) - if (aas != null) - { - // AAS itself - yield return aas; - } - - if (environment.Submodels != null) - foreach (var sm in environment.Submodels) - if (sm != null) - { - yield return sm; - - if (!onlyIdentifiables) - { - // TODO (MIHO, 2020-08-26): not very elegant, yet. Avoid temporary collection - var allsme = new List(); - sm.RecurseOnSubmodelElements(null, (state, parents, sme) => - { - allsme.Add(sme); return true; - }); - foreach (var sme in allsme) - yield return sme; - } - } - - if (environment.ConceptDescriptions != null) - foreach (var cd in environment.ConceptDescriptions) - if (cd != null) - yield return cd; - } - -#if !DoNotUseAasxCompatibilityModels - - public static AasCore.Aas3_0_RC02.Environment ConvertFromV10(this AasCore.Aas3_0_RC02.Environment environment, AasxCompatibilityModels.AdminShellV10.AdministrationShellEnv sourceEnvironement) - { - //Convert Administration Shells - if (sourceEnvironement.AdministrationShells != null) - { - if (environment.AssetAdministrationShells == null) - { - environment.AssetAdministrationShells = new List(); - } - foreach (var sourceAas in sourceEnvironement.AdministrationShells) - { - var sourceAsset = sourceEnvironement?.FindAsset(sourceAas.assetRef); - if (sourceAsset != null) - { - var newAssetInformation = new AssetInformation(AssetKind.Instance); - newAssetInformation = newAssetInformation.ConvertFromV10(sourceAsset); - - var newAas = new AssetAdministrationShell(id: sourceAas.identification.id, newAssetInformation); - newAas = newAas.ConvertFromV10(sourceAas); - - environment.AssetAdministrationShells.Add(newAas); - } - - } - } - - //Convert Submodels - if (sourceEnvironement.Submodels != null) - { - if (environment.Submodels == null) - { - environment.Submodels = new List(); - } - foreach (var sourceSubmodel in sourceEnvironement.Submodels) - { - var newSubmodel = new Submodel(sourceSubmodel.identification.id); - newSubmodel = newSubmodel.ConvertFromV10(sourceSubmodel); - environment.Submodels.Add(newSubmodel); - } - } - - if (sourceEnvironement.ConceptDescriptions != null) - { - if (environment.ConceptDescriptions == null) - { - environment.ConceptDescriptions = new List(); - } - foreach (var sourceConceptDescription in sourceEnvironement.ConceptDescriptions) - { - var newConceptDescription = new ConceptDescription(sourceConceptDescription.identification.id); - newConceptDescription = newConceptDescription.ConvertFromV10(sourceConceptDescription); - environment.ConceptDescriptions.Add(newConceptDescription); - } - } - - return environment; - } - - - public static AasCore.Aas3_0_RC02.Environment ConvertFromV20(this AasCore.Aas3_0_RC02.Environment environment, AasxCompatibilityModels.AdminShellV20.AdministrationShellEnv sourceEnvironement) - { - //Convert Administration Shells - if (sourceEnvironement.AdministrationShells != null) - { - if (environment.AssetAdministrationShells == null) - { - environment.AssetAdministrationShells = new List(); - } - foreach (var sourceAas in sourceEnvironement.AdministrationShells) - { - // first make the AAS - var newAas = new AssetAdministrationShell(id: sourceAas.identification.id, null); - newAas = newAas.ConvertFromV20(sourceAas); - environment.AssetAdministrationShells.Add(newAas); - - var sourceAsset = sourceEnvironement?.FindAsset(sourceAas.assetRef); - if (sourceAsset != null) - { - var newAssetInformation = new AssetInformation(AssetKind.Instance); - newAssetInformation = newAssetInformation.ConvertFromV20(sourceAsset); - newAas.AssetInformation = newAssetInformation; - } - - } - } - - //Convert Submodels - if (sourceEnvironement.Submodels != null) - { - if (environment.Submodels == null) - { - environment.Submodels = new List(); - } - foreach (var sourceSubmodel in sourceEnvironement.Submodels) - { - var newSubmodel = new Submodel(sourceSubmodel.identification.id); - newSubmodel = newSubmodel.ConvertFromV20(sourceSubmodel); - environment.Submodels.Add(newSubmodel); - } - } - - if (sourceEnvironement.ConceptDescriptions != null) - { - if (environment.ConceptDescriptions == null) - { - environment.ConceptDescriptions = new List(); - } - foreach (var sourceConceptDescription in sourceEnvironement.ConceptDescriptions) - { - var newConceptDescription = new ConceptDescription(sourceConceptDescription.identification.id); - newConceptDescription = newConceptDescription.ConvertFromV20(sourceConceptDescription); - environment.ConceptDescriptions.Add(newConceptDescription); - } - } - - return environment; - } - -#endif - - //TODO:jtikekar to test - public static AasCore.Aas3_0_RC02.Environment CreateFromExistingEnvironment(this AasCore.Aas3_0_RC02.Environment environment, AasCore.Aas3_0_RC02.Environment sourceEnvironment, List filterForAas = null, List filterForAssets = null, List filterForSubmodel = null, List filterForConceptDescriptions = null) - { - if (filterForAas == null) - { - filterForAas = new List(); - } - - if (filterForAssets == null) - { - filterForAssets = new List(); - } - - if (filterForSubmodel == null) - { - filterForSubmodel = new List(); - } - - if (filterForConceptDescriptions == null) - { - filterForConceptDescriptions = new List(); - } - - //var outputEnvironment = new AasCore.Aas3_0_RC02.Environment(); - - //Copy AssetAdministrationShells - foreach (var aas in sourceEnvironment.AssetAdministrationShells) - { - if (filterForAas.Contains(aas)) - { - environment.AssetAdministrationShells.Add(aas); - - if (aas.Submodels != null && aas.Submodels.Count > 0) - { - foreach (var submodelReference in aas.Submodels) - { - var submodel = sourceEnvironment.FindSubmodel(submodelReference); - if (submodel != null) - { - filterForSubmodel.Add(submodel); - } - } - } - } - } - - //Copy Submodel - foreach (var submodel in sourceEnvironment.Submodels) - { - if (filterForSubmodel.Contains(submodel)) - { - environment.Submodels.Add(submodel); - - //Find Used CDs - environment.CreateFromExistingEnvRecurseForCDs(sourceEnvironment, submodel.SubmodelElements, ref filterForConceptDescriptions); - } - } - - //Copy ConceptDescription - foreach (var conceptDescription in sourceEnvironment.ConceptDescriptions) - { - if (filterForConceptDescriptions.Contains(conceptDescription)) - { - environment.ConceptDescriptions.Add(conceptDescription); - } - } - - return environment; - - } - - public static void CreateFromExistingEnvRecurseForCDs(this AasCore.Aas3_0_RC02.Environment environment, AasCore.Aas3_0_RC02.Environment sourceEnvironment, List submodelElements, ref List filterForConceptDescription) - { - if (submodelElements == null || submodelElements.Count == 0 || filterForConceptDescription == null || filterForConceptDescription.Count == 0) - { - return; - } - - foreach (var submodelElement in submodelElements) - { - if (submodelElement == null) - { - return; - } - - if (submodelElement.SemanticId != null) - { - var conceptDescription = sourceEnvironment.FindConceptDescriptionByReference(submodelElement.SemanticId); - if (conceptDescription != null) - { - filterForConceptDescription.Add(conceptDescription); - } - } - - if (submodelElement is SubmodelElementCollection smeColl) - { - environment.CreateFromExistingEnvRecurseForCDs(sourceEnvironment, smeColl.Value, ref filterForConceptDescription); - } - - if (submodelElement is SubmodelElementList smeList) - { - environment.CreateFromExistingEnvRecurseForCDs(sourceEnvironment, smeList.Value, ref filterForConceptDescription); - } - - if (submodelElement is Entity entity) - { - environment.CreateFromExistingEnvRecurseForCDs(sourceEnvironment, entity.Statements, ref filterForConceptDescription); - } - - if (submodelElement is AnnotatedRelationshipElement annotatedRelationshipElement) - { - var annotedELements = new List(); - foreach (var annotation in annotatedRelationshipElement.Annotations) - { - annotedELements.Add(annotation); - } - environment.CreateFromExistingEnvRecurseForCDs(sourceEnvironment, annotedELements, ref filterForConceptDescription); - } - - if (submodelElement is Operation operation) - { - var operationELements = new List(); - foreach (var inputVariable in operation.InputVariables) - { - operationELements.Add(inputVariable.Value); - } - - foreach (var outputVariable in operation.OutputVariables) - { - operationELements.Add(outputVariable.Value); - } - - foreach (var inOutVariable in operation.InoutputVariables) - { - operationELements.Add(inOutVariable.Value); - } - - environment.CreateFromExistingEnvRecurseForCDs(sourceEnvironment, operationELements, ref filterForConceptDescription); - - } - } - } - - public static ConceptDescription Add(this AasCore.Aas3_0_RC02.Environment env, ConceptDescription cd) - { - if (cd == null) - return null; - if (env.ConceptDescriptions == null) - env.ConceptDescriptions = new(); - env.ConceptDescriptions.Add(cd); - return cd; - } - - public static Submodel Add(this AasCore.Aas3_0_RC02.Environment env, Submodel sm) - { - if (sm == null) - return null; - if (env.Submodels == null) - env.Submodels = new(); - env.Submodels.Add(sm); - return sm; - } - - public static AssetAdministrationShell Add(this AasCore.Aas3_0_RC02.Environment env, AssetAdministrationShell aas) - { - if (aas == null) - return null; - if (env.AssetAdministrationShells == null) - env.AssetAdministrationShells = new(); - env.AssetAdministrationShells.Add(aas); - return aas; - } - - //public static JsonWriter SerialiazeJsonToStream(this AasCore.Aas3_0_RC02.Environment environment, StreamWriter streamWriter, bool leaveJsonWriterOpen = false) - //{ - // streamWriter.AutoFlush = true; - - // JsonSerializer serializer = new JsonSerializer() - // { - // NullValueHandling = NullValueHandling.Ignore, - // ReferenceLoopHandling = ReferenceLoopHandling.Serialize, - // Formatting = Newtonsoft.Json.Formatting.Indented - // }; - - // JsonWriter writer = new JsonTextWriter(streamWriter); - // serializer.Serialize(writer, environment); - // if (leaveJsonWriterOpen) - // return writer; - // writer.Close(); - // return null; - //} - - - #endregion - - #region Submodel Queries - - public static IEnumerable FindAllSubmodelGroupedByAAS(this AasCore.Aas3_0_RC02.Environment environment, Func p = null) - { - if (environment.AssetAdministrationShells == null || environment.Submodels == null) - yield break; - foreach (var aas in environment.AssetAdministrationShells) - { - if (aas?.Submodels == null) - continue; - foreach (var smref in aas.Submodels) - { - var sm = environment.FindSubmodel(smref); - if (sm != null && (p == null || p(aas, sm))) - yield return sm; - } - } - } - public static Submodel FindSubmodel(this AasCore.Aas3_0_RC02.Environment environment, Reference submodelReference) - { - if (submodelReference == null) - { - return null; - } - - if (submodelReference.Keys.Count != 1) // Can have only one reference key - { - return null; - } - - var key = submodelReference.Keys[0]; - if (key.Type != KeyTypes.Submodel) - { - return null; - } - - var submodels = environment.Submodels.Where(s => s.Id.Equals(key.Value, StringComparison.OrdinalIgnoreCase)); - if (submodels.Any()) - { - return submodels.First(); - } - - return null; - } - - public static Submodel FindSubmodelById(this AasCore.Aas3_0_RC02.Environment environment, string submodelId) - { - if (string.IsNullOrEmpty(submodelId)) - { - return null; - } - - var submodels = environment.Submodels.Where(s => s.Id.Equals(submodelId)); - if (submodels.Any()) - { - return submodels.First(); - } - - return null; - } - - public static IEnumerable FindAllSubmodelsGroupedByAAS(this AasCore.Aas3_0_RC02.Environment environment, Func p = null) - { - if (environment.AssetAdministrationShells == null || environment.Submodels == null) - yield break; - foreach (var aas in environment.AssetAdministrationShells) - { - if (aas?.Submodels == null) - continue; - foreach (var submodelReference in aas.Submodels) - { - var submodel = environment.FindSubmodel(submodelReference); - if (submodel != null && (p == null || p(aas, submodel))) - yield return submodel; - } - } - } - - public static IEnumerable FindAllSubmodelBySemanticId(this AasCore.Aas3_0_RC02.Environment environment, string semanticId) - { - if (semanticId == null) - yield break; - - foreach (var submodel in environment.Submodels) - if (true == submodel.SemanticId?.Matches(semanticId)) - yield return submodel; - } - - #endregion - - #region AssetAdministrationShell Queries - public static AssetAdministrationShell FindAasWithSubmodelId(this AasCore.Aas3_0_RC02.Environment environment, string submodelId) - { - if (submodelId == null) - { - return null; - } - - var aas = environment.AssetAdministrationShells.Where(a => (a.Submodels?.Where(s => s.Matches(submodelId)).First()) != null).First(); - - return aas; - } - - public static AssetAdministrationShell FindAasById(this AasCore.Aas3_0_RC02.Environment environment, string aasId) - { - if (string.IsNullOrEmpty(aasId)) - { - return null; - } - - var aas = environment.AssetAdministrationShells.Where(a => a.Id.Equals(aasId)).First(); - - return aas; - } - - #endregion - - #region ConceptDescription Queries - - public static ConceptDescription FindConceptDescriptionById( - this AasCore.Aas3_0_RC02.Environment env, string cdId) - { - if (string.IsNullOrEmpty(cdId)) - return null; - - var conceptDescription = env.ConceptDescriptions.Where(c => c.Id.Equals(cdId)).FirstOrDefault(); - return conceptDescription; - } - - public static ConceptDescription FindConceptDescriptionByReference( - this AasCore.Aas3_0_RC02.Environment env, Reference rf) - { - if (rf == null) - return null; - - return env.FindConceptDescriptionById(rf.GetAsIdentifier()); - } - - #endregion - - #region Referable Queries - - /// - /// Result of FindReferable in Environment - /// - public class ReferableRootInfo - { - public AssetAdministrationShell AAS = null; - public AssetInformation Asset = null; - public Submodel Submodel = null; - public ConceptDescription CD = null; - - public int NrOfRootKeys = 0; - - public bool IsValid - { - get - { - return NrOfRootKeys > 0 && (AAS != null || Submodel != null || Asset != null); - } - } - } - - //TODO: jtikekar Need to test - public static IReferable FindReferableByReference( - this AasCore.Aas3_0_RC02.Environment environment, - Reference reference, - int keyIndex = 0, - List submodelElementList = null, - ReferableRootInfo rootInfo = null) - { - // access - var keyList = reference?.Keys; - if (keyList == null || keyList.Count == 0 || keyIndex >= keyList.Count) - return null; - - // shortcuts - var firstKeyType = keyList[keyIndex].Type; - var firstKeyId = keyList[keyIndex].Value; - - // different pathes - switch (firstKeyType) - { - case KeyTypes.AssetAdministrationShell: - { - var aas = environment.FindAasById(firstKeyId); - - // side info? - if (rootInfo != null) - { - rootInfo.AAS = aas; - rootInfo.NrOfRootKeys = 1 + keyIndex; - } - - //Not found or already at the end of our search - if (aas == null || keyIndex >= keyList.Count - 1) - { - return aas; - } - - return environment.FindReferableByReference(reference, ++keyIndex); - } - - // TODO (MIHO, 2023-01-01): stupid generalization :-( - case KeyTypes.GlobalReference: - case KeyTypes.ConceptDescription: - { - // In meta model V3, multiple important things might by identified - // by a flat GlobalReference :-( - - // find an Asset by that id? - var keyedAas = environment.FindAasWithAssetInformation(firstKeyId); - if (keyedAas?.AssetInformation != null) - { - // found an Asset - - // side info? - if (rootInfo != null) - { - rootInfo.AAS = keyedAas; - rootInfo.Asset = keyedAas?.AssetInformation; - rootInfo.NrOfRootKeys = 1 + keyIndex; - } - - // give back the AAS - return keyedAas; - } - - // Concept?Description - var keyedCd = environment.FindConceptDescriptionById(firstKeyId); - if (keyedCd != null) - { - // side info? - if (rootInfo != null) - { - rootInfo.CD = keyedCd; - rootInfo.NrOfRootKeys = 1 + keyIndex; - } - - // give back the CD - return keyedCd; - } - - // Nope - return null; - } - - case KeyTypes.Submodel: - { - var submodel = environment.FindSubmodelById(firstKeyId); - // No? - if (submodel == null) - return null; - - // notice in side info - if (rootInfo != null) - { - rootInfo.Submodel = submodel; - rootInfo.NrOfRootKeys = 1 + keyIndex; - - // add even more info - if (rootInfo.AAS == null) - { - foreach (var aas2 in environment.AssetAdministrationShells) - { - var smref2 = environment.FindSubmodelById(submodel.Id); - if (smref2 != null) - { - rootInfo.AAS = aas2; - break; - } - } - } - } - - // at the end of the journey? - if (keyIndex >= keyList.Count - 1) - return submodel; - - return environment.FindReferableByReference(reference, ++keyIndex, submodel.SubmodelElements); - } - } - - if (firstKeyType.IsSME() && submodelElementList != null) - { - var submodelElement = submodelElementList.Where( - sme => sme.IdShort.Equals(keyList[keyIndex].Value, - StringComparison.OrdinalIgnoreCase)).First(); - - //This is required element - if (keyIndex + 1 >= keyList.Count) - { - return submodelElement; - } - - //Recurse again - if (submodelElement != null && submodelElement is SubmodelElementCollection smeColl) - { - return environment.FindReferableByReference(reference, ++keyIndex, smeColl.Value); - } - - if (submodelElement != null && submodelElement is SubmodelElementList smeList) - { - return environment.FindReferableByReference(reference, ++keyIndex, smeList.Value); - } - } - - //Nothing in this environment - return null; - } - - #endregion - - #region AasxPackageExplorer - - public static IEnumerable FindAllSubmodelElements(this AasCore.Aas3_0_RC02.Environment environment, - Predicate match = null, AssetAdministrationShell onlyForAAS = null) where T : ISubmodelElement - { - // more or less two different schemes - if (onlyForAAS != null) - { - if (onlyForAAS.Submodels == null) - yield break; - foreach (var smr in onlyForAAS.Submodels) - { - var sm = environment.FindSubmodel(smr); - if (sm?.SubmodelElements != null) - foreach (var x in sm.SubmodelElements.FindDeep(match)) - yield return x; - } - } - else - { - if (environment.Submodels != null) - foreach (var sm in environment.Submodels) - if (sm?.SubmodelElements != null) - foreach (var x in sm.SubmodelElements.FindDeep(match)) - yield return x; - } - } - - public static IEnumerable FindAllReferences(this AasCore.Aas3_0_RC02.Environment environment) - { - if (environment.AssetAdministrationShells != null) - foreach (var aas in environment.AssetAdministrationShells) - if (aas != null) - foreach (var r in aas.FindAllReferences()) - yield return r; - - //if (this.Assets != null) - // foreach (var asset in this.Assets) - // if (asset != null) - // foreach (var r in asset.FindAllReferences()) - // yield return new LocatedReference(asset, r); - - if (environment.Submodels != null) - foreach (var sm in environment.Submodels) - if (sm != null) - foreach (var r in sm.FindAllReferences()) - yield return r; - - if (environment.ConceptDescriptions != null) - foreach (var cd in environment.ConceptDescriptions) - if (cd != null) - foreach (var r in cd.FindAllReferences()) - yield return new LocatedReference(cd, r); - } - - /// - /// Tries renaming an Identifiable, specifically: the identification of an Identifiable and - /// all references to it. - /// Currently supported: ConceptDescriptions - /// Returns a list of Referables, which were changed or null in case of error - /// - public static List RenameIdentifiable(this AasCore.Aas3_0_RC02.Environment environment, string oldId, string newId) - where T : IClass - { - // access - if (oldId == null || newId == null || oldId.Equals(newId)) - return null; - - var res = new List(); - - if (typeof(T) == typeof(ConceptDescription)) - { - // check, if exist or not exist - var cdOld = environment.FindConceptDescriptionById(oldId); - if (cdOld == null || environment.FindConceptDescriptionById(newId) != null) - return null; - - // rename old cd - cdOld.Id = newId; - res.Add(cdOld); - - // search all SMEs referring to this CD - foreach (var sme in environment.FindAllSubmodelElements(match: (s) => - { - return (s != null && s.SemanticId != null && s.SemanticId.Matches(oldId)); - })) - { - sme.SemanticId.Keys[0].Value = newId; - res.Add(sme); - } - - // seems fine - return res; - } - else - if (typeof(T) == typeof(Submodel)) - { - // check, if exist or not exist - var smOld = environment.FindSubmodelById(oldId); - if (smOld == null || environment.FindSubmodelById(newId) != null) - return null; - - // recurse all possible Referenes in the aas env - foreach (var lr in environment.FindAllReferences()) - { - var r = lr?.Reference; - if (r != null) - for (int i = 0; i < r.Keys.Count; i++) - if (r.Keys[i].Matches(KeyTypes.Submodel, oldId, MatchMode.Relaxed)) - { - // directly replace - r.Keys[i].Value = newId; - if (res.Contains(lr.Identifiable)) - res.Add(lr.Identifiable); - } - } - - // rename old Submodel - smOld.Id = newId; - - // seems fine - return res; - } - else - if (typeof(T) == typeof(AssetAdministrationShell)) - { - // check, if exist or not exist - var aasOld = environment.FindAasById(oldId); - if (aasOld == null || environment.FindAasById(newId) != null) - return null; - - // recurse? -> no? - - // rename old Asset - aasOld.Id = newId; - - // seems fine - return res; - } - else - //TODO:jtikekar support asset - if (typeof(T) == typeof(AssetInformation)) - { - // check, if exist or not exist - var assetOld = environment.FindAasWithAssetInformation(oldId); - if (assetOld == null || environment.FindAasWithAssetInformation(newId) != null) - return null; - - // recurse all possible Referenes in the aas env - foreach (var lr in environment.FindAllReferences()) - { - var r = lr?.Reference; - if (r != null) - for (int i = 0; i < r.Keys.Count; i++) - if (r.Keys[i].Matches(KeyTypes.GlobalReference, oldId)) - { - // directly replace - r.Keys[i].Value = newId; - if (res.Contains(lr.Identifiable)) - res.Add(lr.Identifiable); - } - } - - // rename old Asset - assetOld.AssetInformation.GlobalAssetId = new Reference(ReferenceTypes.GlobalReference, new List() { new Key(KeyTypes.GlobalReference, newId)}); - - // seems fine - return res; - } - - // no result is false, as well - return null; - } - - public static AssetAdministrationShell FindAasWithAssetInformation(this AasCore.Aas3_0_RC02.Environment environment, string globalAssetId) - { - if(string.IsNullOrEmpty(globalAssetId)) - { - return null; - } - - foreach(var aas in environment.AssetAdministrationShells) - { - if(aas.AssetInformation.GlobalAssetId.GetAsIdentifier().Equals(globalAssetId)) - { - return aas; - } - } - - return null; - } - - public static ComparerIndexed CreateIndexedComparerCdsForSmUsage(this AasCore.Aas3_0_RC02.Environment environment) - { - var cmp = new ComparerIndexed(); - int nr = 0; - foreach (var sm in environment.FindAllSubmodelGroupedByAAS()) - foreach (var sme in sm.FindDeep()) - { - if (sme.SemanticId == null) - continue; - var cd = environment.FindConceptDescriptionByReference(sme.SemanticId); - if (cd == null) - continue; - if (cmp.Index.ContainsKey(cd)) - continue; - cmp.Index[cd] = nr++; - } - return cmp; - } - - public static ISubmodelElement CopySubmodelElementAndCD(this AasCore.Aas3_0_RC02.Environment environment, - AasCore.Aas3_0_RC02.Environment srcEnv, ISubmodelElement srcElem, bool copyCD = false, bool shallowCopy = false) - { - // access - if (srcEnv == null || srcElem == null) - return null; - - // 1st result pretty easy (calling function will add this to the appropriate Submodel) - var res = srcElem.Copy(); - - // copy the CDs.. - if (copyCD) - environment.CopyConceptDescriptionsFrom(srcEnv, srcElem, shallowCopy); - - // give back - return res; - } - - public static Reference CopySubmodelRefAndCD( this AasCore.Aas3_0_RC02.Environment environment, - AasCore.Aas3_0_RC02.Environment srcEnv, Reference srcSubRef, bool copySubmodel = false, bool copyCD = false, - bool shallowCopy = false) - { - // access - if (srcEnv == null || srcSubRef == null) - return null; - - // need to have the source Submodel - var srcSub = srcEnv.FindSubmodel(srcSubRef); - if (srcSub == null) - return null; - - // 1st result pretty easy (calling function will add this to the appropriate AAS) - var dstSubRef =srcSubRef.Copy(); - - // get the destination and shall src != dst - var dstSub = environment.FindSubmodel(dstSubRef); - if (srcSub == dstSub) - return null; - - // maybe we need the Submodel in our environment, as well - if (dstSub == null && copySubmodel) - { - dstSub = srcSub.Copy(); - environment.Submodels.Add(dstSub); - } - else - if (dstSub != null) - { - // there is already an submodel, just add members - if (!shallowCopy && srcSub.SubmodelElements != null) - { - if (dstSub.SubmodelElements == null) - dstSub.SubmodelElements = new List(); - foreach (var smw in srcSub.SubmodelElements) - dstSub.SubmodelElements.Add( - smw.Copy()); - } - } - - // copy the CDs.. - if (copyCD && srcSub.SubmodelElements != null) - foreach (var smw in srcSub.SubmodelElements) - environment.CopyConceptDescriptionsFrom(srcEnv, smw, shallowCopy); - - // give back - return dstSubRef; - } - - private static void CopyConceptDescriptionsFrom(this AasCore.Aas3_0_RC02.Environment environment, - AasCore.Aas3_0_RC02.Environment srcEnv, ISubmodelElement src, bool shallowCopy = false) - { - // access - if (srcEnv == null || src == null || src.SemanticId == null) - return; - // check for this SubmodelElement in Source - var cdSrc = srcEnv.FindConceptDescriptionByReference(src.SemanticId); - if (cdSrc == null) - return; - // check for this SubmodelElement in Destnation (this!) - var cdDest = environment.FindConceptDescriptionByReference(src.SemanticId); - if (cdDest != null) - return; - // copy new - environment.ConceptDescriptions.Add(cdSrc.Copy()); - // recurse? - if (!shallowCopy && src is SubmodelElementCollection) - foreach (var m in (src as SubmodelElementCollection).Value) - environment.CopyConceptDescriptionsFrom(srcEnv, m, shallowCopy: false); - - } - #endregion - - } - - - -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendFile.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendFile.cs deleted file mode 100644 index 8b8cc7576..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendFile.cs +++ /dev/null @@ -1,68 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendFile - { - public static string ValueAsText(this File file) - { - return "" + file.Value; - } - - public static void Set(this File file, - string contentType = "", string value = "") - { - file.ContentType = contentType; - file.Value = value; - } - - public static File ConvertFromV10(this File file, AasxCompatibilityModels.AdminShellV10.File sourceFile) - { - file.ContentType = sourceFile.mimeType; - file.Value = sourceFile.value; - return file; - } - public static File ConvertFromV20(this File file, AasxCompatibilityModels.AdminShellV20.File sourceFile) - { - file.ContentType = sourceFile.mimeType; - file.Value = sourceFile.value; - return file; - } - - public static File UpdateFrom(this File elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is Property srcProp) - { - elem.Value = srcProp.Value; - } - - if (source is AasCore.Aas3_0_RC02.Range srcRng) - { - elem.Value = srcRng.Min; - } - - if (source is MultiLanguageProperty srcMlp) - { - elem.Value = "" + srcMlp.Value?.GetDefaultString(); - } - - if (source is File srcFile) - { - elem.Value = "" + srcFile.Value; - } - - return elem; - } - - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendHasDataSpecification.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendHasDataSpecification.cs deleted file mode 100644 index 1a34c6d18..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendHasDataSpecification.cs +++ /dev/null @@ -1,26 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AasxCompatibilityModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendHasDataSpecification - { - public static IHasDataSpecification ConvertFromV20(this IHasDataSpecification embeddedDataSpecifications, AasxCompatibilityModels.AdminShellV20.HasDataSpecification sourceSpecification) - { - foreach(var sourceSpec in sourceSpecification) - { - var newEmbeddedSpec = new EmbeddedDataSpecification(null, null); - newEmbeddedSpec.ConvertFromV20(sourceSpec); - embeddedDataSpecifications.EmbeddedDataSpecifications.Add(newEmbeddedSpec); - } - - return embeddedDataSpecifications; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendIDataSpecificationContent.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendIDataSpecificationContent.cs deleted file mode 100644 index 4f020cea9..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendIDataSpecificationContent.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Extensions; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasCore.Aas3_0_RC02; -using AdminShellNS; - -namespace Extensions -{ - public static class ExtendIDataSpecificationContent - { - public enum ContentTypes { NoInfo, Iec61360, PhysicalUnit} - - public static Key GetKeyForIec61360() - { - return new Key(KeyTypes.GlobalReference, - "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0"); - } - - public static Reference GetReferencForIec61360() - { - return new Reference(ReferenceTypes.GlobalReference, new List { GetKeyForIec61360() }); - } - - public static Key GetKeyForPhysicalUnit() - { - return new Key(KeyTypes.GlobalReference, - "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0"); - } - - public static Key GetKeyFor(ContentTypes ct) - { - if (ct == ContentTypes.Iec61360) - return GetKeyForIec61360(); - if (ct == ContentTypes.PhysicalUnit) - return GetKeyForPhysicalUnit(); - return null; - } - - public static IDataSpecificationContent ContentFactoryFor(ContentTypes ct) - { - if (ct == ContentTypes.Iec61360) - return new DataSpecificationIec61360(null); - if (ct == ContentTypes.PhysicalUnit) - return new DataSpecificationPhysicalUnit("", "", null); - return null; - } - - public static ContentTypes GuessContentTypeFor(Reference rf) - { - foreach (var v in AdminShellUtil.GetEnumValues(new[] { ContentTypes.NoInfo })) - if (rf?.MatchesExactlyOneKey(GetKeyFor(v)) == true) - return v; - return ContentTypes.NoInfo; - } - - public static ContentTypes GuessContentTypeFor(IDataSpecificationContent content) - { - if (content is DataSpecificationIec61360) - return ContentTypes.Iec61360; - if (content is DataSpecificationPhysicalUnit) - return ContentTypes.PhysicalUnit; - return ContentTypes.NoInfo; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendIIdentifiable.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendIIdentifiable.cs deleted file mode 100644 index 29d8ffc33..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendIIdentifiable.cs +++ /dev/null @@ -1,28 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendIIdentifiable - { - #region List of Identifiers - - public static string ToStringExtended(this List identifiables,string delimiter = ",") - { - return string.Join(delimiter, identifiables.Select((x) => x.Id)); - } - - #endregion - public static Reference GetReference(this IIdentifiable identifiable) - { - var key = new Key(ExtensionsUtil.GetKeyType(identifiable), identifiable.Id); - var outputReference = new Reference(ReferenceTypes.ModelReference, new List() { key }); - - return outputReference; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendIReferable.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendIReferable.cs deleted file mode 100644 index 340900668..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendIReferable.cs +++ /dev/null @@ -1,600 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AdminShellNS; -using AdminShellNS.Display; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http.Headers; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendIReferable - { - #region AasxPackageExplorer - - public static void RecurseOnReferables(this IReferable referable, - object state, Func, IReferable, bool> lambda, - bool includeThis = false) - { - if(referable is Submodel submodel) - { - submodel.RecurseOnReferables(state, lambda, includeThis); - } - else if(referable is SubmodelElementCollection submodelElementCollection) - { - submodelElementCollection.RecurseOnReferables(state, lambda, includeThis); - } - else if(referable is SubmodelElementList submodelElementList) - { - submodelElementList.RecurseOnReferables(state, lambda, includeThis); - } - else if (includeThis) - lambda(state, null, referable); - } - - public static void Remove(this IReferable referable, ISubmodelElement submodelElement) - { - if(referable is Submodel submodel) - { - submodel.Remove(submodelElement); - } - else if(referable is AnnotatedRelationshipElement annotatedRelationshipElement) - { - annotatedRelationshipElement.Remove(submodelElement); - } - else if(referable is SubmodelElementCollection submodelElementCollection) - { - submodelElementCollection.Remove(submodelElement); - } - else if(referable is SubmodelElementList submodelElementList) - { - submodelElementList.Remove(submodelElement); - } - else if(referable is Entity entity) - { - entity.Remove(submodelElement); - } - } - - public static void Add(this IReferable referable, ISubmodelElement submodelElement) - { - if (referable is Submodel submodel) - { - submodel.Add(submodelElement); - } - else if (referable is AnnotatedRelationshipElement annotatedRelationshipElement) - { - annotatedRelationshipElement.Add(submodelElement); - } - else if (referable is SubmodelElementCollection submodelElementCollection) - { - submodelElementCollection.Add(submodelElement); - } - else if (referable is SubmodelElementList submodelElementList) - { - submodelElementList.Add(submodelElement); - } - else if (referable is Entity entity) - { - entity.Add(submodelElement); - } - } - - #region Display - - public static EnumerationPlacmentBase GetChildrenPlacement(this IReferable referable, ISubmodelElement submodelElement) - { - if(referable is Operation operation) - { - return operation.GetChildrenPlacement(submodelElement); - } - - return null; - } - - #endregion - - public static IIdentifiable FindParentFirstIdentifiable(this IReferable referable) - { - IReferable curr = referable; - while (curr != null) - { - if (curr is IIdentifiable curri) - return curri; - curr = curr.Parent as IReferable; - } - return null; - } - - #endregion - - #region ListOfReferables - public static Reference GetReference(this List referables) - { - return new Reference(ReferenceTypes.GlobalReference, referables.ToKeyList()); - } - - public static List ToKeyList(this List referables) - { - var res = new List(); - foreach (var rf in referables) - res.Add(new Key(rf.GetSelfDescription()?.KeyType ?? KeyTypes.GlobalReference, rf.IdShort)); - return res; - } - #endregion - - public static string ToIdShortString(this IReferable rf) - { - if (rf.IdShort == null || rf.IdShort.Trim().Length < 1) - return (""); - return rf.IdShort.Trim(); - } - - public static Reference GetReference(this IReferable referable) - { - if (referable is IIdentifiable identifiable) - { - return identifiable.GetReference(); - } - else if (referable is ISubmodelElement submodelElement) - { - return submodelElement.GetModelReference(); - } - else - return null; - } - public static void Validate(this IReferable referable,AasValidationRecordList results) - { - referable.BaseValidation(results); - - if(referable is ConceptDescription conceptDescription) - { - conceptDescription.Validate(results); - } - else if(referable is Submodel submodel) - { - submodel.Validate(results); - } - else if(referable is ISubmodelElement submodelElement) - { - submodelElement.Validate(results); - } - } - - public static void BaseValidation(this IReferable referable, AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check - if (string.IsNullOrEmpty(referable.IdShort)) - results.Add(new AasValidationRecord( - AasValidationSeverity.SpecViolation, referable, - "Referable: missing idShort", - () => - { - referable.IdShort = "TO_FIX"; - })); - - if (referable.Description != null && (referable.Description.Count < 1)) - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, referable, - "Referable: existing description with missing langString", - () => - { - referable.Description = null; - })); - } - - /// - /// Tells, if the IReferable is used with an index instead of idShort. - /// - public static bool IsIndexed(this IReferable rf) - { - return rf is SubmodelElementList; - } - - public static AasElementSelfDescription GetSelfDescription(this IReferable referable) - { - if (referable is AssetAdministrationShell) - { - return new AasElementSelfDescription("AssetAdministrationShell", "AAS", - KeyTypes.AssetAdministrationShell, null); - } - else if (referable is ConceptDescription) - { - return new AasElementSelfDescription("ConceptDescription", "CD", - KeyTypes.ConceptDescription, null); - } - else if (referable is Submodel) - { - return new AasElementSelfDescription("Submodel", "SM", - KeyTypes.Submodel, null); - } - else if (referable is Property) - { - return new AasElementSelfDescription("Property", "Prop", - KeyTypes.Property, AasSubmodelElements.Property); - } - else if (referable is MultiLanguageProperty) - { - return new AasElementSelfDescription("MultiLanguageProperty", "MLP", - KeyTypes.MultiLanguageProperty, AasSubmodelElements.MultiLanguageProperty); - } - else if(referable is AasCore.Aas3_0_RC02.Range) - { - return new AasElementSelfDescription("Range", "Range", - KeyTypes.Range, AasSubmodelElements.Range); - } - else if(referable is Blob) - { - return new AasElementSelfDescription("Blob", "Blob", - KeyTypes.Blob, AasSubmodelElements.Blob); - } - else if(referable is AasCore.Aas3_0_RC02.File) - { - return new AasElementSelfDescription("File", "File", - KeyTypes.File, AasSubmodelElements.File); - } - else if(referable is ReferenceElement) - { - return new AasElementSelfDescription("ReferenceElement", "Ref", - KeyTypes.ReferenceElement, AasSubmodelElements.ReferenceElement); - } - else if(referable is RelationshipElement) - { - return new AasElementSelfDescription("RelationshipElement", "Rel", - KeyTypes.RelationshipElement, AasSubmodelElements.RelationshipElement); - } - else if(referable is AnnotatedRelationshipElement) - { - return new AasElementSelfDescription("AnnotatedRelationshipElement", "RelA", - KeyTypes.AnnotatedRelationshipElement, AasSubmodelElements.AnnotatedRelationshipElement); - } - else if(referable is Capability) - { - return new AasElementSelfDescription("Capability", "Cap", - KeyTypes.Capability, AasSubmodelElements.Capability); - } - else if(referable is SubmodelElementCollection) - { - return new AasElementSelfDescription("SubmodelElementCollection", "SMC", - KeyTypes.SubmodelElementCollection, AasSubmodelElements.SubmodelElementCollection); - } - else if(referable is SubmodelElementList) - { - return new AasElementSelfDescription("SubmodelElementList", "SML", - KeyTypes.SubmodelElementList, AasSubmodelElements.SubmodelElementList); - } - else if(referable is Operation) - { - return new AasElementSelfDescription("Operation", "Opr", - KeyTypes.Operation, AasSubmodelElements.Operation); - } - else if(referable is Entity) - { - return new AasElementSelfDescription("Entity", "Ent", - KeyTypes.Entity, AasSubmodelElements.Entity); - } - else if(referable is BasicEventElement) - { - return new AasElementSelfDescription("BasicEventElement", "Evt", - - KeyTypes.BasicEventElement, AasSubmodelElements.BasicEventElement); - } - else if(referable is IDataElement) - { - return new AasElementSelfDescription("DataElement", "DE", - KeyTypes.DataElement, AasSubmodelElements.DataElement); - } - else if(referable is ISubmodelElement) - { - return new AasElementSelfDescription("SubmodelElement", "SME", - KeyTypes.SubmodelElement, AasSubmodelElements.SubmodelElement); - } - else - { - return new AasElementSelfDescription("Referable", "Ref", - KeyTypes.Referable, null); - } - } - public static void CollectReferencesByParent(this IReferable referable, List refs) - { - // access - if (refs == null) - return; - - // check, if this is identifiable - if (referable is IIdentifiable) - { - var idf = referable as IIdentifiable; - if (idf != null) - { - //var k = Key.CreateNew( - // idf.GetElementName(), true, idf.identification?.idType, idf.identification?.id); - - var key = new Key((KeyTypes)Stringification.KeyTypesFromString(idf.GetType().Name), idf.Id); - refs.Insert(0, key); - } - } - else - { - //var k = Key.CreateNew(this.GetElementName(), true, "IdShort", referable.IdShort); - var key = new Key((KeyTypes)Stringification.KeyTypesFromString(referable.GetType().Name), referable.IdShort); - refs.Insert(0, key); - // recurse upwards! - if (referable.Parent is IReferable prf) - prf.CollectReferencesByParent(refs); - } - } - public static void SetTimeStamp(this IReferable referable, DateTime timeStamp) - { - IReferable newReferable = referable; - do - { - newReferable.TimeStamp = timeStamp; - if (newReferable != newReferable.Parent) - { - newReferable = (IReferable)newReferable.Parent; - } - else - newReferable = null; - } - while (newReferable != null); - } - - public static bool EnumeratesChildren(this ISubmodelElement elem) - { - var num = elem.EnumerateChildren().Count(); - return (num > 0); - } - - public static IEnumerable EnumerateChildren(this IReferable referable) - { - if (referable is Submodel submodel && submodel.SubmodelElements != null) - { - if (submodel.SubmodelElements != null) - { - foreach (var submodelElement in submodel.SubmodelElements) - { - yield return submodelElement; - } - } - } - else if (referable is SubmodelElementCollection submodelElementCollection) - { - if (submodelElementCollection.Value != null) - { - foreach (var submodelElement in submodelElementCollection.Value) - { - yield return submodelElement; - } - } - } - else if (referable is SubmodelElementList submodelElementList) - { - if (submodelElementList.Value != null) - { - foreach (var submodelElement in submodelElementList.Value) - { - yield return submodelElement; - } - } - } - else if (referable is AnnotatedRelationshipElement annotatedRelationshipElement) - { - if (annotatedRelationshipElement.Annotations != null) - { - foreach (var submodelElement in annotatedRelationshipElement.Annotations) - { - yield return submodelElement; - } - } - } - else if (referable is Entity entity) - { - if (entity.Statements != null) - { - foreach (var submodelElement in entity.Statements) - { - yield return submodelElement; - } - } - } - else if (referable is Operation operation) - { - if (operation.InputVariables != null) - foreach (var inputVariable in operation.InputVariables) - { - yield return inputVariable.Value; - } - - if (operation.OutputVariables != null) - foreach (var outputVariable in operation.OutputVariables) - { - yield return outputVariable.Value; - } - - if (operation.InoutputVariables != null) - foreach (var inOutVariable in operation.InoutputVariables) - { - yield return inOutVariable.Value; - } - } - else - { - yield break; - } - } - - - public static void SetAllParentsAndTimestamps(this IReferable referable, IReferable parent, DateTime timeStamp, DateTime timeStampCreate) - { - if (parent == null) - return; - - referable.Parent = parent; - referable.TimeStamp = timeStamp; - referable.TimeStampCreate = timeStampCreate; - - foreach (var submodelElement in referable.EnumerateChildren()) - { - submodelElement.SetAllParentsAndTimestamps(referable, timeStamp, timeStampCreate); - } - } - - public static Submodel GetParentSubmodel(this IReferable referable) - { - IReferable parent = referable; - while (parent is not Submodel && parent != null) - parent = (IReferable)parent.Parent; - return parent as Submodel; - } - - public static string CollectIdShortByParent(this IReferable referable) - { - // recurse first - var head = ""; - if (referable is not IIdentifiable && referable.Parent is IReferable parentReferable) - // can go up - head = parentReferable.CollectIdShortByParent() + "/"; - // add own - var myid = ""; - if (string.IsNullOrEmpty(referable.IdShort)) - myid = referable.IdShort.Trim(); - // together - return head + myid; - } - - public static void AddDescription(this IReferable referable,string language, string Text) - { - if (referable.Description == null) - referable.Description = new List(); - referable.Description.Add(new LangString(language, Text)); - } - - public static List ListOfIReferableFrom( - System.Text.Json.Nodes.JsonNode node) - { - var res = new List(); - if (node == null) - return res; - var array = node.AsArray(); - foreach (var it in array) - { - var ir = Jsonization.Deserialize.IReferableFrom(it); - res.Add(ir); - } - return res; - } - - public static Key ToKey(this IReferable rf) - { - var sd = rf.GetSelfDescription(); - if (sd == null || !sd.KeyType.HasValue) - return null; - if (rf is IIdentifiable rfi) - return new Key(sd.KeyType.Value, rfi.Id); - return new Key(sd.KeyType.Value, rf.IdShort); - } - - public static System.Text.Json.Nodes.JsonNode ToJsonObject(List classes) - { - var jar = new System.Text.Json.Nodes.JsonArray(); - if (classes != null) - foreach (var c in classes) - jar.Add(Jsonization.Serialize.ToJsonObject(c)); - return jar; - } - - public static IEnumerable FindAllQualifierType(this IReferable rf, string qualifierType) - { - if (!(rf is IQualifiable rfq) || rfq.Qualifiers == null || qualifierType == null) - yield break; - foreach (var q in rfq.Qualifiers) - if (q.Type.Trim().ToLower() == qualifierType.Trim().ToLower()) - yield return q; - } - - public static Qualifier HasQualifierOfType(this IReferable rf, string qualifierType) - { - if (!(rf is IQualifiable rfq) || rfq.Qualifiers == null) - return null; - foreach (var q in rfq.Qualifiers) - if (q.Type?.Trim().ToLower() == qualifierType?.Trim().ToLower()) - return q; - return null; - } - - public static Qualifier Add(this IReferable rf, Qualifier q) - { - if (!(rf is IQualifiable rfq)) - return null; - if (rfq.Qualifiers == null) - rfq.Qualifiers = new List(); - rfq.Qualifiers.Add(q); - return q; - } - - public static IEnumerable FindAllExtensionName(this IReferable rf, string extensionName) - { - if (!(rf is IHasExtensions rfe) || rfe.Extensions == null) - yield break; - foreach (var e in rfe.Extensions) - if (e.Name?.Trim().ToLower() == extensionName?.Trim().ToLower()) - yield return e; - } - - - public static Extension HasExtensionOfName(this IReferable rf, string extensionName) - { - if (!(rf is IHasExtensions rfe) || rfe.Extensions == null) - return null; - foreach (var e in rfe.Extensions) - if (e.Name?.Trim().ToLower() == extensionName?.Trim().ToLower()) - return e; - return null; - } - - public static Extension Add(this IReferable rf, Extension ext) - { - if (rf.Extensions == null) - rf.Extensions = new List(); - rf.Extensions.Add(ext); - return ext; - } - - public static void MigrateV20QualifiersToExtensions(this IReferable rf) - { - // access - if (!(rf is IQualifiable iq) || iq.Qualifiers == null || !(rf is IHasExtensions ihe)) - return; - - // Qualifiers to migrate - var toMigrate = new[] { - "Animate.Args", "Plotting.Args", "TimeSeries.Args", "BOM.Args", "ImageMap.Args" - }; - - List toMove = new List(); - foreach (var q in iq.Qualifiers) - foreach (var tm in toMigrate) - if (q?.Type?.Equals(tm, StringComparison.InvariantCultureIgnoreCase) == true) - toMove.Add(q); - - // now move these - for (int i=0; i ToCaptionInfo(this ISubmodelElement submodelElement) - { - var caption = AdminShellUtil.EvalToNonNullString("\"{0}\" ", submodelElement.IdShort, ""); - var info = ""; - // TODO (MIHO, 2021-07-08): obvious error .. info should receive semanticId .. but would change - // display presentation .. therefore to be checked again - if (submodelElement.SemanticId != null) - AdminShellUtil.EvalToNonEmptyString("\u21e8 {0}", submodelElement.SemanticId.ToStringExtended(), ""); - return Tuple.Create(caption, info); - } - - public static void ValueFromText(this ISubmodelElement submodelElement, string text, string defaultLang = null) - { - switch(submodelElement) - { - case Property property: - { - property.ValueFromText(text); - break; - } - case MultiLanguageProperty multiLanguageProperty: - { - multiLanguageProperty.ValueFromText(text, defaultLang); - break; - } - default: - { - throw new Exception("Unhandled submodel element type"); - } - } - } - - #endregion - public static IEnumerable FindAllParents(this ISubmodelElement submodelElement, - Predicate p, - bool includeThis = false, bool includeSubmodel = false, - bool passOverMiss = false) - { - // call for this? - if (includeThis) - { - if (p == null || p.Invoke(submodelElement)) - yield return submodelElement; - else - if (!passOverMiss) - yield break; - } - - // daisy chain all parents .. - if (submodelElement.Parent != null) - { - if (submodelElement.Parent is ISubmodelElement psme) - { - foreach (var q in psme.FindAllParents(p, includeThis: true, - passOverMiss: passOverMiss)) - yield return q; - } - else if (includeSubmodel && submodelElement.Parent is Submodel psm) - { - if (p == null || p.Invoke(psm)) - yield return submodelElement; - } - } - } - - public static IEnumerable FindAllParentsWithSemanticId( - this ISubmodelElement submodelElement, Reference semId, - bool includeThis = false, bool includeSubmodel = false, bool passOverMiss = false) - { - return (FindAllParents(submodelElement, - (rf) => (true == (rf as IHasSemantics)?.SemanticId?.Matches(semId, - matchMode: MatchMode.Relaxed)), - includeThis: includeThis, includeSubmodel: includeSubmodel, passOverMiss: passOverMiss)); - } - - public static string ValueAsText(this ISubmodelElement submodelElement, string defaultLang = null) - { - //TODO:Need to check/test this logic again - if (submodelElement is Property property) - { - return property.ValueAsText(); - } - - if (submodelElement is MultiLanguageProperty multiLanguageProperty) - { - return multiLanguageProperty.ValueAsText(defaultLang); - } - - if (submodelElement is AasCore.Aas3_0_RC02.Range range) - { - return range.ValueAsText(); - } - - if (submodelElement is File file) - { - return file.ValueAsText(); - } - - return ""; - } - - public static Qualifier FindQualifierOfType(this ISubmodelElement submodelElement, string qualifierType) - { - if (submodelElement.Qualifiers == null || submodelElement.Qualifiers.Count == 0) - { - return null; - } - - foreach (var qualifier in submodelElement.Qualifiers) - { - if (qualifier.Type.Equals(qualifierType, StringComparison.OrdinalIgnoreCase)) - { - return qualifier; - } - } - - return null; - - } - - public static Reference GetModelReference(this ISubmodelElement sme, bool includeParents = true) - { - // this will be the tail of our chain - var keyList = new List(); - var keyType = ExtensionsUtil.GetKeyType(sme); - var key = new Key(keyType, sme.IdShort); - keyList.Add(key); - - // keys for Parents will be INSERTED in front, iteratively - var currentParent = sme.Parent; - while (includeParents && currentParent != null) - { - if (currentParent is IIdentifiable identifiable) - { - var currentParentKey = new Key(ExtensionsUtil.GetKeyType(identifiable), identifiable.Id); - keyList.Insert(0, currentParentKey); - currentParent = null; - } - else if (currentParent is IReferable referable) - { - var currentParentKey = new Key(ExtensionsUtil.GetKeyType(referable), referable.IdShort); - keyList.Insert(0, currentParentKey); - currentParent = referable.Parent; - } - - } - - var outputReference = new Reference(ReferenceTypes.ModelReference, keyList); - outputReference.ReferredSemanticId = sme.SemanticId; - return outputReference; - } - - public static IEnumerable FindDeep(this ISubmodelElement submodelElement) - { - if (submodelElement is T) - { - yield return (T)submodelElement; - } - - foreach (var x in submodelElement.Descend().OfType()) - yield return x; - - //if (submodelElement is SubmodelElementList sml && sml.Value != null) - // foreach (var ce in sml.Value) - // if (ce != null) - // foreach (var x in ce.FindDeep()) - // yield return x; - - //if (submodelElement is AnnotatedRelationshipElement arel && arel.Annotations != null) - // foreach (var x in arel.FindDeep()) - // yield return x; - - //if (submodelElement is Entity entity) - // foreach (var statement in entity.Statements) - // foreach (var x in statement.FindDeep()) - // yield return x; - - //if (submodelElement is Operation operation) - //{ - // var variableCollection = new SubmodelElementCollection(); - // variableCollection.Value = new List(); - // foreach (var inputVariable in operation.InputVariables) - // { - // variableCollection.Value.Add(inputVariable.Value); - // } - // foreach (var outputVariable in operation.OutputVariables) - // { - // variableCollection.Value.Add(outputVariable.Value); - // } - // foreach (var inOutVariable in operation.InoutputVariables) - // { - // variableCollection.Value.Add(inOutVariable.Value); - // } - // yield return (T)variableCollection.FindDeep(); - //} - } - - public static ISubmodelElement ConvertFromV10(this ISubmodelElement submodelElement, AdminShellV10.SubmodelElement sourceSubmodelElement, bool shallowCopy = false) - { - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelElement != null) - { - if (sourceSubmodelElement is AdminShellV10.SubmodelElementCollection collection) - { - var newSmeCollection = new SubmodelElementCollection(); - outputSubmodelElement = newSmeCollection.ConvertFromV10(collection, shallowCopy); - } - else if (sourceSubmodelElement is AdminShellV10.Property sourceProperty) - { - var newProperty = new Property(DataTypeDefXsd.String); - outputSubmodelElement = newProperty.ConvertFromV10(sourceProperty); - } - else if (sourceSubmodelElement is AdminShellV10.File sourceFile) - { - var newFile = new File(""); - outputSubmodelElement = newFile.ConvertFromV10(sourceFile); - } - else if (sourceSubmodelElement is AdminShellV10.Blob blob) - { - var newBlob = new Blob(""); - outputSubmodelElement = newBlob.ConvertFromV10(blob); - } - else if (sourceSubmodelElement is AdminShellV10.ReferenceElement sourceReferenceElement) - { - outputSubmodelElement = new ReferenceElement(); - } - else if (sourceSubmodelElement is AdminShellV10.RelationshipElement sourceRelationshipElement) - { - var newFirst = ExtensionsUtil.ConvertReferenceFromV10(sourceRelationshipElement.first, ReferenceTypes.ModelReference); - var newSecond = ExtensionsUtil.ConvertReferenceFromV10(sourceRelationshipElement.second, ReferenceTypes.ModelReference); - outputSubmodelElement = new RelationshipElement(newFirst, newSecond); - } - - if (sourceSubmodelElement is AdminShellV10.Operation sourceOperation) - { - var newInputVariables = new List(); - var newOutputVariables = new List(); - if (sourceOperation.valueIn != null) - { - - foreach (var inputVariable in sourceOperation.valueIn) - { - if (inputVariable.value.submodelElement != null) - { - ISubmodelElement newSubmodelElement = null; - newSubmodelElement = newSubmodelElement.ConvertFromV10(inputVariable.value.submodelElement); - var newOpVariable = new OperationVariable(newSubmodelElement); - newInputVariables.Add(newOpVariable); - } - } - } - if (sourceOperation.valueOut != null) - { - foreach (var outputVariable in sourceOperation.valueOut) - { - if (outputVariable.value.submodelElement != null) - { - ISubmodelElement newSubmodelElement = null; - newSubmodelElement = newSubmodelElement.ConvertFromV10(outputVariable.value.submodelElement); - var newOpVariable = new OperationVariable(newSubmodelElement); - newOutputVariables.Add(newOpVariable); - } - } - } - - outputSubmodelElement = new Operation(inputVariables: newInputVariables, outputVariables: newOutputVariables); - } - - - outputSubmodelElement.BasicConversionFromV10(sourceSubmodelElement); - } - - return outputSubmodelElement; - } - - private static void BasicConversionFromV10(this ISubmodelElement submodelElement, AdminShellV10.SubmodelElement sourceSubmodelElement) - { - if (!string.IsNullOrEmpty(sourceSubmodelElement.idShort)) - { - submodelElement.IdShort = sourceSubmodelElement.idShort; - } - - if (!string.IsNullOrEmpty(sourceSubmodelElement.category)) - { - submodelElement.Category = sourceSubmodelElement.category; - } - - if (sourceSubmodelElement.description != null) - { - submodelElement.Description = ExtensionsUtil.ConvertDescriptionFromV10(sourceSubmodelElement.description); - } - - if (sourceSubmodelElement.semanticId != null) - { - var keyList = new List(); - foreach (var refKey in sourceSubmodelElement.semanticId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - submodelElement.SemanticId = new Reference(ReferenceTypes.GlobalReference, keyList); - } - - if (sourceSubmodelElement.kind != null) - { - if (sourceSubmodelElement.kind.IsInstance) - { - submodelElement.Kind = ModelingKind.Instance; - } - else - { - submodelElement.Kind = ModelingKind.Template; - } - } - - if (sourceSubmodelElement.qualifiers != null && sourceSubmodelElement.qualifiers.Count != 0) - { - if (submodelElement.Qualifiers == null && submodelElement.Qualifiers.Count != 0) - { - submodelElement.Qualifiers = new List(); - } - - foreach (var sourceQualifier in sourceSubmodelElement.qualifiers) - { - var newQualifier = new Qualifier("", DataTypeDefXsd.String); - newQualifier = newQualifier.ConvertFromV10(sourceQualifier); - submodelElement.Qualifiers.Add(newQualifier); - } - } - - if (sourceSubmodelElement.hasDataSpecification != null) - { - //TODO: jtikekar : EmbeddedDataSpecification?? (as per old implementation) - if (submodelElement.EmbeddedDataSpecifications == null) - { - submodelElement.EmbeddedDataSpecifications = new List(); - } - foreach (var dataSpecification in sourceSubmodelElement.hasDataSpecification.reference) - { - submodelElement.EmbeddedDataSpecifications.Add( - new EmbeddedDataSpecification( - ExtensionsUtil.ConvertReferenceFromV10(dataSpecification, ReferenceTypes.GlobalReference), - null)); - } - } - } - - public static ISubmodelElement ConvertFromV20(this ISubmodelElement submodelElement, AdminShellV20.SubmodelElement sourceSubmodelElement, bool shallowCopy = false) - { - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelElement != null) - { - if (sourceSubmodelElement is AdminShellV20.SubmodelElementCollection collection) - { - var newSmeCollection = new SubmodelElementCollection(); - outputSubmodelElement = newSmeCollection.ConvertFromV20(collection, shallowCopy); - } - else if (sourceSubmodelElement is AdminShellV20.Property sourceProperty) - { - var newProperty = new Property(DataTypeDefXsd.String); - outputSubmodelElement = newProperty.ConvertFromV20(sourceProperty); - } - else if (sourceSubmodelElement is AdminShellV20.MultiLanguageProperty sourceMultiLangProp) - { - var newMultiLangProperty = new MultiLanguageProperty(); - outputSubmodelElement = newMultiLangProperty.ConvertFromV20(sourceMultiLangProp); - } - else if (sourceSubmodelElement is AdminShellV20.Range sourceRange) - { - var newRange = new AasCore.Aas3_0_RC02.Range(DataTypeDefXsd.String); - outputSubmodelElement = newRange.ConvertFromV20(sourceRange); - } - else if (sourceSubmodelElement is AdminShellV20.File sourceFile) - { - var newFile = new File(""); - outputSubmodelElement = newFile.ConvertFromV20(sourceFile); - } - else if (sourceSubmodelElement is AdminShellV20.Blob blob) - { - var newBlob = new Blob(""); - outputSubmodelElement = newBlob.ConvertFromV20(blob); - } - else if (sourceSubmodelElement is AdminShellV20.ReferenceElement sourceReferenceElement) - { - var newReference = ExtensionsUtil.ConvertReferenceFromV20(sourceReferenceElement.value, ReferenceTypes.ModelReference); - outputSubmodelElement = new ReferenceElement(value: newReference); - } - else if (sourceSubmodelElement is AdminShellV20.AnnotatedRelationshipElement sourceAnnotedRelationshipElement) - { - var newFirst = ExtensionsUtil.ConvertReferenceFromV20(sourceAnnotedRelationshipElement.first, ReferenceTypes.ModelReference); - var newSecond = ExtensionsUtil.ConvertReferenceFromV20(sourceAnnotedRelationshipElement.second, ReferenceTypes.ModelReference); - var newAnnotedRelElement = new AnnotatedRelationshipElement(newFirst, newSecond); - outputSubmodelElement = newAnnotedRelElement.ConvertAnnotationsFromV20(sourceAnnotedRelationshipElement); - } - else if (sourceSubmodelElement is AdminShellV20.RelationshipElement sourceRelationshipElement) - { - var newFirst = ExtensionsUtil.ConvertReferenceFromV20(sourceRelationshipElement.first, ReferenceTypes.ModelReference); - var newSecond = ExtensionsUtil.ConvertReferenceFromV20(sourceRelationshipElement.second, ReferenceTypes.ModelReference); - outputSubmodelElement = new RelationshipElement(newFirst, newSecond); - } - else if (sourceSubmodelElement is AdminShellV20.BasicEvent sourceBasicEvent) - { - var newObserved = ExtensionsUtil.ConvertReferenceFromV20(sourceBasicEvent.observed, ReferenceTypes.ModelReference); - - outputSubmodelElement = new BasicEventElement(newObserved, Direction.Input, StateOfEvent.Off); //TODO: jtikekar default values of enums - } - else if (sourceSubmodelElement is AdminShellV20.Entity sourceEntity) - { - var entityType = Stringification.EntityTypeFromString(sourceEntity.entityType); - var newEntity = new Entity(entityType ?? EntityType.CoManagedEntity); - outputSubmodelElement = newEntity.ConvertFromV20(sourceEntity); - } - else if (sourceSubmodelElement is AdminShellV20.Operation sourceOperation) - { - var newInputVariables = new List(); - var newOutputVariables = new List(); - var newInOutVariables = new List(); - if (sourceOperation.inputVariable != null) - { - - foreach (var inputVariable in sourceOperation.inputVariable) - { - if (inputVariable.value.submodelElement != null) - { - ISubmodelElement newSubmodelElement = null; - newSubmodelElement = newSubmodelElement.ConvertFromV20(inputVariable.value.submodelElement); - var newOpVariable = new OperationVariable(newSubmodelElement); - newInputVariables.Add(newOpVariable); - } - } - } - if (sourceOperation.outputVariable != null) - { - foreach (var outputVariable in sourceOperation.outputVariable) - { - if (outputVariable.value.submodelElement != null) - { - ISubmodelElement newSubmodelElement = null; - newSubmodelElement = newSubmodelElement.ConvertFromV20(outputVariable.value.submodelElement); - var newOpVariable = new OperationVariable(newSubmodelElement); - newOutputVariables.Add(newOpVariable); - } - } - } - - if (sourceOperation.inoutputVariable != null) - { - foreach (var inOutVariable in sourceOperation.inoutputVariable) - { - if (inOutVariable.value.submodelElement != null) - { - ISubmodelElement newSubmodelElement = null; - newSubmodelElement = newSubmodelElement.ConvertFromV20(inOutVariable.value.submodelElement); - var newOpVariable = new OperationVariable(newSubmodelElement); - newInOutVariables.Add(newOpVariable); - } - } - } - - outputSubmodelElement = new Operation(inputVariables: newInputVariables, outputVariables: newOutputVariables, inoutputVariables: newInOutVariables); - } - - outputSubmodelElement.BasicConversionFromV20(sourceSubmodelElement); - } - - return outputSubmodelElement; - } - - private static void BasicConversionFromV20(this ISubmodelElement submodelElement, AdminShellV20.SubmodelElement sourceSubmodelElement) - { - if (!string.IsNullOrEmpty(sourceSubmodelElement.idShort)) - submodelElement.IdShort = sourceSubmodelElement.idShort; - - if (!string.IsNullOrEmpty(sourceSubmodelElement.category)) - submodelElement.Category = sourceSubmodelElement.category; - - if (sourceSubmodelElement.description != null) - submodelElement.Description = ExtensionsUtil.ConvertDescriptionFromV20(sourceSubmodelElement.description); - - if (sourceSubmodelElement.semanticId != null) - { - var keyList = new List(); - foreach (var refKey in sourceSubmodelElement.semanticId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - // DECISION: After phone call with Birgit, set all CD to GlobalReference - // assuming it is always a external concept - if (keyType == KeyTypes.ConceptDescription) - keyType = KeyTypes.GlobalReference; - - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - submodelElement.SemanticId = new Reference(ReferenceTypes.GlobalReference, keyList); - } - - if (sourceSubmodelElement.kind != null) - { - if (sourceSubmodelElement.kind.IsInstance) - submodelElement.Kind = ModelingKind.Instance; - else - submodelElement.Kind = ModelingKind.Template; - } - - if (sourceSubmodelElement.qualifiers != null && sourceSubmodelElement.qualifiers.Count != 0) - { - if (submodelElement.Qualifiers == null || submodelElement.Qualifiers.Count == 0) - submodelElement.Qualifiers = new List(); - - foreach (var sourceQualifier in sourceSubmodelElement.qualifiers) - { - var newQualifier = new Qualifier("", DataTypeDefXsd.String); - newQualifier = newQualifier.ConvertFromV20(sourceQualifier); - submodelElement.Qualifiers.Add(newQualifier); - } - } - - if (sourceSubmodelElement.hasDataSpecification != null) - { - //TODO: jtikekar : EmbeddedDataSpecification?? (as per old implementation) - if (submodelElement.EmbeddedDataSpecifications == null) - submodelElement.EmbeddedDataSpecifications = new List(); - - //TODO: jtikekar: DataSpecificationContent?? (as per old implementation) - foreach (var sourceDataSpec in sourceSubmodelElement.hasDataSpecification) - { - submodelElement.EmbeddedDataSpecifications.Add( - new EmbeddedDataSpecification( - ExtensionsUtil.ConvertReferenceFromV20(sourceDataSpec.dataSpecification, ReferenceTypes.GlobalReference), - null)); - } - } - - // move Qualifiers to Extensions - submodelElement.MigrateV20QualifiersToExtensions(); - } - - #region List - - public static IReferable FindReferableByReference( - this List submodelElements, Reference rf, int keyIndex) - { - return FindReferableByReference(submodelElements, rf?.Keys, keyIndex); - } - - public static IReferable FindReferableByReference( - this List submodelElements, List keys, int keyIndex) - { - // first index needs to exist .. - if (submodelElements == null || keys == null || keyIndex >= keys.Count) - return null; - - - // over all wrappers - foreach (var smw in submodelElements) - if (smw != null && smw.IdShort.Equals(keys[keyIndex].Value, StringComparison.OrdinalIgnoreCase)) - { - // match on this level. Did we find a leaf element? - if ((keyIndex + 1) >= keys.Count) - return smw; - - // dive into SMC? - if (smw is SubmodelElementCollection smc) - { - var found = FindReferableByReference(smc.Value, keys, keyIndex + 1); - if (found != null) - return found; - } - // dive into SML? - if (smw is SubmodelElementList submodelElementList) - { - var found = FindReferableByReference(submodelElementList.Value, keys, keyIndex + 1); - if (found != null) - return found; - } - - // dive into AnnotedRelationshipElement? - if (smw is AnnotatedRelationshipElement annotatedRelationshipElement) - { - var annotations = new List(annotatedRelationshipElement.Annotations); - var found = FindReferableByReference(annotations, keys, keyIndex + 1); - if (found != null) - return found; - } - - // dive into Entity statements? - if (smw is Entity ent) - { - var found = FindReferableByReference(ent.Statements, keys, keyIndex + 1); - if (found != null) - return found; - } - - // else: - return null; - } - - // no? - return null; - } - - public static IEnumerable FindDeep(this List submodelElements, Predicate match = null) where T : ISubmodelElement - { - foreach (var smw in submodelElements) - { - var current = smw; - if (current == null) - continue; - - // call lambda for this element - if (current is T) - if (match == null || match.Invoke((T)current)) - yield return (T)current; - - // dive into? - // TODO (MIHO, 2020-07-31): would be nice to use IEnumerateChildren for this .. - if (current is SubmodelElementCollection smc && smc.Value != null) - foreach (var x in smc.Value.FindDeep(match)) - yield return x; - - if (current is AnnotatedRelationshipElement are && are.Annotations != null) - { - var annotationsList = new List(are.Annotations); - foreach (var x in annotationsList.FindDeep(match)) - yield return x; - } - - if (current is Entity ent && ent.Statements != null) - foreach (var x in ent.Statements.FindDeep(match)) - yield return x; - - if (current is Operation op) - { - var operationVariables = new List(); - foreach(var opVariable in op.InputVariables) - { - operationVariables.Add(opVariable.Value); - } - - foreach(var opVariable in op.InoutputVariables) - { - operationVariables.Add(opVariable.Value); - } - - foreach(var opVariable in op.OutputVariables) - { - operationVariables.Add(opVariable.Value); - } - - foreach (var x in operationVariables.FindDeep(match)) - yield return x; - } - } - } - - public static void CopyManySMEbyCopy(this List submodelElements, ConceptDescription destCD, - List sourceSmc, ConceptDescription sourceCD, - bool createDefault = false, Action setDefault = null, - MatchMode matchMode = MatchMode.Relaxed) where T : ISubmodelElement - { - submodelElements.CopyManySMEbyCopy(destCD.GetSingleKey(), sourceSmc, sourceCD.GetSingleKey(), - createDefault ? destCD : null, setDefault, matchMode); - } - - public static void CopyManySMEbyCopy(this List submodelElements, Key destSemanticId, - List sourceSmc, Key sourceSemanticId, - ConceptDescription createDefault = null, Action setDefault = null, - MatchMode matchMode = MatchMode.Relaxed) where T : ISubmodelElement - { - // bool find possible sources - bool foundSrc = false; - if (sourceSmc == null) - return; - foreach (var src in sourceSmc.FindAllSemanticIdAs(sourceSemanticId, matchMode)) - { - // type of found src? - AasSubmodelElements aeSrc = (AasSubmodelElements)Enum.Parse(typeof(AasSubmodelElements), src.GetType().Name); - - // ok? - if (src == null || aeSrc == AasSubmodelElements.SubmodelElement) - continue; - foundSrc = true; - - // ok, create new one - var dst = AdminShellNS.AdminShellUtil.CreateSubmodelElementFromEnum(aeSrc, src); - if (dst != null) - { - // make same things sure - dst.IdShort = src.IdShort; - dst.Category = src.Category; - dst.SemanticId = new Reference(ReferenceTypes.ModelReference, new List() { destSemanticId}); - - // instantanously add it? - submodelElements.Add(dst); - } - } - - // default? - if (createDefault != null && !foundSrc) - { - // ok, default - var dflt = submodelElements.CreateSMEForCD(createDefault, addSme: true); - - // set default? - setDefault?.Invoke(dflt); - } - } - - public static T CopyOneSMEbyCopy(this List submodelElements, ConceptDescription destCD, - List sourceSmc, Key[] sourceKeys, - bool createDefault = false, Action setDefault = null, - MatchMode matchMode = MatchMode.Relaxed, - string idShort = null, bool addSme = false) where T : ISubmodelElement - { - return submodelElements.CopyOneSMEbyCopy(destCD?.GetSingleKey(), sourceSmc, sourceKeys, - createDefault ? destCD : null, setDefault, matchMode, idShort, addSme); - } - - public static T CopyOneSMEbyCopy(this List submodelELements, ConceptDescription destCD, - List sourceSmc, ConceptDescription sourceCD, - bool createDefault = false, Action setDefault = null, - MatchMode matchMode = MatchMode.Relaxed, - string idShort = null, bool addSme = false) where T : ISubmodelElement - { - return submodelELements.CopyOneSMEbyCopy(destCD?.GetSingleKey(), sourceSmc, new[] { sourceCD?.GetSingleKey() }, - createDefault ? destCD : null, setDefault, matchMode, idShort, addSme); - } - - public static T CopyOneSMEbyCopy(this List submodelElements, Key destSemanticId, - List sourceSmc, Key[] sourceSemanticId, - ConceptDescription createDefault = null, Action setDefault = null, - MatchMode matchMode = MatchMode.Relaxed, - string idShort = null, bool addSme = false) where T : ISubmodelElement - { - // get source - var src = sourceSmc.FindFirstAnySemanticIdAs(sourceSemanticId, matchMode); - - // may be make an adaptive conversion - if (src == null) - { - var anySrc = sourceSmc?.FindFirstAnySemanticId(sourceSemanticId, matchMode: matchMode); - src = submodelElements.AdaptiveConvertTo(anySrc, createDefault, - idShort: idShort, addSme: false); - } - - // proceed - AasSubmodelElements aeSrc = (AasSubmodelElements)Enum.Parse(typeof(AasSubmodelElements), src?.GetType().Name); - if (src == null || aeSrc == AasSubmodelElements.SubmodelElement) - { - // create a default? - if (createDefault == null) - return default(T); - - // ok, default - var dflt = submodelElements.CreateSMEForCD(createDefault, idShort: idShort, addSme: addSme); - - // set default? - setDefault?.Invoke(dflt); - - // return - return dflt; - } - - // ok, create new one - var dst = AdminShellNS.AdminShellUtil.CreateSubmodelElementFromEnum(aeSrc, src); - if (dst == null) - return default(T); - - // make same things sure - dst.IdShort = src.IdShort; - dst.Category = src.Category; - dst.SemanticId = new Reference(ReferenceTypes.ModelReference, new List() { destSemanticId}); - - // instantanously add it? - if (addSme) - submodelElements.Add(dst); - - // give back - return (T)dst; - } - - public static T AdaptiveConvertTo(this List submodelElements, - ISubmodelElement anySrc, - ConceptDescription createDefault = null, - string idShort = null, bool addSme = false) where T : ISubmodelElement - { - if (typeof(T) == typeof(MultiLanguageProperty) - && anySrc is Property srcProp) - { - var res = submodelElements.CreateSMEForCD(createDefault, idShort: idShort, addSme: addSme); - if (res is MultiLanguageProperty mlp) - { - mlp.Value = new List() { new LangString("EN?", srcProp.Value) }; - mlp.ValueId = srcProp.ValueId; - return res; - } - } - - if (typeof(T) == typeof(Property) - && anySrc is MultiLanguageProperty srcMlp) - { - var res = submodelElements.CreateSMEForCD(createDefault, idShort: idShort, addSme: addSme); - if (res is Property prp) - { - prp.Value = "" + srcMlp.Value?.GetDefaultString(); - prp.ValueId = srcMlp.ValueId; - return res; - } - } - - return default(T); - } - - public static IEnumerable FindAllIdShort(this List submodelElements, - string idShort) - { - foreach (var smw in submodelElements) - if (smw != null) - if (smw.IdShort.Trim().ToLower() == idShort.Trim().ToLower()) - yield return smw; - } - - public static IEnumerable FindAllIdShortAs(this List submodelElements, - string idShort) where T : class, ISubmodelElement - { - foreach (var smw in submodelElements) - if (smw is T) - if (smw.IdShort.Trim().ToLower() == idShort.Trim().ToLower()) - yield return smw as T; - } - - public static ISubmodelElement FindFirstIdShort(this List submodelElements, - string idShort) - { - return submodelElements.FindAllIdShort(idShort)?.FirstOrDefault(); - } - - public static T FindFirstIdShortAs(this List submodelElements, - string idShort) where T : class, ISubmodelElement - { - return submodelElements.FindAllIdShortAs(idShort)?.FirstOrDefault(); - } - - - public static ISubmodelElement FindFirstAnySemanticId(this List submodelElements, - Key[] semId, Type[] allowedTypes = null, MatchMode matchMode = MatchMode.Strict) - { - if (semId == null) - return null; - foreach (var si in semId) - { - var found = submodelElements.FindAllSemanticId(si, allowedTypes, matchMode)? - .FirstOrDefault(); - if (found != null) - return found; - } - return null; - } - - public static T FindFirstAnySemanticIdAs(this List submodelElements, Key[] semId, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - if (semId == null) - return default(T); - foreach (var si in semId) - { - var found = submodelElements.FindAllSemanticIdAs(si, matchMode).FirstOrDefault(); - if (found != null) - return found; - } - return default(T); - } - - public static T CreateNew(string idShort = null, string category = null, Reference semanticId = null) - where T : ISubmodelElement, new() - { - var res = new T(); - if (idShort != null) - res.IdShort = idShort; - if (category != null) - res.Category = category; - if (semanticId != null) - res.SemanticId = semanticId.Copy(); - return res; - } - - public static T CreateSMEForCD(this List submodelELements, ConceptDescription conceptDescription, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false, bool isTemplate = false) - where T : ISubmodelElement - { - // access - if (conceptDescription == null) - return default(T); - - // fin type enum - var smeType = AdminShellUtil.AasSubmodelElementsFrom(); - if (!smeType.HasValue) - return default(T); - - // try to potentially figure out idShort - var ids = conceptDescription.IdShort; - - //TODO:jtikekar Temporarily removed - if ((ids == null || ids.Trim() == "") && conceptDescription.GetIEC61360() != null) - ids = conceptDescription.GetIEC61360().ShortName? - .GetDefaultString(); - - if (idShort != null) - ids = idShort; - - if (ids == null) - return default(T); - - // unique? - if (idxTemplate != null) - ids = submodelELements.IterateIdShortTemplateToBeUnique(idxTemplate, maxNum); - - // make a new instance - var semanticId = conceptDescription.GetCdReference(); - ISubmodelElement sme = AdminShellUtil.CreateSubmodelElementFromEnum(smeType.Value); - if (sme == null) - return default(T); - sme.IdShort = ids; - sme.SemanticId = semanticId.Copy(); - if (category != null) - sme.Category = category; - if (isTemplate) - sme.Kind = ModelingKind.Template; - - // if its a SMC, make sure its accessible - if (sme is SubmodelElementCollection smc) - smc.Value = new List(); - - // instantanously add it? - if (addSme) - submodelELements.Add(sme); - - // give back - return (T)sme; - } - - public static IEnumerable FindAllSemanticIdAs(this List submodelELements, Key semId, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - foreach (var submodelElement in submodelELements) - if (submodelElement != null && submodelElement is T - && submodelElement.SemanticId != null) - if (submodelElement.SemanticId.MatchesExactlyOneKey(semId, matchMode)) - yield return (T)submodelElement; - } - - public static IEnumerable FindAllSemanticIdAs(this List submodelELements, - Reference semId, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - foreach (var submodelElement in submodelELements) - if (submodelElement != null && submodelElement is T - && submodelElement.SemanticId != null) - if (submodelElement.SemanticId.Matches(semId, matchMode)) - yield return (T)submodelElement; - } - - public static T FindFirstSemanticIdAs(this List submodelElements, - Key semId, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - return submodelElements.FindAllSemanticIdAs(semId, matchMode).FirstOrDefault(); - } - - public static T FindFirstSemanticIdAs(this List submodelElements, - Reference semId, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - return submodelElements.FindAllSemanticIdAs(semId, matchMode).FirstOrDefault(); - } - - public static void RecurseOnReferables(this List submodelElements, object state, List parents, - Func, IReferable, bool> lambda) - { - if (lambda == null) - return; - if (parents == null) - parents = new List(); - - // over all elements - foreach (var submodelElement in submodelElements) - { - var current = submodelElement; - if (current == null) - continue; - - // call lambda for this element - // AND decide, if to recurse! - var goDeeper = lambda(state, parents, current); - - if (goDeeper) - { - // add to parents - parents.Add(current); - - // dive into? - if (current is SubmodelElementCollection smc) - smc.Value?.RecurseOnReferables(state, parents, lambda); - - if (current is Entity ent) - ent.Statements?.RecurseOnReferables(state, parents, lambda); - - if (current is Operation operation) - { - SubmodelElementCollection opVariableCollection = new SubmodelElementCollection(); - foreach (var inputVariable in operation.InputVariables) - { - opVariableCollection.Value.Add(inputVariable.Value); - } - - foreach (var outputVariable in operation.OutputVariables) - { - opVariableCollection.Value.Add(outputVariable.Value); - } - - foreach (var inOutVariable in operation.InoutputVariables) - { - opVariableCollection.Value.Add(inOutVariable.Value); - } - - opVariableCollection.Value.RecurseOnReferables(state, parents, lambda); - } - - if (current is AnnotatedRelationshipElement annotatedRelationshipElement) - { - var annotationElements = new List(); - if (annotatedRelationshipElement.Annotations != null) - foreach (var annotation in annotatedRelationshipElement.Annotations) - { - annotationElements.Add(annotation); - } - annotationElements.RecurseOnReferables(state, parents, lambda); - } - - // remove from parents - parents.RemoveAt(parents.Count - 1); - } - } - } - - public static void RecurseOnSubmodelElements(this List submodelElements, object state, List parents, Action, ISubmodelElement> lambda) - { - // trivial - if (lambda == null) - return; - if (parents == null) - parents = new List(); - - // over all elements - foreach (var smw in submodelElements) - { - var current = smw; - if (current == null) - continue; - - // call lambda for this element - lambda(state, parents, current); - - // add to parents - parents.Add(current); - - // dive into? - if (current is SubmodelElementCollection smc) - smc.Value?.RecurseOnSubmodelElements(state, parents, lambda); - - if (current is Entity ent) - ent.Statements?.RecurseOnSubmodelElements(state, parents, lambda); - - if (current is Operation operation) - { - SubmodelElementCollection opVariableCollection = new SubmodelElementCollection(); - foreach (var inputVariable in operation.InputVariables) - { - opVariableCollection.Value.Add(inputVariable.Value); - } - - foreach (var outputVariable in operation.OutputVariables) - { - opVariableCollection.Value.Add(outputVariable.Value); - } - - foreach (var inOutVariable in operation.InoutputVariables) - { - opVariableCollection.Value.Add(inOutVariable.Value); - } - - opVariableCollection.Value.RecurseOnSubmodelElements(state, parents, lambda); - } - - if (current is AnnotatedRelationshipElement annotatedRelationshipElement) - { - var annotationElements = new List(); - foreach (var annotation in annotatedRelationshipElement.Annotations) - { - annotationElements.Add(annotation); - } - annotationElements.RecurseOnSubmodelElements(state, parents, lambda); - } - - // remove from parents - parents.RemoveAt(parents.Count - 1); - } - } - - public static IEnumerable FindAllSemanticIdAs(this List submodelELements, string semanticId) where T : ISubmodelElement - { - foreach (var submodelElement in submodelELements) - { - if (submodelElement != null && submodelElement is T && submodelElement.SemanticId != null) - { - if (submodelElement.SemanticId.Matches(semanticId)) - { - yield return (T)submodelElement; - } - } - } - } - - public static T FindFirstSemanticIdAs(this List submodelELements, string semanticId) where T : ISubmodelElement - { - return submodelELements.FindAllSemanticIdAs(semanticId).FirstOrDefault(); - } - - public static T FindFirstAnySemanticIdAs(this List submodelELements, string[] semanticIds) where T : ISubmodelElement - { - if (semanticIds == null) - return default; - foreach (var semanticId in semanticIds) - { - var found = submodelELements.FindFirstSemanticIdAs(semanticId); - if (found != null) - return found; - } - return default; - } - - public static IEnumerable FindAllSemanticId( - this List smes, - string[] allowedSemanticIds, - bool invertedAllowed = false) where T : ISubmodelElement - { - if (allowedSemanticIds == null || allowedSemanticIds.Length < 1) - yield break; - - foreach (var sme in smes) - { - if (sme == null || !(sme is T)) - continue; - - if (sme.SemanticId == null || sme.SemanticId.Keys.Count < 1) - { - if (invertedAllowed) - yield return (T)sme; - continue; - } - - var found = false; - foreach (var semanticId in allowedSemanticIds) - if (sme.SemanticId.Matches(semanticId)) - { - found = true; - break; - } - - if (invertedAllowed) - found = !found; - - if (found) - yield return (T)sme; - } - } - - public static T FindFirstAnySemanticId(this List submodelElements, string[] allowedSemanticIds, bool invertAllowed = false) where T : ISubmodelElement - { - return submodelElements.FindAllSemanticId(allowedSemanticIds, invertAllowed).FirstOrDefault(); - } - - public static IEnumerable FindAllSemanticId( - this List smes, - Key[] allowedSemanticIds, MatchMode mm = MatchMode.Strict, - bool invertedAllowed = false) where T : ISubmodelElement - { - if (allowedSemanticIds == null || allowedSemanticIds.Length < 1) - yield break; - - foreach (var sme in smes) - { - if (sme == null || !(sme is T)) - continue; - - if (sme.SemanticId == null || sme.SemanticId.Keys.Count < 1) - { - if (invertedAllowed) - yield return (T)sme; - continue; - } - - var found = false; - foreach (var semanticId in allowedSemanticIds) - if (sme.SemanticId.MatchesExactlyOneKey(semanticId, mm)) - { - found = true; - break; - } - - if (invertedAllowed) - found = !found; - - if (found) - yield return (T)sme; - } - } - - public static T FindFirstAnySemanticId( - this List submodelElements, - Key[] allowedSemanticIds, MatchMode mm = MatchMode.Strict, - bool invertAllowed = false) where T : ISubmodelElement - { - return submodelElements.FindAllSemanticId(allowedSemanticIds, mm, invertAllowed).FirstOrDefault(); - } - - public static IEnumerable FindAllSemanticId( - this List submodelElements, Key semId, - Type[] allowedTypes = null, - MatchMode matchMode = MatchMode.Strict) - { - foreach (var smw in submodelElements) - if (smw != null && smw.SemanticId != null) - { - if (smw == null) - continue; - - if (allowedTypes != null) - { - var smwt = smw.GetType(); - if (!allowedTypes.Contains(smwt)) - continue; - } - - if (smw.SemanticId.MatchesExactlyOneKey(semId, matchMode)) - yield return smw; - } - } - - public static ISubmodelElement FindFirstSemanticId(this List submodelElements, Key semId, Type[] allowedTypes = null, MatchMode matchMode = MatchMode.Strict) - { - return submodelElements.FindAllSemanticId(semId, allowedTypes, matchMode)?.FirstOrDefault(); - } - - public static IEnumerable FindAllSemanticIdAs( - this List smes, - ConceptDescription cd, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - foreach (var x in FindAllSemanticIdAs(smes, cd.GetReference(), matchMode)) - yield return x; - } - - public static T FindFirstSemanticIdAs( - this List smes, - ConceptDescription cd, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - return smes.FindAllSemanticIdAs(cd, matchMode).FirstOrDefault(); - } - - - public static string IterateIdShortTemplateToBeUnique(this List submodelElements, string idShortTemplate, int maxNum) - { - if (idShortTemplate == null || maxNum < 1 || !idShortTemplate.Contains("{0")) - return null; - - int i = 1; - while (i < maxNum) - { - var ids = string.Format(idShortTemplate, i); - if (submodelElements.CheckIdShortIsUnique(ids)) - return ids; - i++; - } - - return null; - } - - public static bool CheckIdShortIsUnique(this List submodelElements, string idShort) - { - idShort = idShort?.Trim(); - if (idShort == null || idShort.Length < 1) - return false; - - var res = true; - foreach (var smw in submodelElements) - if (smw != null && smw.IdShort != null && smw.IdShort == idShort) - { - res = false; - break; - } - - return res; - } - - #endregion - - public static ISubmodelElement UpdateFrom(this ISubmodelElement elem, ISubmodelElement source) - { - if (source == null) - return elem; - - // IReferable - elem.Category = source.Category; - elem.IdShort = source.IdShort; - elem.DisplayName = source.DisplayName?.Copy(); - elem.Description = source.Description?.Copy(); - elem.Checksum = source.Checksum; - - // IHasKind - if (source.Kind.HasValue) - elem.Kind = source.Kind.Value; - - // IHasSemantics - if (source.SemanticId != null) - elem.SemanticId = source.SemanticId.Copy(); - if (source.SupplementalSemanticIds != null) - elem.SupplementalSemanticIds = source.SupplementalSemanticIds.Copy(); - - // IQualifiable - if (source.Qualifiers != null) - elem.Qualifiers = source.Qualifiers.Copy(); - - // IHasDataSpecification - if (source.EmbeddedDataSpecifications != null) - elem.EmbeddedDataSpecifications = source.EmbeddedDataSpecifications.Copy(); - - return elem; - } - - // - // Factories - // - - private static readonly Dictionary AasSubmodelElementsToAbbrev = ( - new Dictionary() - { - { AasSubmodelElements.AnnotatedRelationshipElement, "RelA" }, - { AasSubmodelElements.BasicEventElement, "BEvt" }, - { AasSubmodelElements.Blob, "Blob" }, - { AasSubmodelElements.Capability, "Cap" }, - { AasSubmodelElements.DataElement, "DE" }, - { AasSubmodelElements.Entity, "Ent" }, - { AasSubmodelElements.EventElement, "Evt" }, - { AasSubmodelElements.File, "File" }, - { AasSubmodelElements.MultiLanguageProperty, "MLP" }, - { AasSubmodelElements.Operation, "Opr" }, - { AasSubmodelElements.Property, "Prop" }, - { AasSubmodelElements.Range, "Range" }, - { AasSubmodelElements.ReferenceElement, "Ref" }, - { AasSubmodelElements.RelationshipElement, "Rel" }, - { AasSubmodelElements.SubmodelElement, "SME" }, - { AasSubmodelElements.SubmodelElementList, "SML" }, - { AasSubmodelElements.SubmodelElementCollection, "SMC" } - }); - - /// - /// Retrieve the string abbreviation of . - /// - /// - /// If is not a valid literal, return null. - /// - public static string? ToString(AasSubmodelElements? that) - { - if (!that.HasValue) - { - return null; - } - else - { - if (AasSubmodelElementsToAbbrev.TryGetValue(that.Value, out string? value)) - { - return value; - } - else - { - return null; - } - } - } - - private static readonly Dictionary _aasSubmodelElementsFromAbbrev = ( - new Dictionary() - { - { "RelA", AasSubmodelElements.AnnotatedRelationshipElement }, - { "BEvt", AasSubmodelElements.BasicEventElement }, - { "Blob", AasSubmodelElements.Blob }, - { "Cap", AasSubmodelElements.Capability }, - { "DE", AasSubmodelElements.DataElement }, - { "Ent", AasSubmodelElements.Entity }, - { "Evt", AasSubmodelElements.EventElement }, - { "File", AasSubmodelElements.File }, - { "MLP", AasSubmodelElements.MultiLanguageProperty }, - { "Opr", AasSubmodelElements.Operation }, - { "Prop", AasSubmodelElements.Property }, - { "Range", AasSubmodelElements.Range }, - { "Ref", AasSubmodelElements.ReferenceElement }, - { "Rel", AasSubmodelElements.RelationshipElement }, - { "SME", AasSubmodelElements.SubmodelElement }, - { "SML", AasSubmodelElements.SubmodelElementList }, - { "SMC", AasSubmodelElements.SubmodelElementCollection } - }); - - /// - /// Parse the string abbreviation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static AasSubmodelElements? AasSubmodelElementsFromAbbrev(string text) - { - if (_aasSubmodelElementsFromAbbrev.TryGetValue(text, out AasSubmodelElements value)) - { - return value; - } - else - { - return null; - } - } - - /// - /// Parse the string representation or the abbreviation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static AasSubmodelElements? AasSubmodelElementsFromStringOrAbbrev(string text) - { - var res = Stringification.AasSubmodelElementsFromString(text); - if (res.HasValue) - return res; - - return AasSubmodelElementsFromAbbrev(text); - } - - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendKey.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendKey.cs deleted file mode 100644 index 141308e50..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendKey.cs +++ /dev/null @@ -1,229 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AasxCompatibilityModels; -using AdminShellNS; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; -using System.Text.RegularExpressions; - -namespace Extensions -{ - public static class ExtendKey - { - public static Key CreateFrom(Reference r) - { - if (r == null || r.Count() != 1) - return null; - return r.Keys[0].Copy(); - } - - public static bool Matches(this Key key, - KeyTypes type, string id, MatchMode matchMode = MatchMode.Strict) - { - if (matchMode == MatchMode.Strict) - return key.Type == type && key.Value == id; - - if (matchMode == MatchMode.Relaxed) - return (key.Type == type || key.Type == KeyTypes.GlobalReference || type == KeyTypes.GlobalReference) - && key.Value == id; - - if (matchMode == MatchMode.Identification) - return key.Value == id; - - return false; - } - public static bool Matches(this Key key, Key otherKey) - { - if (otherKey == null) - { - return false; - } - - if (key.Type == otherKey.Type && key.Value.Equals(otherKey.Value)) - { - return true; - } - - return false; - } - - public static bool Matches(this Key key, Key otherKey, MatchMode matchMode = MatchMode.Strict) - { - if (matchMode == MatchMode.Strict) - return key.Type == otherKey.Type && key.Value == otherKey.Value; - - if (matchMode == MatchMode.Relaxed) - return (key.Type == otherKey.Type || key.Type == KeyTypes.GlobalReference || otherKey.Type == KeyTypes.GlobalReference) - && (key.Value == otherKey.Value); - - if (matchMode == MatchMode.Identification) - return key.Value == otherKey.Value; - - return false; - } - - public static bool MatchesSetOfTypes(this Key key, IEnumerable set) - { - foreach (var kt in set) - if (key.Type == kt) - return true; - return false; - } - - - public static AasValidationAction Validate(this Key key, AasValidationRecordList results, IReferable container) - { - // access - if (results == null || container == null) - return AasValidationAction.No; - - var res = AasValidationAction.No; - - // check - if (key == null) - { - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SpecViolation, container, - "Key: is null", - () => - { - res = AasValidationAction.ToBeDeleted; - })); - } - else - { - - // check type - var tf = AdminShellUtil.CheckIfInConstantStringArray(Enum.GetNames(typeof(KeyTypes)), Stringification.ToString(key.Type)); - if (tf == AdminShellUtil.ConstantFoundEnum.No) - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - "Key: type is not in allowed enumeration values", - () => - { - key.Type = KeyTypes.GlobalReference; - })); - if (tf == AdminShellUtil.ConstantFoundEnum.AnyCase) - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - "Key: type in wrong casing", - () => - { - //NO IdType in V3 - //key.idType = AdminShellUtil.CorrectCasingForConstantStringArray( - // KeyElements, key.type); - })); - } - - // may give result "to be deleted" - return res; - } - - - - public static string ToStringExtended(this Key key, int format = 1) - { - if (format == 2) - return "" + key.Value; - return $"[{key.Type}, {key.Value}]"; - } - - public static bool IsAbsolute(this Key key) - { - return key.Type == KeyTypes.GlobalReference || key.Type == KeyTypes.AssetAdministrationShell || key.Type == KeyTypes.Submodel; - } - - public static Key Parse(string cell, KeyTypes typeIfNotSet = KeyTypes.GlobalReference, - bool allowFmtAll = false, bool allowFmt0 = false, - bool allowFmt1 = false, bool allowFmt2 = false) - { - // access and defaults? - if (cell == null || cell.Trim().Length < 1) - return null; - - // format == 1 - if (allowFmtAll || allowFmt1) - { - var m = Regex.Match(cell, @"\((\w+)\)( ?)(.*)$"); - if (m.Success) - { - return new Key( - Stringification.KeyTypesFromString(m.Groups[1].ToString()) ?? KeyTypes.GlobalReference, - m.Groups[3].ToString()); - } - } - - // format == 2 - if (allowFmtAll || allowFmt2) - { - var m = Regex.Match(cell, @"( ?)(.*)$"); - if (m.Success) - { - return new Key( - typeIfNotSet, m.Groups[2].ToString()); - } - } - - // format == 0 - if (allowFmtAll || allowFmt0) - { - var m = Regex.Match(cell, @"\[(\w+),( ?)(.*)\]"); - if (m.Success) - { - return new Key( - Stringification.KeyTypesFromString(m.Groups[1].ToString()) ?? KeyTypes.GlobalReference, - m.Groups[3].ToString()); - } - } - - // no - return null; - } - - // ------------------------------------------------------------------------------------------------------------- - #region Handling with enums for KeyTypes - - // see: https://stackoverflow.com/questions/27372816/how-to-read-the-value-for-an-enummember-attribute - //public static string? GetEnumMemberValue(this T value) - // where T : Enum - //{ - // return typeof(T) - // .GetTypeInfo() - // .DeclaredMembers - // .SingleOrDefault(x => x.Name == value.ToString()) - // ?.GetCustomAttribute(false) - // ?.Value; - //} - - //public static KeyTypes? MapFrom(AasReferables input) - //{ - // var st = input.GetEnumMemberValue(); - // var res = Stringification.KeyTypesFromString(st); - // return res; - //} - - //public static List MapFrom(IEnumerable input) - //{ - // List res = new(); - // foreach (var i in input) - // { - // var x = MapFrom(i); - // if (x.HasValue) - // res.Add(x.Value); - // } - // return res; - //} - - //public static List GetAllKeyTypesForAasReferables() - // => ExtendKey.MapFrom(Enum.GetValues(typeof(AasReferables)).OfType()); - - #endregion - - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendKeyList.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendKeyList.cs deleted file mode 100644 index 86d899062..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendKeyList.cs +++ /dev/null @@ -1,183 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AasxCompatibilityModels; -using AdminShellNS; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; -using System.Text.RegularExpressions; -using Extensions; - -namespace Extensions -{ - public static class ExtendKeyList - { - public static bool IsEmpty(this List keys) - { - return keys.Count < 1; - } - - public static bool Matches(this List keys, List other, MatchMode matchMode = MatchMode.Strict) - { - if (other == null || other.Count != keys.Count) - return false; - - var same = true; - for (int i = 0; i < keys.Count; i++) - same = same && keys[i].Matches(other[i], matchMode); - - return same; - } - - public static List ReplaceLastKey(this List keys,List newKeys) - { - var res = new List(keys); - if (res.Count < 1 || newKeys == null || newKeys.Count < 1) - return res; - - res.Remove(res.Last()); - res.AddRange(newKeys); - return res; - } - - public static bool StartsWith(this List keyList, List otherKeyList) - { - if (otherKeyList == null || otherKeyList.Count == 0) - return false; - - // simply test element-wise - for (int i = 0; i < otherKeyList.Count; i++) - { - // does head have more elements than this list? - if (i >= keyList.Count) - return false; - - if (!otherKeyList[i].Matches(keyList[i])) - return false; - } - - // ok! - return true; - } - - public static bool StartsWith(this List keyList,List head, bool emptyIsTrue = false, - MatchMode matchMode = MatchMode.Relaxed) - { - // access - if (head == null) - return false; - if (head.Count == 0) - return emptyIsTrue; - - // simply test element-wise - for (int i = 0; i < head.Count; i++) - { - // does head have more elements than this list? - if (i >= keyList.Count) - return false; - - if (!head[i].Matches(keyList[i], matchMode)) - return false; - } - - // ok! - return true; - } - - public static string ToStringExtended(this List keys, int format = 1, string delimiter = ",") - { - return string.Join(delimiter, keys.Select((k) => k.ToStringExtended(format))); - } - - public static void Validate(this List keys, AasValidationRecordList results, - IReferable container) - { - // access - if (results == null || keys == null || container == null) - return; - - // iterate thru - var idx = 0; - while (idx < keys.Count) - { - var act = keys[idx].Validate(results, container); - if (act == AasValidationAction.ToBeDeleted) - { - keys.RemoveAt(idx); - continue; - } - idx++; - } - } - - public static bool MatchesSetOfTypes(this List key, IEnumerable set) - { - var res = true; - foreach (var kt in key) - if (!key.MatchesSetOfTypes(set)) - res = false; - return res; - } - - public static List Parse(string input) - { - // access - if (input == null) - return null; - - // split - var parts = input.Split(',', ';'); - var kl = new List(); - - foreach (var p in parts) - { - var k = ExtendKey.Parse(p); - if (k != null) - kl.Add(k); - } - - return kl; - } - - /// - /// Take only idShort, ignore all other key-types and create a '/'-separated list - /// - /// Empty string or list of idShorts - public static string BuildIdShortPath(this List keyList, - int startPos = 0, int count = int.MaxValue) - { - if (keyList == null || startPos >= keyList.Count) - return ""; - int nr = 0; - var res = ""; - for (int i = startPos; i < keyList.Count && nr < count; i++) - { - nr++; - //// if (keyList[i].Type.Trim().ToLower() == Key.IdShort.Trim().ToLower()) - { - if (res != "") - res += "/"; - res += keyList[i].Value; - } - } - return res; - } - - public static List SubList(this List keyList, - int startPos, int count = int.MaxValue) - { - var res = new List(); - if (startPos >= keyList.Count()) - return res; - int nr = 0; - for (int i = startPos; i < keyList.Count() && nr < count; i++) - { - nr++; - res.Add(keyList[i]); - } - return res; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendKeyTypes.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendKeyTypes.cs deleted file mode 100644 index 2b00c5fd1..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendKeyTypes.cs +++ /dev/null @@ -1,22 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AdminShellNS; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; - -namespace Extensions -{ - public static class ExtendKeyTypes - { - public static bool IsSME(this KeyTypes keyType) - { - foreach (var kt in Constants.AasSubmodelElementsAsKeys) - if (kt.HasValue && kt.Value == keyType) - return true; - return false; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendLangString.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendLangString.cs deleted file mode 100644 index 1dc8f9504..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendLangString.cs +++ /dev/null @@ -1,35 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendLangString - { - // constants - public static string LANG_DEFAULT = "en"; - - // MIHO: not required, see ExtendLangStringSte - //public static string GetDefaultString(this List langStrings, string defaultLang = null) - //{ - // // start - // if (defaultLang == null) - // defaultLang = "en"; - // defaultLang = defaultLang.Trim().ToLower(); - // string res = null; - - // // search - // foreach (var ls in langStrings) - // if (ls.Language.Trim().ToLower() == defaultLang) - // res = ls.Text; - // if (res == null && langStrings.Count > 0) - // res = langStrings[0].Text; - - // // found? - // return res; - //} - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendLangStringSet.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendLangStringSet.cs deleted file mode 100644 index c5743605c..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendLangStringSet.cs +++ /dev/null @@ -1,165 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Text.RegularExpressions; - -namespace Extensions -{ - public static class ExtendLangStringSet - { - #region AasxPackageExplorer - - public static bool IsValid(this List langStringSet) - { - if(langStringSet != null && langStringSet.Count >=1) - { - return true; - } - - return false; - } - - #endregion - public static bool IsEmpty(this List langStringSet) - { - if (langStringSet == null || langStringSet.Count == 0) - { - return true; - } - - return false; - } - public static string GetDefaultString(this List langStringSet, string defaultLang = null) - { - // start - if (defaultLang == null) - defaultLang = "en"; //Default Lang in old implementation is en - - string res = null; - - // search - foreach (var langString in langStringSet) - if (langString.Language.Equals(defaultLang, StringComparison.OrdinalIgnoreCase)) - res = langString.Text; - - if (res == null && langStringSet.Count > 0) - res = langStringSet[0].Text; - - // found? - return res; - } - - public static List Create(string language, string text) - { - return new List { new LangString(language, text) }; - } - - public static List CreateManyFromStringArray(string[] s) - { - if (s == null) - return null; - var r = new List(); - var i = 0; - while ((i + 1) < s.Length) - { - r.Add(new LangString(s[i], s[i + 1])); - i += 2; - } - return r; - } - - // TODO (Jui, 2023-01-05): Check why the generic Copy does not apply here?! - public static List Copy(this List original) - { - var res = new List(); - if (original != null) - foreach (var o in original) - res.Add(o.Copy()); - return res; - } - - public static List Set(this List lss, string lang, string text) - { - foreach (var ls in lss) - if (ls.Language.Trim().ToLower() == lang?.Trim().ToLower()) - { - ls.Text = text; - return lss; - } - lss.Add(new LangString(lang, text)); - return lss; - } - - public static List ConvertFromV20( - this List langStringSet, - AasxCompatibilityModels.AdminShellV20.LangStringSet sourceLangStrings) - { - - //if (!sourceLangStrings.langString.IsNullOrEmpty()) - if (sourceLangStrings.langString!= null && sourceLangStrings.langString.Count != 0) - { - langStringSet = new List(); - foreach (var sourceLangString in sourceLangStrings.langString) - { - var langString = new LangString(sourceLangString.lang, sourceLangString.str); - langStringSet.Add(langString); - } - } - return langStringSet; - } - - public static List ConvertFromV20( - this List lss, - AasxCompatibilityModels.AdminShellV20.LangStringSetIEC61360 src) - { - - //if (!sourceLangStrings.langString.IsNullOrEmpty()) - if (src != null && src.Count != 0) - { - lss = new List(); - foreach (var sourceLangString in src) - { - var langString = new LangString(sourceLangString.lang, sourceLangString.str); - lss.Add(langString); - } - } - return lss; - } - - public static List Parse(string cell) - { - // access - if (cell == null) - return null; - - // iterative approach - var res = new List(); - while (true) - { - // trivial case and finite end - if (!cell.Contains("@")) - { - if (cell.Trim() != "") - res.Add(new LangString(ExtendLangString.LANG_DEFAULT, cell)); - break; - } - - // OK, pick the next couple - var m = Regex.Match(cell, @"(.*?)@(\w+)", RegexOptions.Singleline); - if (!m.Success) - { - // take emergency exit? - res.Add(new LangString("??", cell)); - break; - } - - // use the match and shorten cell .. - res.Add(new LangString(m.Groups[2].ToString(), m.Groups[1].ToString().Trim())); - cell = cell.Substring(m.Index + m.Length); - } - - return res; - } - - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendModelKind.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendModelKind.cs deleted file mode 100644 index 142f91c65..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendModelKind.cs +++ /dev/null @@ -1,33 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AdminShellNS; - -namespace Extensions -{ - public static class ExtendModelKind - { - public static void Validate(this ModelingKind modelingKind, AasValidationRecordList results, IReferable container) - { - // access - if (results == null || container == null) - return; - - // check - if (modelingKind != ModelingKind.Template && modelingKind != ModelingKind.Instance) - { - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - $"ModelingKind: enumeration value neither Template nor Instance", - () => - { - modelingKind = ModelingKind.Instance; - })); - } - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendMultiLanguageProperty.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendMultiLanguageProperty.cs deleted file mode 100644 index 6dd634852..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendMultiLanguageProperty.cs +++ /dev/null @@ -1,127 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendMultiLanguageProperty - { - #region AasxPackageExplorer - - public static void ValueFromText(this MultiLanguageProperty multiLanguageProperty, string text, string defaultLang) - { - multiLanguageProperty.Value ??= new List(); - - multiLanguageProperty.Value.Add(new LangString(defaultLang == null? "en" : defaultLang, text)); - } - - #endregion - - public static string ValueAsText(this MultiLanguageProperty multiLanguageProperty, string defaultLang = null) - { - //TODO: need to check/test again - //return "" + multiLanguageProperty.Value?.LangStrings.FirstOrDefault().Text; - return "" + multiLanguageProperty.Value?.GetDefaultString(defaultLang); - } - - public static MultiLanguageProperty ConvertFromV20(this MultiLanguageProperty property, AasxCompatibilityModels.AdminShellV20.MultiLanguageProperty sourceProperty) - { - if (sourceProperty == null) - { - return null; - } - - if (sourceProperty.valueId != null) - { - var keyList = new List(); - foreach (var refKey in sourceProperty.valueId.Keys) - { - //keyList.Add(new Key(ExtensionsUtil.GetKeyTypeFromString(refKey.type), refKey.value)); - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value not found for property {property.IdShort}"); - } - } - property.ValueId = new Reference(ReferenceTypes.GlobalReference, keyList); - } - - var newLangStrings = new List(); - - List newLangStringSet = new(newLangStrings); - - property.Value = newLangStringSet.ConvertFromV20(sourceProperty.value); - - return property; - - } - - public static MultiLanguageProperty UpdateFrom( - this MultiLanguageProperty elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is Property srcProp) - { - elem.Value = new List { new LangString("EN?", srcProp.Value) }; - if (srcProp.ValueId != null) - elem.ValueId = srcProp.ValueId.Copy(); - } - - if (source is MultiLanguageProperty srcMlp) - { - if (srcMlp.Value != null) - elem.Value = srcMlp.Value.Copy(); - if (srcMlp.ValueId != null) - elem.ValueId = srcMlp.ValueId.Copy(); - } - - if (source is AasCore.Aas3_0_RC02.Range srcRng) - { - if (srcRng.Min != null) - elem.Value = new List { new LangString("EN?", srcRng.Min) }; - } - - if (source is File srcFile) - { - elem.Value = new List { new LangString("EN?", srcFile.Value) }; - } - - return elem; - } - - public static MultiLanguageProperty Set(this MultiLanguageProperty mlp, - List ls) - { - mlp.Value = ls; - return mlp; - } - - public static MultiLanguageProperty Set(this MultiLanguageProperty mlp, - LangString ls) - { - if (ls == null) - return mlp; - if (mlp.Value == null) - mlp.Value = new List(); - mlp.Value.Set(ls.Language, ls.Text); - return mlp; - } - - public static MultiLanguageProperty Set(this MultiLanguageProperty mlp, - string lang, string str) - { - return mlp.Set(new LangString(lang, str)); - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendObject.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendObject.cs deleted file mode 100644 index 2f0db29c2..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendObject.cs +++ /dev/null @@ -1,137 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Extensions.ArrayExtensions; - -namespace Extensions -{ - public static class ExtendObject - { - private static readonly MethodInfo CloneMethod = typeof(Object).GetMethod("MemberwiseClone", BindingFlags.NonPublic | BindingFlags.Instance); - - public static bool IsPrimitive(this Type type) - { - if (type == typeof(String)) return true; - return (type.IsValueType & type.IsPrimitive); - } - - public static Object Copy(this Object originalObject) - { - return InternalCopy(originalObject, new Dictionary(new ReferenceEqualityComparer())); - } - - private static Object InternalCopy(Object originalObject, IDictionary visited) - { - if (originalObject == null) return null; - var typeToReflect = originalObject.GetType(); - if (IsPrimitive(typeToReflect)) return originalObject; - if (visited.ContainsKey(originalObject)) return visited[originalObject]; - if (typeof(Delegate).IsAssignableFrom(typeToReflect)) return null; - var cloneObject = CloneMethod.Invoke(originalObject, null); - if (typeToReflect.IsArray) - { - var arrayType = typeToReflect.GetElementType(); - if (IsPrimitive(arrayType) == false) - { - Array clonedArray = (Array)cloneObject; - clonedArray.ForEach((array, indices) => array.SetValue(InternalCopy(clonedArray.GetValue(indices), visited), indices)); - } - - } - visited.Add(originalObject, cloneObject); - CopyFields(originalObject, visited, cloneObject, typeToReflect); - RecursiveCopyBaseTypePrivateFields(originalObject, visited, cloneObject, typeToReflect); - return cloneObject; - } - - private static void RecursiveCopyBaseTypePrivateFields(object originalObject, IDictionary visited, object cloneObject, Type typeToReflect) - { - if (typeToReflect.BaseType != null) - { - RecursiveCopyBaseTypePrivateFields(originalObject, visited, cloneObject, typeToReflect.BaseType); - CopyFields(originalObject, visited, cloneObject, typeToReflect.BaseType, BindingFlags.Instance | BindingFlags.NonPublic, info => info.IsPrivate); - } - } - - private static void CopyFields(object originalObject, IDictionary visited, object cloneObject, Type typeToReflect, BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.FlattenHierarchy, Func filter = null) - { - foreach (FieldInfo fieldInfo in typeToReflect.GetFields(bindingFlags)) - { - if (filter != null && filter(fieldInfo) == false) continue; - if (IsPrimitive(fieldInfo.FieldType)) continue; - var originalFieldValue = fieldInfo.GetValue(originalObject); - var clonedFieldValue = InternalCopy(originalFieldValue, visited); - fieldInfo.SetValue(cloneObject, clonedFieldValue); - } - } - public static T Copy(this T original) - { - return (T)Copy((Object)original); - } - } - - public class ReferenceEqualityComparer : EqualityComparer - { - public override bool Equals(object x, object y) - { - return ReferenceEquals(x, y); - } - public override int GetHashCode(object obj) - { - if (obj == null) return 0; - return obj.GetHashCode(); - } - } - - namespace ArrayExtensions - { - public static class ArrayExtensions - { - public static void ForEach(this Array array, Action action) - { - if (array.LongLength == 0) return; - ArrayTraverse walker = new ArrayTraverse(array); - do action(array, walker.Position); - while (walker.Step()); - } - } - - internal class ArrayTraverse - { - public int[] Position; - private int[] maxLengths; - - public ArrayTraverse(Array array) - { - maxLengths = new int[array.Rank]; - for (int i = 0; i < array.Rank; ++i) - { - maxLengths[i] = array.GetLength(i) - 1; - } - Position = new int[array.Rank]; - } - - public bool Step() - { - for (int i = 0; i < Position.Length; ++i) - { - if (Position[i] < maxLengths[i]) - { - Position[i]++; - for (int j = 0; j < i; j++) - { - Position[j] = 0; - } - return true; - } - } - return false; - } - } - } - -} - diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendOperation.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendOperation.cs deleted file mode 100644 index 12ad52979..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendOperation.cs +++ /dev/null @@ -1,148 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AdminShellNS.Display; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendOperation - { - #region AasxPackageExplorer - - public static object AddChild(this Operation operation, ISubmodelElement childSubmodelElement, EnumerationPlacmentBase placement = null) - { - // not enough information to select list of children? - var pl = placement as EnumerationPlacmentOperationVariable; - if (childSubmodelElement == null || pl == null) - return null; - - // ok, use information - var ov = new OperationVariable(childSubmodelElement); - - if (childSubmodelElement != null) - childSubmodelElement.Parent = operation; - - if (pl.Direction == OperationVariableDirection.In) - { - operation.InputVariables ??= new List(); - operation.InputVariables.Add(ov); - } - - if (pl.Direction == OperationVariableDirection.Out) - { - operation.OutputVariables ??= new List(); - operation.OutputVariables.Add(ov); - } - - if (pl.Direction == OperationVariableDirection.InOut) - { - operation.InoutputVariables ??= new List(); - operation.InoutputVariables.Add(ov); - } - - return ov; - } - - public static EnumerationPlacmentBase GetChildrenPlacement(this Operation operation, ISubmodelElement child) - { - // trivial - if (child == null) - return null; - - // search - OperationVariableDirection? dir = null; - OperationVariable opvar = null; - if (operation.InputVariables != null) - foreach (var ov in operation.InputVariables) - if (ov?.Value == child) - { - dir = OperationVariableDirection.In; - opvar = ov; - } - - if (operation.OutputVariables != null) - foreach (var ov in operation.OutputVariables) - if (ov?.Value == child) - { - dir = OperationVariableDirection.Out; - opvar = ov; - } - - if (operation.InoutputVariables != null) - foreach (var ov in operation.InoutputVariables) - if (ov?.Value == child) - { - dir = OperationVariableDirection.InOut; - opvar = ov; - } - - // found - if (!dir.HasValue) - return null; - return new EnumerationPlacmentOperationVariable() - { - Direction = dir.Value, - OperationVariable = opvar - }; - } - - public static List GetVars(this Operation op, OperationVariableDirection dir) - { - if (dir == OperationVariableDirection.In) - return op.InputVariables; - if (dir == OperationVariableDirection.Out) - return op.OutputVariables; - return op.InoutputVariables; - } - - public static List SetVars( - this Operation op, OperationVariableDirection dir, List value) - { - if (dir == OperationVariableDirection.In) - { - op.InputVariables = value; - return op.InputVariables; - } - if (dir == OperationVariableDirection.Out) - { - op.OutputVariables = value; - return op.OutputVariables; - } - - op.InoutputVariables = value; - return op.InoutputVariables; - } - - #endregion - - public static Operation UpdateFrom( - this Operation elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is SubmodelElementCollection srcColl) - { - if (srcColl.Value != null) - elem.InputVariables = srcColl.Value.Copy().Select( - (isme) => new OperationVariable(isme)).ToList(); - } - - if (source is SubmodelElementCollection srcList) - { - if (srcList.Value != null) - elem.InputVariables = srcList.Value.Copy().Select( - (isme) => new OperationVariable(isme)).ToList(); - } - - return elem; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendProperty.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendProperty.cs deleted file mode 100644 index b9e9d4e4d..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendProperty.cs +++ /dev/null @@ -1,266 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendProperty - { - #region AasxPackageExplorer - - public static void ValueFromText(this Property property, string text) - { - property.Value = text; - } - - #endregion - public static bool IsValueTrue(this Property property) - { - if(property.ValueType == DataTypeDefXsd.Boolean) - { - if(property.Value.Equals("true", StringComparison.OrdinalIgnoreCase)) - { - return true; - } - } - - return false; - } - - public static string ValueAsText(this Property property) - { - return "" + property.Value; - } - - public static double? ValueAsDouble(this Property prop) - { - // pointless - if (prop.Value == null || prop.Value.Trim() == "") - return null; - - // type? - if (!ExtendDataElement.ValueTypes_Number.Contains(prop.ValueType)) - return null; - - // try convert - if (double.TryParse(prop.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out double dbl)) - return dbl; - - // no - return null; - } - public static Property ConvertFromV10(this Property property, AasxCompatibilityModels.AdminShellV10.Property sourceProperty) - { - if (sourceProperty == null) - { - return null; - } - var propertyType = Stringification.DataTypeDefXsdFromString("xs:" + sourceProperty.valueType); - if (propertyType != null) - { - property.ValueType = (DataTypeDefXsd)propertyType; - } - else - { - Console.WriteLine($"ValueType {sourceProperty.valueType} not found for property {sourceProperty.idShort}"); - } - property.Value = sourceProperty.value; - if (sourceProperty.valueId != null) - { - var keyList = new List(); - foreach (var refKey in sourceProperty.valueId.Keys) - { - //keyList.Add(new Key(ExtensionsUtil.GetKeyTypeFromString(refKey.type), refKey.value)); - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {sourceProperty.valueType} not found for property {property.IdShort}"); - } - } - property.ValueId = new Reference(ReferenceTypes.GlobalReference, keyList); - } - - return property; - } - - public static Property ConvertFromV20(this Property property, AasxCompatibilityModels.AdminShellV20.Property sourceProperty) - { - if (sourceProperty == null) - { - return null; - } - - var propertyType = Stringification.DataTypeDefXsdFromString("xs:" + sourceProperty.valueType); - if (propertyType != null) - { - property.ValueType = (DataTypeDefXsd)propertyType; - } - else - { - Console.WriteLine($"ValueType {sourceProperty.valueType} not found for property {sourceProperty.idShort}"); - } - property.Value = sourceProperty.value; - if (sourceProperty.valueId != null) - { - var keyList = new List(); - foreach (var refKey in sourceProperty.valueId.Keys) - { - //keyList.Add(new Key(ExtensionsUtil.GetKeyTypeFromString(refKey.type), refKey.value)); - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {sourceProperty.valueType} not found for property {property.IdShort}"); - } - } - property.ValueId = new Reference(ReferenceTypes.GlobalReference, keyList); - } - - return property; - } - - public static Property UpdateFrom(this Property elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is Property srcProp) - { - elem.ValueType = srcProp.ValueType; - elem.Value = srcProp.Value; - if (srcProp.ValueId != null) - elem.ValueId = srcProp.ValueId.Copy(); - } - - if (source is AasCore.Aas3_0_RC02.Range srcRng) - { - elem.ValueType = srcRng.ValueType; - elem.Value = srcRng.Min; - } - - if (source is MultiLanguageProperty srcMlp) - { - elem.ValueType = DataTypeDefXsd.String; - elem.Value = "" + srcMlp.Value?.GetDefaultString(); - if (srcMlp.ValueId != null) - elem.ValueId = srcMlp.ValueId.Copy(); - } - - if (source is File srcFile) - { - elem.ValueType = DataTypeDefXsd.String; - elem.Value = "" + srcFile.Value; - } - - return elem; - } - - // MIHO: Jui, why was this required? -#if OLD - - public static void UpdatePropertyFrom(this Property property, Property sourceProperty) - { - if (sourceProperty.Extensions != null) - { - property.Extensions = sourceProperty.Extensions; - } - if (sourceProperty.Category != null) - { - property.Category = sourceProperty.Category; - } - if (sourceProperty.IdShort != null) - { - property.IdShort = sourceProperty.IdShort; - } - if (sourceProperty.DisplayName != null) - { - property.DisplayName = sourceProperty.DisplayName; - } - if (sourceProperty.Description != null) - { - property.Description = sourceProperty.Description; - } - if (sourceProperty.Checksum != null) - { - property.Checksum = sourceProperty.Checksum; - } - if (sourceProperty.Kind != null) - { - property.Kind = sourceProperty.Kind; - } - if (sourceProperty.SemanticId != null) - { - property.SemanticId = sourceProperty.SemanticId; - } - if (sourceProperty.SupplementalSemanticIds != null) - { - property.SupplementalSemanticIds = sourceProperty.SupplementalSemanticIds; - } - if (sourceProperty.Qualifiers != null) - { - property.Qualifiers = sourceProperty.Qualifiers; - } - if (sourceProperty.EmbeddedDataSpecifications != null) - { - property.EmbeddedDataSpecifications = sourceProperty.EmbeddedDataSpecifications; - } - if (true) - { - property.ValueType = sourceProperty.ValueType; - } - if (sourceProperty.ValueId != null) - { - property.ValueId = sourceProperty.ValueId; - } - if (sourceProperty.Value != null) - { - property.Value = sourceProperty.Value; - } - } -#endif - - public static Property Set(this Property prop, - DataTypeDefXsd valueType = DataTypeDefXsd.String, string value = "") - { - prop.ValueType = valueType; - prop.Value = value; - return prop; - } - - public static Property Set(this Property prop, - KeyTypes type, string value) - { - prop.ValueId = ExtendReference.CreateFromKey(new Key(type, value)); - return prop; - } - - public static Property Set(this Property prop, - Qualifier q) - { - if (q != null) - prop.Add(q); - return prop; - } - - public static Property Set(this Property prop, - Extension ext) - { - if (ext != null) - prop.Add(ext); - return prop; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendQualifier.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendQualifier.cs deleted file mode 100644 index 44a495d65..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendQualifier.cs +++ /dev/null @@ -1,192 +0,0 @@ -using AasCore.Aas3_0_RC02; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendQualifier - { - public static Qualifier ConvertFromV10(this Qualifier qualifier, AasxCompatibilityModels.AdminShellV10.Qualifier sourceQualifier) - { - if (sourceQualifier.semanticId != null) - { - var keyList = new List(); - foreach (var refKey in sourceQualifier.semanticId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - qualifier.SemanticId = new Reference(ReferenceTypes.GlobalReference, keyList); - } - - qualifier.Type = sourceQualifier.qualifierType; - qualifier.Value = sourceQualifier.qualifierValue; - - if (sourceQualifier.qualifierValueId != null) - { - var keyList = new List(); - foreach (var refKey in sourceQualifier.qualifierValueId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - qualifier.ValueId = new Reference(ReferenceTypes.GlobalReference, keyList); - } - - return qualifier; - } - - public static Qualifier ConvertFromV20(this Qualifier qualifier, AasxCompatibilityModels.AdminShellV20.Qualifier sourceQualifier) - { - if (sourceQualifier.semanticId != null) - { - var keyList = new List(); - foreach (var refKey in sourceQualifier.semanticId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - - } - qualifier.SemanticId = new Reference(ReferenceTypes.GlobalReference, keyList); - } - - qualifier.Type = sourceQualifier.type; - qualifier.Value = sourceQualifier.value; - - if (sourceQualifier.valueId != null) - { - var keyList = new List(); - foreach (var refKey in sourceQualifier.valueId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - qualifier.ValueId = new Reference(ReferenceTypes.GlobalReference, keyList); - } - - return qualifier; - } - - // ReSharper disable MethodOverloadWithOptionalParameter .. this seems to work, anyhow - // ReSharper disable RedundantArgumentDefaultValue - public static string ToStringExtended(this Qualifier q, - int format = 0, string delimiter = ",") - { - var res = "" + q.Type; - if (res == "") - res += "" + q.SemanticId?.ToStringExtended(format, delimiter); - - if (q.Value != null) - res += " = " + q.Value; - else if (q.ValueId != null) - res += " = " + q.ValueId?.ToStringExtended(format, delimiter); - - return res; - } - // ReSharper enable MethodOverloadWithOptionalParameter - // ReSharper enable RedundantArgumentDefaultValue - - // - // - // List - // - // - - #region QualifierCollection - - public static Qualifier FindQualifierOfType(this List qualifiers, string qualifierType) - { - if(qualifierType == null) - { - return null; - } - - foreach(var qualifier in qualifiers) - { - if(qualifier != null && qualifierType.Equals(qualifier.Type)) - { - return qualifier; - } - } - - return null; - } - - // ReSharper disable MethodOverloadWithOptionalParameter .. this seems to work, anyhow - // ReSharper disable RedundantArgumentDefaultValue - public static string ToStringExtended(this List qualifiers, - int format = 0, string delimiter = ";", string referencesDelimiter = ",") - { - var res = ""; - foreach (var q in qualifiers) - { - if (res != "") - res += delimiter; - res += q.ToStringExtended(format, referencesDelimiter); - } - return res; - } - // ReSharper enable MethodOverloadWithOptionalParameter - // ReSharper enable RedundantArgumentDefaultValue - - public static Qualifier FindType(this List qualifiers, string type) - { - if (type == null || qualifiers == null) - return null; - foreach (var q in qualifiers) - if (q != null && q.Type != null && q.Type.Trim() == type.Trim()) - return q; - return null; - } - - public static Qualifier Parse(string input) - { - var m = Regex.Match(input, @"\s*([^,]*)(,[^=]+){0,1}\s*=\s*([^,]*)(,.+){0,1}\s*"); - if (!m.Success) - return null; - - return new Qualifier( - valueType: DataTypeDefXsd.String, - type: m.Groups[1].ToString().Trim(), - semanticId: ExtendReference.Parse(m.Groups[1].ToString().Trim()), - value: m.Groups[3].ToString().Trim(), - valueId: ExtendReference.Parse(m.Groups[1].ToString().Trim()) - ); - } - - #endregion - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendRange.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendRange.cs deleted file mode 100644 index e67c7b40c..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendRange.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AAS = AasCore.Aas3_0_RC02; - -namespace Extensions -{ - public static class ExtendRange - { - public static string ValueAsText(this AasCore.Aas3_0_RC02.Range range) - { - return "" + range.Min + " .. " + range.Max; - } - - public static AasCore.Aas3_0_RC02.Range ConvertFromV20(this AasCore.Aas3_0_RC02.Range range, AasxCompatibilityModels.AdminShellV20.Range sourceRange) - { - if (sourceRange == null) - { - return null; - } - - var propertyType = AAS.Stringification.DataTypeDefXsdFromString("xs:" + sourceRange.valueType); - if (propertyType != null) - { - range.ValueType = (AAS.DataTypeDefXsd)propertyType; - } - else - { - Console.WriteLine($"ValueType {sourceRange.valueType} not found for property {range.IdShort}"); - } - - range.Max = sourceRange.max; - range.Min = sourceRange.min; - - return range; - } - - public static AAS.Range UpdateFrom(this AAS.Range elem, AAS.ISubmodelElement source) - { - if (source == null) - return elem; - - ((AAS.ISubmodelElement)elem).UpdateFrom(source); - - if (source is AAS.Property srcProp) - { - elem.ValueType = srcProp.ValueType; - elem.Min = srcProp.Value; - elem.Max = elem.Min; - } - - if (source is AAS.MultiLanguageProperty srcMlp) - { - elem.ValueType = AAS.DataTypeDefXsd.String; - elem.Min = "" + srcMlp.Value?.GetDefaultString(); - elem.Max = elem.Min; - } - - if (source is AAS.File srcFile) - { - elem.ValueType = AAS.DataTypeDefXsd.String; - elem.Min = "" + srcFile.Value; - elem.Max = elem.Min; - } - - return elem; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendReference.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendReference.cs deleted file mode 100644 index ad4870212..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendReference.cs +++ /dev/null @@ -1,263 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AdminShellNS.Exceptions; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendReference - { - #region AasxPackageExplorer - - public static AasElementSelfDescription GetSelfDescription(this Reference reference) - { - return new AasElementSelfDescription("Reference", "Rfc", null, null); - } - - public static bool IsValid(this Reference reference) - { - return reference.Keys != null && !reference.Keys.IsEmpty(); - } - - /// - /// Formaly a static constructor. - /// Creates a Reference from a key, guessing Reference.Type. - /// - /// Given single Key - /// Reference with guessed type - public static Reference CreateFromKey(Key k) - { - var res = new Reference(ReferenceTypes.GlobalReference, new List { k }); - res.Type = res.GuessType(); - return res; - } - - /// - /// Formaly a static constructor. - /// Creates a Reference from a key, guessing Reference.Type. - /// - public static Reference CreateFromKey(KeyTypes type, - string value) - { - var res = new Reference(ReferenceTypes.GlobalReference, - new List { new Key(type, value) }); - res.Type = res.GuessType(); - return res; - } - - /// - /// Formaly a static constructor. - /// Creates a Reference from a list of keys, guessing Reference.Type. - /// - /// - /// - public static Reference CreateNew(List lk) - { - var res = new Reference(ReferenceTypes.GlobalReference, new List()); - if (lk == null) - return res; - res.Keys.AddRange(lk.Copy()); - res.Type = res.GuessType(); - return res; - } - - // TODO (Jui, 2023-01-05): Check why the generic Copy does not apply here?! - public static Reference Copy(this Reference original) - { - var res = new Reference(original.Type, new List()); - if (original != null) - foreach (var o in original.Keys) - res.Add(o.Copy()); - return res; - } - - - public static Reference Parse(string input) - { - var res = new Reference(ReferenceTypes.GlobalReference, new List()); - if (input == null) - return res; - - res.Keys = ExtendKeyList.Parse(input); - res.Type = res.GuessType(); - return res; - } - - //This is alternative for operator overloding method +, as operator overloading cannot be done in extension classes - public static Reference Add(this Reference a, Reference b) - { - a.Keys?.AddRange(b?.Keys); - return a; - } - - public static Reference Add(this Reference a, Key k) - { - if (k != null) - a.Keys?.Add(k); - return a; - } - - public static bool IsEmpty(this Reference reference) - { - if (reference == null || reference.Keys == null || reference.Keys.Count < 1) - { - return true; - } - - return false; - } - - #endregion - - public static bool Matches (this Reference reference, KeyTypes keyType, string id, MatchMode matchMode = MatchMode.Strict) - { - if(reference.IsEmpty()) - { - return false; - } - - if(reference.Keys.Count == 1) - { - var key = reference.Keys[0]; - return key.Matches(new Key(keyType, id), matchMode); - } - - return false; - } - - public static bool Matches(this Reference reference, string id) - { - if (string.IsNullOrEmpty(id)) - { - return false; - } - - if (reference.Keys.Count == 1) // As per old implementation - { - if (reference.Keys[0].Value == id) - return true; - } - - return false; - } - - public static bool Matches(this Reference reference, Reference otherReference, MatchMode matchMode = MatchMode.Strict) - { - if (reference.Keys == null || reference.Keys.Count == 0 || otherReference?.Keys == null || otherReference.Keys.Count == 0) - { - return false; - } - - bool match = true; - for (int i = 0; i < reference.Keys.Count; i++) - { - match = match && reference.Keys[i].Matches(otherReference.Keys[i], matchMode); - } - - return match; - } - - public static bool MatchesExactlyOneKey(this Reference reference, Key key, MatchMode matchMode = MatchMode.Strict) - { - if(key == null || reference.Keys == null || reference.Keys.Count != 1) - { - return false; - } - - var referenceKey = reference.Keys[0]; - return referenceKey.Matches(key, matchMode); - } - - public static string GetAsIdentifier(this Reference reference) - { - if (reference.Type == ReferenceTypes.GlobalReference) // Applying only to Global Reference, based on older implementation, TODO:Make it Generic - { - if (reference.Keys == null || reference.Keys.Count < 1) - { - return null; - } - - return reference.Keys[0].Value; - } - - return null; - } - - public static string MostSignificantInfo(this Reference reference) - { - if (reference.Keys.Count < 1) - { - return "-"; - } - - var i = reference.Keys.Count - 1; - var output = reference.Keys[i].Value; - if (reference.Keys[i].Type == KeyTypes.FragmentReference && i > 0) - output += reference.Keys[i - 1].Value; - return output; - } - - public static Key GetAsExactlyOneKey(this Reference reference) - { - if (reference.Keys == null || reference.Keys.Count != 1) - { - return null; - } - - var key = reference.Keys[0]; - return new Key(key.Type, key.Value); - } - - public static string ToStringExtended(this Reference reference, int format = 1, string delimiter = ",") - { - if(reference.Keys == null) - { - throw new NullValueException("Keys"); - } - - return reference.Keys.ToStringExtended(format, delimiter); - } - - public static ReferenceTypes GuessType(this Reference reference) - { - var setAasRefs = Constants.AasReferables.Where((kt) => kt != null).Select(kt => kt.Value).ToArray(); - var allAasRefs = true; - foreach (var k in reference.Keys) - if (!k.MatchesSetOfTypes(setAasRefs)) - allAasRefs = false; - if (allAasRefs) - return ReferenceTypes.ModelReference; - else - return ReferenceTypes.GlobalReference; - } - - public static int Count(this Reference rf) - { - return rf.Keys.Count; - } - - public static Key Last(this Reference rf) - { - return rf.Keys.Last(); - } - - public static string ListOfValues(this Reference rf, string delim) - { - string res = ""; - if (rf.Keys != null) - foreach (var x in rf.Keys) - { - if (x == null) - continue; - if (res != "") res += delim; - res += x.Value; - } - return res; - } - } - -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendReferenceElement.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendReferenceElement.cs deleted file mode 100644 index 4fdc888a0..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendReferenceElement.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AAS = AasCore.Aas3_0_RC02; -using AasCore.Aas3_0_RC02; - -namespace Extensions -{ - public static class ExtendReferenceElement - { - public static AAS.ReferenceElement Set(this AAS.ReferenceElement elem, - Reference rf) - { - elem.Value = rf; - return elem; - } - - public static AAS.ReferenceElement UpdateFrom( - this AAS.ReferenceElement elem, AAS.ISubmodelElement source) - { - if (source == null) - return elem; - - ((AAS.ISubmodelElement)elem).UpdateFrom(source); - - if (source is AAS.RelationshipElement srcRel) - { - if (srcRel.First != null) - elem.Value = srcRel.First.Copy(); - } - - if (source is AAS.AnnotatedRelationshipElement srcRelA) - { - if (srcRelA.First != null) - elem.Value = srcRelA.First.Copy(); - } - - return elem; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendRelationshipElement.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendRelationshipElement.cs deleted file mode 100644 index 45dfa17b3..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendRelationshipElement.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AAS = AasCore.Aas3_0_RC02; - -namespace Extensions -{ - public static class ExtendRelationshipElement - { - public static AAS.RelationshipElement Set(this AAS.RelationshipElement elem, - AAS.Reference first, AAS.Reference second) - { - elem.First = first; - elem.Second = second; - return elem; - } - - public static AAS.RelationshipElement UpdateFrom( - this AAS.RelationshipElement elem, AAS.ISubmodelElement source) - { - if (source == null) - return elem; - - ((AAS.ISubmodelElement)elem).UpdateFrom(source); - - if (source is AAS.ReferenceElement srcRef) - { - if (srcRef.Value != null) - elem.First = srcRef.Value.Copy(); - } - - if (source is AAS.AnnotatedRelationshipElement srcRelA) - { - if (srcRelA.First != null) - elem.First = srcRelA.First.Copy(); - } - - return elem; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendStream.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendStream.cs deleted file mode 100644 index fefe4af1f..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendStream.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendStream - { - public static byte[] ToByteArray(this Stream stream) - { - using (stream) - { - using MemoryStream memStream = new(); - stream.CopyTo(memStream); - return memStream.ToArray(); - } - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendStringification.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendStringification.cs deleted file mode 100644 index cb554c921..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendStringification.cs +++ /dev/null @@ -1,15 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendStringification - { - public static IEnumerable DataTypeXsdToStringArray() => - Enum.GetValues(typeof(DataTypeDefXsd)).OfType().Select((dt) => Stringification.ToString(dt)); - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendSubmodel.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendSubmodel.cs deleted file mode 100644 index 3f07b4ff9..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendSubmodel.cs +++ /dev/null @@ -1,455 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AdminShellNS; -using AdminShellNS.Display; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendSubmodel - { - #region AasxPackageExplorer - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. Include this element, as well. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// Include this element as well. parents will then - /// include this element as well! - public static void RecurseOnReferables(this Submodel submodel, - object state, Func, IReferable, bool> lambda, - bool includeThis = false) - { - var parents = new List(); - if (includeThis) - { - lambda(state, null, submodel); - parents.Add(submodel); - } - submodel.SubmodelElements?.RecurseOnReferables(state, parents, lambda); - } - - public static void Remove(this Submodel submodel, ISubmodelElement submodelElement) - { - if(submodel != null) - { - if(submodel.SubmodelElements != null) - { - submodel.SubmodelElements.Remove(submodelElement); - } - } - } - - public static object AddChild(this Submodel submodel,ISubmodelElement childSubmodelElement, EnumerationPlacmentBase placement = null) - { - if (childSubmodelElement == null) - return null; - submodel.SubmodelElements ??= new (); - if (childSubmodelElement != null) - childSubmodelElement.Parent = submodel; - submodel.SubmodelElements.Add(childSubmodelElement); - return childSubmodelElement; - } - - public static Tuple ToCaptionInfo(this Submodel submodel) - { - var caption = AdminShellUtil.EvalToNonNullString("\"{0}\" ", submodel.IdShort, ""); - if (submodel.Administration != null) - caption += "V" + submodel.Administration.Version + "." + submodel.Administration.Revision; - var info = ""; - if (submodel.Id != null) - info = $"[{submodel.Id}]"; - return Tuple.Create(caption, info); - } - - public static IEnumerable FindAllReferences(this Submodel submodel) - { - // not nice: use temp list - var temp = new List(); - - // recurse - submodel.RecurseOnSubmodelElements(null, (state, parents, sme) => - { - if (sme is ReferenceElement re) - if (re.Value != null) - temp.Add(re.Value); - if (sme is RelationshipElement rl) - { - if (rl.First != null) - temp.Add(rl.First); - if (rl.Second != null) - temp.Add(rl.Second); - } - // recurse - return true; - }); - - // now, give back - foreach (var r in temp) - yield return new LocatedReference(submodel, r); - } - - #endregion - public static void Validate(this Submodel submodel,AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check - submodel.BaseValidation(results); - submodel.Kind.Value.Validate(results,submodel); - submodel.SemanticId.Keys.Validate(results, submodel); - } - public static Submodel ConvertFromV10(this Submodel submodel, AasxCompatibilityModels.AdminShellV10.Submodel sourceSubmodel, bool shallowCopy = false) - { - if (sourceSubmodel == null) - { - return null; - } - - if (string.IsNullOrEmpty(sourceSubmodel.idShort)) - { - submodel.IdShort = ""; - } - else - { - submodel.IdShort = sourceSubmodel.idShort; - } - - if (sourceSubmodel.description != null) - { - submodel.Description = ExtensionsUtil.ConvertDescriptionFromV10(sourceSubmodel.description); - } - - if (sourceSubmodel.administration != null) - { - submodel.Administration = new AdministrativeInformation(version: sourceSubmodel.administration.version, revision: sourceSubmodel.administration.revision); - } - - if (sourceSubmodel.semanticId != null) - { - var keyList = new List(); - foreach (var refKey in sourceSubmodel.semanticId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - submodel.SemanticId = new Reference(ReferenceTypes.GlobalReference, keyList); - } - - if (sourceSubmodel.kind != null) - { - if (sourceSubmodel.kind.IsInstance) - { - submodel.Kind = ModelingKind.Instance; - } - else - { - submodel.Kind = ModelingKind.Template; - } - } - - if (sourceSubmodel.qualifiers != null && sourceSubmodel.qualifiers.Count != 0) - { - if (submodel.Qualifiers == null && submodel.Qualifiers.Count != 0) - { - submodel.Qualifiers = new List(); - } - - foreach (var sourceQualifier in sourceSubmodel.qualifiers) - { - var newQualifier = new Qualifier("", DataTypeDefXsd.String); - newQualifier = newQualifier.ConvertFromV10(sourceQualifier); - submodel.Qualifiers.Add(newQualifier); - } - } - - if (!shallowCopy && sourceSubmodel.submodelElements != null) - { - if (submodel.SubmodelElements == null) - { - submodel.SubmodelElements = new List(); - } - - foreach (var submodelElementWrapper in sourceSubmodel.submodelElements) - { - var sourceSubmodelELement = submodelElementWrapper.submodelElement; - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelELement != null) - { - outputSubmodelElement = outputSubmodelElement.ConvertFromV10(sourceSubmodelELement, shallowCopy); - submodel.SubmodelElements.Add(outputSubmodelElement); - } - - } - } - - return submodel; - - } - - public static Submodel ConvertFromV20(this Submodel sm, AasxCompatibilityModels.AdminShellV20.Submodel srcSM, bool shallowCopy = false) - { - if (srcSM == null) - return null; - - if (string.IsNullOrEmpty(srcSM.idShort)) - sm.IdShort = ""; - else - sm.IdShort = srcSM.idShort; - - if (srcSM.identification?.id != null) - sm.Id = srcSM.identification.id; - - if (srcSM.description != null) - sm.Description = ExtensionsUtil.ConvertDescriptionFromV20(srcSM.description); - - if (srcSM.administration != null) - sm.Administration = new AdministrativeInformation( - version: srcSM.administration.version, revision: srcSM.administration.revision); - - if (srcSM.semanticId != null) - { - var keyList = new List(); - foreach (var refKey in srcSM.semanticId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - sm.SemanticId = new Reference(ReferenceTypes.GlobalReference, keyList); - } - - if (srcSM.kind != null) - { - if (srcSM.kind.IsInstance) - { - sm.Kind = ModelingKind.Instance; - } - else - { - sm.Kind = ModelingKind.Template; - } - } - - if (srcSM.qualifiers != null && srcSM.qualifiers.Count != 0) - { - if (sm.Qualifiers == null) - { - sm.Qualifiers = new List(); - } - - foreach (var sourceQualifier in srcSM.qualifiers) - { - var newQualifier = new Qualifier("", DataTypeDefXsd.String); - newQualifier = newQualifier.ConvertFromV20(sourceQualifier); - sm.Qualifiers.Add(newQualifier); - } - } - - if (!shallowCopy && srcSM.submodelElements != null) - { - if (sm.SubmodelElements == null) - { - sm.SubmodelElements = new List(); - } - - foreach (var submodelElementWrapper in srcSM.submodelElements) - { - var sourceSubmodelELement = submodelElementWrapper.submodelElement; - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelELement != null) - { - outputSubmodelElement = outputSubmodelElement.ConvertFromV20(sourceSubmodelELement, shallowCopy); - sm.SubmodelElements.Add(outputSubmodelElement); - } - - } - } - - // move Qualifiers to Extensions - sm.MigrateV20QualifiersToExtensions(); - - return sm; - } - - public static T FindFirstIdShortAs(this Submodel submodel, string idShort) where T : ISubmodelElement - { - - var submodelElement = submodel.SubmodelElements.Where(sme => (sme != null) && (sme is T) && sme.IdShort.Equals(idShort, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); - - return (T)submodelElement; - } - - public static IEnumerable FindDeep(this Submodel submodel) - { - if (submodel.SubmodelElements == null || submodel.SubmodelElements.Count == 0) - { - yield break; - } - - foreach (var submodelElement in submodel.SubmodelElements) - { - foreach (var x in submodelElement.FindDeep()) - yield return x; - } - } - - public static Reference GetModelReference(this Submodel submodel) - { - var key = new Key(KeyTypes.Submodel, submodel.Id); - var outputReference = new Reference(ReferenceTypes.ModelReference, new List() { key }) - { - ReferredSemanticId = submodel.SemanticId - }; - - return outputReference; - } - - /// - /// If instance, return semanticId as one key. - /// If template, return identification as key. - /// - public static Key GetSemanticKey(this Submodel submodel) - { - if (submodel.Kind == ModelingKind.Instance) - return submodel.SemanticId.GetAsExactlyOneKey(); - else - return new Key(KeyTypes.Submodel, submodel.Id); - } - - public static List SmeForWrite(this Submodel submodel) - { - if (submodel.SubmodelElements == null) - submodel.SubmodelElements = new(); - return submodel.SubmodelElements; - } - - public static void RecurseOnSubmodelElements(this Submodel submodel, object state, Func, ISubmodelElement, bool> lambda) - { - submodel.SubmodelElements?.RecurseOnReferables(state, null, (o, par, rf) => - { - if (rf is ISubmodelElement sme) - return lambda(o, par, sme); - else - return true; - }); - } - - public static ISubmodelElement FindSubmodelElementByIdShort(this Submodel submodel, string smeIdShort) - { - if (submodel.SubmodelElements == null || submodel.SubmodelElements.Count == 0) - { - return null; - } - - var submodelElements = submodel.SubmodelElements.Where(sme => (sme != null) && sme.IdShort.Equals(smeIdShort, StringComparison.OrdinalIgnoreCase)); - if (submodelElements.Any()) - { - return submodelElements.First(); - } - else - { - return null; - } - } - - public static void SetAllParents(this Submodel submodel, DateTime timestamp) - { - if (submodel.SubmodelElements != null) - foreach (var sme in submodel.SubmodelElements) - SetParentsForSME(submodel, sme, timestamp); - } - - public static void SetParentsForSME(IReferable parent, ISubmodelElement submodelElement, DateTime timestamp) - { - if (submodelElement == null) - return; - - submodelElement.Parent = parent; - submodelElement.TimeStamp = timestamp; - submodelElement.TimeStampCreate = timestamp; - - foreach (var childElement in submodelElement.EnumerateChildren()) - { - SetParentsForSME(submodelElement, childElement, timestamp); - } - } - - public static void SetParentsForSME(IReferable parent, ISubmodelElement submodelElement) - { - if (submodelElement == null) - return; - - submodelElement.Parent = parent; - - foreach (var childElement in submodelElement.EnumerateChildren()) - { - SetParentsForSME(submodelElement, childElement); - } - } - - public static void SetAllParents(this Submodel submodel) - { - if (submodel.SubmodelElements != null) - foreach (var sme in submodel.SubmodelElements) - SetParentsForSME(submodel, sme); - } - - public static void Add(this Submodel submodel, ISubmodelElement submodelElement) - { - if (submodel.SubmodelElements == null) - { - submodel.SubmodelElements = new List(); - } - - submodelElement.Parent = submodel; - submodel.SubmodelElements.Add(submodelElement); - } - - public static void Insert(this Submodel submodel, int index, ISubmodelElement submodelElement) - { - if (submodel.SubmodelElements == null) - { - submodel.SubmodelElements = new List(); - } - - submodelElement.Parent = submodel; - submodel.SubmodelElements.Insert(index, submodelElement); - } - - public static T CreateSMEForCD( - this Submodel sm, - ConceptDescription conceptDescription, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false, bool isTemplate = false) - where T : ISubmodelElement - { - if (sm.SubmodelElements == null) - sm.SubmodelElements = new List(); - return sm.SubmodelElements.CreateSMEForCD( - conceptDescription, category, idShort, idxTemplate, maxNum, addSme, isTemplate); - } - - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendSubmodelElementCollection.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendSubmodelElementCollection.cs deleted file mode 100644 index c5ca34340..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendSubmodelElementCollection.cs +++ /dev/null @@ -1,194 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AdminShellNS.Display; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendSubmodelElementCollection - { - #region AasxPackageExplorer - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. Include this element, as well. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// Include this element as well. parents will then - /// include this element as well! - public static void RecurseOnReferables(this SubmodelElementCollection submodelElementCollection, - object state, Func, IReferable, bool> lambda, - bool includeThis = false) - { - var parents = new List(); - if (includeThis) - { - lambda(state, null, submodelElementCollection); - parents.Add(submodelElementCollection); - } - submodelElementCollection.Value?.RecurseOnReferables(state, parents, lambda); - } - - public static void Remove(this SubmodelElementCollection submodelElementCollection, ISubmodelElement submodelElement) - { - if(submodelElementCollection != null) - { - if(submodelElementCollection.Value != null) - { - submodelElementCollection.Value.Remove(submodelElement); - } - } - } - - public static object AddChild(this SubmodelElementCollection submodelElementCollection, ISubmodelElement childSubmodelElement, EnumerationPlacmentBase placement = null) - { - if (childSubmodelElement == null) - return null; - if (submodelElementCollection.Value == null) - submodelElementCollection.Value = new (); - if (childSubmodelElement != null) - childSubmodelElement.Parent = submodelElementCollection; - submodelElementCollection.Value.Add(childSubmodelElement); - return childSubmodelElement; - } - - #endregion - public static T FindFirstIdShortAs(this SubmodelElementCollection submodelElementCollection, string idShort) where T : ISubmodelElement - { - - var submodelElement = submodelElementCollection.Value.Where(sme => (sme != null) && (sme is T) && sme.IdShort.Equals(idShort, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); - - return (T)submodelElement; - } - - public static SubmodelElementCollection ConvertFromV10(this SubmodelElementCollection submodelElementCollection, AasxCompatibilityModels.AdminShellV10.SubmodelElementCollection sourceSmeCollection, bool shallowCopy = false) - { - if (sourceSmeCollection == null) - return null; - - if (submodelElementCollection.Value == null) - { - submodelElementCollection.Value = new List(); - } - - if (!shallowCopy) - { - foreach (var submodelElementWrapper in sourceSmeCollection.value) - { - var sourceSubmodelElement = submodelElementWrapper.submodelElement; - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelElement != null) - { - outputSubmodelElement = outputSubmodelElement.ConvertFromV10(sourceSubmodelElement, shallowCopy); - } - - submodelElementCollection.Value.Add(outputSubmodelElement); - } - } - - return submodelElementCollection; - } - - public static SubmodelElementCollection ConvertFromV20(this SubmodelElementCollection submodelElementCollection, AasxCompatibilityModels.AdminShellV20.SubmodelElementCollection sourceSmeCollection, bool shallowCopy = false) - { - if (sourceSmeCollection == null) - return null; - - if (submodelElementCollection.Value == null) - { - submodelElementCollection.Value = new List(); - } - - if (!shallowCopy) - { - foreach (var submodelElementWrapper in sourceSmeCollection.value) - { - var sourceSubmodelElement = submodelElementWrapper.submodelElement; - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelElement != null) - { - outputSubmodelElement = outputSubmodelElement.ConvertFromV20(sourceSubmodelElement, shallowCopy); - } - - submodelElementCollection.Value.Add(outputSubmodelElement); - } - } - - return submodelElementCollection; - } - - public static void Add(this SubmodelElementCollection submodelElementCollection, ISubmodelElement submodelElement) - { - submodelElementCollection.Value ??= new List(); - - submodelElement.Parent = submodelElementCollection; - submodelElementCollection.Value.Add(submodelElement); - } - - public static void Insert(this SubmodelElementCollection submodelElementCollection, int index, ISubmodelElement submodelElement) - { - if (submodelElementCollection.Value == null) - { - submodelElementCollection.Value = new List(); - } - - submodelElement.Parent = submodelElementCollection; - submodelElementCollection.Value.Insert(index, submodelElement); - } - - public static T CreateSMEForCD( - this SubmodelElementCollection smc, - ConceptDescription conceptDescription, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false, bool isTemplate = false) - where T : ISubmodelElement - { - if (smc.Value == null) - smc.Value = new List(); - return smc.Value.CreateSMEForCD( - conceptDescription, category, idShort, idxTemplate, maxNum, addSme, isTemplate); - } - - public static SubmodelElementCollection UpdateFrom( - this SubmodelElementCollection elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is SubmodelElementList srcList) - { - if (srcList.Value != null) - elem.Value = srcList.Value.Copy(); - } - - if (source is Operation srcOp) - { - Action, List> appov = (dst, src) => - { - if (src == null) - return; - foreach (var ov in src) - if (ov.Value != null) - dst.Append(ov.Value.Copy()); - }; - - elem.Value = new(); - appov(elem.Value, srcOp.InputVariables); - appov(elem.Value, srcOp.InoutputVariables); - appov(elem.Value, srcOp.OutputVariables); - if (elem.Value.Count < 1) - elem.Value = null; - } - - return elem; - } - - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtendSubmodelElementList.cs b/src/AasxCsharpLib_bkp/Extensions/ExtendSubmodelElementList.cs deleted file mode 100644 index 4d700549f..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtendSubmodelElementList.cs +++ /dev/null @@ -1,200 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AdminShellNS.Display; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtendSubmodelElementList - { - #region AasxPackageExplorer - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. Include this element, as well. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// Include this element as well. parents will then - /// include this element as well! - public static void RecurseOnReferables(this SubmodelElementList submodelElementList, - object state, Func, IReferable, bool> lambda, - bool includeThis = false) - { - var parents = new List(); - if (includeThis) - { - lambda(state, null, submodelElementList); - parents.Add(submodelElementList); - } - submodelElementList.Value?.RecurseOnReferables(state, parents, lambda); - } - - public static void Add(this SubmodelElementList submodelElementList, ISubmodelElement submodelElement) - { - if (submodelElementList != null) - { - submodelElementList.Value ??= new(); - - submodelElement.Parent = submodelElementList; - - submodelElementList.Value.Add(submodelElement); - } - } - - public static void Remove(this SubmodelElementList submodelElementList, ISubmodelElement submodelElement) - { - if (submodelElementList != null) - { - if (submodelElementList.Value != null) - { - submodelElementList.Value.Remove(submodelElement); - } - } - } - - public static object AddChild(this SubmodelElementList submodelElementList, ISubmodelElement childSubmodelElement, EnumerationPlacmentBase placement = null) - { - if (childSubmodelElement == null) - return null; - if (submodelElementList.Value == null) - submodelElementList.Value = new(); - if (childSubmodelElement != null) - childSubmodelElement.Parent = submodelElementList; - submodelElementList.Value.Add(childSubmodelElement); - return childSubmodelElement; - } - - #endregion - public static T FindFirstIdShortAs(this SubmodelElementList submodelElementList, string idShort) where T : ISubmodelElement - { - - var submodelElements = submodelElementList.Value.Where(sme => sme != null && sme is T && sme.IdShort.Equals(idShort, StringComparison.OrdinalIgnoreCase)); - - if (submodelElements.Any()) - { - return (T)submodelElements.First(); - } - - return default; - } - - public static SubmodelElementList UpdateFrom( - this SubmodelElementList elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is SubmodelElementCollection srcColl) - { - if (srcColl.Value != null) - elem.Value = srcColl.Value.Copy(); - } - - if (source is Operation srcOp) - { - Action, List> appov = (dst, src) => - { - if (src == null) - return; - foreach (var ov in src) - if (ov.Value != null) - dst.Append(ov.Value.Copy()); - }; - - elem.Value = new(); - appov(elem.Value, srcOp.InputVariables); - appov(elem.Value, srcOp.InoutputVariables); - appov(elem.Value, srcOp.OutputVariables); - if (elem.Value.Count < 1) - elem.Value = null; - } - - return elem; - } - - // advanced checks - - public class ConstraintStat - { - /// - /// Constraint AASd-107: If a first level child element in a SubmodelElementList has a semanticId - /// it shall be identical to SubmodelElementList/semanticIdListElement. - /// - public bool AllChildSemIdMatch = true; - - /// - /// Constraint AASd-108: All first level child elements in a SubmodelElementList shall have the - /// same submodel element type as specified in SubmodelElementList/typeValueListElement. - /// - public bool AllChildSmeTypeMatch = true; - - /// - /// Constraint AASd-109: If SubmodelElementList/typeValueListElement equal to Property or Range, - /// SubmodelElementList/valueTypeListElement shall be set and all first level child elements in - /// the SubmodelElementList shall have the the value type as specified in - /// SubmodelElementList/valueTypeListElement - /// - public bool AllChildValueTypeMatch = true; - } - - public static ConstraintStat EvalConstraintStat(this SubmodelElementList list) - { - // access - var res = new ConstraintStat(); - if (list.Value == null) - return res; - - // prepare SME type - var smeTypeToCheck = list.TypeValueListElement; - - // prepare value type - var valueTypeToCheck = list.ValueTypeListElement; - - // eval - foreach (var sme in list.Value) - { - // need self description - var smesd = sme.GetSelfDescription(); - if (smesd == null) - continue; - - // sem id? - if (res.AllChildSemIdMatch - && list.SemanticIdListElement?.IsValid() == true - && sme.SemanticId?.IsValid() == true - && !list.SemanticIdListElement.Matches(sme.SemanticId)) - res.AllChildSemIdMatch = false; - - // type of SME? - if (res.AllChildSmeTypeMatch - && smesd.SmeType != smeTypeToCheck) - res.AllChildSmeTypeMatch = false; - - // value type to check - if (valueTypeToCheck.HasValue - && res.AllChildValueTypeMatch - && sme is Property prop - && prop.ValueType != valueTypeToCheck.Value) - res.AllChildValueTypeMatch = false; - - if (valueTypeToCheck.HasValue - && res.AllChildValueTypeMatch - && sme is AasCore.Aas3_0_RC02.Range range - && range.ValueType != valueTypeToCheck.Value) - res.AllChildValueTypeMatch = false; - } - - // ok - return res; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/ExtensionsUtil.cs b/src/AasxCsharpLib_bkp/Extensions/ExtensionsUtil.cs deleted file mode 100644 index fc2940ab2..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/ExtensionsUtil.cs +++ /dev/null @@ -1,115 +0,0 @@ -using AasCore.Aas3_0_RC02; -using AasxCompatibilityModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public static class ExtensionsUtil - { - - public static Reference ConvertReferenceFromV10(AdminShellV10.Reference sourceReference, ReferenceTypes referenceTypes) - { - Reference outputReference = null; - if (sourceReference != null) - { - var keyList = new List(); - foreach (var refKey in sourceReference.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - outputReference = new Reference(referenceTypes, keyList); - } - - return outputReference; - } - - public static Reference ConvertReferenceFromV20(AdminShellV20.Reference sourceReference, ReferenceTypes referenceTypes) - { - Reference outputReference = null; - if (sourceReference != null) - { - var keyList = new List(); - foreach (var refKey in sourceReference.Keys) - { - // Fix, as Asset does not exist anymore - if (refKey.type?.Trim().Equals("Asset", StringComparison.InvariantCultureIgnoreCase) == true) - refKey.type = "GlobalReference"; - - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - outputReference = new Reference(referenceTypes, keyList); - } - - return outputReference; - } - - internal static List ConvertDescriptionFromV10(AdminShellV10.Description sourceDescription) - { - var newLangStrList = new List(); - foreach (var ls in sourceDescription.langString) - { - newLangStrList.Add(new LangString(ls.lang, ls.str)); - } - - return new List(newLangStrList); - } - - internal static List ConvertDescriptionFromV20(AdminShellV20.Description sourceDescription) - { - var newLangStrList = new List(); - foreach (var ls in sourceDescription.langString) - { - newLangStrList.Add(new LangString(ls.lang, ls.str)); - } - - return new List(newLangStrList); - } - - internal static KeyTypes GetKeyType(IClass aasElement) - { - return aasElement switch - { - AssetAdministrationShell => KeyTypes.AssetAdministrationShell, - Submodel => KeyTypes.Submodel, - ConceptDescription => KeyTypes.ConceptDescription, - SubmodelElementCollection => KeyTypes.SubmodelElementCollection, - SubmodelElementList => KeyTypes.SubmodelElementList, - BasicEventElement => KeyTypes.BasicEventElement, - Blob => KeyTypes.Blob, - Entity => KeyTypes.Entity, - File => KeyTypes.File, - MultiLanguageProperty => KeyTypes.MultiLanguageProperty, - Property => KeyTypes.Property, - Operation => KeyTypes.Operation, - AasCore.Aas3_0_RC02.Range => KeyTypes.Range, - ReferenceElement => KeyTypes.ReferenceElement, - RelationshipElement => KeyTypes.RelationshipElement, - AnnotatedRelationshipElement => KeyTypes.AnnotatedRelationshipElement, - IIdentifiable => KeyTypes.Identifiable, - IReferable => KeyTypes.Referable, - Reference => KeyTypes.GlobalReference,//TODO:jtikekar what about model reference - _ => KeyTypes.SubmodelElement, // default case - }; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/LocatedReference.cs b/src/AasxCsharpLib_bkp/Extensions/LocatedReference.cs deleted file mode 100644 index 433578d61..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/LocatedReference.cs +++ /dev/null @@ -1,22 +0,0 @@ -using AasCore.Aas3_0_RC02; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public class LocatedReference - { - public IIdentifiable Identifiable; - public Reference Reference; - - public LocatedReference() { } - public LocatedReference(IIdentifiable identifiable, Reference reference) - { - Identifiable = identifiable; - Reference = reference; - } - } -} diff --git a/src/AasxCsharpLib_bkp/Extensions/MatchMode.cs b/src/AasxCsharpLib_bkp/Extensions/MatchMode.cs deleted file mode 100644 index f30029657..000000000 --- a/src/AasxCsharpLib_bkp/Extensions/MatchMode.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Extensions -{ - public enum MatchMode - { - Strict, //may be not needed in future, as no local flag in V3 - Relaxed, //should be as default - Identification - } -} diff --git a/src/AasxCsharpLib_bkp/IAasxOnlineConnection.cs b/src/AasxCsharpLib_bkp/IAasxOnlineConnection.cs deleted file mode 100644 index 7ce13b014..000000000 --- a/src/AasxCsharpLib_bkp/IAasxOnlineConnection.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (c) 2018-2021 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasCore.Aas3_0_RC02; -using AdminShellNS; - -namespace AasxIntegrationBase -{ - /// - /// This interface describes a connection for a server resource of AASX contents, such as OPC UA or REST - /// - public interface IAasxOnlineConnection - { - bool IsValid(); - bool IsConnected(); - string GetInfo(); - Stream GetThumbnailStream(); - string UpdatePropertyValue( - AasCore.Aas3_0_RC02.Environment env, Submodel submodel, ISubmodelElement sme); - } -} diff --git a/src/AasxCsharpLib_bkp/LICENSE.txt b/src/AasxCsharpLib_bkp/LICENSE.txt deleted file mode 100644 index 2e5ee87b9..000000000 --- a/src/AasxCsharpLib_bkp/LICENSE.txt +++ /dev/null @@ -1,1475 +0,0 @@ -Copyright (c) 2018-2021 Festo AG & Co. KG -, -author: Michael Hoffmeister - -Copyright (c) 2019-2021 PHOENIX CONTACT GmbH & Co. KG -, -author: Andreas Orzelski - -Copyright (c) 2019-2020 Fraunhofer IOSB-INA Lemgo, - eine rechtlich nicht selbstaendige Einrichtung der Fraunhofer-Gesellschaft - zur Foerderung der angewandten Forschung e.V. - -Copyright (c) 2020 Schneider Electric Automation GmbH -, -author: Marco Mendes - -Copyright (c) 2020 SICK AG - -Copyright (c) 2021 KEB Automation KG - -Copyright (c) 2021 Lenze SE -author: Jonas Grote, Denis Göllner, Sebastian Bischof - -The AASX Package Explorer is licensed under the Apache License 2.0 -(Apache-2.0, see below). - -The AASX Package Explorer is a sample application for demonstration of the -features of the Asset Administration Shell. -The implementation uses the concepts of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed -under Creative Commons CC BY-ND 3.0 DE. - -When using eCl@ss or IEC CDD data, please check the corresponding license -conditions. - -------------------------------------------------------------------------------- - -The components below are used in AASX Package Explorer. -The related licenses are listed for information purposes only. -Some licenses may only apply to their related plugins. - -The browser functionality is licensed under the cefSharp license (see below). - -The Newtonsoft.JSON serialization is licensed under the MIT License -(MIT, see below). - -The QR code generation is licensed under the MIT license (MIT, see below). - -The Zxing.Net Dot Matrix Code (DMC) generation is licensed under -the Apache License 2.0 (Apache-2.0, see below). - -The Grapevine REST server framework is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The AutomationML.Engine is licensed under the MIT license (MIT, see below). - -The MQTT server and client is licensed under the MIT license (MIT, see below). - -The ClosedXML Excel reader/writer is licensed under the MIT license (MIT, -see below). - -The CountryFlag WPF control is licensed under the Code Project Open License -(CPOL, see below). - -The DocumentFormat.OpenXml SDK is licensed under the MIT license (MIT, -see below). - -The ExcelNumberFormat number parser is licensed under the MIT license (MIT, -see below). - -The FastMember reflection access is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The IdentityModel OpenID client is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The jose-jwt object signing and encryption is licensed under the -MIT license (MIT, see below). - -The ExcelDataReader is licensed under the MIT license (MIT, see below). - -Portions copyright (c) by OPC Foundation, Inc. and licensed under the -Reciprocal Community License (RCL, see below) - -The OPC UA Example Code of OPC UA Standard is licensed under the MIT license -(MIT, see below). - -The MSAGL (Microsoft Automatic Graph Layout) is licensed under the MIT license -(MIT, see below) - -Glob (https://www.nuget.org/packages/Glob/) is licensed under the MIT license -(MIT, see below). - -The Magick.NET library is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The SSharp.NET library (https://github.com/PetroProtsyk/SSharp) is licensed -under Apache License 2.0 (Apache-2.0, see below). - -------------------------------------------------------------------------------- - - -With respect to AASX Package Explorer -===================================== - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to cefSharp -======================== - -(https://raw.githubusercontent.com/cefsharp/CefSharp/master/LICENSE) - -Copyright © The CefSharp Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google Inc. nor the name Chromium Embedded - Framework nor the name CefSharp nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -With respect to Newtonsoft.Json -=============================== - -(https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md) - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to QRcoder -======================= - -(https://github.com/codebude/QRCoder/blob/master/LICENSE.txt) - -The MIT License (MIT) - -Copyright (c) 2013-2018 Raffael Herrmann - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to ZXing.Net -========================= -With respect to Grapevine -========================= -With respect to FastMember -========================== -With respect to IdentityModel -============================= - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - -With respect to MQTTnet -======================= - -(https://github.com/chkr1011/MQTTnet/blob/master/LICENSE) - -MIT License - -MQTTnet Copyright (c) 2016-2019 Christian Kratky - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to ClosedXML -========================= - -(https://github.com/ClosedXML/ClosedXML/blob/develop/LICENSE) - -MIT License - -Copyright (c) 2016 ClosedXML - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to CountryFlag -=========================== - -(https://www.codeproject.com/Articles/190722/WPF-CountryFlag-Control) - -The Code Project Open License (CPOL) 1.02 - -Copyright © 2017 Meshack Musundi - -Preamble - -This License governs Your use of the Work. This License is intended to allow -developers to use the Source Code and Executable Files provided as part of -the Work in any application in any form. - -The main points subject to the terms of the License are: - - Source Code and Executable Files can be used in commercial applications; - Source Code and Executable Files can be redistributed; and - Source Code can be modified to create derivative works. - No claim of suitability, guarantee, or any warranty whatsoever is provided. - The software is provided "as-is". - The Article(s) accompanying the Work may not be distributed or republished - without the Author's consent - -This License is entered between You, the individual or other entity reading or -otherwise making use of the Work licensed pursuant to this License and the -individual or other entity which offers the Work under the terms of this -License ("Author"). - -License - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS -CODE PROJECT OPEN LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT -AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED -UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE -TO BE BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS -CONTAINED HEREIN IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND -CONDITIONS. IF YOU DO NOT AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS -LICENSE, YOU CANNOT MAKE ANY USE OF THE WORK. - -Definitions. - "Articles" means, collectively, all articles written by Author which -describes how the Source Code and Executable Files for the Work may -be used by a user. - "Author" means the individual or entity that offers the Work under -the terms of this License. - "Derivative Work" means a work based upon the Work or upon the Work -and other pre-existing works. - "Executable Files" refer to the executables, binary files, -configuration and any required data files included in the Work. - "Publisher" means the provider of the website, magazine, CD-ROM, -DVD or other medium from or by which the Work is obtained by You. - "Source Code" refers to the collection of source code and -configuration files used to create the Executable Files. - "Standard Version" refers to such a Work if it has not been modified, -or has been modified in accordance with the consent of the Author, -such consent being in the full discretion of the Author. - "Work" refers to the collection of files distributed by the Publisher, -including the Source Code, Executable Files, binaries, data files, -documentation, whitepapers and the Articles. - "You" is you, an individual or entity wishing to use the Work and -exercise your rights under this License. - -Fair Use/Fair Use Rights. Nothing in this License is intended to reduce, -limit, or restrict any rights arising from fair use, fair dealing, -first sale or other limitations on the exclusive rights of the -copyright owner under copyright law or other applicable laws. - -License Grant. Subject to the terms and conditions of this License, the -Author hereby grants You a worldwide, royalty-free, non-exclusive, -perpetual (for the duration of the applicable copyright) license -to exercise the rights in the Work as stated below: - You may use the standard version of the Source Code or Executable -Files in Your own applications. - You may apply bug fixes, portability fixes and other modifications -obtained from the Public Domain or from the Author. A Work modified -in such a way shall still be considered the standard version and will -be subject to this License. - You may otherwise modify Your copy of this Work (excluding the Articles) -in any way to create a Derivative Work, provided that You insert a prominent -notice in each changed file stating how, when and where You changed that file. - You may distribute the standard version of the Executable Files and Source -Code or Derivative Work in aggregate with other (possibly commercial) -programs as part of a larger (possibly commercial) software distribution. - The Articles discussing the Work published in any form by the author may -not be distributed or republished without the Author's consent. The author -retains copyright to any such Articles. You may use the Executable Files and -Source Code pursuant to this License but you may not repost or republish or -otherwise distribute or make available the Articles, without the prior written -consent of the Author. - -Any subroutines or modules supplied by You and linked into the Source Code -or Executable Files of this Work shall not be considered part of this Work -and will not be subject to the terms of this License. - -Patent License. Subject to the terms and conditions of this License, each -Author hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, -royalty-free, irrevocable (except as stated in this section) patent license -to make, have made, use, import, and otherwise transfer the Work. - -Restrictions. The license granted in Section 3 above is expressly made subject -to and limited by the following restrictions: - You agree not to remove any of the original copyright, patent, trademark, -and attribution notices and associated disclaimers that may appear in the -Source Code or Executable Files. - You agree not to advertise or in any way imply that this Work is a product -of Your own. - The name of the Author may not be used to endorse or promote products -derived from the Work without the prior written consent of the Author. - You agree not to sell, lease, or rent any part of the Work. This does -not restrict you from including the Work or any part of the Work inside -a larger software distribution that itself is being sold. The Work by itself, -though, cannot be sold, leased or rented. - You may distribute the Executable Files and Source Code only under the terms -of this License, and You must include a copy of, or the Uniform Resource -Identifier for, this License with every copy of the Executable Files or -Source Code You distribute and ensure that anyone receiving such Executable -Files and Source Code agrees that the terms of this License apply to such -Executable Files and/or Source Code. You may not offer or impose any terms -on the Work that alter or restrict the terms of this License or the -recipients' exercise of the rights granted hereunder. You may not sublicense -the Work. You must keep intact all notices that refer to this License and to -the disclaimer of warranties. You may not distribute the Executable Files or -Source Code with any technological measures that control access or use of the -Work in a manner inconsistent with the terms of this License. - You agree not to use the Work for illegal, immoral or improper -purposes, or on pages containing illegal, immoral or improper material. -The Work is subject to applicable export laws. You agree to comply with all -such laws and regulations that may apply to the Work after Your receipt of -the Work. - -Representations, Warranties and Disclaimer. THIS WORK IS PROVIDED "AS IS", -"WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OR -CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE, -INCLUDING COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. -AUTHOR EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES -OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS -OF MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR -PURPOSE, OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK -(OR ANY PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES. -YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE -WORKS. - -Indemnity. You agree to defend, indemnify and hold harmless the Author and the -Publisher from and against any claims, suits, losses, damages, liabilities, -costs, and expenses (including reasonable legal or attorneys’ fees) -resulting from or relating to any use of the Work by You. - -Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, -IN NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL -THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY -DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE, -EVEN IF THE AUTHOR OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH DAMAGES. - -Termination. - This License and the rights granted hereunder will terminate -automatically upon any breach by You of any term of this License. -Individuals or entities who have received Derivative Works from You under -this License, however, will not have their licenses terminated provided such -individuals or entities remain in full compliance with those licenses. -Sections 1, 2, 6, 7, 8, 9, 10 and 11 will survive any termination of -this License. - If You bring a copyright, trademark, patent or any other infringement -claim against any contributor over infringements You claim are made by the -Work, your License from such contributor to the Work ends automatically. - Subject to the above terms and conditions, this License is perpetual -(for the duration of the applicable copyright in the Work). -Notwithstanding the above, the Author reserves the right to release the Work -under different license terms or to stop distributing the Work at any time; -provided, however that any such election will not serve to withdraw this -License (or any other license that has been, or is required to be, -granted under the terms of this License), and this License will continue -in full force and effect unless terminated as stated above. - -Publisher. The parties hereby confirm that the Publisher shall not, under -any circumstances, be responsible for and shall not have any liability -in respect of the subject matter of this License. The Publisher makes no -warranty whatsoever in connection with the Work and shall not be liable -to You or any party on any legal theory for any damages whatsoever, including -without limitation any general, special, incidental or consequential damages -arising in connection to this license. The Publisher reserves the right to -cease making the Work available to You at any time without notice - -Miscellaneous - This License shall be governed by the laws of the location of the head -office of the Author or if the Author is an individual, the laws of -location of the principal place of residence of the Author. - If any provision of this License is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of the -remainder of the terms of this License, and without further action by the -parties to this License, such provision shall be reformed to the minimum -extent necessary to make such provision valid and enforceable. - No term or provision of this License shall be deemed waived and no -breach consented to unless such waiver or consent shall be in writing -and signed by the party to be charged with such waiver or consent. - This License constitutes the entire agreement between the parties -with respect to the Work licensed herein. There are no understandings, -agreements or representations with respect to the Work not specified herein. -The Author shall not be bound by any additional provisions that may appear -in any communication from You. This License may not be modified without -the mutual written agreement of the Author and You. - - -With respect to DocumentFormat.OpenXml -====================================== - -(https://github.com/OfficeDev/Open-XML-SDK/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to ExcelNumberFormat -================================= - -(https://github.com/andersnm/ExcelNumberFormat/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2017 andersnm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to jose-jwt -======================== - -(https://github.com/dvsekhvalnov/jose-jwt/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014-2019 dvsekhvalnov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With resepect to ExcelDataReader -================================ - -(https://github.com/ExcelDataReader/ExcelDataReader/blob/develop/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014 ExcelDataReader - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepect to OPC UA Example Code -==================================== - - * Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. - * - * OPC Foundation MIT License 1.00 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * The complete license agreement can be found here: - * http://opcfoundation.org/License/MIT/1.00/ - - -With respect to OPC Foundation -============================== - -RCL License -Reciprocal Community License 1.00 (RCL1.00) -Version 1.00, June 24, 2009 -Copyright (C) 2008,2009 OPC Foundation, Inc., All Rights Reserved. - -https://opcfoundation.org/license/rcl.html - -Remark: PHOENIX CONTACT GmbH & Co. KG and Festo SE & Co. KG are members -of OPC foundation. - -With respect to MSAGL (Microsoft Automatic Graph Layout) -======================================================== -(see: https://github.com/microsoft/automatic-graph-layout/blob/master/LICENSE) - -Microsoft Automatic Graph Layout, MSAGL - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With respect to Glob (https://www.nuget.org/packages/Glob/) -=========================================================== -(see: https://raw.githubusercontent.com/kthompson/glob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2013-2019 Kevin Thompson - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to Magick.NET -========================== - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -With respect to SSharp.NET library -================================== - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/AasxCsharpLib_bkp/LogInternally.cs b/src/AasxCsharpLib_bkp/LogInternally.cs deleted file mode 100644 index f5a9bfad9..000000000 --- a/src/AasxCsharpLib_bkp/LogInternally.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright (c) 2020 ZHAW Zürcher Hochschule für Angewandte Wissenschaften -Author: Marko Ristin - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using Exception = System.Exception; - -namespace AdminShellNS -{ - public static class Logging - { - // see: https://stackoverflow.com/questions/9314172/getting-all-messages-from-innerexceptions - private static string GetExceptionMessages(this Exception e, string msgs = "") - { - if (e == null) return string.Empty; - if (msgs == "") msgs = e.Message; - if (e.InnerException != null) - msgs += "\r\nInnerException: " + GetExceptionMessages(e.InnerException); - return msgs; - } - - public static string FormatError(Exception ex, string where) - { - var res = string.Format("Error: {0}: {1} {2} at {3}.", - where, - ex.Message, - ex.GetExceptionMessages(), - ex.StackTrace); - - var inner = ex.InnerException; - while (inner != null) - { - res += $"Inner message: {inner.Message}" + Environment.NewLine; - inner = inner.InnerException; - } - - return res; - } - } - - public class InternalLog - { - /// - /// Logs the exception to STDERR. - /// - public void Error(Exception ex, string where) - { - System.Console.Error.WriteLine(Logging.FormatError(ex, where)); - } - - /// - /// Logs that the exception is silently ignored to STDERR. - /// - public void SilentlyIgnoredError(Exception ex) - { - System.Console.Error.WriteLine("The exception is silently ignored: {0} {1} at {2}.", - ex.Message, - ((ex.InnerException != null) ? ex.InnerException.Message : ""), - ex.StackTrace); - } - - /// - /// Does no logging at all. Allows to have non-empty catch clauses. - /// - public void CompletelyIgnoredError(Exception ex) - { - } - } - - /// - /// Handles logging meant to be read by developers (*i.e*, not by the users of the software). - /// - /// Please see AasxIntegrationBase\LogInstance.cs for how to keep logs intended - /// for the user. - public static class LogInternally - { - public static readonly InternalLog That = new InternalLog(); - } -} \ No newline at end of file diff --git a/src/AasxCsharpLib_bkp/Properties/AssemblyInfo.cs b/src/AasxCsharpLib_bkp/Properties/AssemblyInfo.cs deleted file mode 100644 index 9aa23c08b..000000000 --- a/src/AasxCsharpLib_bkp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("AasxCsharpLibrary")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AasxCsharpLibrary")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("9863799b-4e44-4da2-9120-c85c7985bc6d")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, -// indem Sie "*" wie unten gezeigt eingeben: -//// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/AasxCsharpLib_bkp/Resources/schemaV201/AAS.xsd b/src/AasxCsharpLib_bkp/Resources/schemaV201/AAS.xsd deleted file mode 100644 index 2e6c24f6b..000000000 --- a/src/AasxCsharpLib_bkp/Resources/schemaV201/AAS.xsd +++ /dev/null @@ -1,555 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/AasxCsharpLib_bkp/Resources/schemaV201/AAS_ABAC.xsd b/src/AasxCsharpLib_bkp/Resources/schemaV201/AAS_ABAC.xsd deleted file mode 100644 index 4048a5746..000000000 --- a/src/AasxCsharpLib_bkp/Resources/schemaV201/AAS_ABAC.xsd +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLib_bkp/Resources/schemaV201/IEC61360.xsd b/src/AasxCsharpLib_bkp/Resources/schemaV201/IEC61360.xsd deleted file mode 100644 index d52f04f1e..000000000 --- a/src/AasxCsharpLib_bkp/Resources/schemaV201/IEC61360.xsd +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/AasxCsharpLib_bkp/Resources/schemaV201/aas.json b/src/AasxCsharpLib_bkp/Resources/schemaV201/aas.json deleted file mode 100644 index 9583c2b1f..000000000 --- a/src/AasxCsharpLib_bkp/Resources/schemaV201/aas.json +++ /dev/null @@ -1,1148 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "title": "AssetAdministrationShellEnvironment", - "$id": "http://www.admin-shell.io/schema/json/v2.0.1", - "type": "object", - "required": ["assetAdministrationShells", "submodels", "assets", "conceptDescriptions"], - "properties": { - "assetAdministrationShells": { - "type": "array", - "items": { - "$ref": "#/definitions/AssetAdministrationShell" - } - }, - "submodels": { - "type": "array", - "items": { - "$ref": "#/definitions/Submodel" - } - }, - "assets": { - "type": "array", - "items": { - "$ref": "#/definitions/Asset" - } - }, - "conceptDescriptions": { - "type": "array", - "items": { - "$ref": "#/definitions/ConceptDescription" - } - } - }, - "definitions": { - "Referable": { - "type": "object", - "properties": { - "idShort": { - "type": "string" - }, - "category": { - "type": "string" - }, - "description": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - } - }, - "parent": { - "$ref": "#/definitions/Reference" - }, - "modelType": { - "$ref": "#/definitions/ModelType" - } - }, - "required": [ "idShort", "modelType" ] - }, - "Identifiable": { - "allOf": [ - { "$ref": "#/definitions/Referable" }, - { "properties": { - "identification": { - "$ref": "#/definitions/Identifier" - }, - "administration": { - "$ref": "#/definitions/AdministrativeInformation" - } - }, - "required": [ "identification" ] - } - ] - }, - "Qualifiable": { - "type": "object", - "properties": { - "qualifiers": { - "type": "array", - "items": { - "$ref": "#/definitions/Constraint" - } - } - } - }, - "HasSemantics": { - "type": "object", - "properties": { - "semanticId": { - "$ref": "#/definitions/Reference" - } - } - }, - "HasDataSpecification": { - "type": "object", - "properties": { - "embeddedDataSpecifications": { - "type": "array", - "items": { - "$ref": "#/definitions/EmbeddedDataSpecification" - } - } - } - }, - "AssetAdministrationShell": { - "allOf": [ - { "$ref": "#/definitions/Identifiable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "properties": { - "derivedFrom": { - "$ref": "#/definitions/Reference" - }, - "asset": { - "$ref": "#/definitions/Reference" - }, - "submodels": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - }, - "views": { - "type": "array", - "items": { - "$ref": "#/definitions/View" - } - }, - "conceptDictionaries": { - "type": "array", - "items": { - "$ref": "#/definitions/ConceptDictionary" - } - }, - "security": { - "$ref": "#/definitions/Security" - } - }, - "required": [ "asset" ] - } - ] - }, - "Identifier": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "idType": { - "$ref": "#/definitions/KeyType" - } - }, - "required": [ "id", "idType" ] - }, - "KeyType": { - "type": "string", - "enum": ["Custom", "IRDI", "IRI", "IdShort", "FragmentId"] - }, - "AdministrativeInformation": { - "type": "object", - "properties": { - "version": { - "type": "string" - }, - "revision": { - "type": "string" - } - } - }, - "LangString": { - "type": "object", - "properties": { - "language": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": [ "language", "text" ] - }, - "Reference": { - "type": "object", - "properties": { - "keys": { - "type": "array", - "items": { - "$ref": "#/definitions/Key" - } - } - }, - "required": [ "keys" ] - }, - "Key": { - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/KeyElements" - }, - "idType": { - "$ref": "#/definitions/KeyType" - }, - "value": { - "type": "string" - }, - "local": { - "type": "boolean" - } - }, - "required": [ "type", "idType", "value", "local" ] - }, - "KeyElements": { - "type": "string", - "enum": [ - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel", - "AccessPermissionRule", - "AnnotatedRelationshipElement", - "BasicEvent", - "Blob", - "Capability", - "ConceptDictionary", - "DataElement", - "File", - "Entity", - "Event", - "MultiLanguageProperty", - "Operation", - "Property", - "Range", - "ReferenceElement", - "RelationshipElement", - "SubmodelElement", - "SubmodelElementCollection", - "View", - "GlobalReference", - "FragmentReference" - ] - }, - "ModelTypes": { - "type": "string", - "enum": [ - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel", - "AccessPermissionRule", - "AnnotatedRelationshipElement", - "BasicEvent", - "Blob", - "Capability", - "ConceptDictionary", - "DataElement", - "File", - "Entity", - "Event", - "MultiLanguageProperty", - "Operation", - "Property", - "Range", - "ReferenceElement", - "RelationshipElement", - "SubmodelElement", - "SubmodelElementCollection", - "View", - "GlobalReference", - "FragmentReference", - "Constraint", - "Formula", - "Qualifier" - ] - }, - "ModelType": { - "type": "object", - "properties": { - "name": { - "$ref": "#/definitions/ModelTypes" - } - }, - "required": [ "name" ] - }, - "EmbeddedDataSpecification": { - "type": "object", - "properties": { - "dataSpecification": { - "$ref": "#/definitions/Reference" - }, - "dataSpecificationContent": { - "$ref": "#/definitions/DataSpecificationContent" - } - }, - "required": [ "dataSpecification", "dataSpecificationContent" ] - }, - "DataSpecificationContent": { - "oneOf": [ - { "$ref": "#/definitions/DataSpecificationIEC61360Content" }, - { "$ref": "#/definitions/DataSpecificationPhysicalUnitContent" } - ] - }, - "DataSpecificationPhysicalUnitContent": { - "type": "object", - "properties": { - "unitName": { - "type": "string" - }, - "unitSymbol": { - "type": "string" - }, - "definition": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - } - }, - "siNotation": { - "type": "string" - }, - "siName": { - "type": "string" - }, - "dinNotation": { - "type": "string" - }, - "eceName": { - "type": "string" - }, - "eceCode": { - "type": "string" - }, - "nistName": { - "type": "string" - }, - "sourceOfDefinition": { - "type": "string" - }, - "conversionFactor": { - "type": "string" - }, - "registrationAuthorityId": { - "type": "string" - }, - "supplier": { - "type": "string" - } - }, - "required": [ "unitName", "unitSymbol", "definition" ] - }, - "DataSpecificationIEC61360Content": { - "allOf": [ - { "$ref": "#/definitions/ValueObject" }, - { - "type": "object", - "properties": { - "dataType": { - "enum": [ - "DATE", - "STRING", - "STRING_TRANSLATABLE", - "REAL_MEASURE", - "REAL_COUNT", - "REAL_CURRENCY", - "BOOLEAN", - "URL", - "RATIONAL", - "RATIONAL_MEASURE", - "TIME", - "TIMESTAMP", - "INTEGER_COUNT", - "INTEGER_MEASURE", - "INTEGER_CURRENCY" - ] - }, - "definition": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - } - }, - "preferredName": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - } - }, - "shortName": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - } - }, - "sourceOfDefinition": { - "type": "string" - }, - "symbol": { - "type": "string" - }, - "unit": { - "type": "string" - }, - "unitId": { - "$ref": "#/definitions/Reference" - }, - "valueFormat": { - "type": "string" - }, - "valueList": { - "$ref": "#/definitions/ValueList" - }, - "levelType": { - "type": "array", - "items": { - "$ref": "#/definitions/LevelType" - } - } - }, - "required": [ "preferredName" ] - } - ] - }, - "LevelType": { - "type": "string", - "enum": [ "Min", "Max", "Nom", "Typ" ] - }, - "ValueList": { - "type": "object", - "properties": { - "valueReferencePairTypes": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/ValueReferencePairType" - } - } - }, - "required": [ "valueReferencePairTypes" ] - }, - "ValueReferencePairType": { - "allOf": [ - { "$ref": "#/definitions/ValueObject" } - ] - }, - "ValueObject": { - "type": "object", - "properties": { - "value": { "type": "string" }, - "valueId": { - "$ref": "#/definitions/Reference" - }, - "valueType": { - "type": "string", - "enum": [ - "anyUri", - "base64Binary", - "boolean", - "date", - "dateTime", - "dateTimeStamp", - "decimal", - "integer", - "long", - "int", - "short", - "byte", - "nonNegativeInteger", - "positiveInteger", - "unsignedLong", - "unsignedInt", - "unsignedShort", - "unsignedByte", - "nonPositiveInteger", - "negativeInteger", - "double", - "duration", - "dayTimeDuration", - "yearMonthDuration", - "float", - "gDay", - "gMonth", - "gMonthDay", - "gYear", - "gYearMonth", - "hexBinary", - "NOTATION", - "QName", - "string", - "normalizedString", - "token", - "language", - "Name", - "NCName", - "ENTITY", - "ID", - "IDREF", - "NMTOKEN", - "time" - ]} - } - }, - "Asset": { - "allOf": [ - { "$ref": "#/definitions/Identifiable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "properties": { - "kind": { - "$ref": "#/definitions/AssetKind" - }, - "assetIdentificationModel": { - "$ref": "#/definitions/Reference" - }, - "billOfMaterial": { - "$ref": "#/definitions/Reference" - } - }, - "required": [ "kind" ] - } - ] - }, - "AssetKind": { - "type": "string", - "enum": ["Type", "Instance"] - }, - "ModelingKind": { - "type": "string", - "enum": ["Template", "Instance"] - }, - "Submodel": { - "allOf": [ - { "$ref": "#/definitions/Identifiable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "$ref": "#/definitions/Qualifiable" }, - { "$ref": "#/definitions/HasSemantics" }, - { "properties": { - "kind": { - "$ref": "#/definitions/ModelingKind" - }, - "submodelElements": { - "type": "array", - "items": { - "$ref": "#/definitions/SubmodelElement" - } - } - } - } - ] - }, - "Constraint": { - "type": "object", - "properties": { - "modelType": { - "$ref": "#/definitions/ModelType" - } - }, - "required": [ "modelType" ] - }, - "Operation": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "inputVariable": { - "type": "array", - "items": { - "$ref": "#/definitions/OperationVariable" - } - }, - "outputVariable": { - "type": "array", - "items": { - "$ref": "#/definitions/OperationVariable" - } - }, - "inoutputVariable": { - "type": "array", - "items": { - "$ref": "#/definitions/OperationVariable" - } - } - } - } - ] - }, - "OperationVariable": { - "type": "object", - "properties": { - "value": { - "oneOf": [ - { "$ref": "#/definitions/Blob" }, - { "$ref": "#/definitions/File" }, - { "$ref": "#/definitions/Capability" }, - { "$ref": "#/definitions/Entity" }, - { "$ref": "#/definitions/Event" }, - { "$ref": "#/definitions/BasicEvent" }, - { "$ref": "#/definitions/MultiLanguageProperty" }, - { "$ref": "#/definitions/Operation" }, - { "$ref": "#/definitions/Property" }, - { "$ref": "#/definitions/Range" }, - { "$ref": "#/definitions/ReferenceElement" }, - { "$ref": "#/definitions/RelationshipElement" }, - { "$ref": "#/definitions/SubmodelElementCollection" } - ] - } - }, - "required": [ "value" ] - }, - "SubmodelElement": { - "allOf": [ - { "$ref": "#/definitions/Referable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "$ref": "#/definitions/HasSemantics" }, - { "$ref": "#/definitions/Qualifiable" }, - { "properties": { - "kind": { - "$ref": "#/definitions/ModelingKind" - } - } - } - ] - }, - "Event": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" } - ] - }, - "BasicEvent": { - "allOf": [ - { "$ref": "#/definitions/Event" }, - { "properties": { - "observed": { - "$ref": "#/definitions/Reference" - } - }, - "required": [ "observed" ] - } - ] - }, - "EntityType": { - "type": "string", - "enum": ["CoManagedEntity", "SelfManagedEntity"] - }, - "Entity": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "statements": { - "type": "array", - "items": { - "$ref": "#/definitions/SubmodelElement" - } - }, - "entityType": { - "$ref": "#/definitions/EntityType" - }, - "asset": { - "$ref": "#/definitions/Reference" - } - }, - "required": [ "entityType" ] - } - ] - }, - "View": { - "allOf": [ - { "$ref": "#/definitions/Referable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "$ref": "#/definitions/HasSemantics" }, - { "properties": { - "containedElements": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - } - } - } - ] - }, - "ConceptDictionary": { - "allOf": [ - { "$ref": "#/definitions/Referable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "properties": { - "conceptDescriptions": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - } - } - } - ] - }, - "ConceptDescription": { - "allOf": [ - { "$ref": "#/definitions/Identifiable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "properties": { - "isCaseOf": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - } - } - } - ] - }, - "Capability": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" } - ] - }, - "Property": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "$ref": "#/definitions/ValueObject" } - ] - }, - "Range": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "valueType": { - "type": "string", - "enum": [ - "anyUri", - "base64Binary", - "boolean", - "date", - "dateTime", - "dateTimeStamp", - "decimal", - "integer", - "long", - "int", - "short", - "byte", - "nonNegativeInteger", - "positiveInteger", - "unsignedLong", - "unsignedInt", - "unsignedShort", - "unsignedByte", - "nonPositiveInteger", - "negativeInteger", - "double", - "duration", - "dayTimeDuration", - "yearMonthDuration", - "float", - "gDay", - "gMonth", - "gMonthDay", - "gYear", - "gYearMonth", - "hexBinary", - "NOTATION", - "QName", - "string", - "normalizedString", - "token", - "language", - "Name", - "NCName", - "ENTITY", - "ID", - "IDREF", - "NMTOKEN", - "time" - ] - }, - "min": { "type": "string" }, - "max": { "type": "string" } - }, - "required": [ "valueType"] - } - ] - }, - "MultiLanguageProperty": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - } - }, - "valueId": { - "$ref": "#/definitions/Reference" - } - } - } - ] - }, - "File": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "value": { - "type": "string" - }, - "mimeType": { - "type": "string" - } - }, - "required": [ "mimeType" ] - } - ] - }, - "Blob": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "value": { - "type": "string" - }, - "mimeType": { - "type": "string" - } - }, - "required": [ "mimeType" ] - } - ] - }, - "ReferenceElement": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "value": { - "$ref": "#/definitions/Reference" - } - } - } - ] - }, - "SubmodelElementCollection": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "value": { - "type": "array", - "items": { - "oneOf": [ - { "$ref": "#/definitions/Blob" }, - { "$ref": "#/definitions/File" }, - { "$ref": "#/definitions/Capability" }, - { "$ref": "#/definitions/Entity" }, - { "$ref": "#/definitions/Event" }, - { "$ref": "#/definitions/BasicEvent" }, - { "$ref": "#/definitions/MultiLanguageProperty" }, - { "$ref": "#/definitions/Operation" }, - { "$ref": "#/definitions/Property" }, - { "$ref": "#/definitions/Range" }, - { "$ref": "#/definitions/ReferenceElement" }, - { "$ref": "#/definitions/RelationshipElement" }, - { "$ref": "#/definitions/SubmodelElementCollection" } - ] - } - }, - "allowDuplicates": { - "type": "boolean" - }, - "ordered": { - "type": "boolean" - } - } - } - ] - }, - "RelationshipElement": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "first": { - "$ref": "#/definitions/Reference" - }, - "second": { - "$ref": "#/definitions/Reference" - } - }, - "required": [ "first", "second" ] - } - ] - }, - "AnnotatedRelationshipElement": { - "allOf": [ - { "$ref": "#/definitions/RelationshipElement" }, - { "properties": { - "annotation": { - "type": "array", - "items": { - "oneOf": [ - { "$ref": "#/definitions/Blob" }, - { "$ref": "#/definitions/File" }, - { "$ref": "#/definitions/MultiLanguageProperty" }, - { "$ref": "#/definitions/Property" }, - { "$ref": "#/definitions/Range" }, - { "$ref": "#/definitions/ReferenceElement" } - ] - } - } - } - } - ] - }, - "Qualifier": { - "allOf": [ - { "$ref": "#/definitions/Constraint" }, - { "$ref": "#/definitions/HasSemantics" }, - { "$ref": "#/definitions/ValueObject" }, - { "properties": { - "type": { - "type": "string" - } - }, - "required": [ "type" ] - } - ] - }, - "Formula": { - "allOf": [ - { "$ref": "#/definitions/Constraint" }, - { "properties": { - "dependsOn": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - } - } - } - ] - }, - "Security": { - "type": "object", - "properties": { - "accessControlPolicyPoints": { - "$ref": "#/definitions/AccessControlPolicyPoints" - }, - "certificate": { - "type": "array", - "items": { - "oneOf": [ - { "$ref": "#/definitions/BlobCertificate" } - ] - } - }, - "requiredCertificateExtension": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - } - }, - "required": [ "accessControlPolicyPoints" ] - }, - "Certificate": { - "type": "object" - }, - "BlobCertificate": { - "allOf": [ - { "$ref": "#/definitions/Certificate" }, - { "properties": { - "blobCertificate": { - "$ref": "#/definitions/Blob" - }, - "containedExtension": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - }, - "lastCertificate": { - "type": "boolean" - } - } - } - ] - }, - "AccessControlPolicyPoints": { - "type": "object", - "properties": { - "policyAdministrationPoint": { - "$ref": "#/definitions/PolicyAdministrationPoint" - }, - "policyDecisionPoint": { - "$ref": "#/definitions/PolicyDecisionPoint" - }, - "policyEnforcementPoint": { - "$ref": "#/definitions/PolicyEnforcementPoint" - }, - "policyInformationPoints": { - "$ref": "#/definitions/PolicyInformationPoints" - } - }, - "required": [ "policyAdministrationPoint", "policyDecisionPoint", "policyEnforcementPoint" ] - }, - "PolicyAdministrationPoint": { - "type": "object", - "properties": { - "localAccessControl": { - "$ref": "#/definitions/AccessControl" - }, - "externalAccessControl": { - "type": "boolean" - } - }, - "required": [ "externalAccessControl" ] - }, - "PolicyInformationPoints": { - "type": "object", - "properties": { - "internalInformationPoint": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - }, - "externalInformationPoint": { - "type": "boolean" - } - }, - "required": [ "externalInformationPoint" ] - }, - "PolicyEnforcementPoint": { - "type": "object", - "properties": { - "externalPolicyEnforcementPoint": { - "type": "boolean" - } - }, - "required": [ "externalPolicyEnforcementPoint" ] - }, - "PolicyDecisionPoint": { - "type": "object", - "properties": { - "externalPolicyDecisionPoints": { - "type": "boolean" - } - }, - "required": [ "externalPolicyDecisionPoints" ] - }, - "AccessControl": { - "type": "object", - "properties": { - "selectableSubjectAttributes": { - "$ref": "#/definitions/Reference" - }, - "defaultSubjectAttributes": { - "$ref": "#/definitions/Reference" - }, - "selectablePermissions": { - "$ref": "#/definitions/Reference" - }, - "defaultPermissions": { - "$ref": "#/definitions/Reference" - }, - "selectableEnvironmentAttributes": { - "$ref": "#/definitions/Reference" - }, - "defaultEnvironmentAttributes": { - "$ref": "#/definitions/Reference" - }, - "accessPermissionRule": { - "type": "array", - "items": { - "$ref": "#/definitions/AccessPermissionRule" - } - } - } - }, - "AccessPermissionRule": { - "allOf": [ - { "$ref": "#/definitions/Referable" }, - { "$ref": "#/definitions/Qualifiable" }, - { "properties": { - "targetSubjectAttributes": { - "type": "array", - "items": { - "$ref": "#/definitions/SubjectAttributes" - }, - "minItems": 1 - }, - "permissionsPerObject": { - "type": "array", - "items": { - "$ref": "#/definitions/PermissionsPerObject" - } - } - }, - "required": [ "targetSubjectAttributes" ] - } - ] - }, - "SubjectAttributes": { - "type": "object", - "properties": { - "subjectAttributes": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - }, - "minItems": 1 - } - } - }, - "PermissionsPerObject": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/Reference" - }, - "targetObjectAttributes": { - "$ref": "#/definitions/ObjectAttributes" - }, - "permission": { - "type": "array", - "items": { - "$ref": "#/definitions/Permission" - } - } - } - }, - "ObjectAttributes": { - "type": "object", - "properties": { - "objectAttribute": { - "type": "array", - "items": { - "$ref": "#/definitions/Property" - }, - "minItems": 1 - } - } - }, - "Permission": { - "type": "object", - "properties": { - "permission": { - "$ref": "#/definitions/Reference" - }, - "kindOfPermission": { - "type": "string", - "enum": ["Allow", "Deny", "NotApplicable", "Undefined"] - } - }, - "required": [ "permission", "kindOfPermission" ] - } - } -} diff --git a/src/AasxCsharpLibrary.Tests/AasxCsharpLibrary.Tests.csproj b/src/AasxCsharpLibrary.Tests/AasxCsharpLibrary.Tests.csproj deleted file mode 100644 index 41d51c68e..000000000 --- a/src/AasxCsharpLibrary.Tests/AasxCsharpLibrary.Tests.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - net6.0-windows - Library - false - 8 - false - - - - PreserveNewest - - - - - Always - - - - - - - - diff --git a/src/AasxCsharpLibrary.Tests/DocTestAdminShellUtil.cs b/src/AasxCsharpLibrary.Tests/DocTestAdminShellUtil.cs deleted file mode 100644 index e6bd57845..000000000 --- a/src/AasxCsharpLibrary.Tests/DocTestAdminShellUtil.cs +++ /dev/null @@ -1,67 +0,0 @@ -// This file was automatically generated by doctest-csharp. -// !!! DO NOT EDIT OR APPEND !!! - -using NUnit.Framework; - -namespace AdminShellNS.Tests -{ - public class DocTest_AdminShellUtil_cs - { - [Test] - public void AtLine40AndColumn12() - { - Assert.AreEqual("someName", AdminShellUtil.FilterFriendlyName("someName")); - } - - [Test] - public void AtLine41AndColumn12() - { - Assert.AreEqual("some__name", AdminShellUtil.FilterFriendlyName("some!;name")); - } - - [Test] - public void AtLine51AndColumn12() - { - Assert.IsFalse(AdminShellUtil.HasWhitespace("")); - } - - [Test] - public void AtLine52AndColumn12() - { - Assert.IsTrue(AdminShellUtil.HasWhitespace(" ")); - } - - [Test] - public void AtLine53AndColumn12() - { - Assert.IsTrue(AdminShellUtil.HasWhitespace("aa bb")); - } - - [Test] - public void AtLine54AndColumn12() - { - Assert.IsTrue(AdminShellUtil.HasWhitespace(" aabb")); - } - - [Test] - public void AtLine55AndColumn12() - { - Assert.IsTrue(AdminShellUtil.HasWhitespace("aabb ")); - } - - [Test] - public void AtLine56AndColumn12() - { - Assert.IsFalse(AdminShellUtil.HasWhitespace("aabb")); - } - - [Test] - public void AtLine68AndColumn12() - { - Assert.IsTrue(AdminShellUtil.ComplyIdShort("")); - } - } -} - -// This file was automatically generated by doctest-csharp. -// !!! DO NOT EDIT OR APPEND !!! diff --git a/src/AasxCsharpLibrary.Tests/LICENSE.txt b/src/AasxCsharpLibrary.Tests/LICENSE.txt deleted file mode 100644 index 75f36a4ff..000000000 --- a/src/AasxCsharpLibrary.Tests/LICENSE.txt +++ /dev/null @@ -1,1475 +0,0 @@ -Copyright (c) 2018-2023 Festo AG & Co. KG -, -author: Michael Hoffmeister - -Copyright (c) 2019-2021 PHOENIX CONTACT GmbH & Co. KG -, -author: Andreas Orzelski - -Copyright (c) 2019-2020 Fraunhofer IOSB-INA Lemgo, - eine rechtlich nicht selbstaendige Einrichtung der Fraunhofer-Gesellschaft - zur Foerderung der angewandten Forschung e.V. - -Copyright (c) 2020 Schneider Electric Automation GmbH -, -author: Marco Mendes - -Copyright (c) 2020 SICK AG - -Copyright (c) 2021 KEB Automation KG - -Copyright (c) 2021 Lenze SE -author: Jonas Grote, Denis Göllner, Sebastian Bischof - -The AASX Package Explorer is licensed under the Apache License 2.0 -(Apache-2.0, see below). - -The AASX Package Explorer is a sample application for demonstration of the -features of the Asset Administration Shell. -The implementation uses the concepts of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed -under Creative Commons CC BY-ND 3.0 DE. - -When using eCl@ss or IEC CDD data, please check the corresponding license -conditions. - -------------------------------------------------------------------------------- - -The components below are used in AASX Package Explorer. -The related licenses are listed for information purposes only. -Some licenses may only apply to their related plugins. - -The browser functionality is licensed under the cefSharp license (see below). - -The Newtonsoft.JSON serialization is licensed under the MIT License -(MIT, see below). - -The QR code generation is licensed under the MIT license (MIT, see below). - -The Zxing.Net Dot Matrix Code (DMC) generation is licensed under -the Apache License 2.0 (Apache-2.0, see below). - -The Grapevine REST server framework is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The AutomationML.Engine is licensed under the MIT license (MIT, see below). - -The MQTT server and client is licensed under the MIT license (MIT, see below). - -The ClosedXML Excel reader/writer is licensed under the MIT license (MIT, -see below). - -The CountryFlag WPF control is licensed under the Code Project Open License -(CPOL, see below). - -The DocumentFormat.OpenXml SDK is licensed under the MIT license (MIT, -see below). - -The ExcelNumberFormat number parser is licensed under the MIT license (MIT, -see below). - -The FastMember reflection access is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The IdentityModel OpenID client is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The jose-jwt object signing and encryption is licensed under the -MIT license (MIT, see below). - -The ExcelDataReader is licensed under the MIT license (MIT, see below). - -Portions copyright (c) by OPC Foundation, Inc. and licensed under the -Reciprocal Community License (RCL, see below) - -The OPC UA Example Code of OPC UA Standard is licensed under the MIT license -(MIT, see below). - -The MSAGL (Microsoft Automatic Graph Layout) is licensed under the MIT license -(MIT, see below) - -Glob (https://www.nuget.org/packages/Glob/) is licensed under the MIT license -(MIT, see below). - -The Magick.NET library is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The SSharp.NET library (https://github.com/PetroProtsyk/SSharp) is licensed -under Apache License 2.0 (Apache-2.0, see below). - -------------------------------------------------------------------------------- - - -With respect to AASX Package Explorer -===================================== - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to cefSharp -======================== - -(https://raw.githubusercontent.com/cefsharp/CefSharp/master/LICENSE) - -Copyright © The CefSharp Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google Inc. nor the name Chromium Embedded - Framework nor the name CefSharp nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -With respect to Newtonsoft.Json -=============================== - -(https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md) - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to QRcoder -======================= - -(https://github.com/codebude/QRCoder/blob/master/LICENSE.txt) - -The MIT License (MIT) - -Copyright (c) 2013-2018 Raffael Herrmann - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to ZXing.Net -========================= -With respect to Grapevine -========================= -With respect to FastMember -========================== -With respect to IdentityModel -============================= - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - -With respect to MQTTnet -======================= - -(https://github.com/chkr1011/MQTTnet/blob/master/LICENSE) - -MIT License - -MQTTnet Copyright (c) 2016-2019 Christian Kratky - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to ClosedXML -========================= - -(https://github.com/ClosedXML/ClosedXML/blob/develop/LICENSE) - -MIT License - -Copyright (c) 2016 ClosedXML - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to CountryFlag -=========================== - -(https://www.codeproject.com/Articles/190722/WPF-CountryFlag-Control) - -The Code Project Open License (CPOL) 1.02 - -Copyright © 2017 Meshack Musundi - -Preamble - -This License governs Your use of the Work. This License is intended to allow -developers to use the Source Code and Executable Files provided as part of -the Work in any application in any form. - -The main points subject to the terms of the License are: - - Source Code and Executable Files can be used in commercial applications; - Source Code and Executable Files can be redistributed; and - Source Code can be modified to create derivative works. - No claim of suitability, guarantee, or any warranty whatsoever is provided. - The software is provided "as-is". - The Article(s) accompanying the Work may not be distributed or republished - without the Author's consent - -This License is entered between You, the individual or other entity reading or -otherwise making use of the Work licensed pursuant to this License and the -individual or other entity which offers the Work under the terms of this -License ("Author"). - -License - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS -CODE PROJECT OPEN LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT -AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED -UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE -TO BE BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS -CONTAINED HEREIN IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND -CONDITIONS. IF YOU DO NOT AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS -LICENSE, YOU CANNOT MAKE ANY USE OF THE WORK. - -Definitions. - "Articles" means, collectively, all articles written by Author which -describes how the Source Code and Executable Files for the Work may -be used by a user. - "Author" means the individual or entity that offers the Work under -the terms of this License. - "Derivative Work" means a work based upon the Work or upon the Work -and other pre-existing works. - "Executable Files" refer to the executables, binary files, -configuration and any required data files included in the Work. - "Publisher" means the provider of the website, magazine, CD-ROM, -DVD or other medium from or by which the Work is obtained by You. - "Source Code" refers to the collection of source code and -configuration files used to create the Executable Files. - "Standard Version" refers to such a Work if it has not been modified, -or has been modified in accordance with the consent of the Author, -such consent being in the full discretion of the Author. - "Work" refers to the collection of files distributed by the Publisher, -including the Source Code, Executable Files, binaries, data files, -documentation, whitepapers and the Articles. - "You" is you, an individual or entity wishing to use the Work and -exercise your rights under this License. - -Fair Use/Fair Use Rights. Nothing in this License is intended to reduce, -limit, or restrict any rights arising from fair use, fair dealing, -first sale or other limitations on the exclusive rights of the -copyright owner under copyright law or other applicable laws. - -License Grant. Subject to the terms and conditions of this License, the -Author hereby grants You a worldwide, royalty-free, non-exclusive, -perpetual (for the duration of the applicable copyright) license -to exercise the rights in the Work as stated below: - You may use the standard version of the Source Code or Executable -Files in Your own applications. - You may apply bug fixes, portability fixes and other modifications -obtained from the Public Domain or from the Author. A Work modified -in such a way shall still be considered the standard version and will -be subject to this License. - You may otherwise modify Your copy of this Work (excluding the Articles) -in any way to create a Derivative Work, provided that You insert a prominent -notice in each changed file stating how, when and where You changed that file. - You may distribute the standard version of the Executable Files and Source -Code or Derivative Work in aggregate with other (possibly commercial) -programs as part of a larger (possibly commercial) software distribution. - The Articles discussing the Work published in any form by the author may -not be distributed or republished without the Author's consent. The author -retains copyright to any such Articles. You may use the Executable Files and -Source Code pursuant to this License but you may not repost or republish or -otherwise distribute or make available the Articles, without the prior written -consent of the Author. - -Any subroutines or modules supplied by You and linked into the Source Code -or Executable Files of this Work shall not be considered part of this Work -and will not be subject to the terms of this License. - -Patent License. Subject to the terms and conditions of this License, each -Author hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, -royalty-free, irrevocable (except as stated in this section) patent license -to make, have made, use, import, and otherwise transfer the Work. - -Restrictions. The license granted in Section 3 above is expressly made subject -to and limited by the following restrictions: - You agree not to remove any of the original copyright, patent, trademark, -and attribution notices and associated disclaimers that may appear in the -Source Code or Executable Files. - You agree not to advertise or in any way imply that this Work is a product -of Your own. - The name of the Author may not be used to endorse or promote products -derived from the Work without the prior written consent of the Author. - You agree not to sell, lease, or rent any part of the Work. This does -not restrict you from including the Work or any part of the Work inside -a larger software distribution that itself is being sold. The Work by itself, -though, cannot be sold, leased or rented. - You may distribute the Executable Files and Source Code only under the terms -of this License, and You must include a copy of, or the Uniform Resource -Identifier for, this License with every copy of the Executable Files or -Source Code You distribute and ensure that anyone receiving such Executable -Files and Source Code agrees that the terms of this License apply to such -Executable Files and/or Source Code. You may not offer or impose any terms -on the Work that alter or restrict the terms of this License or the -recipients' exercise of the rights granted hereunder. You may not sublicense -the Work. You must keep intact all notices that refer to this License and to -the disclaimer of warranties. You may not distribute the Executable Files or -Source Code with any technological measures that control access or use of the -Work in a manner inconsistent with the terms of this License. - You agree not to use the Work for illegal, immoral or improper -purposes, or on pages containing illegal, immoral or improper material. -The Work is subject to applicable export laws. You agree to comply with all -such laws and regulations that may apply to the Work after Your receipt of -the Work. - -Representations, Warranties and Disclaimer. THIS WORK IS PROVIDED "AS IS", -"WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OR -CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE, -INCLUDING COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. -AUTHOR EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES -OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS -OF MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR -PURPOSE, OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK -(OR ANY PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES. -YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE -WORKS. - -Indemnity. You agree to defend, indemnify and hold harmless the Author and the -Publisher from and against any claims, suits, losses, damages, liabilities, -costs, and expenses (including reasonable legal or attorneys’ fees) -resulting from or relating to any use of the Work by You. - -Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, -IN NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL -THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY -DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE, -EVEN IF THE AUTHOR OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH DAMAGES. - -Termination. - This License and the rights granted hereunder will terminate -automatically upon any breach by You of any term of this License. -Individuals or entities who have received Derivative Works from You under -this License, however, will not have their licenses terminated provided such -individuals or entities remain in full compliance with those licenses. -Sections 1, 2, 6, 7, 8, 9, 10 and 11 will survive any termination of -this License. - If You bring a copyright, trademark, patent or any other infringement -claim against any contributor over infringements You claim are made by the -Work, your License from such contributor to the Work ends automatically. - Subject to the above terms and conditions, this License is perpetual -(for the duration of the applicable copyright in the Work). -Notwithstanding the above, the Author reserves the right to release the Work -under different license terms or to stop distributing the Work at any time; -provided, however that any such election will not serve to withdraw this -License (or any other license that has been, or is required to be, -granted under the terms of this License), and this License will continue -in full force and effect unless terminated as stated above. - -Publisher. The parties hereby confirm that the Publisher shall not, under -any circumstances, be responsible for and shall not have any liability -in respect of the subject matter of this License. The Publisher makes no -warranty whatsoever in connection with the Work and shall not be liable -to You or any party on any legal theory for any damages whatsoever, including -without limitation any general, special, incidental or consequential damages -arising in connection to this license. The Publisher reserves the right to -cease making the Work available to You at any time without notice - -Miscellaneous - This License shall be governed by the laws of the location of the head -office of the Author or if the Author is an individual, the laws of -location of the principal place of residence of the Author. - If any provision of this License is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of the -remainder of the terms of this License, and without further action by the -parties to this License, such provision shall be reformed to the minimum -extent necessary to make such provision valid and enforceable. - No term or provision of this License shall be deemed waived and no -breach consented to unless such waiver or consent shall be in writing -and signed by the party to be charged with such waiver or consent. - This License constitutes the entire agreement between the parties -with respect to the Work licensed herein. There are no understandings, -agreements or representations with respect to the Work not specified herein. -The Author shall not be bound by any additional provisions that may appear -in any communication from You. This License may not be modified without -the mutual written agreement of the Author and You. - - -With respect to DocumentFormat.OpenXml -====================================== - -(https://github.com/OfficeDev/Open-XML-SDK/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to ExcelNumberFormat -================================= - -(https://github.com/andersnm/ExcelNumberFormat/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2017 andersnm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to jose-jwt -======================== - -(https://github.com/dvsekhvalnov/jose-jwt/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014-2019 dvsekhvalnov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With resepect to ExcelDataReader -================================ - -(https://github.com/ExcelDataReader/ExcelDataReader/blob/develop/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014 ExcelDataReader - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepect to OPC UA Example Code -==================================== - - * Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. - * - * OPC Foundation MIT License 1.00 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * The complete license agreement can be found here: - * http://opcfoundation.org/License/MIT/1.00/ - - -With respect to OPC Foundation -============================== - -RCL License -Reciprocal Community License 1.00 (RCL1.00) -Version 1.00, June 24, 2009 -Copyright (C) 2008,2009 OPC Foundation, Inc., All Rights Reserved. - -https://opcfoundation.org/license/rcl.html - -Remark: PHOENIX CONTACT GmbH & Co. KG and Festo SE & Co. KG are members -of OPC foundation. - -With respect to MSAGL (Microsoft Automatic Graph Layout) -======================================================== -(see: https://github.com/microsoft/automatic-graph-layout/blob/master/LICENSE) - -Microsoft Automatic Graph Layout, MSAGL - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With respect to Glob (https://www.nuget.org/packages/Glob/) -=========================================================== -(see: https://raw.githubusercontent.com/kthompson/glob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2013-2019 Kevin Thompson - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to Magick.NET -========================== - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -With respect to SSharp.NET library -================================== - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/AasxCsharpLibrary.Tests/Properties/AssemblyInfo.cs b/src/AasxCsharpLibrary.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index e76309e43..000000000 --- a/src/AasxCsharpLibrary.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("AasxCsharpLibrary.TestsNew")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AasxCsharpLibrary.TestsNew")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("2f21feff-f0ef-40b5-ba05-09fc9f499ae9")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, -// indem Sie "*" wie unten gezeigt eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/AasxCsharpLibrary.Tests/TemporaryDirectory.cs b/src/AasxCsharpLibrary.Tests/TemporaryDirectory.cs deleted file mode 100644 index 94c002bf0..000000000 --- a/src/AasxCsharpLibrary.Tests/TemporaryDirectory.cs +++ /dev/null @@ -1,23 +0,0 @@ -using IDisposable = System.IDisposable; - -namespace AdminShellNS.Tests -{ - class TemporaryDirectory : IDisposable - { - public readonly string Path; - - public TemporaryDirectory() - { - this.Path = System.IO.Path.Combine( - System.IO.Path.GetTempPath(), - System.IO.Path.GetRandomFileName()); - - System.IO.Directory.CreateDirectory(this.Path); - } - - public void Dispose() - { - System.IO.Directory.Delete(this.Path, true); - } - } -} diff --git a/src/AasxCsharpLibrary.Tests/TestAdminShellUtil.cs b/src/AasxCsharpLibrary.Tests/TestAdminShellUtil.cs deleted file mode 100644 index b6ce2eac3..000000000 --- a/src/AasxCsharpLibrary.Tests/TestAdminShellUtil.cs +++ /dev/null @@ -1,28 +0,0 @@ -using NUnit.Framework; - -namespace AdminShellNS.Tests -{ - // ReSharper disable UnusedType.Global - public class Test_EvalToNonNullString - { - [Test] - public void NonNull_Gives_Formatted() - { - var result = AdminShellNS.AdminShellUtil.EvalToNonNullString( - "some message: {0}", 1984, "something else"); - - Assert.That(result, Is.EqualTo("some message: 1984")); - } - - [Test] - public void Null_Gives_ElseString() - { - var result = AdminShellNS.AdminShellUtil.EvalToNonNullString( - "some message: {0}", null, "something else"); - - Assert.That(result, Is.EqualTo("something else")); - } - } - // ReSharper restore UnusedType.Global - -} diff --git a/src/AasxCsharpLibrary.Tests/TestAgainstAasCorePackage.cs b/src/AasxCsharpLibrary.Tests/TestAgainstAasCorePackage.cs deleted file mode 100644 index dfe5fc069..000000000 --- a/src/AasxCsharpLibrary.Tests/TestAgainstAasCorePackage.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Text; -using NUnit.Framework; - -namespace AdminShellNS.Tests -{ - public class TestAgainstAasCorePackage - { - /** - * Retrieve the bytes of the valid XML file 01_Festo.aasx.xml from the - * test resources. - */ - private static byte[] Get01FestoAasxXmlBytes() - { - string pth = Path.Combine( - TestContext.CurrentContext.TestDirectory, - "TestResources\\AasxCsharpLibrary.Tests\\XmlValidation\\expectedOk\\" + - "01_Festo.aasx.xml"); - - if (!File.Exists(pth)) - { - throw new FileNotFoundException( - $"Could not find the XML file: {pth}"); - } - - return File.ReadAllBytes(pth); - } - - [Test] - public void TestThatSupplementaryMaterialIsLoaded() - { - var packaging = new AasCore.Aas3.Package.Packaging(); - using var tmpDir = new TemporaryDirectory(); - - var pth = System.IO.Path.Combine(tmpDir.Path, "dummy.aasx"); - - var supplUri = new Uri( - "/aasx-suppl/some-company/some-manual.pdf", - UriKind.Relative); - - var supplContent = Encoding.UTF8.GetBytes("some content"); - - // Create a package - { - using var pkg = packaging.Create(pth); - - var spec = pkg.MakeSpec( - pkg.PutPart( - new Uri("/aasx/some-company/data.xml", UriKind.Relative), - "text/xml", - Get01FestoAasxXmlBytes())); - - pkg.RelateSupplementaryToSpec( - pkg.PutPart( - supplUri, - "application/pdf", - supplContent), - spec); - - pkg.Flush(); - } - - // Load the AASX using AasxCsharpLibrary - { - using var package = new AdminShellPackageEnv(pth); - - Assert.IsTrue(package.IsOpen); - - var lst = package.GetListOfSupplementaryFiles(); - - Assert.AreEqual(1, lst.Count); - var suppl = lst.First(); - Assert.AreEqual(supplUri, suppl.Uri); - Assert.AreEqual( - Encoding.UTF8.GetString(supplContent), - Encoding.UTF8.GetString( - package.GetByteArrayFromUriOrLocalPackage( - suppl.Uri.ToString())) - ); - } - } - } -} \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestLoadSaveChain.cs b/src/AasxCsharpLibrary.Tests/TestLoadSaveChain.cs deleted file mode 100644 index 48b7b66a9..000000000 --- a/src/AasxCsharpLibrary.Tests/TestLoadSaveChain.cs +++ /dev/null @@ -1,189 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; -using Environment = System.Environment; -using InvalidOperationException = System.InvalidOperationException; -using Path = System.IO.Path; - -namespace AdminShellNS.Tests -{ - static class SamplesAasxDir - { - public static List ListAasxPaths() - { - var variable = "SAMPLE_AASX_DIR"; - - var sampleAasxDir = System.Environment.GetEnvironmentVariable(variable); - if (sampleAasxDir == null) - { - throw new InvalidOperationException( - $"The environment variable {variable} has not been set. " + - "Did you set it manually to the directory containing sample AASXs? " + - "Otherwise, run the test through Test.ps1?"); - } - - if (!System.IO.Directory.Exists(sampleAasxDir)) - { - throw new InvalidOperationException( - $"The directory containing the sample AASXs does not exist or is not a directory: " + - $"{sampleAasxDir}; did you download the samples with DownloadSamples.ps1?"); - } - - var result = System.IO.Directory.GetFiles(sampleAasxDir) - .Where(p => System.IO.Path.GetExtension(p) == ".aasx") - .ToList(); - - result.Sort(); - - return result; - } - } - - /* - TODO (mristin, 2020-10-05): The class is unused since all its tests were disabled temporarily and - will be fixed in the near future. - - Once the tests are enabled, please remove this Resharper directive. - */ - // ReSharper disable once UnusedType.Global - public class TestLoadSaveChain - { - private static void AssertFilesEqual(string firstPath, string secondPath, string aasxPath) - { - string firstContent = System.IO.File.ReadAllText(firstPath); - string secondContent = System.IO.File.ReadAllText(secondPath); - - string[] firstLines = firstContent.Split( - new[] { "\r\n", "\r", "\n" }, - System.StringSplitOptions.None - ); - - string[] secondLines = secondContent.Split( - new[] { "\r\n", "\r", "\n" }, - System.StringSplitOptions.None - ); - - int min = (firstLines.Length < secondLines.Length) - ? firstLines.Length - : secondLines.Length; - - for (var i = 0; i < min; i++) - { - if (firstLines[i] != secondLines[i]) - { - int start = (i < 20) ? 0 : i - 20; - var sb = new System.Text.StringBuilder(); - sb.AppendLine("The first and the second export in the chain differ:"); - - for (var j = start; j < i; j++) - { - sb.AppendLine($"[{i,6}:SAME IN BOTH]{firstLines[j]}"); - } - - sb.AppendLine($"[{i,6}:IN FIRST ]{firstLines[i]}"); - sb.AppendLine($"[{i,6}:IN SECOND ]{secondLines[i]}"); - - sb.AppendLine($"The AASX sample used was: {aasxPath}"); - throw new AssertionException(sb.ToString()); - } - } - } - - /* - TODO (mristin, 2020-10-05): This test has been temporary disabled so that we can merge in the branch - MIHO/EnhanceDocumentShelf. The test should be fixed in a future pull request and we will then re-enable it - again. - - Please do not forget to remove the Resharper directive at the top of this class. - - [TestCase(".xml")] - - dead-csharp ignore this comment - */ - public void TestLoadSaveLoadAssertEqual(string extension) - { - List aasxPaths = SamplesAasxDir.ListAasxPaths(); - - using var tmpDir = new TemporaryDirectory(); - foreach (string aasxPath in aasxPaths) - { - /* - * The chain is as follows: - * - First load from AASX (package A) - * - Convert package 1 to `extension` format and save as path 1 - * - Load from the path 1 in `extension` format (package B) - * - Save package B in `extension` format to path 2 - * - * We expect the content of the two files (path 1 and path 2, respectively) to be equal. - */ - using var packageA = new AdminShellPackageEnv(aasxPath); - string path1 = System.IO.Path.Combine(tmpDir.Path, $"first{extension}"); - string path2 = System.IO.Path.Combine(tmpDir.Path, $"second{extension}"); - - packageA.SaveAs(path1, writeFreshly: true); - - using var packageB = new AdminShellPackageEnv(path1); - packageB.SaveAs(path2, writeFreshly: true); - AssertFilesEqual(path1, path2, aasxPath); - } - } - - - /* - TODO (mristin, 2020-10-05): This test has been temporary disabled so that we can merge in the branch - MIHO/EnhanceDocumentShelf. The test should be fixed in a future pull request and we will then re-enable it - again. - - Please do not forget to remove the Resharper directive at the top of this class. - - [Test] - - dead-csharp ignore this comment - */ - public void TestLoadSaveXmlValidate() - { - var validator = AasSchemaValidation.NewXmlValidator(); - - List aasxPaths = SamplesAasxDir.ListAasxPaths(); - - using var tmpDir = new TemporaryDirectory(); - string tmpDirPath = tmpDir.Path; - - foreach (string aasxPath in aasxPaths) - { - using var package = new AdminShellPackageEnv(aasxPath); - /* - TODO (mristin, 2020-09-17): Remove autofix once XSD and Aasx library in sync - - Package has been loaded, now we need to do an automatic check & fix. - - This is necessary as Aasx library is still not conform with the XSD AASX schema and breaks - certain constraints (*e.g.*, the cardinality of langString = 1..*). - */ - var recs = package.AasEnv.ValidateAll(); - if (recs != null) - { - package.AasEnv.AutoFix(recs); - } - - // Save as XML - string name = Path.GetFileName(aasxPath); - string outPath = System.IO.Path.Combine(tmpDirPath, $"{name}.converted.xml"); - package.SaveAs(outPath, writeFreshly: true); - - using var fileStream = System.IO.File.OpenRead(outPath); - var records = new AasValidationRecordList(); - validator.Validate(records, fileStream); - if (records.Count != 0) - { - var parts = new List - { - $"Failed to validate XML file exported from {aasxPath} to {outPath}:" - }; - parts.AddRange(records.Select((r) => r.Message)); - throw new AssertionException(string.Join(Environment.NewLine, parts)); - } - } - } - } -} diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/01_Festo.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/01_Festo.aasx.xml deleted file mode 100644 index ac57a24bd..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/01_Festo.aasx.xml +++ /dev/null @@ -1,8384 +0,0 @@ - - - - - Festo_3S7PM0CP4BD - CONSTANT - smart.festo.com/demo/aas/1/1/454576463545648365874 - - - HTTP://PK.FESTO.COM/3S7PM0CP4BD - - - - - - www.company.com/ids/sm/4343_5072_7091_3242 - - - - - www.company.com/ids/sm/2543_5072_7091_2660 - - - - - www.company.com/ids/sm/6053_5072_7091_5102 - - - - - www.company.com/ids/sm/6563_5072_7091_4267 - - - - - smart.festo.com/demo/sm/instance/1/1/13B7CCD9BF7A3F24 - - - - - - - - - FPK_3s7plfdrs35 - - Festo OVEL Vacuum generator - Festo OVEL Vakuumsaugdüse - - HTTP://PK.FESTO.COM/3S7PM0CP4BD - Instance - - - - - Nameplate - www.company.com/ids/sm/4343_5072_7091_3242 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Festo AG & Co. KG - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - OVEL Vacuum generator - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Ruiter Straße 82 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 73734 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Esslingen-Berkheim - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Baden-Württemberg - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - OVEL-5-H-10-P-VQ4-UA-Z-C-A-V1PNLK-H3 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - JO43 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - DE - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - integer - 2019 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - 0173-1#07-CAA016#001 - - - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - Marking_CRUUS - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CRUUSLabelingPresent - PARAMETER - - - 0173-1#02-AAR528#005 - - - Instance - - boolean - 1 - - - 0173-1#07-CAA016#001 - - - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_cruus.jpg - - - - false - false - - - - - Marking_RCM - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - RCMLabelingPresent - PARAMETER - - - 0173-1#02-AAR528#005 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_rcm.jpg - - - - false - false - - - - - - Document - www.company.com/ids/sm/2543_5072_7091_2660 - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Festo - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Festo AG & Co. KG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Erklärung zur CE-Kennzeichnung bei Produkten der Festo AG & Co.KG - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - CE_Kennzeichnung_2016_de.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/CE_Kennzeichnung_2016_de.pdf - - - - false - false - - - - - DeclarationRoHS - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Festo - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Festo AG & Co. KG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - RoHS 2011/65/EU und delegierte Fassung (EU) 2015/863 - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - RoHS_2011_65_EU_Konzern_Information_de.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/RoHS_2011_65_EU_Konzern_Information_de.pdf - - - - false - false - - - - - DeclarationCRUUS - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - UL - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Underwriter Laboratories LLC - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Certificate of compliance - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - SPAE_UL_4531318_-_2_EN.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/SPAE_UL_4531318_-_2_EN.pdf - - - - false - false - - - - - DeclarationIOLink - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Festo - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Festo AG & Co. KG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Manufacturer's declaration of conformity - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - OVEL_IO_Link_5439356_-_3_EN.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/OVEL_IO_Link_5439356_-_3_EN.pdf - - - - false - false - - - - - Manual_OVEL_EN - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - 8070874 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Festo - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Festo AG & Co. KG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 2017-05 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Operating instructions Vacuum generator OVEL - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - The OVEL vacuum generator is used to generate a vacuum. - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - OVEL_2017-05_8070876g1_EN.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/OVEL_2017-05_8070876g1_EN.pdf - - - - false - false - - - - - Manual_OVEL_DE - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - 8070874 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Festo - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Festo AG & Co. KG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 2017-05 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Bedienungsanleitung Vakuumsaugdüse OVEL - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - Die Vakuumsaugdüse OVEL wird bestimmungsgemäß zur Erzeugung von Vakuum eingesetzt. - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - OVEL_2017-05_8070875d1_DE.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/OVEL_2017-05_8070875d1_DE.pdf - - - - false - false - - - - - Manual_SPAE_EN - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - 8058480 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Festo - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Festo AG & Co. KG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 2017-03b - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Operating instructions Pressure sensor SPAE - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - The SPAE pressure sensor is intended for measuring the relative pressure in pneumatic applications. The SPAE converts pneumatic pressure values into a pressure proportional voltage. The measurement result is shown on the display. - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - SPAE_2017-03b_8058481d1_EN.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/SPAE_2017-03b_8058481d1_EN.pdf - - - - false - false - - - - - Manual_SPAE_DE - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - 8058480 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Festo - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Festo AG & Co. KG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 2017-03b - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Bedienungsanleitung Drucksensor SPAE - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - Der Drucksensor SPAE dient bestimmungsgemäß zur Erfassung des Relativdrucks in Pneumatikapplikationen. Der SPAE wandelt pneumatische Druckwerte in eine druckproportionale Spannung. Das Messergebnis wird im Display angezeigt. - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - SPAE_2017-03b_8058481d1_DE.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/SPAE_2017-03b_8058481d1_DE.pdf - - - - false - false - - - - - ApplicationNote_SPAE_EN - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Festo - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Festo AG & Co. KG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 1.10 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Application Note IO-Link parameter description - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - A brief explanation of the contents (identification, parameter and commands, block parameterization, teach-In, process data, using different pressure units, diagnosis) - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - 09.02.2015 - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - SPAE_100017_ApplNote.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/SPAE_100017_ApplNote.pdf - - - - false - false - - - - - - Service - www.company.com/ids/sm/6053_5072_7091_5102 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Festo AG & Co. KG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Ruiter Straße 82 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 73734 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Esslingen-Berkheim - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Baden-Württemberg - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - technikservice@festo.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - string - https://www.festo.com - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49711347-3000 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - +49711 347-2190 - - - - false - false - - - - - - Identification - www.company.com/ids/sm/6563_5072_7091_4267 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Festo AG & Co. KG - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - 2220000020640 - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - - - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - - - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - OVEL Vacuum generator - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - Compact vacuum generator with IO-Link sensor - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Festo AG & Co. KG - - - - - GLNOfSupplier - PARAMETER - - - 0173-1#02-AAY813#001 - - - Instance - - string - 2220000020640 - - - - - SupplierIdProvider - PARAMETER - - - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - Instance - - - - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Instance - - - - - - - - SupplierProductDesignation - - - 0173-1#02-AAM551#002 - - - Instance - - string - OVEL Vacuum generator - - - - - SupplierProductDescription - PARAMETER - - - 0173-1#02-AAU730#001 - - - Instance - - langString - Compact vacuum generator with IO-Link sensor - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - OVEL-5-H-10-P-VQ4-UA-Z-C-A-V1PNLK-H3 - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eclass - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - https://www.hsu-hh.de/aut/aas/thumbnail - - - Instance - - image/jpeg - /Festo_OVEL_product_rendering.png - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - anyURI - HTTP://PK.FESTO.COM/3S7PM0CP4BD - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - smart.festo.com/demo/aas/1/1/454576463545648365874 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - date - - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Festo AG & Co. KG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - langString - Ruiter Straße 82 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 73734 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Esslingen-Berkheim - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Baden-Württemberg - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - technikservice@festo.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.festo.com - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49711347-3000 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - +49711 347-2190 - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/assetIdentification/logo.png - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://pk.festo.com/3s7plfdrs35 - - - - - - DeviceDescriptionFiles - smart.festo.com/demo/sm/instance/1/1/13B7CCD9BF7A3F24 - - - http://admin-shell/sample/submodel/type/device-description-files - - - Instance - - - - - IODD - - - http://admin-shell.io/sample/conceptdescriptions/437857438753457473 - - - Instance - - application/general - /aasx/Software/Festo-SPAE-kPa-20171025-IODD1.1.zip - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - https://www.hsu-hh.de/aut/aas/thumbnail - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - TelephoneContact - https://www.hsu-hh.de/aut/aas/ContactInfo/TelephoneContact - - - - - - - - Telephone Contact - Telefonkontakt - - TelephoneContact - - - - - Sammlung für Kontaktdaten über Telefon - Collection for contact data via telephone - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - CRUUSLabelingPresent - 0173-1#02-AAR528#005 - - - - - - - - Kennzeichnung (RCM) vorhanden - RCM labeling present - - CRUUSLabelingPresent - - - BOOLEAN - - indication whether the product is equipped with a specified RCM labeling - Angabe, ob das Produkt mit einer spezifizierten RCM-Kennzeichnung ausgestattet ist - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - ValString - www.company.com/ids/cd/4490_8182_7091_6124 - - - - - - - - Wert - Value String - - ValString - - - - - Ausdruck für den Wert der übergeordneten Collection. - Value string for the collection value on the next superordinate level - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentIdDomain - www.company.com/ids/cd/6003_8182_7091_9350 - - - - - - - - DocumentIdDomain - DocumentIdDomain - - DocumentIdDomain - - - - - Angabe einer Liste von Domänen, in de-nen die DocumentIds des Dokuments eindeutig sind - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Party - www.company.com/ids/cd/3153_8182_7091_4327 - - - - - - - - Party - Party - - Party - - - - - Verweis auf eine Party (siehe VDI 2770 Anhang C1.17), die für diese Domäne verantwortlich ist - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_Organisation - www.company.com/ids/cd/9214_8182_7091_6391 - - - - - - - - Organisation - Organisation - - Organisation - - - - - Angabe einer Organisation - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersion - www.company.com/ids/cd/2580_0282_7091_6213 - - - - - - - - Dokumenten-Version - DocumentVersion - - DocumentVersion - - - - - Zu jedem Dokument muss eine Menge von mindestens einer Dokumentenversion existieren. Es können auch mehrere Dokumentenversionen ausgeliefert werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - VDI2770_Language - www.company.com/ids/cd/0231_0282_7091_5062 - - - - - - - - Sprache - Language - - Language - - - - - Liste der im Dokument verwendeten Sprachen - TBD - - - - - - - DocumentVersion_Description - www.company.com/ids/cd/9151_0282_7091_8032 - - - - - - - - Beschreibung zur DocumentVersion - DocumentVersion Description - - DocumentVersion_Description - - - - - Zusammenfassende Beschreibungen zur Dokumentenversion in ggf. unterschiedlichen Sprachen. - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_LifeCycleStatus - www.company.com/ids/cd/0282_0282_7091_7878 - - - - - - - - Lebenszyklus Status - LifeCycleStatus - - LifeCycleStatus - - - - - Liste von Statusdefinitionen mit Bezug zum Dokumentenlebenszyklus inklusive der Angabe der Beteiligten und einem zugehörigen Zeitstempel - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - DocumentRelationship - www.company.com/ids/cd/1204_0282_7091_7896 - - - - - - - - Dokumenten-Beziehung - Document Relationship - - DocumentRelationship - - - - - Liste von Beziehungen zu anderen Dokumenten. Es ist möglich, auf einen Dokument, ein Dokument in einer spezifischen Dokumentenversion oder auch ein Teildokument zu verweisen. - TBD - - - - - - - DocumentRelationship_Type - www.company.com/ids/cd/5044_0282_7091_6924 - - - - - - - - Typ der Dokumenten-Beziehung - DocumentRelationship_Type - - DocumentRelationship_Type - - - - - Typisierung der Beziehung zwischen den beiden DocumentVersions. Folgende Beziehungsarten können verwendet werden: Affecting (hat Auswirkungen auf), ReferesTo (bezieht sich auf), BasedOn (basiert auf) - TBD - - - - - - - StoredDocumentRepresentation - www.company.com/ids/cd/3094_0282_7091_2090 - - - - - - - - StoredDocumentRepresentation - StoredDocumentRepresentation - - StoredDocumentRepresentation - - - - - Liste von digitalen Repräsentationen zur DocumentVersion - TBD - - - - - - - VDI2770_DigitalFile - www.company.com/ids/cd/2305_0282_7091_2077 - - - - - - - - Digitaler-File - DigitalFile - - DigitalFile - - - - - Datei, die die DocumentVersion (siehe VDI 2770:2018 Anhang C1.5) repräsentiert Neben der obligatorischen PDF/A-Datei können weitere Dateien angegeben werden. - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_ReferencedObject - www.company.com/ids/cd/2570_2282_7091_0055 - - - - - - - - ReferencedObject - ReferencedObject - - ReferencedObject - - - - - Liste von IDs für ein Objekt, auf das sich das Dokument bezieht - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - DocGroup_01 - www.company.com/ids/cd/1420_0113_7091_0891 - - - - - - - - 01 Identifikation - 01 Identification - - DocGroup_01 - - - - - Der Gruppe „Identifikation“ werden alle Dokumente zugeordnet, die der Identifikation des Objekts dienen, zu dem die Herstellerdokumentation gehört. Sie enthält insbesondere Informationen, die die elektronische Datenverarbeitung unterstützen und die es dem Hersteller und dem Nutzer erlauben, das Objekt in ihren jeweiligen elektronischen Datenverarbeitungssystemen zu identifizieren. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocGroup_02 - www.company.com/ids/cd/4323_0113_7091_2591 - - - - - - - - 02 Technische Beschaffenheit - 02 Technical characteristics - - DocGroup_02 - - - - - Die Gruppe „Technische Beschaffenheit“ beinhaltet alle Dokumente, die die technischen Anforderungen, deren Erfüllung und die Bescheinigung der Eigenschaften eines Objekts betreffen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocGroup_03 - www.company.com/ids/cd/5053_0113_7091_5741 - - - - - - - - 03 Tätigkeitsbezogene Dokumente - 03 Work-related documents - - DocGroup_03 - - - - - Die Gruppe „Tätigkeitsbezogene Dokumente“ beinhaltet alle Dokumente, die Anforderungen, Hinweise und Hilfestellungen für Tätigkeiten an und mit dem Objekt nach der Übergabe an den Nutzer betreffen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocGroup_04 - www.company.com/ids/cd/5473_0113_7091_1588 - - - - - - - - 04 Vertragsunterlagen - 04 Contract documents - - DocGroup_04 - - - - - Der Gruppe „Vertragsunterlagen“ werden alle Dokumente zugeordnet, die im Zusammenhang mit der kaufmännischen Abwicklung eines Vertrages stehen, aber nicht selbst Gegenstand des Vertrags sind und lediglich zur Erfüllung des Vertrags dienen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_01-01 - www.company.com/ids/cd/9593_0113_7091_2401 - - - - - - - - 01-01 Identifikation - 01-01 Identification - - DocCategory_01-01 - - - - - Der Kategorie „Identifikation“ werden alle Dokumente zugeordnet, die der Identifikation des Objekts dienen, zu dem die Herstellerdokumentation gehört. Sie enthält insbesondere Informationen, die die elektronische Datenverarbeitung unterstützen und die es dem Hersteller und dem Nutzer erlauben, das Objekt in ihren jeweiligen elektronischen Datenverarbeitungssystemen zu identifizieren. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_02-01 - www.company.com/ids/cd/5314_0113_7091_8640 - - - - - - - - 02-01 Techn. Spezifikation - 02-01 Technical specification - - DocCategory_02-01 - - - - - Der Kategorie „Technische Spezifikation“ werden alle Dokumente zugeordnet, die die Anforderungen an ein Objekt sowie dessen Eigenschaften beschreiben. Dazu gehören die Auslegungsdaten, Berechnungen (Verfahrenstechnik, Festigkeit usw.) sowie alle relevanten Eigenschaften des übergebenen Objekts. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_02-02 - www.company.com/ids/cd/5515_0113_7091_8581 - - - - - - - - 02-02 Zeichnungen, Pläne - 02-02 Drawings and diagrams - - DocCategory_02-02 - - - - - Der Kategorie „Zeichnungen, Pläne“ werden alle Dokumente zugeordnet, die Zeichnungscharakter haben, das heißt eine grafische Darstellung zur Übermittlung von Information nutzen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_02-03 - www.company.com/ids/cd/0335_0113_7091_0312 - - - - - - - - 02-03 Bauteile - 02-03 Components - - DocCategory_02-03 - - - - - Der Kategorie „Bauteile“ werden alle Dokumente zugeordnet, die eine strukturierte Auflistung der Teile eines Objekts beinhalten. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_02-04 - www.company.com/ids/cd/2155_0113_7091_3955 - - - - - - - - 02-04 Zeugnisse, Zertifikate, Bescheinigungen - 02-04 Reports, Certificates, declarations - - DocCategory_02-04 - - - - - Der Kategorie „Zeugnisse, Zertifikate, Bescheinigungen“ werden alle Dokumente zugeordnet, die Urkundencharakter haben. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-01 - www.company.com/ids/cd/3565_0113_7091_2704 - - - - - - - - 03-01 Montage, Inbetriebnahme, Demontage - 03-01 Assembly, commissioning, disassembly - - DocCategory_03-01 - - - - - Der Kategorie „Montage, Demontage“ werden alle Dokumente zugeordnet, die Tätigkeiten und Maßnahmen beschreiben, die erforderlich sind, um ein Objekt: zu transportieren oder zu lagern, als Ganzes in ein übergeordnetes Objekt einzubauen, auszubauen oder an dieses anzuschließen, so weit vorzubereiten, dass es zur Inbetriebnahme bereitsteht, nach Abschluss der Nutzungsphase zu demontieren und zu entsorgen - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-02 - www.company.com/ids/cd/4290_1113_7091_7266 - - - - - - - - 03-02 Bedienung - 03-02 Operation - - DocCategory_03-02 - - - - - Der Kategorie „Bedienung“ werden Dokumente zur bestimmungsgemäßen Verwendung und sicheren Bedienung eines Objekts zugeordnet. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-03 - www.company.com/ids/cd/2211_1113_7091_3911 - - - - - - - - 03-03 Allgemeine Sicherheit - 03-03 Safety in general - - DocCategory_03-03 - - - - - Der Kategorie „Allgemeine Sicherheit“ werden Dokumente zugeordnet, die Sicherheitshinweise auf mögliche Gefährdungen bei der Verwendung des Objekts geben. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-04 - www.company.com/ids/cd/7521_1113_7091_4471 - - - - - - - - 03-04 Inspektion, Wartung, Prüfung - 03-04 Inspection, maintenance, test - - DocCategory_03-04 - - - - - Der Kategorie „Inspektion, Wartung, Prüfung“ werden alle Dokumente zugeordnet, die vom Hersteller vorgeschlagene wiederkehrende Maßnahmen zur Feststellung oder zum Erhalt des funktionsfähigen Zustands beschreiben. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-05 - www.company.com/ids/cd/5161_1113_7091_0458 - - - - - - - - 03-05 Instandsetzung - 03-05 Repair - - DocCategory_03-05 - - - - - Der Kategorie „Instandsetzung“ werden alle Dokumente zugeordnet, die Maßnahmen zur Wiederherstellung der Funktion eines Objekts betreffen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-06 - www.company.com/ids/cd/2181_1113_7091_5948 - - - - - - - - 03-06 Ersatzteile - 03-06 Spare parts - - DocCategory_03-06 - - - - - Der Kategorie „Ersatzteile“ werden Dokumente zugeordnet, die Informationen zu Ersatzteilen und Hilfs- und Betriebsstoffen enthalten. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_04-01 - www.company.com/ids/cd/5391_1113_7091_8996 - - - - - - - - 04-01 Vertragsunterlagen - 04-01 Contract documents - - DocCategory_04-01 - - - - - Der Kategorie „Vertragsunterlagen“ werden alle Dokumente zugeordnet, die im Zusammenhang mit der kaufmännischen Abwicklung eines Vertrages stehen, aber nicht selbst Gegenstand des Vertrags sind und lediglich zur Erfüllung des Vertrags dienen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/02_Bosch.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/02_Bosch.aasx.xml deleted file mode 100644 index 43b134291..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/02_Bosch.aasx.xml +++ /dev/null @@ -1,6811 +0,0 @@ - - - - - Bosch_NexoPistolGripNutrunner - http://boschrexroth.com/shells/0608842005/917004878 - - - http://dc-qr.com?m=0608842005&s=917004878 - - - - - - http://boschrexroth.com/shells/0608842005/917004878/submodels/nameplate - - - - - http://boschrexroth.com/shells/0608842005/917004878/submodels/document - - - - - http://boschrexroth.com/shells/0608842005/917004878/submodels/service - - - - - http://boschrexroth.com/shells/0608842005/917004878/submodels/identification - - - - - - - - - M0608842005_S917004878 - http://dc-qr.com?m=0608842005&s=917004878 - Instance - - - - - Nameplate - http://boschrexroth.com/shells/0608842005/917004878/submodels/nameplate - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Bosch Rexroth AG - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Nexo Wi-Fi Cordless Nutrunner - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Fornsbacher Straße 92 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 71540 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Murrhardt - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Baden-Württemberg - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - Cordless Nutrunner - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 917004878 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - DE - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - xxxxxxxxxxxxxxxxxxxxxxx - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - - Document - http://boschrexroth.com/shells/0608842005/917004878/submodels/document - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - DCTC-30434-002_KOE_M_NN_2019-01-01 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 2019-01-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - EG-Konformitätserklärung - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - DCTC-30434-002_KOE_M_NN_2019-01-01.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/DCTC-30434-002_KOE_M_NN_2019-01-01.pdf - - - - false - false - - - - - EU_Declaration_of_Conformity - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - DCTC-30434-002:2019-01-01 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 2019-01-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de/en/fr/es/pt/it/pl/cs/sk/hu/bg/da/et/fi/el/hr/lv/lt/nl/ro/sv/sl/ru/zh/ar/id/ja/ko/no/th/tr/vi - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - EU-Konformitätserklärung (DE) EU Declaration of Conformity (EN) - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - EU_Declaration_of_Conformity.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/EU_Declaration_of_Conformity.pdf - - - - false - false - - - - - Certificat_ISO_9001_2015 - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Zertifikat für Bosch Rexroth AG Normen ISO 9001:2015 - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - DCMC-01001-000_KOB_N_EN_2019-06-14.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/DCMC-01001-000_KOB_N_EN_2019-06-14.pdf - - - - false - false - - - - - 3608870EF2_OperatingInstructions - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - 3608870EF2 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - AC / 01.2018 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en-US/​cs-CZ/​de-DE/​es-ES/​fr-FR/​hu-HU/​it-IT/​pl-PL/​pt-BR/​sl-SI/​ru-RU/​zh-CN - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - NXA, NXP, NXV012T - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - 3608870EF2_AC.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/3608870EF2_AC.pdf - - - - false - false - - - - - 3608870A47_ProjectPlanning_DE - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - 3 608 870 A47_DE - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - A47/05.2017 DE - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Rexroth Funk-Akkuschrauber Nexo - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - 3608870A47_AE_DE.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/3608870A47_AE_DE.pdf - - - - false - false - - - - - 3608870A47_ProjectPlanning_EN - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - 3 608 870 A47_EN - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Operating - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - A47/05.2017 EN - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Nexo cordless Wi-Fi nutrunner by Rexroth - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - 3608870A47_AE_EN.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/3608870A47_AE_EN.pdf - - - - false - false - - - - - 36088702_SafetyInstructions_DE - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - 3 608 870 2DE - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-03 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Allgemeine Sicherheit - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - AA/01.2010 DE - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Sicherheitshinweise für Rexroth Schraubsysteme - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - 36088702DE_AA.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/36088702DE_AA.pdf - - - - false - false - - - - - 36088702_SafetyInstructions_EN - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - 3 608 870 2EN - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-03 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - General Safety - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - AA/01.2010 EN - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Safety Instructions for Rexroth Tightening Systems - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - 36088702EN_AA.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/36088702EN_AA.pdf - - - - false - false - - - - - - Service - http://boschrexroth.com/shells/0608842005/917004878/submodels/service - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Bosch Rexroth AG Service Tightening Systems - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Bgm.-Dr.-Nebel-Str. 8 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Lohr - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - service@boschrexroth.de - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.boschrexroth.com/de/de/service/startseite-service - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +499352405060 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - - Identification - http://boschrexroth.com/shells/0608842005/917004878/submodels/identification - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Bosch Rexroth AG - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - 4048118000006 - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - string - GLN GS1 - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - string - 0608842005 - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - NXP012QD-36V - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - The most intelligent hand-held nutrunner in the world - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - Cordless Nutrunner - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eCl@ss - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /ST_Mittelgriffschrauber_NXP_Produktbild_V01_20160822_161306.jpg - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - http://dc-qr.com?m=0608842005&s=917004878 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 917004878 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - - 2019 - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Bosch Rexroth AG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Zum Eisengießer 1 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Lohr am Main - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - service@boschrexroth.de - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.boschrexroth.com/de/de/home/index - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +499352405060 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/Identification/logo.png - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - http://dc-qr.com?m=0608842005&s=917004878 - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/4401_1272_7091_3437 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/03_Bosch.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/03_Bosch.aasx.xml deleted file mode 100644 index 59ae3d081..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/03_Bosch.aasx.xml +++ /dev/null @@ -1,13753 +0,0 @@ - - - - - Bosch_R901509807_1201694127 - https://boschrexroth.com/ids/aas?p=p652370&m=R90150807&s=1201694127 - - - http://dc-qr.com?m=R901509807&s=1&f=1202044787 - - - - - - http://boschrexroth.com/ids/sm/4343_5072_7091_3242 - - - - - http://boschrexroth.com/ids/sm/2543_5072_7091_2660 - - - - - http://boschrexroth.com/ids/sm/6053_5072_7091_5102 - - - - - http://boschrexroth.com/ids/sm/6563_5072_7091_4267 - - - - - - - - - R901509807_1202044787 - http://dc-qr.com?m=R901509807&s=1&f=1202044787 - Instance - - - - - Nameplate - http://boschrexroth.com/ids/sm/4343_5072_7091_3242 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Bosch Rexroth AG - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - 4WRPEH 6 C3 B40L-3X/M/24L1 - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Zum Eisengießer 1 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Lohr am Main - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - High-respones directional valve, direct operated - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 1201694127 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - DE - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - 2019 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - Marking_IO-Link - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - IO-LinkMarkingPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/Logo_IO-link.jpg - - - - false - false - - - - - Connector_IO-Link - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - IO-LinkConnectorPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/IO_Link_Steckerbelegung.png - - - - false - false - - - - - - Document - http://boschrexroth.com/ids/sm/2543_5072_7091_2660 - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - www.company.com/ids/sm/2543_5072_7091_2660 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - DCTC-31003-003_KOE_N_DE_2016-07-20 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2016-07-20 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - EG-Konformitatserklarung - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - DCTC-31003-003_KOE_N_DE_2016-07-20.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/DCTC-31003-003_KOE_N_DE_2016-07-20.pdf - - - - false - false - - - - - Declaration_IO-Link - PARAMETER - - - www.company.com/ids/sm/2543_5072_7091_2660 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - DCTC-31000-136_HEK_N_EN_2019-09-18 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-09-18 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - HerstellererklärungIO-Link - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - DCTC-31000-136_HEK_N_EN_2019-09-18.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/DCTC-31000-136_HEK_N_EN_2019-09-18.pdf - - - - false - false - - - - - Certificat_DIN_EN_ISO_14001_2015 - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - string - Lohr_Bosch-Rexroth-AG_ISO_14001_BR_Matrix_en_20090723 - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Zertifikat für Bosch Rexroth AG Normen DIN EN ISO 14001:2015 - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - Lohr_Bosch-Rexroth-AG_ISO_14001_BR_Matrix_en_20090723 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/Lohr_Bosch-Rexroth-AG_ISO_14001_BR_Matrix_en_20090723.pdf - - - - false - false - - - - - Datasheet_4WRPEH6-3x-EN - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - RE29131 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Technische Spezifikation - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-02 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Datasheet: Directional control valves, direct operated, with electrical position feedback and integrated electronics (OBE) - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - re29121_2019-02 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/re29121_2019-02.pdf - - - - false - false - - - - - UserManual_4WRPEH6-3x_EN - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - RE07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - RE07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/RE07600-B_web_01_2019.pdf - - - - false - false - - - - - Parameter_IO-Link_EN - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - RE29400 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - string - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Technische Spezifikation - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Parameter description: High-response directional valves with electrical position feedback and IO-Link interface - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - RE29400_01-2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/RE29400_01-2019.pdf - - - - false - false - - - - - UserManual_4WRPEH6-3x_DE - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - RD07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - RD07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/RD07600_web_01_2019.pdf - - - - false - false - - - - - UserManual_4WRPEH6-3x_RO - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - RU07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - ro - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - RU07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/RU07600-B_web_01_2019.pdf - - - - false - false - - - - - UserManual_4WRPEH6-3x_ES - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - RS07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - es - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - RS07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/RS07600-B_web_01_2019.pdf - - - - false - false - - - - - UserManual_4WRPEH6-3x_FI - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R-SF07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - fi - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R-SF07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R-SF07600_01_2019_web.pdf - - - - false - false - - - - - UserManual_4WRPEH6-3x_FR - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - RF07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - fr - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - RF07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/RF07600-B_web_01_2019.pdf - - - - false - false - - - - - UserManual_4WRPEH6-3x_NL - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R-NL07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - nl - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R-NL07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R-NL07600-B_web_01_2019.pdf - - - - false - false - - - - - UserManual_4WRPEH6-3x_PL - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R-PL07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - pl - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R-PL07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R-PL07600-B_web_01_2019 - - - - false - false - - - - - UserManual_4WRPEH6-3x_PT - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - RP07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - pt - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - RP07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/RP07600-B_web_01_2019.pdf - - - - false - false - - - - - UserManual_4WRPEH6-3x_RU - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R-RS07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - ru - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R-RS07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R-RS07600-B_web_30_03_2016.pdf - - - - false - false - - - - - UserManual_4WRPEH6-3x_SV - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R-SK07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - sv - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R-SK07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R-SK07600_web_B_01_2019.pdf - - - - false - false - - - - - UserManual_4WRPEH6-3x_TR - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - RT07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - tr - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - RT07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/RT07600_web_01_2019.pdf - - - - false - false - - - - - UserManual_4WRPEH6-3x_IT - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - RI07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - it - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - RI07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/RI07600-B_web_01_2019.pdf - - - - false - false - - - - - UserManual_4WRPEH6-3x_CS - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R-CZ07600 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Montage, Demontage - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - cs - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - User Manuel Hydraulic valves and hydroelectric pressure switches for industrial applications - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R-CZ07600-B_web_01_2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R-CZ 07600-B_web_01_2019.pdf - - - - false - false - - - - - Datasheet_4WRPEH6-3x_DE - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - RD29131 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Technische Spezifikation - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-02 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Datasheet: Directional control valves, direct operated, with electrical position feedback and integrated electronics (OBE) - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - rd29121_2019-02 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/rd29121_2019-02.pdf - - - - false - false - - - - - Datasheet_4WRPEH6-3x-zh - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - RC29131 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Technische Spezifikation - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-02 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - zh - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Datasheet: Directional control valves, direct operated, with electrical position feedback and integrated electronics (OBE) - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - rc29121_2019-02 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/rc29121_2019-02.pdf - - - - false - false - - - - - Parameter_IO-Link-DE - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - RD29400 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - string - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-01 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Technische Spezifikation - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Parameter description: High-response directional valves with electrical position feedback and IO-Link interface - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - SerialId - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - 1201694127 - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - RD29400_01-2019 - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/RD29400_01_2019_web.pdf - - - - false - false - - - - - - Service - http://boschrexroth.com/ids/sm/6053_5072_7091_5102 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Bosch Rexroth AG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Bgm.-Dr.-Nebel-Str. 8 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Lohr - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - service@boschrexroth.de - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.boschrexroth.com/de/de/service/startseite-service - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +499352405060 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - - Identification - http://boschrexroth.com/ids/sm/6563_5072_7091_4267 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Bosch Rexroth AG - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - 4048118000006 - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - string - GLN GS1 - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - string - R901509807 - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - 4WRPEH 6 C3 B40L-3X/M/24L1 - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - High-response directional valves, direct operated, with electrical position feedback and integrated electronics (OBE)“ oder auch „• Size 6 • Component series 3X • Maximum operating pressure 350 bar • Nominal flow 4 … 40 l/min • Digital interface IO-Link - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - Proportional directional control valve, spool design (hydraulics) - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eCl@ss - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /aasx/4WRPEH6_3X.png - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - http://dc-qr.com?m=R901509807&s=1&f=1202044787 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 1202044787 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - - 2018 - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - 30 - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - string - 02V08 - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - string - P.017.0014 - - - - - QrCode - PARAMETER - - - https://www.hsu-hh.de/aut/aas/qrcode - - - Instance - - image/jpeg - /aasx/Identification/QR-Code.jpg - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Bosch Rexroth AG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Zum Eisengießer 1 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Lohr am Main - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - service@boschrexroth.de - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.boschrexroth.com/de/de/home/index - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +499352405060 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/Identification/Rexroth-Logo_RGB_M.jpg - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - http://dc-qr.com?m=R901509807&s=1&f=1202044787 - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - IO-Link-Kennzeichnung vorhanden - IO-Link marking present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - DocumentationItem - - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/4401_1272_7091_3437 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/04_Bosch.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/04_Bosch.aasx.xml deleted file mode 100644 index eb7d7280c..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/04_Bosch.aasx.xml +++ /dev/null @@ -1,6691 +0,0 @@ - - - - - Bosch_CompactModuleBallRailSystem - http://boschrexroth.com/shells/R036037000/1005625831090001 - - - http://dc-qr.com?m=R036037000&s=1005625831090001&vc=CKK-090-NN-1 - - - - - - http://boschrexroth.com/shells/R036037000/1005625831090001/submodels/nameplate/ - - - - - http://boschrexroth.com/shells/R036037000/1005625831090001/submodels/document/ - - - - - http://boschrexroth.com/shells/R036037000/1005625831090001/submodels/service/ - - - - - http://boschrexroth.com/shells/R036037000/1005625831090001/submodels/identification/ - - - - - http://boschrexroth.com/shells/R036037000/1005625831090001/submodels/technicalSpecification/ - - - - - - - - - MR036037000_S1005625831090001 - CONSTANT - http://dc-qr.com?m=R036037000&s=1005625831090001&vc=CKK-090-NN-1 - Instance - - - - - Nameplate - http://boschrexroth.com/shells/R036037000/1005625831090001/submodels/nameplate/ - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Bosch Rexroth AG - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Compact Module with ball screw drive (CKK) - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Zum Eisengießer 1 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Lohr am Main - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - Compact module - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 1005625831090001 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - DE - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - 2019 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - - Document - http://boschrexroth.com/shells/R036037000/1005625831090001/submodels/document/ - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - Doku_Schmierung_CKx_V01_R320103051_2017_03 - PARAMETER - - - - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - R320103051 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 2017-03 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de/en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Erweiterungsdokumentation Schmierung CKK und CRK (de) / Extension instructions lubrication of CKK and CKR (en) - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - Doku_Schmierung_CKx_V01_R320103051_2017_03.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/Doku_Schmierung_CKx_V01_R320103051_2017_03.pdf - - - - false - false - - - - - R320103141_2015_06_Einbauerklaerung_einachsig - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R320103141 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2015-06 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de/en/es/fr/it/pt/bg/cs/da/et/el/fi/ga/hu/is/lt/lv/mt/nl/no/pl/ro/sk/sl/sv/tr - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Einbauerklärung für einachsige Linearsysteme - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R320103141_2015_06_Einbauerklaerung_einachsig.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R320103141_2015_06_Einbauerklaerung_einachsig.pdf - - - - false - false - - - - - R320103152_2015_01_DE_Safety_LS_Media_22_01_2015 - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R320103152 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-03 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Allgemeine Sicherheit (DE) General Security (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2015-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Sicherheitshinweise für Linearsysteme - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R320103152_2015_01_DE_Safety_LS_Media_22_01_2015.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R320103152_2015_01_DE_Safety_LS_Media_22_01_2015.pdf - - - - false - false - - - - - R320103152_2015_01_EN_Safety_LS_22_01_2015_web - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R320103152 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-03 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Allgemeine Sicherheit (DE) General Security (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2015-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Sicherheitshinweise für Linearsysteme - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R320103152_2015_01_EN_Safety_LS_22_01_2015_web.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R320103152_2015_01_EN_Safety_LS_22_01_2015_web.pdf - - - - false - false - - - - - R320103982_DE_EN_FR_IT_2015-05_CKK - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R320103982 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2015-05 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de/en/fr/it - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Anleitung / Instructions / Instructions / Istruzioni - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R320103982_DE_EN_FR_IT_(2015_05)_CKK.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R320103982_DE_EN_FR_IT_(2015_05)_CKK.pdf - - - - false - false - - - - - R999000479_2019_03_DE_18_07_2019_CKx - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R999000479 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-03 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Katalog CKK / CKR - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R999000479_2019_03_DE_18_07_2019_CKx.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R999000479_2019_03_DE_18_07_2019_CKx.pdf - - - - false - false - - - - - R999000499_2019_03_EN_18_07_2019_CKx - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R999000499 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-03 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Catalog CKK / CKR - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R999000499_2019_03_EN_18_07_2019_CKx.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R999000499_2019_03_EN_18_07_2019_CKx.pdf - - - - false - false - - - - - - Service - http://boschrexroth.com/shells/R036037000/1005625831090001/submodels/service/ - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Bosch Rexroth AG Linear Motion Technologies - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Röntgenstraße 5 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97424 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Schweinfurt - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - service.lt@boschrexroth.de - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.boschrexroth.com/en/xc/products/product-groups/linear-motion-technology/service-linear-motion-technology - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49 9721 937 8617 - - - - false - false - - - - - - Identification - http://boschrexroth.com/shells/R036037000/1005625831090001/submodels/identification/ - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Bosch Rexroth AG - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - 4048118000006 - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - string - GLN GS1 - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - string - R036037000 - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - CKK-090-NN-1 - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - Compact Module with ball screw drive (CKK) - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - Compact Module - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eCl@ss - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /CKK.jpg - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - http://dc-qr.com?m=R036037000&s=1005625831090001&vc=CKK-090-NN-1 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 1005625831090001 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - - 2019 - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Bosch Rexroth AG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Zum Eisengießer 1 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Lohr am Main - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - service@boschrexroth.de - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.boschrexroth.com/de/de/home/index - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +499352405060 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/Identification/logo.png - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - http://dc-qr.com?m=R036037000&s=1005625831090001&vc=CKK-090-NN-1 - - - - - - TechnicalSpecification - http://boschrexroth.com/shells/R036037000/1005625831090001/submodels/technicalSpecification/ - - - https://www.hsu-hh.de/aut/aas/technicalspecification - - - Instance - - - - - MaxTraversePath - PARAMETER - - - - http://boschrexroth.com/cds/lt/maxTraversePath - - - Instance - - float - 210 - - - - - FormFeedConstant - PARAMETER - - - - http://boschrexroth.com/cds/lt/formFeedConstant - - - Instance - - float - 10,00 - - - - - MaxPermissibleSpeed - PARAMETER - - - - http://boschrexroth.com/cds/lt/maxPermissibleSpeed - - - Instance - - float - 1,13 - - - - - MaxPermissibleAcceleration - PARAMETER - - - - http://boschrexroth.com/cds/lt/maxPermissibleAcceleration - - - Instance - - float - 50,00 - - - - - MaxPermissibleTorque - PARAMETER - - - - http://boschrexroth.com/cds/lt/maxPermissibleTorque - - - Instance - - float - 4,42 - - - - - RotationDirectionPositiveMovement - PARAMETER - - - - http://boschrexroth.com/cds/lt/RotationDirectionPositiveMovement - - - Instance - - string - CW - - - - - GearTransmissionRatio - PARAMETER - - - - http://boschrexroth.com/cds/lt/GearTransmissionRatio - - - Instance - - float - 1,00 - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/4401_1272_7091_3437 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - MaxTraversePath - http://boschrexroth.com/cds/lt/MaxTraversePath - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Max. Verfahrweg (mm) - Max. traverse path (mm) - - MaxTraversePath - mm - - - 0173-1#05-AAA480#003 - - - - smax_mm - REAL_MEASURE - - - - - - - FormFeedConstant - http://boschrexroth.com/cds/lt/FormFeedConstant - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Vorschubkonstante (mm/U) - Form feed constant (mm/U) - - FormFeedConstant - mm/U - - - - - u_mmpU - REAL_MEASURE - - - - - - - MaxPermissibleSpeed - http://boschrexroth.com/cds/lt/MaxPermissibleSpeed - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Maximal zulässige Geschwindigkeit (m/s) - Maximum permissible speed (m/s) - - MaxPermissibleSpeed - m/s - - - 0173-1#05-AAA434#003 - - - - vmax_mps - REAL_MEASURE - - - - - - - MaxPermissibleAcceleration - http://boschrexroth.com/cds/lt/MaxPermissibleAcceleration - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Maximal zulässige Beschleunigung (m/s²) - Maximum permissible acceleration (m/s²) - - MaxPermissibleAcceleration - m/s² - - - 0173-1#05-AAA597#003 - - - - amax_mps2 - REAL_MEASURE - - - - - - - MaxPermissibleTorque - http://boschrexroth.com/cds/lt/MaxPermissibleTorque - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Maximal zulässiges Drehmoment (Nm) - Maximum permissible torque (Nm) - - MaxPermissibleTorque - Nm - - - - - M1max_Nm - REAL_MEASURE - - - - - - - RotationDirectionPositiveMovement - http://boschrexroth.com/cds/lt/RotationDirectionPositiveMovement - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Drehrichtung für positive Fahrrichtung (weg vom Motor) - Rotation direction for positive movement - - RotationDirectionPositiveMovement - - - - - - d - STRING - - - - - - - GearTransmissionRatio - http://boschrexroth.com/cds/lt/GearTransmissionRatio - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Getriebeübersetzung - Gear transmission ratio - - GearTransmissionRatio - - - - - - i - REAL_MEASURE - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/05_Bosch.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/05_Bosch.aasx.xml deleted file mode 100644 index ebf6a52ff..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/05_Bosch.aasx.xml +++ /dev/null @@ -1,6177 +0,0 @@ - - - - - Bosch_CompactModuleToothedBeltDrive - http://boschrexroth.com/shells/R036447000/1005625831070001 - - - http://dc-qr.com?m=R036447000&s=1005625831070001 - - - - - - http://boschrexroth.com/shells/R036447000/1005625831070001/submodels/nameplate/ - - - - - http://boschrexroth.com/shells/R036447000/1005625831070001/submodels/document/ - - - - - http://boschrexroth.com/shells/R036447000/1005625831070001/submodels/service/ - - - - - http://boschrexroth.com/shells/R036447000/1005625831070001/submodels/identification/ - - - - - http://boschrexroth.com/shells/R036447000/1005625831070001/submodels/technicalSpecification/ - - - - - - - - - MR036447000_S1005625831070001 - http://dc-qr.com?m=R036447000&s=1005625831070001 - Instance - - - - - Nameplate - http://boschrexroth.com/shells/R036447000/1005625831070001/submodels/nameplate/ - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Bosch Rexroth AG - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Compact Module with toothed belt drive (CKR) - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Zum Eisengießer 1 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Lohr am Main - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - Compact Module - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 1005625831070001 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - DE - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - 2019 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - - Service - http://boschrexroth.com/shells/R036447000/1005625831070001/submodels/service/ - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Bosch Rexroth AG Linear Motion Technologies - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Röntgenstraße 5 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97424 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Schweinfurt - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - service.lt@boschrexroth.de - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.boschrexroth.com/en/xc/products/product-groups/linear-motion-technology/service-linear-motion-technology - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49 9721 937 8617 - - - - false - false - - - - - - Identification - http://boschrexroth.com/shells/R036447000/1005625831070001/submodels/identification/ - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Bosch Rexroth AG - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - 4048118000006 - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - string - GLN GS1 - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - string - R036447000 - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - CKR-110-NN-1 - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - Compact Modules with toothed belt drive (CKR) - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - Compact Module - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eCl@ss - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /CKR.jpg - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - http://dc-qr.com?m=R036447000&s=1005625831070001 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 1005625831070001 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - - 2019 - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Bosch Rexroth AG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Zum Eisengießer 1 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Lohr am Main - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - service@boschrexroth.de - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.boschrexroth.com/de/de/home/index - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +499352405060 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/Identification/logo.png - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - http://dc-qr.com?m=R036447000&s=1005625831070001 - - - - - - TechnicalSpecification - http://boschrexroth.com/shells/R036447000/1005625831070001/submodels/technicalSpecification/ - - - https://www.hsu-hh.de/aut/aas/technicalspecification - - - Instance - - - - - MaxTraversePath - PARAMETER - - - - http://boschrexroth.com/cds/lt/maxTraversePath - - - Instance - - float - 280 - - - - - FormFeedConstant - PARAMETER - - - - http://boschrexroth.com/cds/lt/formFeedConstant - - - Instance - - float - 120,00 - - - - - MaxPermissibleSpeed - PARAMETER - - - - http://boschrexroth.com/cds/lt/maxPermissibleSpeed - - - Instance - - float - 2,00 - - - - - MaxPermissibleAcceleration - PARAMETER - - - - http://boschrexroth.com/cds/lt/maxPermissibleAcceleration - - - Instance - - float - 50,00 - - - - - MaxPermissibleTorque - PARAMETER - - - - http://boschrexroth.com/cds/lt/maxPermissibleTorque - - - Instance - - float - 1,30 - - - - - RotationDirectionPositiveMovement - PARAMETER - - - - http://boschrexroth.com/cds/lt/RotationDirectionPositiveMovement - - - Instance - - string - CCW - - - - - GearTransmissionRatio - PARAMETER - - - - http://boschrexroth.com/cds/lt/GearTransmissionRatio - - - Instance - - float - 10,00 - - - - - - Document - http://boschrexroth.com/shells/R036447000/1005625831070001/submodels/document/ - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - Doku_Schmierung_CKx_V01_R320103051_2017_03 - PARAMETER - - - - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - R320103051 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 2017-03 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de/en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Erweiterungsdokumentation Schmierung CKK und CRK (DE) / Extension instructions lubrication of CKK and CKR (EN) - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - Doku_Schmierung_CKx_V01_R320103051_2017_03.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/Doku_Schmierung_CKx_V01_R320103051_2017_03.pdf - - - - false - false - - - - - R320103141_2015_06_Einbauerklaerung_einachsig - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R320103141 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2015-06 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de/en/es/fr/it/pt/bg/cs/da/et/el/fi/ga/hu/is/lt/lv/mt/nl/no/pl/ro/sk/sl/sv/tr - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Einbauerklärung für einachsige Linearsysteme - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R320103141_2015_06_Einbauerklaerung_einachsig.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R320103141_2015_06_Einbauerklaerung_einachsig.pdf - - - - false - false - - - - - R320103152_2015_01_DE_Safety_LS_Media_22_01_2015 - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R320103152 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-03 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Allgemeine Sicherheit (DE) General Security (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2015-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Sicherheitshinweise für Linearsysteme - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R320103152_2015_01_DE_Safety_LS_Media_22_01_2015.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R320103152_2015_01_DE_Safety_LS_Media_22_01_2015.pdf - - - - false - false - - - - - R320103152_2015_01_EN_Safety_LS_22_01_2015_web - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R320103152 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-03 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Allgemeine Sicherheit (DE) General Security (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2015-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Safety Instructions for Linear Motion Systems - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R320103152_2015_01_EN_Safety_LS_22_01_2015_web.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R320103152_2015_01_EN_Safety_LS_22_01_2015_web.pdf - - - - false - false - - - - - R999000479_2019_03_DE_18_07_2019_CKx - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R999000479 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-03 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Compactmodule CKK / CKR - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R999000479_2019_03_DE_18_07_2019_CKx.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R999000479_2019_03_DE_18_07_2019_CKx.pdf - - - - false - false - - - - - R999000499_2019_03_EN_18_07_2019_CKx - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R999000499 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2019-03 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Compact Modules CKK / CKR - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R999000499_2019_03_EN_18_07_2019_CKx_(1).pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R999000499_2019_03_EN_18_07_2019_CKx_(1).pdf - - - - false - false - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - DocumentationItem - - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/4401_1272_7091_3437 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - MaxTraversePath - http://boschrexroth.com/cds/lt/MaxTraversePath - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Max. Verfahrweg (mm) - Max. traverse path (mm) - - MaxTraversePath - mm - - - 0173-1#05-AAA480#003 - - - - smax_mm - REAL_MEASURE - - - - - - - FormFeedConstant - http://boschrexroth.com/cds/lt/FormFeedConstant - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Vorschubkonstante (mm/U) - Form feed constant (mm/U) - - FormFeedConstant - mm/U - - - - - u_mmpU - REAL_MEASURE - - - - - - - MaxPermissibleSpeed - http://boschrexroth.com/cds/lt/MaxPermissibleSpeed - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Maximal zulässige Geschwindigkeit (m/s) - Maximum permissible speed (m/s) - - MaxPermissibleSpeed - m/s - - - 0173-1#05-AAA434#003 - - - - vmax_mps - REAL_MEASURE - - - - - - - MaxPermissibleAcceleration - http://boschrexroth.com/cds/lt/MaxPermissibleAcceleration - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Maximal zulässige Beschleunigung (m/s²) - Maximum permissible acceleration (m/s²) - - MaxPermissibleAcceleration - m/s² - - - 0173-1#05-AAA597#003 - - - - amax_mps2 - REAL_MEASURE - - - - - - - MaxPermissibleTorque - http://boschrexroth.com/cds/lt/MaxPermissibleTorque - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Maximal zulässiges Drehmoment (Nm) - Maximum permissible torque (Nm) - - MaxPermissibleTorque - Nm - - - - - M1max_Nm - REAL_MEASURE - - - - - - - RotationDirectionPositiveMovement - http://boschrexroth.com/cds/lt/RotationDirectionPositiveMovement - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Drehrichtung für positive Fahrrichtung (weg vom Motor) - Rotation direction for positive movement - - RotationDirectionPositiveMovement - - - - - - d - STRING - - - - - - - GearTransmissionRatio - http://boschrexroth.com/cds/lt/GearTransmissionRatio - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Getriebeübersetzung - Gear transmission ratio - - GearTransmissionRatio - - - - - - i - REAL_MEASURE - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/06_Bosch.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/06_Bosch.aasx.xml deleted file mode 100644 index 067ccce55..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/06_Bosch.aasx.xml +++ /dev/null @@ -1,6640 +0,0 @@ - - - - - Bosch_PrecisionModulePSK - http://boschrexroth.com/shells/R055732577/1012160102010001 - - - http://dc-qr.com?m=R055732577&t=PSK-060-NN-1&s=1012160102010001 - - - - - - http://boschrexroth.com/shells/R055732577/1012160102010001/submodels/nameplate/ - - - - - http://boschrexroth.com/shells/R055732577/1012160102010001/submodels/document/ - - - - - http://boschrexroth.com/shells/R055732577/1012160102010001/submodels/service/ - - - - - http://boschrexroth.com/shells/R055732577/1012160102010001/submodels/identification/ - - - - - http://boschrexroth.com/shells/R055732577/1012160102010001/submodels/technicalSpecification/ - - - - - - - - - MR055732577_S1012160102010001 - http://dc-qr.com?m=R055732577&t=PSK-060-NN-1&s=1012160102010001 - Instance - - - - - Nameplate - http://boschrexroth.com/shells/R055732577/1012160102010001/submodels/nameplate/ - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Bosch Rexroth AG - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Precision Module PSK - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Zum Eisengießer 1 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Lohr am Main - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - Precision Module PSK - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 1012160102010001 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - DE - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - 2019 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - - Service - http://boschrexroth.com/shells/R055732577/1012160102010001/submodels/service/ - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Bosch Rexroth AG Service Linear Motion Technologies - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Röntgenstraße 5 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97424 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Schweinfurt - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - service.lt@boschrexroth.de - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.boschrexroth.com/en/xc/products/product-groups/linear-motion-technology/service-linear-motion-technology - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49 9721 937 8617 - - - - false - false - - - - - - Identification - http://boschrexroth.com/shells/R055732577/1012160102010001/submodels/identification/ - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Bosch Rexroth AG - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - 4048118000006 - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - string - GLN GS1 - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - string - PSK-060-NN-1 - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Precision Module - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - Precision Module + Integrated Ball Rail System + Precision Ball Screw Assembly - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - Linear motion system - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eCl@ss - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /PSK.jpg - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - http://dc-qr.com?m=R055732577&s=1012160102010001&t=PSK-060-NN-1 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 1012160102010001 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - - 2019 - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Bosch Rexroth AG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Zum Eisengießer 1 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Lohr am Main - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - service@boschrexroth.de - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.boschrexroth.com/de/de/home/index - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +499352405060 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/Identification/logo.png - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - http://dc-qr.com?m=R055732577&s=1012160102010001 - - - - - - TechnicalSpecification - http://boschrexroth.com/shells/R055732577/1012160102010001/submodels/technicalSpecification/ - - - https://www.hsu-hh.de/aut/aas/technicalspecification - - - Instance - - - - - MaxTraversePath - PARAMETER - - - - http://boschrexroth.com/cds/lt/maxTraversePath - - - Instance - - float - 140,00 - - - - - FormFeedConstant - PARAMETER - - - - http://boschrexroth.com/cds/lt/formFeedConstant - - - Instance - - float - 10,00 - - - - - MaxPermissibleSpeed - PARAMETER - - - - http://boschrexroth.com/cds/lt/maxPermissibleSpeed - - - Instance - - float - 1,17 - - - - - MaxPermissibleAcceleration - PARAMETER - - - - http://boschrexroth.com/cds/lt/maxPermissibleAcceleration - - - Instance - - float - 50,00 - - - - - MaxPermissibleTorque - PARAMETER - - - - http://boschrexroth.com/cds/lt/maxPermissibleTorque - - - Instance - - float - 3,20 - - - - - RotationDirectionPositiveMovement - PARAMETER - - - - http://boschrexroth.com/cds/lt/RotationDirectionPositiveMovement - - - Instance - - string - CW - - - - - GearTransmissionRatio - PARAMETER - - - - http://boschrexroth.com/cds/lt/GearTransmissionRatio - - - Instance - - float - 1,00 - - - - - - Document - http://boschrexroth.com/shells/R055732577/1012160102010001/submodels/document/ - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - EU_Declaration_of_Conformity - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - DCTC-30434-002:2019-01-01 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 2019-01-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de/en/fr/es/pt/it/pl/cs/sk/hu/bg/da/et/fi/el/hr/lv/lt/nl/ro/sv/sl/ru/zh/ar/id/ja/ko/no/th/tr/vi - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - EU-Konformitätserklärung (DE) EU Declaration of Conformity (EN) - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - EU_Declaration_of_Conformity.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/EU_Declaration_of_Conformity.pdf - - - - false - false - - - - - Katalog-DE_R999000480_2015-12_PSK_24_10_2018_Gy - PARAMETER - - - - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - R999000480 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 2015-12 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Präzisionsmodule PSK - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - Katalog-DE_R999000480_2015-12_PSK_24_10_2018_Gy.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/Katalog-DE_R999000480_2015-12_PSK_24_10_2018_Gy.pdf - - - - false - false - - - - - Katalog-EN_R999000500_2015-12_PSK_24_10_2018_Gy - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R999000500 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2015-12 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Precision Modules PSK - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - Katalog-EN_R999000500_2015-12_PSK_24_10_2018_Gy.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/Katalog-EN_R999000500_2015-12_PSK_24_10_2018_Gy.pdf - - - - false - false - - - - - Anleitung-R320103187_2006_09_2 - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R320103187 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2006-09 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de/en/fr/it - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Anleitung Präzisionsmodule (EN) Instructions Precision Module PSK (EN) - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - Anleitung-R320103187_2006_09_2.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/Anleitung-R320103187_2006_09_2.pdf - - - - false - false - - - - - R320103141_2015_06_Einbauerklaerung_einachsig - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R320103141 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung (DE) Operating Instructions (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2015-06 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de/en/es/fr/it/pt/bg/cs/da/et/el/fi/ga/hu/is/lt/lv/mt/nl/no/pl/ro/sk/sl/sv/tr - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Einbauerklärung für einachsige Linearsysteme (DE) Declaration of Incorporation for single axis Linear Motion Systems (EN) - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R320103141_2015_06_Einbauerklaerung_einachsig.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R320103141_2015_06_Einbauerklaerung_einachsig.pdf - - - - false - false - - - - - R320103152_2015_01_DE_Safety_LS_Media_22_01_2015 - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R320103152 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-03 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Allgemeine Sicherheit (DE) General Security (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2015-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Sicherheitshinweise für Linearsysteme - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R320103152_2015_01_DE_Safety_LS_Media_22_01_2015.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R320103152_2015_01_DE_Safety_LS_Media_22_01_2015.pdf - - - - false - false - - - - - R320103152_2015_01_EN_Safety_LS_22_01_2015_web - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - Bosch Rexroth - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - R320103152 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Bosch Rexroth - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Bosch Rexroth AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-03 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Allgemeine Sicherheit (DE) General Security (EN) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - string - 2015-01 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Safety Instructions for Linear Motion Systems - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - R320103152_2015_01_EN_Safety_LS_22_01_2015_web.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/R320103152_2015_01_EN_Safety_LS_22_01_2015_web.pdf - - - - false - false - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/4401_1272_7091_3437 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - MaxTraversePath - http://boschrexroth.com/cds/lt/MaxTraversePath - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Max. Verfahrweg (mm) - Max. traverse path (mm) - - MaxTraversePath - mm - - - 0173-1#05-AAA480#003 - - - - smax_mm - REAL_MEASURE - - - - - - - FormFeedConstant - http://boschrexroth.com/cds/lt/FormFeedConstant - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Vorschubkonstante (mm/U) - Form feed constant (mm/U) - - FormFeedConstant - mm/U - - - - - u_mmpU - REAL_MEASURE - - - - - - - MaxPermissibleSpeed - http://boschrexroth.com/cds/lt/MaxPermissibleSpeed - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Maximal zulässige Geschwindigkeit (m/s) - Maximum permissible speed (m/s) - - MaxPermissibleSpeed - m/s - - - 0173-1#05-AAA434#003 - - - - vmax_mps - REAL_MEASURE - - - - - - - MaxPermissibleAcceleration - http://boschrexroth.com/cds/lt/MaxPermissibleAcceleration - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Maximal zulässige Beschleunigung (m/s²) - Maximum permissible acceleration (m/s²) - - MaxPermissibleAcceleration - m/s² - - - 0173-1#05-AAA597#003 - - - - amax_mps2 - REAL_MEASURE - - - - - - - MaxPermissibleTorque - http://boschrexroth.com/cds/lt/MaxPermissibleTorque - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Maximal zulässiges Drehmoment (Nm) - Maximum permissible torque (Nm) - - MaxPermissibleTorque - Nm - - - - - M1max_Nm - REAL_MEASURE - - - - - - - RotationDirectionPositiveMovement - http://boschrexroth.com/cds/lt/RotationDirectionPositiveMovement - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Drehrichtung für positive Fahrrichtung (weg vom Motor) - Rotation direction for positive movement - - RotationDirectionPositiveMovement - - - - - - d - STRING - - - - - - - GearTransmissionRatio - http://boschrexroth.com/cds/lt/GearTransmissionRatio - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Getriebeübersetzung - Gear transmission ratio - - GearTransmissionRatio - - - - - - i - REAL_MEASURE - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/07_PhoenixContact.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/07_PhoenixContact.aasx.xml deleted file mode 100644 index b97555d7f..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/07_PhoenixContact.aasx.xml +++ /dev/null @@ -1,3507 +0,0 @@ - - - - - PhoenixContact_R901278815_25 - CONSTANT - www.company.com/ids/aas/2520_6010_8091_1277 - - - www.company.com/ids/asset/8220_6010_8091_3593 - - - - - - www.company.com/ids/sm/4343_5072_7091_3242 - - - - - www.company.com/ids/sm/2543_5072_7091_2660 - - - - - www.company.com/ids/sm/6053_5072_7091_5102 - - - - - www.company.com/ids/sm/6563_5072_7091_4267 - - - - - - - - - R901278815_25 - www.company.com/ids/asset/8220_6010_8091_3593 - Instance - - - - - Nameplate - www.company.com/ids/sm/4343_5072_7091_3242 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - PHOENIX CONTACT GmbH & Co. KG - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - QUINT4-PS/3AC/24DC/20 - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Flachsmarktstr. 8 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 32825 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Blomberg - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Nordrhein-Westfalen - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 2904622001634T0008 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - DE - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - 2016 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - - Document - www.company.com/ids/sm/2543_5072_7091_2660 - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Phoenix Contact - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - PHOENIX CONTACT GmbH & Co. KG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en, de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - EU_Declaration_of_Conformity.pdf - - - - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - - - - Instance - - string - EU_Declaration_of_Conformity.pdf Nr. 2904622.CE.01 - - - - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/EU_Declaration_of_Conformity.pdf - - - - false - false - - - - - - Service - www.company.com/ids/sm/6053_5072_7091_5102 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - PHOENIX CONTACT GmbH & Co. KG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Flachsmarktstraße 8 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 32825 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Blomberg - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Nordrhein-Westfalen - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - aftersales@phoenixcontact.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.phoenixcontact.com/online/portal/de?1dmy&urile=wcm:path:/dede/web/main/service_and_support/entry_page/entry_page - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49 52 35/3-4 00 50 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - - Identification - www.company.com/ids/sm/6563_5072_7091_4267 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - PHOENIX CONTACT GmbH & Co. KG - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - - - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - - - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - QUINT4-PS/3AC/24DC/20 - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - Primary-switched QUINT POWER power supply with free choice of output characteristic curve, SFB (selective fuse breaking) technology, and NFC interface, input: 3-phase, output: 24 V DC/20 A - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - PHOENIX CONTACT GmbH & Co. KG - - - - - GLNOfSupplier - PARAMETER - - - 0173-1#02-AAY813#001 - - - Instance - - string - - - - - - SupplierIdProvider - PARAMETER - - - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - Instance - - - - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Instance - - - - - - - - SupplierProductDesignation - - - 0173-1#02-AAM551#002 - - - Instance - - string - QUINT4-PS/3AC/24DC/20 - - - - - SupplierProductDescription - PARAMETER - - - 0173-1#02-AAU730#001 - - - Instance - - langString - Primary-switched QUINT POWER power supply with free choice of output characteristic curve, SFB (selective fuse breaking) technology, and NFC interface, input: 3-phase, output: 24 V DC/20 A - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eclass - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - - Instance - - image/jpeg - /aasx/2904622.jpeg - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - www.company.com/ids/asset/8220_6010_8091_3593 - - - - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 25 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - - - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - 02 - - - - - QrCode - PARAMETER - - - https://www.hsu-hh.de/aut/aas/qrcode - - - Instance - - image/jpeg - /aasx/2904622_QRCode.jpeg - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - PHOENIX CONTACT GmbH & Co. KG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Flachsmarktstr. 8 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 32825 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Blomberg - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Nordrhein-Westfalen - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - info@phoenixcontact.de - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.phoenixcontact.com/online/portal/pc - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49 52 35/3-1 20 00 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/PhoenixContact_Logo.png - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - http://phoenixcontact.net/qr/2904622 - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/4401_1272_7091_3437 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/08_SchneiderElectric.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/08_SchneiderElectric.aasx.xml deleted file mode 100644 index b85815050..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/08_SchneiderElectric.aasx.xml +++ /dev/null @@ -1,4570 +0,0 @@ - - - - - SE_Tesys_Island_Header - www.company.com/ids/aas/2520_6010_8091_1277 - - - www.company.com/ids/asset/8220_6010_8091_3593 - - - - - - www.company.com/ids/sm/4343_5072_7091_3242 - - - - - www.company.com/ids/sm/2543_5072_7091_2660 - - - - - www.company.com/ids/sm/6053_5072_7091_5102 - - - - - www.company.com/ids/sm/6563_5072_7091_4267 - - - - - - - - - SE_Tesys_Island_Header - www.company.com/ids/asset/8220_6010_8091_3593 - Instance - - - - - Nameplate - www.company.com/ids/sm/4343_5072_7091_3242 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Schneider Electric - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Bus coupler TeSys island, Ethernet switch (EtherNet IP / Modbus TCP) - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - FR - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Rue Joseph Monier - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 92506 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Rueil Malmaison - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Hauts de Seine - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 1x14F4023C - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - FR - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - 2019 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - Marking_UL - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/UL.png - - - - false - false - - - - - Marking_WEEE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/Marking_WEEE.png - - - - false - false - - - - - - Document - www.company.com/ids/sm/2543_5072_7091_2660 - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Schneider Electric - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Schneider Electric SAS - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - SC19062501 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - EU - Declaration of conformity - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - EU - Declaration of conformity - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - string - Bus Coupler for TeSys Island offer - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - string - TPRBCEIP, TPRBCPFN, TPRBETC - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - CE_TPRBC_SC19062501.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/CE_TPRBC_SC19062501.pdf - - - - false - false - - - - - DeclarationULMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Schneider Electric - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Schneider Electric Automation SAS - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - NRAQ.E3220218 - PROGRAMMABLE CONTROLLERS - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - string - 2019 - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - PROGRAMMABLE_CONTROLLERS___UL_Product_iQ.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/PROGRAMMABLE_CONTROLLERS___UL_Product_iQ.pdf - - - - false - false - - - - - Instruction Bulletin - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Technical Documentation - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Schneider Electric - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Schneider Electric SAS - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 8536IB1901EN - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - System Guide - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Instruction bulletin - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - string - This instruction bulletin introduces and describes the main functions of TeSys island. - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - string - TeSys Island - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - instal_EN.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/Instal_EN.pdf - - - - false - false - - - - - - Service - www.company.com/ids/sm/6053_5072_7091_5102 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Schneider Elcetric - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Schneider Platz - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Marktheidenfeld - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.schneider-electric.com/en/work/support/ - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - - Identification - www.company.com/ids/sm/6563_5072_7091_4267 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Schneider Electric - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - TPRBCEIP - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - - - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - - - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Bus coupler TeSys island, Ethernet switch (EtherNet IP / Modbus TCP) - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - Bus coupler Ethernet IP / Modbus TCP, point of connection between a group of starters and an automation controller - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Schneider Electric - - - - - GLNOfSupplier - PARAMETER - - - 0173-1#02-AAY813#001 - - - Instance - - string - TPRBCEIP - - - - - SupplierIdProvider - PARAMETER - - - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - Instance - - - - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Instance - - - - - - - - SupplierProductDesignation - - - 0173-1#02-AAM551#002 - - - Instance - - string - Bus coupler TeSys island, Ethernet switch (EtherNet IP / Modbus TCP) - - - - - SupplierProductDescription - PARAMETER - - - 0173-1#02-AAU730#001 - - - Instance - - langString - Bus coupler Ethernet IP / Modbus TCP, point of connection between a group of starters and an automation controller - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eclass - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /aasx/Identification/TPRBCEIP.PNG - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - www.company.com/ids/asset/8220_6010_8091_3593 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 1x14F4023C - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - - - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - - - - - - QrCode - PARAMETER - - - https://www.hsu-hh.de/aut/aas/qrcode - - - Instance - - image/jpeg - /aasx/Identification/QRCode_Tesys_Island_Header.jpg - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Schneider Electric - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - FR - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Rue Joseph Monier - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 92506 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Rueil Malmaison - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Hauts de Seine - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.se.com/ww/en/ - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/Identification/logo_SE.png - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.schneider-electric.com/en/product-range-presentation/65746-tesys-island/?parent-category-id=3000&parent-subcategory-id=3080&filter=business-4-low-voltage-products-and-systems#tabs-top - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/6044_0150_1191_5121 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/09_SchneiderElectric.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/09_SchneiderElectric.aasx.xml deleted file mode 100644 index 89372c86b..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/09_SchneiderElectric.aasx.xml +++ /dev/null @@ -1,4570 +0,0 @@ - - - - - SE_Tesys_Island_Power - www.company.com/ids/aas/2520_6010_8091_1277 - - - www.company.com/ids/asset/8220_6010_8091_3593 - - - - - - www.company.com/ids/sm/4343_5072_7091_3242 - - - - - www.company.com/ids/sm/2543_5072_7091_2660 - - - - - www.company.com/ids/sm/6053_5072_7091_5102 - - - - - www.company.com/ids/sm/6563_5072_7091_4267 - - - - - - - - - SE_Tesys_Island_Power - www.company.com/ids/asset/8220_6010_8091_3593 - Instance - - - - - Nameplate - www.company.com/ids/sm/4343_5072_7091_3242 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Schneider Electric - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Voltage interface Module, TeSys island - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - FR - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Rue Joseph Monier - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 92506 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Rueil Malmaison - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Hauts de Seine - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 190730000777 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - FR - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - 2019 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - Marking_UL - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/UL.png - - - - false - false - - - - - Marking_WEEE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/Marking_WEEE.png - - - - false - false - - - - - - Document - www.company.com/ids/sm/2543_5072_7091_2660 - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Schneider Electric - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Schneider Electric SAS - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - SC19062503 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - EU - Declaration of conformity - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - EU - Declaration of conformity - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - string - Voltage Measurement Module for TeSys Island offer - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - string - TPRVM001 - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - CE_TPRVM_SC19062503.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/CE_TPRVM_SC19062503.pdf - - - - false - false - - - - - DeclarationULMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Schneider Electric - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Schneider Electric Automation SAS - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - NRAQ.E3220218 - PROGRAMMABLE CONTROLLERS - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - string - 2019 - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - PROGRAMMABLE_CONTROLLERS___UL_Product_iQ.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/PROGRAMMABLE_CONTROLLERS___UL_Product_iQ.pdf - - - - false - false - - - - - Instruction Bulletin - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Technical Documentation - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Schneider Electric - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Schneider Electric SAS - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 8536IB1901EN - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - System Guide - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Instruction bulletin - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - string - This instruction bulletin introduces and describes the main functions of TeSys island. - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - string - TeSys Island - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - instal_EN.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/Instal_EN.pdf - - - - false - false - - - - - - Service - www.company.com/ids/sm/6053_5072_7091_5102 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Schneider Elcetric - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Schneider Platz - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Marktheidenfeld - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.schneider-electric.com/en/work/support/ - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - - Identification - www.company.com/ids/sm/6563_5072_7091_4267 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Schneider Electric - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - TPRVM001 - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - - - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - - - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Voltage interface Module, TeSys island - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - Monitoring of the mains voltage powering the island and Reporting of the voltage to the bus coupler to enable power & energy monitoring - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Schneider Electric - - - - - GLNOfSupplier - PARAMETER - - - 0173-1#02-AAY813#001 - - - Instance - - string - TPRVM001 - - - - - SupplierIdProvider - PARAMETER - - - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - Instance - - - - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Instance - - - - - - - - SupplierProductDesignation - - - 0173-1#02-AAM551#002 - - - Instance - - string - Voltage interface Module, TeSys island - - - - - SupplierProductDescription - PARAMETER - - - 0173-1#02-AAU730#001 - - - Instance - - langString - Monitoring of the mains voltage powering the island and Reporting of the voltage to the bus coupler to enable power & energy monitoring - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eclass - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /aasx/Identification/TPRVM001.PNG - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - www.company.com/ids/asset/8220_6010_8091_3593 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 190730000777 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - - - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - - - - - - QrCode - PARAMETER - - - https://www.hsu-hh.de/aut/aas/qrcode - - - Instance - - image/jpeg - /aasx/Identification/QRCode_Tesys_Island_Power.jpg - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Schneider Electric - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - FR - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Rue Joseph Monier - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 92506 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Rueil Malmaison - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Hauts de Seine - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.schneider-electric.com/en/ - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/Identification/logo_SE.png - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.schneider-electric.com/en/product-range-presentation/65746-tesys-island/?parent-category-id=3000&parent-subcategory-id=3080&filter=business-4-low-voltage-products-and-systems#tabs-top - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/6044_0150_1191_5121 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/10_SchneiderElectric.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/10_SchneiderElectric.aasx.xml deleted file mode 100644 index 90a9a45d2..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/10_SchneiderElectric.aasx.xml +++ /dev/null @@ -1,4570 +0,0 @@ - - - - - SE_Tesys_Island_Starter - www.company.com/ids/aas/2520_6010_8091_1277 - - - www.company.com/ids/asset/8220_6010_8091_3593 - - - - - - www.company.com/ids/sm/4343_5072_7091_3242 - - - - - www.company.com/ids/sm/2543_5072_7091_2660 - - - - - www.company.com/ids/sm/6053_5072_7091_5102 - - - - - www.company.com/ids/sm/6563_5072_7091_4267 - - - - - - - - - SE_Tesys_Island_Starter - www.company.com/ids/asset/8220_6010_8091_3593 - Instance - - - - - Nameplate - www.company.com/ids/sm/4343_5072_7091_3242 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Schneider Electric - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Motor Starter, TeSys island - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - FR - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Rue Joseph Monier - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 92506 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Rueil Malmaison - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Hauts de Seine - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 2F184031001 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - FR - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - 2019 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - Marking_UL - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/UL.png - - - - false - false - - - - - Marking_WEEE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/Marking_WEEE.png - - - - false - false - - - - - - Document - www.company.com/ids/sm/2543_5072_7091_2660 - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Schneider Electric - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Schneider Electric SAS - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - SC19062505 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - EU - Declaration of conformity - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - EU - Declaration of conformity - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - string - Motor Starters for TeSys Island offer - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - string - TPRSx009, TPRSx025, TPRSx038, TPRSx065, TPRSx080, *where x can be T or S - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - CE_TPRSx_SC19062505.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/CE_TPRSx_SC19062505.pdf - - - - false - false - - - - - DeclarationULMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Schneider Electric - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Schneider Electric Automation SAS - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - NRAQ.E3220218 - PROGRAMMABLE CONTROLLERS - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - string - 2019 - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - PROGRAMMABLE_CONTROLLERS___UL_Product_iQ.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/PROGRAMMABLE_CONTROLLERS___UL_Product_iQ.pdf - - - - false - false - - - - - Instruction Bulletin - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Technical Documentation - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Schneider Electric - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Schneider Electric SAS - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 8536IB1901EN - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - System Guide - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Instruction bulletin - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - string - This instruction bulletin introduces and describes the main functions of TeSys island. - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - string - TeSys Island - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - instal_EN.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/Instal_EN.pdf - - - - false - false - - - - - - Service - www.company.com/ids/sm/6053_5072_7091_5102 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Schneider Elcetric - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Schneider Platz - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Marktheidenfeld - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.schneider-electric.com/en/work/support/ - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - - Identification - www.company.com/ids/sm/6563_5072_7091_4267 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Schneider Electric - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - TPRST009 - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - - - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - - - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Motor Starter, TeSys island - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - Direct starter connected to an automation controller through a bus coupler, Operational only when connected to a bus coupler - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Schneider Electric - - - - - GLNOfSupplier - PARAMETER - - - 0173-1#02-AAY813#001 - - - Instance - - string - TPRST009 - - - - - SupplierIdProvider - PARAMETER - - - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - Instance - - - - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Instance - - - - - - - - SupplierProductDesignation - - - 0173-1#02-AAM551#002 - - - Instance - - string - Motor Starter, TeSys island - - - - - SupplierProductDescription - PARAMETER - - - 0173-1#02-AAU730#001 - - - Instance - - langString - Direct starter connected to an automation controller through a bus coupler, Operational only when connected to a bus coupler - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eclass - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /TPRST009.PNG - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - www.company.com/ids/asset/8220_6010_8091_3593 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 2F184031001 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - string - 2019 - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - - - - - - QrCode - PARAMETER - - - https://www.hsu-hh.de/aut/aas/qrcode - - - Instance - - image/jpeg - /aasx/Identification/QRCode_Tesys_Island_Starter.jpg - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Schneider Electric - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - FR - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Rue Joseph Monier - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 92506 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Rueil Malmaison - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Hauts de Seine - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.schneider-electric.com/en/ - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/Identification/logo_SE.png - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.schneider-electric.com/en/product-range-presentation/65746-tesys-island/?parent-category-id=3000&parent-subcategory-id=3080&filter=business-4-low-voltage-products-and-systems#tabs-top - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/6044_0150_1191_5121 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/11_SchneiderElectric.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/11_SchneiderElectric.aasx.xml deleted file mode 100644 index 8912f73c0..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/11_SchneiderElectric.aasx.xml +++ /dev/null @@ -1,4570 +0,0 @@ - - - - - SE_Modicon_M262 - www.company.com/ids/aas/2520_6010_8091_1277 - - - www.company.com/ids/asset/8220_6010_8091_3593 - - - - - - www.company.com/ids/sm/4343_5072_7091_3242 - - - - - www.company.com/ids/sm/2543_5072_7091_2660 - - - - - www.company.com/ids/sm/6053_5072_7091_5102 - - - - - www.company.com/ids/sm/6563_5072_7091_4267 - - - - - - - - - SE_Modicon_M262 - www.company.com/ids/asset/8220_6010_8091_3593 - Instance - - - - - Nameplate - www.company.com/ids/sm/4343_5072_7091_3242 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Schneider Electric - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - IIOT ready Logic and Motion Controller - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - FR - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Rue Joseph Monier - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 92506 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Rueil Malmaison - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Hauts de Seine - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - Logic/Motion controller - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 8B192700462 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - FR - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - 2019 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - Marking_UL - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/UL.png - - - - false - false - - - - - Marking_WEEE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/Marking_WEEE.png - - - - false - false - - - - - - Document - www.company.com/ids/sm/2543_5072_7091_2660 - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Schneider Electric SE - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Schneider Electric Automation GmbH - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02.00 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - EU - Declaration of conformity - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - MOD2019002.00_DeclarationOfConformity_TM262_TMS_TM3XHSC_signed.pdf - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - MOD2019002.00_DeclarationOfConformity_TM262_TMS_TM3XHSC_signed.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/MOD2019002.00_DeclarationOfConformity_TM262_TMS_TM3XHSC_signed.pdf - - - - false - false - - - - - DeclarationULMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Schneider Electric SE - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Schneider Electric Automation GmbH - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Notice of Completion and autorization to apply the UL mark - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - M262_20190513_Notice of Authorization.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/M262_20190513_Notice_of_Authorization.pdf - - - - false - false - - - - - InstructionSheet - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - QGH5583101 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Schneider Electric SE - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Schneider Electric Automation GmbH - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Instruction Sheet - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - IS_M262.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/IS_M262.pdf - - - - false - false - - - - - - Service - www.company.com/ids/sm/6053_5072_7091_5102 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Schneider Elcetric - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Schneider Platz - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 97816 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Marktheidenfeld - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.schneider-electric.com/en/work/support/ - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - - Identification - www.company.com/ids/sm/6563_5072_7091_4267 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Schneider Electric - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - TM262L20MESE8T - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - - - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - - - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - IIOT Ready Logic and Motion Controller - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - Logic/Motion controller Modicon M262 IIoT-ready logic & motion controller for performance machines. Modicon M262 controllers embed Industrial Internet of Things (IIoT) protocols and encryption to provide direct cloud connectivity & digital services. - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Schneider Electric - - - - - GLNOfSupplier - PARAMETER - - - 0173-1#02-AAY813#001 - - - Instance - - string - TM262L20MESE8T - - - - - SupplierIdProvider - PARAMETER - - - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - Instance - - - - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Instance - - - - - - - - SupplierProductDesignation - - - 0173-1#02-AAM551#002 - - - Instance - - string - IIOT Ready Logic and Motion Controller - - - - - SupplierProductDescription - PARAMETER - - - 0173-1#02-AAU730#001 - - - Instance - - langString - Logic/Motion controller Modicon M262 IIoT-ready logic & motion controller for performance machines. Modicon M262 controllers embed Industrial Internet of Things (IIoT) protocols and encryption to provide direct cloud connectivity & digital services. - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - Logic/Motion controller - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /aasx/Identification/M262.PNG - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - www.company.com/ids/asset/8220_6010_8091_3593 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 8B192700462 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - - - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - - - - - - QrCode - PARAMETER - - - https://www.hsu-hh.de/aut/aas/qrcode - - - Instance - - image/jpeg - /aasx/Identification/QRCode_M262.JPG - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Schneider Electric - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - FR - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Rue Joseph Monier - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 92506 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Rueil Malmaison - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Hauts de Seine - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.schneider-electric.com/en/ - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/Identification/logo_SE.png - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.schneider-electric.com/en/product-range-presentation/65771-logic-motion-controller-modicon-m262/?filter=business-1-industrial-automation-and-control#tabs-top - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/4401_1272_7091_3437 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/12_Pepperl+Fuchs.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/12_Pepperl+Fuchs.aasx.xml deleted file mode 100644 index b11a4a11a..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/12_Pepperl+Fuchs.aasx.xml +++ /dev/null @@ -1,3973 +0,0 @@ - - - - - PeFu_267075_100078 - www.company.com/ids/aas/8403_3140_0191_8844 - - - www.company.com/ids/asset/1595_3140_0191_3961 - - - - - - www.company.com/ids/sm/4343_5072_7091_3242 - - - - - www.company.com/ids/sm/2543_5072_7091_2660 - - - - - www.company.com/ids/sm/6053_5072_7091_5102 - - - - - www.company.com/ids/sm/6563_5072_7091_4267 - - - - - - - - - 267075_100078 - CONSTANT - www.company.com/ids/asset/1595_3140_0191_3961 - Instance - - - - - Nameplate - www.company.com/ids/sm/4343_5072_7091_3242 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Pepperl+Fuchs - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Distance Sensor - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Lilienthalstr. 200 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 68307 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Mannheim - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Baden-Wuertemberg - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 40000089327054 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - DE - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - 2018 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - - Document - www.company.com/ids/sm/2543_5072_7091_2660 - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Pepperl+Fuchs - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Pepperl+Fuchs - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - EU-Konformitätserklärung - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - EU-Konformitaetserklaerung.pdf.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/EU-Konformitaetserklaerung.pdf - - - - false - false - - - - - Certificat_DIN_EN_ISO_14001_2015 - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Pepperl+Fuchs - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Pepperl+Fuchs - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Data Sheet OMT100-R100-2EP-IO-V31 - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - 267075-100078_eng.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/267075-100078_eng.pdf - - - - false - false - - - - - - Service - www.company.com/ids/sm/6053_5072_7091_5102 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Pepperl+Fuchs - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Lilienthalstr. 200 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 68307 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Mannheim - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Baden-Würtemberg - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - info@pepperl-fuchs.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.pepperl-fuchs.com - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +496217760 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - - - - - - false - false - - - - - - Identification - www.company.com/ids/sm/6563_5072_7091_4267 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Pepperl+Fuchs - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - - - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - - - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - string - 267075-100078 - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - OMT100-R100-2EP-IO-V31 - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - string - Distance Sensor, Measurement to object, 100 mm detection range, red light, measured value via IO-Link, 2 x push-pull output, M8 plug - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Pepperl+Fuchs - - - - - GLNOfSupplier - PARAMETER - - - 0173-1#02-AAY813#001 - - - Instance - - - - - - - - SupplierIdProvider - PARAMETER - - - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - Instance - - - - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Instance - - string - 267075-100078 - - - - - SupplierProductDesignation - - - 0173-1#02-AAM551#002 - - - Instance - - string - OMT100-R100-2EP-IO-V31 - - - - - SupplierProductDescription - PARAMETER - - - 0173-1#02-AAU730#001 - - - Instance - - string - Distance Sensor - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eclass - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /MAC0007059_rgb.jpg - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - www.company.com/ids/asset/1595_3140_0191_3961 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 40000089327054 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - - - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Pepperl+Fuchs - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Lilienthalstr. 200 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 68307 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Mannheim - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Baden-Würtemberg - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - info@pepperl-fuchs.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.pepperl-fuchs.com - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +496217760 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/Identification/PF_Logo_RGB.jpg - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.pepperl-fuchs.com/usa/en/classid_53.htm?view=productdetails&prodid=66664 - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/4401_1272_7091_3437 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/13_DKE.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/13_DKE.aasx.xml deleted file mode 100644 index 9c4ff996e..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/13_DKE.aasx.xml +++ /dev/null @@ -1,4210 +0,0 @@ - - - - - dkeNamePlate - www.dke.de/digitales-typenschild - - - - - - - www.company.com/ids/sm/4343_5072_7091_3242 - - - - - www.company.com/ids/sm/6053_5072_7091_5102 - - - - - www.company.com/ids/sm/6563_5072_7091_4267 - - - - - www.company.com/ids/sm/5171_3150_1191_6645 - - - - - www.company.com/ids/sm/7543_3150_1191_1022 - - - - - - - - - DKE1234 - - DKE peppermint dragees - DEK Pfefferminzdragees - - www.company.com/ids/asset/3240_1162_7091_2878 - Instance - - - - - Nameplate - www.company.com/ids/sm/4343_5072_7091_3242 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - DKE Deutsche Kommission Elektrotechnik Elektronik Informationstechnik in DIN und VDE - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Pfefferminzdragees - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Stresemannallee 15 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 60596 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Frankfurt - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Hessen - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 123456 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - DE - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - integer - 2019 - - - - - - Service - www.company.com/ids/sm/6053_5072_7091_5102 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - DKE Deutsche Kommission Elektrotechnik Elektronik Informationstechnik in DIN und VDE - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Distributor - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Stresemannallee 15 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 60596 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Frankfurt - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Hessen - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - dke@vde.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - string - https://www.dke.de/digitales-typenschild - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49 69 6308-0 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - +49 69 6308-9863 - - - - false - false - - - - - - Identification - www.company.com/ids/sm/6563_5072_7091_4267 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Deutsche Kommission Elektrotechnik Elektronik Informationstechnik in DIN und VDE - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - DKE123456 - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - - - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - - - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Pfefferminzdragees - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - Pfefferminzdragees in Blechdose - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - DKE Deutsche Kommission Elektrotechnik Elektronik Informationstechnik in DIN und VDE - - - - - GLNOfSupplier - PARAMETER - - - 0173-1#02-AAY813#001 - - - Instance - - string - DKE123456 - - - - - SupplierIdProvider - PARAMETER - - - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - Instance - - - - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Instance - - - - - - - - SupplierProductDesignation - - - 0173-1#02-AAM551#002 - - - Instance - - string - Pfefferminzdragees - - - - - SupplierProductDescription - PARAMETER - - - 0173-1#02-AAU730#001 - - - Instance - - langString - Pfefferminzdragees in Blechdose - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eclass - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /dke-dose.jpg - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - anyURI - www.dke.de/digitales-typenschild - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - DKE123456 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - date - 2019 - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - - - - - - QrCode - PARAMETER - - - https://www.hsu-hh.de/aut/aas/qrcode - - - Instance - - image/png - /aasx/dke-qr.png - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - DKE Deutsche Kommission Elektrotechnik Elektronik Informationstechnik in DIN und VDE - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Distributor - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - langString - Stresemannallee 15 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 60596 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Frankfurt - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Hessen - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - dke@vde.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.dke.de/digitales-typenschild - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49 69 6308-0 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - +49 69 6308-9863 - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/jpeg - /aasx/dke-logo.jpg - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.dke.de/digitales-typenschild - - - - - LOT - CONSTANT - - Lot - Lot - - - - - - - - Instance - - string - 696.240 - - - - - best_before - - Mindesthaltbarkeit - best before - - - - - - - Instance - - date - 11/2020 - - - - - weight - CONSTANT - - Inhalt, g - content, g - - - - - - - Instance - - decimal - 18.0 - - - - - content - - Inhalt - CONTENT - - - - - - - - - - - - Instance - - string - Pfefferminzdragees - - - - - - nutrition_facts - PARAMETER - - Nährwertangaben - Nutrition Facts - - www.company.com/ids/sm/5171_3150_1191_6645 - - - - - - - https://www.hsu-hh.de/aut/aas/nutrition-facts - - - Instance - - - - - nutrition_value - CONSTANT - - Nährwert, kJ/100g - nutrition value, kJ/100g - - - - - - - - Instance - - decimal - 1604 - - - - - fat - - Fett, g - Fat, g - - - - - - - Instance - - decimal - 0.4 - - - - - saturated_fat - - gesättigte Fette, g - saturated fats, g - - - - - - - Instance - - decimal - 0.1 - - - - - carbohydrates - - Kohlenhydrate, g - Carbohydrates,g - - - - - - - Instance - - decimal - 93.2 - - - - - sugar - CONSTANT - - Zucker, g - Sugar, g - - - - - - - Instance - - decimal - 92.6 - - - - - protein - CONSTANT - - Eiweiß, g - Protein, g - - - - - - - - Instance - - long - 0.2 - - - - - salt - CONSTANT - - Salz, g - Salt, g - - - - - - - Instance - - string - < 0.005 - - - - - - ingredients - PARAMETER - - Inhaltsstoffe - Ingredients - - www.company.com/ids/sm/7543_3150_1191_1022 - - - https://www.hsu-hh.de/aut/aas/ingredients - - - Instance - - - - - igrendient_1 - - Inhaltsstoff 1 - Ingredient 1 - - - - - - - Instance - - string - sugar - - - - - ingredient_2 - - Inhaltsstoff 2 - Ingredient 2 - - - - - - - Instance - - string - dextrose - - - - - ingredient_3 - - Inhaltsstoff 3 - Ingredient 3 - - - - - - - Instance - - string - E470b - - - - - ingredient_4 - - Inhaltsstoff 4 - Ingredient 4 - - - - - - - Instance - - string - flavour - - - - - ingredient_5 - - Inhaltsstoff 5 - Ingredient 5 - - - - - - - Instance - - string - glucose - - - - - ingredient_6 - - Inhaltsstoff 6 - Ingredient 6 - - - - - - - Instance - - string - E171 - - - - - ingredient_7 - - Inhaltsstoff 7 - Ingredient 7 - - - - - - - Instance - - - carnauba wax - - - - - ingredient_8 - CONSTANT - - Inhaltsstoff 8 - Ingredient 8 - - - - - - - Instance - - string - gummi arabicum - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Pfefferminzdragees - peppermint dragees - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/4401_1272_7091_3437 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - TelephoneContact - https://www.hsu-hh.de/aut/aas/ContactInfo/TelephoneContact - - - - - - - - Telephone Contact - Telefonkontakt - - TelephoneContact - - - - - Sammlung für Kontaktdaten über Telefon - Collection for contact data via telephone - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - WEEELabelingPresent - 0173-1#02-AAR528#005 - - - - - - - - Kennzeichnung (WEEE) vorhanden - WEEE labeling present - - WEEELabelingPresent - - - BOOLEAN - - indication whether the product is equipped with a specified WEEE labeling - Angabe, ob das Produkt mit einer spezifizierten WEEE-Kennzeichnung ausgestattet ist - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - ValString - www.company.com/ids/cd/4490_8182_7091_6124 - - - - - - - - Wert - Value String - - ValString - - - - - Ausdruck für den Wert der übergeordneten Collection. - Value string for the collection value on the next superordinate level - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentIdDomain - www.company.com/ids/cd/6003_8182_7091_9350 - - - - - - - - DocumentIdDomain - DocumentIdDomain - - DocumentIdDomain - - - - - Angabe einer Liste von Domänen, in de-nen die DocumentIds des Dokuments eindeutig sind - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Party - www.company.com/ids/cd/3153_8182_7091_4327 - - - - - - - - Party - Party - - Party - - - - - Verweis auf eine Party (siehe VDI 2770 Anhang C1.17), die für diese Domäne verantwortlich ist - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_Organisation - www.company.com/ids/cd/9214_8182_7091_6391 - - - - - - - - Organisation - Organisation - - Organisation - - - - - Angabe einer Organisation - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersion - www.company.com/ids/cd/2580_0282_7091_6213 - - - - - - - - Dokumenten-Version - DocumentVersion - - DocumentVersion - - - - - Zu jedem Dokument muss eine Menge von mindestens einer Dokumentenversion existieren. Es können auch mehrere Dokumentenversionen ausgeliefert werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - VDI2770_Language - www.company.com/ids/cd/0231_0282_7091_5062 - - - - - - - - Sprache - Language - - Language - - - - - Liste der im Dokument verwendeten Sprachen - TBD - - - - - - - DocumentVersion_Description - www.company.com/ids/cd/9151_0282_7091_8032 - - - - - - - - Beschreibung zur DocumentVersion - DocumentVersion Description - - DocumentVersion_Description - - - - - Zusammenfassende Beschreibungen zur Dokumentenversion in ggf. unterschiedlichen Sprachen. - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_LifeCycleStatus - www.company.com/ids/cd/0282_0282_7091_7878 - - - - - - - - Lebenszyklus Status - LifeCycleStatus - - LifeCycleStatus - - - - - Liste von Statusdefinitionen mit Bezug zum Dokumentenlebenszyklus inklusive der Angabe der Beteiligten und einem zugehörigen Zeitstempel - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - DocumentRelationship - www.company.com/ids/cd/1204_0282_7091_7896 - - - - - - - - Dokumenten-Beziehung - Document Relationship - - DocumentRelationship - - - - - Liste von Beziehungen zu anderen Dokumenten. Es ist möglich, auf einen Dokument, ein Dokument in einer spezifischen Dokumentenversion oder auch ein Teildokument zu verweisen. - TBD - - - - - - - DocumentRelationship_Type - www.company.com/ids/cd/5044_0282_7091_6924 - - - - - - - - Typ der Dokumenten-Beziehung - DocumentRelationship_Type - - DocumentRelationship_Type - - - - - Typisierung der Beziehung zwischen den beiden DocumentVersions. Folgende Beziehungsarten können verwendet werden: Affecting (hat Auswirkungen auf), ReferesTo (bezieht sich auf), BasedOn (basiert auf) - TBD - - - - - - - StoredDocumentRepresentation - www.company.com/ids/cd/3094_0282_7091_2090 - - - - - - - - StoredDocumentRepresentation - StoredDocumentRepresentation - - StoredDocumentRepresentation - - - - - Liste von digitalen Repräsentationen zur DocumentVersion - TBD - - - - - - - VDI2770_DigitalFile - www.company.com/ids/cd/2305_0282_7091_2077 - - - - - - - - Digitaler-File - DigitalFile - - DigitalFile - - - - - Datei, die die DocumentVersion (siehe VDI 2770:2018 Anhang C1.5) repräsentiert Neben der obligatorischen PDF/A-Datei können weitere Dateien angegeben werden. - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_ReferencedObject - www.company.com/ids/cd/2570_2282_7091_0055 - - - - - - - - ReferencedObject - ReferencedObject - - ReferencedObject - - - - - Liste von IDs für ein Objekt, auf das sich das Dokument bezieht - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - DocGroup_01 - www.company.com/ids/cd/1420_0113_7091_0891 - - - - - - - - 01 Identifikation - 01 Identification - - DocGroup_01 - - - - - Der Gruppe „Identifikation“ werden alle Dokumente zugeordnet, die der Identifikation des Objekts dienen, zu dem die Herstellerdokumentation gehört. Sie enthält insbesondere Informationen, die die elektronische Datenverarbeitung unterstützen und die es dem Hersteller und dem Nutzer erlauben, das Objekt in ihren jeweiligen elektronischen Datenverarbeitungssystemen zu identifizieren. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocGroup_02 - www.company.com/ids/cd/4323_0113_7091_2591 - - - - - - - - 02 Technische Beschaffenheit - 02 Technical characteristics - - DocGroup_02 - - - - - Die Gruppe „Technische Beschaffenheit“ beinhaltet alle Dokumente, die die technischen Anforderungen, deren Erfüllung und die Bescheinigung der Eigenschaften eines Objekts betreffen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocGroup_03 - www.company.com/ids/cd/5053_0113_7091_5741 - - - - - - - - 03 Tätigkeitsbezogene Dokumente - 03 Work-related documents - - DocGroup_03 - - - - - Die Gruppe „Tätigkeitsbezogene Dokumente“ beinhaltet alle Dokumente, die Anforderungen, Hinweise und Hilfestellungen für Tätigkeiten an und mit dem Objekt nach der Übergabe an den Nutzer betreffen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocGroup_04 - www.company.com/ids/cd/5473_0113_7091_1588 - - - - - - - - 04 Vertragsunterlagen - 04 Contract documents - - DocGroup_04 - - - - - Der Gruppe „Vertragsunterlagen“ werden alle Dokumente zugeordnet, die im Zusammenhang mit der kaufmännischen Abwicklung eines Vertrages stehen, aber nicht selbst Gegenstand des Vertrags sind und lediglich zur Erfüllung des Vertrags dienen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_01-01 - www.company.com/ids/cd/9593_0113_7091_2401 - - - - - - - - 01-01 Identifikation - 01-01 Identification - - DocCategory_01-01 - - - - - Der Kategorie „Identifikation“ werden alle Dokumente zugeordnet, die der Identifikation des Objekts dienen, zu dem die Herstellerdokumentation gehört. Sie enthält insbesondere Informationen, die die elektronische Datenverarbeitung unterstützen und die es dem Hersteller und dem Nutzer erlauben, das Objekt in ihren jeweiligen elektronischen Datenverarbeitungssystemen zu identifizieren. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_02-01 - www.company.com/ids/cd/5314_0113_7091_8640 - - - - - - - - 02-01 Techn. Spezifikation - 02-01 Technical specification - - DocCategory_02-01 - - - - - Der Kategorie „Technische Spezifikation“ werden alle Dokumente zugeordnet, die die Anforderungen an ein Objekt sowie dessen Eigenschaften beschreiben. Dazu gehören die Auslegungsdaten, Berechnungen (Verfahrenstechnik, Festigkeit usw.) sowie alle relevanten Eigenschaften des übergebenen Objekts. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_02-02 - www.company.com/ids/cd/5515_0113_7091_8581 - - - - - - - - 02-02 Zeichnungen, Pläne - 02-02 Drawings and diagrams - - DocCategory_02-02 - - - - - Der Kategorie „Zeichnungen, Pläne“ werden alle Dokumente zugeordnet, die Zeichnungscharakter haben, das heißt eine grafische Darstellung zur Übermittlung von Information nutzen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_02-03 - www.company.com/ids/cd/0335_0113_7091_0312 - - - - - - - - 02-03 Bauteile - 02-03 Components - - DocCategory_02-03 - - - - - Der Kategorie „Bauteile“ werden alle Dokumente zugeordnet, die eine strukturierte Auflistung der Teile eines Objekts beinhalten. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_02-04 - www.company.com/ids/cd/2155_0113_7091_3955 - - - - - - - - 02-04 Zeugnisse, Zertifikate, Bescheinigungen - 02-04 Reports, Certificates, declarations - - DocCategory_02-04 - - - - - Der Kategorie „Zeugnisse, Zertifikate, Bescheinigungen“ werden alle Dokumente zugeordnet, die Urkundencharakter haben. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-01 - www.company.com/ids/cd/3565_0113_7091_2704 - - - - - - - - 03-01 Montage, Inbetriebnahme, Demontage - 03-01 Assembly, commissioning, disassembly - - DocCategory_03-01 - - - - - Der Kategorie „Montage, Demontage“ werden alle Dokumente zugeordnet, die Tätigkeiten und Maßnahmen beschreiben, die erforderlich sind, um ein Objekt: zu transportieren oder zu lagern, als Ganzes in ein übergeordnetes Objekt einzubauen, auszubauen oder an dieses anzuschließen, so weit vorzubereiten, dass es zur Inbetriebnahme bereitsteht, nach Abschluss der Nutzungsphase zu demontieren und zu entsorgen - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-02 - www.company.com/ids/cd/4290_1113_7091_7266 - - - - - - - - 03-02 Bedienung - 03-02 Operation - - DocCategory_03-02 - - - - - Der Kategorie „Bedienung“ werden Dokumente zur bestimmungsgemäßen Verwendung und sicheren Bedienung eines Objekts zugeordnet. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-03 - www.company.com/ids/cd/2211_1113_7091_3911 - - - - - - - - 03-03 Allgemeine Sicherheit - 03-03 Safety in general - - DocCategory_03-03 - - - - - Der Kategorie „Allgemeine Sicherheit“ werden Dokumente zugeordnet, die Sicherheitshinweise auf mögliche Gefährdungen bei der Verwendung des Objekts geben. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-04 - www.company.com/ids/cd/7521_1113_7091_4471 - - - - - - - - 03-04 Inspektion, Wartung, Prüfung - 03-04 Inspection, maintenance, test - - DocCategory_03-04 - - - - - Der Kategorie „Inspektion, Wartung, Prüfung“ werden alle Dokumente zugeordnet, die vom Hersteller vorgeschlagene wiederkehrende Maßnahmen zur Feststellung oder zum Erhalt des funktionsfähigen Zustands beschreiben. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-05 - www.company.com/ids/cd/5161_1113_7091_0458 - - - - - - - - 03-05 Instandsetzung - 03-05 Repair - - DocCategory_03-05 - - - - - Der Kategorie „Instandsetzung“ werden alle Dokumente zugeordnet, die Maßnahmen zur Wiederherstellung der Funktion eines Objekts betreffen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-06 - www.company.com/ids/cd/2181_1113_7091_5948 - - - - - - - - 03-06 Ersatzteile - 03-06 Spare parts - - DocCategory_03-06 - - - - - Der Kategorie „Ersatzteile“ werden Dokumente zugeordnet, die Informationen zu Ersatzteilen und Hilfs- und Betriebsstoffen enthalten. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_04-01 - www.company.com/ids/cd/5391_1113_7091_8996 - - - - - - - - 04-01 Vertragsunterlagen - 04-01 Contract documents - - DocCategory_04-01 - - - - - Der Kategorie „Vertragsunterlagen“ werden alle Dokumente zugeordnet, die im Zusammenhang mit der kaufmännischen Abwicklung eines Vertrages stehen, aber nicht selbst Gegenstand des Vertrags sind und lediglich zur Erfüllung des Vertrags dienen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/14_Siemens.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/14_Siemens.aasx.xml deleted file mode 100644 index 4f696a0d6..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/14_Siemens.aasx.xml +++ /dev/null @@ -1,6015 +0,0 @@ - - - - - SITRANS_P320 - www.company.com/ids/aas/9460_8042_0191_4407 - - - http://siemens.com/pimobile?1P=7MF0300-1QU01-5BF2-Z&S=N1L22110101185 - - - - - - www.company.com/demo/sm/instance/F9CC779860FC1039 - - - - - www.company.com/demo/sm/instance/204F677FF7D40E79 - - - - - www.company.com/demo/sm/instance/1D77CEFC25CEC482 - - - - - www.company.com/demo/sm/instance/4F44B8B32822E483 - - - - - - - - - P320 - - SITRANS P320 für Relativdruck, HART (4 ... 20 mA) - SITRANS P320 for gauge pressure, HART (4 ... 20 mA) - - http://siemens.com/pimobile?1P=7MF0300-1QU01-5BF2-Z&S=N1L22110101185 - Instance - - - - - Nameplate - www.company.com/demo/sm/instance/F9CC779860FC1039 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Siemens AG - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - SITRANS P320 für Relativdruck, HART (4 ... 20 mA) - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 76181 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Karlsruhe - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Baden-Württemberg - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - Druckmessumformer - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - N1L22110101185 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - DE - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - 2019 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - 0173-1#07-CAA016#001 - - - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - - Identification - www.company.com/demo/sm/instance/4F44B8B32822E483 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Siemens AG - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - - 4016001000006 - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - - - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - - 7MF0300-1QU01-5BF2-Z B11+C20+D42+E20+Y01+Y17+Y21 - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - SITRANS P320 for gauge pressure, HART (4 ... 20 mA) - - - - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - string - Gauge Pressure Transmitter - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Siemens AG - - - - - GLNOfSupplier - PARAMETER - - - 0173-1#02-AAY813#001 - - - Instance - - - 4016001000006 - - - - - SupplierIdProvider - PARAMETER - - - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - Instance - - - - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Instance - - - 7MF0300-1QU01-5BF2-Z B11+C20+D42+E20+Y01+Y17+Y21 - - - - - SupplierProductDesignation - - - 0173-1#02-AAM551#002 - - - Instance - - string - SITRANS P320 for gauge pressure, HART (4 ... 20 mA) - - - - - SupplierProductDescription - PARAMETER - - - 0173-1#02-AAU730#001 - - - Instance - - string - Gauge Pressure Transmitter - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eclass - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /P_FI01_XX_05457I.jpg - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - http://siemens.com/pimobile?1P=7MF0300-1QU01-5BF2-Z&S=N1L22110101185 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - N1L22110101185 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - date - 15.04.2019 - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - string - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - 12.34.56 - - - - - QrCode - PARAMETER - - - https://www.hsu-hh.de/aut/aas/qrcode - - - Instance - - image/jpeg - /aasx/Identification/qrcode_P320.png - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Siemens AG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 76181 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Karlsruhe - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Baden-Württemberg - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.siemens.com/processinstrumentation - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/Identification/sie-logo-layer-petrol-rgb.jpg - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - http://siemens.com/pimobile?1P=7MF0300-1QU01-5BF2-Z&S=N1L22110101185 - - - - - - Service - www.company.com/demo/sm/instance/1D77CEFC25CEC482 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Siemens AG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 76181 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Karlsruhe - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Baden-Württemberg - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://support.industry.siemens.com/ - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - - - - - - false - false - - - - - - Document - www.company.com/demo/sm/instance/204F677FF7D40E79 - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Siemens AG - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Siemens AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - EU-Konformitätserklärung - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - EU Declaration of Conformity.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/cert_EU-DoC_SitP320_P420_A5E44320812A_002.pdf - - - - false - false - - - - - Certificat_DIN_EN_ISO_14001_2015 - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - BVS 18 ATEX E049X - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Siemens AG - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Siemens AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - EN - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - ATEX-EC-Type-Examination-Certificate - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - cert__SIP320_P420_Exi_Exd_de_en_BVS_18_ATEX_E049X.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/cert__SIP320_P420_Exi_Exd_de_en_BVS_18_ATEX_E049X.pdf - - - - false - false - - - - - Betriebsanleitung - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - A5E41285171-AB - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Siemens AG - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Siemens AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Betriebsanleitung - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - date - 01.09.2018 - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - A5E41285171-ABde_P320P420_HART_OI_de-DE.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/A5E41285171-ABde_P320P420_HART_OI_de-DE.pdf - - - - false - false - - - - - OperatingInstruction - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - A5E44852162-AB - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Siemens AG - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Siemens AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Operating Instructions - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - date - 01.09.2018 - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - A5E44852162-ABen_P320P420_HART_OI_en-US.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/A5E44852162-ABen_P320P420_HART_OI_en-US.pdf - - - - false - false - - - - - Kompaktbetriebsanleitung - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - A5E38874562-AB - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Siemens AG - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Siemens AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Kompaktbetriebsanleitung - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - date - 01.09.2018 - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - A5E38874562-ABde_P320P420_COI_de-DE.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/A5E38874562-ABde_P320P420_COI_de-DE.pdf - - - - false - false - - - - - CompactOperatingInstructions - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - A5E38874562-AB - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Siemens AG - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Siemens AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Compact Operating Instructions - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - date - 01.09.2018 - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - A5E38874562-ABen_P320P420_COI_en-US.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/A5E38874562-ABen_P320P420_COI_en-US.pdf - - - - false - false - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/4401_1272_7091_3437 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - OrganisationContactInfo - www.company.com/demo/cd/1DEEF3CC9CF46C80 - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - CompanyLogo - www.company.com/ids/cd/3132_1142_0191_9159 - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - DocumentationItem - - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - Her - 0173-1#02-AAO055#001 - - - 1 - - - - - - - - - Herstellername - - Her - - - STRING - - ist die Bezeichnung des Produzenten - - - - - - - 0173-1#02-AAO055#001 - - - - - 0173-1#02-AAM552#002 - - - 1 - - - - - - - - - Herstellerartikelbezeichnung - - Her - - - STRING - - vom Hersteller (oder Vertrieb) festgelegter Markenname für ein Produkt, wobei Produkt synonym für Objekt, Gegenstand oder Dienstleistung steht - - - - - - - 0173-1#02-AAM552#002 - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/15_Siemens.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/15_Siemens.aasx.xml deleted file mode 100644 index 4afa75765..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/15_Siemens.aasx.xml +++ /dev/null @@ -1,5044 +0,0 @@ - - - - - S7_CPU1515 - CONSTANT - www.company.com/demo/aas/1234554842136874684321 - - 1 - 0 - - - - www.siemens.com/ids/asset/MLFB=6ES7515-2FM00-0AB0&SN=C-E9S35353 - - - - - - www.company.com/demo/sm/instance/F9CC779860FC10391 - - - - - www.company.com/demo/sm/instance/4F44B8B32822E483 - - - - - www.company.com/demo/sm/instance/1D77CEFC25CEC482 - - - - - www.company.com/demo/sm/instance/204F677FF7D40E79 - - - - - - - - - S7_1515F_2PN - - - SIMATIC S7-1500F, CPU 1515F-2 PN, Zentralbaugruppe mit Arbeitsspeicher 750 KB für Programm und 3MByte für Daten, 1. Schnittstelle, PROFINET IRT mit 2 Port Switch, 2. Schnittstelle, Ethernet, 30 NS Bit-Performance, SIMATIC Memory Card notwendig - SIMATIC S7-1500F, CPU 1515F-2 PN, Central processing unit with work memory 750 KB for Program and 3 MB for data, 1st interface, PROFINET IRT with 2-port switch, 2nd interface, Ethernet, 30 ns bit performance, SIMATIC Memory Card required - - www.siemens.com/ids/asset/MLFB=6ES7515-2FM00-0AB0&SN=C-E9S35353 - Instance - - - - - Nameplate - www.company.com/demo/sm/instance/F9CC779860FC10391 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Siemens AG - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - CPU 1515F-2 PN - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 90475 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Nuremberg - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bayern - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - Programmable logic control (SPS) - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - C-E9S35353 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - DE - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - 2014 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - Marking_UL - PARAMETER - - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - ULMarkingPresent - PARAMETER - - - 0173-1#02-AAW723#001 - - - Instance - - boolean - 1 - - - - - - - - File - PARAMETER - - - - - Instance - - - /aasx/Nameplate/marking_UL.jpg - - - - false - false - - - - - - Identification - www.company.com/demo/sm/instance/4F44B8B32822E483 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Siemens AG - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - 4047623000006 - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - string - GS1 - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - string - 6ES7515-2FM00-0AB0 - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - CPU 1515F-2 PN, 750KB Prog., 3MB Daten - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - string - SIMATIC S7-1500F, CPU 1515F-2 PN, Central processing unit with work memory 750 KB for Program and 3 MB for data, 1st interface, PROFINET IRT with 2-port switch, 2nd interface, Ethernet, 30 ns bit performance, - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Siemens AG - - - - - GLNOfSupplier - PARAMETER - - - 0173-1#02-AAY813#001 - - - Instance - - string - 4047623000006 - - - - - SupplierIdProvider - PARAMETER - - - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - Instance - - string - GS1 - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Instance - - string - 6ES7515-2FM00-0AB0 - - - - - SupplierProductDesignation - - - 0173-1#02-AAM551#002 - - - Instance - - string - CPU 1515F-2 PN, 750KB Prog., 3MB Daten - - - - - SupplierProductDescription - PARAMETER - - - 0173-1#02-AAU730#001 - - - Instance - - string - SIMATIC S7-1500F, CPU 1515F-2 PN, Central processing unit with work memory 750 KB for Program and 3 MB for data, 1st interface, PROFINET IRT with 2-port switch, 2nd interface, Ethernet, 30 ns bit performance, - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - Programmable logic control (SPS) - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eclass - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /P_ST70_XX_06800J.jpg - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - www.siemens.com/ids/asset/MLFB=6ES7515-2FM00-0AB0&SN=C-E9S35353 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - C-E9S35353 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - date - 2014 - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - string - 01 - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - string - V1.8.5 - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - string - 01 - - - - - QrCode - PARAMETER - - - https://www.hsu-hh.de/aut/aas/qrcode - - - Instance - - image/jpeg - /aasx/Identification/dmc.gif - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Siemens AG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Gleiwitzer Str. 555 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 90475 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Nuremberg - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Bavaria - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - markus.kempf@siemens.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.siemens.com/automation - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/Identification/sie-logo-layer-petrol-rgb.jpg - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://support.industry.siemens.com/cs/pd/86475?pdti=pi&dl=en&lc=en-WW - - - - - - Service - www.company.com/demo/sm/instance/1D77CEFC25CEC482 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Siemens AG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Gleiwitzer Str. 555 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 90475 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Nuremburg - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - bavaria - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://support.industry.siemens.com/ - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - - - - - - false - false - - - - - - Document - www.company.com/demo/sm/instance/204F677FF7D40E79 - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Manufacturer - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Siemens AG - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Siemens AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - EU-Konformitätserklärung - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - 106_CE_S7_1500_general_A3_10_2019_d_e.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/106_CE_S7_1500_general_A3_10_2019_d_e.pdf - - - - false - false - - - - - DeclarationULMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Manufacturer - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Siemens AG - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Siemens AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Certificate of compliance - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - S7-1500_Vol.9_Sec.1_E222109.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/S7-1500_Vol.9_Sec.1_E222109.pdf - - - - false - false - - - - - Produktinformation - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - A5E35635424-AG - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - string - Handbuch - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Manufacturer - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Siemens AG - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Siemens AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-03 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Allgemeine Sicherheit - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - DE, EN, FR, SP, IT, CH - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - SIMATIC S7-1200/S7-1500 F-CPUs Produktinformation - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - string - 11/18 - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - s71200_1500_f_cpus_product_information_x_de-DE.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/s71200_1500_f_cpus_product_information_x_de-DE.pdf - - - - false - false - - - - - Programming and Operating Manual - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - string - A5E02714440-AH - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Manufacturer - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Siemens AG - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Siemens AG - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - SIMATIC Industrial Software SIMATIC Safety - Configuring and Programming - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - date - 09.26.2018 - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - ProgFAILenUS_en-US.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/ProgFAILenUS_en-US.pdf - - - - false - false - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - SIMATIC S7-1500F, CPU 1515F-2 PN, Zentralbaugruppe mit Arbeitsspeicher 750 KB für Programm und 3MByte für Daten, 1. Schnittstelle, PROFINET IRT mit 2 Port Switch, 2. Schnittstelle, Ethernet, 30 NS Bit-Performance - SIMATIC S7-1500F, CPU 1515F-2 PN, Central processing unit with work memory 750 KB for Program and 3 MB for data, 1st interface, PROFINET IRT with 2-port switch, 2nd interface, Ethernet, 30 ns bit performance - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl der Anschrift - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - PARAMETER - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/4401_1272_7091_3437 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - DocumentationItem - - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - Filename - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - ULMarkingPresent - 0173-1#02-AAW723#001 - - - 1 - - - - - - - - - UL-Listing vorhanden - UL listing present - - UlLisPre - - - BOOLEAN - - Indiz und Bestätigung für das Vorhandensein von erforderlichen, zweckentsprechenden Eigenschaften (z. B. in Form einer Plakette, einer (Konformitäts-)Bescheinigung, eines Zertifikats, eines Prüfprotokolls für Bauartprüfung, etc.) / Zulassung und Zertifizierung durch Underwriter's Laboratories (alphabetische Kennzeichnung von Herstellern und Lieferanten innerhalb bestimmter Produktgruppen), dass Produkte spezifischen UL-Vorschriften (UL-Style für Material und Produkteigenschaften, NEC-Type für Flammtest und Einsatzbereich) entsprechen - Indication and acknowledgment of the existence of necessary, appropriate characteristics (eg in the form of a plaque, a (conformity) certificate, a certificate, a test report for type examination, etc.) / Approval and certification by Underwriter's Laboratories (alphabetical identification of Manufacturers and suppliers within certain product groups) that products conform to specific UL regulations (UL style for material and product characteristics, NEC type for flame test and application) - - - - - - - 0173-1#02-AAW723#001 - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/16_Lenze.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/16_Lenze.aasx.xml deleted file mode 100644 index 1b7e52fd8..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/16_Lenze.aasx.xml +++ /dev/null @@ -1,4017 +0,0 @@ - - - - - Lenze_i950 - http://digital.lenze.com/aas/1/1/1616441908732837000002 - - - http://digital.lenze.com/asset/YVSBRHHZADF - - - - - - www.company.com/ids/sm/4343_5072_7091_3242 - - - - - www.company.com/ids/sm/2543_5072_7091_2660 - - - - - www.company.com/ids/sm/6053_5072_7091_5102 - - - - - www.company.com/ids/sm/6563_5072_7091_4267 - - - - - - - - - i950 - http://digital.lenze.com/asset/YVSBRHHZADF - Instance - - - - - Nameplate - www.company.com/ids/sm/4343_5072_7091_3242 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Lenze Automation GmbH - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - i950 Inverter - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Hans-Lenze-Strasse 1 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 31855 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Aerzen - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Niedersachsen - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 1616441908732837000002 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - DE - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - string - 2019 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - Marking_UL - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/UL_Mark.png - - - - false - false - - - - - - Document - www.company.com/ids/sm/2543_5072_7091_2660 - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Lenze - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Lenze Automation GmbH - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - EU-Konformitätserklärung - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - EU_Declaration_of_Conformity.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/EU_Declaration_of_Conformity.pdf - - - - false - false - - - - - DeclarationULMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Lenze - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Lenze Automation GmbH - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - UL-Approbation - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - UL-Approbation_Servoumrichter_i950_xx.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/UL-Approbation_Servoumrichter_i950_xx.pdf - - - - false - false - - - - - - Service - www.company.com/ids/sm/6053_5072_7091_5102 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Lenze Service GmbH - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Breslauer Strasse 3 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 32699 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Extertal - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - NRW - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - service.de@lenze.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.lenze.com/de-de/service/ - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49 515482-3000 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - - - - - - false - false - - - - - - Identification - www.company.com/ids/sm/6563_5072_7091_4267 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Lenze Automation GmbH - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - - - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - - - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - - - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Servoumrichter i950 - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - string - Servoumrichter - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - - - - - - GLNOfSupplier - PARAMETER - - - 0173-1#02-AAY813#001 - - - Instance - - - - - - - - SupplierIdProvider - PARAMETER - - - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - Instance - - - - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Instance - - - - - - - - SupplierProductDesignation - - - 0173-1#02-AAM551#002 - - - Instance - - string - - - - - - SupplierProductDescription - PARAMETER - - - 0173-1#02-AAU730#001 - - - Instance - - string - - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eclass - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - www.company.com/ids/cd/4401_1272_7091_3437 - - - Instance - - image/jpeg - /aasx/Identification/thumbnail.jpeg - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - string - http://digital.lenze.com/asset/YVSBRHHZADF - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 1616441908732837000002 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - - - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Lenze Automation GmbH - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Hans-Lenze-Strasse 1 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 31855 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Aerzen - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Niedersachsen - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - service.de@lenze.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.lenze.com - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49 515482-3000 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/Identification/logo.png - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.lenze.com/de-de/produkte/umrichter/schaltschrankeinbau/servoumrichter-i950/ - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - www.company.com/ids/cd/4401_1272_7091_3437 - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/17_ABB.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/17_ABB.aasx.xml deleted file mode 100644 index cba1293c8..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/17_ABB.aasx.xml +++ /dev/null @@ -1,4777 +0,0 @@ - - - - - ABB_TTF_300 - www.abb.com/8055_9070_1191_2593 - - - www.abb.com/8055_9070_1191_2593 - - - - - https://productid.abb.com/9AAC129110?sn=3K650000548505 - - - - - - www.abb.com/ids/4834_5472_7091_3242 - - - - - www.company.com/ids/sm/2543_5072_7091_2660 - - - - - www.company.com/ids/sm/6053_5072_7091_5102 - - - - - www.company.com/ids/sm/6563_5072_7091_4267 - - - - - www.abb.com/ids/6113_5160_1191_8063 - - - - - www.abb.com/ids/0212_0171_1391_2237 - - - - - www.abb.com/ids/3213_0170_1192_3931 - - - - - - - - - instanceAsset - https://productid.abb.com/9AAC129110?sn=3K650000548505 - Instance - - - www.abb.com/sm/1433_0170_1191_4089 - - - - - - - Nameplate - www.abb.com/ids/4834_5472_7091_3242 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - ABB Automation Products GmbH - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - TTF 300 - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Stierstadterstrasse 5 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 60488 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Frankfurt - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Hessen - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - Temperature transmitter - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 3K650000548505 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - DE - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - integer - 2019 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - - Document - www.company.com/ids/sm/2543_5072_7091_2660 - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - CE_TTX300_TTX200_ATEX_2016X - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - ABB - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - ABB Automation Products GmbH - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - EU-Konformitätserklärung - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - CE_TTX300_TTX200_ATEX_2016X-DE.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/CE_TTX300_TTX200_ATEX_2016X-DE.pdf - - - - false - false - - - - - ManualDE - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - OI/TTF300 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - ABB - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - ABB Automation Products GmbH - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Operation (EN) Bedienung (DE) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - G - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Betriebsanleitung - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - OI_TTF300_DE_G01.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/OI_TTF300_DE_G01.pdf - - - - false - false - - - - - ManualEN - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - OI/TTF300 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - ABB - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - ABB Automation Products GmbH - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Operation (EN) Bedienung (DE) - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - G - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Manual - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - OI_TTF300_EN_G01.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/OI_TTF300_EN_G01.pdf - - - - false - false - - - - - - Service - www.company.com/ids/sm/6053_5072_7091_5102 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - ABB AG - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Schillerstr. 72 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 32423 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Minden - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Nordrhein-Westfalen - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - contact.center@de.abb.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - string - https://new.abb.com/service - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +496213813333 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - - Identification - www.company.com/ids/sm/6563_5072_7091_4267 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - ABB Automation Products GmbH - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - - - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Instance - - - - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - Field mounted temperature transmitters - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - For enhanced (e.g. redundancy) field mounting application with 4 to 20 mA HART, PROFIBUS and FOUNDATION Fieldbus communication. With and without LCD display including device configurability. Also available with Ex-approvals and SIL declaration of conformity. - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - ABB Automation Products GmbH - - - - - GLNOfSupplier - PARAMETER - - - 0173-1#02-AAY813#001 - - - Instance - - string - - - - - - SupplierIdProvider - PARAMETER - - - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - Instance - - - - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Instance - - - TTF300.Y0C4F - - - - - SupplierProductDesignation - - - 0173-1#02-AAM551#002 - - - Instance - - string - Field mounted temperature transmitters - - - - - SupplierProductDescription - PARAMETER - - - 0173-1#02-AAU730#001 - - - Instance - - langString - For enhanced (e.g. redundancy) field mounting application with 4 to 20 mA HART, PROFIBUS and FOUNDATION Fieldbus communication. With and without LCD display including device configurability. Also available with Ex-approvals and SIL declaration of conformity. - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - Temperature transmitter - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eclass - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - https://www.hsu-hh.de/aut/aas/thumbnail - - - Instance - - image/jpeg - /thumbnail.jpg - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - anyURI - www.company.com/ids/asset/8220_6010_8091_3593 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 3K650000548505 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - date - 2018-12-20 - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - 01.01.05 - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - 01.00.02 - - - - - QrCode - PARAMETER - - - https://www.hsu-hh.de/aut/aas/qrcode - - - Instance - - image/jpeg - /aasx/QR_9AAC129110_3K650000548505.png - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - ABB Automation Products GmbH - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - langString - Wallstadter Straße 59 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 68526 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Ladenburg - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Baden-Württemberg - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - contact.center@de.abb.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://www.abb.com - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49 621 381 3333 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/ABB_Logo_320.png - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://productid.abb.com/9AAC129110?sn=3K650000548505 - - - - - - AssetIdentification - www.abb.com/ids/6113_5160_1191_8063 - - - https://www.hsu-hh.de/aut/aas/assetidentification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - ABB Automation Products GmbH - - - - - Brand - CONSTANT - - - 0173-1#02-AAO742#002 - - - Instance - - string - TTF300 - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Instance - - - TTF300.Y0C4F - - - - - EclassClassification - CONSTANT - - - - https://www.eclasscontent.com/index.php?action=det&id=27200208 - - - Instance - - - 27-20-02-08 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 3K650000548505 - - - - - InstallationID - - - - https://www.abb.com/servIS/installationID - - - Instance - - - 9AAK619994K8957 - - - - - DeliveryDate - - - - https://www.abb.com/servIS/deliveryDate - - - Instance - - - 2018-12-20 - - - - - - CertificatesAndDeclarations - - www.abb.com/ids/0212_0171_1391_2237 - - - https://www.hsu-hh.de/aut/aas/certificatesanddeclarations - - - Instance - - - - - AdditionalLinkAddress - - - 0173-1#02-AAE670#003 - - - Instance - - anyURI - https://share.library.abb.com/api/v4?cid=9AAC129110&dk=Certificate - - - - - - TechnicalData - - www.abb.com/ids/3213_0170_1192_3931 - - - https://www.hsu-hh.de/aut/aas/technicaldata - - - Instance - - - - - Weight - - - - 0173-1#02-AAB713#005 - - - Instance - - - 1.2 - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl der Anschrift - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - https://www.hsu-hh.de/aut/aas/thumbnail - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - Brand - 0173-1#02-AAO742#002 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Brand - Makre - - BRAND - - - - - - - - - - EclassClasification - CONSTANT - https://www.eclasscontent.com/index.php?action=det&id=27200208 - - - - - - - - - - - - - Temperaturmessung elektrisch komplett - Temperature measuring electr. complete - - - - - - - AdditionalLinkAddress - 0173-1#02-AAE670#003 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - zusätzlicher Online-Verweis - additional link address - - - - - STRING_TRANSLATABLE - - site address where you can view information about the product or to communicate - Angabe einer Web-Adresse, die zusätzliche Informationen zum Produkt oder Kontaktdaten enthält - - - - - - - Weight - 0173-1#02-AAB713#005 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Weight - Gewicht - - Weight - kg - - REAL_MEASURE - - Masse des Wägegutes ohne Verpackung und ohne Transportgerät - Mass of weight without packaging and transport unit - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/18_Hitachi_HX_DigTyp40.aasx.xml b/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/18_Hitachi_HX_DigTyp40.aasx.xml deleted file mode 100644 index 39324b5b9..000000000 --- a/src/AasxCsharpLibrary.Tests/TestResources/AasxCsharpLibrary.Tests/XmlValidation/expectedOk/18_Hitachi_HX_DigTyp40.aasx.xml +++ /dev/null @@ -1,6872 +0,0 @@ - - - - - 000000001 - https://admin-shell.hitachi-industrial.eu/aas/1/1/000000001 - - - https://admin-shell.hitachi-industrial.eu/asset/000000001 - - - - - - www.company.com/ids/sm/4343_5072_7091_3242 - - - - - www.company.com/ids/sm/2543_5072_7091_2660 - - - - - www.company.com/ids/sm/6053_5072_7091_5102 - - - - - www.company.com/ids/sm/6563_5072_7091_4267 - - - - - https://automation.hitachi-industrial.eu/_Resources/Static/Packages/Moon.HitachiEurope/Downloads/automation/[2]%20Software/[5]%20Configuration%20Files/[1]%20Device%20Descriptions/Device%20files.zip - - - - - - - - - Hitachi_000000001 - - Hitachi HX PLC - Hitachi HX SPS - - https://admin-shell.hitachi-industrial.eu/asset/000000001 - Instance - - - - - Nameplate - www.company.com/ids/sm/4343_5072_7091_3242 - - - https://www.hsu-hh.de/aut/aas/nameplate - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Hitachi Industrial Equipment Systems Co.,Ltd. - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - HX-CP1H16 - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - JP - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - AKS Bldg, 3 Kanda Neribei-cho - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 101-0022 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Chiyoda-ku, Tokyo - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - Tokyo - - - - false - false - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - - PAC IoT Controller HX Series - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - HX-CP1H16 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - string - N/A - - - - - ProductCountryOfOrigin - PARAMETER - - - 0173-1#02-AAO841#001 - - - Instance - - string - JP - - - - - YearOfConstruction - PARAMETER - - - 0173-1#02-AAP906#001 - - - Instance - - integer - 2018 - - - - - Marking_CE - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CEQualificationPresent - PARAMETER - - - 0173-1#02-BAF053#008 - - - Instance - - boolean - 1 - - - 0173-1#07-CAA016#001 - - - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_ce.png - - - - false - false - - - - - Marking_CRUUS - PARAMETER - - - https://www.hsu-hh.de/aut/aas/productmarking - - - Instance - - - - - CRUUSLabelingPresent - PARAMETER - - - 0173-1#02-AAR528#005 - - - Instance - - boolean - 1 - - - 0173-1#07-CAA016#001 - - - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - image/png - /aasx/Nameplate/marking_cruus.jpg - - - - false - false - - - - - - Document - www.company.com/ids/sm/2543_5072_7091_2660 - - - https://www.hsu-hh.de/aut/aas/document - - - Instance - - - - - DeclarationCEMarking - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Hitachi - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Hitachi Industrial Equipment Systems Co.,Ltd. - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - HX CE declaration - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - CE_DLR_EH-150_REV17.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/CE_DLR_EH-150_REV17.pdf - - - - false - false - - - - - DeclarationRoHS - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Hitachi - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Hitachi Industrial Equipment Systems Co.,Ltd. - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 02-04 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Zeugnisse, Zertifikate, Bescheinigungen - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - RoHS 2011/65/EU Declaration of conformity - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - CE_DLR_EH-150_REV17.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/CE_DLR_EH-150_REV17.pdf - - - - false - false - - - - - EN_Manual_Hitachi_HX_Hardware - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - NJI-637(X) - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Hitachi - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Hitachi Industrial Equipment Systems Co.,Ltd. - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 2016.11 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - HX Series Application Manual (Hardware) - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - This application manual informs about the hardware of HX series which is a high-performance PAC system suitable for IoT. The contents relevant to programming has been separated as an application manual (software) and a command reference manual. - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - NJI-637A(X)_HX-CPU_Hardware_Rev_01.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/NJI-637A(X)_HX-CPU_Hardware_Rev_01.pdf - - - - false - false - - - - - EN_Manual_Hitachi_HX_Software - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - NJI-638(X) - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Hitachi - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Hitachi Industrial Equipment Systems Co.,Ltd. - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 2016.12 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - HX Series Application Manual (Software) - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - This application manual informs about the software of HX series which is a high-performance PAC system suitable for IoT. The contents relevant to installation has been separated as an hardware manual. - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - NJI-638X_HX-CPU_Software.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/NJI-638X_HX-CPU_Software.pdf - - - - false - false - - - - - DE_CODESYS_V3_Installation_und_Erste_Schritte - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - 0000000 - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - 3S-Smart Software Solutions GmbH - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - 3S-Smart Software Solutions GmbH - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 20XX - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - de - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - CODESYS V3, Installation und Erste Schritte - Anwenderdokumentation - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - CODESYS_Installation_und_Erste_Schritte_20V11.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/CODESYS_Installation_und_Erste_Schritte_V11.pdf - - - - false - false - - - - - EN_Datasheet_IoT_PAC_Controller_HX_Series - PARAMETER - - - 0173-1#02-AAD001#001 - - - Instance - - - - - DocumentType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - Instance - - string - Single - - - - - VDI2770_DomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - Instance - - - - - - - - VDI2770_IdType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - Instance - - string - Primary - - - - - DocumentId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - Instance - - - - - - - - DocumentDomainId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - Instance - - - - - - - - VDI2770_Role - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - Instance - - string - Responsible - - - - - VDI2770_OrganisationId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - Instance - - - - - - - - VDI2770_OrganisationName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - Instance - - string - Hitachi - - - - - VDI2770_OrganisationOfficialName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - Instance - - string - Hitachi Europe GmbH - - - - - VDI2770_Description - PARAMETER - - Eine Beschreibung zur Dokumententeile ID. Da eine Sprachangabe nicht möglich ist, sollte die Sprache für dieses Metadatum vor der Lieferung abgestimmt werden. - - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - Instance - - - The new Hitachi HX series PAC Controller combines powerful features and efficiency to meet the demands of a global supply chain in manufacturing industries. In addition, HX series is already prepared for the next generation requirements in automation thanks to its IoT capabilities. Manufacturing & service innovations can be achieved with integrated functions and seamless connectivity from field machine level to cloud services. - - - - - DocumentPartId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - Instance - - - - - - - - DocumentClassification_ClassId - PARAMETER - - eindeutige ID der Klasse in einer Klassifikation - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - Instance - - string - 03-02 - - - - - VDI2770_ClassName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - Instance - - string - Bedienung - - - - - ClassificationSystem - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - Instance - - string - VDI2770:2018 - - - - - DocumentVersionId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - Instance - - - 1.10 - - - - - DocumentVersion_LanguageCode - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - Instance - - string - en - - - - - VDI2770_Title - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - Instance - - string - Datasheet: IoT PAC Controller HX Series - Next generation industrial controller. - - - - - VDI2770_Summary - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - Instance - - - - - - - - VDI2770_Keywords - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - Instance - - - - - - - - VDI2770_StatusValue - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - Instance - - string - Released - - - - - VDI2770_SetDate - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - Instance - - - 2017.03 - - - - - VDI2770_Purpose - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - Instance - - - - - - - - VDI2770_BasedOnProcedure - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - Instance - - - - - - - - VDI2770_Comments - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - Instance - - - - - - - - VDI2770_ReferencedObject_Type - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - Instance - - string - Product - - - - - VDI2770_ReferencedObject_RefType - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - Instance - - - - - - - - VDI2770_ReferencedObject_ObjectId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - Instance - - - - - - - - VDI2770_FileId - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - Instance - - - - - - - - VDI2770_FileName - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - Instance - - string - HX%20Datasheet.pdf - - - - - VDI2770_FileFormat - PARAMETER - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - Instance - - string - application/pdf - - - - - File - PARAMETER - - - 0173-1#02-AAD005#008 - - - Instance - - application/pdf - /aasx/Document/HX_Datasheet.pdf - - - - false - false - - - - - - Service - www.company.com/ids/sm/6053_5072_7091_5102 - - - https://www.hsu-hh.de/aut/aas/service - - - Instance - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Hitachi Europe GmbH - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Sales organization - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - string - Niederkasseler Lohweg 191 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 40547 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Düsseldorf - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - North Rhine-Westphalia - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - automation.industrial@hitachi-eu.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - string - https://automation.hitachi-industrial.eu/ - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49-211-5283-0 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - +49-211-2049-049 - - - - false - false - - - - - - Identification - www.company.com/ids/sm/6563_5072_7091_4267 - - - https://www.hsu-hh.de/aut/aas/identification - - - Instance - - - - - ManufacturerName - PARAMETER - - - 0173-1#02-AAO677#002 - - - Instance - - string - Hitachi Industrial Equipment Systems Co.,Ltd. - - - - - GLNOfManufacturer - PARAMETER - - - 0173-1#02-AAY812#001 - - - Instance - - string - N/A - - - - - SupplierOfTheIdentifier - - - 0173-1#02-AAP796#004 - - - Instance - - - N/A - - - - - MAN_PROD_NUM - - - 0173-1#02-AAO676#003 - - - Type - - - 1696-0702 - - - - - ManufacturerProductDesignation - PARAMETER - - - 0173-1#02-AAW338#001 - - - Instance - - string - HX-CP1H16 - - - - - ManufacturerProductDescription - PARAMETER - - - 0173-1#02-AAU734#001 - - - Instance - - langString - PLC Based PAC System for IoT Applications - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Hitachi Europe GmbH - - - - - GLNOfSupplier - PARAMETER - - - 0173-1#02-AAY813#001 - - - Instance - - string - N/A - - - - - SupplierIdProvider - PARAMETER - - - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - Instance - - - 316033943 - - - - - SUP_PROD_NUM - PARAMETER - - - 0173-1#02-AAO736#004 - - - Type - - - 1696-0702 - - - - - SupplierProductDesignation - - - 0173-1#02-AAM551#002 - - - Instance - - string - HX-CP1H16 - - - - - SupplierProductDescription - PARAMETER - - - 0173-1#02-AAU730#001 - - - Instance - - langString - Programmable automation controller (PAC) System for IoT Applications - - - - - ManufacturerProductFamily - PARAMETER - - - 0173-1#02-AAU731#001 - - - Instance - - string - PAC IoT Controller HX Series - - - - - ClassificationSystem - PARAMETER - - - 0173-1#02-AAO715#002 - - - Instance - - string - eclass - - - - - SecondaryKeyTyp - - - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - Instance - - - - - - - - TypThumbnail - PARAMETER - - - https://www.hsu-hh.de/aut/aas/thumbnail - - - Instance - - image/png - /HX_200432.png - - - - - AssetId - PARAMETER - - - https://www.hsu-hh.de/aut/aas/assetid - - - Instance - - anyURI - https://automation.hitachi-industrial.eu/demo/asset/0000_0000_0000_0000_0000 - - - - - SerialNumber - PARAMETER - - - 0173-1#02-AAM556#002 - - - Instance - - string - 1696-0702 - - - - - BatchNumber - PARAMETER - - - 0173-1#02-AAQ196#001 - - - Instance - - - N/A - - - - - SecondaryKeyInstance - PARAMETER - - - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - Instance - - - - - - - - DateOfManufacture - PARAMETER - - - 0173-1#02-AAR972#002 - - - Instance - - date - N/A - - - - - DeviceRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/devicerevision - - - Instance - - - N/A - - - - - SoftwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/softwarerevision - - - Instance - - - 3.5.13.40 - - - - - HardwareRevision - PARAMETER - - - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - Instance - - - N/A - - - - - ContactInfo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/contactinfo - - - Instance - - - - - NameOfSupplier - PARAMETER - - - 0173-1#02-AAO735#003 - - - Instance - - string - Hitachi Europe GmbH - - - - - ContactInfo_Role - PARAMETER - - - https://www.hsu-hh.de/aut/aas/role - - - Instance - - string - Manufacturer - - - - - PhysicalAddress - PARAMETER - - - https://www.hsu-hh.de/aut/aas/physicaladdress - - - Instance - - - - - CountryCode - PARAMETER - - - 0173-1#02-AAO730#001 - - - Instance - - string - DE - - - - - Street - PARAMETER - - - 0173-1#02-AAO128#001 - - - Instance - - langString - Niederkasseler Lohweg 191 - - - - - Zip - PARAMETER - - - 0173-1#02-AAO129#002 - - - Instance - - string - 40547 - - - - - CityTown - PARAMETER - - - 0173-1#02-AAO132#001 - - - Instance - - string - Düsseldorf - - - - - StateCounty - PARAMETER - - - 0173-1#02-AAO133#002 - - - Instance - - string - North Rhine-Westphalia - - - - false - false - - - - - Email - PARAMETER - - - https://www.hsu-hh.de/aut/aas/email - - - Instance - - string - automation.industrial@hitachi-eu.com - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://automation.hitachi-industrial.eu/ - - - - - PhoneNumber - PARAMETER - - - 0173-1#02-AAO136#002 - - - Instance - - string - +49-211-5283-0 - - - - - Fax - PARAMETER - - - https://www.hsu-hh.de/aut/aas/fax - - - Instance - - string - +49-211-2049-049 - - - - false - false - - - - - CompanyLogo - PARAMETER - - - https://www.hsu-hh.de/aut/aas/companylogo - - - Instance - - image/png - /aasx/assetIdentification/Hitachi_logo.png - - - - - URL - PARAMETER - - - 0173-1#02-AAO694#001 - - - Instance - - anyURI - https://automation.hitachi-industrial.eu/demo/0000_0000_0000_0000_0000 - - - - - - DeviceDescriptionFiles - https://automation.hitachi-industrial.eu/_Resources/Static/Packages/Moon.HitachiEurope/Downloads/automation/[2]%20Software/[5]%20Configuration%20Files/[1]%20Device%20Descriptions/Device%20files.zip - - - https://automation.hitachi-industrial.eu/en/products/software/configuration-files/device-descriptions - - - Instance - - - - - CodeSysDD - - - http://admin-shell.io/sample/conceptdescriptions/437857438753457473 - - - Instance - - application/general - /aasx/Document/Device_files.zip - - - - - - - - ManufacturerName - 0173-1#02-AAO677#002 - - - - - - - - Herstellername - Manufacturer Name - - Manufacturer Name - - - - - Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation - - - - - - - GLNOfManufacturer - 0173-1#02-AAY812#001 - - - - - - - - GLN of manufacturer - GLN des Herstellers - - GLN of manufacturer - - - - - international eindeutige Nummer für den Geräte- oder Produkthersteller sowie für den Standort - internationally unique identification number for the manufacturer of the device or the product and for the physical location - - - - - - - SupplierOfTheIdentifier - 0173-1#02-AAP796#004 - - - - - - - - Supplier of the identifier - Anbieter der Identifikationsnummer für Hersteller - - Supplier of the identifier - - - STRING_TRANSLATABLE - - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - - - - - - - MAN_PROD_NUM - - product article number of manufacturer - - 0173-1#02-AAO676#003 - - - - - - - - product article number of manufacturer - Herstellerartikelnummer - - MAN_PROD_NUM - - - STRING_TRANSLATABLE - - eindeutiger Bestellschlüssel des Herstellers - unique product identifier of the manufacturer - - - - - - - ManufacturerProductDesignation - 0173-1#02-AAW338#001 - - - - - - - - Manufacturer product designation - Herstellerproduktbezeichnung - - ManufacturerTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - ManufacturerProductDescription - 0173-1#02-AAU734#001 - - - - - - - - Manufacturer product description - Herstellerproduktbeschreibung - - Manufacturer product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - NameOfSupplier - 0173-1#02-AAO735#003 - - - - - - - - - - - - name of supplier - Lieferantenname - - name of supplier - - - - - Name des Lieferanten, welcher dem Kunden ein Produkt oder eine Dienstleistung bereitstellt - name of supplier which provides the customer with a product or a service - - - - - - - GLNOfSupplier - 0173-1#02-AAY813#001 - - - - - - - - GLN of supplier - GLN des Lieferanten - - GLN of supplier - - - - - international eindeutige Nummer für den Geräte- oder Produktlieferanten sowie für den Standort - internationally unique identification number for the supplier of the device or the product and for the physical location - - - - - - - SupplierIdProvider - https://www.hsu-hh.de/aut/aas/supplieridprovider - - - - - - - - SupplierIdProvider - Anbieter der Identifikationsnummer - - SupplierIdProvider - - - STRING_TRANSLATABLE - - DUNS-Nr., Lieferantennummer oder andere Nummer zur Identifikation eines Anbieters bzw. Lieferanten der Identifikationsnummer - DUNS-no., supplier number, or other number as identifier of an offeror or supplier of the identification - - - - - - - SUP_PROD_NUM - 0173-1#02-AAO736#004 - - - - - - - - product article number of supplier - Lieferantenartikelnummer - - product article number of supplier - - - - - eindeutiger Bestellschlüssel des Lieferanten - unique product order identifier of the supplier - - - - - - - SupplierProductDesignation - 0173-1#02-AAM551#002 - - - - - - - - Supplier product designation - Lieferantenproduktbezeichnung - - SupplierTypName - - - STRING_TRANSLATABLE - - Kurze Beschreibung des Produktes (Kurztext) - Short description of the product (short text) - - - - - - - SupplierProductDescription - 0173-1#02-AAU730#001 - - - - - - - - Supplier product description - Lieferantenproduktbeschreibung - - Supplier product description - - - - - Beschreibung des Produktes, seiner technischen Eigenschaften und ggf. seiner Anwendung (Langtext) - Description of the product, it's technical features and implementation if needed (long text) - - - - - - - ManufacturerProductFamily - 0173-1#02-AAU731#001 - - - - - - - - Manufacturer product family - Herstellerproduktfamilie - - TypClass - - - - - 2. Ebene einer 3 stufigen herstellerspezifischen Produkthierarchie - 2nd level of a 3 level manufacturer specific product hierarchy - - - - - - - ClassificationSystem - 0173-1#02-AAO715#002 - - - - - - - - classification system - Klassifizierungssystem - - ClassificationSystem - - - - - Klassifizierungssystem - Classification System - - - - - - - SecondaryKeyTyp - https://www.hsu-hh.de/aut/aas/secondarykeytyp - - - - - - - - SecondaryKeyTyp - Typnummer des IT Systems - - SecondaryKeyTyp - - - - - Führende technische ID im IT System des Typs - SecondaryKeyTyp - - - - - - - TypThumbnail - https://www.hsu-hh.de/aut/aas/thumbnail - - - - - - - - TypThumbnail - Vorschaubild - - TypThumbnail - - - - - Darstellung des Produkttyps in kleinem Format - Small picture of the product type - - - - - - - AssetId - https://www.hsu-hh.de/aut/aas/assetid - - - - - - - - AssetId - Asset ID - - AssetId - - - - - Global eindeutige ID eines Asset, die machienenlesbar oder durch Menschen lesbar ist. - Global unique ID of an asset, which can be read by both human and machine. - - - - - - - SerialNumber - 0173-1#02-AAM556#002 - - - - - - - - Serial number - Seriennummer - - InstanceId - - - - - eindeutige Zahlen- und Buchstabenkombination mit der das Gerät nach seiner Herstellung identifiziert ist - unique combination of numbers and letters used to identify the device once it has been manufactured - - - - - - - BatchNumber - 0173-1#02-AAQ196#001 - - - - - - - - Batch number - Chargen-Nummer - - ChargeId - - - - - Eine vom Hersteller eines Stoffes vergebene Nummer zur Identifikation einer Charge - Number assigned by the manufacturer of a material to identify the manufacturer's batch - - - - - - - SecondaryKeyInstance - https://www.hsu-hh.de/aut/aas/secondarykeyinstance - - - - - - - - SecondaryKeyInstance - Instanznummer des IT Systems - - SecondaryKeyInstance - - - - - Führende technische ID im IT System der Instanz - SecondaryKeyInstance - - - - - - - DateOfManufacture - 0173-1#02-AAR972#002 - - - - - - - - Date of manufacture - Herstellungsdatum - - Date of manufacture - - - DATE - - Datum, ab der der Herstellungs- und/oder Entstehungsprozess abgeschlossen ist bzw. ab dem eine Dienstleistung vollständig erbracht ist - Date from which the production and / or development process is completed or from which a service is provided completely - - - - - - - DeviceRevision - https://www.hsu-hh.de/aut/aas/devicerevision - - - - - - - - DeviceRevision - DeviceRevision - - DeviceRevision - - - - - DeviceRevision - DeviceRevision - - - - - - - SoftwareRevision - https://www.hsu-hh.de/aut/aas/softwarerevision - - - - - - - - SoftwareRevision - SoftwareRevision - - SoftwareRevision - - - - - SoftwareRevision - SoftwareRevision - - - - - - - HardwareRevision - https://www.hsu-hh.de/aut/aas/hardwarerevision - - - - - - - - HardwareRevision - HardwareRevision - - HardwareRevision - - - - - HardwareRevision - HardwareRevision - - - - - - - QrCode - https://www.hsu-hh.de/aut/aas/qrcode - - - - - - - - QrCode - QrCode - - QrCode - - - - - In dem QRCode ist die URL, die die Instanz des Assets genau beschreibt, hinterlegt. - QrCode - - - - - - - OrganisationContactInfo - https://www.hsu-hh.de/aut/aas/contactinfo - - - - - - - - Contact Info - Kontakt Info - - OrganisationContactInfo - - - - - Sammlung für die allgemeinen Kontaktdaten - Collection for general contact data - - - - - - - PhysicalAddress - https://www.hsu-hh.de/aut/aas/physicaladdress - - - - - - - - PhysicalAddress - Physische Adresse - - PhysicalAddress - - - - - Sammlung für reale physische Adresse - Collection for real physical address - - - - - - - CountryCode - 0173-1#02-AAO730#001 - - - - - - - - - - - - Landeskennung - Country code - - Country code - - - - - Vereinbartes Merkmal zur eindeutigen Identifizierung eines Landes - agreed upon symbol for unambiguous identification of a country - - - - - - - Street - 0173-1#02-AAO128#001 - - - - - - - - Strasse - Street - - Street - - - - - Name der Strasse und Hausnummer - Street name and house number - - - - - - - Zip - 0173-1#02-AAO129#002 - - - - - - - - Zip - Postleitzahl - - PostalCode - - - - - ZIP code of address - Postleitzahl der Anschrift - - - - - - - CityTown - 0173-1#02-AAO132#001 - - - - - - - - Ort - City/town - - City/town - - - - - Town or city of the company - Ortsangabe - - - - - - - StateCounty - 0173-1#02-AAO133#002 - - - - - - - - state/county - Bundesland - - StateCounty - - - - - Bundesland - state/county - - - - - - - Email - https://www.hsu-hh.de/aut/aas/email - - - - - - - - Emailadresse - Email address - - Email - - - - - Emailadresse - Email address - - - - - - - TelephoneContact - https://www.hsu-hh.de/aut/aas/ContactInfo/TelephoneContact - - - - - - - - Telephone Contact - Telefonkontakt - - TelephoneContact - - - - - Sammlung für Kontaktdaten über Telefon - Collection for contact data via telephone - - - - - - - PhoneNumber - 0173-1#02-AAO136#002 - - - - - - - - Telefonnummer - telephone number - - Phone - - - - - vollständige Telefonnummer unter der ein Geschäftspartner erreichbar ist - complete telephone number to be called to reach a business partner - - - - - - - CompanyLogo - https://www.hsu-hh.de/aut/aas/companylogo - - - - - - - - Firmenlogo - CompanyLogo - - CompanyLogo - - - - - Firmenlogo - CompanyLogo - - - - - - - URL - 0173-1#02-AAO694#001 - - - - - - - - Internetadresse - Internet address - - URL - - - - - stated as link to a home page. The home page is the starting page or table of contents of a web site with offerings. It usually has the name index.htm or index.html - Angabe als Link, um in eine Homepage zu gelangen. die Homepage ist die Start- beziehungsweise die Inhaltsseite eines Web-Angebots. Meistens trägt sie den Namen index.htm oder index.html - - - - - - - ProductCountryOfOrigin - 0173-1#02-AAO841#001 - - - - - - - - Produkt Ursprungsland - Product country of origin - - CountryOfOrigin - - - - - Land in dem das Produkt hergestellt wurde (Hersteller Land) - Country in which the product is manufactured (manufacturer country) - - - - - - - YearOfConstruction - 0173-1#02-AAP906#001 - - - - - - - - Year of construction - Baujahr - - YearOfConstruction - - - - - Jahreszahl als Datumsangabe für die Fertigstellung des Objektes - Year as completion date of object - - - - - - - File - 0173-1#02-AAD005#008 - - - - www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - Enthaltene Doku. Datei - Embedded Doc. file - - File - - - - - Verweis/ BLOB auf enthaltene Dokumentations-Datei. - Reference/ BLOB to embedded documentation file. - - - - - - - ProductMarking - https://www.hsu-hh.de/aut/aas/productmarking - - - - - - - - Produktkennzeichnung - Product Marking - - ProductMarking - - - - - Sammlungsdatei für Produktkennzeichnung - Collection file for product marking - - - - - - - CEQualificationPresent - 0173-1#02-BAF053#008 - - - - - - - - CE-Kennzeichnung vorhanden - CE- qualification present - - CEMarkingPresent - - - BOOLEAN - - whether CE- qualification is present - Angabe, ob CE-Kennzeichnung vorhanden ist - - - - - - - CRUUSLabelingPresent - 0173-1#02-AAR528#005 - - - - - - - - Kennzeichnung (RCM) vorhanden - RCM labeling present - - CRUUSLabelingPresent - - - BOOLEAN - - indication whether the product is equipped with a specified RCM labeling - Angabe, ob das Produkt mit einer spezifizierten RCM-Kennzeichnung ausgestattet ist - - - - - - - DocumentClassification_ClassId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - - - - Dokumentkategorie - Document category - - DocCategory - - - - - Dokumentkategorie nach VDI 2770:2018/10 - Document category after VDI 2770:2018/10 - - - - - - - DocumentId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId - - - - - - - - DocumentId - Dokumenten-Nummer - - DocumentId - - - - - Die Dokument ID stellt eine eindeutige Identifizierung des Dokuments innerhalb einer Domäne sicher. - TBD - - - - - - - VDI2770_DomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/DomainId - - - - - - - - Domain-Nummer - DomainId - - DomainId - - - - - Kennung oder Kennzeichen einer Domäne, in der eine DocumentId eineindeutig ist. - TBD - - - - - - - VDI2770_IdType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentId/IdType - - - - - - - - Nummerntyp - IdType - - IdType - - - - - Besitzt ein Dokument mehrere Identifikationsnummern, muss mithilfe dieser Eigenschaft die führende ID angegeben werden. Der Wert „Primary“ ist für diese ID zu setzen. - TBD - - - - - - - ValString - www.company.com/ids/cd/4490_8182_7091_6124 - - - - - - - - Wert - Value String - - ValString - - - - - Ausdruck für den Wert der übergeordneten Collection. - Value string for the collection value on the next superordinate level - - - - - - - DocumentationItem - 0173-1#02-AAD001#001 - - - - - - - - Dokumentationsgruppe - Documentation item - - DocumentationItem - - - - - Gruppe von Merkmalen, die Zugriff gibt auf eine Dokumentation für ein Asset, beispielhaft struktuiert nach VDI 2770. - Collection of properties, which gives access to documentation of an asset, structured exemplary-wise according to VDI 2770. - - - - - - - DocumentIdDomain - www.company.com/ids/cd/6003_8182_7091_9350 - - - - - - - - DocumentIdDomain - DocumentIdDomain - - DocumentIdDomain - - - - - Angabe einer Liste von Domänen, in de-nen die DocumentIds des Dokuments eindeutig sind - TBD - - - - - - - DocumentDomainId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentIdDomain/DocumentDomainId - - - - - - - - DocumentDomainId - DocumentDomainId - - DocumentDomainId - - - - - Kennung oder Kennzeichen einer Domäne - TBD - - - - - - - VDI2770_Party - www.company.com/ids/cd/3153_8182_7091_4327 - - - - - - - - Party - Party - - Party - - - - - Verweis auf eine Party (siehe VDI 2770 Anhang C1.17), die für diese Domäne verantwortlich ist - TBD - - - - - - - VDI2770_Role - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Role - - - - - - - - Rolle - Role - - Role - - - - - Festlegung einer Rolle für die Organisation gemäß der folgenden Auswahlliste: Author (Autor), Customer (Kunde), Supplier (Zulieferer, Anbieter), Manufacturer (Hersteller), Responsible (Verantwortlicher) - TBD - - - - - - - VDI2770_Organisation - www.company.com/ids/cd/9214_8182_7091_6391 - - - - - - - - Organisation - Organisation - - Organisation - - - - - Angabe einer Organisation - TBD - - - - - - - VDI2770_OrganisationId - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationId - - - - - - - - Organisation ID - Organisation ID - - OrganisationId - - - - - eindeutige ID für die Organisation - TBD - - - - - - - VDI2770_OrganisationName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationName - - - - - - - - OrganisationName - OrganisationName - - OrganisationName - - - - - gebräuchliche Bezeichnung für die Organisation - TBD - - - - - - - VDI2770_OrganisationOfficialName - http://www.vdi.de/2770/AssetDocumentation/Document/Party/Organisation/OrganisationOfficialName - - - - - - - - Offizieller Name der Organisation - Organisation Official Name - - OrganisationOfficialName - - - - - offizieller Name der Organisation - TBD - - - - - - - DocumentPartId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentPartId - - - - - - - - Dokumenten-Teilnummer - DocumentPartId - - DocumentPartId - - - - - Ist das Dokument ein zusammengesetztes Dokument, können mithilfe dieser Eigenschaft eindeutige Dokumententeile IDs eingetragen werden, um das Dokument von den anderen Dokumenten zu unterscheiden. - TBD - - - - - - - VDI2770_Description - http://www.vdi.de/2770/AssetDocumentation/Document/Description - - - - - - - - Beschreibung - Description - - Description - - - - - Beschreibung für die nächste übergeordnete Collection - TBD - - - - - - - VDI2770_ClassName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassName - - - - - - - - Klassenname - Class Name - - ClassName - - - - - Liste von sprachabhängigen Namen zur ClassId. Für die Klassennamen nach VDI 2770 müssen die Werte aus Tabelle 1 in Abschnitt 8.5 angewendet werden. - TBD - - - - - - - DocumentVersion_LanguageCode - http://www.vdi.de/2770/AssetDocumentation/Document/LanguageCode - - - - - - - - Sprachenschlüssel - LanguageCode - - LanguageCode - - - - - Angabe eines Sprachcodes gemäss ISO 639-1 oder -2 - TBD - - - - - - - VDI2770_ClassificationSystem - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassificationSystem - - - - - - - - Klassifizierungssystem - classification system - - ClassificationSystem - - - - - Eindeutige Kennung für ein Klassifikationssystem. Für Klassifikationen nach VDI 2770 muss „VDI2770:2018“ verwenden werden. - TBD - - - - - - - DocumentVersion - www.company.com/ids/cd/2580_0282_7091_6213 - - - - - - - - Dokumenten-Version - DocumentVersion - - DocumentVersion - - - - - Zu jedem Dokument muss eine Menge von mindestens einer Dokumentenversion existieren. Es können auch mehrere Dokumentenversionen ausgeliefert werden. - TBD - - - - - - - DocumentVersionId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersionId - - - - - - - - Dokumenten-Versionsnummer - DocumentVersionId - - DocumentVersionId - - - - - Identifikationsnummer zur Dokumenten-version. Verweist ein Document (siehe Anhang C1.1, Eigenschaft DocumentVersion) auf diese Dokumentenversion, muss die Kombination aus DocumentId und DocumentVersionId eindeutig sein. - TBD - - - - - - - VDI2770_Language - www.company.com/ids/cd/0231_0282_7091_5062 - - - - - - - - Sprache - Language - - Language - - - - - Liste der im Dokument verwendeten Sprachen - TBD - - - - - - - DocumentVersion_Description - www.company.com/ids/cd/9151_0282_7091_8032 - - - - - - - - Beschreibung zur DocumentVersion - DocumentVersion Description - - DocumentVersion_Description - - - - - Zusammenfassende Beschreibungen zur Dokumentenversion in ggf. unterschiedlichen Sprachen. - TBD - - - - - - - VDI2770_Title - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Title - - - - - - - - Titel - Title - - VDI2770_Title - - - - - sprachabhängiger Titel des Dokuments - TBD - - - - - - - VDI2770_Summary - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Summary - - - - - - - - Zusammenfassung - Summary - - Summary - - - - - sprachabhängige, aussagekräftige Zusammenfassung des Dokumenteninhalts - TBD - - - - - - - VDI2770_Keywords - http://www.vdi.de/2770/AssetDocumentation/Document/Description/Keywords - - - - - - - - Schlagwörter - Keywords - - Keywords - - - - - sprachabhängige, durch Komma getrennte Liste von Schlagwörtern - TBD - - - - - - - VDI2770_LifeCycleStatus - www.company.com/ids/cd/0282_0282_7091_7878 - - - - - - - - Lebenszyklus Status - LifeCycleStatus - - LifeCycleStatus - - - - - Liste von Statusdefinitionen mit Bezug zum Dokumentenlebenszyklus inklusive der Angabe der Beteiligten und einem zugehörigen Zeitstempel - TBD - - - - - - - VDI2770_StatusValue - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/StatusValue - - - - - - - - Statuswert - StatusValue - - StatusValue - - - - - Jede Dokumentenversion stellt einen Zeitpunkt im Dokumentenlebenszyklus dar. Dieser Statuswert bezieht sich auf die Meilensteine im Dokumentenlebenszyklus. Für die Anwendung dieser Richtlinie sind die beiden folgenden Status zu verwenden. InReview (in Prüfung), Released (freigegeben) - TBD - - - - - - - VDI2770_SetDate - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/SetDate - - - - - - - - Erstellungsdatum - Set Date - - SetDate - - - - - Datum und Uhrzeit, an dem der Status festgelegt wurde Es muss das Datumsformat „YYYY-MM-dd“ verwendet werden (Y = Jahr, M = Monat, d = Tag, siehe DIN ISO 8601). - TBD - - - - - - - VDI2770_Purpose - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Purpose - - - - - - - - Zweck - Purpose - - Purpose - - - - - Hier kann ein Zweck zum Meilenstein angegeben werden, z. B. „zur Weiterleitung an den Kunden“. - TBD - - - - - - - VDI2770_BasedOnProcedure - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/BasedOnProcedure - - - - - - - - Prozedur - Procedure - - BasedOnProcedure - - - - - textueller Bezug auf ein Verfahren, das der Festlegung dieses Status zugrunde liegt - TBD - - - - - - - VDI2770_Comments - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/LifeCycleStatus/Comments - - - - - - - - Kommentar - Comments - - Comments - - - - - textuelle Bemerkungen und Anmerkungen zum Status - TBD - - - - - - - DocumentRelationship - www.company.com/ids/cd/1204_0282_7091_7896 - - - - - - - - Dokumenten-Beziehung - Document Relationship - - DocumentRelationship - - - - - Liste von Beziehungen zu anderen Dokumenten. Es ist möglich, auf einen Dokument, ein Dokument in einer spezifischen Dokumentenversion oder auch ein Teildokument zu verweisen. - TBD - - - - - - - DocumentRelationship_Type - www.company.com/ids/cd/5044_0282_7091_6924 - - - - - - - - Typ der Dokumenten-Beziehung - DocumentRelationship_Type - - DocumentRelationship_Type - - - - - Typisierung der Beziehung zwischen den beiden DocumentVersions. Folgende Beziehungsarten können verwendet werden: Affecting (hat Auswirkungen auf), ReferesTo (bezieht sich auf), BasedOn (basiert auf) - TBD - - - - - - - StoredDocumentRepresentation - www.company.com/ids/cd/3094_0282_7091_2090 - - - - - - - - StoredDocumentRepresentation - StoredDocumentRepresentation - - StoredDocumentRepresentation - - - - - Liste von digitalen Repräsentationen zur DocumentVersion - TBD - - - - - - - VDI2770_DigitalFile - www.company.com/ids/cd/2305_0282_7091_2077 - - - - - - - - Digitaler-File - DigitalFile - - DigitalFile - - - - - Datei, die die DocumentVersion (siehe VDI 2770:2018 Anhang C1.5) repräsentiert Neben der obligatorischen PDF/A-Datei können weitere Dateien angegeben werden. - TBD - - - - - - - VDI2770_FileId - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileId - - - - - - - - ID der Datei - File ID - - FileId - - - - - eindeutige ID für die Datei - TBD - - - - - - - VDI2770_FileName - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileName - - - - - - - - Dateiname - File name - - FileName - - - - - Name der Datei inkl. einer Dateiendung (sofern vorhanden) Es ist nicht notwendig, einen Pfad für die Datei anzugeben. - TBD - - - - - - - VDI2770_FileFormat - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentVersion/StoredDocumentRepresentation/DigitalFile/FileFormat - - - - - - - - Datei Format - File format - - FileFormat - - - - - Angabe eines Media Typs gemäß der Liste der IANA - TBD - - - - - - - DocumentType - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentType - - - - - - - - Dokumententyp - Document Type - - DocumentType - - - - - Festlegung des Typs des Dokuments im Sinne der DIN EN 82045-1: a) Single (Einzeldokument) b) Aggregate (Sammeldokument) c) DocumentSet (Dokumentensatz) d) CompoundDoc (Mischdokument) - TBD - - - - - - - VDI2770_ReferencedObject - www.company.com/ids/cd/2570_2282_7091_0055 - - - - - - - - ReferencedObject - ReferencedObject - - ReferencedObject - - - - - Liste von IDs für ein Objekt, auf das sich das Dokument bezieht - TBD - - - - - - - VDI2770_ReferencedObject_Type - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ReferencedObjectType - - - - - - - - Typ - Type - - Type - - - - - Für Type des Objekts muss immer Product angegeben werden. - TBD - - - - - - - VDI2770_ReferencedObject_RefType - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/RefType - - - - - - - - RefType - RefType - - RefType - - - - - Angabe einer Typisierung zur Kennung des technischen Objekts. Folgende Werte sind möglich, ProductId (Produktnummer), SerialId (Seriennummer) - TBD - - - - - - - VDI2770_ReferencedObject_ObjectId - http://www.vdi.de/2770/AssetDocumentation/Document/ReferencedObject/ObjectId - - - - - - - - ObjectId - ObjectId - - ObjectId - - - - - Angabe der Identifikationsnummer zum Objekt - TBD - - - - - - - ContactInfo_Role - https://www.hsu-hh.de/aut/aas/role - - - - - - - - Rolle - Role - - Role - - - - - Angabe zur Spezifizierung der Rolle, die die Organisation aus ContactInfo einnimmt - Information to specify the role which the organisation of ContactInfo plays - - - - - - - Fax - https://www.hsu-hh.de/aut/aas/fax - - - - - - - - Fax - Fax - - Fax - - - - - Faxnummer - Fax number - - - - - - - 0173-1#02-AAO136#002 - - - - - DocGroup_01 - www.company.com/ids/cd/1420_0113_7091_0891 - - - - - - - - 01 Identifikation - 01 Identification - - DocGroup_01 - - - - - Der Gruppe „Identifikation“ werden alle Dokumente zugeordnet, die der Identifikation des Objekts dienen, zu dem die Herstellerdokumentation gehört. Sie enthält insbesondere Informationen, die die elektronische Datenverarbeitung unterstützen und die es dem Hersteller und dem Nutzer erlauben, das Objekt in ihren jeweiligen elektronischen Datenverarbeitungssystemen zu identifizieren. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocGroup_02 - www.company.com/ids/cd/4323_0113_7091_2591 - - - - - - - - 02 Technische Beschaffenheit - 02 Technical characteristics - - DocGroup_02 - - - - - Die Gruppe „Technische Beschaffenheit“ beinhaltet alle Dokumente, die die technischen Anforderungen, deren Erfüllung und die Bescheinigung der Eigenschaften eines Objekts betreffen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocGroup_03 - www.company.com/ids/cd/5053_0113_7091_5741 - - - - - - - - 03 Tätigkeitsbezogene Dokumente - 03 Work-related documents - - DocGroup_03 - - - - - Die Gruppe „Tätigkeitsbezogene Dokumente“ beinhaltet alle Dokumente, die Anforderungen, Hinweise und Hilfestellungen für Tätigkeiten an und mit dem Objekt nach der Übergabe an den Nutzer betreffen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocGroup_04 - www.company.com/ids/cd/5473_0113_7091_1588 - - - - - - - - 04 Vertragsunterlagen - 04 Contract documents - - DocGroup_04 - - - - - Der Gruppe „Vertragsunterlagen“ werden alle Dokumente zugeordnet, die im Zusammenhang mit der kaufmännischen Abwicklung eines Vertrages stehen, aber nicht selbst Gegenstand des Vertrags sind und lediglich zur Erfüllung des Vertrags dienen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_01-01 - www.company.com/ids/cd/9593_0113_7091_2401 - - - - - - - - 01-01 Identifikation - 01-01 Identification - - DocCategory_01-01 - - - - - Der Kategorie „Identifikation“ werden alle Dokumente zugeordnet, die der Identifikation des Objekts dienen, zu dem die Herstellerdokumentation gehört. Sie enthält insbesondere Informationen, die die elektronische Datenverarbeitung unterstützen und die es dem Hersteller und dem Nutzer erlauben, das Objekt in ihren jeweiligen elektronischen Datenverarbeitungssystemen zu identifizieren. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_02-01 - www.company.com/ids/cd/5314_0113_7091_8640 - - - - - - - - 02-01 Techn. Spezifikation - 02-01 Technical specification - - DocCategory_02-01 - - - - - Der Kategorie „Technische Spezifikation“ werden alle Dokumente zugeordnet, die die Anforderungen an ein Objekt sowie dessen Eigenschaften beschreiben. Dazu gehören die Auslegungsdaten, Berechnungen (Verfahrenstechnik, Festigkeit usw.) sowie alle relevanten Eigenschaften des übergebenen Objekts. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_02-02 - www.company.com/ids/cd/5515_0113_7091_8581 - - - - - - - - 02-02 Zeichnungen, Pläne - 02-02 Drawings and diagrams - - DocCategory_02-02 - - - - - Der Kategorie „Zeichnungen, Pläne“ werden alle Dokumente zugeordnet, die Zeichnungscharakter haben, das heißt eine grafische Darstellung zur Übermittlung von Information nutzen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_02-03 - www.company.com/ids/cd/0335_0113_7091_0312 - - - - - - - - 02-03 Bauteile - 02-03 Components - - DocCategory_02-03 - - - - - Der Kategorie „Bauteile“ werden alle Dokumente zugeordnet, die eine strukturierte Auflistung der Teile eines Objekts beinhalten. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_02-04 - www.company.com/ids/cd/2155_0113_7091_3955 - - - - - - - - 02-04 Zeugnisse, Zertifikate, Bescheinigungen - 02-04 Reports, Certificates, declarations - - DocCategory_02-04 - - - - - Der Kategorie „Zeugnisse, Zertifikate, Bescheinigungen“ werden alle Dokumente zugeordnet, die Urkundencharakter haben. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-01 - www.company.com/ids/cd/3565_0113_7091_2704 - - - - - - - - 03-01 Montage, Inbetriebnahme, Demontage - 03-01 Assembly, commissioning, disassembly - - DocCategory_03-01 - - - - - Der Kategorie „Montage, Demontage“ werden alle Dokumente zugeordnet, die Tätigkeiten und Maßnahmen beschreiben, die erforderlich sind, um ein Objekt: zu transportieren oder zu lagern, als Ganzes in ein übergeordnetes Objekt einzubauen, auszubauen oder an dieses anzuschließen, so weit vorzubereiten, dass es zur Inbetriebnahme bereitsteht, nach Abschluss der Nutzungsphase zu demontieren und zu entsorgen - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-02 - www.company.com/ids/cd/4290_1113_7091_7266 - - - - - - - - 03-02 Bedienung - 03-02 Operation - - DocCategory_03-02 - - - - - Der Kategorie „Bedienung“ werden Dokumente zur bestimmungsgemäßen Verwendung und sicheren Bedienung eines Objekts zugeordnet. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-03 - www.company.com/ids/cd/2211_1113_7091_3911 - - - - - - - - 03-03 Allgemeine Sicherheit - 03-03 Safety in general - - DocCategory_03-03 - - - - - Der Kategorie „Allgemeine Sicherheit“ werden Dokumente zugeordnet, die Sicherheitshinweise auf mögliche Gefährdungen bei der Verwendung des Objekts geben. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-04 - www.company.com/ids/cd/7521_1113_7091_4471 - - - - - - - - 03-04 Inspektion, Wartung, Prüfung - 03-04 Inspection, maintenance, test - - DocCategory_03-04 - - - - - Der Kategorie „Inspektion, Wartung, Prüfung“ werden alle Dokumente zugeordnet, die vom Hersteller vorgeschlagene wiederkehrende Maßnahmen zur Feststellung oder zum Erhalt des funktionsfähigen Zustands beschreiben. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-05 - www.company.com/ids/cd/5161_1113_7091_0458 - - - - - - - - 03-05 Instandsetzung - 03-05 Repair - - DocCategory_03-05 - - - - - Der Kategorie „Instandsetzung“ werden alle Dokumente zugeordnet, die Maßnahmen zur Wiederherstellung der Funktion eines Objekts betreffen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_03-06 - www.company.com/ids/cd/2181_1113_7091_5948 - - - - - - - - 03-06 Ersatzteile - 03-06 Spare parts - - DocCategory_03-06 - - - - - Der Kategorie „Ersatzteile“ werden Dokumente zugeordnet, die Informationen zu Ersatzteilen und Hilfs- und Betriebsstoffen enthalten. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - DocCategory_04-01 - www.company.com/ids/cd/5391_1113_7091_8996 - - - - - - - - 04-01 Vertragsunterlagen - 04-01 Contract documents - - DocCategory_04-01 - - - - - Der Kategorie „Vertragsunterlagen“ werden alle Dokumente zugeordnet, die im Zusammenhang mit der kaufmännischen Abwicklung eines Vertrages stehen, aber nicht selbst Gegenstand des Vertrags sind und lediglich zur Erfüllung des Vertrags dienen. - TBD - - - - - - - http://www.vdi.de/2770/AssetDocumentation/Document/DocumentClassification/ClassId - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary.Tests/TestValidateXml.cs b/src/AasxCsharpLibrary.Tests/TestValidateXml.cs deleted file mode 100644 index dc4b2f64f..000000000 --- a/src/AasxCsharpLibrary.Tests/TestValidateXml.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; -using Environment = System.Environment; -using InvalidOperationException = System.InvalidOperationException; -using Path = System.IO.Path; - -namespace AdminShellNS.Tests -{ - public class TestOnFiles - { - [Test] - public void TestSuccess() - { - string successDir = Path.Combine( - TestContext.CurrentContext.TestDirectory, - "TestResources\\AasxCsharpLibrary.Tests\\XmlValidation\\expectedOk"); - - if (!System.IO.Directory.Exists(successDir)) - { - throw new InvalidOperationException( - $"The directory containing the valid AAS XML files does not exist or is not a directory: " + - successDir); - } - - var paths = System.IO.Directory.GetFiles(successDir) - .Where(p => System.IO.Path.GetExtension(p) == ".xml") - .ToList(); - - if (paths.Count == 0) - { - throw new InvalidOperationException( - $"No *.xml files were found in the directory expected to contain the valid XML files: " + - successDir); - } - - var validator = AasSchemaValidation.NewXmlValidator(); - - foreach (string path in paths) - { - using var fileStream = System.IO.File.OpenRead(path); - var records = new AasValidationRecordList(); - validator.Validate(records, fileStream); - if (records.Count != 0) - { - var parts = new List - { - $"Failed to validate XML file {path}:" - }; - parts.AddRange(records.Select((r) => r.Message)); - throw new AssertionException(string.Join(Environment.NewLine, parts)); - } - } - } - } -} diff --git a/src/AasxCsharpLibrary/AasxCompatibilityModels/V10/AdminShellV10.cs b/src/AasxCsharpLibrary/AasxCompatibilityModels/V10/AdminShellV10.cs deleted file mode 100644 index 91c73d650..000000000 --- a/src/AasxCsharpLibrary/AasxCompatibilityModels/V10/AdminShellV10.cs +++ /dev/null @@ -1,4649 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.IO.Packaging; -using System.Text.RegularExpressions; -using System.Xml; -using System.Xml.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -// ReSharper disable All .. as this is legacy code! - -#if !DoNotUseAasxCompatibilityModels - -namespace AasxCompatibilityModels -{ - #region Utils - // - // Utils - // - - public class AdminShellUtilV10 - { - public static string EvalToNonNullString(string fmt, object o, string elseString = "") - { - if (o == null) - return elseString; - return string.Format(fmt, o); - } - - public static string EvalToNonEmptyString(string fmt, string o, string elseString = "") - { - if (o == "") - return elseString; - return string.Format(fmt, o); - } - - public static string FilterFriendlyName(string src) - { - if (src == null) - return null; - return Regex.Replace(src, @"[^a-zA-Z0-9\-_]", "_"); - } - - public static bool HasWhitespace(string src) - { - if (src == null) - throw new ArgumentNullException(nameof(src)); - for (var i = 0; i < src.Length; i++) - foreach (var c in src) - if (char.IsWhiteSpace(c)) - return true; - return false; - } - - public static bool ComplyIdShort(string src) - { - if (src == null) - throw new ArgumentNullException(nameof(src)); - var res = true; - foreach (var c in src) - if (!Char.IsLetterOrDigit(c) && c != '_') - res = false; - if (src.Length > 0 && !Char.IsLetter(src[0])) - res = false; - return res; - } - - public static string ShortLocation(Exception ex) - { - if (ex == null || ex.StackTrace == null) - return ""; - string[] lines = ex.StackTrace.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None); - if (lines.Length < 1) - return ""; - // search for " in " - // as the most actual stacktrace might be a built-in function, this might not work and therefore - // go down in the stack - int currLine = 0; - while (true) - { - // nothing found at all - if (currLine >= lines.Length) - return ""; - // access current line - var p = lines[currLine].IndexOf(" in ", StringComparison.Ordinal); - if (p < 0) - { - // advance to next oldest line - currLine++; - continue; - } - // search last "\" or "/", to get only filename portion and position - p = lines[currLine].LastIndexOfAny(new[] { '\\', '/' }); - if (p < 0) - { - // advance to next oldest line - currLine++; - continue; - } - // return this - return lines[currLine].Substring(p); - } - } - - } - - #endregion - - - #region AdminShell_V1_0 - - /// - /// Version of Details of Administration Shell Part 1 V1.0 published Nov/Dec/Jan 2018/19 - /// - public class AdminShellV10 - { - - public class Identification - { - - // members - - [XmlAttribute] - public string idType = ""; - [XmlText] - public string id = ""; - - // constructors - - public Identification() { } - - public Identification(string idType, string id) - { - this.idType = idType; - this.id = id; - } - - public Identification(Identification src) - { - this.idType = src.idType; - this.id = src.id; - } - - // Creator with validation - - public static Identification CreateNew(string idType, string id) - { - if (idType == null || id == null) - return null; - var found = false; - foreach (var x in Key.IdentifierTypeNames) - found = found || idType.ToLower().Trim() == x.ToLower().Trim(); - if (!found) - return null; - return new Identification(idType, id); - } - - // further - - public bool IsEqual(Identification other) - { - return (this.idType.Trim().ToLower() == other.idType.Trim().ToLower() - && this.id.Trim().ToLower() == other.id.Trim().ToLower()); - } - - public override string ToString() - { - return $"[{this.idType}] {this.id}"; - } - } - - public class Administration - { - - // members - - public string version = ""; - public string revision = ""; - - // constructors - - public Administration() { } - - public Administration(Administration src) - { - this.version = src.version; - this.revision = src.revision; - } - - public Administration(string version, string revision) - { - this.version = version; - this.revision = revision; - } - - public override string ToString() - { - return $"R={this.version}, V={this.revision}"; - } - } - - public class Key - { - [XmlAttribute] - public string type = ""; - [XmlAttribute] - public bool local = false; - - [XmlAttribute] - [JsonIgnore] - public string idType = ""; - [XmlIgnore] - [JsonProperty(PropertyName = "idType")] - public string JsonIdType - { - get { return (idType == "idShort") ? "IdShort" : idType; } - set { if (value == "IdShort") idType = "idShort"; else idType = value; } - } - - [XmlText] - public string value = ""; - - [XmlIgnore] - [JsonProperty(PropertyName = "index")] - public int index = 0; - - public Key() - { - } - - public Key(Key src) - { - this.type = src.type; - this.local = src.local; - this.idType = src.idType; - this.value = src.value; - } - - public Key(string type, bool local, string idType, string value) - { - this.type = type; - this.local = local; - this.idType = idType; - this.value = value; - } - - public static Key CreateNew(string type, bool local, string idType, string value) - { - var k = new Key(); - k.type = type; - k.local = local; - k.idType = idType; - k.value = value; - return (k); - } - - public static Key GetFromRef(Reference r) - { - if (r == null || r.Count != 1) - return null; - return r[0]; - } - - public override string ToString() - { - var local = (this.local) ? "Local" : "not Local"; - return $"[{this.type}, {local}, {this.idType}, {this.value}]"; - } - - public static string KeyListToString(List keys) - { - if (keys == null || keys.Count < 1) - return ""; - // normally, exactly one key - if (keys.Count == 1) - return keys[0].ToString(); - // multiple! - var s = "[ "; - foreach (var k in keys) - { - if (s.Length > 0) - s += ", "; - s += k.ToString(); - } - return s + " ]"; - } - - public static string[] KeyElements = new string[] { - "GlobalReference", - "AccessPermissionRule", - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel", - "SubmodelRef", // not completely right, but used by Package Explorer - "Blob", - "ConceptDictionary", - "DataElement", - "File", - "Event", - "Operation", - "OperationVariable", - "Property", - "ReferenceElement", - "RelationshipElement", - "SubmodelElement", - "SubmodelElementCollection", - "View" }; - - public static string[] ReferableElements = new string[] { - "AccessPermissionRule", - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel", - "Blob", - "ConceptDictionary", - "DataElement", - "File", - "Event", - "Operation", - "OperationVariable", - "Property", - "ReferenceElement", - "RelationshipElement", - "SubmodelElement", - "SubmodelElementCollection", - "View" - }; - - public static string[] SubmodelElements = new string[] { - "DataElement", - "File", - "Event", - "Operation", - "Property", - "ReferenceElement", - "RelationshipElement", - "SubmodelElementCollection"}; - - public static string[] IdentifiableElements = new string[] { - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel" }; - - // use this in list to designate all of the above elements - public static string AllElements = "All"; - - // use this in list to designate the GlobalReference - public static string GlobalReference = "GlobalReference"; - public static string ConceptDescription = "ConceptDescription"; - public static string SubmodelRef = "SubmodelRef"; - public static string Submodel = "Submodel"; - public static string Asset = "Asset"; - public static string AAS = "AssetAdministrationShell"; - - public static string[] IdentifierTypeNames = new string[] { "IdShort", "Custom", "IRDI", "URI" }; - - public enum IdentifierType { IdShort = 0, Custom, IRDI, URI }; - - public static string GetIdentifierTypeName(IdentifierType t) - { - return IdentifierTypeNames[(int)t]; - } - - // some helpers - - public static bool IsInKeyElements(string ke) - { - var res = false; - foreach (var s in KeyElements) - if (s.Trim().ToLower() == ke.Trim().ToLower()) - res = true; - return res; - } - - } - - // the whole class shall not be serialized by having it private - public class KeyList - { - // members - - [XmlIgnore] // anyway, as it is privat - private List key = new List(); - - // getters / setters - - [XmlIgnore] - public List Keys { get { return key; } } - [XmlIgnore] - public bool IsEmpty { get { return key == null || key.Count < 1; } } - [XmlIgnore] - public int Count { get { if (key == null) return 0; return key.Count; } } - [XmlIgnore] - public Key this[int index] { get { return key[index]; } } - - // constructors / creators - - public void Add(Key k) - { - key.Add(k); - } - - public static KeyList CreateNew(Key k) - { - var kl = new KeyList(); - kl.Add(k); - return kl; - } - - public static KeyList CreateNew(string type, bool local, string idType, string value) - { - var kl = new KeyList(); - kl.Add(Key.CreateNew(type, local, idType, value)); - return kl; - } - - // other - - public void NumberIndices() - { - if (this.Keys == null) - return; - for (int i = 0; i < this.Keys.Count; i++) - this.Keys[i].index = i; - } - } - - [XmlType(TypeName = "reference")] - public class Reference - { - - // members - - [XmlIgnore] // anyway, as it is privat - [JsonIgnore] - private KeyList keys = new KeyList(); - - // getters / setters - - [XmlArray("keys")] - [XmlArrayItem("key")] - [JsonIgnore] - public List Keys { get { return keys?.Keys; } } - [XmlIgnore] - [JsonProperty(PropertyName = "keys")] - public List JsonKeys - { - get - { - keys?.NumberIndices(); - return keys.Keys; - } - } - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return keys == null || keys.Count < 1; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (keys == null) return 0; return keys.Count; } } - [XmlIgnore] - [JsonIgnore] - public Key this[int index] { get { return keys[index]; } } - - // constructors / creators - - public Reference() - { - } - - public Reference(Key k) - { - if (k != null) - keys.Keys.Add(k); - } - - public Reference(Reference src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(new Key(k)); - } - - public Reference(SemanticId src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(new Key(k)); - } - - public static Reference CreateNew(Key k) - { - if (k == null) - return null; - var r = new Reference(); - r.keys.Keys.Add(k); - return r; - } - - public static Reference CreateNew(List k) - { - if (k == null) - return null; - var r = new Reference(); - r.keys.Keys.AddRange(k); - return r; - } - - public static Reference CreateNew(string type, bool local, string idType, string value) - { - if (type == null || idType == null || value == null) - return null; - var r = new Reference(); - r.keys.Keys.Add(Key.CreateNew(type, local, idType, value)); - return r; - } - - public static Reference CreateIrdiReference(string irdi) - { - if (irdi == null) - return null; - var r = new Reference(); - r.keys.Keys.Add(new Key(Key.GlobalReference, false, "IRDI", irdi)); - return r; - } - - // further - - public bool IsExactlyOneKey(string type, bool local, string idType, string id) - { - if (keys == null || keys.Keys == null || keys.Count != 1) - return false; - var k = keys.Keys[0]; - return k.type == type && k.local == local && k.idType == idType && k.value == id; - } - - public bool MatchesTo(Identification other) - { - return (this.keys != null && this.keys.Count == 1 - && this.keys[0].idType.Trim().ToLower() == other.idType.Trim().ToLower() - && this.keys[0].value.Trim().ToLower() == other.id.Trim().ToLower()); - } - - public bool MatchesTo(Reference other) - { - if (this.keys == null || other == null || other.keys == null || other.Count != this.Count) - return false; - - var same = true; - for (int i = 0; i < this.Count; i++) - same = same - && this.keys[i].type.Trim().ToLower() == other.keys[i].type.Trim().ToLower() - && this.keys[i].local == other.keys[i].local - && this.keys[i].idType.Trim().ToLower() == other.keys[i].idType.Trim().ToLower() - && this.keys[i].value.Trim().ToLower() == other.keys[i].value.Trim().ToLower(); - - return same; - } - - public override string ToString() - { - var res = ""; - if (keys != null && keys.Keys != null) - foreach (var k in keys.Keys) - res += k.ToString() + ","; - return res.TrimEnd(','); - } - - public string ListOfValues(string delim) - { - string res = ""; - if (this.Keys != null) - foreach (var x in this.Keys) - { - if (x == null) - continue; - if (res != "") res += delim; - res += x.value; - } - return res; - } - - public virtual string GetElementName() - { - return "Reference"; - } - } - - [XmlType(TypeName = "derivedFrom")] - public class AssetAdministrationShellRef : Reference - { - // constructors - - public AssetAdministrationShellRef() : base() { } - - public AssetAdministrationShellRef(Key k) : base(k) { } - - public AssetAdministrationShellRef(Reference src) : base(src) { } - - // further methods - - public override string GetElementName() - { - return "AssetAdministrationShellRef"; - } - } - - [XmlType(TypeName = "assetRef")] - public class AssetRef : Reference - { - // constructors - - public AssetRef() : base() { } - - public AssetRef(AssetRef src) : base(src) { } - - // translation - - public static AssetRef CreateNew(Reference r) - { - return (AssetRef)new Reference(r); - } - - // further methods - - public override string GetElementName() - { - return "AssetRef"; - } - } - - [XmlType(TypeName = "submodelRef")] - public class SubmodelRef : Reference - { - // constructors - - public SubmodelRef() : base() { } - - public SubmodelRef(SubmodelRef src) : base(src) { } - - public static new SubmodelRef CreateNew(string type, bool local, string idType, string value) - { - var r = new SubmodelRef(); - r.Keys.Add(Key.CreateNew(type, local, idType, value)); - return r; - } - - public static SubmodelRef CreateNew(Reference src) - { - if (src == null || src.Keys == null) - return null; - var r = new SubmodelRef(); - r.Keys.AddRange(src.Keys); - return r; - } - - // further methods - - public override string GetElementName() - { - return "SubmodelRef"; - } - } - - [XmlType(TypeName = "conceptDescriptionRef")] - public class ConceptDescriptionRef : Reference - { - // constructors - - public ConceptDescriptionRef() : base() { } - - public ConceptDescriptionRef(ConceptDescriptionRef src) : base(src) { } - - // further methods - - public new static ConceptDescriptionRef CreateNew(string type, bool local, string idType, string value) - { - var r = new ConceptDescriptionRef(); - r.Keys.Add(Key.CreateNew(type, local, idType, value)); - return r; - } - - public override string GetElementName() - { - return "ConceptDescriptionRef"; - } - } - - [XmlType(TypeName = "dataSpecificationRef")] - public class DataSpecificationRef : Reference - { - // constructors - - public DataSpecificationRef() : base() { } - - public DataSpecificationRef(DataSpecificationRef src) : base(src) { } - - // further methods - - public static DataSpecificationRef CreateNew(Reference src) - { - if (src == null || src.Keys == null) - return null; - var res = new DataSpecificationRef(); - foreach (var k in src.Keys) - res.Keys.Add(new Key(k)); - return res; - } - - public override string GetElementName() - { - return "DataSpecificationRef"; - } - } - - [XmlType(TypeName = "conceptDescriptions")] - public class ConceptDescriptionRefs - { - [XmlElement(ElementName = "conceptDescriptionRef")] - public List conceptDescriptions = new List(); - - // constructors - - public ConceptDescriptionRefs() { } - - public ConceptDescriptionRefs(ConceptDescriptionRefs src) - { - if (src.conceptDescriptions != null) - foreach (var cdr in src.conceptDescriptions) - this.conceptDescriptions.Add(new ConceptDescriptionRef(cdr)); - } - } - - [XmlType(TypeName = "containedElementRef")] - public class ContainedElementRef : Reference - { - // constructors - - public ContainedElementRef() { } - public ContainedElementRef(ContainedElementRef src) : base(src) { } - - public static ContainedElementRef CreateNew(Reference src) - { - if (src == null || src.Keys == null) - return null; - var r = new ContainedElementRef(); - r.Keys.AddRange(src.Keys); - return r; - } - - // further methods - - public override string GetElementName() - { - return "ContainedElementRef"; - } - } - - [XmlType(TypeName = "hasDataSpecification")] - public class HasDataSpecification - { - [XmlElement(ElementName = "reference")] // make "reference" go away by magic?! - public List reference = new List(); - - public HasDataSpecification() { } - - public HasDataSpecification(HasDataSpecification src) - { - foreach (var r in src.reference) - reference.Add(new Reference(r)); - } - } - - [XmlType(TypeName = "ContainedElements")] - public class ContainedElements - { - - // members - - [XmlElement(ElementName = "containedElementRef")] // make "reference" go away by magic?! - public List reference = new List(); - - // getter / setter - - public bool IsEmpty { get { return reference == null || reference.Count < 1; } } - public int Count { get { if (reference == null) return 0; return reference.Count; } } - public ContainedElementRef this[int index] { get { return reference[index]; } } - - // Creators - - public ContainedElements() { } - - public ContainedElements(ContainedElements src) - { - if (src.reference != null) - foreach (var r in src.reference) - this.reference.Add(new ContainedElementRef(r)); - } - - public static ContainedElements CreateOrSetInner(ContainedElements outer, ContainedElementRef[] inner) - { - var res = outer; - if (res == null) - res = new ContainedElements(); - if (inner == null) - { - res.reference = null; - return res; - } - res.reference = new List(inner); - return res; - } - - } - - [XmlType(TypeName = "langString", Namespace = "http://www.admin-shell.io/1/0")] - public class LangStr - { - - // members - - [XmlAttribute(Namespace = "http://www.admin-shell.io/1/0")] - [JsonProperty(PropertyName = "language")] - public string lang = ""; - [XmlText] - [JsonProperty(PropertyName = "text")] - public string str = ""; - - // constructors - - public LangStr() { } - - public LangStr(LangStr src) - { - this.lang = src.lang; - this.str = src.str; - } - - public static LangStr CreateNew(string lang, string str) - { - var l = new LangStr(); - l.lang = lang; - l.str = str; - return (l); - } - - public static List CreateManyFromStringArray(string[] s) - { - var r = new List(); - var i = 0; - while ((i + 1) < s.Length) - { - r.Add(LangStr.CreateNew(s[i], s[i + 1])); - i += 2; - } - return r; - } - } - - public class Description - { - - // members - - [XmlElement(ElementName = "langString")] - public List langString = new List(); - - // constructors - - public Description() { } - - public Description(Description src) - { - if (src != null) - foreach (var ls in src.langString) - langString.Add(new LangStr(ls)); - } - } - - public class Kind - { - [XmlText] - public string kind = "Instance"; - - // getters / setters - - [XmlIgnore] - [JsonIgnore] - public bool IsInstance { get { return kind == null || kind.Trim().ToLower() == "instance"; } } - - [XmlIgnore] - [JsonIgnore] - public bool IsType { get { return kind != null && kind.Trim().ToLower() == "type"; } } - - // constructors / creators - - public Kind() { } - - public Kind(Kind src) - { - kind = src.kind; - } - - public Kind(string kind) - { - this.kind = kind; - } - - public static Kind CreateFrom(Kind k) - { - var res = new Kind(); - res.kind = k.kind; - return res; - } - - public static Kind CreateAsType() - { - var res = new Kind(); - res.kind = "Type"; - return res; - } - - public static Kind CreateAsInstance() - { - var res = new Kind(); - res.kind = "Instance"; - return res; - } - } - - public class SemanticId - { - - // members - - [XmlIgnore] - [JsonIgnore] - private KeyList keys = new KeyList(); - - // getters / setters - - [XmlArray("keys")] - [XmlArrayItem("key")] - [JsonIgnore] - public List Keys { get { return keys?.Keys; } } - [XmlIgnore] - [JsonProperty(PropertyName = "keys")] - public List JsonKeys - { - get - { - keys?.NumberIndices(); - return keys.Keys; - } - } - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return keys == null || keys.IsEmpty; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (keys == null) return 0; return keys.Count; } } - [XmlIgnore] - [JsonIgnore] - public Key this[int index] { get { return keys[index]; } } - - public override string ToString() - { - return Key.KeyListToString(keys.Keys); - } - - // constructors / creators - - public SemanticId() - { - } - - public SemanticId(SemanticId src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(k); - } - - public static SemanticId CreateFromKey(Key key) - { - if (key == null) - return null; - var res = new SemanticId(); - res.Keys.Add(key); - return res; - } - - public static SemanticId CreateFromKeys(List keys) - { - if (keys == null) - return null; - var res = new SemanticId(); - res.Keys.AddRange(keys); - return res; - } - - // matching - - public bool Matches(string type, bool local, string idType, string value) - { - if (this.Count == 1 - && this.keys[0].type.ToLower().Trim() == type.ToLower().Trim() - && this.keys[0].local == local - && this.keys[0].idType.ToLower().Trim() == idType.ToLower().Trim() - && this.keys[0].value.ToLower().Trim() == value.ToLower().Trim()) - return true; - return false; - } - } - - public class Referable - { - - // members - - public string idShort = null; - public string category = null; - - [XmlElement(ElementName = "description")] - [JsonIgnore] - public Description description = null; - [XmlIgnore] - [JsonProperty(PropertyName = "descriptions")] - public List JsonDescription - { - get - { - if (description == null) - return null; - return description.langString; - } - set - { - if (description == null) - description = new Description(); - description.langString = value; - } - } - - [XmlIgnore] - [JsonIgnore] - public Referable parent = null; - - public static string[] ReferableCategoryNames = new string[] { "CONSTANT", "PARAMETER", "VARIABLE" }; - - // constructors - - public Referable() { } - - public Referable(Referable src) - { - this.idShort = src.idShort; - this.category = src.category; - if (src.description != null) - this.description = new Description(src.description); - } - - public void AddDescription(string lang, string str) - { - if (description == null) - description = new Description(); - description.langString.Add(LangStr.CreateNew(lang, str)); - } - - public virtual string GetElementName() - { - return "GlobalReference"; // not correct, but this method wasn't overridden correctly - } - - public string GetFriendlyName() - { - return AdminShellUtilV10.FilterFriendlyName(this.idShort); - } - - public void CollectReferencesByParent(List refs) - { - // check, if this is identifiable - if (this is Identifiable) - { - var idf = this as Identifiable; - var k = Key.CreateNew( - idf.GetElementName(), true, idf.identification.idType, idf.identification.id); - refs.Insert(0, k); - } - else - { - var k = Key.CreateNew(this.GetElementName(), true, "idShort", this.idShort); - refs.Insert(0, k); - // recurse upwards! - if (parent != null && parent is Referable) - (this.parent).CollectReferencesByParent(refs); - } - } - - public string CollectIdShortByParent() - { - // recurse first - var head = ""; - if (!(this is Identifiable) && this.parent != null && this.parent is Referable) - // can go up - head = this.parent.CollectIdShortByParent() + "/"; - // add own - var myid = ""; - if (this.idShort != null && this.idShort.Trim() != "") - myid = this.idShort.Trim(); - // together - return head + myid; - } - } - - public class Identifiable : Referable - { - - // members - - public Identification identification = new Identification(); - public Administration administration = null; - - // constructors - - public Identifiable() : base() { } - - public Identifiable(Identifiable src) - : base(src) - { - if (src.identification != null) - this.identification = new Identification(src.identification); - if (src.administration != null) - this.administration = new Administration(src.administration); - } - - public void SetIdentification(string idType, string id, string idShort = null) - { - identification.idType = idType; - identification.id = id; - if (idShort != null) - this.idShort = idShort; - } - - public void SetAdminstration(string version, string revision) - { - if (administration == null) - administration = new Administration(); - administration.version = version; - administration.revision = revision; - } - - public new string GetFriendlyName() - { - if (identification != null && identification.id != "") - return AdminShellUtilV10.FilterFriendlyName(this.identification.id); - return AdminShellUtilV10.FilterFriendlyName(this.idShort); - } - - } - - public class JsonModelTypeWrapper - { - public string name = ""; - - public JsonModelTypeWrapper(string name = "") { this.name = name; } - } - - public class AdministrationShell : Identifiable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // from hasDataSpecification: - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // from this very class - public AssetAdministrationShellRef derivedFrom = null; - - [JsonProperty(PropertyName = "asset")] - public AssetRef assetRef = new AssetRef(); - - [JsonProperty(PropertyName = "submodels")] - public List submodelRefs = new List(); - - [JsonIgnore] - public Views views = null; - [XmlIgnore] - [JsonProperty(PropertyName = "views")] - public View[] JsonViews - { - get { return views?.views.ToArray(); } - set { views = Views.CreateOrSetInnerViews(views, value); } - } - - [JsonProperty(PropertyName = "conceptDictionaries")] - public List conceptDictionaries = null; - - // constructurs - - public AdministrationShell() { } - - public AdministrationShell(AdministrationShell src) - : base(src) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - - if (src.derivedFrom != null) - this.derivedFrom = new AssetAdministrationShellRef(src.derivedFrom); - - if (src.assetRef != null) - this.assetRef = new AssetRef(src.assetRef); - - if (src.submodelRefs != null) - foreach (var smr in src.submodelRefs) - this.submodelRefs.Add(new SubmodelRef(smr)); - - if (src.views != null) - this.views = new Views(src.views); - - if (src.conceptDictionaries != null) - { - this.conceptDictionaries = new List(); - foreach (var cdd in src.conceptDictionaries) - this.conceptDictionaries.Add(new ConceptDictionary(cdd)); - } - } - - public static AdministrationShell CreateNew( - string idType, string id, string version = null, string revision = null) - { - var s = new AdministrationShell(); - s.identification.idType = idType; - s.identification.id = id; - if (version != null) - s.SetAdminstration(version, revision); - return (s); - } - - // add - - public void AddView(View v) - { - if (views == null) - views = new Views(); - views.views.Add(v); - } - - public void AddConceptDictionary(ConceptDictionary d) - { - if (conceptDictionaries == null) - conceptDictionaries = new List(); - conceptDictionaries.Add(d); - } - - public void AddDataSpecification(Key k) - { - if (hasDataSpecification == null) - hasDataSpecification = new HasDataSpecification(); - var r = new Reference(); - r.Keys.Add(k); - hasDataSpecification.reference.Add(r); - } - - public override string GetElementName() - { - return "AssetAdministrationShell"; - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV10.EvalToNonNullString("\"{0}\" ", idShort, "\"AAS\""); - if (administration != null) - caption += "V" + administration.version + "." + administration.revision; - - var info = ""; - if (identification != null) - info = $"[{identification.idType}, {identification.id}]"; - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - public SubmodelRef FindSubmodelRef(Identification refid) - { - if (this.submodelRefs == null) - return null; - foreach (var r in this.submodelRefs) - if (r.MatchesTo(refid)) - return r; - return null; - } - - public bool HasSubmodelRef(SubmodelRef newref) - { - // check, if existing - if (this.submodelRefs == null) - return false; - var found = false; - foreach (var r in this.submodelRefs) - if (r.MatchesTo(newref)) - found = true; - - return found; - } - - public void AddSubmodelRef(SubmodelRef newref) - { - if (this.submodelRefs == null) - this.submodelRefs = new List(); - this.submodelRefs.Add(newref); - } - } - - public class Asset : Identifiable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // from hasDataSpecification: - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - // from HasKind - [XmlElement(ElementName = "kind")] - [JsonIgnore] - public Kind kind = new Kind(); - [XmlIgnore] - [JsonProperty(PropertyName = "kind")] - public string JsonKind - { - get - { - if (kind == null) - return null; - return kind.kind; - } - set - { - if (kind == null) - kind = new Kind(); - kind.kind = value; - } - } - // from this very class - [XmlElement(ElementName = "assetIdentificationModelRef")] - public SubmodelRef assetIdentificationModelRef = null; - - // constructors - - public Asset() { } - - public Asset(Asset src) - : base(src) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.kind != null) - this.kind = new Kind(src.kind); - if (src.assetIdentificationModelRef != null) - this.assetIdentificationModelRef = new SubmodelRef(src.assetIdentificationModelRef); - } - - // Getter & setters - - public AssetRef GetReference() - { - var r = new AssetRef(); - r.Keys.Add( - Key.CreateNew(this.GetElementName(), true, this.identification.idType, this.identification.id)); - return r; - } - - public override string GetElementName() - { - return "Asset"; - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV10.EvalToNonNullString("\"{0}\" ", idShort, ""); - if (administration != null) - caption += "V" + administration.version + "." + administration.revision; - - var info = ""; - if (identification != null) - info = $"[{identification.idType}, {identification.id}]"; - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - } - - public class View : Referable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // from hasSemanticId: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = null; - // from hasDataSpecification - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // from this very class - [JsonIgnore] - public ContainedElements containedElements = null; - [XmlIgnore] - [JsonProperty(PropertyName = "containedElements")] - public ContainedElementRef[] JsonContainedElements - { - get { return containedElements?.reference.ToArray(); } - set { containedElements = ContainedElements.CreateOrSetInner(containedElements, value); } - } - - // getter / setter - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return containedElements == null || containedElements.Count < 1; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (containedElements == null) return 0; return containedElements.Count; } } - - public ContainedElementRef this[int index] - { - get - { - if ( -containedElements == null) return null; return containedElements[index]; - } - } - - // constructors / creators - - public View() { } - - public View(View src) - : base(src) - { - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.containedElements != null) - this.containedElements = new ContainedElements(src.containedElements); - } - - public static View CreateNew(string idShort) - { - var v = new View(); - v.idShort = idShort; - return (v); - } - - public void AddDataSpecification(Key k) - { - if (hasDataSpecification == null) - hasDataSpecification = new HasDataSpecification(); - var r = new Reference(); - r.Keys.Add(k); - hasDataSpecification.reference.Add(r); - } - - public void AddContainedElement(Key k) - { - if (containedElements == null) - containedElements = new ContainedElements(); - var r = new ContainedElementRef(); - r.Keys.Add(k); - containedElements.reference.Add(r); - } - - public void AddContainedElement(List keys) - { - if (containedElements == null) - containedElements = new ContainedElements(); - var r = new ContainedElementRef(); - foreach (var k in keys) - r.Keys.Add(k); - containedElements.reference.Add(r); - } - - public void AddContainedElement(Reference r) - { - if (containedElements == null) - containedElements = new ContainedElements(); - containedElements.reference.Add(ContainedElementRef.CreateNew(r)); - } - - public void AddContainedElement(List rlist) - { - if (containedElements == null) - containedElements = new ContainedElements(); - foreach (var r in rlist) - containedElements.reference.Add(ContainedElementRef.CreateNew(r)); - } - - public override string GetElementName() - { - return "View"; - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV10.EvalToNonNullString("\"{0}\" ", idShort, ""); - var info = ""; - if (this.semanticId != null) - info = Key.KeyListToString(this.semanticId.Keys); - if (this.containedElements != null && this.containedElements.reference != null) - info = - (info + " ").Trim() + String.Format("({0} elements)", this.containedElements.reference.Count); - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - } - - public class Views - { - [XmlElement(ElementName = "view")] - [JsonIgnore] - public List views = new List(); - - // constructors - - public Views() { } - - public Views(Views src) - { - if (src != null && src.views != null) - foreach (var v in src.views) - this.views.Add(new View(v)); - } - - public static Views CreateOrSetInnerViews(Views outer, View[] inner) - { - var res = outer; - if (res == null) - res = new Views(); - if (inner == null) - { - res.views = null; - return res; - } - res.views = new List(inner); - return res; - } - } - - public class LangStringIEC61360 - { - - // members - - [XmlElement(ElementName = "langString", Namespace = "http://www.admin-shell.io/aas/1/0")] - public List langString = new List(); - - // getters / setters - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return langString == null || langString.Count < 1; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (langString == null) return 0; return langString.Count; } } - [XmlIgnore] - [JsonIgnore] - public LangStr this[int index] { get { return langString[index]; } } - - // constructors - - public LangStringIEC61360() { } - - public LangStringIEC61360(LangStringIEC61360 src) - { - if (src.langString != null) - foreach (var ls in src.langString) - this.langString.Add(new LangStr(ls)); - } - - // converter - - public static LangStringIEC61360 CreateFrom(List src) - { - var res = new LangStringIEC61360(); - if (src != null) - foreach (var ls in src) - res.langString.Add(new LangStr(ls)); - return res; - } - - } - - public class UnitId - { - - // members - - [XmlIgnore] - [JsonIgnore] - public KeyList keys = new KeyList(); - - // getter / setters - - [XmlArray("keys")] - [XmlArrayItem("key")] - [JsonIgnore] - public List Keys { get { return keys?.Keys; } } - [XmlIgnore] - [JsonProperty(PropertyName = "keys")] - public List JsonKeys - { - get - { - keys?.NumberIndices(); - return keys.Keys; - } - } - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return keys == null || keys.IsEmpty; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (keys == null) return 0; return keys.Count; } } - [XmlIgnore] - [JsonIgnore] - public Key this[int index] { get { return keys.Keys[index]; } } - - // constructors / creators - - public UnitId() { } - - public UnitId(UnitId src) - { - if (src.keys != null) - foreach (var k in src.Keys) - this.keys.Add(new Key(k)); - } - - public static UnitId CreateNew(string type, bool local, string idType, string value) - { - var u = new UnitId(); - u.keys.Keys.Add(Key.CreateNew(type, local, idType, value)); - return u; - } - - public static UnitId CreateNew(Reference src) - { - var res = new UnitId(); - if (src != null && src.Keys != null) - foreach (var k in src.Keys) - res.keys.Add(k); - return res; - } - } - - [XmlRoot(Namespace = "http://www.admin-shell.io/IEC61360/1/0")] - public class DataSpecificationIEC61360 - { - // static member - [XmlIgnore] - [JsonIgnore] - public static string[] DataTypeNames = { - "STRING", - "STRING_TRANSLATABLE", - "REAL_MEASURE", - "REAL_COUNT", - "REAL_CURRENCY", - "INTEGER_MEASURE", - "INTEGER_COUNT", - "INTEGER_CURRENCY", - "BOOLEAN", - "URL", - "RATIONAL", - "RATIONAL_MEASURE", - "TIME", - "TIMESTAMP", - "DATE" }; - - // members - public LangStringIEC61360 preferredName = new LangStringIEC61360(); - public string shortName = ""; - public string unit = ""; - public UnitId unitId = null; - public string valueFormat = null; - public List sourceOfDefinition = new List(); - public string symbol = null; - public string dataType = ""; - public LangStringIEC61360 definition = new LangStringIEC61360(); - - // getter / setters - - // constructors - - public DataSpecificationIEC61360() { } - - public DataSpecificationIEC61360(DataSpecificationIEC61360 src) - { - if (src.preferredName != null) - this.preferredName = new LangStringIEC61360(src.preferredName); - this.shortName = src.shortName; - this.unit = src.unit; - if (src.unitId != null) - this.unitId = new UnitId(src.unitId); - this.valueFormat = src.valueFormat; - if (src.sourceOfDefinition != null) - foreach (var sod in src.sourceOfDefinition) - this.sourceOfDefinition.Add(sod); - this.symbol = src.symbol; - this.dataType = src.dataType; - if (src.definition != null) - this.definition = new LangStringIEC61360(src.definition); - } - - public static DataSpecificationIEC61360 CreateNew( - string[] preferredName = null, - string shortName = "", - string unit = "", - UnitId unitId = null, - string valueFormat = null, - string[] sourceOfDefinition = null, - string symbol = null, - string dataType = "", - string[] definition = null - ) - { - var d = new DataSpecificationIEC61360(); - if (preferredName != null) - d.preferredName.langString = LangStr.CreateManyFromStringArray(preferredName); - d.shortName = shortName; - d.unit = unit; - d.unitId = unitId; - d.valueFormat = valueFormat; - if (sourceOfDefinition != null) - d.sourceOfDefinition = LangStr.CreateManyFromStringArray(sourceOfDefinition); - d.symbol = symbol; - d.dataType = dataType; - if (definition != null) - d.definition.langString = LangStr.CreateManyFromStringArray(definition); - return (d); - } - } - - public class DataSpecificationISO99999 - { - } - - public class DataSpecificationContent - { - - // members - - public DataSpecificationIEC61360 dataSpecificationIEC61360 = new DataSpecificationIEC61360(); - public DataSpecificationISO99999 dataSpecificationISO99999 = null; - - // constructors - - public DataSpecificationContent() { } - - public DataSpecificationContent(DataSpecificationContent src) - { - if (src.dataSpecificationIEC61360 != null) - this.dataSpecificationIEC61360 = new DataSpecificationIEC61360(src.dataSpecificationIEC61360); - } - } - - public class EmbeddedDataSpecification - { - // members - - public DataSpecificationRef hasDataSpecification = new DataSpecificationRef(); - public DataSpecificationContent dataSpecificationContent = new DataSpecificationContent(); - - // constructors - - public EmbeddedDataSpecification() { } - - public EmbeddedDataSpecification(EmbeddedDataSpecification src) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new DataSpecificationRef(src.hasDataSpecification); - if (src.dataSpecificationContent != null) - this.dataSpecificationContent = new DataSpecificationContent(src.dataSpecificationContent); - } - } - - public class ConceptDescription : Identifiable, System.IDisposable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // do this in order to be IDisposable, that is: suitable for (using) - void System.IDisposable.Dispose() { } - public void GetData() { } - // from HasDataSpecification - // TODO (Michael Hoffmeister, 1970-01-01): in V1.0, shall be a list of embeddedDataSpecification - [XmlElement(ElementName = "embeddedDataSpecification")] - [JsonIgnore] - public EmbeddedDataSpecification embeddedDataSpecification = new EmbeddedDataSpecification(); - [XmlIgnore] - [JsonProperty(PropertyName = "embeddedDataSpecifications")] - public EmbeddedDataSpecification[] JsonEmbeddedDataSpecifications - { - get - { - if (embeddedDataSpecification == null) - return null; - return new EmbeddedDataSpecification[] { embeddedDataSpecification }; - } - set - { - if (value == null) - embeddedDataSpecification = null; - else - embeddedDataSpecification = value[0]; - } - } - - // this class - [XmlIgnore] - private List isCaseOf = null; - - // getter / setter - - [XmlElement(ElementName = "isCaseOf")] - [JsonProperty(PropertyName = "isCaseOf")] - public List IsCaseOf - { - get { return isCaseOf; } - set { isCaseOf = value; } - } - - // constructors / creators - - public ConceptDescription() : base() { } - - public ConceptDescription(ConceptDescription src) - : base(src) - { - if (src.embeddedDataSpecification != null) - this.embeddedDataSpecification = new EmbeddedDataSpecification(src.embeddedDataSpecification); - if (src.isCaseOf != null) - foreach (var ico in src.isCaseOf) - { - if (this.isCaseOf == null) - this.isCaseOf = new List(); - this.isCaseOf.Add(new Reference(ico)); - } - } - - public static ConceptDescription CreateNew( - string idType, string id, string version = null, string revision = null) - { - var cd = new ConceptDescription(); - cd.identification.idType = idType; - cd.identification.id = id; - if (version != null) - { - if (cd.administration == null) - cd.administration = new Administration(); - cd.administration.version = version; - cd.administration.revision = revision; - } - return (cd); - } - - public ConceptDescriptionRef GetReference() - { - var r = new ConceptDescriptionRef(); - r.Keys.Add( - Key.CreateNew(this.GetElementName(), true, this.identification.idType, this.identification.id)); - return r; - } - - public Key GetGlobalDataSpecRef() - { - if (embeddedDataSpecification.hasDataSpecification.Count != 1) - return null; - return (embeddedDataSpecification.hasDataSpecification[0]); - } - - public void SetIEC61360Spec( - string[] preferredNames = null, - string shortName = "", - string unit = "", - UnitId unitId = null, - string valueFormat = null, - string[] sourceOfDefinition = null, - string symbol = null, - string dataType = "", - string[] definition = null - ) - { - this.embeddedDataSpecification = new EmbeddedDataSpecification(); - this.embeddedDataSpecification.hasDataSpecification.Keys.Add( - Key.CreateNew("GlobalReference", false, "URI", - "www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360")); - this.embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360 = - AdminShellV10.DataSpecificationIEC61360.CreateNew( - preferredNames, shortName, unit, unitId, valueFormat, sourceOfDefinition, symbol, dataType, - definition); - this.AddIsCaseOf( - Reference.CreateNew(new Key( - "ConceptDescription", false, this.identification.idType, this.identification.id))); - } - - public DataSpecificationIEC61360 GetIEC61360() - { - if (embeddedDataSpecification != null && - embeddedDataSpecification.dataSpecificationContent != null && - embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360 != null) - return embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360; - return null; - } - - public string GetShortName() - { - if (embeddedDataSpecification != null && - embeddedDataSpecification.dataSpecificationContent != null && - embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360 != null) - return embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360.shortName; - return ""; - } - - public override string GetElementName() - { - return "ConceptDescription"; - } - - public Tuple ToCaptionInfo() - { - var caption = ""; - if (this.idShort != null && this.idShort.Trim() != "") - caption = $"\"{this.idShort.Trim()}\""; - if (this.identification != null) - caption = (caption + " " + this.identification).Trim(); - - var info = ""; - if (embeddedDataSpecification != null && - embeddedDataSpecification.dataSpecificationContent != null && - embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360 != null) - info += embeddedDataSpecification.dataSpecificationContent.dataSpecificationIEC61360.shortName; - - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - public void AddIsCaseOf(Reference ico) - { - if (isCaseOf == null) - isCaseOf = new List(); - isCaseOf.Add(ico); - } - - public static IDisposable CreateNew() - { - throw new NotImplementedException(); - } - } - - public class ConceptDictionary : Referable - { - [XmlElement(ElementName = "conceptDescriptions")] - public ConceptDescriptionRefs conceptDescriptionsRefs = null; - - // constructors - - public ConceptDictionary() { } - - public ConceptDictionary(ConceptDictionary src) - { - if (src.conceptDescriptionsRefs != null) - this.conceptDescriptionsRefs = new ConceptDescriptionRefs(src.conceptDescriptionsRefs); - } - - public static ConceptDictionary CreateNew(string idShort = null) - { - var d = new ConceptDictionary(); - if (idShort != null) - d.idShort = idShort; - return (d); - } - - // add - - public void AddReference(Reference r) - { - var cdr = (ConceptDescriptionRef)(ConceptDescriptionRef.CreateNew(r.Keys)); - if (conceptDescriptionsRefs == null) - conceptDescriptionsRefs = new ConceptDescriptionRefs(); - conceptDescriptionsRefs.conceptDescriptions.Add(cdr); - } - - public override string GetElementName() - { - return "ConceptDictionary"; - } - } - - [XmlRoot(ElementName = "aasenv", Namespace = "http://www.admin-shell.io/aas/1/0")] - public class AdministrationShellEnv - { - [XmlAttribute(Namespace = System.Xml.Schema.XmlSchema.InstanceNamespace)] - public string schemaLocation = - "http://www.admin-shell.io/aas/1/0 AAS.xsd http://www.admin-shell.io/IEC61360/1/0 IEC61360.xsd"; - - /// [XmlElement(ElementName="assetAdministrationShells")] - [XmlIgnore] // will be ignored, anyway - private List administrationShells = new List(); - [XmlIgnore] // will be ignored, anyway - private List assets = new List(); - [XmlIgnore] // will be ignored, anyway - private List submodels = new List(); - [XmlIgnore] // will be ignored, anyway - private List conceptDescriptions = new List(); - - // getter / setters - - [XmlArray("assetAdministrationShells")] - [XmlArrayItem("assetAdministrationShell")] - [JsonProperty(PropertyName = "assetAdministrationShells")] - public List AdministrationShells - { - get { return administrationShells; } - set { administrationShells = value; } - } - - [XmlArray("assets")] - [XmlArrayItem("asset")] - [JsonProperty(PropertyName = "assets")] - public List Assets - { - get { return assets; } - set { assets = value; } - } - - [XmlArray("submodels")] - [XmlArrayItem("submodel")] - [JsonProperty(PropertyName = "submodels")] - public List Submodels - { - get { return submodels; } - set { submodels = value; } - } - - [XmlArray("conceptDescriptions")] - [XmlArrayItem("conceptDescription")] - [JsonProperty(PropertyName = "conceptDescriptions")] - public List ConceptDescriptions - { - get { return conceptDescriptions; } - set { conceptDescriptions = value; } - } - - // finders - - public AdministrationShell FindAAS(Identification id) - { - if (id == null) - return null; - foreach (var aas in this.AdministrationShells) - if (aas.identification != null && aas.identification.IsEqual(id)) - return aas; - return null; - } - - public AdministrationShell FindAAS(string idShort) - { - if (idShort == null) - return null; - foreach (var aas in this.AdministrationShells) - if (aas.idShort != null && aas.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - return aas; - return null; - } - - public AdministrationShell FindAASwithSubmodel(Identification smid) - { - if (smid == null) - return null; - foreach (var aas in this.AdministrationShells) - if (aas.submodelRefs != null) - foreach (var smref in aas.submodelRefs) - if (smref.MatchesTo(smid)) - return aas; - return null; - } - - public Asset FindAsset(Identification id) - { - if (id == null) - return null; - foreach (var asset in this.Assets) - if (asset.identification != null && asset.identification.IsEqual(id)) - return asset; - return null; - } - - public Asset FindAsset(AssetRef aref) - { - // trivial - if (aref == null) - return null; - // can only refs with 1 key - if (aref.Count != 1) - return null; - // and we're picky - var key = aref[0]; - if (!key.local || key.type.ToLower().Trim() != "asset") - return null; - // brute force - foreach (var a in assets) - if (a.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && a.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return a; - // uups - return null; - } - - public Submodel FindSubmodel(Identification id) - { - if (id == null) - return null; - foreach (var sm in this.Submodels) - if (sm.identification != null && sm.identification.IsEqual(id)) - return sm; - return null; - } - - public Submodel FindSubmodel(SubmodelRef smref) - { - // trivial - if (smref == null) - return null; - // can only refs with 1 key - if (smref.Count != 1) - return null; - // and we're picky - var key = smref.Keys[0]; - if (!key.local || key.type.ToLower().Trim() != "submodel") - return null; - // brute force - foreach (var sm in this.Submodels) - if (sm.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && sm.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return sm; - // uups - return null; - } - - public Referable FindReferableByReference(Reference rf, int keyIndex = 0) - { - // first index needs to exist .. - if (rf == null || keyIndex >= rf.Count) - return null; - - // which type? - var firstType = rf[keyIndex].type.Trim().ToLower(); - var firstIdentification = new Identification(rf[keyIndex].idType, rf[keyIndex].value); - - if (firstType == Key.AAS.Trim().ToLower()) - return this.FindAAS(firstIdentification); - - if (firstType == Key.Asset.Trim().ToLower()) - return this.FindAsset(firstIdentification); - - if (firstType == Key.ConceptDescription.Trim().ToLower()) - return this.FindConceptDescription(firstIdentification); - - if (firstType == Key.Submodel.Trim().ToLower()) - { - // ok, search Submodel - var sm = this.FindSubmodel(new Identification(rf[keyIndex].idType, rf[keyIndex].value)); - if (sm == null) - return null; - - // at our end? - if (keyIndex >= rf.Count - 1) - return sm; - - // go inside - return SubmodelElementWrapper.FindReferableByReference(sm.submodelElements, rf, keyIndex + 1); - } - - // nothing in this Environment - return null; - } - - - public ConceptDescription FindConceptDescription(ConceptDescriptionRef cdr) - { - if (cdr == null) - return null; - return FindConceptDescription(cdr.Keys); - } - - public ConceptDescription FindConceptDescription(Identification id) - { - var cdr = ConceptDescriptionRef.CreateNew("Conceptdescription", true, id.idType, id.id); - return FindConceptDescription(cdr); - } - - public ConceptDescription FindConceptDescription(List keys) - { - // trivial - if (keys == null) - return null; - // can only refs with 1 key - if (keys.Count != 1) - return null; - // and we're picky - var key = keys[0]; - if (!key.local || key.type.ToLower().Trim() != "conceptdescription") - return null; - // brute force - foreach (var cd in conceptDescriptions) - if (cd.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && cd.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return cd; - // uups - return null; - } - - public ConceptDescription FindConceptDescription(Key key) - { - if (key == null) - return null; - var l = new List(); - l.Add(key); - return (FindConceptDescription(l)); - } - - // creators - - private void CopyConceptDescriptionsFrom( - AdministrationShellEnv srcEnv, SubmodelElement src, bool shallowCopy = false) - { - // access - if (srcEnv == null || src == null || src.semanticId == null) - return; - // check for this SubmodelElement in Source - var cdSrc = srcEnv.FindConceptDescription(src.semanticId.Keys); - if (cdSrc == null) - return; - // check for this SubmodelElement in Destnation (this!) - var cdDest = this.FindConceptDescription(src.semanticId.Keys); - if (cdDest != null) - return; - // copy new - this.ConceptDescriptions.Add(new ConceptDescription(cdSrc)); - // recurse? - if (!shallowCopy && src is SubmodelElementCollection) - foreach (var m in (src as SubmodelElementCollection).value) - CopyConceptDescriptionsFrom(srcEnv, m.submodelElement, shallowCopy); - - } - - public SubmodelElementWrapper CopySubmodelElementAndCD( - AdministrationShellEnv srcEnv, SubmodelElement srcElem, bool copyCD = false, bool shallowCopy = false) - { - // access - if (srcEnv == null || srcElem == null) - return null; - - // 1st result pretty easy (calling function will add this to the appropriate Submodel) - var res = new SubmodelElementWrapper(srcElem); - - // copy the CDs.. - if (copyCD) - CopyConceptDescriptionsFrom(srcEnv, srcElem, shallowCopy); - - // give back - return res; - } - - public SubmodelRef CopySubmodelRefAndCD( - AdministrationShellEnv srcEnv, SubmodelRef srcSubRef, bool copySubmodel = false, bool copyCD = false, - bool shallowCopy = false) - { - // access - if (srcEnv == null || srcSubRef == null) - return null; - - // need to have the source Submodel - var srcSub = srcEnv.FindSubmodel(srcSubRef); - if (srcSub == null) - return null; - - // 1st result pretty easy (calling function will add this to the appropriate AAS) - var dstSubRef = new SubmodelRef(srcSubRef); - - // get the destination and shall src != dst - var dstSub = this.FindSubmodel(dstSubRef); - if (srcSub == dstSub) - return null; - - // maybe we need the Submodel in our environment, as well - if (dstSub == null && copySubmodel) - { - dstSub = new Submodel(srcSub, shallowCopy); - this.Submodels.Add(dstSub); - } - else - { - // there is already an submodel, just add members - if (!shallowCopy && srcSub.submodelElements != null) - { - if (dstSub.submodelElements == null) - dstSub.submodelElements = new List(); - foreach (var smw in srcSub.submodelElements) - dstSub.submodelElements.Add(new SubmodelElementWrapper(smw.submodelElement, shallowCopy)); - } - } - - // copy the CDs.. - if (copyCD && srcSub.submodelElements != null) - foreach (var smw in srcSub.submodelElements) - CopyConceptDescriptionsFrom(srcEnv, smw.submodelElement, shallowCopy); - - // give back - return dstSubRef; - } - - // serializations - - public void SerializeXmlToStream(StreamWriter s) - { - var serializer = new XmlSerializer(typeof(AdminShellV10.AdministrationShellEnv)); - var nss = new XmlSerializerNamespaces(); - nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - nss.Add("aas", "http://www.admin-shell.io/aas/1/0"); - nss.Add("IEC61360", "http://www.admin-shell.io/IEC61360/1/0"); - serializer.Serialize(s, this, nss); - } - - public JsonWriter SerialiazeJsonToStream(StreamWriter sw, bool leaveJsonWriterOpen = false) - { - sw.AutoFlush = true; - - JsonSerializer serializer = new JsonSerializer(); - serializer.NullValueHandling = NullValueHandling.Ignore; - serializer.ReferenceLoopHandling = ReferenceLoopHandling.Serialize; - serializer.Formatting = Newtonsoft.Json.Formatting.Indented; - - JsonWriter writer = new JsonTextWriter(sw); - serializer.Serialize(writer, this); - if (leaveJsonWriterOpen) - return writer; - writer.Close(); - return null; - } - - public AdministrationShellEnv DeserializeFromXmlStream(TextReader reader) - { - XmlSerializer serializer = new XmlSerializer( - typeof(AdminShellV10.AdministrationShellEnv), "http://www.admin-shell.io/aas/1/0"); - var res = serializer.Deserialize(reader) as AdminShellV10.AdministrationShellEnv; - return res; - } - - public AdministrationShellEnv DeserializeFromJsonStream(TextReader reader) - { - JsonSerializer serializer = new JsonSerializer(); - serializer.Converters.Add(new AdminShellV10.JsonAasxConverter("modelType", "name")); - var res = (AdministrationShellEnv)serializer.Deserialize(reader, typeof(AdministrationShellEnv)); - return res; - } - - // special functions - - private static void CreateFromExistingEnvRecurseForCDs( - AdministrationShellEnv src, List wrappers, - ref List filterForCD) - { - if (wrappers == null || filterForCD == null) - return; - - foreach (var w in wrappers) - { - // include in filter .. - if (w.submodelElement.semanticId != null) - { - var cd = src.FindConceptDescription(w.submodelElement.semanticId.Keys); - if (cd != null) - filterForCD.Add(cd); - } - - // recurse? - if (w.submodelElement is SubmodelElementCollection) - CreateFromExistingEnvRecurseForCDs( - src, (w.submodelElement as SubmodelElementCollection).value, ref filterForCD); - - if (w.submodelElement is Operation) - for (int i = 0; i < 2; i++) - { - var w2s = Operation.GetWrappers((w.submodelElement as Operation)[i]); - CreateFromExistingEnvRecurseForCDs(src, w2s, ref filterForCD); - } - - } - } - - public static AdministrationShellEnv CreateFromExistingEnv(AdministrationShellEnv src, - List filterForAas = null, - List filterForAsset = null, - List filterForSubmodel = null, - List filterForCD = null) - { - // prepare defaults - if (filterForAas == null) - filterForAas = new List(); - if (filterForAsset == null) - filterForAsset = new List(); - if (filterForSubmodel == null) - filterForSubmodel = new List(); - if (filterForCD == null) - filterForCD = new List(); - - // make new - var res = new AdministrationShellEnv(); - - // take over AAS - foreach (var aas in src.administrationShells) - if (filterForAas.Contains(aas)) - { - // take over - res.administrationShells.Add(new AdministrationShell(aas)); - - // consequences - if (aas.assetRef != null) - { - var asset = src.FindAsset(aas.assetRef); - if (asset != null) - filterForAsset.Add(asset); - } - - if (aas.submodelRefs != null) - foreach (var smr in aas.submodelRefs) - { - var sm = src.FindSubmodel(smr); - if (sm != null) - filterForSubmodel.Add(sm); - } - - if (aas.conceptDictionaries != null) - foreach (var cdd in aas.conceptDictionaries) - if (cdd.conceptDescriptionsRefs != null && - cdd.conceptDescriptionsRefs.conceptDescriptions != null) - foreach (var cdr in cdd.conceptDescriptionsRefs.conceptDescriptions) - { - var cd = src.FindConceptDescription(cdr); - if (cd != null) - filterForCD.Add(cd); - } - } - - // take over Assets - foreach (var asset in src.assets) - if (filterForAsset.Contains(asset)) - { - // take over - res.assets.Add(new Asset(asset)); - } - - // take over Submodels - foreach (var sm in src.Submodels) - if (filterForSubmodel.Contains(sm)) - { - // take over - res.submodels.Add(new Submodel(sm)); - - // recursion in order to find used CDs - CreateFromExistingEnvRecurseForCDs(src, sm.submodelElements, ref filterForCD); - } - - // ConceptDescriptions - foreach (var cd in src.ConceptDescriptions) - if (filterForCD.Contains(cd)) - { - // take over - res.conceptDescriptions.Add(new ConceptDescription(cd)); - } - - // ok - return res; - } - } - - // - // Submodel + Submodel elements - // - - public interface IGetReference - { - Reference GetReference(); - } - - public class Qualifier - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // member - - // from hasSemantics: - [XmlElement(ElementName = "semanticId")] - // TODO (Michael Hoffmeister, 1970-01-01): Qualifiers not working! - // 190410: test-wise enable them again, everyhing works fine .. - public SemanticId semanticId = null; - - // this class - public string qualifierType = null; - public string qualifierValue = null; - public Reference qualifierValueId = null; - - // constructors - - public Qualifier() { } - - public Qualifier(Qualifier src) - { - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - this.qualifierType = src.qualifierType; - this.qualifierValue = src.qualifierValue; - if (src.qualifierValueId != null) - this.qualifierValueId = new Reference(src.qualifierValueId); - } - - public string GetElementName() - { - return "Qualifier"; - } - } - - public class SubmodelElement : Referable, System.IDisposable, IGetReference - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // do this in order to be IDisposable, that is: suitable for (using) - void System.IDisposable.Dispose() { } - public void GetData() { } - // from hasDataSpecification: - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - // from hasSemantics: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = null; - // from hasKind: - [XmlElement(ElementName = "kind")] - [JsonIgnore] - public Kind kind = null; - [XmlIgnore] - [JsonProperty(PropertyName = "kind")] - public string JsonKind - { - get - { - if (kind == null) - return null; - return kind.kind; - } - set - { - if (kind == null) - kind = new Kind(); - kind.kind = value; - } - } - // from Qualifiable: - [XmlArray("qualifier")] - [XmlArrayItem("qualifier")] - [JsonProperty(PropertyName = "constraints")] - public List qualifiers = null; - - // getter / setter - - // constructors / creators - - public SubmodelElement() - : base() { } - - public SubmodelElement(SubmodelElement src) - : base(src) - { - if (src.hasDataSpecification != null) - hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.semanticId != null) - semanticId = new SemanticId(src.semanticId); - if (src.kind != null) - kind = new Kind(src.kind); - if (src.qualifiers != null) - { - if (qualifiers == null) - qualifiers = new List(); - foreach (var q in src.qualifiers) - qualifiers.Add(new Qualifier(q)); - } - } - - public void CreateNewLogic(string idShort = null, string category = null, Key semanticIdKey = null) - { - if (idShort != null) - this.idShort = idShort; - if (category != null) - this.category = category; - if (semanticIdKey != null) - { - if (this.semanticId == null) - this.semanticId = new SemanticId(); - this.semanticId.Keys.Add(semanticIdKey); - } - } - - public void AddQualifier( - string qualifierType = null, string qualifierValue = null, KeyList semanticKeys = null, - Reference qualifierValueId = null) - { - if (this.qualifiers == null) - this.qualifiers = new List(); - var q = new Qualifier(); - q.qualifierType = qualifierType; - q.qualifierValue = qualifierValue; - q.qualifierValueId = qualifierValueId; - if (semanticKeys != null) - q.semanticId = SemanticId.CreateFromKeys(semanticKeys.Keys); - this.qualifiers.Add(q); - } - - public Qualifier HasQualifierOfType(string qualifierType) - { - if (this.qualifiers == null || qualifierType == null) - return null; - foreach (var q in this.qualifiers) - if (q.qualifierType.Trim().ToLower() == qualifierType.Trim().ToLower()) - return q; - return null; - } - - public override string GetElementName() - { - return "SubmodelElement"; - } - - public Reference GetReference() - { - Reference r = new Reference(); - // this is the tail of our referencing chain .. - r.Keys.Add(Key.CreateNew(GetElementName(), true, "idShort", this.idShort)); - // try to climb up .. - var current = this.parent; - while (current != null) - { - if (current is Identifiable) - { - // add big information set - r.Keys.Insert(0, Key.CreateNew( - current.GetElementName(), - true, - (current as Identifiable).identification.idType, - (current as Identifiable).identification.id)); - } - else - { - // reference via idShort - r.Keys.Insert(0, Key.CreateNew( - current.GetElementName(), - true, - "idShort", this.idShort)); - } - current = current.parent; - } - return r; - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV10.EvalToNonNullString("\"{0}\" ", idShort, ""); - var info = ""; - if (semanticId != null) - info = AdminShellUtilV10.EvalToNonEmptyString("\u21e8 {0}", semanticId.ToString(), ""); - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - - } - - [XmlType(TypeName = "submodelElement")] - public class SubmodelElementWrapper - { - - // members - - [XmlElement(ElementName = "property", Type = typeof(Property))] - [XmlElement(ElementName = "file", Type = typeof(File))] - [XmlElement(ElementName = "blob", Type = typeof(Blob))] - [XmlElement(ElementName = "referenceElement", Type = typeof(ReferenceElement))] - [XmlElement(ElementName = "relationshipElement", Type = typeof(RelationshipElement))] - [XmlElement(ElementName = "submodelElementCollection", Type = typeof(SubmodelElementCollection))] - [XmlElement(ElementName = "operation", Type = typeof(Operation))] - public SubmodelElement submodelElement; - - // element names - public static string[] AdequateElementNames = { - "SubmodelElementCollection", "Property", "File", "Blob", "ReferenceElement", - "RelationshipElement", "Operation", "OperationVariable" }; - - // constructors - - public SubmodelElementWrapper() { } - - // for cloning - public SubmodelElementWrapper(SubmodelElement src, bool shallowCopy = false) - { - if (src is Property) - this.submodelElement = new Property(src as Property); - if (src is File) - this.submodelElement = new File(src as File); - if (src is Blob) - this.submodelElement = new Blob(src as Blob); - if (src is ReferenceElement) - this.submodelElement = new ReferenceElement(src as ReferenceElement); - if (src is RelationshipElement) - this.submodelElement = new RelationshipElement(src as RelationshipElement); - if (src is SubmodelElementCollection) - this.submodelElement = new SubmodelElementCollection( - src as SubmodelElementCollection, shallowCopy: shallowCopy); - if (src is Operation) - this.submodelElement = new Operation(src as Operation); - } - - /// - /// Introduced for JSON serialization, can create SubModelElements based on a string name - /// - /// string name (standard PascalCased) - /// SubmodelElement - public static SubmodelElement CreateAdequateType(string elementName) - { - if (elementName == "Property") - return new Property(); - if (elementName == "File") - return new File(); - if (elementName == "Blob") - return new Blob(); - if (elementName == "ReferenceElement") - return new ReferenceElement(); - if (elementName == "RelationshipElement") - return new RelationshipElement(); - if (elementName == "SubmodelElementCollection") - return new SubmodelElementCollection(); - if (elementName == "Operation") - return new Operation(); - if (elementName == "OperationVariable") - return new OperationVariable(); - return null; - } - - /// - /// Can create SubmodelElements based on a numerical index - /// - /// Index 0..7 (6+7 are Operation..!) - /// SubmodelElement - public static SubmodelElement CreateAdequateType(int index) - { - AdminShellV10.SubmodelElement sme = null; - switch (index) - { - case 0: - sme = new AdminShellV10.Property(); - break; - case 1: - sme = new AdminShellV10.File(); - break; - case 2: - sme = new AdminShellV10.Blob(); - break; - case 3: - sme = new AdminShellV10.ReferenceElement(); - break; - case 4: - sme = new AdminShellV10.SubmodelElementCollection(); - break; - case 5: - sme = new AdminShellV10.RelationshipElement(); - break; - case 6: - sme = new AdminShellV10.Operation(); - break; - case 7: - sme = new AdminShellV10.OperationVariable(); - break; - } - return sme; - } - - public string GetFourDigitCode() - { - if (submodelElement == null) - return ("Null"); - if (submodelElement is AdminShellV10.Property) return ("Prop"); - if (submodelElement is AdminShellV10.File) return ("File"); - if (submodelElement is AdminShellV10.Blob) return ("Blob"); - if (submodelElement is AdminShellV10.ReferenceElement) return ("Ref"); - if (submodelElement is AdminShellV10.RelationshipElement) return ("Rel"); - if (submodelElement is AdminShellV10.SubmodelElementCollection) return ("Coll"); - if (submodelElement is AdminShellV10.Operation) return ("Opr"); - return ("Elem"); - } - - public static List ListOfWrappersToListOfElems(List wrappers) - { - var res = new List(); - if (wrappers == null) - return res; - foreach (var w in wrappers) - if (w.submodelElement != null) - res.Add(w.submodelElement); - return res; - } - - public static SubmodelElementWrapper CreateFor(SubmodelElement sme) - { - var res = new SubmodelElementWrapper(); - res.submodelElement = sme; - return res; - } - - public static Referable FindReferableByReference( - List wrappers, Reference rf, int keyIndex) - { - // first index needs to exist .. - if (wrappers == null || rf == null || keyIndex >= rf.Count) - return null; - - // as SubmodelElements are not Identifiables, the actual key shall be IdSHort - if (rf[keyIndex].idType.Trim().ToLower() != - Key.GetIdentifierTypeName(Key.IdentifierType.IdShort).Trim().ToLower()) - return null; - - // over all wrappers - if (wrappers != null) - foreach (var smw in wrappers) - if (smw.submodelElement != null && - smw.submodelElement.idShort.Trim().ToLower() == rf[keyIndex].value.Trim().ToLower()) - { - // match on this level. Did we find a leaf element? - if ((keyIndex + 1) >= rf.Count) - return smw.submodelElement; - - // ok, not a leaf, must be a recursion - // int SMEC - if (smw.submodelElement is SubmodelElementCollection) - return FindReferableByReference( - (smw.submodelElement as SubmodelElementCollection).value, rf, keyIndex + 1); - - // TODO (Michael Hoffmeister, 1970-01-01): Operation - - // else: - return null; - } - - // no? - return null; - } - } - - public class Submodel : Identifiable, System.IDisposable, IGetReference - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // do this in order to be IDisposable, that is: suitable for (using) - void System.IDisposable.Dispose() { } - public void GetData() { } - // from hasDataSpecification: - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - // from hasSemanticId: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = new SemanticId(); - // from Kindable - [XmlElement(ElementName = "kind")] - [JsonIgnore] - public Kind kind = new Kind(); - [XmlIgnore] - [JsonProperty(PropertyName = "kind")] - public string JsonKind - { - get - { - if (kind == null) - return null; - return kind.kind; - } - set - { - if (kind == null) - kind = new Kind(); - kind.kind = value; - } - } - // from Qualifiable: - [XmlArray("qualifier")] - [XmlArrayItem("qualifier")] - public List qualifiers = null; - - // from this very class - [JsonIgnore] - public List submodelElements = null; - [XmlIgnore] - [JsonProperty(PropertyName = "submodelElements")] - public SubmodelElement[] JsonSubmodelElements - { - get - { - var res = new List(); - if (submodelElements != null) - foreach (var smew in submodelElements) - res.Add(smew.submodelElement); - return res.ToArray(); - } - set - { - if (value != null) - { - this.submodelElements = new List(); - foreach (var x in value) - { - var smew = new SubmodelElementWrapper(); - smew.submodelElement = x; - this.submodelElements.Add(smew); - } - } - } - } - - // getter / setter - - // constructors / creators - - public Submodel() : base() { } - - public Submodel(Submodel src, bool shallowCopy = false) - : base(src) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - if (src.kind != null) - this.kind = new Kind(src.kind); - if (!shallowCopy && src.submodelElements != null) - { - if (this.submodelElements == null) - this.submodelElements = new List(); - foreach (var smw in src.submodelElements) - this.submodelElements.Add(new SubmodelElementWrapper(smw.submodelElement, shallowCopy)); - } - } - - public static Submodel CreateNew(string idType, string id, string version = null, string revision = null) - { - var s = new Submodel(); - s.identification.idType = idType; - s.identification.id = id; - if (version != null) - { - if (s.administration == null) - s.administration = new Administration(); - s.administration.version = version; - s.administration.revision = revision; - } - return (s); - } - - public override string GetElementName() - { - return "Submodel"; - } - - public Reference GetReference() - { - SubmodelRef l = new SubmodelRef(); - l.Keys.Add( - Key.CreateNew(this.GetElementName(), true, this.identification.idType, this.identification.id)); - return l; - } - - public void Add(SubmodelElement se) - { - if (submodelElements == null) - submodelElements = new List(); - var sew = new SubmodelElementWrapper(); - se.parent = this; // track parent here! - sew.submodelElement = se; - submodelElements.Add(sew); - } - - public void AddDataSpecification(Key k) - { - if (hasDataSpecification == null) - hasDataSpecification = new HasDataSpecification(); - var r = new Reference(); - r.Keys.Add(k); - hasDataSpecification.reference.Add(r); - } - - public SubmodelElementWrapper FindSubmodelElementWrapper(string idShort) - { - if (this.submodelElements == null) - return null; - foreach (var smw in this.submodelElements) - if (smw.submodelElement != null) - if (smw.submodelElement.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - return smw; - return null; - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV10.EvalToNonNullString("\"{0}\" ", idShort, ""); - if (administration != null) - caption += "V" + administration.version + "." + administration.revision; - var info = ""; - if (identification != null) - info = $"[{identification.idType}, {identification.id}]"; - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - // Recursing - - private void RecurseOnSubmodelElementsRecurse( - List wrappers, object state, List parents, - Action, SubmodelElement> lambda) - { - // trivial - if (wrappers == null || parents == null || lambda == null) - return; - - // over all elements - foreach (var smw in wrappers) - { - var current = smw.submodelElement; - if (current == null) - continue; - - // call lambda for this element - lambda(state, parents, current); - - // add to parents - parents.Add(current); - - // dive into? - if (current is SubmodelElementCollection) - { - var smc = current as SubmodelElementCollection; - RecurseOnSubmodelElementsRecurse(smc.value, state, parents, lambda); - } - - if (current is Operation) - { - var op = current as Operation; - for (int i = 0; i < 2; i++) - RecurseOnSubmodelElementsRecurse(Operation.GetWrappers(op[i]), state, parents, lambda); - } - - // remove from parents - parents.RemoveAt(parents.Count - 1); - } - } - - public void RecurseOnSubmodelElements( - object state, Action, SubmodelElement> lambda) - { - RecurseOnSubmodelElementsRecurse(this.submodelElements, state, new List(), lambda); - } - - // Parents stuff - - private static void SetParentsForSME(Referable parent, SubmodelElement se) - { - se.parent = parent; - var smc = se as SubmodelElementCollection; - if (smc != null) - foreach (var sme in smc.value) - SetParentsForSME(se, sme.submodelElement); - } - - public void SetAllParents() - { - if (this.submodelElements != null) - foreach (var sme in this.submodelElements) - SetParentsForSME(this, sme.submodelElement); - } - - } - - // - // Derived from SubmodelElements - // - - public class DataElement : SubmodelElement - { - - public DataElement() { } - - public DataElement(DataElement src) - : base(src) - { } - - public override string GetElementName() - { - return "DataElement"; - } - } - - public class JsonValueTypeCast - { - - public class JsonDataObjectType - { - [JsonProperty(PropertyName = "name")] - public string name = ""; - } - - [JsonProperty(PropertyName = "dataObjectType")] - public JsonDataObjectType dataObjectType = new JsonDataObjectType(); - - public JsonValueTypeCast(string name) - { - this.dataObjectType.name = name; - } - } - - public class Property : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - [JsonIgnore] - public string valueType = ""; - [XmlIgnore] - [JsonProperty(PropertyName = "valueType")] - public JsonValueTypeCast JsonValueType - { - get { return new JsonValueTypeCast(this.valueType); } - set { this.valueType = value?.dataObjectType?.name; } - } - - - public string value = ""; - public Reference valueId = null; - - // constructors - - public Property() { } - - public Property(Property src) - : base(src) - { - this.valueType = src.valueType; - this.value = src.value; - if (src.valueId != null) - src.valueId = new Reference(src.valueId); - } - - public static Property CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new Property(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(string valueType = "", string value = "") - { - this.valueType = valueType; - this.value = value; - } - - public void Set(string type, bool local, string idType, string value) - { - this.valueId = Reference.CreateNew(Key.CreateNew(type, local, idType, value)); - } - - public override string GetElementName() - { - return "Property"; - } - } - - public class Blob : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public string mimeType = ""; - public string value = ""; - - // constructors - - public Blob() { } - - public Blob(Blob src) - : base(src) - { - this.mimeType = src.mimeType; - this.value = src.value; - } - - public static Blob CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new Blob(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(string mimeType = "", string value = "") - { - this.mimeType = mimeType; - this.value = value; - } - - public override string GetElementName() - { - return "Blob"; - } - - } - - public class File : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public string mimeType = ""; - public string value = ""; - - // constructors - - public File() { } - - public File(File src) - : base(src) - { - this.mimeType = src.mimeType; - this.value = src.value; - } - - public static File CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new File(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(string mimeType = "", string value = "") - { - this.mimeType = mimeType; - this.value = value; - } - - public override string GetElementName() - { - return "File"; - } - - public static string[] GetPopularMimeTypes() - { - return - new string[] { - System.Net.Mime.MediaTypeNames.Text.Plain, - System.Net.Mime.MediaTypeNames.Text.Xml, - System.Net.Mime.MediaTypeNames.Text.Html, - "application/json", - "application/rdf+xml", - System.Net.Mime.MediaTypeNames.Application.Pdf, - System.Net.Mime.MediaTypeNames.Image.Jpeg, - "image/png", - System.Net.Mime.MediaTypeNames.Image.Gif, - "application/iges", - "application/step" - }; - } - } - - public class ReferenceElement : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public Reference value = new Reference(); - - // constructors - - public ReferenceElement() { } - - public ReferenceElement(ReferenceElement src) - : base(src) - { - if (src.value != null) - this.value = new Reference(src.value); - } - - public static ReferenceElement CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new ReferenceElement(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(Reference value = null) - { - this.value = value; - } - - public override string GetElementName() - { - return "ReferenceElement"; - } - - } - - public class RelationshipElement : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public Reference first = new Reference(); - public Reference second = new Reference(); - - // constructors - - public RelationshipElement() { } - - public RelationshipElement(RelationshipElement src) - : base(src) - { - if (src.first != null) - this.first = new Reference(src.first); - if (src.second != null) - this.second = new Reference(src.second); - } - - public static RelationshipElement CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new RelationshipElement(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(Reference first = null, Reference second = null) - { - this.first = first; - this.second = second; - } - - public override string GetElementName() - { - return "RelationshipElement"; - } - } - - public class SubmodelElementCollection : SubmodelElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - [JsonIgnore] - public List value = new List(); - - [XmlIgnore] - [JsonProperty(PropertyName = "value")] - public SubmodelElement[] JsonValue - { - get - { - var res = new List(); - if (value != null) - foreach (var smew in value) - res.Add(smew.submodelElement); - return res.ToArray(); - } - set - { - if (value != null) - { - this.value = new List(); - foreach (var x in value) - { - var smew = new SubmodelElementWrapper(); - smew.submodelElement = x; - this.value.Add(smew); - } - } - } - } - - // further members - public bool ordered = false; - public bool allowDuplicates = false; - - // constructors - - public SubmodelElementCollection() { } - - public SubmodelElementCollection(SubmodelElementCollection src, bool shallowCopy = false) - : base(src) - { - this.ordered = src.ordered; - this.allowDuplicates = src.allowDuplicates; - if (!shallowCopy) - foreach (var smw in src.value) - value.Add(new SubmodelElementWrapper(smw.submodelElement)); - } - - public static SubmodelElementCollection CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new SubmodelElementCollection(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(bool allowDuplicates = false, bool ordered = false) - { - this.allowDuplicates = allowDuplicates; - this.ordered = ordered; - } - - public void Add(SubmodelElement se) - { - if (value == null) - value = new List(); - var sew = new SubmodelElementWrapper(); - se.parent = this; // track parent here! - sew.submodelElement = se; - value.Add(sew); - } - - public SubmodelElementWrapper FindSubmodelElementWrapper(string idShort) - { - if (this.value == null) - return null; - foreach (var smw in this.value) - if (smw.submodelElement != null) - if (smw.submodelElement.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - return smw; - return null; - } - - public override string GetElementName() - { - return "SubmodelElementCollection"; - } - } - - public class OperationVariable : SubmodelElement - { - public enum Direction { In, Out }; - - // Note: for OperationVariable, the values of the SubmodelElement itself ARE NOT TO BE USED! - // only the SME attributes of "value" are counting - - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - public SubmodelElementWrapper value = null; - - // constructors - - public OperationVariable() - { - this.kind = new Kind("Type"); - } - - public OperationVariable(OperationVariable src, bool shallowCopy = false) - : base(src) - { - this.value = new SubmodelElementWrapper(src.value.submodelElement, shallowCopy); - } - - public OperationVariable(SubmodelElement elem) - : base() - { - this.value = new SubmodelElementWrapper(elem); - } - - public override string GetElementName() - { - return "OperationVariable"; - } - } - - public class Operation : SubmodelElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - [JsonIgnore] - [XmlElement(ElementName = "in")] - public List valueIn = new List(); - - [JsonIgnore] - [XmlElement(ElementName = "out")] - public List valueOut = new List(); - - [XmlIgnore] - // MICHA 190504: enabled JSON operation variables! - [JsonProperty(PropertyName = "in")] - public OperationVariable[] JsonValueIn - { - get { return valueIn?.ToArray(); } - set { valueIn = (value != null) ? new List(value) : null; } - } - - [XmlIgnore] - [JsonProperty(PropertyName = "out")] - // MICHA 190504: enabled JSON operation variables! - public OperationVariable[] JsonValueOut - { - get { return valueOut?.ToArray(); } - set { valueOut = (value != null) ? new List(value) : null; } - } - - public List this[OperationVariable.Direction dir] - { - get - { - return (dir == OperationVariable.Direction.In) ? valueIn : valueOut; - } - set - { - if (dir == OperationVariable.Direction.In) - valueIn = value; - else - valueOut = value; - } - } - - public List this[int dir] - { - get - { - return (dir == 0) ? valueIn : valueOut; - } - set - { - if (dir == 0) - valueIn = value; - else - valueOut = value; - } - } - - public static List GetWrappers(List ovl) - { - var res = new List(); - foreach (var ov in ovl) - if (ov.value != null) - res.Add(ov.value); - return res; - } - - // constructors - - public Operation() { } - - public Operation(Operation src) - : base(src) - { - for (int i = 0; i < 2; i++) - if (src[i] != null) - { - if (this[i] == null) - this[i] = new List(); - foreach (var ov in src[i]) - this[i].Add(ov); - } - } - - - public override string GetElementName() - { - return "Operation"; - } - } - - // - // Handling of packages - // - - /// - /// This converter is used for reading JSON files; it claims to be responsible for - /// "SubmodelElements" (the base class) - /// and decides, which sub-class of the base class shall be populated. - /// The decision, shich special sub-class to create is done in a factory - /// AdminShell.SubmodelElementWrapper.CreateAdequateType(), - /// in order to have all sub-class specific decisions in one place (SubmodelElementWrapper) - /// Remark: There is a NuGet package JsonSubTypes, which could have done the job, except the fact of having - /// "modelType" being a class property with a contained property "name". - /// - public class JsonAasxConverter : JsonConverter - { - private string UpperClassProperty = "modelType"; - private string LowerClassProperty = "name"; - - public JsonAasxConverter() : base() - { - } - - public JsonAasxConverter(string UpperClassProperty, string LowerClassProperty) : base() - { - this.UpperClassProperty = UpperClassProperty; - this.LowerClassProperty = LowerClassProperty; - } - - public override bool CanConvert(Type objectType) - { - if (typeof(AdminShellV10.SubmodelElement).IsAssignableFrom(objectType)) - return true; - return false; - } - - public override bool CanWrite - { - get { return false; } - } - - public override object ReadJson(JsonReader reader, - Type objectType, - object existingValue, - JsonSerializer serializer) - { - // Load JObject from stream - JObject jObject = JObject.Load(reader); - - // Create target object based on JObject - object target = new AdminShellV10.SubmodelElement(); - - if (jObject.ContainsKey(UpperClassProperty)) - { - var j2 = jObject[UpperClassProperty]; - foreach (var c in j2.Children()) - { - var cprop = c as Newtonsoft.Json.Linq.JProperty; - if (cprop == null) - continue; - if (cprop.Name == LowerClassProperty && - cprop.Value != null && - cprop.Value.Type.ToString() == "String") - { - var cpval = cprop.Value.ToObject(); - if (cpval == null) - continue; - var o = AdminShellV10.SubmodelElementWrapper.CreateAdequateType(cpval); - if (o != null) - target = o; - } - } - } - - // Populate the object properties - serializer.Populate(jObject.CreateReader(), target); - - return target; - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - throw new NotImplementedException(); - } - } - - /// - /// This class lets an outer functionality keep track on the supplementary files, which are in or - /// are pending to be added or deleted to an Package. - /// - public class PackageSupplementaryFile : Referable - { - public enum LocationType { InPackage, AddPending, DeletePending } - - public enum SpecialHandlingType { None, EmbedAsThumbnail } - - public Uri uri = null; - public string sourcePath = null; - public LocationType location = LocationType.InPackage; - public SpecialHandlingType specialHandling = SpecialHandlingType.None; - - public PackageSupplementaryFile( - Uri uri, string sourcePath = null, LocationType location = LocationType.InPackage, - SpecialHandlingType specialHandling = SpecialHandlingType.None) - { - this.uri = uri; - this.sourcePath = sourcePath; - this.location = location; - this.specialHandling = specialHandling; - } - - // class derives from Referable in order to provide GetElementName - public override string GetElementName() - { - return "File"; - } - - } - - /// - /// This class encapsulates an AdminShellEnvironment and supplementary files into an AASX Package. - /// Specifically has the capability to load, update and store .XML, .JSON and .AASX packages. - /// - public class PackageEnv - { - private string fn = "New Package"; - private AdministrationShellEnv aasenv = new AdministrationShellEnv(); - private Package openPackage = null; - private List pendingFilesToAdd = new List(); - private List pendingFilesToDelete = new List(); - - public PackageEnv() - { - } - - public PackageEnv(AdministrationShellEnv env) - { - if (env != null) - this.aasenv = env; - } - - public PackageEnv(string fn) - { - Load(fn); - } - - public bool IsOpen - { - get - { - return openPackage != null; - } - } - - public string Filename - { - get - { - return fn; - } - } - - public AdminShellV10.AdministrationShellEnv AasEnv - { - get - { - return aasenv; - } - } - - public bool Load(string fn) - { - this.fn = fn; - if (this.openPackage != null) - this.openPackage.Close(); - this.openPackage = null; - - if (fn.ToLower().EndsWith(".xml")) - { - // load only XML - try - { - // TODO (Michael Hoffmeister, 1970-01-01): use aasenv serialzers here! - XmlSerializer serializer = new XmlSerializer( - typeof(AdminShellV10.AdministrationShellEnv), "http://www.admin-shell.io/aas/1/0"); - TextReader reader = new StreamReader(fn); - this.aasenv = serializer.Deserialize(reader) as AdminShellV10.AdministrationShellEnv; - if (this.aasenv == null) - throw (new Exception("Type error for XML file!")); - reader.Close(); - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While reading AAS {0} at {1} gave: {2}", fn, - AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - if (fn.ToLower().EndsWith(".json")) - { - // load only JSON - try - { - using (StreamReader file = System.IO.File.OpenText(fn)) - { - // TODO (Michael Hoffmeister, 1970-01-01): use aasenv serialzers here! - JsonSerializer serializer = new JsonSerializer(); - serializer.Converters.Add(new AdminShellV10.JsonAasxConverter("modelType", "name")); - this.aasenv = (AdministrationShellEnv)serializer.Deserialize( - file, typeof(AdministrationShellEnv)); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While reading AAS {0} at {1} gave: {2}", - fn, AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - if (fn.ToLower().EndsWith(".aasx")) - { - // load package AASX - try - { - var package = Package.Open(fn, FileMode.Open); - - // get the origin from the package - PackagePart originPart = null; - var xs = package.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - originPart = package.GetPart(x.TargetUri); - break; - } - if (originPart == null) - throw (new Exception(string.Format("Unable to find AASX origin. Aborting!"))); - - // get the specs from the package - PackagePart specPart = null; - xs = originPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-spec"); - foreach (var x in xs) - { - specPart = package.GetPart(x.TargetUri); - break; - } - if (specPart == null) - throw (new Exception(string.Format("Unable to find AASX spec(s). Aborting!"))); - - // open spec part to read - try - { - if (specPart.Uri.ToString().ToLower().Trim().EndsWith("json")) - { - using (var s = specPart.GetStream(FileMode.Open)) - { - using (StreamReader file = new StreamReader(s)) - { - JsonSerializer serializer = new JsonSerializer(); - serializer.Converters.Add( - new AdminShellV10.JsonAasxConverter("modelType", "name")); - this.aasenv = (AdministrationShellEnv)serializer.Deserialize( - file, typeof(AdministrationShellEnv)); - } - } - } - else - { - using (var s = specPart.GetStream(FileMode.Open)) - { - // own catch loop to be more specific - XmlSerializer serializer = new XmlSerializer( - typeof(AdminShellV10.AdministrationShellEnv), - "http://www.admin-shell.io/aas/1/0"); - this.aasenv = serializer.Deserialize(s) as AdminShellV10.AdministrationShellEnv; - this.openPackage = package; - if (this.aasenv == null) - throw (new Exception("Type error for XML file!")); - s.Close(); - } - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While reading AAS {0} spec at {1} gave: {2}", - fn, AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While reading AASX {0} at {1} gave: {2}", fn, - AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - // Don't know to handle - throw (new Exception(string.Format($"Not able to handle {fn}."))); - } - - public bool LoadFromAasEnvString(string content) - { - try - { - using (var file = new StringReader(content)) - { - // TODO (Michael Hoffmeister, 1970-01-01): use aasenv serialzers here! - JsonSerializer serializer = new JsonSerializer(); - serializer.Converters.Add(new AdminShellV10.JsonAasxConverter("modelType", "name")); - this.aasenv = (AdministrationShellEnv)serializer.Deserialize( - file, typeof(AdministrationShellEnv)); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While reading AASENV string {0} gave: {1}", - AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - public enum PreferredFormat { None, Xml, Json }; - - public bool SaveAs(string fn, bool writeFreshly = false, PreferredFormat prefFmt = PreferredFormat.None) - { - - if (fn.ToLower().EndsWith(".xml")) - { - // save only XML - this.fn = fn; - try - { - using (var s = new StreamWriter(this.fn)) - { - // TODO (Michael Hoffmeister, 1970-01-01): use aasenv serialzers here! - var serializer = new XmlSerializer(typeof(AdminShellV10.AdministrationShellEnv)); - var nss = new XmlSerializerNamespaces(); - nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - nss.Add("aas", "http://www.admin-shell.io/aas/1/0"); - nss.Add("IEC61360", "http://www.admin-shell.io/IEC61360/1/0"); - serializer.Serialize(s, this.aasenv, nss); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While writing AAS {0} at {1} gave: {2}", - fn, AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - if (fn.ToLower().EndsWith(".json")) - { - // save only JSON - // this funcitonality is a initial test - this.fn = fn; - try - { - using (var sw = new StreamWriter(fn)) - { - // TODO (Michael Hoffmeister, 1970-01-01): use aasenv serialzers here! - - sw.AutoFlush = true; - - JsonSerializer serializer = new JsonSerializer(); - serializer.NullValueHandling = NullValueHandling.Ignore; - serializer.ReferenceLoopHandling = ReferenceLoopHandling.Serialize; - serializer.Formatting = Newtonsoft.Json.Formatting.Indented; - using (JsonWriter writer = new JsonTextWriter(sw)) - { - serializer.Serialize(writer, this.aasenv); - } - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While writing AAS {0} at {1} gave: {2}", - fn, AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - if (fn.ToLower().EndsWith(".aasx")) - { - // save package AASX - try - { - // we want existing contents to be preserved, but no possiblity to change file name - // therefore: copy file to new name, re-open! - // fn could be changed, therefore close "old" package first - if (this.openPackage != null) - { - try - { - this.openPackage.Close(); - if (!writeFreshly) - System.IO.File.Copy(this.fn, fn); - } - catch { } - this.openPackage = null; - } - - // approach is to utilize the existing package, if possible. If not, create from scratch - var package = Package.Open(fn, (writeFreshly) ? FileMode.Create : FileMode.OpenOrCreate); - this.fn = fn; - - // get the origin from the package - PackagePart originPart = null; - var xs = package.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - originPart = package.GetPart(x.TargetUri); - break; - } - if (originPart == null) - { - // create, as not existing - originPart = package.CreatePart( - new Uri( - "/aasx/aasx-origin", UriKind.RelativeOrAbsolute), - System.Net.Mime.MediaTypeNames.Text.Plain, CompressionOption.Maximum); - using (var s = originPart.GetStream(FileMode.Create)) - { - var bytes = System.Text.Encoding.ASCII.GetBytes("Intentionally empty."); - s.Write(bytes, 0, bytes.Length); - } - package.CreateRelationship( - originPart.Uri, TargetMode.Internal, - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - } - - // get the specs from the package - PackagePart specPart = null; - PackageRelationship specRel = null; - xs = originPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-spec"); - foreach (var x in xs) - { - specRel = x; - specPart = package.GetPart(x.TargetUri); - break; - } - - // check, if we have to change the spec part - if (specPart != null && specRel != null) - { - var name = System.IO.Path.GetFileNameWithoutExtension( - specPart.Uri.ToString()).ToLower().Trim(); - var ext = System.IO.Path.GetExtension(specPart.Uri.ToString()).ToLower().Trim(); - if ((ext == ".json" && prefFmt == PreferredFormat.Xml) - || (ext == ".xml" && prefFmt == PreferredFormat.Json) - || (name.StartsWith("aasenv-with-no-id"))) - { - // try kill specpart - try - { - originPart.DeleteRelationship(specRel.Id); - package.DeletePart(specPart.Uri); - } - catch { } - finally { specPart = null; specRel = null; } - } - } - - if (specPart == null) - { - // create, as not existing - var frn = "aasenv-with-no-id"; - if (this.aasenv.AdministrationShells.Count > 0) - frn = this.aasenv.AdministrationShells[0].GetFriendlyName() ?? frn; - var aas_spec_fn = "/aasx/#/#.aas"; - if (prefFmt == PreferredFormat.Json) - aas_spec_fn += ".json"; - else - aas_spec_fn += ".xml"; - aas_spec_fn = aas_spec_fn.Replace("#", "" + frn); - specPart = package.CreatePart( - new Uri( - aas_spec_fn, UriKind.RelativeOrAbsolute), System.Net.Mime.MediaTypeNames.Text.Xml, - CompressionOption.Maximum); - originPart.CreateRelationship( - specPart.Uri, TargetMode.Internal, - "http://www.admin-shell.io/aasx/relationships/aas-spec"); - } - - // now, specPart shall be != null! - if (specPart.Uri.ToString().ToLower().Trim().EndsWith("json")) - { - using (var s = specPart.GetStream(FileMode.Create)) - { - JsonSerializer serializer = new JsonSerializer(); - serializer.NullValueHandling = NullValueHandling.Ignore; - serializer.ReferenceLoopHandling = ReferenceLoopHandling.Serialize; - serializer.Formatting = Newtonsoft.Json.Formatting.Indented; - using (var sw = new StreamWriter(s)) - { - using (JsonWriter writer = new JsonTextWriter(sw)) - { - serializer.Serialize(writer, this.aasenv); - } - } - } - } - else - { - using (var s = specPart.GetStream(FileMode.Create)) - { - var serializer = new XmlSerializer(typeof(AdminShellV10.AdministrationShellEnv)); - var nss = new XmlSerializerNamespaces(); - nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - nss.Add("aas", "http://www.admin-shell.io/aas/1/0"); - nss.Add("IEC61360", "http://www.admin-shell.io/IEC61360/1/0"); - serializer.Serialize(s, this.aasenv, nss); - } - } - - // there might be pending files to be deleted (first delete, then add, in case of identical - // files in both categories) - foreach (var psfDel in pendingFilesToDelete) - { - // try find an existing part for that file .. - var found = false; - - // normal files - xs = specPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-suppl"); - foreach (var x in xs) - if (x.TargetUri == psfDel.uri) - { - // try to delete - specPart.DeleteRelationship(x.Id); - package.DeletePart(psfDel.uri); - found = true; - break; - } - - // thumbnails - xs = package.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.TargetUri == psfDel.uri) - { - // try to delete - package.DeleteRelationship(x.Id); - package.DeletePart(psfDel.uri); - found = true; - break; - } - - if (!found) - throw (new Exception( - $"Not able to delete pending file {psfDel.uri} in saving package {fn}")); - } - - // after this, there are no more pending for delete files - pendingFilesToDelete.Clear(); - - // write pending supplementary files - foreach (var psfAdd in pendingFilesToAdd) - { - // make sure .. - if (psfAdd.sourcePath == null || - psfAdd.location != PackageSupplementaryFile.LocationType.AddPending) - continue; - - // normal file? - if (psfAdd.specialHandling == PackageSupplementaryFile.SpecialHandlingType.None) - { - - // try find an existing part for that file .. - PackagePart filePart = null; - xs = specPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-suppl"); - foreach (var x in xs) - if (x.TargetUri == psfAdd.uri) - { - filePart = package.GetPart(x.TargetUri); - break; - } - - if (filePart == null) - { - // create new part and link - filePart = package.CreatePart( - psfAdd.uri, AdminShellV10.PackageEnv.GuessMimeType(psfAdd.sourcePath), - CompressionOption.Maximum); - specPart.CreateRelationship( - filePart.Uri, TargetMode.Internal, - "http://www.admin-shell.io/aasx/relationships/aas-suppl"); - } - - // now should be able to write - using (var s = filePart.GetStream(FileMode.Create)) - { - var bytes = System.IO.File.ReadAllBytes(psfAdd.sourcePath); - s.Write(bytes, 0, bytes.Length); - } - } - - // thumbnail file? - if (psfAdd.specialHandling == - PackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail) - { - // try find an existing part for that file .. - PackagePart filePart = null; - xs = package.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/" && x.TargetUri == psfAdd.uri) - { - filePart = package.GetPart(x.TargetUri); - break; - } - - if (filePart == null) - { - // create new part and link - filePart = package.CreatePart( - psfAdd.uri, AdminShellV10.PackageEnv.GuessMimeType(psfAdd.sourcePath), - CompressionOption.Maximum); - package.CreateRelationship( - filePart.Uri, TargetMode.Internal, - "http://schemas.openxmlformats.org/package/2006/" + - "relationships/metadata/thumbnail"); - } - - // now should be able to write - using (var s = filePart.GetStream(FileMode.Create)) - { - var bytes = System.IO.File.ReadAllBytes(psfAdd.sourcePath); - s.Write(bytes, 0, bytes.Length); - } - } - } - - // after this, there are no more pending for add files - pendingFilesToAdd.Clear(); - - // flush, but leave open - package.Flush(); - this.openPackage = package; - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While write AASX {0} at {1} gave: {2}", - fn, AdminShellUtilV10.ShortLocation(ex), ex.Message))); - } - return true; - } - - // Don't know to handle - throw (new Exception(string.Format($"Not able to handle {fn}."))); - } - - private int BackupIndex = 0; - - public void BackupInDir(string backupDir, int maxFiles) - { - // access - if (backupDir == null || maxFiles < 1) - return; - - // we do it not caring on any errors - try - { - // get index in form - if (BackupIndex == 0) - { - // do not always start at 0!! - var rnd = new Random(); - BackupIndex = rnd.Next(maxFiles); - } - var ndx = BackupIndex % maxFiles; - BackupIndex += 1; - - // build a filename - var fn = Path.Combine(backupDir, $"backup{ndx:000}.xml"); - - // raw save - using (var s = new StreamWriter(fn)) - { - var serializer = new XmlSerializer(typeof(AdminShellV10.AdministrationShellEnv)); - var nss = new XmlSerializerNamespaces(); - nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - nss.Add("aas", "http://www.admin-shell.io/aas/1/0"); - nss.Add("IEC61360", "http://www.admin-shell.io/IEC61360/1/0"); - serializer.Serialize(s, this.aasenv, nss); - } - } - catch { } - } - - public Stream GetLocalStreamFromPackage(string uriString) - { - // access - if (this.openPackage == null) - throw (new Exception(string.Format($"AASX Package {this.fn} not opened. Aborting!"))); - var part = this.openPackage.GetPart(new Uri(uriString, UriKind.RelativeOrAbsolute)); - if (part == null) - throw (new Exception( - string.Format( - $"Cannot access URI {uriString} in {this.fn} not opened. Aborting!"))); - return part.GetStream(FileMode.Open); - } - - public long GetStreamSizeFromPackage(string uriString) - { - long res = 0; - try - { - if (this.openPackage == null) - return 0; - var part = this.openPackage.GetPart(new Uri(uriString, UriKind.RelativeOrAbsolute)); - if (part == null) - return 0; - using (var s = part.GetStream(FileMode.Open)) - { - res = s.Length; - } - } - catch { return 0; } - return res; - } - - public Stream GetLocalThumbnailStream(ref Uri thumbUri) - { - // access - if (this.openPackage == null) - throw (new Exception(string.Format($"AASX Package {this.fn} not opened. Aborting!"))); - // get the thumbnail over the relationship - PackagePart thumbPart = null; - var xs = this.openPackage.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - thumbPart = this.openPackage.GetPart(x.TargetUri); - thumbUri = x.TargetUri; - break; - } - if (thumbPart == null) - throw (new Exception(string.Format("Unable to find AASX thumbnail. Aborting!"))); - return thumbPart.GetStream(FileMode.Open); - } - - public Stream GetLocalThumbnailStream() - { - Uri dummy = null; - return GetLocalThumbnailStream(ref dummy); - } - - public List GetListOfSupplementaryFiles() - { - // new result - var result = new List(); - - // access - if (this.openPackage != null) - { - - // get the thumbnail(s) from the package - var xs = this.openPackage.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - result.Add(new PackageSupplementaryFile( - x.TargetUri, - location: PackageSupplementaryFile.LocationType.InPackage, - specialHandling: PackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail)); - } - - // get the origin from the package - PackagePart originPart = null; - xs = this.openPackage.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - originPart = this.openPackage.GetPart(x.TargetUri); - break; - } - - if (originPart != null) - { - // get the specs from the origin - PackagePart specPart = null; - xs = originPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-spec"); - foreach (var x in xs) - { - specPart = this.openPackage.GetPart(x.TargetUri); - break; - } - - if (specPart != null) - { - // get the supplementaries from the package, derived from spec - xs = specPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-suppl"); - foreach (var x in xs) - { - result.Add( - new PackageSupplementaryFile( - x.TargetUri, location: PackageSupplementaryFile.LocationType.InPackage)); - } - } - } - } - - // add or modify the files to delete - foreach (var psfDel in pendingFilesToDelete) - { - // already in - var found = result.Find(x => { return x.uri == psfDel.uri; }); - if (found != null) - found.location = PackageSupplementaryFile.LocationType.DeletePending; - else - { - psfDel.location = PackageSupplementaryFile.LocationType.DeletePending; - result.Add(psfDel); - } - } - - // add the files to store as well - foreach (var psfAdd in pendingFilesToAdd) - { - // already in (should not happen ?!) - var found = result.Find(x => { return x.uri == psfAdd.uri; }); - if (found != null) - found.location = PackageSupplementaryFile.LocationType.AddPending; - else - { - psfAdd.location = PackageSupplementaryFile.LocationType.AddPending; - result.Add(psfAdd); - } - } - - // done - return result; - } - - public static string GuessMimeType(string fn) - { - var file_ext = System.IO.Path.GetExtension(fn).ToLower().Trim(); - var content_type = System.Net.Mime.MediaTypeNames.Text.Plain; - if (file_ext == ".pdf") content_type = System.Net.Mime.MediaTypeNames.Application.Pdf; - if (file_ext == ".xml") content_type = System.Net.Mime.MediaTypeNames.Text.Xml; - if (file_ext == ".txt") content_type = System.Net.Mime.MediaTypeNames.Text.Plain; - if (file_ext == ".igs") content_type = "application/iges"; - if (file_ext == ".iges") content_type = "application/iges"; - if (file_ext == ".stp") content_type = "application/step"; - if (file_ext == ".step") content_type = "application/step"; - if (file_ext == ".jpg") content_type = System.Net.Mime.MediaTypeNames.Image.Jpeg; - if (file_ext == ".jpeg") content_type = System.Net.Mime.MediaTypeNames.Image.Jpeg; - if (file_ext == ".png") content_type = "image/png"; - if (file_ext == ".gif") content_type = System.Net.Mime.MediaTypeNames.Image.Gif; - return content_type; - } - - public void AddSupplementaryFileToStore( - string sourcePath, string targetDir, string targetFn, bool embedAsThumb) - { - // beautify parameters - sourcePath = sourcePath.Trim(); - targetDir = targetDir.Trim(); - if (!targetDir.EndsWith("/")) - targetDir += "/"; - targetDir = targetDir.Replace(@"\", "/"); - targetFn = targetFn.Trim(); - if (sourcePath == "" || targetDir == "" || targetFn == "") - throw (new Exception(string.Format("Trying add supplementary file with empty name or path!"))); - - var file_fn = "" + targetDir.Trim() + targetFn.Trim(); - - // add record - pendingFilesToAdd.Add( - new PackageSupplementaryFile( - new Uri(file_fn, UriKind.RelativeOrAbsolute), - sourcePath, - location: PackageSupplementaryFile.LocationType.AddPending, - specialHandling: ( - embedAsThumb - ? PackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail - : PackageSupplementaryFile.SpecialHandlingType.None) - )); - } - - public void DeleteSupplementaryFile(PackageSupplementaryFile psf) - { - if (psf == null) - throw (new Exception(string.Format("No supplementary file given!"))); - - if (psf.location == PackageSupplementaryFile.LocationType.AddPending) - { - // is still pending in add list -> remove - pendingFilesToAdd.RemoveAll((x) => { return x.uri == psf.uri; }); - } - - if (psf.location == PackageSupplementaryFile.LocationType.InPackage) - { - // add to pending delete list - pendingFilesToDelete.Add(psf); - } - } - - public void Close() - { - if (this.openPackage != null) - this.openPackage.Close(); - this.openPackage = null; - this.fn = ""; - this.aasenv = null; - } - } - - } - - #endregion -} - -#endif diff --git a/src/AasxCsharpLibrary/AasxCompatibilityModels/V20/AdminShell.cs b/src/AasxCsharpLibrary/AasxCompatibilityModels/V20/AdminShell.cs deleted file mode 100644 index 045199144..000000000 --- a/src/AasxCsharpLibrary/AasxCompatibilityModels/V20/AdminShell.cs +++ /dev/null @@ -1,8895 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using System.Xml; -using System.Xml.Serialization; -using AdminShell_V20; -using Newtonsoft.Json; - -//namespace AdminShellNS -//namespace AdminShell_V20 -namespace AasxCompatibilityModels -{ - /// - /// This empty class derives always from the current version of the Administration Shell class hierarchy. - /// - public class AdminShell : AdminShellV20 { } - - #region AdminShell_V2_0 - - /// - /// Version of Details of Administration Shell Part 1 V1.0 published Nov/Dec/Jan 2018/19 - /// - public class AdminShellV20 - { - public class Identification - { - - // members - - [XmlAttribute] - [CountForHash] - public string idType = ""; - - [XmlText] - [CountForHash] - public string id = ""; - - // some constants - - public static string IRDI = "IRDI"; - public static string IRI = "IRI"; - public static string IdShort = "IdShort"; - - // constructors - - public Identification() { } - - public Identification(Identification src) - { - this.idType = src.idType; - this.id = src.id; - } - -#if !DoNotUseAasxCompatibilityModels - public Identification(AasxCompatibilityModels.AdminShellV10.Identification src) - { - this.idType = src.idType; - if (this.idType.Trim().ToLower() == "uri") - this.idType = Identification.IRI; - this.id = src.id; - } -#endif - - public Identification(string idType, string id) - { - this.idType = idType; - this.id = id; - } - - public Identification(Key key) - { - this.idType = key.idType; - this.id = key.value; - } - - // Creator with validation - - public static Identification CreateNew(string idType, string id) - { - if (idType == null || id == null) - return null; - var found = false; - foreach (var x in Key.IdentifierTypeNames) - found = found || idType.ToLower().Trim() == x.ToLower().Trim(); - if (!found) - return null; - return new Identification(idType, id); - } - - // further - - public bool IsEqual(Identification other) - { - return (this.idType.Trim().ToLower() == other.idType.Trim().ToLower() - && this.id.Trim().ToLower() == other.id.Trim().ToLower()); - } - - public bool IsIRI() - { - return idType?.Trim().ToUpper() == "URI" - || idType?.Trim().ToUpper() == IRI; - } - - public bool IsIRDI() - { - return idType?.Trim().ToUpper() == IRDI; - } - - public override string ToString() - { - return $"[{this.idType}] {this.id}"; - } - } - - public class Administration - { - - // members - - [MetaModelName("Administration.version")] - [TextSearchable] - [CountForHash] - public string version = ""; - - [MetaModelName("Administration.revision")] - [TextSearchable] - [CountForHash] - public string revision = ""; - - // constructors - - public Administration() { } - - public Administration(Administration src) - { - this.version = src.version; - this.revision = src.revision; - } - -#if !DoNotUseAasxCompatibilityModels - public Administration(AasxCompatibilityModels.AdminShellV10.Administration src) - { - this.version = src.version; - this.revision = src.revision; - } -#endif - - public Administration(string version, string revision) - { - this.version = version; - this.revision = revision; - } - - public override string ToString() - { - return $"R={this.version}, V={this.revision}"; - } - } - - public class Key - { - // Constants - - public enum MatchMode { Strict, Relaxed, Identification }; - - // Members - - [MetaModelName("Key.type")] - [TextSearchable] - [XmlAttribute] - [CountForHash] - public string type = ""; - - [XmlAttribute] - [CountForHash] - public bool local = false; - - [MetaModelName("Key.idType")] - [TextSearchable] - [XmlAttribute] - [JsonIgnore] - [CountForHash] - public string idType = ""; - - [XmlIgnore] - [JsonProperty(PropertyName = "idType")] - public string JsonIdType - { - // adapt idShort <-> IdShort - get => (idType == "idShort") ? "IdShort" : idType; - set => idType = (value == "idShort") ? "IdShort" : value; - } - - [MetaModelName("Key.value")] - [TextSearchable] - [XmlText] - [CountForHash] - public string value = ""; - - [XmlIgnore] - [JsonProperty(PropertyName = "index")] - [CountForHash] - public int index = 0; - - public Key() - { - } - - public Key(Key src) - { - this.type = src.type; - this.local = src.local; - this.idType = src.idType; - this.value = src.value; - } - -#if !DoNotUseAasxCompatibilityModels - public Key(AasxCompatibilityModels.AdminShellV10.Key src) - { - this.type = src.type; - this.local = src.local; - this.idType = src.idType; - if (this.idType.Trim().ToLower() == "uri") - this.idType = Identification.IRI; - if (this.idType.Trim().ToLower() == "idshort") - this.idType = Identification.IdShort; - this.value = src.value; - } -#endif - - public Key(string type, bool local, string idType, string value) - { - this.type = type; - this.local = local; - this.idType = idType; - this.value = value; - } - - public static Key CreateNew(string type, bool local, string idType, string value) - { - var k = new Key() - { - type = type, - local = local, - idType = idType, - value = value - }; - return (k); - } - - public static Key GetFromRef(Reference r) - { - if (r == null || r.Count != 1) - return null; - return r[0]; - } - - public Identification ToId() - { - return new Identification(this); - } - - public string ToString(int format = 0) - { - if (format == 1) - { - return String.Format( - "({0})({1})[{2}]{3}", this.type, this.local ? "local" : "no-local", this.idType, this.value); - } - if (format == 2) - { - return String.Format("[{0}]{1}", this.idType, this.value); - } - - // (old) default - var tlc = (this.local) ? "Local" : "not Local"; - return $"[{this.type}, {tlc}, {this.idType}, {this.value}]"; - } - - public static Key Parse(string cell, string typeIfNotSet = null, - bool allowFmtAll = false, bool allowFmt0 = false, - bool allowFmt1 = false, bool allowFmt2 = false) - { - // access and defaults? - if (cell == null || cell.Trim().Length < 1) - return null; - if (typeIfNotSet == null) - typeIfNotSet = Key.GlobalReference; - - // format == 1 - if (allowFmtAll || allowFmt1) - { - var m = Regex.Match(cell, @"\((\w+)\)\((\S+)\)\[(\w+)\]( ?)(.*)$"); - if (m.Success) - { - return new AdminShell.Key( - m.Groups[1].ToString(), m.Groups[2].ToString() == "local", - m.Groups[3].ToString(), m.Groups[5].ToString()); - } - } - - // format == 2 - if (allowFmtAll || allowFmt2) - { - var m = Regex.Match(cell, @"\[(\w+)\]( ?)(.*)$"); - if (m.Success) - { - return new AdminShell.Key( - typeIfNotSet, true, - m.Groups[1].ToString(), m.Groups[3].ToString()); - } - } - - // format == 0 - if (allowFmtAll || allowFmt0) - { - var m = Regex.Match(cell, @"\[(\w+),( ?)([^,]+),( ?)\[(\w+)\],( ?)(.*)\]"); - if (m.Success) - { - return new AdminShell.Key( - m.Groups[1].ToString(), !m.Groups[3].ToString().Contains("not"), - m.Groups[5].ToString(), m.Groups[7].ToString()); - } - } - - // no - return null; - } - - public static string KeyListToString(List keys) - { - if (keys == null || keys.Count < 1) - return ""; - // normally, exactly one key - if (keys.Count == 1) - return keys[0].ToString(); - // multiple! - var s = "[ "; - foreach (var k in keys) - { - if (s.Length > 0) - s += ", "; - s += k.ToString(); - } - return s + " ]"; - } - - public static string[] KeyElements = new string[] { - "GlobalReference", - "FragmentReference", - "AccessPermissionRule", - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel", - "SubmodelRef", // not completely right, but used by Package Explorer - "Blob", - "ConceptDictionary", - "DataElement", - "File", - "Operation", - "OperationVariable", - "BasicEvent", - "Entity", - "Property", - "MultiLanguageProperty", - "Range", - "ReferenceElement", - "RelationshipElement", - "AnnotatedRelationshipElement", - "Capability", - "SubmodelElement", - "SubmodelElementCollection", - "View" }; - - public static string[] ReferableElements = new string[] { - "AccessPermissionRule", - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel", - "Blob", - "ConceptDictionary", - "DataElement", - "File", - "Operation", - "OperationVariable", - "Entity", - "BasicEvent", - "Property", - "MultiLanguageProperty", - "Range", - "ReferenceElement", - "RelationshipElement", - "AnnotatedRelationshipElement", - "Capability", - "SubmodelElement", - "SubmodelElementCollection", - "View" }; - - public static string[] SubmodelElements = new string[] { - "DataElement", - "File", - "Event", - "Operation", - "Property", - "MultiLanguageProperty", - "Range", - "ReferenceElement", - "RelationshipElement", - "AnnotatedRelationshipElement", - "Capability", - "BasicEvent", - "Entity", - "SubmodelElementCollection"}; - - public static string[] IdentifiableElements = new string[] { - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel" }; - - // use this in list to designate all of the above elements - public static string AllElements = "All"; - - // use this in list to designate the GlobalReference - // Resharper disable MemberHidesStaticFromOuterClass - public static string GlobalReference = "GlobalReference"; - public static string FragmentReference = "FragmentReference"; - public static string ConceptDescription = "ConceptDescription"; - public static string SubmodelRef = "SubmodelRef"; - public static string Submodel = "Submodel"; - public static string SubmodelElement = "SubmodelElement"; - public static string Asset = "Asset"; - public static string AAS = "AssetAdministrationShell"; - public static string Entity = "Entity"; - public static string View = "View"; - // Resharper enable MemberHidesStaticFromOuterClass - - public static string[] IdentifierTypeNames = new string[] { - Identification.IdShort, "FragmentId", "Custom", Identification.IRDI, Identification.IRI }; - - public enum IdentifierType { IdShort = 0, FragmentId, Custom, IRDI, IRI }; - - public static string GetIdentifierTypeName(IdentifierType t) - { - return IdentifierTypeNames[(int)t]; - } - - public static string IdShort = "IdShort"; - public static string FragmentId = "FragmentId"; - public static string Custom = "Custom"; - - // some helpers - - public static bool IsInKeyElements(string ke) - { - var res = false; - foreach (var s in KeyElements) - if (s.Trim().ToLower() == ke.Trim().ToLower()) - res = true; - return res; - } - - public bool IsIdType(string[] value) - { - if (value == null || idType == null || idType.Trim() == "") - return false; - return value.Contains(idType.Trim()); - } - - public bool IsIdType(string value) - { - if (value == null || idType == null || idType.Trim() == "") - return false; - return value.Trim().Equals(idType.Trim()); - } - - public bool IsType(string value) - { - if (value == null || type == null || type.Trim() == "") - return false; - return value.Trim().ToLower().Equals(type.Trim().ToLower()); - } - - public bool IsAbsolute() - { - return IsType(Key.GlobalReference) - || IsType(Key.AAS) - || IsType(Key.Asset) - || IsType(Key.Submodel); - } - - public bool Matches( - string type, bool local, string idType, string id, MatchMode matchMode = MatchMode.Strict) - { - if (matchMode == MatchMode.Strict) - return this.type == type && this.local == local && this.idType == idType && this.value == id; - - if (matchMode == MatchMode.Relaxed) - return (this.type == type || this.type == Key.GlobalReference || type == Key.GlobalReference) - && this.idType == idType && this.value == id; - - if (matchMode == MatchMode.Identification) - return this.idType == idType && this.value == id; - - return false; - } - - public bool Matches(Identification id) - { - if (id == null) - return false; - return this.Matches(Key.GlobalReference, false, id.idType, id.id, MatchMode.Identification); - } - - public bool Matches(Key key, MatchMode matchMode = MatchMode.Strict) - { - if (key == null) - return false; - return this.Matches(key.type, key.local, key.idType, key.value, matchMode); - } - - // validation - - public static AasValidationAction Validate(AasValidationRecordList results, Key k, Referable container) - { - // access - if (results == null || container == null) - return AasValidationAction.No; - - var res = AasValidationAction.No; - - // check - if (k == null) - { - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SpecViolation, container, - "Key: is null", - () => - { - res = AasValidationAction.ToBeDeleted; - })); - } - else - { - // check IdType - var idf = AdminShellUtilV20.CheckIfInConstantStringArray(IdentifierTypeNames, k.idType); - if (idf == AdminShellUtilV20.ConstantFoundEnum.No) - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - "Key: idType is not in allowed enumeration values", - () => - { - k.idType = Custom; - })); - if (idf == AdminShellUtilV20.ConstantFoundEnum.AnyCase) - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - "Key: idType in wrong casing", - () => - { - k.idType = AdminShellUtilV20.CorrectCasingForConstantStringArray( - IdentifierTypeNames, k.idType); - })); - - // check type - var tf = AdminShellUtilV20.CheckIfInConstantStringArray(KeyElements, k.type); - if (tf == AdminShellUtilV20.ConstantFoundEnum.No) - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - "Key: type is not in allowed enumeration values", - () => - { - k.type = GlobalReference; - })); - if (tf == AdminShellUtilV20.ConstantFoundEnum.AnyCase) - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - "Key: type in wrong casing", - () => - { - k.idType = AdminShellUtilV20.CorrectCasingForConstantStringArray( - KeyElements, k.type); - })); - } - - // may give result "to be deleted" - return res; - } - } - - public class KeyList : List - { - // getters / setters - - [XmlIgnore] - public bool IsEmpty { get { return this.Count < 1; } } - - // constructors / creators - - public KeyList() { } - - public KeyList(KeyList src) - { - if (src != null) - foreach (var k in src) - this.Add(new Key(k)); - } - - public static KeyList CreateNew(Key k) - { - var kl = new KeyList { k }; - return kl; - } - - public static KeyList CreateNew(string type, bool local, string idType, string value) - { - var kl = new KeyList() { - Key.CreateNew(type, local, idType, value) - }; - return kl; - } - - public static KeyList CreateNew(string type, bool local, string idType, string[] valueItems) - { - // access - if (valueItems == null) - return null; - - // prepare - var kl = new AdminShell.KeyList(); - foreach (var x in valueItems) - kl.Add(new AdminShell.Key(type, local, idType, "" + x)); - return kl; - } - - // matches - - public bool Matches(KeyList other, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (other == null || other.Count != this.Count) - return false; - - var same = true; - for (int i = 0; i < this.Count; i++) - same = same && this[i].Matches(other[i], matchMode); - - return same; - } - - // other - - public void NumberIndices() - { - for (int i = 0; i < this.Count; i++) - this[i].index = i; - } - - public string ToString(int format = 0, string delimiter = ",") - { - var res = string.Join(delimiter, this.Select((k) => k.ToString(format))); - return res; - } - - public static KeyList Parse(string input) - { - // access - if (input == null) - return null; - - // split - var parts = input.Split(',', ';'); - var kl = new KeyList(); - - foreach (var p in parts) - { - var k = Key.Parse(p); - if (k != null) - kl.Add(k); - } - - return kl; - } - - public string MostSignificantInfo() - { - if (this.Count < 1) - return "-"; - var i = this.Count - 1; - var res = this[i].value; - if (this[i].IsIdType(new[] { Key.FragmentId }) && i > 0) - res += this[i - 1].value; - return res; - } - - // validation - - public static void Validate(AasValidationRecordList results, KeyList kl, - Referable container) - { - // access - if (results == null || kl == null || container == null) - return; - - // iterate thru - var idx = 0; - while (idx < kl.Count) - { - var act = Key.Validate(results, kl[idx], container); - if (act == AasValidationAction.ToBeDeleted) - { - kl.RemoveAt(idx); - continue; - } - idx++; - } - } - - public bool StartsWith(KeyList head, bool emptyIsTrue = false, - Key.MatchMode matchMode = Key.MatchMode.Strict) - { - // access - if (head == null) - return false; - if (head.Count == 0) - return emptyIsTrue; - - // simply test element-wise - for (int i = 0; i < head.Count; i++) - { - // does head have more elements than this list? - if (i >= this.Count) - return false; - - if (!head[i].Matches(this[i], matchMode)) - return false; - } - - // ok! - return true; - } - - // arithmetics - - public static KeyList operator +(KeyList a, Key b) - { - var res = new KeyList(a); - if (b != null) - res.Add(b); - return res; - } - - public static KeyList operator +(KeyList a, KeyList b) - { - var res = new KeyList(a); - if (b != null) - res.AddRange(b); - return res; - } - - public KeyList SubList(int startPos, int count = int.MaxValue) - { - var res = new KeyList(); - if (startPos >= this.Count) - return res; - int nr = 0; - for (int i = startPos; i < this.Count && nr < count; i++) - { - nr++; - res.Add(this[i]); - } - return res; - } - - public KeyList ReplaceLastKey(KeyList newKeys) - { - var res = new KeyList(this); - if (res.Count < 1 || newKeys == null || newKeys.Count < 1) - return res; - - res.Remove(res.Last()); - res = res + newKeys; - - return res; - } - - // other - - /// - /// Take only idShort, ignore all other key-types and create a '/'-separated list - /// - /// Empty string or list of idShorts - public string BuildIdShortPath(int startPos = 0, int count = int.MaxValue) - { - if (startPos >= this.Count) - return ""; - int nr = 0; - var res = ""; - for (int i = startPos; i < this.Count && nr < count; i++) - { - nr++; - if (this[i].idType.Trim().ToLower() == Key.IdShort.Trim().ToLower()) - { - if (res != "") - res += "/"; - res += this[i].value; - } - } - return res; - } - } - - public class AasElementSelfDescription - { - public string ElementName = ""; - public string ElementAbbreviation = ""; - public SubmodelElementWrapper.AdequateElementEnum ElementEnum = - SubmodelElementWrapper.AdequateElementEnum.Unknown; - - public AasElementSelfDescription() { } - - public AasElementSelfDescription( - string ElementName, string ElementAbbreviation, - SubmodelElementWrapper.AdequateElementEnum elementEnum - = SubmodelElementWrapper.AdequateElementEnum.Unknown) - { - this.ElementName = ElementName; - this.ElementAbbreviation = ElementAbbreviation; - this.ElementEnum = elementEnum; - } - } - - /// - /// Extends understanding of Referable to further elements, which can be related to - /// - public interface IAasElement - { - AasElementSelfDescription GetSelfDescription(); - string GetElementName(); - } - - [XmlType(TypeName = "reference")] - public class Reference : IAasElement - { - - // members - - [XmlIgnore] // anyway, as it is private - [JsonIgnore] - private KeyList keys = new KeyList(); - - // getters / setters - - [XmlArray("keys")] - [XmlArrayItem("key")] - [JsonIgnore] - public KeyList Keys { get { return keys; } } - [XmlIgnore] - [JsonProperty(PropertyName = "keys")] - public KeyList JsonKeys - { - get - { - keys?.NumberIndices(); - return keys; - } - } - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return keys == null || keys.Count < 1; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (keys == null) return 0; return keys.Count; } } - [XmlIgnore] - [JsonIgnore] - public Key this[int index] { get { return keys[index]; } } - - [XmlIgnore] - [JsonIgnore] - public Key First { get { return this.Count < 1 ? null : this.keys[0]; } } - - [XmlIgnore] - [JsonIgnore] - public Key Last { get { return this.Count < 1 ? null : this.keys[this.keys.Count - 1]; } } - - // constructors / creators - - public Reference() - { - } - - public Reference(Key k) - { - if (k != null) - keys.Add(k); - } - - public Reference(Reference src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(new Key(k)); - } - -#if !DoNotUseAasxCompatibilityModels - public Reference(AasxCompatibilityModels.AdminShellV10.Reference src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(new Key(k)); - } -#endif - - public Reference(SemanticId src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(new Key(k)); - } - -#if !DoNotUseAasxCompatibilityModels - public Reference(AasxCompatibilityModels.AdminShellV10.SemanticId src) - { - if (src != null) - foreach (var k in src.Keys) - keys.Add(new Key(k)); - } -#endif - public static Reference CreateNew(Key k) - { - if (k == null) - return null; - var r = new Reference(); - r.keys.Add(k); - return r; - } - - public static Reference CreateNew(List k) - { - if (k == null) - return null; - var r = new Reference(); - r.keys.AddRange(k); - return r; - } - - public static Reference CreateNew(string type, bool local, string idType, string value) - { - if (type == null || idType == null || value == null) - return null; - var r = new Reference(); - r.keys.Add(Key.CreateNew(type, local, idType, value)); - return r; - } - - public static Reference CreateIrdiReference(string irdi) - { - if (irdi == null) - return null; - var r = new Reference(); - r.keys.Add(new Key(Key.GlobalReference, false, Identification.IRDI, irdi)); - return r; - } - - // additions - - public static Reference operator +(Reference a, Key b) - { - var res = new Reference(a); - res.Keys?.Add(b); - return res; - } - - public static Reference operator +(Reference a, Reference b) - { - var res = new Reference(a); - res.Keys?.AddRange(b?.Keys); - return res; - } - - // further - - public Key GetAsExactlyOneKey() - { - if (keys == null || keys.Count != 1) - return null; - var k = keys[0]; - return new Key(k.type, k.local, k.idType, k.value); - } - - public bool MatchesExactlyOneKey( - string type, bool local, string idType, string id, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (keys == null || keys.Count != 1) - return false; - var k = keys[0]; - return k.Matches(type, local, idType, id, matchMode); - } - - public bool MatchesExactlyOneKey(Key key, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (key == null) - return false; - return this.MatchesExactlyOneKey(key.type, key.local, key.idType, key.value, matchMode); - } - - public bool Matches( - string type, bool local, string idType, string id, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (this.Count == 1) - { - var k = keys[0]; - return k.Matches(type, local, idType, id, matchMode); - } - return false; - } - - public bool Matches(Key key, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (this.Count == 1) - { - var k = keys[0]; - return k.Matches(key, matchMode); - } - return false; - } - - public bool Matches(Identification other) - { - if (other == null) - return false; - if (this.Count == 1) - { - var k = keys[0]; - return k.Matches(Key.GlobalReference, false, other.idType, other.id, Key.MatchMode.Identification); - } - return false; - } - - public bool Matches(Reference other, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (this.keys == null || other == null || other.keys == null || other.Count != this.Count) - return false; - - var same = true; - for (int i = 0; i < this.Count; i++) - same = same && this.keys[i].Matches(other.keys[i], matchMode); - - return same; - } - - public bool Matches(SemanticId other, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - return Matches(new Reference(other), matchMode); - } - - public bool Matches(ConceptDescription cd, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - return Matches(cd?.GetReference(), matchMode); - } - - public string ToString(int format = 0, string delimiter = ",") - { - return keys?.ToString(format, delimiter); - } - - public static Reference Parse(string input) - { - return CreateNew(KeyList.Parse(input)); - } - - public string ListOfValues(string delim) - { - string res = ""; - if (this.Keys != null) - foreach (var x in this.Keys) - { - if (x == null) - continue; - if (res != "") res += delim; - res += x.value; - } - return res; - } - - // self description - - public virtual AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Reference", "Rfc"); - } - - public virtual string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - } - - [XmlType(TypeName = "derivedFrom")] - public class AssetAdministrationShellRef : Reference - { - // constructors - - public AssetAdministrationShellRef() : base() { } - - public AssetAdministrationShellRef(Key k) : base(k) { } - - public AssetAdministrationShellRef(Reference src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public AssetAdministrationShellRef(AasxCompatibilityModels.AdminShellV10.Reference src) : base(src) { } -#endif - - // further methods - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("AssetAdministrationShellRef", "AasRef"); - } - } - - [XmlType(TypeName = "assetRef")] - public class AssetRef : Reference - { - // constructors - - public AssetRef() : base() { } - - public AssetRef(AssetRef src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public AssetRef(AasxCompatibilityModels.AdminShellV10.AssetRef src) : base(src) { } -#endif - - public AssetRef(Reference r) - : base(r) - { - } - - // further methods - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("AssetRef", "AssetRef"); - } - } - - [XmlType(TypeName = "submodelRef")] - public class SubmodelRef : Reference - { - // constructors - - public SubmodelRef() : base() { } - - public SubmodelRef(SubmodelRef src) : base(src) { } - - public SubmodelRef(Reference src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public SubmodelRef(AasxCompatibilityModels.AdminShellV10.SubmodelRef src) : base(src) { } -#endif - - public new static SubmodelRef CreateNew(string type, bool local, string idType, string value) - { - var r = new SubmodelRef(); - r.Keys.Add(Key.CreateNew(type, local, idType, value)); - return r; - } - - public static SubmodelRef CreateNew(Reference src) - { - if (src == null || src.Keys == null) - return null; - var r = new SubmodelRef(); - r.Keys.AddRange(src.Keys); - return r; - } - - // further methods - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("SubmodelRef", "SMRef"); - } - } - - [XmlType(TypeName = "conceptDescriptionRef")] - public class ConceptDescriptionRef : Reference - { - // constructors - - public ConceptDescriptionRef() : base() { } - - public ConceptDescriptionRef(ConceptDescriptionRef src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public ConceptDescriptionRef( - AasxCompatibilityModels.AdminShellV10.ConceptDescriptionRef src) : base(src) { } -#endif - - // further methods - - public new static ConceptDescriptionRef CreateNew(string type, bool local, string idType, string value) - { - var r = new ConceptDescriptionRef(); - r.Keys.Add(Key.CreateNew(type, local, idType, value)); - return r; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("ConceptDescriptionRef", "CDRef"); - } - - } - - [XmlType(TypeName = "dataSpecificationRef")] - public class DataSpecificationRef : Reference - { - // constructors - - public DataSpecificationRef() : base() { } - - public DataSpecificationRef(DataSpecificationRef src) : base(src) { } - - public DataSpecificationRef(Reference src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public DataSpecificationRef(AasxCompatibilityModels.AdminShellV10.DataSpecificationRef src) : base(src) { } - - public DataSpecificationRef(AasxCompatibilityModels.AdminShellV10.Reference src) : base(src) { } -#endif - - // further methods - - public static DataSpecificationRef CreateNew(Reference src) - { - if (src == null || src.Keys == null) - return null; - var res = new DataSpecificationRef(); - foreach (var k in src.Keys) - res.Keys.Add(new Key(k)); - return res; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("DataSpecificationRef", "DSRef"); - } - - } - - [XmlType(TypeName = "conceptDescriptions")] - public class ConceptDescriptionRefs - { - [XmlElement(ElementName = "conceptDescriptionRef")] - public List conceptDescriptions = new List(); - - // constructors - - public ConceptDescriptionRefs() { } - - public ConceptDescriptionRefs(ConceptDescriptionRefs src) - { - if (src.conceptDescriptions != null) - foreach (var cdr in src.conceptDescriptions) - this.conceptDescriptions.Add(new ConceptDescriptionRef(cdr)); - } - -#if !DoNotUseAasxCompatibilityModels - public ConceptDescriptionRefs(AasxCompatibilityModels.AdminShellV10.ConceptDescriptionRefs src) - { - if (src.conceptDescriptions != null) - foreach (var cdr in src.conceptDescriptions) - this.conceptDescriptions.Add(new ConceptDescriptionRef(cdr)); - } -#endif - } - - [XmlType(TypeName = "containedElementRef")] - public class ContainedElementRef : Reference - { - // constructors - - public ContainedElementRef() { } - - public ContainedElementRef(ContainedElementRef src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public ContainedElementRef(AasxCompatibilityModels.AdminShellV10.ContainedElementRef src) : base(src) { } -#endif - - public static ContainedElementRef CreateNew(Reference src) - { - if (src == null || src.Keys == null) - return null; - var r = new ContainedElementRef(); - r.Keys.AddRange(src.Keys); - return r; - } - - // further methods - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("ContainedElementRef", "CERef"); - } - - } - -#if __not_valid_anymore - [XmlType(TypeName = "hasDataSpecification")] - public class HasDataSpecification - { - [XmlElement(ElementName = "reference")] // make "reference" go away by magic?! - public List reference = new List(); - - public HasDataSpecification() { } - - public HasDataSpecification(HasDataSpecification src) - { - foreach (var r in src.reference) - reference.Add(new Reference(r)); - } - -#if !DoNotUseAasxCompatibilityModels - public HasDataSpecification(AasxCompatibilityModels.AdminShellV10.HasDataSpecification src) - { - foreach (var r in src.reference) - reference.Add(new Reference(r)); - } -#endif - } -#else - // Note: In versions prior to V2.0.1, the SDK has "HasDataSpecification" containing only a Reference. - // Iv 2.0.1, theoretically each entity with HasDataSpecification could also conatin a - // EmbeddedDataSpecification. - - [XmlType(TypeName = "hasDataSpecification")] - public class HasDataSpecification : List - { - public HasDataSpecification() { } - - public HasDataSpecification(HasDataSpecification src) - { - foreach (var r in src) - this.Add(new EmbeddedDataSpecification(r)); - } - - public HasDataSpecification(IEnumerable src) - { - foreach (var r in src) - this.Add(new EmbeddedDataSpecification(r)); - } - -#if !DoNotUseAasxCompatibilityModels - public HasDataSpecification(AasxCompatibilityModels.AdminShellV10.HasDataSpecification src) - { - foreach (var r in src.reference) - this.Add(new EmbeddedDataSpecification(r)); - } -#endif - - // make some explicit and easy to use getter, setters - - [XmlIgnore] - [JsonIgnore] - public EmbeddedDataSpecification IEC61360 - { - get - { - foreach (var eds in this) - if (eds?.dataSpecificationContent?.dataSpecificationIEC61360 != null - || eds?.dataSpecification?.MatchesExactlyOneKey( - DataSpecificationIEC61360.GetKey(), Key.MatchMode.Identification) == true) - return eds; - return null; - } - set - { - // search existing first? - var eds = this.IEC61360; - if (eds != null) - { - // replace this - /* TODO (MIHO, 2020-08-30): this does not prevent the corner case, that we could have - * multiple dataSpecificationIEC61360 in this list, which would be an error */ - this.Remove(eds); - this.Add(value); - return; - } - - // no? .. add! - this.Add(value); - } - } - - [XmlIgnore] - [JsonIgnore] - public DataSpecificationIEC61360 IEC61360Content - { - get - { - return this.IEC61360?.dataSpecificationContent?.dataSpecificationIEC61360; - } - set - { - // search existing first? - var eds = this.IEC61360; - if (eds != null) - { - // replace this - eds.dataSpecificationContent.dataSpecificationIEC61360 = value; - return; - } - // no? .. add! - var edsnew = new EmbeddedDataSpecification(); - edsnew.dataSpecificationContent.dataSpecificationIEC61360 = value; - this.Add(edsnew); - } - } - - } -#endif - - [XmlType(TypeName = "ContainedElements")] - public class ContainedElements - { - - // members - - [XmlElement(ElementName = "containedElementRef")] // make "reference" go away by magic?! - public List reference = new List(); - - // getter / setter - - public bool IsEmpty { get { return reference == null || reference.Count < 1; } } - public int Count { get { if (reference == null) return 0; return reference.Count; } } - public ContainedElementRef this[int index] { get { return reference[index]; } } - - // Creators - - public ContainedElements() { } - - public ContainedElements(ContainedElements src) - { - if (src.reference != null) - foreach (var r in src.reference) - this.reference.Add(new ContainedElementRef(r)); - } - -#if !DoNotUseAasxCompatibilityModels - public ContainedElements(AasxCompatibilityModels.AdminShellV10.ContainedElements src) - { - if (src.reference != null) - foreach (var r in src.reference) - this.reference.Add(new ContainedElementRef(r)); - } -#endif - - public static ContainedElements CreateOrSetInner(ContainedElements outer, ContainedElementRef[] inner) - { - var res = outer; - if (res == null) - res = new ContainedElements(); - if (inner == null) - { - res.reference = null; - return res; - } - res.reference = new List(inner); - return res; - } - - } - - [XmlType(TypeName = "langString", Namespace = "http://www.admin-shell.io/2/0")] - public class LangStr - { - // constants - public static string LANG_DEFAULT = "en"; - - // members - - [MetaModelName("LangStr.lang")] - [TextSearchable] - [XmlAttribute(Namespace = "http://www.admin-shell.io/2/0")] - [JsonProperty(PropertyName = "language")] - [CountForHash] - public string lang = ""; - - [MetaModelName("LangStr.str")] - [TextSearchable] - [XmlText] - [JsonProperty(PropertyName = "text")] - [CountForHash] - public string str = ""; - - // constructors - - public LangStr() { } - - public LangStr(LangStr src) - { - this.lang = src.lang; - this.str = src.str; - } - -#if !DoNotUseAasxCompatibilityModels - public LangStr(AasxCompatibilityModels.AdminShellV10.LangStr src) - { - this.lang = src.lang; - this.str = src.str; - } -#endif - - public LangStr(string lang, string str) - { - this.lang = lang; - this.str = str; - } - - public static ListOfLangStr CreateManyFromStringArray(string[] s) - { - var r = new ListOfLangStr(); - var i = 0; - while ((i + 1) < s.Length) - { - r.Add(new LangStr(s[i], s[i + 1])); - i += 2; - } - return r; - } - - public override string ToString() - { - return $"{str}@{lang}"; - } - } - - public class ListOfLangStr : List - { - public ListOfLangStr() { } - - public ListOfLangStr(LangStr ls) - { - if (ls != null) - this.Add(ls); - } - - public ListOfLangStr(ListOfLangStr src) - { - if (src != null) - foreach (var ls in src) - this.Add(ls); - } - - public string this[string lang] - { - get - { - return GetDefaultStr(lang); - } - set - { - foreach (var ls in this) - if (ls.lang.Trim().ToLower() == lang?.Trim().ToLower()) - { - ls.str = value; - return; - } - this.Add(new LangStr(lang, value)); - } - } - - public string GetDefaultStr(string defaultLang = null) - { - // start - if (defaultLang == null) - defaultLang = LangStr.LANG_DEFAULT; - defaultLang = defaultLang.Trim().ToLower(); - string res = null; - - // search - foreach (var ls in this) - if (ls.lang.Trim().ToLower() == defaultLang) - res = ls.str; - if (res == null && this.Count > 0) - res = this[0].str; - - // found? - return res; - } - - public string GetExactStrForLang(string lang) - { - // start - if (lang == null) - return null; - string res = null; - - // exact search - foreach (var ls in this) - if (ls.lang.Trim().ToLower() == lang) - res = ls.str; - - // found? - return res; - } - - public bool ContainsLang(string lang) - { - return GetExactStrForLang(lang) != null; - } - - public bool AllLangSameString() - { - if (this.Count < 2) - return true; - - for (int i = 1; i < this.Count; i++) - if (this[0]?.str != null && this[0]?.str?.Trim() != this[i]?.str?.Trim()) - return false; - - return true; - } - - public override string ToString() - { - return string.Join(", ", this.Select((ls) => ls.ToString())); - } - - public static ListOfLangStr Parse(string cell) - { - // access - if (cell == null) - return null; - - // iterative approach - var res = new ListOfLangStr(); - while (true) - { - // trivial case and finite end - if (!cell.Contains("@")) - { - if (cell.Trim() != "") - res.Add(new LangStr(LangStr.LANG_DEFAULT, cell)); - break; - } - - // OK, pick the next couple - var m = Regex.Match(cell, @"(.*?)@(\w+)", RegexOptions.Singleline); - if (!m.Success) - { - // take emergency exit? - res.Add(new LangStr("??", cell)); - break; - } - - // use the match and shorten cell .. - res.Add(new LangStr(m.Groups[2].ToString(), m.Groups[1].ToString().Trim())); - cell = cell.Substring(m.Index + m.Length); - } - - return res; - } - } - - public class Description - { - - // members - - [XmlElement(ElementName = "langString")] - public ListOfLangStr langString = new ListOfLangStr(); - - // constructors - - public Description() { } - - public Description(Description src) - { - if (src != null && src.langString != null) - foreach (var ls in src.langString) - langString.Add(new LangStr(ls)); - } - - public Description(LangStringSet src) - { - if (src != null && src.langString != null) - foreach (var ls in src.langString) - langString.Add(new LangStr(ls)); - } - -#if !DoNotUseAasxCompatibilityModels - public Description(AasxCompatibilityModels.AdminShellV10.Description src) - { - if (src != null) - foreach (var ls in src.langString) - langString.Add(new LangStr(ls)); - } -#endif - - // single string representation - public string GetDefaultStr(string defaultLang = null) - { - return this.langString?.GetDefaultStr(defaultLang); - } - - } - - public class AssetKind - { - // constants - public static string Type = "Type"; - public static string Instance = "Instance"; - - [MetaModelName("AssetKind.kind")] - [TextSearchable] - [XmlText] - [CountForHash] - public string kind = "Instance"; - - // getters / setters - - [XmlIgnore] - [JsonIgnore] - public bool IsInstance { get { return kind == null || kind.Trim().ToLower() == "instance"; } } - - [XmlIgnore] - [JsonIgnore] - public bool IsType { get { return kind != null && kind.Trim().ToLower() == "type"; } } - - // constructors / creators - - public AssetKind() { } - - public AssetKind(AssetKind src) - { - kind = src.kind; - } - -#if !DoNotUseAasxCompatibilityModels - public AssetKind(AasxCompatibilityModels.AdminShellV10.Kind src) - { - kind = src.kind; - } -#endif - - public AssetKind(string kind) - { - this.kind = kind; - } - - public static AssetKind CreateAsType() - { - var res = new AssetKind() { kind = AssetKind.Type }; - return res; - } - - public static AssetKind CreateAsInstance() - { - var res = new AssetKind() { kind = AssetKind.Instance }; - return res; - } - } - - public class ModelingKind - { - // constants - public static string Template = "Template"; - public static string Instance = "Instance"; - - [MetaModelName("ModelingKind.kind")] - [TextSearchable] - [XmlText] - [CountForHash] - public string kind = Instance; - - // getters / setters - - [XmlIgnore] - [JsonIgnore] - public bool IsInstance { get { return kind == null || kind.Trim().ToLower() == Instance.ToLower(); } } - - [XmlIgnore] - [JsonIgnore] - public bool IsTemplate { get { return kind != null && kind.Trim().ToLower() == Template.ToLower(); } } - - // constructors / creators - - public ModelingKind() { } - - public ModelingKind(ModelingKind src) - { - kind = src.kind; - } - -#if !DoNotUseAasxCompatibilityModels - public ModelingKind(AasxCompatibilityModels.AdminShellV10.Kind src) - { - kind = src.kind; - } -#endif - - public ModelingKind(string kind) - { - this.kind = kind; - } - - public static ModelingKind CreateAsTemplate() - { - var res = new ModelingKind() { kind = Template }; - return res; - } - - public static ModelingKind CreateAsInstance() - { - var res = new ModelingKind() { kind = Instance }; - return res; - } - - // validation - - public static void Validate(AasValidationRecordList results, ModelingKind mk, Referable container) - { - // access - if (results == null || container == null) - return; - - // check - if (mk == null || mk.kind == null) - { - // warning - results.Add(new AasValidationRecord( - AasValidationSeverity.Warning, container, - "ModelingKind: is null", - () => - { - })); - } - else - { - var k = mk.kind.Trim(); - var kl = k.ToLower(); - if (kl != Template.ToLower() && kl != Instance.ToLower()) - { - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - $"ModelingKind: enumeration value neither {Template} nor {Instance}", - () => - { - mk.kind = Instance; - })); - } - else if (k != Template && k != Instance) - { - // warning - results.Add(new AasValidationRecord( - AasValidationSeverity.Warning, container, - "ModelingKind: enumeration value in wrong casing", - () => - { - if (kl == Template.ToLower()) - mk.kind = Template; - else - mk.kind = Instance; - })); - } - } - } - } - - public class SemanticId : Reference - { - - // constructors / creators - - public SemanticId() - : base() - { - } - - public SemanticId(SemanticId src) - : base(src) - { - } - - public SemanticId(Reference src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public SemanticId(AasxCompatibilityModels.AdminShellV10.SemanticId src) - : base(src) - { - } -#endif - public SemanticId(Key key) : base(key) { } - - public static SemanticId CreateFromKey(Key key) - { - if (key == null) - return null; - var res = new SemanticId(); - res.Keys.Add(key); - return res; - } - - public static SemanticId CreateFromKeys(List keys) - { - if (keys == null) - return null; - var res = new SemanticId(); - res.Keys.AddRange(keys); - return res; - } - - public new static SemanticId Parse(string input) - { - return (SemanticId)CreateNew(KeyList.Parse(input)); - } - } - - /// - /// This class allows to describe further data (in derived classes) when enumerating Children. - /// - public class EnumerationPlacmentBase - { - } - - public interface IEnumerateChildren - { - IEnumerable EnumerateChildren(); - EnumerationPlacmentBase GetChildrenPlacement(SubmodelElement child); - object AddChild(SubmodelElementWrapper smw, EnumerationPlacmentBase placement = null); - } - - public interface IValidateEntity - { - void Validate(AasValidationRecordList results); - } - - /// - /// This attribute indicates, that it should e.g. serialized in JSON. - /// - [System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple = true)] - public class CountForHash : System.Attribute - { - } - - /// - /// This attribute indicates, that evaluation shall not count following field or not dive into references. - /// - [System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple = true)] - public class SkipForHash : System.Attribute - { - } - - /// - /// This attribute indicates, that the field / property is searchable - /// - [System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)] - public class MetaModelName : System.Attribute - { - public string name; - public MetaModelName(string name) - { - this.name = name; - } - } - - /// - /// This attribute indicates, that the field / property shall be skipped for reflection - /// in order to avoid cycles - /// - [System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)] - public class SkipForReflection : System.Attribute - { - } - - /// - /// This attribute indicates, that the field / property shall be skipped for searching, because it is not - /// directly displayed in Package Explorer - /// - [System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)] - public class SkipForSearch : System.Attribute - { - } - - /// - /// This attribute indicates, that the field / property is searchable - /// - [System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = true)] - public class TextSearchable : System.Attribute - { - } - - /// - /// Result of FindReferable in Environment - /// - public class ReferableRootInfo - { - public AdministrationShell AAS = null; - public Asset Asset = null; - public Submodel Submodel = null; - - public int NrOfRootKeys = 0; - - public bool IsValid - { - get - { - return NrOfRootKeys > 0 && (AAS != null || Submodel != null || Asset != null); - } - } - } - - /// - /// Marks an object, preferaby a payload item, which might be featured by the diary collection - /// - public interface IAasDiaryEntry - { - } - - public class DiaryDataDef - { - public enum TimeStampKind { Create, Update } - - [XmlIgnore] - [JsonIgnore] - private DateTime[] _timeStamp = new DateTime[2]; - - [XmlIgnore] - [JsonIgnore] - public DateTime[] TimeStamp { get { return _timeStamp; } } - - /// - /// List of entries, timewise one after each other (entries are timestamped). - /// Note: Default is Entries = null, as handling of many many AAS elements does not - /// create additional overhead of creating empty lists. An empty list shall be avoided. - /// - public List Entries = null; - - public static void AddAndSetTimestamps(Referable element, IAasDiaryEntry de, bool isCreate = false) - { - // trivial - if (element == null || de == null || element.DiaryData == null) - return; - - // add entry - if (element.DiaryData.Entries == null) - element.DiaryData.Entries = new List(); - element.DiaryData.Entries.Add(de); - - // figure out which timestamp - var tsk = TimeStampKind.Update; - if (isCreate) - { - tsk = TimeStampKind.Create; - } - - // set this timestamp (and for the parents, as well) - IDiaryData el = element; - while (el?.DiaryData != null) - { - // itself - el.DiaryData.TimeStamp[(int)tsk] = DateTime.UtcNow; - - // go up - el = (el as Referable)?.parent as IDiaryData; - } - } - } - - public interface IDiaryData - { - DiaryDataDef DiaryData { get; } - } - - public class ListOfReferable : List - { - // conversion to other list - - public KeyList ToKeyList() - { - var res = new KeyList(); - foreach (var rf in this) - res.Add(rf.ToKey()); - return res; - } - - public Reference GetReference() - { - return Reference.CreateNew(ToKeyList()); - } - } - - public interface IRecurseOnReferables - { - void RecurseOnReferables( - object state, Func lambda, - bool includeThis = false); - } - - public class Referable : IValidateEntity, IAasElement, IDiaryData, IGetReference, IRecurseOnReferables - { - // diary - - [XmlIgnore] - [JsonIgnore] - [SkipForHash] - [SkipForReflection] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [XmlIgnore] - [JsonIgnore] - [SkipForReflection] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - // members - - [MetaModelName("Referable.IdShort")] - [TextSearchable] - [CountForHash] - public string idShort = ""; - - [MetaModelName("Referable.category")] - [TextSearchable] - [CountForHash] - public string category = null; - - [XmlElement(ElementName = "description")] - [JsonIgnore] - [CountForHash] - public Description description = null; - - [XmlIgnore] - [JsonProperty(PropertyName = "descriptions")] - public ListOfLangStr JsonDescription - { - get - { - return description?.langString; - } - set - { - if (value == null) - { - description = null; - return; - } - - if (description == null) - description = new Description(); - description.langString = value; - } - } - - [XmlIgnore] - [JsonIgnore] - [SkipForHash] // important to skip, as recursion elsewise will go in cycles! - [SkipForReflection] // important to skip, as recursion elsewise will go in cycles! - public IAasElement parent = null; - - public static string CONSTANT = "CONSTANT"; - public static string Category_PARAMETER = "PARAMETER"; - public static string VARIABLE = "VARIABLE"; - - public static string[] ReferableCategoryNames = new string[] { CONSTANT, Category_PARAMETER, VARIABLE }; - - // constructors - - public Referable() { } - - public Referable(string idShort) - { - this.idShort = idShort; - } - - public Referable(Referable src) - { - if (src == null) - return; - this.idShort = src.idShort; - this.category = src.category; - if (src.description != null) - this.description = new Description(src.description); - } - -#if !DoNotUseAasxCompatibilityModels - public Referable(AasxCompatibilityModels.AdminShellV10.Referable src) - { - if (src == null) - return; - this.idShort = src.idShort; - if (this.idShort == null) - // change in V2.0 -> mandatory - this.idShort = ""; - this.category = src.category; - if (src.description != null) - this.description = new Description(src.description); - } -#endif - - /// - /// Introduced for JSON serialization, can create Referables based on a string name - /// - /// string name (standard PascalCased) - public static Referable CreateAdequateType(string elementName) - { - if (elementName == Key.AAS) - return new AdministrationShell(); - if (elementName == Key.Asset) - return new Asset(); - if (elementName == Key.ConceptDescription) - return new ConceptDescription(); - if (elementName == Key.Submodel) - return new Submodel(); - if (elementName == Key.View) - return new View(); - return SubmodelElementWrapper.CreateAdequateType(elementName); - } - - public void AddDescription(string lang, string str) - { - if (description == null) - description = new Description(); - description.langString.Add(new LangStr(lang, str)); - } - - public virtual AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Referable", "Ref"); - } - - public virtual string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - - public string GetFriendlyName() - { - return AdminShellUtilV20.FilterFriendlyName(this.idShort); - } - - public virtual Reference GetReference(bool includeParents = true) - { - return new Reference( - new AdminShell.Key( - this.GetElementName(), false, Key.IdShort, "" + this.idShort)); - } - - public void CollectReferencesByParent(List refs) - { - // access - if (refs == null) - return; - - // check, if this is identifiable - if (this is Identifiable) - { - var idf = this as Identifiable; - if (idf != null) - { - var k = Key.CreateNew( - idf.GetElementName(), true, idf.identification?.idType, idf.identification?.id); - refs.Insert(0, k); - } - } - else - { - var k = Key.CreateNew(this.GetElementName(), true, "IdShort", this.idShort); - refs.Insert(0, k); - // recurse upwards! - if (this.parent is Referable prf) - prf.CollectReferencesByParent(refs); - } - } - - public string CollectIdShortByParent() - { - // recurse first - var head = ""; - if (!(this is Identifiable) && this.parent is Referable prf) - // can go up - head = prf.CollectIdShortByParent() + "/"; - // add own - var myid = ""; - if (this.idShort != null && this.idShort.Trim() != "") - myid = this.idShort.Trim(); - // together - return head + myid; - } - - // string functions - - public string ToIdShortString() - { - if (this.idShort == null || this.idShort.Trim().Length < 1) - return (""); - return this.idShort.Trim(); - } - - public override string ToString() - { - return "" + this.idShort; - } - - public virtual Key ToKey() - { - return new Key(GetElementName(), true, Key.IdShort, idShort); - } - - // hash functionality - - public class ObjectFieldInfo - { - public object o; - public FieldInfo fi; - public ObjectFieldInfo() { } - public ObjectFieldInfo(object o, FieldInfo fi) - { - this.o = o; - this.fi = fi; - } - } - - public List RecursivelyFindFields(object o, Type countAttribute, Type skipAttribute) - { - // access - var res = new List(); - if (o == null || countAttribute == null) - return res; - - // find fields for this object - var t = o.GetType(); - var l = t.GetFields(BindingFlags.Instance | BindingFlags.Public); - foreach (var f in l) - { - // Skip this field?? - if (skipAttribute != null && f.GetCustomAttribute(skipAttribute) != null) - continue; - - // add directly? - if (f.GetCustomAttribute(countAttribute) != null) - res.Add(new ObjectFieldInfo(o, f)); - - // object - if (f.FieldType.IsClass) - { - var oo = f.GetValue(o); - var r = RecursivelyFindFields(oo, countAttribute, skipAttribute); - res.AddRange(r); - } - - // try cast in IList to check further - var elems = f.GetValue(o) as IList; - if (elems != null) - foreach (var e in elems) - { - var r = RecursivelyFindFields(e, countAttribute, skipAttribute); - res.AddRange(r); - } - - } - // OK - return res; - } - - public byte[] ComputeByteArray() - { - // use memory stream for effcient behaviour - var mems = new MemoryStream(); - - // TEST - var xxx = RecursivelyFindFields(this, typeof(CountForHash), typeof(SkipForHash)); - - foreach (var ofi in xxx) - { - var a = ofi.fi.GetCustomAttribute(); - if (a != null) - { - // found an accountable field, get bytes - var o = ofi.fi.GetValue(ofi.o); - byte[] bs = null; - - // optimize for probabilities - - if (o is string) - bs = System.Text.Encoding.UTF8.GetBytes((string)o); - else if (o is char[]) - bs = System.Text.Encoding.UTF8.GetBytes((char[])o); - else if (o is double) - bs = BitConverter.GetBytes((double)o); - else if (o is float) - bs = BitConverter.GetBytes((float)o); - else if (o is char) - bs = BitConverter.GetBytes((char)o); - else if (o is byte) - bs = BitConverter.GetBytes((byte)o); - else if (o is int) - bs = BitConverter.GetBytes((int)o); - else if (o is long) - bs = BitConverter.GetBytes((long)o); - else if (o is short) - bs = BitConverter.GetBytes((short)o); - else if (o is uint) - bs = BitConverter.GetBytes((uint)o); - else if (o is ulong) - bs = BitConverter.GetBytes((ulong)o); - else if (o is ushort) - bs = BitConverter.GetBytes((ushort)o); - - if (bs != null) - mems.Write(bs, 0, bs.Length); - } - } - - return mems.ToArray(); - } - - private static System.Security.Cryptography.SHA256 HashProvider = - System.Security.Cryptography.SHA256.Create(); - - public string ComputeHashcode() - { - var dataBytes = this.ComputeByteArray(); - var hashBytes = Referable.HashProvider.ComputeHash(dataBytes); - - StringBuilder sb = new StringBuilder(); - foreach (var hb in hashBytes) - sb.Append(hb.ToString("X2")); - return sb.ToString(); - } - - // sorting - - public class ComparerIdShort : IComparer - { - public int Compare(Referable a, Referable b) - { - return String.Compare(a?.idShort, b?.idShort, - CultureInfo.InvariantCulture, CompareOptions.IgnoreCase); - } - } - - public class ComparerIndexed : IComparer - { - public int NullIndex = int.MaxValue; - public Dictionary Index = new Dictionary(); - - public int Compare(Referable a, Referable b) - { - var ca = Index.ContainsKey(a); - var cb = Index.ContainsKey(b); - - if (!ca && !cb) - return 0; - // make CDs without usage to appear at end of list - if (!ca) - return +1; - if (!cb) - return -1; - - var ia = Index[a]; - var ib = Index[b]; - - if (ia == ib) - return 0; - if (ia < ib) - return -1; - return +1; - } - } - - // validation - - public virtual void Validate(AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check - if (this.idShort == null || this.idShort.Trim() == "") - results.Add(new AasValidationRecord( - AasValidationSeverity.SpecViolation, this, - "Referable: missing idShort", - () => - { - this.idShort = "TO_FIX"; - })); - - if (this.description != null && (this.description.langString == null - || this.description.langString.Count < 1)) - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, this, - "Referable: existing description with missing langString", - () => - { - this.description = null; - })); - } - - // hierarchy & recursion (by derived elements) - - public virtual void RecurseOnReferables( - object state, Func lambda, - bool includeThis = false) - { - if (includeThis) - lambda(state, null, this); - } - - public Identifiable FindParentFirstIdentifiable() - { - Referable curr = this; - while (curr != null) - { - if (curr is Identifiable curri) - return curri; - curr = curr.parent as Referable; - } - return null; - } - } - - public class Identifiable : Referable, IGetReference - { - - // members - - public Identification identification = new Identification(); - public Administration administration = null; - - // constructors - - public Identifiable() : base() { } - - public Identifiable(string idShort) : base(idShort) { } - - public Identifiable(Identifiable src) - : base(src) - { - if (src == null) - return; - if (src.identification != null) - this.identification = new Identification(src.identification); - if (src.administration != null) - this.administration = new Administration(src.administration); - } - -#if !DoNotUseAasxCompatibilityModels - public Identifiable(AasxCompatibilityModels.AdminShellV10.Identifiable src) - : base(src) - { - if (src.identification != null) - this.identification = new Identification(src.identification); - if (src.administration != null) - this.administration = new Administration(src.administration); - } -#endif - - public void SetIdentification(string idType, string id, string idShort = null) - { - identification.idType = idType; - identification.id = id; - if (idShort != null) - this.idShort = idShort; - } - - public void SetAdminstration(string version, string revision) - { - if (administration == null) - administration = new Administration(); - administration.version = version; - administration.revision = revision; - } - - public new string GetFriendlyName() - { - if (identification != null && identification.id != "") - return AdminShellUtilV20.FilterFriendlyName(this.identification.id); - return AdminShellUtilV20.FilterFriendlyName(this.idShort); - } - - public override string ToString() - { - return ("" + identification?.ToString() + " " + administration?.ToString()).Trim(); - } - - public override Key ToKey() - { - return new Key(GetElementName(), true, "" + identification?.idType, "" + identification?.id); - } - - // self description - - public override Reference GetReference(bool includeParents = true) - { - var r = new Reference(); - r.Keys.Add( - Key.CreateNew( - this.GetElementName(), true, this.identification.idType, this.identification.id)); - return r; - } - - // sorting - - public class ComparerIdentification : IComparer - { - public int Compare(Identifiable a, Identifiable b) - { - if (a?.identification == null && b?.identification == null) - return 0; - if (a?.identification == null) - return +1; - if (b?.identification == null) - return -1; - - var vc = String.Compare(a.identification.idType, b.identification.idType, - CultureInfo.InvariantCulture, CompareOptions.IgnoreCase); - if (vc != 0) - return vc; - - return String.Compare(a.identification.id, b.identification.id, - CultureInfo.InvariantCulture, CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace); - } - } - - } - - public class JsonModelTypeWrapper - { - public string name = ""; - - public JsonModelTypeWrapper(string name = "") { this.name = name; } - } - - public interface IFindAllReferences - { - IEnumerable FindAllReferences(); - } - - public interface IGetSemanticId - { - SemanticId GetSemanticId(); - } - - public class AdministrationShell : Identifiable, IFindAllReferences - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // from hasDataSpecification: - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // from this very class - public AssetAdministrationShellRef derivedFrom = null; - - [JsonProperty(PropertyName = "asset")] - public AssetRef assetRef = new AssetRef(); - - [JsonProperty(PropertyName = "submodels")] - [SkipForSearch] - public List submodelRefs = new List(); - - [JsonIgnore] - public Views views = null; - [XmlIgnore] - [JsonProperty(PropertyName = "views")] - public View[] JsonViews - { - get { return views?.views.ToArray(); } - set { views = Views.CreateOrSetInnerViews(views, value); } - } - - [JsonProperty(PropertyName = "conceptDictionaries")] - public List conceptDictionaries = null; - - // constructors - - public AdministrationShell() { } - - public AdministrationShell(string idShort) : base(idShort) { } - - public AdministrationShell(AdministrationShell src) - : base(src) - { - if (src != null) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - - if (src.derivedFrom != null) - this.derivedFrom = new AssetAdministrationShellRef(src.derivedFrom); - - if (src.assetRef != null) - this.assetRef = new AssetRef(src.assetRef); - - if (src.submodelRefs != null) - foreach (var smr in src.submodelRefs) - this.submodelRefs.Add(new SubmodelRef(smr)); - - if (src.views != null) - this.views = new Views(src.views); - - if (src.conceptDictionaries != null) - { - this.conceptDictionaries = new List(); - foreach (var cdd in src.conceptDictionaries) - this.conceptDictionaries.Add(new ConceptDictionary(cdd)); - } - } - } - -#if !DoNotUseAasxCompatibilityModels - public AdministrationShell(AasxCompatibilityModels.AdminShellV10.AdministrationShell src) - : base(src) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - - if (src.derivedFrom != null) - this.derivedFrom = new AssetAdministrationShellRef(src.derivedFrom); - - if (src.assetRef != null) - this.assetRef = new AssetRef(src.assetRef); - - if (src.submodelRefs != null) - foreach (var smr in src.submodelRefs) - this.submodelRefs.Add(new SubmodelRef(smr)); - - if (src.views != null) - this.views = new Views(src.views); - - if (src.conceptDictionaries != null) - { - this.conceptDictionaries = new List(); - foreach (var cdd in src.conceptDictionaries) - this.conceptDictionaries.Add(new ConceptDictionary(cdd)); - } - } -#endif - - public static AdministrationShell CreateNew( - string idShort, string idType, string id, string version = null, string revision = null) - { - var s = new AdministrationShell(); - s.idShort = idShort; - if (version != null) - s.SetAdminstration(version, revision); - s.identification.idType = idType; - s.identification.id = id; - return (s); - } - - // add - - public void AddView(View v) - { - if (views == null) - views = new Views(); - views.views.Add(v); - } - - public void AddConceptDictionary(ConceptDictionary d) - { - if (conceptDictionaries == null) - conceptDictionaries = new List(); - conceptDictionaries.Add(d); - } - - public void AddDataSpecification(Key k) - { - if (hasDataSpecification == null) - hasDataSpecification = new HasDataSpecification(); - var r = new Reference(); - r.Keys.Add(k); - hasDataSpecification.Add(new EmbeddedDataSpecification(r)); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("AssetAdministrationShell", "AAS"); - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV20.EvalToNonNullString("\"{0}\" ", idShort, "\"AAS\""); - if (administration != null) - caption += "V" + administration.version + "." + administration.revision; - - var info = ""; - if (identification != null) - info = $"[{identification.idType}, {identification.id}]"; - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - public SubmodelRef FindSubmodelRef(Identification refid) - { - if (this.submodelRefs == null) - return null; - foreach (var r in this.submodelRefs) - if (r.Matches(refid)) - return r; - return null; - } - - public bool HasSubmodelRef(SubmodelRef newref) - { - // check, if existing - if (this.submodelRefs == null) - return false; - var found = false; - foreach (var r in this.submodelRefs) - if (r.Matches(newref)) - found = true; - - return found; - } - - public void AddSubmodelRef(SubmodelRef newref) - { - if (this.submodelRefs == null) - this.submodelRefs = new List(); - this.submodelRefs.Add(newref); - } - - public IEnumerable FindAllReferences() - { - // Asset - if (this.assetRef != null) - yield return new LocatedReference(this, this.assetRef); - - // Submodel references - if (this.submodelRefs != null) - foreach (var r in this.submodelRefs) - yield return new LocatedReference(this, r); - - // Views - if (this.views?.views != null) - foreach (var vw in this.views.views) - if (vw?.containedElements?.reference != null) - foreach (var r in vw.containedElements.reference) - yield return new LocatedReference(this, r); - } - } - - public class ListOfAdministrationShells : List, IAasElement - { - // self decscription - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("AssetAdministrationShells", "AASs"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - } - - public class Asset : Identifiable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // from hasDataSpecification: - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // from this very class - [XmlElement(ElementName = "assetIdentificationModelRef")] - public SubmodelRef assetIdentificationModelRef = null; - - [XmlElement(ElementName = "billOfMaterialRef")] - public SubmodelRef billOfMaterialRef = null; - - // from HasKind - [XmlElement(ElementName = "kind")] - [JsonIgnore] - public AssetKind kind = new AssetKind(); - [XmlIgnore] - [JsonProperty(PropertyName = "kind")] - public string JsonKind - { - get - { - if (kind == null) - return null; - return kind.kind; - } - set - { - if (kind == null) - kind = new AssetKind(); - kind.kind = value; - } - } - - // constructors - - public Asset() { } - - public Asset(string idShort) : base(idShort) { } - - public Asset(Asset src) - : base(src) - { - if (src != null) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.kind != null) - this.kind = new AssetKind(src.kind); - if (src.assetIdentificationModelRef != null) - this.assetIdentificationModelRef = new SubmodelRef(src.assetIdentificationModelRef); - } - } - -#if !DoNotUseAasxCompatibilityModels - public Asset(AasxCompatibilityModels.AdminShellV10.Asset src) - : base(src) - { - if (src != null) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.kind != null) - this.kind = new AssetKind(src.kind); - if (src.assetIdentificationModelRef != null) - this.assetIdentificationModelRef = new SubmodelRef(src.assetIdentificationModelRef); - } - } -#endif - - // Getter & setters - - public AssetRef GetAssetReference() - { - var r = new AssetRef(); - r.Keys.Add( - Key.CreateNew( - this.GetElementName(), true, this.identification.idType, this.identification.id)); - return r; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Asset", "Asset"); - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV20.EvalToNonNullString("\"{0}\" ", idShort, ""); - if (administration != null) - caption += "V" + administration.version + "." + administration.revision; - - var info = ""; - if (identification != null) - info = $"[{identification.idType}, {identification.id}]"; - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - public IEnumerable FindAllReferences() - { - if (this.assetIdentificationModelRef != null) - yield return this.assetIdentificationModelRef; - if (this.billOfMaterialRef != null) - yield return this.billOfMaterialRef; - } - } - - public class ListOfAssets : List, IAasElement - { - // self decscription - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Assets", "Assets"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - - } - - public class View : Referable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // from hasSemanticId: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = null; - - // from hasDataSpecification - [XmlElement(ElementName = "hasDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // from this very class - [JsonIgnore] - [SkipForSearch] - public ContainedElements containedElements = null; - [XmlIgnore] - [SkipForSearch] - [JsonProperty(PropertyName = "containedElements")] - public ContainedElementRef[] JsonContainedElements - { - get { return containedElements?.reference.ToArray(); } - set { containedElements = ContainedElements.CreateOrSetInner(containedElements, value); } - } - - // getter / setter - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return containedElements == null || containedElements.Count < 1; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (containedElements == null) return 0; return containedElements.Count; } } - - public ContainedElementRef this[int index] - { - get { if (containedElements == null) return null; return containedElements[index]; } - } - - // constructors / creators - - public View() { } - - public View(View src) - : base(src) - { - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.containedElements != null) - this.containedElements = new ContainedElements(src.containedElements); - } - -#if !DoNotUseAasxCompatibilityModels - public View(AasxCompatibilityModels.AdminShellV10.View src) - : base(src) - { - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.containedElements != null) - this.containedElements = new ContainedElements(src.containedElements); - } -#endif - - public static View CreateNew(string idShort) - { - var v = new View() { idShort = idShort }; - return (v); - } - - public void AddDataSpecification(Key k) - { - if (hasDataSpecification == null) - hasDataSpecification = new HasDataSpecification(); - var r = new Reference(); - r.Keys.Add(k); - hasDataSpecification.Add(new EmbeddedDataSpecification(r)); - } - - public void AddContainedElement(Key k) - { - if (containedElements == null) - containedElements = new ContainedElements(); - var r = new ContainedElementRef(); - r.Keys.Add(k); - containedElements.reference.Add(r); - } - - public void AddContainedElement(List keys) - { - if (containedElements == null) - containedElements = new ContainedElements(); - var r = new ContainedElementRef(); - foreach (var k in keys) - r.Keys.Add(k); - containedElements.reference.Add(r); - } - - public void AddContainedElement(Reference r) - { - if (containedElements == null) - containedElements = new ContainedElements(); - containedElements.reference.Add(ContainedElementRef.CreateNew(r)); - } - - public void AddContainedElement(List rlist) - { - if (containedElements == null) - containedElements = new ContainedElements(); - foreach (var r in rlist) - containedElements.reference.Add(ContainedElementRef.CreateNew(r)); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("View", "View"); - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV20.EvalToNonNullString("\"{0}\" ", idShort, ""); - var info = ""; - if (this.semanticId != null) - info = Key.KeyListToString(this.semanticId.Keys); - if (this.containedElements != null && this.containedElements.reference != null) - info = (info + " ").Trim() + - String.Format("({0} elements)", this.containedElements.reference.Count); - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - // validation - - public override void Validate(AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check - base.Validate(results); - KeyList.Validate(results, semanticId?.Keys, this); - } - } - - public class Views - { - [XmlElement(ElementName = "view")] - [JsonIgnore] - public List views = new List(); - - // constructors - - public Views() { } - - public Views(Views src) - { - if (src != null && src.views != null) - foreach (var v in src.views) - this.views.Add(new View(v)); - } - -#if !DoNotUseAasxCompatibilityModels - public Views(AasxCompatibilityModels.AdminShellV10.Views src) - { - if (src != null && src.views != null) - foreach (var v in src.views) - this.views.Add(new View(v)); - } -#endif - - public static Views CreateOrSetInnerViews(Views outer, View[] inner) - { - var res = outer; - if (res == null) - res = new Views(); - if (inner == null) - { - res.views = null; - return res; - } - res.views = new List(inner); - return res; - } - } - - /// - /// Multiple lang string for the AAS namespace - /// - public class LangStringSet - { - - // members - - [XmlElement(ElementName = "langString", Namespace = "http://www.admin-shell.io/aas/2/0")] - public ListOfLangStr langString = new ListOfLangStr(); - - // getters / setters - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return langString == null || langString.Count < 1; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (langString == null) return 0; return langString.Count; } } - [XmlIgnore] - [JsonIgnore] - public LangStr this[int index] { get { return langString[index]; } } - - // constructors - - public LangStringSet() { } - - public LangStringSet(LangStringSet src) - { - if (src.langString != null) - foreach (var ls in src.langString) - this.langString.Add(new LangStr(ls)); - } - - public LangStringSet(ListOfLangStr src) - { - if (src != null) - foreach (var ls in src) - this.langString.Add(new LangStr(ls)); - } - -#if !DoNotUseAasxCompatibilityModels - // not available in V1.0 -#endif - public LangStringSet(string lang, string str) - { - if (str == null || str.Trim() == "") - return; - this.langString.Add(new LangStr(lang, str)); - } - - // converter - - public static LangStringSet CreateFrom(List src) - { - var res = new LangStringSet(); - if (src != null) - foreach (var ls in src) - res.langString.Add(new LangStr(ls)); - return res; - } - - // add - - public LangStr Add(LangStr ls) - { - this.langString.Add(ls); - return ls; - } - - public LangStr Add(string lang, string str) - { - var ls = new LangStr(lang, str); - this.langString.Add(ls); - return ls; - } - - // single string representation - public string GetDefaultStr(string defaultLang = null) - { - return this.langString?.GetDefaultStr(defaultLang); - } - } - - /// - /// Multiple lang string for the IEC61360 namespace - /// - public class LangStringSetIEC61360 : ListOfLangStr - { - - // getters / setters - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return this.Count < 1; } } - - // constructors - - public LangStringSetIEC61360() { } - - public LangStringSetIEC61360(ListOfLangStr lol) : base(lol) { } - - public LangStringSetIEC61360(LangStringSetIEC61360 src) - { - foreach (var ls in src) - this.Add(new LangStr(ls)); - } - -#if !DoNotUseAasxCompatibilityModels - public LangStringSetIEC61360(AasxCompatibilityModels.AdminShellV10.LangStringIEC61360 src) - { - if (src.langString != null) - foreach (var ls in src.langString) - this.Add(new LangStr(ls)); - } -#endif - public LangStringSetIEC61360(string lang, string str) - { - if (str == null || str.Trim() == "") - return; - this.Add(new LangStr(lang, str)); - } - - // converter - - public static LangStringSetIEC61360 CreateFrom(List src) - { - var res = new LangStringSetIEC61360(); - if (src != null) - foreach (var ls in src) - res.Add(new LangStr(ls)); - return res; - } - - } - - public class UnitId - { - - // members - - [XmlIgnore] - [JsonIgnore] - public KeyList keys = new KeyList(); - - // getter / setters - - [XmlArray("keys")] - [XmlArrayItem("key")] - [JsonIgnore] - public KeyList Keys { get { return keys; } } - [XmlIgnore] - [JsonProperty(PropertyName = "keys")] - public KeyList JsonKeys - { - get - { - keys?.NumberIndices(); - return keys; - } - } - - [XmlIgnore] - [JsonIgnore] - public bool IsEmpty { get { return keys == null || keys.IsEmpty; } } - [XmlIgnore] - [JsonIgnore] - public int Count { get { if (keys == null) return 0; return keys.Count; } } - [XmlIgnore] - [JsonIgnore] - public Key this[int index] { get { return keys[index]; } } - - // constructors / creators - - public UnitId() { } - - public UnitId(UnitId src) - { - if (src.keys != null) - foreach (var k in src.Keys) - this.keys.Add(new Key(k)); - } - -#if !DoNotUseAasxCompatibilityModels - public UnitId(AasxCompatibilityModels.AdminShellV10.UnitId src) - { - if (src.keys != null) - foreach (var k in src.Keys) - this.keys.Add(new Key(k)); - } -#endif - - public static UnitId CreateNew(string type, bool local, string idType, string value) - { - var u = new UnitId(); - u.keys.Add(Key.CreateNew(type, local, idType, value)); - return u; - } - - public static UnitId CreateNew(Reference src) - { - if (src == null) - return null; - var res = new UnitId(); - if (src.Keys != null) - foreach (var k in src.Keys) - res.keys.Add(k); - return res; - } - } - - [XmlRoot(Namespace = "http://www.admin-shell.io/IEC61360/2/0")] - public class DataSpecificationIEC61360 - { - // static member - [XmlIgnore] - [JsonIgnore] - public static string[] DataTypeNames = { - "STRING", - "STRING_TRANSLATABLE", - "REAL_MEASURE", - "REAL_COUNT", - "REAL_CURRENCY", - "INTEGER_MEASURE", - "INTEGER_COUNT", - "INTEGER_CURRENCY", - "BOOLEAN", - "URL", - "RATIONAL", - "RATIONAL_MEASURE", - "TIME", - "TIMESTAMP", - "DATE" }; - - // members - // TODO (MIHO, 2020-08-27): According to spec, cardinality is [1..1][1..n] - // these cardinalities are NOT MAINTAINED in ANY WAY by the system - public LangStringSetIEC61360 preferredName = new LangStringSetIEC61360(); - - // TODO (MIHO, 2020-08-27): According to spec, cardinality is [0..1][1..n] - // these cardinalities are NOT MAINTAINED in ANY WAY by the system - public LangStringSetIEC61360 shortName = null; - - [MetaModelName("DataSpecificationIEC61360.unit")] - [TextSearchable] - [CountForHash] - public string unit = ""; - - public UnitId unitId = null; - - [MetaModelName("DataSpecificationIEC61360.valueFormat")] - [TextSearchable] - [CountForHash] - public string valueFormat = null; - - [MetaModelName("DataSpecificationIEC61360.sourceOfDefinition")] - [TextSearchable] - [CountForHash] - public string sourceOfDefinition = null; - - [MetaModelName("DataSpecificationIEC61360.symbol")] - [TextSearchable] - [CountForHash] - public string symbol = null; - - [MetaModelName("DataSpecificationIEC61360.dataType")] - [TextSearchable] - [CountForHash] - public string dataType = ""; - - // TODO (MIHO, 2020-08-27): According to spec, cardinality is [0..1][1..n] - // these cardinalities are NOT MAINTAINED in ANY WAY by the system - public LangStringSetIEC61360 definition = null; - - // getter / setters - - // constructors - - public DataSpecificationIEC61360() { } - - public DataSpecificationIEC61360(DataSpecificationIEC61360 src) - { - if (src.preferredName != null) - this.preferredName = new LangStringSetIEC61360(src.preferredName); - this.shortName = src.shortName; - this.unit = src.unit; - if (src.unitId != null) - this.unitId = new UnitId(src.unitId); - this.valueFormat = src.valueFormat; - this.sourceOfDefinition = src.sourceOfDefinition; - this.symbol = src.symbol; - this.dataType = src.dataType; - if (src.definition != null) - this.definition = new LangStringSetIEC61360(src.definition); - } - -#if !DoNotUseAasxCompatibilityModels - public DataSpecificationIEC61360(AasxCompatibilityModels.AdminShellV10.DataSpecificationIEC61360 src) - { - if (src.preferredName != null) - this.preferredName = new LangStringSetIEC61360(src.preferredName); - this.shortName = new LangStringSetIEC61360("EN?", src.shortName); - this.unit = src.unit; - if (src.unitId != null) - this.unitId = new UnitId(src.unitId); - this.valueFormat = src.valueFormat; - if (src.sourceOfDefinition != null && src.sourceOfDefinition.Count > 0) - this.sourceOfDefinition = src.sourceOfDefinition[0].str; - this.symbol = src.symbol; - this.dataType = src.dataType; - if (src.definition != null) - this.definition = new LangStringSetIEC61360(src.definition); - } -#endif - - public static DataSpecificationIEC61360 CreateNew( - string[] preferredName = null, - string shortName = "", - string unit = "", - UnitId unitId = null, - string valueFormat = null, - string sourceOfDefinition = null, - string symbol = null, - string dataType = "", - string[] definition = null - ) - { - var d = new DataSpecificationIEC61360(); - if (preferredName != null) - { - d.preferredName = new LangStringSetIEC61360(LangStr.CreateManyFromStringArray(preferredName)); - } - d.shortName = new LangStringSetIEC61360("EN?", shortName); - d.unit = unit; - d.unitId = unitId; - d.valueFormat = valueFormat; - d.sourceOfDefinition = sourceOfDefinition; - d.symbol = symbol; - d.dataType = dataType; - if (definition != null) - { - if (d.definition == null) - d.definition = new LangStringSetIEC61360(); - d.definition = new LangStringSetIEC61360(LangStr.CreateManyFromStringArray(definition)); - } - return (d); - } - - // "constants" - - public static Key GetKey() - { - return Key.CreateNew( - "GlobalReference", false, "IRI", - "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0"); - } - - // validation - - public void Validate(AasValidationRecordList results, ConceptDescription cd) - { - // access - if (results == null || cd == null) - return; - - // check IEC61360 spec - if (this.preferredName == null || this.preferredName.Count < 1) - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, cd, - "ConceptDescription: missing preferredName", - () => - { - this.preferredName = new AdminShell.LangStringSetIEC61360("EN?", - AdminShellUtilV20.EvalToNonEmptyString("{0}", cd.idShort, "UNKNOWN")); - })); - - if (this.shortName != null && this.shortName.Count < 1) - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, cd, - "ConceptDescription: existing shortName with missing langString", - () => - { - this.shortName = null; - })); - - if (this.definition != null && this.definition.Count < 1) - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, cd, - "ConceptDescription: existing definition with missing langString", - () => - { - this.definition = null; - })); - - // check data type - string foundDataType = null; - if (this.dataType != null) - foreach (var dtn in DataTypeNames) - if (this.dataType.Trim() == dtn.Trim()) - foundDataType = this.dataType; - if (foundDataType == null) - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, cd, - "ConceptDescription: dataType does not match allowed enumeration values", - () => - { - this.dataType = "STRING"; - })); - } - } - - // ReSharper disable ClassNeverInstantiated.Global .. class is important to show potential for ISO! - - public class DataSpecificationISO99999 - { - } - - // ReSharper enable ClassNeverInstantiated.Global - - public class DataSpecificationContent - { - - // members - - public DataSpecificationIEC61360 dataSpecificationIEC61360 = null; - public DataSpecificationISO99999 dataSpecificationISO99999 = null; - - // constructors - - public DataSpecificationContent() { } - - public DataSpecificationContent(DataSpecificationContent src) - { - if (src.dataSpecificationIEC61360 != null) - this.dataSpecificationIEC61360 = new DataSpecificationIEC61360(src.dataSpecificationIEC61360); - } - -#if !DoNotUseAasxCompatibilityModels - public DataSpecificationContent(AasxCompatibilityModels.AdminShellV10.DataSpecificationContent src) - { - if (src.dataSpecificationIEC61360 != null) - this.dataSpecificationIEC61360 = new DataSpecificationIEC61360(src.dataSpecificationIEC61360); - } -#endif - } - - public class EmbeddedDataSpecification - { - // members - - [JsonIgnore] - public DataSpecificationContent dataSpecificationContent = null; - - [XmlIgnore] - [JsonProperty("dataSpecificationContent")] - public DataSpecificationIEC61360 JsonWrongDataSpec61360 - { - get { return dataSpecificationContent?.dataSpecificationIEC61360; } - set - { - if (dataSpecificationContent == null) - dataSpecificationContent = new DataSpecificationContent(); - dataSpecificationContent.dataSpecificationIEC61360 = value; - } - } - - public DataSpecificationRef dataSpecification = null; - - // constructors - - public EmbeddedDataSpecification() { } - - public EmbeddedDataSpecification( - DataSpecificationRef dataSpecification, - DataSpecificationContent dataSpecificationContent) - { - this.dataSpecification = dataSpecification; - this.dataSpecificationContent = dataSpecificationContent; - } - - public EmbeddedDataSpecification(EmbeddedDataSpecification src) - { - if (src.dataSpecification != null) - this.dataSpecification = new DataSpecificationRef(src.dataSpecification); - if (src.dataSpecificationContent != null) - this.dataSpecificationContent = new DataSpecificationContent(src.dataSpecificationContent); - } - - public EmbeddedDataSpecification(Reference src) - { - if (src != null) - this.dataSpecification = new DataSpecificationRef(src); - } - -#if !DoNotUseAasxCompatibilityModels - public EmbeddedDataSpecification(AasxCompatibilityModels.AdminShellV10.EmbeddedDataSpecification src) - { - if (src.hasDataSpecification != null) - this.dataSpecification = new DataSpecificationRef(src.hasDataSpecification); - if (src.dataSpecificationContent != null) - this.dataSpecificationContent = new DataSpecificationContent(src.dataSpecificationContent); - } - - public EmbeddedDataSpecification(AasxCompatibilityModels.AdminShellV10.Reference src) - { - if (src != null) - this.dataSpecification = new DataSpecificationRef(src); - } -#endif - - public static EmbeddedDataSpecification CreateIEC61360WithContent() - { - var eds = new EmbeddedDataSpecification(new DataSpecificationRef(), new DataSpecificationContent()); - - eds.dataSpecification.Keys.Add(DataSpecificationIEC61360.GetKey()); - - eds.dataSpecificationContent.dataSpecificationIEC61360 = - AdminShell.DataSpecificationIEC61360.CreateNew(); - - return eds; - } - - public DataSpecificationIEC61360 GetIEC61360() - { - return this.dataSpecificationContent?.dataSpecificationIEC61360; - } - } - - public class ConceptDescription : Identifiable, System.IDisposable - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // do this in order to be IDisposable, that is: suitable for (using) - void System.IDisposable.Dispose() { } - public void GetData() { } - // from HasDataSpecification - -#if __not_anymore - - [XmlElement(ElementName = "embeddedDataSpecification")] - [JsonIgnore] - public EmbeddedDataSpecification embeddedDataSpecification = new EmbeddedDataSpecification(); -#else - // According to Spec V2.0.1, a ConceptDescription might feature alos multiple data specifications - /* TODO (MIHO, 2020-08-30): align wording of the member ("embeddedDataSpecification") with the - * wording of the other entities ("hasDataSpecification") */ - [XmlElement(ElementName = "embeddedDataSpecification")] - [JsonIgnore] - public HasDataSpecification embeddedDataSpecification = null; -#endif - - [XmlIgnore] - [JsonProperty(PropertyName = "embeddedDataSpecifications")] - public EmbeddedDataSpecification[] JsonEmbeddedDataSpecifications - { - get - { - return this.embeddedDataSpecification?.ToArray(); - } - set - { - embeddedDataSpecification = new HasDataSpecification(value); - } - } - - // old - - // this class - [XmlIgnore] - private List isCaseOf = null; - - // getter / setter - - [XmlElement(ElementName = "isCaseOf")] - [JsonProperty(PropertyName = "isCaseOf")] - public List IsCaseOf - { - get { return isCaseOf; } - set { isCaseOf = value; } - } - - // constructors / creators - - public ConceptDescription() : base() { } - - public ConceptDescription(ConceptDescription src) - : base(src) - { - if (src.embeddedDataSpecification != null) - this.embeddedDataSpecification = new HasDataSpecification(src.embeddedDataSpecification); - if (src.isCaseOf != null) - foreach (var ico in src.isCaseOf) - { - if (this.isCaseOf == null) - this.isCaseOf = new List(); - this.isCaseOf.Add(new Reference(ico)); - } - } - -#if !DoNotUseAasxCompatibilityModels - public ConceptDescription(AasxCompatibilityModels.AdminShellV10.ConceptDescription src) - : base(src) - { - if (src.embeddedDataSpecification != null) - { - this.embeddedDataSpecification = new HasDataSpecification(); - this.embeddedDataSpecification.Add(new EmbeddedDataSpecification(src.embeddedDataSpecification)); - } - if (src.IsCaseOf != null) - foreach (var ico in src.IsCaseOf) - { - if (this.isCaseOf == null) - this.isCaseOf = new List(); - this.isCaseOf.Add(new Reference(ico)); - } - } -#endif - - public static ConceptDescription CreateNew( - string idShort, string idType, string id, string version = null, string revision = null) - { - var cd = new ConceptDescription(); - cd.idShort = idShort; - cd.identification.idType = idType; - cd.identification.id = id; - if (version != null) - { - if (cd.administration == null) - cd.administration = new Administration(); - cd.administration.version = version; - cd.administration.revision = revision; - } - return (cd); - } - - public Key GetSingleKey() - { - return Key.CreateNew(this.GetElementName(), true, this.identification.idType, this.identification.id); - } - - public ConceptDescriptionRef GetCdReference() - { - var r = new ConceptDescriptionRef(); - r.Keys.Add( - Key.CreateNew( - this.GetElementName(), true, this.identification.idType, this.identification.id)); - return r; - } - - public void SetIEC61360Spec( - string[] preferredNames = null, - string shortName = "", - string unit = "", - UnitId unitId = null, - string valueFormat = null, - string sourceOfDefinition = null, - string symbol = null, - string dataType = "", - string[] definition = null - ) - { - var eds = new EmbeddedDataSpecification(new DataSpecificationRef(), new DataSpecificationContent()); - eds.dataSpecification.Keys.Add( - DataSpecificationIEC61360.GetKey()); - eds.dataSpecificationContent.dataSpecificationIEC61360 = - AdminShell.DataSpecificationIEC61360.CreateNew( - preferredNames, shortName, unit, unitId, valueFormat, sourceOfDefinition, symbol, - dataType, definition); - - this.embeddedDataSpecification = new HasDataSpecification(); - this.embeddedDataSpecification.Add(eds); - - this.AddIsCaseOf( - Reference.CreateNew( - new Key("ConceptDescription", false, this.identification.idType, this.identification.id))); - } - - public DataSpecificationIEC61360 GetIEC61360() - { - return this.embeddedDataSpecification?.IEC61360Content; - } - - // as experimental approach, forward the IEC getter/sett of hasDataSpec directly - - [XmlIgnore] - [JsonIgnore] - public EmbeddedDataSpecification IEC61360DataSpec - { - get - { - return this.embeddedDataSpecification?.IEC61360; - } - set - { - // add embeddedDataSpecification first? - if (this.embeddedDataSpecification == null) - this.embeddedDataSpecification = new HasDataSpecification(); - this.embeddedDataSpecification.IEC61360 = value; - } - } - - [XmlIgnore] - [JsonIgnore] - public DataSpecificationIEC61360 IEC61360Content - { - get - { - return this.embeddedDataSpecification?.IEC61360Content; - } - set - { - // add embeddedDataSpecification first? - if (this.embeddedDataSpecification == null) - this.embeddedDataSpecification = new HasDataSpecification(); - - // check, if e IEC61360 can be found - var eds = this.embeddedDataSpecification.IEC61360; - - // if already there, update - if (eds != null) - { - eds.dataSpecificationContent = new DataSpecificationContent(); - eds.dataSpecificationContent.dataSpecificationIEC61360 = value; - return; - } - - // no: add a full record - eds = EmbeddedDataSpecification.CreateIEC61360WithContent(); - eds.dataSpecificationContent.dataSpecificationIEC61360 = value; - this.embeddedDataSpecification.Add(eds); - } - } - - public DataSpecificationIEC61360 CreateDataSpecWithContentIec61360() - { - var eds = AdminShell.EmbeddedDataSpecification.CreateIEC61360WithContent(); - if (this.embeddedDataSpecification == null) - this.embeddedDataSpecification = new HasDataSpecification(); - this.embeddedDataSpecification.Add(eds); - return eds.dataSpecificationContent?.dataSpecificationIEC61360; - } - - public string GetDefaultPreferredName(string defaultLang = null) - { - return "" + - GetIEC61360()? - .preferredName?.GetDefaultStr(defaultLang); - } - - public string GetDefaultShortName(string defaultLang = null) - { - return "" + - GetIEC61360()? - .shortName?.GetDefaultStr(defaultLang); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("ConceptDescription", "CD"); - } - - public Tuple ToCaptionInfo() - { - var caption = ""; - if (this.idShort != null && this.idShort.Trim() != "") - caption = $"\"{this.idShort.Trim()}\""; - if (this.identification != null) - caption = (caption + " " + this.identification).Trim(); - - var info = "" + GetDefaultShortName(); - - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - public void AddIsCaseOf(Reference ico) - { - if (isCaseOf == null) - isCaseOf = new List(); - isCaseOf.Add(ico); - } - - public static IDisposable CreateNew() - { - throw new NotImplementedException(); - } - - // validation - - public override void Validate(AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check CD itself - base.Validate(results); - - // check IEC61360 spec - var eds61360 = this.IEC61360DataSpec; - if (eds61360 != null) - { - // check data spec - if (eds61360.dataSpecification == null || - !(eds61360.dataSpecification.MatchesExactlyOneKey(DataSpecificationIEC61360.GetKey()))) - results.Add(new AasValidationRecord( - AasValidationSeverity.SpecViolation, this, - "HasDataSpecification: data specification content set to IEC61360, but no " + - "data specification reference set!", - () => - { - eds61360.dataSpecification = new DataSpecificationRef( - new Reference( - DataSpecificationIEC61360.GetKey())); - })); - - // validate content - if (eds61360.dataSpecificationContent?.dataSpecificationIEC61360 == null) - { - results.Add(new AasValidationRecord( - AasValidationSeverity.SpecViolation, this, - "HasDataSpecification: data specification reference set to IEC61360, but no " + - "data specification content set!", - () => - { - eds61360.dataSpecificationContent = new DataSpecificationContent(); - eds61360.dataSpecificationContent.dataSpecificationIEC61360 = - new DataSpecificationIEC61360(); - })); - } - else - { - // validate - eds61360.dataSpecificationContent.dataSpecificationIEC61360.Validate(results, this); - } - } - } - - // more find - - public IEnumerable FindAllReferences() - { - yield break; - } - } - - public class ListOfConceptDescriptions : List, IAasElement - { - // finding - - public ConceptDescription Find(ConceptDescriptionRef cdr) - { - if (cdr == null) - return null; - return Find(cdr.Keys); - } - - public ConceptDescription Find(Identification id) - { - var cdr = ConceptDescriptionRef.CreateNew("Conceptdescription", true, id.idType, id.id); - return Find(cdr); - } - - public ConceptDescription Find(List keys) - { - // trivial - if (keys == null) - return null; - // can only refs with 1 key - if (keys.Count != 1) - return null; - // and we're picky - var key = keys[0]; - if (!key.local || key.type.ToLower().Trim() != "conceptdescription") - return null; - // brute force - foreach (var cd in this) - if (cd.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && cd.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return cd; - // uups - return null; - } - - // item management - - public ConceptDescription AddIfNew(ConceptDescription cd) - { - if (cd == null) - return null; - - var exist = this.Find(cd.identification); - if (exist != null) - return exist; - - this.Add(cd); - return cd; - } - - // self decscription - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("ConceptDescriptions", "CDS"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - - // sorting - - - } - - public class ConceptDictionary : Referable - { - [XmlElement(ElementName = "conceptDescriptions")] - public ConceptDescriptionRefs conceptDescriptionsRefs = null; - - // constructors - - public ConceptDictionary() { } - - public ConceptDictionary(ConceptDictionary src) - { - if (src.conceptDescriptionsRefs != null) - this.conceptDescriptionsRefs = new ConceptDescriptionRefs(src.conceptDescriptionsRefs); - } - -#if !DoNotUseAasxCompatibilityModels - public ConceptDictionary(AasxCompatibilityModels.AdminShellV10.ConceptDictionary src) - { - if (src.conceptDescriptionsRefs != null) - this.conceptDescriptionsRefs = new ConceptDescriptionRefs(src.conceptDescriptionsRefs); - } -#endif - - public static ConceptDictionary CreateNew(string idShort = null) - { - var d = new ConceptDictionary(); - if (idShort != null) - d.idShort = idShort; - return (d); - } - - // add - - public void AddReference(Reference r) - { - var cdr = (ConceptDescriptionRef)(ConceptDescriptionRef.CreateNew(r.Keys)); - if (conceptDescriptionsRefs == null) - conceptDescriptionsRefs = new ConceptDescriptionRefs(); - conceptDescriptionsRefs.conceptDescriptions.Add(cdr); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("ConceptDictionary", "CDic"); - } - } - - /// - /// Use by FindAllReference to provide a enumeration of referenced with location - /// info, where they are contained - /// - public class LocatedReference - { - public Identifiable Identifiable; - public Reference Reference; - - public LocatedReference() { } - public LocatedReference(Identifiable identifiable, Reference reference) - { - Identifiable = identifiable; - Reference = reference; - } - } - - [XmlRoot(ElementName = "aasenv", Namespace = "http://www.admin-shell.io/aas/2/0")] - public class AdministrationShellEnv : IFindAllReferences, IAasElement, IDiaryData, IRecurseOnReferables - { - - // diary (as e.g. deleted AASes need to be listed somewhere) - - [XmlIgnore] - [JsonIgnore] - [SkipForHash] - [SkipForReflection] - private DiaryDataDef _diaryData = new DiaryDataDef(); - - [XmlIgnore] - [JsonIgnore] - [SkipForReflection] - public DiaryDataDef DiaryData { get { return _diaryData; } } - - // members - - [XmlAttribute(Namespace = System.Xml.Schema.XmlSchema.InstanceNamespace)] - [JsonIgnore] - public string schemaLocation = - "http://www.admin-shell.io/aas/2/0 AAS.xsd http://www.admin-shell.io/IEC61360/2/0 IEC61360.xsd"; - - [XmlIgnore] // will be ignored, anyway - private ListOfAdministrationShells administrationShells = new ListOfAdministrationShells(); - [XmlIgnore] // will be ignored, anyway - private ListOfAssets assets = new ListOfAssets(); - [XmlIgnore] // will be ignored, anyway - private ListOfSubmodels submodels = new ListOfSubmodels(); - [XmlIgnore] // will be ignored, anyway - private ListOfConceptDescriptions conceptDescriptions = new ListOfConceptDescriptions(); - - // getter / setters - - [XmlArray("assetAdministrationShells")] - [XmlArrayItem("assetAdministrationShell")] - [JsonProperty(PropertyName = "assetAdministrationShells")] - public ListOfAdministrationShells AdministrationShells - { - get { return administrationShells; } - set { administrationShells = value; } - } - - [XmlArray("assets")] - [XmlArrayItem("asset")] - [JsonProperty(PropertyName = "assets")] - public ListOfAssets Assets - { - get { return assets; } - set { assets = value; } - } - - [XmlArray("submodels")] - [XmlArrayItem("submodel")] - [JsonProperty(PropertyName = "submodels")] - public ListOfSubmodels Submodels - { - get { return submodels; } - set { submodels = value; } - } - - [XmlArray("conceptDescriptions")] - [XmlArrayItem("conceptDescription")] - [JsonProperty(PropertyName = "conceptDescriptions")] - public ListOfConceptDescriptions ConceptDescriptions - { - get { return conceptDescriptions; } - set { conceptDescriptions = value; } - } - - // constructors - - public AdministrationShellEnv() { } - -#if !DoNotUseAasxCompatibilityModels - public AdministrationShellEnv(AasxCompatibilityModels.AdminShellV10.AdministrationShellEnv src) - { - if (src.AdministrationShells != null) - foreach (var aas in src.AdministrationShells) - this.administrationShells.Add(new AdministrationShell(aas)); - - if (src.Assets != null) - foreach (var asset in src.Assets) - this.assets.Add(new Asset(asset)); - - if (src.Submodels != null) - foreach (var sm in src.Submodels) - this.submodels.Add(new Submodel(sm)); - - if (src.ConceptDescriptions != null) - foreach (var cd in src.ConceptDescriptions) - this.conceptDescriptions.Add(new ConceptDescription(cd)); - } -#endif - - // to String - - public override string ToString() - { - var res = "AAS-ENV"; - if (AdministrationShells != null) - res += $" {AdministrationShells.Count} AAS"; - if (Assets != null) - res += $" {Assets.Count} Assets"; - if (Submodels != null) - res += $" {Submodels.Count} Submodels"; - if (ConceptDescriptions != null) - res += $" {ConceptDescriptions.Count} CDs"; - return res; - } - - // self decscription - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("AdministrationShellEnv", "Env"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - - // finders - - public AdministrationShell FindAAS(Identification id) - { - if (id == null) - return null; - foreach (var aas in this.AdministrationShells) - if (aas.identification != null && aas.identification.IsEqual(id)) - return aas; - return null; - } - - public AdministrationShell FindAAS(string idShort) - { - if (idShort == null) - return null; - foreach (var aas in this.AdministrationShells) - if (aas.idShort != null && aas.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - return aas; - return null; - } - - public AdministrationShell FindAASwithSubmodel(Identification smid) - { - if (smid == null) - return null; - foreach (var aas in this.AdministrationShells) - if (aas.submodelRefs != null) - foreach (var smref in aas.submodelRefs) - if (smref.Matches(smid)) - return aas; - return null; - } - - public IEnumerable FindAllAAS( - Predicate p = null) - { - if (this.administrationShells == null) - yield break; - foreach (var x in this.administrationShells) - if (p == null || p(x)) - yield return x; - } - - public IEnumerable FindAllSubmodelGroupedByAAS( - Func p = null) - { - if (this.administrationShells == null || this.submodels == null) - yield break; - foreach (var aas in this.administrationShells) - { - if (aas?.submodelRefs == null) - continue; - foreach (var smref in aas.submodelRefs) - { - var sm = this.FindSubmodel(smref); - if (sm != null && (p == null || p(aas, sm))) - yield return sm; - } - } - } - - public Asset FindAsset(Identification id) - { - if (id == null) - return null; - foreach (var asset in this.Assets) - if (asset.identification != null && asset.identification.IsEqual(id)) - return asset; - return null; - } - - public Asset FindAsset(AssetRef aref) - { - // trivial - if (aref == null) - return null; - // can only refs with 1 key - if (aref.Count != 1) - return null; - // and we're picky - var key = aref[0]; - if (!key.local || key.type.ToLower().Trim() != "asset") - return null; - // brute force - foreach (var a in assets) - if (a.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && a.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return a; - // uups - return null; - } - - public Submodel FindSubmodel(Identification id) - { - if (id == null) - return null; - foreach (var sm in this.Submodels) - if (sm.identification != null && sm.identification.IsEqual(id)) - return sm; - return null; - } - - public Submodel FindSubmodel(SubmodelRef smref) - { - // trivial - if (smref == null) - return null; - // can only refs with 1 key - if (smref.Count != 1) - return null; - // and we're picky - var key = smref.Keys[0]; - if (!key.local || key.type.ToLower().Trim() != "submodel") - return null; - // brute force - foreach (var sm in this.Submodels) - if (sm.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && sm.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return sm; - // uups - return null; - } - - public Submodel FindFirstSubmodelBySemanticId(Key semId) - { - // access - if (semId == null) - return null; - - // brute force - foreach (var sm in this.Submodels) - if (true == sm.semanticId?.MatchesExactlyOneKey(semId)) - return sm; - - return null; - } - - public IEnumerable FindAllSubmodelBySemanticId( - Key semId, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - // access - if (semId == null) - yield break; - - // brute force - foreach (var sm in this.Submodels) - if (true == sm.semanticId?.MatchesExactlyOneKey(semId, matchMode)) - yield return sm; - } - - public IEnumerable FindAllReferable(Predicate p) - { - if (p == null) - yield break; - - foreach (var r in this.FindAllReferable()) - if (r != null && p(r)) - yield return r; - } - - public IEnumerable FindAllReferable(bool onlyIdentifiables = false) - { - if (this.AdministrationShells != null) - foreach (var aas in this.AdministrationShells) - if (aas != null) - { - // AAS itself - yield return aas; - - if (!onlyIdentifiables) - { - // Views - if (aas.views?.views != null) - foreach (var view in aas.views.views) - yield return view; - } - } - - if (this.Assets != null) - foreach (var asset in this.Assets) - if (asset != null) - yield return asset; - - if (this.Submodels != null) - foreach (var sm in this.Submodels) - if (sm != null) - { - yield return sm; - - if (!onlyIdentifiables) - { - // TODO (MIHO, 2020-08-26): not very elegant, yet. Avoid temporary collection - var allsme = new ListOfSubmodelElement(); - sm.RecurseOnSubmodelElements(null, (state, parents, sme) => - { - allsme.Add(sme); return true; - }); - foreach (var sme in allsme) - yield return sme; - } - } - - if (this.ConceptDescriptions != null) - foreach (var cd in this.ConceptDescriptions) - if (cd != null) - yield return cd; - } - - // - // Reference handling - // - - public Referable FindReferableByReference(Reference rf, int keyIndex = 0, bool exactMatch = false) - { - return FindReferableByReference(rf?.Keys); - } - - public Referable FindReferableByReference(KeyList kl, int keyIndex = 0, bool exactMatch = false, - ReferableRootInfo rootInfo = null) - { - // first index needs to exist .. - if (kl == null || keyIndex >= kl.Count) - return null; - - // which type? - var firstType = kl[keyIndex].type.Trim().ToLower(); - var firstIdentification = new Identification(kl[keyIndex].idType, kl[keyIndex].value); - AdministrationShell aasToFollow = null; - - if (firstType == Key.AAS.Trim().ToLower()) - { - // search aas - var aas = this.FindAAS(firstIdentification); - - // not found or already at end with our search? - if (aas == null || keyIndex >= kl.Count - 1) - return aas; - - // side info? - if (rootInfo != null) - { - rootInfo.AAS = aas; - rootInfo.NrOfRootKeys = 1 + keyIndex; - } - - // follow up - aasToFollow = aas; - } - - if (firstType == Key.Asset.Trim().ToLower()) - { - // search asset - var asset = this.FindAsset(firstIdentification); - - // not found or already at end with our search? - if (asset == null || keyIndex >= kl.Count - 1) - return exactMatch ? null : asset; - - // try find aas for it - var aas = this.FindAllAAS((a) => - { - return a?.assetRef?.Matches(asset.identification) == true; - }).FirstOrDefault(); - if (aas == null) - return exactMatch ? null : asset; - - // side info? - if (rootInfo != null) - { - rootInfo.Asset = asset; - rootInfo.NrOfRootKeys = 1 + keyIndex; - } - - // follow up - aasToFollow = aas; - } - - // try - if (aasToFollow != null) - { - // search different entities - if (kl[keyIndex + 1].type.Trim().ToLower() == Key.Submodel.ToLower() - || kl[keyIndex + 1].type.Trim().ToLower() == Key.SubmodelRef.ToLower()) - { - // ok, search SubmodelRef - var smref = aasToFollow.FindSubmodelRef(kl[keyIndex + 1].ToId()); - if (smref == null) - return exactMatch ? null : aasToFollow; - - // validate matching submodel - var sm = this.FindSubmodel(smref); - if (sm == null) - return exactMatch ? null : aasToFollow; - - // side info - // side info? - if (rootInfo != null) - { - rootInfo.Submodel = sm; - rootInfo.NrOfRootKeys = 2 + keyIndex; - } - - // at our end? - if (keyIndex >= kl.Count - 2) - return sm; - - // go inside - return SubmodelElementWrapper.FindReferableByReference(sm.submodelElements, kl, keyIndex + 2); - } - } - - if (firstType == Key.ConceptDescription.Trim().ToLower()) - return this.FindConceptDescription(firstIdentification); - - if (firstType == Key.Submodel.Trim().ToLower()) - { - // ok, search Submodel - var sm = this.FindSubmodel(new Identification(kl[keyIndex].idType, kl[keyIndex].value)); - if (sm == null) - return null; - - // notice in side info - if (rootInfo != null) - { - rootInfo.Submodel = sm; - rootInfo.NrOfRootKeys = 1 + keyIndex; - - // add even more info - if (rootInfo.AAS == null) - { - foreach (var aas2 in this.AdministrationShells) - { - var smref2 = aas2.FindSubmodelRef(sm.identification); - if (smref2 != null) - { - rootInfo.AAS = aas2; - break; - } - } - } - } - - // at our end? - if (keyIndex >= kl.Count - 1) - return sm; - - // go inside - return SubmodelElementWrapper.FindReferableByReference(sm.submodelElements, kl, keyIndex + 1); - } - - // nothing in this Environment - return null; - } - - // - // Handling of CDs - // - - public ConceptDescription FindConceptDescription(ConceptDescriptionRef cdr) - { - if (cdr == null) - return null; - return FindConceptDescription(cdr.Keys); - } - - public ConceptDescription FindConceptDescription(SemanticId semId) - { - if (semId == null) - return null; - return FindConceptDescription(semId.Keys); - } - - public ConceptDescription FindConceptDescription(Reference rf) - { - if (rf == null) - return null; - return FindConceptDescription(rf.Keys); - } - - public ConceptDescription FindConceptDescription(Identification id) - { - var cdr = ConceptDescriptionRef.CreateNew("Conceptdescription", true, id.idType, id.id); - return FindConceptDescription(cdr); - } - - public ConceptDescription FindConceptDescription(List keys) - { - // trivial - if (keys == null) - return null; - // can only refs with 1 key - if (keys.Count != 1) - return null; - // and we're picky - var key = keys[0]; - if (!key.local || key.type.ToLower().Trim() != "conceptdescription") - return null; - // brute force - foreach (var cd in conceptDescriptions) - if (cd.identification.idType.ToLower().Trim() == key.idType.ToLower().Trim() - && cd.identification.id.ToLower().Trim() == key.value.ToLower().Trim()) - return cd; - // uups - return null; - } - - public IEnumerable FindAllSubmodelElements( - Predicate match = null, AdministrationShell onlyForAAS = null) where T : SubmodelElement - { - // more or less two different schemes - if (onlyForAAS != null) - { - if (onlyForAAS.submodelRefs == null) - yield break; - foreach (var smr in onlyForAAS.submodelRefs) - { - var sm = this.FindSubmodel(smr); - if (sm?.submodelElements != null) - foreach (var x in sm.submodelElements.FindDeep(match)) - yield return x; - } - } - else - { - if (this.Submodels != null) - foreach (var sm in this.Submodels) - if (sm?.submodelElements != null) - foreach (var x in sm.submodelElements.FindDeep(match)) - yield return x; - } - } - - public ConceptDescription FindConceptDescription(Key key) - { - if (key == null) - return null; - var l = new List { key }; - return (FindConceptDescription(l)); - } - - public IEnumerable FindAllReferences() - { - if (this.AdministrationShells != null) - foreach (var aas in this.AdministrationShells) - if (aas != null) - foreach (var r in aas.FindAllReferences()) - yield return r; - - if (this.Assets != null) - foreach (var asset in this.Assets) - if (asset != null) - foreach (var r in asset.FindAllReferences()) - yield return new LocatedReference(asset, r); - - if (this.Submodels != null) - foreach (var sm in this.Submodels) - if (sm != null) - foreach (var r in sm.FindAllReferences()) - yield return r; - - if (this.ConceptDescriptions != null) - foreach (var cd in this.ConceptDescriptions) - if (cd != null) - foreach (var r in cd.FindAllReferences()) - yield return new LocatedReference(cd, r); - } - - // creators - - private void CopyConceptDescriptionsFrom( - AdministrationShellEnv srcEnv, SubmodelElement src, bool shallowCopy = false) - { - // access - if (srcEnv == null || src == null || src.semanticId == null) - return; - // check for this SubmodelElement in Source - var cdSrc = srcEnv.FindConceptDescription(src.semanticId.Keys); - if (cdSrc == null) - return; - // check for this SubmodelElement in Destnation (this!) - var cdDest = this.FindConceptDescription(src.semanticId.Keys); - if (cdDest != null) - return; - // copy new - this.ConceptDescriptions.Add(new ConceptDescription(cdSrc)); - // recurse? - if (!shallowCopy && src is SubmodelElementCollection) - foreach (var m in (src as SubmodelElementCollection).value) - CopyConceptDescriptionsFrom(srcEnv, m.submodelElement, shallowCopy: false); - - } - - public SubmodelElementWrapper CopySubmodelElementAndCD( - AdministrationShellEnv srcEnv, SubmodelElement srcElem, bool copyCD = false, bool shallowCopy = false) - { - // access - if (srcEnv == null || srcElem == null) - return null; - - // 1st result pretty easy (calling function will add this to the appropriate Submodel) - var res = new SubmodelElementWrapper(srcElem); - - // copy the CDs.. - if (copyCD) - CopyConceptDescriptionsFrom(srcEnv, srcElem, shallowCopy); - - // give back - return res; - } - - public SubmodelRef CopySubmodelRefAndCD( - AdministrationShellEnv srcEnv, SubmodelRef srcSubRef, bool copySubmodel = false, bool copyCD = false, - bool shallowCopy = false) - { - // access - if (srcEnv == null || srcSubRef == null) - return null; - - // need to have the source Submodel - var srcSub = srcEnv.FindSubmodel(srcSubRef); - if (srcSub == null) - return null; - - // 1st result pretty easy (calling function will add this to the appropriate AAS) - var dstSubRef = new SubmodelRef(srcSubRef); - - // get the destination and shall src != dst - var dstSub = this.FindSubmodel(dstSubRef); - if (srcSub == dstSub) - return null; - - // maybe we need the Submodel in our environment, as well - if (dstSub == null && copySubmodel) - { - dstSub = new Submodel(srcSub, shallowCopy); - this.Submodels.Add(dstSub); - } - else - if (dstSub != null) - { - // there is already an submodel, just add members - if (!shallowCopy && srcSub.submodelElements != null) - { - if (dstSub.submodelElements == null) - dstSub.submodelElements = new SubmodelElementWrapperCollection(); - foreach (var smw in srcSub.submodelElements) - dstSub.submodelElements.Add( - new SubmodelElementWrapper( - smw.submodelElement, shallowCopy: false)); - } - } - - // copy the CDs.. - if (copyCD && srcSub.submodelElements != null) - foreach (var smw in srcSub.submodelElements) - CopyConceptDescriptionsFrom(srcEnv, smw.submodelElement, shallowCopy); - - // give back - return dstSubRef; - } - - /// - /// Tries renaming an Identifiable, specifically: the identification of an Identifiable and - /// all references to it. - /// Currently supported: ConceptDescriptions - /// Returns a list of Referables, which were changed or null in case of error - /// - public List RenameIdentifiable(Identification oldId, Identification newId) - where T : Identifiable - { - // access - if (oldId == null || newId == null || oldId.IsEqual(newId)) - return null; - - var res = new List(); - - if (typeof(T) == typeof(ConceptDescription)) - { - // check, if exist or not exist - var cdOld = FindConceptDescription(oldId); - if (cdOld == null || FindConceptDescription(newId) != null) - return null; - - // rename old cd - cdOld.identification = newId; - res.Add(cdOld); - - // search all SMEs referring to this CD - foreach (var sme in this.FindAllSubmodelElements(match: (s) => - { - return (s != null && s.semanticId != null && s.semanticId.Matches(oldId)); - })) - { - sme.semanticId[0].idType = newId.idType; - sme.semanticId[0].value = newId.id; - res.Add(sme); - } - - // seems fine - return res; - } - - if (typeof(T) == typeof(Submodel)) - { - // check, if exist or not exist - var smOld = FindSubmodel(oldId); - if (smOld == null || FindSubmodel(newId) != null) - return null; - - // recurse all possible Referenes in the aas env - foreach (var lr in this.FindAllReferences()) - { - var r = lr?.Reference; - if (r != null) - for (int i = 0; i < r.Count; i++) - if (r[i].Matches(Key.Submodel, false, oldId.idType, oldId.id, Key.MatchMode.Relaxed)) - { - // directly replace - r[i].idType = newId.idType; - r[i].value = newId.id; - if (res.Contains(lr.Identifiable)) - res.Add(lr.Identifiable); - } - } - - // rename old Submodel - smOld.identification = newId; - - // seems fine - return res; - } - - if (typeof(T) == typeof(Asset)) - { - // check, if exist or not exist - var assetOld = FindAsset(oldId); - if (assetOld == null || FindAsset(newId) != null) - return null; - - // recurse all possible Referenes in the aas env - foreach (var lr in this.FindAllReferences()) - { - var r = lr?.Reference; - if (r != null) - for (int i = 0; i < r.Count; i++) - if (r[i].Matches(Key.Asset, false, oldId.idType, oldId.id, Key.MatchMode.Relaxed)) - { - // directly replace - r[i].idType = newId.idType; - r[i].value = newId.id; - if (res.Contains(lr.Identifiable)) - res.Add(lr.Identifiable); - } - } - - // rename old Submodel - assetOld.identification = newId; - - // seems fine - return res; - } - - // no result is false, as well - return null; - } - - // serializations - - public void SerializeXmlToStream(StreamWriter s) - { - var serializer = new XmlSerializer(typeof(AdminShell.AdministrationShellEnv)); - var nss = new XmlSerializerNamespaces(); - nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - nss.Add("aas", "http://www.admin-shell.io/aas/2/0"); - nss.Add("IEC61360", "http://www.admin-shell.io/IEC61360/2/0"); - serializer.Serialize(s, this, nss); - } - - public JsonWriter SerialiazeJsonToStream(StreamWriter sw, bool leaveJsonWriterOpen = false) - { - sw.AutoFlush = true; - - JsonSerializer serializer = new JsonSerializer() - { - NullValueHandling = NullValueHandling.Ignore, - ReferenceLoopHandling = ReferenceLoopHandling.Serialize, - Formatting = Newtonsoft.Json.Formatting.Indented - }; - - JsonWriter writer = new JsonTextWriter(sw); - serializer.Serialize(writer, this); - if (leaveJsonWriterOpen) - return writer; - writer.Close(); - return null; - } - - public AdministrationShellEnv DeserializeFromXmlStream(TextReader reader) - { - XmlSerializer serializer = new XmlSerializer( - typeof(AdminShell.AdministrationShellEnv), "http://www.admin-shell.io/aas/2/0"); - var res = serializer.Deserialize(reader) as AdminShell.AdministrationShellEnv; - return res; - } - - public AdministrationShellEnv DeserializeFromJsonStream(TextReader reader) - { - JsonSerializer serializer = new JsonSerializer(); - serializer.Converters.Add(new AdminShellConverters.JsonAasxConverter("modelType", "name")); - var res = (AdministrationShellEnv)serializer.Deserialize(reader, typeof(AdministrationShellEnv)); - return res; - } - - // special functions - - private static void CreateFromExistingEnvRecurseForCDs( - AdministrationShellEnv src, List wrappers, - ref List filterForCD) - { - if (wrappers == null || filterForCD == null) - return; - - foreach (var w in wrappers) - { - // access - if (w == null) - continue; - - // include in filter .. - if (w.submodelElement.semanticId != null) - { - var cd = src.FindConceptDescription(w.submodelElement.semanticId.Keys); - if (cd != null) - filterForCD.Add(cd); - } - - // recurse? - if (w.submodelElement is SubmodelElementCollection smec) - CreateFromExistingEnvRecurseForCDs(src, smec.value, ref filterForCD); - - if (w.submodelElement is Operation op) - for (int i = 0; i < 2; i++) - { - var w2s = Operation.GetWrappers(op[i]); - CreateFromExistingEnvRecurseForCDs(src, w2s, ref filterForCD); - } - - if (w.submodelElement is Entity smee) - CreateFromExistingEnvRecurseForCDs(src, smee.statements, ref filterForCD); - - if (w.submodelElement is AnnotatedRelationshipElement smea) - CreateFromExistingEnvRecurseForCDs(src, smea.annotations, ref filterForCD); - } - } - - public static AdministrationShellEnv CreateFromExistingEnv(AdministrationShellEnv src, - List filterForAas = null, - List filterForAsset = null, - ListOfSubmodels filterForSubmodel = null, - List filterForCD = null) - { - // prepare defaults - if (filterForAas == null) - filterForAas = new List(); - if (filterForAsset == null) - filterForAsset = new List(); - if (filterForSubmodel == null) - filterForSubmodel = new ListOfSubmodels(); - if (filterForCD == null) - filterForCD = new List(); - - // make new - var res = new AdministrationShellEnv(); - - // take over AAS - foreach (var aas in src.administrationShells) - if (filterForAas.Contains(aas)) - { - // take over - res.administrationShells.Add(new AdministrationShell(aas)); - - // consequences - if (aas.assetRef != null) - { - var asset = src.FindAsset(aas.assetRef); - if (asset != null) - filterForAsset.Add(asset); - } - - if (aas.submodelRefs != null) - foreach (var smr in aas.submodelRefs) - { - var sm = src.FindSubmodel(smr); - if (sm != null) - filterForSubmodel.Add(sm); - } - - if (aas.conceptDictionaries != null) - foreach (var cdd in aas.conceptDictionaries) - if (cdd.conceptDescriptionsRefs != null && - cdd.conceptDescriptionsRefs.conceptDescriptions != null) - foreach (var cdr in cdd.conceptDescriptionsRefs.conceptDescriptions) - { - var cd = src.FindConceptDescription(cdr); - if (cd != null) - filterForCD.Add(cd); - } - } - - // take over Assets - foreach (var asset in src.assets) - if (filterForAsset.Contains(asset)) - { - // take over - res.assets.Add(new Asset(asset)); - } - - // take over Submodels - foreach (var sm in src.Submodels) - if (filterForSubmodel.Contains(sm)) - { - // take over - res.submodels.Add(new Submodel(sm)); - - // recursion in order to find used CDs - CreateFromExistingEnvRecurseForCDs(src, sm.submodelElements, ref filterForCD); - } - - // ConceptDescriptions - foreach (var cd in src.ConceptDescriptions) - if (filterForCD.Contains(cd)) - { - // take over - res.conceptDescriptions.Add(new ConceptDescription(cd)); - } - - // ok - return res; - } - - // Sorting - - public Referable.ComparerIndexed CreateIndexedComparerCdsForSmUsage() - { - var cmp = new Referable.ComparerIndexed(); - int nr = 0; - foreach (var sm in FindAllSubmodelGroupedByAAS()) - foreach (var sme in sm.FindDeep()) - { - if (sme.semanticId == null) - continue; - var cd = this.FindConceptDescription(sme.semanticId); - if (cd == null) - continue; - if (cmp.Index.ContainsKey(cd)) - continue; - cmp.Index[cd] = nr++; - } - return cmp; - } - - // Validation - - public AasValidationRecordList ValidateAll() - { - // collect results - var results = new AasValidationRecordList(); - - // all entities - foreach (var rf in this.FindAllReferable()) - rf.Validate(results); - - // give back - return results; - } - - public int AutoFix(IEnumerable records) - { - // access - if (records == null) - return -1; - - // collect Referables (expensive safety measure) - var allowedReferables = this.FindAllReferable().ToList(); - - // go thru records - int res = 0; - foreach (var rec in records) - { - // access - if (rec == null || rec.Fix == null || rec.Source == null) - continue; - - // minimal safety measure - if (!allowedReferables.Contains(rec.Source)) - continue; - - // apply fix - res++; - try - { - rec.Fix.Invoke(); - } - catch - { - res--; - } - } - - // return number of applied fixes - return res; - } - - public void RecurseOnReferables( - object state, Func lambda, bool includeThis = false) - { - // includeThis does not make sense, as no Referable - // just use the others - foreach (var idf in this.FindAllReferable(onlyIdentifiables: true)) - idf?.RecurseOnReferables(state, lambda, includeThis); - } - } - - // - // Submodel + Submodel elements - // - - public interface IGetReference - { - Reference GetReference(bool includeParents = true); - } - - public interface IGetQualifiers - { - QualifierCollection GetQualifiers(); - } - - public class Qualifier : IAasElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // member - // from hasSemantics: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = null; - - // this class - // TODO (Michael Hoffmeister, 2020-08-01): check, if Json has Qualifiers or not - - [MetaModelName("Qualifier.type")] - [TextSearchable] - [CountForHash] - public string type = ""; - - [MetaModelName("Qualifier.valueType")] - [TextSearchable] - [CountForHash] - public string valueType = ""; - - [CountForHash] - public Reference valueId = null; - - [MetaModelName("Qualifier.value")] - [TextSearchable] - [CountForHash] - public string value = null; - - // dead-csharp off - // Remark: due to publication of v2.0.1, the order of elements has changed!!! - // from hasSemantics: - // [XmlElement(ElementName = "semanticId")] - // [JsonIgnore] - // public SemanticId semanticId = null; - // dead-csharp on - - // constructors - - public Qualifier() { } - - public Qualifier(Qualifier src) - { - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - this.type = src.type; - this.value = src.value; - if (src.valueId != null) - this.valueId = new Reference(src.valueId); - } - - public Qualifier(string type, string value) - { - this.type = type; - this.value = value; - } - -#if !DoNotUseAasxCompatibilityModels - public Qualifier(AasxCompatibilityModels.AdminShellV10.Qualifier src) - { - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - this.type = src.qualifierType; - this.value = src.qualifierValue; - if (src.qualifierValueId != null) - this.valueId = new Reference(src.qualifierValueId); - } -#endif - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Qualifier", "Qfr"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - - // ReSharper disable MethodOverloadWithOptionalParameter .. this seems to work, anyhow - // ReSharper disable RedundantArgumentDefaultValue - public string ToString(int format = 0, string delimiter = ",") - { - var res = "" + type; - if (res == "") - res += "" + semanticId?.ToString(format, delimiter); - - if (value != null) - res += " = " + value; - else if (valueId != null) - res += " = " + valueId?.ToString(format, delimiter); - - return res; - } - - public override string ToString() - { - return this.ToString(0); - } - // ReSharper enable MethodOverloadWithOptionalParameter - // ReSharper enable RedundantArgumentDefaultValue - - public static Qualifier Parse(string input) - { - var m = Regex.Match(input, @"\s*([^,]*)(,[^=]+){0,1}\s*=\s*([^,]*)(,.+){0,1}\s*"); - if (!m.Success) - return null; - - return new Qualifier() - { - type = m.Groups[1].ToString().Trim(), - semanticId = SemanticId.Parse(m.Groups[1].ToString().Trim()), - value = m.Groups[3].ToString().Trim(), - valueId = Reference.Parse(m.Groups[1].ToString().Trim()) - }; - } - } - - /// - /// This class holds some convenience functions for Qualifiers - /// - public class QualifierCollection : List - { - public QualifierCollection() - { - - } - -#if !DoNotUseAasxCompatibilityModels - public QualifierCollection( - List src, bool shallowCopy = false) - - { - if (src != null && src.Count != 0) - { - foreach (var q in src) - { - this.Add(new Qualifier(q)); - } - } - } -#endif - - /// - /// Add qualifier. If null, do nothing - /// - public new void Add(Qualifier q) - { - if (q == null) - return; - base.Add(q); - } - - public Qualifier FindType(string type) - { - if (type == null) - return null; - foreach (var q in this) - if (q != null && q.type != null && q.type.Trim() == type.Trim()) - return q; - return null; - } - - public Qualifier FindSemanticId(SemanticId semId) - { - if (semId == null) - return null; - foreach (var q in this) - if (q != null && q.semanticId != null && q.semanticId.Matches(semId)) - return q; - return null; - } - - // ReSharper disable MethodOverloadWithOptionalParameter .. this seems to work, anyhow - // ReSharper disable RedundantArgumentDefaultValue - public string ToString(int format = 0, string delimiter = ";", string referencesDelimiter = ",") - { - var res = ""; - foreach (var q in this) - { - if (res != "") - res += delimiter; - res += q.ToString(format, referencesDelimiter); - } - return res; - } - - public override string ToString() - { - return this.ToString(0); - } - // ReSharper enable MethodOverloadWithOptionalParameter - // ReSharper enable RedundantArgumentDefaultValue - - // for convenience methods of Submodel, SubmodelElement - - public static void AddQualifier( - ref QualifierCollection qualifiers, - Qualifier q) - { - if (q == null) - return; - if (qualifiers == null) - qualifiers = new QualifierCollection(); - qualifiers.Add(q); - } - - public static void AddQualifier( - ref QualifierCollection qualifiers, - string qualifierType = null, string qualifierValue = null, KeyList semanticKeys = null, - Reference qualifierValueId = null) - { - if (qualifiers == null) - qualifiers = new QualifierCollection(); - var q = new Qualifier() - { - type = qualifierType, - value = qualifierValue, - valueId = qualifierValueId, - }; - if (semanticKeys != null) - q.semanticId = SemanticId.CreateFromKeys(semanticKeys); - qualifiers.Add(q); - } - - public static Qualifier HasQualifierOfType( - QualifierCollection qualifiers, - string qualifierType) - { - if (qualifiers == null || qualifierType == null) - return null; - foreach (var q in qualifiers) - if (q.type.Trim().ToLower() == qualifierType.Trim().ToLower()) - return q; - return null; - } - - public IEnumerable FindAllQualifierType(string qualifierType) - { - if (qualifierType == null) - yield break; - foreach (var q in this) - if (q.type.Trim().ToLower() == qualifierType.Trim().ToLower()) - yield return q; - } - } - - public class ListOfSubmodelElement : List - { - // conversion to other list - - public KeyList ToKeyList() - { - var res = new KeyList(); - foreach (var sme in this) - res.Add(sme.ToKey()); - return res; - } - - public Reference GetReference() - { - return Reference.CreateNew(ToKeyList()); - } - } - - public class SubmodelElement : Referable, System.IDisposable, IGetReference, IGetSemanticId, IGetQualifiers - { - // constants - public static Type[] PROP_MLP = new Type[] { - typeof(AdminShell.MultiLanguageProperty), typeof(AdminShell.Property) }; - - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // do this in order to be IDisposable, that is: suitable for (using) - void System.IDisposable.Dispose() { } - public void GetData() { } - - // from HasKind - [XmlElement(ElementName = "kind")] - [JsonIgnore] - public ModelingKind kind = new ModelingKind(); - [XmlIgnore] - [JsonProperty(PropertyName = "kind")] - public string JsonKind - { - get - { - if (kind == null) - return null; - return kind.kind; - } - set - { - if (kind == null) - kind = new ModelingKind(); - kind.kind = value; - } - } - - // from hasSemanticId: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = new SemanticId(); - public SemanticId GetSemanticId() { return semanticId; } - - // from Qualifiable: - [XmlArray("qualifier")] - [XmlArrayItem("qualifier")] - [JsonProperty(PropertyName = "constraints")] - public QualifierCollection qualifiers = null; - public QualifierCollection GetQualifiers() => qualifiers; - - // from hasDataSpecification: - [XmlElement(ElementName = "embeddedDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // getter / setter - - // constructors / creators - - public SubmodelElement() - : base() { } - - public SubmodelElement(SubmodelElement src) - : base(src) - { - if (src == null) - return; - if (src.hasDataSpecification != null) - hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.semanticId != null) - semanticId = new SemanticId(src.semanticId); - if (src.kind != null) - kind = new ModelingKind(src.kind); - if (src.qualifiers != null) - { - if (qualifiers == null) - qualifiers = new QualifierCollection(); - foreach (var q in src.qualifiers) - qualifiers.Add(new Qualifier(q)); - } - } - -#if !DoNotUseAasxCompatibilityModels - public SubmodelElement(AasxCompatibilityModels.AdminShellV10.SubmodelElement src) - : base(src) - { - if (src.hasDataSpecification != null) - hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.semanticId != null) - semanticId = new SemanticId(src.semanticId); - if (src.kind != null) - kind = new ModelingKind(src.kind); - if (src.qualifiers != null) - { - if (qualifiers == null) - qualifiers = new QualifierCollection(src.qualifiers); - foreach (var q in src.qualifiers) - qualifiers.Add(new Qualifier(q)); - } - } -#endif - - public static T CreateNew(string idShort = null, string category = null, Reference semanticId = null) - where T : SubmodelElement, new() - { - var res = new T(); - if (idShort != null) - res.idShort = idShort; - if (category != null) - res.category = category; - if (semanticId != null) - res.semanticId = new SemanticId(semanticId); - return res; - } - - public void CreateNewLogic(string idShort = null, string category = null, Key semanticIdKey = null) - { - if (idShort != null) - this.idShort = idShort; - if (category != null) - this.category = category; - if (semanticIdKey != null) - { - if (this.semanticId == null) - this.semanticId = new SemanticId(); - this.semanticId.Keys.Add(semanticIdKey); - } - } - - public void AddQualifier( - Qualifier q) - { - QualifierCollection.AddQualifier( - ref this.qualifiers, q); - } - - public void AddQualifier( - string qualifierType = null, string qualifierValue = null, KeyList semanticKeys = null, - Reference qualifierValueId = null) - { - QualifierCollection.AddQualifier( - ref this.qualifiers, qualifierType, qualifierValue, semanticKeys, qualifierValueId); - } - - public Qualifier HasQualifierOfType(string qualifierType) - { - return QualifierCollection.HasQualifierOfType(this.qualifiers, qualifierType); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("SubmodelElement", "SME"); - } - - public override Reference GetReference(bool includeParents = true) - { - Reference r = new Reference(); - // this is the tail of our referencing chain .. - r.Keys.Add(Key.CreateNew(GetElementName(), true, "IdShort", this.idShort)); - // try to climb up .. - var current = this.parent; - while (includeParents && current != null) - { - if (current is Identifiable cid) - { - // add big information set - r.Keys.Insert(0, Key.CreateNew( - current.GetElementName(), - true, - cid.identification.idType, - cid.identification.id)); - } - else - if (current is Referable crf) - { - // reference via idShort - r.Keys.Insert(0, Key.CreateNew( - current.GetElementName(), - true, - "IdShort", crf.idShort)); - } - - if (current is Referable crf2) - current = crf2.parent; - else - current = null; - } - return r; - } - - public IEnumerable FindAllParents( - Predicate p, - bool includeThis = false, bool includeSubmodel = false, - bool passOverMiss = false) - { - // call for this? - if (includeThis) - { - if (p == null || p.Invoke(this)) - yield return this; - else - if (!passOverMiss) - yield break; - } - - // daisy chain all parents .. - if (this.parent != null) - { - if (this.parent is SubmodelElement psme) - { - foreach (var q in psme.FindAllParents(p, includeThis: true, - passOverMiss: passOverMiss)) - yield return q; - } - else if (includeSubmodel && this.parent is Submodel psm) - { - if (p == null || p.Invoke(psm)) - yield return this; - } - } - } - - public IEnumerable FindAllParentsWithSemanticId( - SemanticId semId, - bool includeThis = false, bool includeSubmodel = false, bool passOverMiss = false) - { - return (FindAllParents( - (rf) => (true == (rf as IGetSemanticId)?.GetSemanticId()?.Matches(semId, - matchMode: Key.MatchMode.Relaxed)), - includeThis: includeThis, includeSubmodel: includeSubmodel, passOverMiss: passOverMiss)); - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV20.EvalToNonNullString("\"{0}\" ", idShort, ""); - var info = ""; - // TODO (MIHO, 2021-07-08): obvious error .. info should receive semanticId .. but would change - // display presentation .. therefore to be checked again - if (semanticId != null) - AdminShellUtilV20.EvalToNonEmptyString("\u21e8 {0}", semanticId.ToString(), ""); - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - public virtual string ValueAsText(string defaultLang = null) - { - return ""; - } - - public virtual double? ValueAsDouble() - { - return null; - } - - public virtual void ValueFromText(string text, string defaultLang = null) - { - } - - // validation - - public override void Validate(AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check - base.Validate(results); - ModelingKind.Validate(results, kind, this); - KeyList.Validate(results, semanticId?.Keys, this); - } - } - - [XmlType(TypeName = "submodelElement")] - public class SubmodelElementWrapper - { - - // members - - [XmlElement(ElementName = "property", Type = typeof(Property))] - [XmlElement(ElementName = "multiLanguageProperty", Type = typeof(MultiLanguageProperty))] - [XmlElement(ElementName = "range", Type = typeof(Range))] - [XmlElement(ElementName = "file", Type = typeof(File))] - [XmlElement(ElementName = "blob", Type = typeof(Blob))] - [XmlElement(ElementName = "referenceElement", Type = typeof(ReferenceElement))] - [XmlElement(ElementName = "relationshipElement", Type = typeof(RelationshipElement))] - [XmlElement(ElementName = "annotatedRelationshipElement", Type = typeof(AnnotatedRelationshipElement))] - [XmlElement(ElementName = "capability", Type = typeof(Capability))] - [XmlElement(ElementName = "submodelElementCollection", Type = typeof(SubmodelElementCollection))] - [XmlElement(ElementName = "operation", Type = typeof(Operation))] - [XmlElement(ElementName = "basicEvent", Type = typeof(BasicEvent))] - [XmlElement(ElementName = "entity", Type = typeof(Entity))] - public SubmodelElement submodelElement; - - // element names - public enum AdequateElementEnum - { - Unknown = 0, SubmodelElementCollection, Property, MultiLanguageProperty, Range, File, Blob, - ReferenceElement, RelationshipElement, AnnotatedRelationshipElement, Capability, Operation, - BasicEvent, Entity - } - - public static AdequateElementEnum[] AdequateElementsDataElement = - { - AdequateElementEnum.SubmodelElementCollection, AdequateElementEnum.RelationshipElement, - AdequateElementEnum.AnnotatedRelationshipElement, AdequateElementEnum.Capability, - AdequateElementEnum.Operation, AdequateElementEnum.BasicEvent, AdequateElementEnum.Entity - }; - - public static string[] AdequateElementNames = { "Unknown", "SubmodelElementCollection", "Property", - "MultiLanguageProperty", "Range", "File", "Blob", "ReferenceElement", "RelationshipElement", - "AnnotatedRelationshipElement", "Capability", "Operation", "BasicEvent", "Entity" }; - - public static string[] AdequateElementShortName = { null, "SMC", null, - "MLP", null, null, null, "Ref", "Rel", - "ARel", null, null, "Event", "Entity" }; - - // constructors - - public SubmodelElementWrapper() { } - - // cloning - - public SubmodelElementWrapper(SubmodelElement src, bool shallowCopy = false) - { - /* TODO (MIHO, 2021-08-12): consider using: - Activator.CreateInstance(pl.GetType(), new object[] { pl }) */ - - if (src is SubmodelElementCollection) - this.submodelElement = new SubmodelElementCollection( - src as SubmodelElementCollection, shallowCopy: shallowCopy); - if (src is Property) - this.submodelElement = new Property(src as Property); - if (src is MultiLanguageProperty) - this.submodelElement = new MultiLanguageProperty(src as MultiLanguageProperty); - if (src is Range) - this.submodelElement = new Range(src as Range); - if (src is File) - this.submodelElement = new File(src as File); - if (src is Blob) - this.submodelElement = new Blob(src as Blob); - if (src is ReferenceElement) - this.submodelElement = new ReferenceElement(src as ReferenceElement); - if (src is RelationshipElement) - this.submodelElement = new RelationshipElement(src as RelationshipElement); - if (src is AnnotatedRelationshipElement) - this.submodelElement = new AnnotatedRelationshipElement(src as AnnotatedRelationshipElement); - if (src is Capability) - this.submodelElement = new Capability(src as Capability); - if (src is Operation) - this.submodelElement = new Operation(src as Operation); - if (src is BasicEvent) - this.submodelElement = new BasicEvent(src as BasicEvent); - if (src is Entity) - this.submodelElement = new Entity(src as Entity); - } - -#if !DoNotUseAasxCompatibilityModels - public SubmodelElementWrapper( - AasxCompatibilityModels.AdminShellV10.SubmodelElement src, bool shallowCopy = false) - { - if (src is AasxCompatibilityModels.AdminShellV10.SubmodelElementCollection) - this.submodelElement = new SubmodelElementCollection( - src as AasxCompatibilityModels.AdminShellV10.SubmodelElementCollection, - shallowCopy: shallowCopy); - if (src is AasxCompatibilityModels.AdminShellV10.Property) - this.submodelElement = new Property(src as AasxCompatibilityModels.AdminShellV10.Property); - if (src is AasxCompatibilityModels.AdminShellV10.File) - this.submodelElement = new File(src as AasxCompatibilityModels.AdminShellV10.File); - if (src is AasxCompatibilityModels.AdminShellV10.Blob) - this.submodelElement = new Blob(src as AasxCompatibilityModels.AdminShellV10.Blob); - if (src is AasxCompatibilityModels.AdminShellV10.ReferenceElement) - this.submodelElement = new ReferenceElement( - src as AasxCompatibilityModels.AdminShellV10.ReferenceElement); - if (src is AasxCompatibilityModels.AdminShellV10.RelationshipElement) - this.submodelElement = new RelationshipElement( - src as AasxCompatibilityModels.AdminShellV10.RelationshipElement); - if (src is AasxCompatibilityModels.AdminShellV10.Operation) - this.submodelElement = new Operation(src as AasxCompatibilityModels.AdminShellV10.Operation); - } -#endif - - public static string GetAdequateName(AdequateElementEnum ae) - { - return AdequateElementNames[(int)ae]; - } - - /// - /// Deprecated. See below. - /// - public static AdequateElementEnum GetAdequateEnum(string adequateName) - { - if (adequateName == null) - return AdequateElementEnum.Unknown; - - foreach (var en in (AdequateElementEnum[])Enum.GetValues(typeof(AdequateElementEnum))) - if (Enum.GetName(typeof(AdequateElementEnum), en)?.Trim().ToLower() == - adequateName.Trim().ToLower()) - return en; - - return AdequateElementEnum.Unknown; - } - - /// - /// This version uses the element name array and allows using ShortName - /// - public static AdequateElementEnum GetAdequateEnum2(string adequateName, bool useShortName = false) - { - if (adequateName == null) - return AdequateElementEnum.Unknown; - - foreach (var en in (AdequateElementEnum[])Enum.GetValues(typeof(AdequateElementEnum))) - if (((int)en < AdequateElementNames.Length - && AdequateElementNames[(int)en].Trim().ToLower() == adequateName.Trim().ToLower()) - || (useShortName - && (int)en < AdequateElementShortName.Length - && AdequateElementShortName[(int)en] != null - && AdequateElementShortName[(int)en].Trim().ToLower() == adequateName.Trim().ToLower())) - return en; - - return AdequateElementEnum.Unknown; - } - - public static IEnumerable GetAdequateEnums( - AdequateElementEnum[] excludeValues = null, AdequateElementEnum[] includeValues = null) - { - if (includeValues != null) - { - foreach (var en in includeValues) - yield return en; - } - else - { - foreach (var en in (AdequateElementEnum[])Enum.GetValues(typeof(AdequateElementEnum))) - { - if (en == AdequateElementEnum.Unknown) - continue; - if (excludeValues != null && excludeValues.Contains(en)) - continue; - yield return en; - } - } - } - - /// - /// Introduced for JSON serialization, can create SubModelElements based on a string name - /// - public static SubmodelElement CreateAdequateType(AdequateElementEnum ae, SubmodelElement src = null) - { - if (ae == AdequateElementEnum.Property) - return new Property(src); - if (ae == AdequateElementEnum.MultiLanguageProperty) - return new MultiLanguageProperty(src); - if (ae == AdequateElementEnum.Range) - return new Range(src); - if (ae == AdequateElementEnum.File) - return new File(src); - if (ae == AdequateElementEnum.Blob) - return new Blob(src); - if (ae == AdequateElementEnum.ReferenceElement) - return new ReferenceElement(src); - if (ae == AdequateElementEnum.RelationshipElement) - return new RelationshipElement(src); - if (ae == AdequateElementEnum.AnnotatedRelationshipElement) - return new AnnotatedRelationshipElement(src); - if (ae == AdequateElementEnum.Capability) - return new Capability(src); - if (ae == AdequateElementEnum.SubmodelElementCollection) - return new SubmodelElementCollection(src); - if (ae == AdequateElementEnum.Operation) - return new Operation(src); - if (ae == AdequateElementEnum.BasicEvent) - return new BasicEvent(src); - if (ae == AdequateElementEnum.Entity) - return new Entity(src); - return null; - } - - /// - /// Introduced for JSON serialization, can create SubModelElements based on a string name - /// - /// string name (standard PascalCased) - public static SubmodelElement CreateAdequateType(string elementName) - { - return CreateAdequateType(GetAdequateEnum(elementName)); - } - - /// - /// Can create SubmodelElements based on a given type information - /// - /// Type of the SME to be created - /// SubmodelElement or null - public static SubmodelElement CreateAdequateType(Type t) - { - if (t == null || !t.IsSubclassOf(typeof(AdminShell.SubmodelElement))) - return null; - var sme = Activator.CreateInstance(t) as SubmodelElement; - return sme; - } - - public string GetElementAbbreviation() - { - if (submodelElement == null) - return ("Null"); - var dsc = submodelElement.GetSelfDescription(); - if (dsc?.ElementAbbreviation == null) - return ("Null"); - return dsc.ElementAbbreviation; - } - - public static string GetElementNameByAdequateType(SubmodelElement sme) - { - // access - var sd = sme.GetSelfDescription(); - if (sd == null || sd.ElementEnum == AdequateElementEnum.Unknown) - return null; - var en = sd.ElementEnum; - - // get the names - string res = null; - if ((int)en < AdequateElementNames.Length) - res = AdequateElementNames[(int)en].Trim(); - if ((int)en < AdequateElementShortName.Length && AdequateElementShortName[(int)en] != null) - res = AdequateElementShortName[(int)en].Trim(); - return res; - } - - public static ListOfSubmodelElement ListOfWrappersToListOfElems(List wrappers) - { - var res = new ListOfSubmodelElement(); - if (wrappers == null) - return res; - foreach (var w in wrappers) - if (w.submodelElement != null) - res.Add(w.submodelElement); - return res; - } - - public static SubmodelElementWrapper CreateFor(SubmodelElement sme) - { - var res = new SubmodelElementWrapper() { submodelElement = sme }; - return res; - } - - public static Referable FindReferableByReference( - List wrappers, Reference rf, int keyIndex) - { - return FindReferableByReference(wrappers, rf?.Keys, keyIndex); - } - - public static Referable FindReferableByReference( - List wrappers, KeyList rf, int keyIndex) - { - // first index needs to exist .. - if (wrappers == null || rf == null || keyIndex >= rf.Count) - return null; - - // as SubmodelElements are not Identifiables, the actual key shall be IdShort - if (rf[keyIndex].idType.Trim().ToLower() != Key.GetIdentifierTypeName( - Key.IdentifierType.IdShort).Trim().ToLower()) - return null; - - // over all wrappers - foreach (var smw in wrappers) - if (smw.submodelElement != null && - smw.submodelElement.idShort.Trim().ToLower() == rf[keyIndex].value.Trim().ToLower()) - { - // match on this level. Did we find a leaf element? - if ((keyIndex + 1) >= rf.Count) - return smw.submodelElement; - - // dive into SMC? - if (smw.submodelElement is SubmodelElementCollection smc) - { - var found = FindReferableByReference(smc.value, rf, keyIndex + 1); - if (found != null) - return found; - } - - // dive into Entity statements? - if (smw.submodelElement is Entity ent) - { - var found = FindReferableByReference(ent.statements, rf, keyIndex + 1); - if (found != null) - return found; - } - - // else: - return null; - } - - // no? - return null; - } - - // typecasting wrapper into specific type - public T GetAs() where T : SubmodelElement - { - var x = (this.submodelElement) as T; - return x; - } - - } - - public class SubmodelElementWrapperCollection : BaseSubmodelElementWrapperCollection - { - public SubmodelElementWrapperCollection() : base() { } - - public SubmodelElementWrapperCollection(SubmodelElementWrapper smw) : base(smw) { } - - public SubmodelElementWrapperCollection(SubmodelElement sme) : base(sme) { } - - public SubmodelElementWrapperCollection(SubmodelElementWrapperCollection other) : base(other) { } - } - - public class DataElementWrapperCollection : BaseSubmodelElementWrapperCollection - { - public DataElementWrapperCollection() : base() { } - - public DataElementWrapperCollection(SubmodelElementWrapperCollection other) - : base(other) - { - } - - public DataElementWrapperCollection(DataElementWrapperCollection other) - : base() - { - foreach (var wo in other) - this.Add(wo); - } - } - - /// - /// Provides some more functionalities for searching specific elements, e.g. in a SMEC - /// - // OZ - // Resharper disable UnusedTypeParameter - public class BaseSubmodelElementWrapperCollection : List - where ELEMT : SubmodelElement - { - // Resharper enable UnusedTypeParameter - - // member: Parent - // will be held correctly by the containing class - public Referable Parent = null; - - // constructors - - public BaseSubmodelElementWrapperCollection() : base() { } - - public BaseSubmodelElementWrapperCollection(SubmodelElementWrapperCollection other) - : base() - { - if (other == null) - return; - - foreach (var smw in other) - this.Add(new SubmodelElementWrapper(smw.submodelElement)); - } - - public BaseSubmodelElementWrapperCollection(SubmodelElementWrapper smw) - : base() - { - if (smw != null) - this.Add(smw); - } - - public BaseSubmodelElementWrapperCollection(SubmodelElement sme) - : base() - { - if (sme != null) - this.Add(new SubmodelElementWrapper(sme)); - } - - // better find functions - - public IEnumerable FindDeep(Predicate match = null) where T : SubmodelElement - { - foreach (var smw in this) - { - var current = smw.submodelElement; - if (current == null) - continue; - - // call lambda for this element - if (current is T) - if (match == null || match.Invoke(current as T)) - yield return current as T; - - // dive into? - // TODO (MIHO, 2020-07-31): would be nice to use IEnumerateChildren for this .. - if (current is SubmodelElementCollection smc && smc.value != null) - foreach (var x in smc.value.FindDeep(match)) - yield return x; - - if (current is AnnotatedRelationshipElement are && are.annotations != null) - foreach (var x in are.annotations.FindDeep(match)) - yield return x; - - if (current is Entity ent && ent.statements != null) - foreach (var x in ent.statements.FindDeep(match)) - yield return x; - - if (current is Operation op) - for (int i = 0; i < 2; i++) - if (Operation.GetWrappers(op[i]) != null) - foreach (var x in Operation.GetWrappers(op[i]).FindDeep(match)) - yield return x; - } - } - - public IEnumerable FindAllIdShort(string idShort) - { - foreach (var smw in this) - if (smw.submodelElement != null) - if (smw.submodelElement.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - yield return smw; - } - - public IEnumerable FindAllIdShortAs(string idShort) where T : SubmodelElement - { - foreach (var smw in this) - if (smw.submodelElement != null && smw.submodelElement is T) - if (smw.submodelElement.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - yield return smw.submodelElement as T; - } - - public SubmodelElementWrapper FindFirstIdShort(string idShort) - { - return FindAllIdShort(idShort)?.FirstOrDefault(); - } - - public T FindFirstIdShortAs(string idShort) where T : SubmodelElement - { - return FindAllIdShortAs(idShort)?.FirstOrDefault(); - } - - public IEnumerable FindAllSemanticId( - Key semId, Type[] allowedTypes = null, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - foreach (var smw in this) - if (smw.submodelElement != null && smw.submodelElement.semanticId != null) - { - if (smw.submodelElement == null) - continue; - - if (allowedTypes != null) - { - var smwt = smw.submodelElement.GetType(); - if (!allowedTypes.Contains(smwt)) - continue; - } - - if (smw.submodelElement.semanticId.MatchesExactlyOneKey(semId, matchMode)) - yield return smw; - } - } - - public IEnumerable FindAllSemanticIdAs(Key semId, Key.MatchMode matchMode = Key.MatchMode.Strict) - where T : SubmodelElement - { - foreach (var smw in this) - if (smw.submodelElement != null && smw.submodelElement is T - && smw.submodelElement.semanticId != null) - if (smw.submodelElement.semanticId.MatchesExactlyOneKey(semId, matchMode)) - yield return smw.submodelElement as T; - } - - public IEnumerable FindAllSemanticIdAs(Reference semId, - Key.MatchMode matchMode = Key.MatchMode.Strict) - where T : SubmodelElement - { - foreach (var smw in this) - if (smw.submodelElement != null && smw.submodelElement is T - && smw.submodelElement.semanticId != null) - if (smw.submodelElement.semanticId.Matches(semId, matchMode)) - yield return smw.submodelElement as T; - } - - public IEnumerable FindAllSemanticIdAs(ConceptDescription cd, - Key.MatchMode matchMode = Key.MatchMode.Strict) - where T : SubmodelElement - { - foreach (var x in FindAllSemanticIdAs(cd.GetReference(), matchMode)) - yield return x; - } - - public SubmodelElementWrapper FindFirstSemanticId( - Key semId, Type[] allowedTypes = null, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - return FindAllSemanticId(semId, allowedTypes, matchMode)?.FirstOrDefault(); - } - - public SubmodelElementWrapper FindFirstAnySemanticId( - Key[] semId, Type[] allowedTypes = null, Key.MatchMode matchMode = Key.MatchMode.Strict) - { - if (semId == null) - return null; - foreach (var si in semId) - { - var found = FindAllSemanticId(si, allowedTypes, matchMode)? - .FirstOrDefault(); - if (found != null) - return found; - } - return null; - } - - public T FindFirstSemanticIdAs(Key semId, Key.MatchMode matchMode = Key.MatchMode.Strict) - where T : SubmodelElement - { - return FindAllSemanticIdAs(semId, matchMode)?.FirstOrDefault(); - } - - public T FindFirstAnySemanticIdAs(Key[] semId, Key.MatchMode matchMode = Key.MatchMode.Strict) - where T : SubmodelElement - { - if (semId == null) - return null; - foreach (var si in semId) - { - var found = FindAllSemanticIdAs(si, matchMode)?.FirstOrDefault(); - if (found != null) - return found; - } - return null; - } - - public T FindFirstSemanticIdAs(Reference semId, Key.MatchMode matchMode = Key.MatchMode.Strict) - where T : SubmodelElement - { - return FindAllSemanticIdAs(semId, matchMode)?.FirstOrDefault(); - } - - /* TODO (MIHO, 2021-10-18): there are overlaps of this new function with - * this old function: FindFirstAnySemanticId(Key[] semId .. - * clarify/ refactor */ - public IEnumerable FindAllSemanticId( - Key[] allowedSemId, Key.MatchMode matchMode = Key.MatchMode.Strict, - bool invertAllowed = false) - where T : SubmodelElement - { - if (allowedSemId == null || allowedSemId.Length < 1) - yield break; - - foreach (var smw in this) - { - if (smw.submodelElement == null || !(smw.submodelElement is T)) - continue; - - if (smw.submodelElement.semanticId == null || smw.submodelElement.semanticId.Count < 1) - { - if (invertAllowed) - yield return smw.submodelElement as T; - continue; - } - - var found = false; - foreach (var semId in allowedSemId) - if (smw.submodelElement.semanticId.MatchesExactlyOneKey(semId, matchMode)) - { - found = true; - break; - } - - if (invertAllowed) - found = !found; - - if (found) - yield return smw.submodelElement as T; - } - } - - public T FindFirstAnySemanticId( - Key[] allowedSemId, Key.MatchMode matchMode = Key.MatchMode.Strict, - bool invertAllowed = false) - where T : SubmodelElement - { - return FindAllSemanticId(allowedSemId, matchMode, invertAllowed)?.FirstOrDefault(); - } - - // recursion - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. Also a list of parents will be provided to - /// the lambda. This list of parents can be initialized or simply set to null - /// in order to be created automatically. - /// - /// State object to be provided to lambda. Could be null. - /// List of already existing parents to be provided to lambda. - /// Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// - public void RecurseOnReferables( - object state, ListOfReferable parents, - Func lambda) - { - // trivial - if (lambda == null) - return; - if (parents == null) - parents = new ListOfReferable(); - - // over all elements - foreach (var smw in this) - { - var current = smw.submodelElement; - if (current == null) - continue; - - // call lambda for this element - // AND decide, if to recurse! - var goDeeper = lambda(state, parents, current); - - if (goDeeper) - { - // add to parents - parents.Add(current); - - // dive into? - if (current is SubmodelElementCollection smc) - smc.value?.RecurseOnReferables(state, parents, lambda); - - if (current is Entity ent) - ent.statements?.RecurseOnReferables(state, parents, lambda); - - if (current is Operation op) - for (int i = 0; i < 2; i++) - Operation.GetWrappers(op[i])?.RecurseOnReferables(state, parents, lambda); - - if (current is AnnotatedRelationshipElement arel) - arel.annotations?.RecurseOnReferables(state, parents, lambda); - - // remove from parents - parents.RemoveAt(parents.Count - 1); - } - } - } - - // idShort management - - /// - /// Checks, if given idShort is already existing in the collection of SubmodelElements. - /// Trims the string, but does not ignore upper/ lowercase. An empty idShort returns false. - /// - public bool CheckIdShortIsUnique(string idShort) - { - idShort = idShort?.Trim(); - if (idShort == null || idShort.Length < 1) - return false; - - var res = true; - foreach (var smw in this) - if (smw.submodelElement != null && smw.submodelElement.idShort != null && - smw.submodelElement.idShort == idShort) - { - res = false; - break; - } - - return res; - } - - /// - /// The string idShortTemplate shall contain Format.String partt such as {0}. - /// A int-Parameter is as long incremented, until the resulting idShort proves - /// to be unique in the collection of SubmodelElements or maxNum is reached. - /// Returns null in case of any error. - /// - public string IterateIdShortTemplateToBeUnique(string idShortTemplate, int maxNum) - { - if (idShortTemplate == null || maxNum < 1 || !idShortTemplate.Contains("{0")) - return null; - - int i = 1; - while (i < maxNum) - { - var ids = String.Format(idShortTemplate, i); - if (this.CheckIdShortIsUnique(ids)) - return ids; - i++; - } - - return null; - } - - // give more direct access to SMEs - - /// - /// Add sme by creating a SubmodelElementWrapper for it and adding to this collection. - /// - public void Add(SubmodelElement sme) - { - if (sme == null) - return; - sme.parent = this.Parent; - this.Add(SubmodelElementWrapper.CreateFor(sme)); - } - - /// - /// Add sme by creating a SubmodelElementWrapper for it and adding to this collection. - /// - public void Insert(int index, SubmodelElement sme) - { - if (sme == null || index < 0 || index >= this.Count) - return; - sme.parent = this.Parent; - this.Insert(index, SubmodelElementWrapper.CreateFor(sme)); - } - - /// - /// Finds the first (shall be only 1!) SubmodelElementWrapper with SubmodelElement sme. - /// - public SubmodelElementWrapper FindSubModelElement(SubmodelElement sme) - { - if (sme != null) - foreach (var smw in this) - if (smw?.submodelElement == sme) - return smw; - return null; - } - - /// - /// Removes the first (shall be only 1!) SubmodelElementWrapper with SubmodelElement sme. - /// - public void Remove(SubmodelElement sme) - { - if (sme == null) - return; - var found = FindSubModelElement(sme); - if (found != null) - this.Remove(found); - } - - // a little more business logic - - public T CreateSMEForCD(ConceptDescription cd, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false, bool isTemplate = false) - where T : SubmodelElement, new() - { - // access - if (cd == null) - return null; - - // try to potentially figure out idShort - var ids = cd.idShort; - if ((ids == null || ids.Trim() == "") && cd.GetIEC61360() != null) - ids = cd.GetIEC61360().shortName? - .GetDefaultStr(); - if (idShort != null) - ids = idShort; - if (ids == null) - return null; - - // unique? - if (idxTemplate != null) - ids = this.IterateIdShortTemplateToBeUnique(idxTemplate, maxNum); - - // make a new instance - var sme = new T() - { - idShort = ids, - semanticId = new SemanticId(cd.GetCdReference()) - }; - if (category != null) - sme.category = category; - if (isTemplate) - sme.kind = ModelingKind.CreateAsTemplate(); - - // if its a SMC, make sure its accessible - if (sme is SubmodelElementCollection smc) - smc.value = new SubmodelElementWrapperCollection(); - - // instantanously add it? - if (addSme) - this.Add(sme); - - // give back - return sme; - } - - public T CreateSMEForIdShort(string idShort, string category = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - // access - if (idShort == null) - return null; - - // try to potentially figure out idShort - var ids = idShort; - - // unique? - if (idxTemplate != null) - ids = this.IterateIdShortTemplateToBeUnique(idxTemplate, maxNum); - - // make a new instance - var sme = new T() { idShort = ids }; - if (category != null) - sme.category = category; - - // instantanously add it? - if (addSme) - this.Add(sme); - - // give back - return sme; - } - - // for conversion - - public T AdaptiveConvertTo( - SubmodelElement anySrc, - ConceptDescription createDefault = null, - string idShort = null, bool addSme = false) where T : SubmodelElement, new() - { - if (typeof(T) == typeof(MultiLanguageProperty) - && anySrc is Property srcProp) - { - var res = this.CreateSMEForCD(createDefault, idShort: idShort, addSme: addSme); - if (res is MultiLanguageProperty mlp) - { - mlp.value = new LangStringSet("EN?", srcProp.value); - mlp.valueId = srcProp.valueId; - return res; - } - } - - if (typeof(T) == typeof(Property) - && anySrc is MultiLanguageProperty srcMlp) - { - var res = this.CreateSMEForCD(createDefault, idShort: idShort, addSme: addSme); - if (res is Property prp) - { - prp.value = "" + srcMlp.value?.GetDefaultStr(); - prp.valueId = srcMlp.valueId; - return res; - } - } - - return null; - } - - public T CopyOneSMEbyCopy(Key destSemanticId, - SubmodelElementWrapperCollection sourceSmc, Key[] sourceSemanticId, - ConceptDescription createDefault = null, Action setDefault = null, - Key.MatchMode matchMode = Key.MatchMode.Relaxed, - string idShort = null, bool addSme = false) where T : SubmodelElement, new() - { - // get source - var src = sourceSmc?.FindFirstAnySemanticIdAs(sourceSemanticId, matchMode); - - // may be make an adaptive conversion - if (src == null) - { - var anySrc = sourceSmc?.FindFirstAnySemanticId(sourceSemanticId, matchMode: matchMode); - src = AdaptiveConvertTo(anySrc?.submodelElement, createDefault, - idShort: idShort, addSme: false); - } - - // proceed - var aeSrc = SubmodelElementWrapper.GetAdequateEnum(src?.GetElementName()); - if (src == null || aeSrc == SubmodelElementWrapper.AdequateElementEnum.Unknown) - { - // create a default? - if (createDefault == null) - return null; - - // ok, default - var dflt = this.CreateSMEForCD(createDefault, idShort: idShort, addSme: addSme); - - // set default? - setDefault?.Invoke(dflt); - - // return - return dflt; - } - - // ok, create new one - var dst = SubmodelElementWrapper.CreateAdequateType(aeSrc, src) as T; - if (dst == null) - return null; - - // make same things sure - dst.idShort = src.idShort; - dst.category = src.category; - dst.semanticId = new SemanticId(destSemanticId); - - // instantanously add it? - if (addSme) - this.Add(dst); - - // give back - return dst; - } - - public T CopyOneSMEbyCopy(ConceptDescription destCD, - SubmodelElementWrapperCollection sourceSmc, ConceptDescription sourceCD, - bool createDefault = false, Action setDefault = null, - Key.MatchMode matchMode = Key.MatchMode.Relaxed, - string idShort = null, bool addSme = false) where T : SubmodelElement, new() - { - return this.CopyOneSMEbyCopy(destCD?.GetSingleKey(), sourceSmc, new[] { sourceCD?.GetSingleKey() }, - createDefault ? destCD : null, setDefault, matchMode, idShort, addSme); - } - - public T CopyOneSMEbyCopy(ConceptDescription destCD, - SubmodelElementWrapperCollection sourceSmc, Key[] sourceKeys, - bool createDefault = false, Action setDefault = null, - Key.MatchMode matchMode = Key.MatchMode.Relaxed, - string idShort = null, bool addSme = false) where T : SubmodelElement, new() - { - return this.CopyOneSMEbyCopy(destCD?.GetSingleKey(), sourceSmc, sourceKeys, - createDefault ? destCD : null, setDefault, matchMode, idShort, addSme); - } - - public void CopyManySMEbyCopy(Key destSemanticId, - SubmodelElementWrapperCollection sourceSmc, Key sourceSemanticId, - ConceptDescription createDefault = null, Action setDefault = null, - Key.MatchMode matchMode = Key.MatchMode.Relaxed) where T : SubmodelElement, new() - { - // bool find possible sources - bool foundSrc = false; - if (sourceSmc == null) - return; - foreach (var src in sourceSmc.FindAllSemanticIdAs(sourceSemanticId, matchMode)) - { - // type of found src? - var aeSrc = SubmodelElementWrapper.GetAdequateEnum(src?.GetElementName()); - - // ok? - if (src == null || aeSrc == SubmodelElementWrapper.AdequateElementEnum.Unknown) - continue; - foundSrc = true; - - // ok, create new one - var dst = SubmodelElementWrapper.CreateAdequateType(aeSrc, src) as T; - if (dst != null) - { - // make same things sure - dst.idShort = src.idShort; - dst.category = src.category; - dst.semanticId = new SemanticId(destSemanticId); - - // instantanously add it? - this.Add(dst); - } - } - - // default? - if (createDefault != null && !foundSrc) - { - // ok, default - var dflt = this.CreateSMEForCD(createDefault, addSme: true); - - // set default? - setDefault?.Invoke(dflt); - } - } - - public void CopyManySMEbyCopy(ConceptDescription destCD, - SubmodelElementWrapperCollection sourceSmc, ConceptDescription sourceCD, - bool createDefault = false, Action setDefault = null, - Key.MatchMode matchMode = Key.MatchMode.Relaxed) where T : SubmodelElement, new() - { - CopyManySMEbyCopy(destCD.GetSingleKey(), sourceSmc, sourceCD.GetSingleKey(), - createDefault ? destCD : null, setDefault, matchMode); - } - } - - public interface IManageSubmodelElements - { - void Add(SubmodelElement sme); - void Insert(int index, SubmodelElement sme); - void Remove(SubmodelElement sme); - } - - public class Submodel : Identifiable, IManageSubmodelElements, - System.IDisposable, IEnumerateChildren, IFindAllReferences, - IGetSemanticId, IGetQualifiers - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - - // do this in order to be IDisposable, that is: suitable for (using) - void System.IDisposable.Dispose() { } - public void GetData() { } - - // from HasKind - [XmlElement(ElementName = "kind")] - [JsonIgnore] - public ModelingKind kind = new ModelingKind(); - [XmlIgnore] - [JsonProperty(PropertyName = "kind")] - public string JsonKind - { - get - { - if (kind == null) - return null; - return kind.kind; - } - set - { - if (kind == null) - kind = new ModelingKind(); - kind.kind = value; - } - } - - // from hasSemanticId: - [XmlElement(ElementName = "semanticId")] - public SemanticId semanticId = new SemanticId(); - public SemanticId GetSemanticId() { return semanticId; } - - // from Qualifiable: - [XmlArray("qualifier")] - [XmlArrayItem("qualifier")] - public QualifierCollection qualifiers = null; - public QualifierCollection GetQualifiers() => qualifiers; - - // from hasDataSpecification: - [XmlElement(ElementName = "embeddedDataSpecification")] - public HasDataSpecification hasDataSpecification = null; - - // from this very class - [XmlIgnore] - [JsonIgnore] - private SubmodelElementWrapperCollection _submodelElements = null; - - [JsonIgnore] - public SubmodelElementWrapperCollection submodelElements - { - get { return _submodelElements; } - set { _submodelElements = value; _submodelElements.Parent = this; } - } - - [XmlIgnore] - [JsonProperty(PropertyName = "submodelElements")] - public SubmodelElement[] JsonSubmodelElements - { - get - { - var res = new ListOfSubmodelElement(); - if (submodelElements != null) - foreach (var smew in submodelElements) - res.Add(smew.submodelElement); - return res.ToArray(); - } - set - { - if (value != null) - { - this.submodelElements = new SubmodelElementWrapperCollection(); - foreach (var x in value) - { - var smew = new SubmodelElementWrapper() { submodelElement = x }; - this.submodelElements.Add(smew); - } - } - } - } - - // getter / setter - - // constructors / creators - - public Submodel() : base() { } - - public Submodel(Submodel src, bool shallowCopy = false) - : base(src) - { - if (src == null) - return; - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - if (src.kind != null) - this.kind = new ModelingKind(src.kind); - if (!shallowCopy && src.submodelElements != null) - { - if (this.submodelElements == null) - this.submodelElements = new SubmodelElementWrapperCollection(); - foreach (var smw in src.submodelElements) - this.submodelElements.Add(new SubmodelElementWrapper(smw.submodelElement, shallowCopy: false)); - } - } - -#if !DoNotUseAasxCompatibilityModels - public Submodel(AasxCompatibilityModels.AdminShellV10.Submodel src, bool shallowCopy = false) - : base(src) - { - if (src.hasDataSpecification != null) - this.hasDataSpecification = new HasDataSpecification(src.hasDataSpecification); - if (src.semanticId != null) - this.semanticId = new SemanticId(src.semanticId); - if (src.kind != null) - this.kind = new ModelingKind(src.kind); - if (src.qualifiers != null) - this.qualifiers = new QualifierCollection(src.qualifiers); - if (!shallowCopy && src.submodelElements != null) - { - if (this.submodelElements == null) - this.submodelElements = new SubmodelElementWrapperCollection(); - foreach (var smw in src.submodelElements) - this.submodelElements.Add(new SubmodelElementWrapper(smw.submodelElement, shallowCopy: false)); - } - } -#endif - - public static Submodel CreateNew(string idType, string id, string version = null, string revision = null) - { - var s = new Submodel() { identification = new Identification(idType, id) }; - if (version != null) - { - if (s.administration == null) - s.administration = new Administration(); - s.administration.version = version; - s.administration.revision = revision; - } - return (s); - } - - [JsonIgnore] - [XmlIgnore] - public SubmodelElementWrapperCollection SmeForWrite - { - get - { - if (this.submodelElements == null) - this.submodelElements = new SubmodelElementWrapperCollection(); - return this.submodelElements; - } - } - - // from IEnumarateChildren - public IEnumerable EnumerateChildren() - { - if (this.submodelElements != null) - foreach (var smw in this.submodelElements) - yield return smw; - } - - public EnumerationPlacmentBase GetChildrenPlacement(SubmodelElement child) - { - return null; - } - - public object AddChild(SubmodelElementWrapper smw, EnumerationPlacmentBase placement = null) - { - if (smw == null) - return null; - if (this.submodelElements == null) - this.submodelElements = new SubmodelElementWrapperCollection(); - if (smw.submodelElement != null) - smw.submodelElement.parent = this; - this.submodelElements.Add(smw); - return smw; - } - - // from IManageSubmodelElements - public void Add(SubmodelElement sme) - { - if (submodelElements == null) - submodelElements = new SubmodelElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - submodelElements.Add(sew); - } - - public void Insert(int index, SubmodelElement sme) - { - if (submodelElements == null) - submodelElements = new SubmodelElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - if (index < 0 || index >= submodelElements.Count) - return; - submodelElements.Insert(index, sew); - } - - public void Remove(SubmodelElement sme) - { - if (submodelElements != null) - submodelElements.Remove(sme); - } - - // further - - public void AddQualifier( - string qualifierType = null, string qualifierValue = null, KeyList semanticKeys = null, - Reference qualifierValueId = null) - { - QualifierCollection.AddQualifier( - ref this.qualifiers, qualifierType, qualifierValue, semanticKeys, qualifierValueId); - } - - public Qualifier HasQualifierOfType(string qualifierType) - { - return QualifierCollection.HasQualifierOfType(this.qualifiers, qualifierType); - } - - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Submodel", "SM"); - } - - public SubmodelRef GetSubmodelRef() - { - SubmodelRef l = new SubmodelRef(); - l.Keys.Add( - Key.CreateNew( - this.GetElementName(), true, this.identification.idType, this.identification.id)); - return l; - } - - /// - /// If instance, return semanticId as on key. - /// If template, return identification as key. - /// - /// - public Key GetSemanticKey() - { - if (true == this.kind?.IsTemplate) - return new Key(this.GetElementName(), true, this.identification?.idType, this.identification?.id); - else - return this.semanticId?.GetAsExactlyOneKey(); - } - - public void AddDataSpecification(Key k) - { - if (hasDataSpecification == null) - hasDataSpecification = new HasDataSpecification(); - var r = new Reference(); - r.Keys.Add(k); - hasDataSpecification.Add(new EmbeddedDataSpecification(r)); - } - - public SubmodelElementWrapper FindSubmodelElementWrapper(string idShort) - { - if (this.submodelElements == null) - return null; - foreach (var smw in this.submodelElements) - if (smw.submodelElement != null) - if (smw.submodelElement.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - return smw; - return null; - } - - public IEnumerable FindDeep(Predicate match = null) where T : SubmodelElement - { - if (this.submodelElements == null) - yield break; - foreach (var x in this.submodelElements.FindDeep(match)) - yield return x; - } - - public Tuple ToCaptionInfo() - { - var caption = AdminShellUtilV20.EvalToNonNullString("\"{0}\" ", idShort, ""); - if (administration != null) - caption += "V" + administration.version + "." + administration.revision; - var info = ""; - if (identification != null) - info = $"[{identification.idType}, {identification.id}]"; - return Tuple.Create(caption, info); - } - - public override string ToString() - { - var ci = ToCaptionInfo(); - return string.Format("{0}{1}", ci.Item1, (ci.Item2 != "") ? " / " + ci.Item2 : ""); - } - - // Recursing - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// - public void RecurseOnSubmodelElements( - object state, Func lambda) - { - this.submodelElements?.RecurseOnReferables(state, null, (o, par, rf) => - { - if (rf is SubmodelElement sme) - return lambda(o, par, sme); - else - return true; - }); - } - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. Include this element, as well. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// Include this element as well. parents will then - /// include this element as well! - public override void RecurseOnReferables( - object state, Func lambda, - bool includeThis = false) - { - var parents = new ListOfReferable(); - if (includeThis) - { - lambda(state, null, this); - parents.Add(this); - } - this.submodelElements?.RecurseOnReferables(state, parents, lambda); - } - - // Parents stuff - - public static void SetParentsForSME(Referable parent, SubmodelElement se) - { - if (se == null) - return; - - se.parent = parent; - - // via interface enumaration - if (se is IEnumerateChildren) - { - var childs = (se as IEnumerateChildren).EnumerateChildren(); - if (childs != null) - foreach (var c in childs) - SetParentsForSME(se, c.submodelElement); - } - } - - public void SetAllParents() - { - if (this.submodelElements != null) - foreach (var sme in this.submodelElements) - SetParentsForSME(this, sme.submodelElement); - } - - public T CreateSMEForCD(ConceptDescription cd, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - if (this.submodelElements == null) - this.submodelElements = new SubmodelElementWrapperCollection(); - return this.submodelElements.CreateSMEForCD(cd, category, idShort, idxTemplate, maxNum, addSme); - } - - public T CreateSMEForIdShort(string idShort, string category = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - if (this.submodelElements == null) - this.submodelElements = new SubmodelElementWrapperCollection(); - return this.submodelElements.CreateSMEForIdShort(idShort, category, idxTemplate, maxNum, addSme); - } - - // validation - - public override void Validate(AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check - base.Validate(results); - ModelingKind.Validate(results, kind, this); - KeyList.Validate(results, semanticId?.Keys, this); - } - - // find - - public IEnumerable FindAllReferences() - { - // not nice: use temp list - var temp = new List(); - - // recurse - this.RecurseOnSubmodelElements(null, (state, parents, sme) => - { - if (sme is ReferenceElement re) - if (re.value != null) - temp.Add(re.value); - if (sme is RelationshipElement rl) - { - if (rl.first != null) - temp.Add(rl.first); - if (rl.second != null) - temp.Add(rl.second); - } - // recurse - return true; - }); - - // now, give back - foreach (var r in temp) - yield return new LocatedReference(this, r); - } - } - - public class ListOfSubmodels : List, IAasElement - { - // self decscription - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Submodels", "SMS"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - } - - // - // Derived from SubmodelElements - // - - public class DataElement : SubmodelElement - { - public static string ValueType_STRING = "string"; - public static string ValueType_DATE = "date"; - public static string ValueType_BOOLEAN = "boolean"; - - public static string[] ValueTypeItems = new string[] { - "anyType", "complexType", "anySimpleType", "anyAtomicType", "anyURI", "base64Binary", - "boolean", "date", "dateTime", - "dateTimeStamp", "decimal", "integer", "long", "int", "short", "byte", "nonNegativeInteger", - "positiveInteger", - "unsignedLong", "unsignedInt", "unsignedShort", "unsignedByte", "nonPositiveInteger", - "negativeInteger", "double", "duration", - "dayTimeDuration", "yearMonthDuration", "float", "hexBinary", "string", "langString", "time" }; - - public static string[] ValueTypes_Number = new[] { - "decimal", "integer", "long", "int", "short", "byte", "nonNegativeInteger", - "positiveInteger", - "unsignedLong", "unsignedInt", "unsignedShort", "unsignedByte", "nonPositiveInteger", - "negativeInteger", "double", "float" }; - - public DataElement() { } - - public DataElement(SubmodelElement src) : base(src) { } - - public DataElement(DataElement src) : base(src) { } - -#if !DoNotUseAasxCompatibilityModels - public DataElement(AasxCompatibilityModels.AdminShellV10.DataElement src) - : base(src) - { } -#endif - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("DataElement", "DE"); - } - } - - public class JsonValueTypeCast - { - - public class JsonDataObjectType - { - [JsonProperty(PropertyName = "name")] - public string name = ""; - } - - [JsonProperty(PropertyName = "dataObjectType")] - public JsonDataObjectType dataObjectType = new JsonDataObjectType(); - - public JsonValueTypeCast(string name) - { - this.dataObjectType.name = name; - } - } - - public class Property : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - [MetaModelName("Property.valueType")] - [TextSearchable] - [JsonIgnore] - public string valueType = ""; - [XmlIgnore] - [JsonProperty(PropertyName = "valueType")] - public JsonValueTypeCast JsonValueType - { - get { return new JsonValueTypeCast(this.valueType); } - set { this.valueType = value?.dataObjectType?.name; } - } - - - [MetaModelName("Property.value")] - [TextSearchable] - public string value = ""; - public Reference valueId = null; - - // constructors - - public Property() { } - - public Property(SubmodelElement src) - : base(src) - { - if (!(src is Property p)) - return; - this.valueType = p.valueType; - this.value = p.value; - if (p.valueId != null) - valueId = new Reference(p.valueId); - } - -#if !DoNotUseAasxCompatibilityModels - public Property(AasxCompatibilityModels.AdminShellV10.Property src) - : base(src) - { - if (src == null) - return; - - this.valueType = src.valueType; - this.value = src.value; - if (src.valueId != null) - this.valueId = new Reference(src.valueId); - } -#endif - - public static Property CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new Property(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public Property Set(string valueType = "", string value = "") - { - this.valueType = valueType; - this.value = value; - return this; - } - - public Property Set(string type, bool local, string idType, string value) - { - this.valueId = Reference.CreateNew(Key.CreateNew(type, local, idType, value)); - return this; - } - - public Property Set(Qualifier q) - { - if (q != null) - this.AddQualifier(q); - return this; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Property", "Prop", - SubmodelElementWrapper.AdequateElementEnum.Property); - } - - public override string ValueAsText(string defaultLang = null) - { - return "" + value; - } - - public override void ValueFromText(string text, string defaultLang = null) - { - value = "" + text; - } - - public bool IsTrue() - { - if (this.valueType?.Trim().ToLower() == "boolean") - { - var v = "" + this.value?.Trim().ToLower(); - if (v == "true" || v == "1") - return true; - } - return false; - } - - public override double? ValueAsDouble() - { - // pointless - if (this.value == null || this.value.Trim() == "" || this.valueType == null) - return null; - - // type? - var vt = this.valueType.Trim().ToLower(); - if (!DataElement.ValueTypes_Number.Contains(vt)) - return null; - - // try convert - if (double.TryParse(this.value, NumberStyles.Any, CultureInfo.InvariantCulture, out double dbl)) - return dbl; - - // no - return null; - } - - } - - public class MultiLanguageProperty : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public LangStringSet value = new LangStringSet(); - public Reference valueId = null; - - // constructors - - public MultiLanguageProperty() { } - - public MultiLanguageProperty(SubmodelElement src) - : base(src) - { - if (!(src is MultiLanguageProperty mlp)) - return; - - this.value = new LangStringSet(mlp.value); - if (mlp.valueId != null) - valueId = new Reference(mlp.valueId); - } - -#if !DoNotUseAasxCompatibilityModels - // not available in V1.0 -#endif - - public static MultiLanguageProperty CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new MultiLanguageProperty(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("MultiLanguageProperty", "MLP", - SubmodelElementWrapper.AdequateElementEnum.MultiLanguageProperty); - } - - public MultiLanguageProperty Set(LangStringSet ls) - { - this.value = ls; - return this; - } - - public MultiLanguageProperty Set(ListOfLangStr ls) - { - this.value = new LangStringSet(ls); - return this; - } - - public MultiLanguageProperty Set(LangStr ls) - { - if (ls == null) - return this; - if (this.value?.langString == null) - this.value = new LangStringSet(); - this.value.langString[ls.lang] = ls.str; - return this; - } - - public MultiLanguageProperty Set(string lang, string str) - { - return this.Set(new LangStr(lang, str)); - } - - public override string ValueAsText(string defaultLang = null) - { - return "" + value?.GetDefaultStr(defaultLang); - } - - public override void ValueFromText(string text, string defaultLang = null) - { - Set(defaultLang, text); - } - - } - - public class Range : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - [MetaModelName("Range.valueType")] - [TextSearchable] - [JsonIgnore] - [CountForHash] - public string valueType = ""; - - [XmlIgnore] - [JsonProperty(PropertyName = "valueType")] - public JsonValueTypeCast JsonValueType - { - get { return new JsonValueTypeCast(this.valueType); } - set { this.valueType = value?.dataObjectType?.name; } - } - - [MetaModelName("Range.min")] - [TextSearchable] - [CountForHash] - public string min = ""; - - [MetaModelName("Range.max")] - [TextSearchable] - [CountForHash] - public string max = ""; - - // constructors - - public Range() { } - - public Range(SubmodelElement src) - : base(src) - { - if (!(src is Range rng)) - return; - - this.valueType = rng.valueType; - this.min = rng.min; - this.max = rng.max; - } - -#if !DoNotUseAasxCompatibilityModels - // not available in V1.0 -#endif - - public static Range CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new Range(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Range", "Range", - SubmodelElementWrapper.AdequateElementEnum.Range); - } - - public override string ValueAsText(string defaultLang = null) - { - return "" + min + " .. " + max; - } - - } - - public class Blob : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - [MetaModelName("Blob.mimeType")] - [TextSearchable] - [CountForHash] - public string mimeType = ""; - - [MetaModelName("Blob.value")] - [TextSearchable] - [CountForHash] - public string value = ""; - - // constructors - - public Blob() { } - - public Blob(SubmodelElement src) - : base(src) - { - if (!(src is Blob blb)) - return; - - this.mimeType = blb.mimeType; - this.value = blb.value; - } - -#if !DoNotUseAasxCompatibilityModels - public Blob(AasxCompatibilityModels.AdminShellV10.Blob src) - : base(src) - { - if (src == null) - return; - - this.mimeType = src.mimeType; - this.value = src.value; - } -#endif - - public static Blob CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new Blob(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(string mimeType = "", string value = "") - { - this.mimeType = mimeType; - this.value = value; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Blob", "Blob", - SubmodelElementWrapper.AdequateElementEnum.Blob); - } - - } - - public class File : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - [MetaModelName("File.mimeType")] - [TextSearchable] - [CountForHash] - public string mimeType = ""; - - [MetaModelName("File.value")] - [TextSearchable] - [CountForHash] - public string value = ""; - - // constructors - - public File() { } - - public File(SubmodelElement src) - : base(src) - { - if (!(src is File fil)) - return; - - this.mimeType = fil.mimeType; - this.value = fil.value; - } - -#if !DoNotUseAasxCompatibilityModels - public File(AasxCompatibilityModels.AdminShellV10.File src) - : base(src) - { - if (src == null) - return; - - this.mimeType = src.mimeType; - this.value = src.value; - } -#endif - - public static File CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new File(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(string mimeType = "", string value = "") - { - this.mimeType = mimeType; - this.value = value; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("File", "File", - SubmodelElementWrapper.AdequateElementEnum.File); - } - - public static string[] GetPopularMimeTypes() - { - return - new[] { - System.Net.Mime.MediaTypeNames.Text.Plain, - System.Net.Mime.MediaTypeNames.Text.Xml, - System.Net.Mime.MediaTypeNames.Text.Html, - "application/json", - "application/rdf+xml", - System.Net.Mime.MediaTypeNames.Application.Pdf, - System.Net.Mime.MediaTypeNames.Image.Jpeg, - "image/png", - System.Net.Mime.MediaTypeNames.Image.Gif, - "application/iges", - "application/step" - }; - } - - public override string ValueAsText(string defaultLang = null) - { - return "" + value; - } - } - - public class ReferenceElement : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public Reference value = new Reference(); - - // constructors - - public ReferenceElement() { } - - public ReferenceElement(SubmodelElement src) - : base(src) - { - if (!(src is ReferenceElement re)) - return; - - if (re.value != null) - this.value = new Reference(re.value); - } - -#if !DoNotUseAasxCompatibilityModels - public ReferenceElement(AasxCompatibilityModels.AdminShellV10.ReferenceElement src) - : base(src) - { - if (src == null) - return; - - if (src.value != null) - this.value = new Reference(src.value); - } -#endif - - public static ReferenceElement CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new ReferenceElement(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public void Set(Reference value = null) - { - this.value = value; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("ReferenceElement", "Ref", - SubmodelElementWrapper.AdequateElementEnum.ReferenceElement); - } - - } - - public class RelationshipElement : DataElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - public Reference first = new Reference(); - public Reference second = new Reference(); - - // constructors - - public RelationshipElement() { } - - public RelationshipElement(SubmodelElement src) - : base(src) - { - if (!(src is RelationshipElement rel)) - return; - - if (rel.first != null) - this.first = new Reference(rel.first); - if (rel.second != null) - this.second = new Reference(rel.second); - } - -#if !DoNotUseAasxCompatibilityModels - public RelationshipElement(AasxCompatibilityModels.AdminShellV10.RelationshipElement src) - : base(src) - { - if (src == null) - return; - - if (src.first != null) - this.first = new Reference(src.first); - if (src.second != null) - this.second = new Reference(src.second); - } -#endif - - public static RelationshipElement CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null, Reference first = null, - Reference second = null) - { - var x = new RelationshipElement(); - x.CreateNewLogic(idShort, category, semanticIdKey); - x.first = first; - x.second = second; - return (x); - } - - public void Set(Reference first = null, Reference second = null) - { - this.first = first; - this.second = second; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("RelationshipElement", "Rel", - SubmodelElementWrapper.AdequateElementEnum.RelationshipElement); - } - } - - public class AnnotatedRelationshipElement : RelationshipElement, IManageSubmodelElements, IEnumerateChildren - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - - // from this very class - - [JsonIgnore] - [SkipForHash] // do NOT count children! - [XmlArray("annotations")] - [XmlArrayItem("dataElement")] - public DataElementWrapperCollection annotations = null; - - [XmlIgnore] - [JsonProperty(PropertyName = "annotations")] - public DataElement[] JsonAnotations - { - get - { - var res = new List(); - if (annotations != null) - foreach (var smew in annotations) - if (smew.submodelElement is DataElement de) - res.Add(de); - return res.ToArray(); - } - set - { - if (value != null) - { - this.annotations = new DataElementWrapperCollection(); - foreach (var x in value) - { - var smew = new SubmodelElementWrapper() { submodelElement = x }; - this.annotations.Add(smew); - } - } - } - } - - // constructors - - public AnnotatedRelationshipElement() { } - - public AnnotatedRelationshipElement(SubmodelElement src) - : base(src) - { - if (!(src is AnnotatedRelationshipElement arel)) - return; - if (arel.first != null) - this.first = new Reference(arel.first); - if (arel.second != null) - this.second = new Reference(arel.second); - if (arel.annotations != null) - this.annotations = new DataElementWrapperCollection(arel.annotations); - } - - public new static AnnotatedRelationshipElement CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null, - Reference first = null, Reference second = null) - { - var x = new AnnotatedRelationshipElement(); - x.CreateNewLogic(idShort, category, semanticIdKey); - x.first = first; - x.second = second; - return (x); - } - - // enumerates its children - - public IEnumerable EnumerateChildren() - { - if (this.annotations != null) - foreach (var smw in this.annotations) - yield return smw; - } - - public EnumerationPlacmentBase GetChildrenPlacement(SubmodelElement child) - { - return null; - } - - public object AddChild(SubmodelElementWrapper smw, EnumerationPlacmentBase placement = null) - { - if (smw == null || !(smw.submodelElement is DataElement)) - return null; - if (this.annotations == null) - this.annotations = new DataElementWrapperCollection(); - if (smw.submodelElement != null) - smw.submodelElement.parent = this; - this.annotations.Add(smw); - return smw; - } - - // from IManageSubmodelElements - public void Add(SubmodelElement sme) - { - if (annotations == null) - annotations = new DataElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - annotations.Add(sew); - } - - public void Insert(int index, SubmodelElement sme) - { - if (annotations == null) - annotations = new DataElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - if (index < 0 || index >= annotations.Count) - return; - annotations.Insert(index, sew); - } - - public void Remove(SubmodelElement sme) - { - if (annotations != null) - annotations.Remove(sme); - } - - // further - - public new void Set(Reference first = null, Reference second = null) - { - this.first = first; - this.second = second; - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("AnnotatedRelationshipElement", "RelA", - SubmodelElementWrapper.AdequateElementEnum.AnnotatedRelationshipElement); - } - - - } - - public class Capability : SubmodelElement - { - public Capability() { } - - public Capability(SubmodelElement src) - : base(src) - { } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Capability", "Cap", - SubmodelElementWrapper.AdequateElementEnum.Capability); - } - } - - - public class SubmodelElementCollection : SubmodelElement, IManageSubmodelElements, IEnumerateChildren - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // values == SMEs - [XmlIgnore] - [JsonIgnore] - [SkipForHash] // do NOT count children! - private SubmodelElementWrapperCollection _value = null; - - [JsonIgnore] - public SubmodelElementWrapperCollection value - { - get { return _value; } - set { _value = value; _value.Parent = this; } - } - - [XmlIgnore] - [JsonProperty(PropertyName = "value")] - public SubmodelElement[] JsonValue - { - get - { - var res = new ListOfSubmodelElement(); - if (value != null) - foreach (var smew in value) - res.Add(smew.submodelElement); - return res.ToArray(); - } - set - { - if (value != null) - { - this.value = new SubmodelElementWrapperCollection(); - foreach (var x in value) - { - var smew = new SubmodelElementWrapper() { submodelElement = x }; - this.value.Add(smew); - } - } - } - } - - // constant members - public bool ordered = false; - public bool allowDuplicates = false; - - // enumartes its children - - public IEnumerable EnumerateChildren() - { - if (this.value != null) - foreach (var smw in this.value) - yield return smw; - } - - public EnumerationPlacmentBase GetChildrenPlacement(SubmodelElement child) - { - return null; - } - - public object AddChild(SubmodelElementWrapper smw, EnumerationPlacmentBase placement = null) - { - if (smw == null) - return null; - if (this.value == null) - this.value = new SubmodelElementWrapperCollection(); - if (smw.submodelElement != null) - smw.submodelElement.parent = this; - this.value.Add(smw); - return smw; - } - - // constructors - - public SubmodelElementCollection() { } - - public SubmodelElementCollection(SubmodelElement src, bool shallowCopy = false) - : base(src) - { - if (!(src is SubmodelElementCollection smc)) - return; - - this.ordered = smc.ordered; - this.allowDuplicates = smc.allowDuplicates; - this.value = new SubmodelElementWrapperCollection(); - if (!shallowCopy) - foreach (var smw in smc.value) - value.Add(new SubmodelElementWrapper(smw.submodelElement)); - } - -#if !DoNotUseAasxCompatibilityModels - public SubmodelElementCollection( - AasxCompatibilityModels.AdminShellV10.SubmodelElementCollection src, bool shallowCopy = false) - : base(src) - { - if (src == null) - return; - - this.ordered = src.ordered; - this.allowDuplicates = src.allowDuplicates; - this.value = new SubmodelElementWrapperCollection(); - if (!shallowCopy) - foreach (var smw in src.value) - value.Add(new SubmodelElementWrapper(smw.submodelElement)); - } -#endif - - public static SubmodelElementCollection CreateNew( - string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new SubmodelElementCollection(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - // from IManageSubmodelElements - public void Add(SubmodelElement sme) - { - if (value == null) - value = new SubmodelElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - value.Add(sew); - } - - public void Insert(int index, SubmodelElement sme) - { - if (value == null) - value = new SubmodelElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - if (index < 0 || index >= value.Count) - return; - value.Insert(index, sew); - } - - public void Remove(SubmodelElement sme) - { - if (value != null) - value.Remove(sme); - } - - // further - - public void Set(bool allowDuplicates = false, bool ordered = false) - { - this.allowDuplicates = allowDuplicates; - this.ordered = ordered; - } - - public SubmodelElementWrapper FindFirstIdShort(string idShort) - { - return this.value?.FindFirstIdShort(idShort); - } - - public T CreateSMEForCD(ConceptDescription cd, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - if (this.value == null) - this.value = new SubmodelElementWrapperCollection(); - return this.value.CreateSMEForCD(cd, category, idShort, idxTemplate, maxNum, addSme); - } - - public T CreateSMEForIdShort(string idShort, string category = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - if (this.value == null) - this.value = new SubmodelElementWrapperCollection(); - return this.value.CreateSMEForIdShort(idShort, category, idxTemplate, maxNum, addSme); - } - - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("SubmodelElementCollection", "SMC", - SubmodelElementWrapper.AdequateElementEnum.SubmodelElementCollection); - } - - // Recursing - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// - public void RecurseOnSubmodelElements( - object state, Func lambda) - { - this.value?.RecurseOnReferables(state, null, (o, par, rf) => - { - if (rf is SubmodelElement sme) - return lambda(o, par, sme); - else - return true; - }); - } - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. Include this element, as well. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// Include this element as well. parents will then - /// include this element as well! - public override void RecurseOnReferables( - object state, Func lambda, - bool includeThis = false) - { - var parents = new ListOfReferable(); - if (includeThis) - { - lambda(state, null, this); - parents.Add(this); - } - this.value?.RecurseOnReferables(state, parents, lambda); - } - } - - public class OperationVariable : IAasElement - { - public enum Direction { In, Out, InOut }; - - // Note: for OperationVariable, the values of the SubmodelElement itself ARE NOT TO BE USED! - // only the SME attributes of "value" are counting - - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public JsonModelTypeWrapper JsonModelType { get { return new JsonModelTypeWrapper(GetElementName()); } } - - // members - public SubmodelElementWrapper value = null; - - // constructors - - public OperationVariable() - { - } - - public OperationVariable(OperationVariable src, bool shallowCopy = false) - { - this.value = new SubmodelElementWrapper(src?.value?.submodelElement, shallowCopy); - } - -#if !DoNotUseAasxCompatibilityModels - public OperationVariable( - AasxCompatibilityModels.AdminShellV10.OperationVariable src, bool shallowCopy = false) - { - this.value = new SubmodelElementWrapper(src.value.submodelElement, shallowCopy); - } -#endif - - public OperationVariable(SubmodelElement elem) - : base() - { - this.value = new SubmodelElementWrapper(elem); - } - - public AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("OperationVariable", "OprVar"); - } - - public string GetElementName() - { - return this.GetSelfDescription()?.ElementName; - } - } - - public class Operation : SubmodelElement, IEnumerateChildren - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // members - [JsonIgnore] - [XmlElement(ElementName = "inputVariable")] - [SkipForHash] // do NOT count children! - public List inputVariable = new List(); - - [JsonIgnore] - [XmlElement(ElementName = "outputVariable")] - [SkipForHash] // do NOT count children! - public List outputVariable = new List(); - - [JsonIgnore] - [XmlElement(ElementName = "inoutputVariable")] - [SkipForHash] // do NOT count children! - public List inoutputVariable = new List(); - - [XmlIgnore] - // MICHA 190504: enabled JSON operation variables! - [JsonProperty(PropertyName = "inputVariable")] - public OperationVariable[] JsonInputVariable - { - get { return inputVariable?.ToArray(); } - set { inputVariable = (value != null) ? new List(value) : null; } - } - - [XmlIgnore] - [JsonProperty(PropertyName = "outputVariable")] - // MICHA 190504: enabled JSON operation variables! - public OperationVariable[] JsonOutputVariable - { - get { return outputVariable?.ToArray(); } - set { outputVariable = (value != null) ? new List(value) : null; } - } - - [XmlIgnore] - [JsonProperty(PropertyName = "inoutputVariable")] - // MICHA 190504: enabled JSON operation variables! - public OperationVariable[] JsonInOutputVariable - { - get { return inoutputVariable?.ToArray(); } - set { inoutputVariable = (value != null) ? new List(value) : null; } - } - - public List this[OperationVariable.Direction dir] - { - get - { - if (dir == OperationVariable.Direction.In) - return inputVariable; - else - if (dir == OperationVariable.Direction.Out) - return outputVariable; - else - return inoutputVariable; - } - set - { - if (dir == OperationVariable.Direction.In) - inputVariable = value; - else - if (dir == OperationVariable.Direction.Out) - outputVariable = value; - else - inoutputVariable = value; - } - } - - public List this[int dir] - { - get - { - if (dir == 0) - return inputVariable; - else - if (dir == 1) - return outputVariable; - else - return inoutputVariable; - } - set - { - if (dir == 0) - inputVariable = value; - else - if (dir == 1) - outputVariable = value; - else - inoutputVariable = value; - } - } - - public static SubmodelElementWrapperCollection GetWrappers(List ovl) - { - var res = new SubmodelElementWrapperCollection(); - foreach (var ov in ovl) - if (ov.value != null) - res.Add(ov.value); - return res; - } - - // enumartes its children - public IEnumerable EnumerateChildren() - { - if (this.inputVariable != null) - foreach (var smw in this.inputVariable) - yield return smw?.value; - - if (this.outputVariable != null) - foreach (var smw in this.outputVariable) - yield return smw?.value; - - if (this.inoutputVariable != null) - foreach (var smw in this.inoutputVariable) - yield return smw?.value; - } - - public class EnumerationPlacmentOperationVariable : EnumerationPlacmentBase - { - public OperationVariable.Direction Direction; - public OperationVariable OperationVariable; - } - - public EnumerationPlacmentBase GetChildrenPlacement(SubmodelElement child) - { - // trivial - if (child == null) - return null; - - // search - OperationVariable.Direction? dir = null; - OperationVariable opvar = null; - if (this.inputVariable != null) - foreach (var ov in this.inputVariable) - if (ov?.value?.submodelElement == child) - { - dir = OperationVariable.Direction.In; - opvar = ov; - } - - if (this.outputVariable != null) - foreach (var ov in this.outputVariable) - if (ov?.value?.submodelElement == child) - { - dir = OperationVariable.Direction.Out; - opvar = ov; - } - - if (this.inoutputVariable != null) - foreach (var ov in this.inoutputVariable) - if (ov?.value?.submodelElement == child) - { - dir = OperationVariable.Direction.InOut; - opvar = ov; - } - - // found - if (!dir.HasValue) - return null; - return new EnumerationPlacmentOperationVariable() - { - Direction = dir.Value, - OperationVariable = opvar - }; - } - - public object AddChild(SubmodelElementWrapper smw, EnumerationPlacmentBase placement = null) - { - // not enough information to select list of children? - var pl = placement as EnumerationPlacmentOperationVariable; - if (smw == null || pl == null) - return null; - - // ok, use information - var ov = new OperationVariable(); - ov.value = smw; - - if (smw.submodelElement != null) - smw.submodelElement.parent = this; - - if (pl.Direction == OperationVariable.Direction.In) - { - if (inputVariable == null) - inputVariable = new List(); - inputVariable.Add(ov); - } - - if (pl.Direction == OperationVariable.Direction.Out) - { - if (outputVariable == null) - outputVariable = new List(); - outputVariable.Add(ov); - } - - if (pl.Direction == OperationVariable.Direction.InOut) - { - if (inoutputVariable == null) - inoutputVariable = new List(); - inoutputVariable.Add(ov); - } - - return ov; - } - - // constructors - - public Operation() { } - - public Operation(SubmodelElement src) - : base(src) - { - if (!(src is Operation op)) - return; - - for (int i = 0; i < 2; i++) - if (op[i] != null) - { - if (this[i] == null) - this[i] = new List(); - foreach (var ov in op[i]) - this[i].Add(new OperationVariable(ov)); - } - } - -#if !DoNotUseAasxCompatibilityModels - public Operation(AasxCompatibilityModels.AdminShellV10.Operation src) - : base(src) - { - for (int i = 0; i < 2; i++) - if (src[i] != null) - { - if (this[i] == null) - this[i] = new List(); - foreach (var ov in src[i]) - this[i].Add(new OperationVariable(ov)); - } - } -#endif - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Operation", "Opr", - SubmodelElementWrapper.AdequateElementEnum.Operation); - } - } - - public class Entity : SubmodelElement, IManageSubmodelElements, IEnumerateChildren - { - public enum EntityTypeEnum { CoManagedEntity = 0, SelfManagedEntity = 1, Undef = 3 } - public static string[] EntityTypeNames = new string[] { "CoManagedEntity", "SelfManagedEntity" }; - - // for JSON only - - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // from this very class - [XmlIgnore] - [JsonIgnore] - [SkipForHash] // do NOT count children! - private SubmodelElementWrapperCollection _statements = null; - - [JsonIgnore] - public SubmodelElementWrapperCollection statements - { - get { return _statements; } - set { _statements = value; _statements.Parent = this; } - } - - [XmlIgnore] - [JsonProperty(PropertyName = "statements")] - public SubmodelElement[] JsonStatements - { - get - { - var res = new ListOfSubmodelElement(); - if (statements != null) - foreach (var smew in statements) - res.Add(smew.submodelElement); - return res.ToArray(); - } - set - { - if (value != null) - { - this.statements = new SubmodelElementWrapperCollection(); - foreach (var x in value) - { - var smew = new SubmodelElementWrapper() { submodelElement = x }; - this.statements.Add(smew); - } - } - } - } - - // further members - - [CountForHash] - public string entityType = ""; - - [JsonProperty(PropertyName = "asset")] - public AssetRef assetRef = null; - - // enumerates its children - - public IEnumerable EnumerateChildren() - { - if (this.statements != null) - foreach (var smw in this.statements) - yield return smw; - } - - public EnumerationPlacmentBase GetChildrenPlacement(SubmodelElement child) - { - return null; - } - - public object AddChild(SubmodelElementWrapper smw, EnumerationPlacmentBase placement = null) - { - if (smw == null) - return null; - if (this.statements == null) - this.statements = new SubmodelElementWrapperCollection(); - if (smw.submodelElement != null) - smw.submodelElement.parent = this; - this.statements.Add(smw); - return smw; - } - - // constructors - - public Entity() { } - - public Entity(SubmodelElement src) - : base(src) - { - if (!(src is Entity ent)) - return; - - if (ent.statements != null) - { - this.statements = new SubmodelElementWrapperCollection(); - foreach (var smw in ent.statements) - this.statements.Add(new SubmodelElementWrapper(smw.submodelElement)); - } - this.entityType = ent.entityType; - if (ent.assetRef != null) - this.assetRef = new AssetRef(ent.assetRef); - } - - public Entity(EntityTypeEnum entityType, string idShort = null, AssetRef assetRef = null, - string category = null, Key semanticIdKey = null) - { - CreateNewLogic(idShort, null, semanticIdKey); - - this.entityType = EntityTypeNames[(int)entityType]; - this.assetRef = assetRef; - } - -#if !DoNotUseAasxCompatibilityModels - // not available in V1.0 -#endif - - public static Entity CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new Entity(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - // from IManageSubmodelElements - public void Add(SubmodelElement sme) - { - if (statements == null) - statements = new SubmodelElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - statements.Add(sew); - } - - public void Insert(int index, SubmodelElement sme) - { - if (statements == null) - statements = new SubmodelElementWrapperCollection(); - var sew = new SubmodelElementWrapper(); - sme.parent = this; // track parent here! - sew.submodelElement = sme; - if (index < 0 || index >= statements.Count) - return; - statements.Insert(index, sew); - } - - public void Remove(SubmodelElement sme) - { - if (statements != null) - statements.Remove(sme); - } - - // management of elememts - - public SubmodelElementWrapper FindSubmodelElementWrapper(string idShort) - { - if (this.statements == null) - return null; - foreach (var smw in this.statements) - if (smw.submodelElement != null) - if (smw.submodelElement.idShort.Trim().ToLower() == idShort.Trim().ToLower()) - return smw; - return null; - } - - public T CreateSMEForCD(ConceptDescription cd, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - if (this.statements == null) - this.statements = new SubmodelElementWrapperCollection(); - return this.statements.CreateSMEForCD(cd, category, idShort, idxTemplate, maxNum, addSme); - } - - public T CreateSMEForIdShort(string idShort, string category = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false) where T : SubmodelElement, new() - { - if (this.statements == null) - this.statements = new SubmodelElementWrapperCollection(); - return this.statements.CreateSMEForIdShort(idShort, category, idxTemplate, maxNum, addSme); - } - - // entity type - - public EntityTypeEnum GetEntityType() - { - EntityTypeEnum res = EntityTypeEnum.Undef; - if (this.entityType != null && this.entityType.Trim().ToLower() == EntityTypeNames[0].ToLower()) - res = EntityTypeEnum.CoManagedEntity; - if (this.entityType != null && this.entityType.Trim().ToLower() == EntityTypeNames[1].ToLower()) - res = EntityTypeEnum.SelfManagedEntity; - return res; - } - - // name - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("Entity", "Ent", - SubmodelElementWrapper.AdequateElementEnum.Entity); - } - } - - public class BasicEvent : SubmodelElement - { - // for JSON only - [XmlIgnore] - [JsonProperty(PropertyName = "modelType")] - public new JsonModelTypeWrapper JsonModelType - { - get { return new JsonModelTypeWrapper(GetElementName()); } - } - - // from this very class - public Reference observed = new Reference(); - - // constructors - - public BasicEvent() { } - - public BasicEvent(SubmodelElement src) - : base(src) - { - if (!(src is BasicEvent be)) - return; - - if (be.observed != null) - this.observed = new Reference(be.observed); - } - -#if !DoNotUseAasxCompatibilityModels - // not available in V1.0 -#endif - - public static BasicEvent CreateNew(string idShort = null, string category = null, Key semanticIdKey = null) - { - var x = new BasicEvent(); - x.CreateNewLogic(idShort, category, semanticIdKey); - return (x); - } - - public override AasElementSelfDescription GetSelfDescription() - { - return new AasElementSelfDescription("BasicEvent", "Evt", - SubmodelElementWrapper.AdequateElementEnum.BasicEvent); - } - } - - // - // Handling of packages - // - } - - #endregion -} - diff --git a/src/AasxCsharpLibrary/AasxCompatibilityModels/V20/AdminShellConverters.cs b/src/AasxCsharpLibrary/AasxCompatibilityModels/V20/AdminShellConverters.cs deleted file mode 100644 index ce541f0c0..000000000 --- a/src/AasxCsharpLibrary/AasxCompatibilityModels/V20/AdminShellConverters.cs +++ /dev/null @@ -1,170 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Reflection; -using AasxCompatibilityModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Newtonsoft.Json.Serialization; - -//namespace AdminShellNS -namespace AdminShell_V20 -{ - public static class AdminShellConverters - { - /// - /// This converter is used for reading JSON files; it claims to be responsible for - /// "Referable" (the base class) - /// and decides, which sub-class of the base class shall be populated. - /// If the object is SubmodelElement, the decision, shich special sub-class to create is done in a factory - /// AdminShell.SubmodelElementWrapper.CreateAdequateType(), - /// in order to have all sub-class specific decisions in one place (SubmodelElementWrapper) - /// Remark: There is a NuGet package JsonSubTypes, which could have done the job, except the fact of having - /// "modelType" being a class property with a contained property "name". - /// - public class JsonAasxConverter : JsonConverter - { - private string UpperClassProperty = "modelType"; - private string LowerClassProperty = "name"; - - public JsonAasxConverter() : base() - { - } - - public JsonAasxConverter(string UpperClassProperty, string LowerClassProperty) : base() - { - this.UpperClassProperty = UpperClassProperty; - this.LowerClassProperty = LowerClassProperty; - } - - public override bool CanConvert(Type objectType) - { - // Info MIHO 21 APR 2020: changed this from SubmodelElement to Referable - if (typeof(AdminShell.Referable).IsAssignableFrom(objectType)) - return true; - return false; - } - - public override bool CanWrite - { - get { return false; } - } - - public override object ReadJson(JsonReader reader, - Type objectType, - object existingValue, - JsonSerializer serializer) - { - // Load JObject from stream - JObject jObject = JObject.Load(reader); - - // Create target object based on JObject - object target = new AdminShell.Referable(); - - if (jObject.ContainsKey(UpperClassProperty)) - { - var j2 = jObject[UpperClassProperty]; - if (j2 != null) - foreach (var c in j2.Children()) - { - var cprop = c as Newtonsoft.Json.Linq.JProperty; - if (cprop == null) - continue; - if (cprop.Name == LowerClassProperty && cprop.Value.Type.ToString() == "String") - { - var cpval = cprop.Value.ToObject(); - if (cpval == null) - continue; - // Info MIHO 21 APR 2020: use Referable.CreateAdequateType instead of SMW... - var o = AdminShell.Referable.CreateAdequateType(cpval); - if (o != null) - target = o; - } - } - } - - // Populate the object properties - serializer.Populate(jObject.CreateReader(), target); - - return target; - } - - /// - /// Introduced for JSON serialization, can create Referables based on a string name - /// - /// string name (standard PascalCased) - - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - throw new NotImplementedException(); - } - } - - /// - /// This converter / contract resolver for Json.NET adaptively filters different levels of depth - /// of nested AASX structures. - /// - public class AdaptiveFilterContractResolver : DefaultContractResolver - { - public bool AasHasViews = true; - public bool BlobHasValue = true; - public bool SubmodelHasElements = true; - public bool SmcHasValue = true; - public bool OpHasVariables = true; - - public AdaptiveFilterContractResolver() { } - - public AdaptiveFilterContractResolver(bool deep = true, bool complete = true) - { - if (!deep) - { - this.SubmodelHasElements = false; - this.SmcHasValue = false; - this.OpHasVariables = false; - } - if (!complete) - { - this.AasHasViews = false; - this.BlobHasValue = false; - } - - } - - protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) - { - JsonProperty property = base.CreateProperty(member, memberSerialization); - - if (!BlobHasValue && property.DeclaringType == typeof(AdminShell.Blob) && - property.PropertyName == "value") - property.ShouldSerialize = instance => { return false; }; - - if (!SubmodelHasElements && property.DeclaringType == typeof(AdminShell.Submodel) && - property.PropertyName == "submodelElements") - property.ShouldSerialize = instance => { return false; }; - - if (!SmcHasValue && property.DeclaringType == typeof(AdminShell.SubmodelElementCollection) && - property.PropertyName == "value") - property.ShouldSerialize = instance => { return false; }; - - if (!OpHasVariables && property.DeclaringType == typeof(AdminShell.Operation) && - (property.PropertyName == "in" || property.PropertyName == "out")) - property.ShouldSerialize = instance => { return false; }; - - if (!AasHasViews && property.DeclaringType == typeof(AdminShell.AdministrationShell) && - property.PropertyName == "views") - property.ShouldSerialize = instance => { return false; }; - - return property; - } - } - - } -} diff --git a/src/AasxCsharpLibrary/AasxCompatibilityModels/V20/AdminShellUtil.cs b/src/AasxCsharpLibrary/AasxCompatibilityModels/V20/AdminShellUtil.cs deleted file mode 100644 index 1452421de..000000000 --- a/src/AasxCsharpLibrary/AasxCompatibilityModels/V20/AdminShellUtil.cs +++ /dev/null @@ -1,633 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using AasxCompatibilityModels; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text.RegularExpressions; - -//namespace AdminShellNS -namespace AdminShell_V20 -{ - public static class AdminShellUtilV20 - { - public static string EvalToNonNullString(string fmt, object o, string elseString = "") - { - if (o == null) - return elseString; - return string.Format(fmt, o); - } - - public static string EvalToNonEmptyString(string fmt, string o, string elseString = "") - { - if (o == null || o == "") - return elseString; - return string.Format(fmt, o); - } - - /// Creates a filter-friendly name from the source. - /// - /// Assert.AreEqual("", AdminShellUtil.FilterFriendlyName("")); - /// Assert.AreEqual("someName", AdminShellUtil.FilterFriendlyName("someName")); - /// Assert.AreEqual("some__name", AdminShellUtil.FilterFriendlyName("some!;name")); - /// - public static string FilterFriendlyName(string src) - { - if (src == null) - return null; - return Regex.Replace(src, @"[^a-zA-Z0-9\-_]", "_"); - } - - /// - /// Assert.IsFalse(AdminShellUtil.HasWhitespace("")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace(" ")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace("aa bb")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace(" aabb")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace("aabb ")); - /// Assert.IsFalse(AdminShellUtil.HasWhitespace("aabb")); - /// - public static bool HasWhitespace(string src) - { - if (src == null) - throw new ArgumentNullException(nameof(src)); - foreach (var s in src) - if (char.IsWhiteSpace(s)) - return true; - return false; - } - - /// Assert.IsTrue(AdminShellUtil.ComplyIdShort("")); - public static bool ComplyIdShort(string src) - { - if (src == null) - throw new ArgumentNullException(nameof(src)); - var res = true; - foreach (var s in src) - if (!Char.IsLetterOrDigit(s) && s != '_') - res = false; - if (src.Length > 0 && !Char.IsLetter(src[0])) - res = false; - return res; - } - - public static string ByteSizeHumanReadable(long len) - { - // see: https://stackoverflow.com/questions/281640/ - // how-do-i-get-a-human-readable-file-size-in-bytes-abbreviation-using-net - string[] sizes = { "B", "KB", "MB", "GB", "TB" }; - int order = 0; - while (len >= 1024 && order < sizes.Length - 1) - { - order++; - len = len / 1024; - } - // Adjust the format string to your preferences. For example "{0:0.#}{1}" would - // show a single decimal place, and no space. - string res = String.Format("{0:0.##} {1}", len, sizes[order]); - return res; - } - - public static string ExtractPascalCasingLetters(string src) - { - // access - src = src?.Trim(); - if (src == null || src.Length < 1) - return null; - - // walk through - var res = ""; - var arm = true; - foreach (var c in src) - { - // take? - if (arm && Char.IsUpper(c)) - res += c; - // state for next iteration - arm = !Char.IsUpper(c); - } - - // result - return res; - } - - public static int CountHeadingSpaces(string line) - { - if (line == null) - return 0; - int j; - for (j = 0; j < line.Length; j++) - if (!Char.IsWhiteSpace(line[j])) - break; - return j; - } - - /// - /// Used to re-reformat a C# here string, which is multiline string introduced by @" ... "; - /// - public static string[] CleanHereStringToArray(string here) - { - if (here == null) - return null; - - // convert all weird breaks to pure new lines - here = here.Replace("\r\n", "\n"); - here = here.Replace("\n\r", "\n"); - - // convert all tabs to spaces - here = here.Replace("\t", " "); - - // split these - var lines = new List(here.Split('\n')); - if (lines.Count < 1) - return lines.ToArray(); - - // the first line could be special - string firstLine = null; - if (lines[0].Trim() != "") - { - firstLine = lines[0].Trim(); - lines.RemoveAt(0); - } - - // detect an constant amount of heading spaces - var headSpaces = int.MaxValue; - foreach (var line in lines) - if (line.Trim() != "") - headSpaces = Math.Min(headSpaces, CountHeadingSpaces(line)); - - // multi line trim possible? - if (headSpaces != int.MaxValue && headSpaces > 0) - for (int i = 0; i < lines.Count; i++) - if (lines[i].Length > headSpaces) - lines[i] = lines[i].Substring(headSpaces); - - // re-compose again - if (firstLine != null) - lines.Insert(0, firstLine); - - // return - return lines.ToArray(); - } - - /// - /// Used to re-reformat a C# here string, which is multiline string introduced by @" ... "; - /// - public static string CleanHereStringWithNewlines(string here, string nl = null) - { - if (nl == null) - nl = System.Environment.NewLine; - var lines = CleanHereStringToArray(here); - if (lines == null) - return null; - return String.Join(nl, lines); - } - - public static string ShortLocation(Exception ex) - { - if (ex == null || ex.StackTrace == null) - return ""; - string[] lines = ex.StackTrace.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None); - if (lines.Length < 1) - return ""; - // search for " in " - // as the most actual stacktrace might be a built-in function, this might not work and therefore - // go down in the stack - int currLine = 0; - while (true) - { - // nothing found at all - if (currLine >= lines.Length) - return ""; - // access current line - /* TODO (MIHO, 2020-11-12): replace with Regex for multi language. Ideally have Exception messages - always as English. */ - var p = lines[currLine].IndexOf(" in ", StringComparison.Ordinal); - if (p < 0) - p = lines[currLine].IndexOf(" bei ", StringComparison.Ordinal); - if (p < 0) - { - // advance to next oldest line - currLine++; - continue; - } - // search last "\" or "/", to get only filename portion and position - p = lines[currLine].LastIndexOfAny(new[] { '\\', '/' }); - if (p < 0) - { - // advance to next oldest line - currLine++; - continue; - } - // return this - return lines[currLine].Substring(p); - } - } - - public enum ConstantFoundEnum { No, AnyCase, ExactCase } - - public static ConstantFoundEnum CheckIfInConstantStringArray(string[] arr, string str) - { - if (arr == null || str == null) - return ConstantFoundEnum.No; - - bool anyCaseFound = false; - bool exactCaseFound = false; - foreach (var a in arr) - { - anyCaseFound = anyCaseFound || str.ToLower() == a.ToLower(); - exactCaseFound = exactCaseFound || str == a; - } - if (exactCaseFound) - return ConstantFoundEnum.ExactCase; - if (anyCaseFound) - return ConstantFoundEnum.AnyCase; - return ConstantFoundEnum.No; - } - - public static string CorrectCasingForConstantStringArray(string[] arr, string str) - { - if (arr == null || str == null) - return str; - - foreach (var a in arr) - if (str.ToLower() == a.ToLower()) - return a; - - return str; - } - - // - // - // - // - // - - public static void PrintSearchableProperties(object obj, int indent) - { - if (obj == null) return; - string indentString = new string(' ', indent); - Type objType = obj.GetType(); - PropertyInfo[] properties = objType.GetProperties(); - foreach (PropertyInfo property in properties) - { - object propValue = property.GetValue(obj, null); - var elems = propValue as IList; - if (elems != null) - { - foreach (var item in elems) - { - PrintSearchableProperties(item, indent + 3); - } - } - else - { - // This will not cut-off System.Collections because of the first check - if (property.PropertyType.Assembly == objType.Assembly) - { - Console.WriteLine("{0}{1}:", indentString, property.Name); - - PrintSearchableProperties(propValue, indent + 2); - } - else - { - Console.WriteLine("{0}{1}: {2}", indentString, property.Name, propValue); - } - } - } - } - - public class SearchOptions - { - public Assembly[] allowedAssemblies = null; - public int maxDepth = int.MaxValue; - public bool findFirst = false; - public int skipFirstResults = 0; - public string findText = null; - public bool isIgnoreCase = false; - public bool isRegex = false; - } - - public class SearchResultItem : IEquatable - { - public SearchOptions searchOptions; - public string qualifiedNameHead; - public string metaModelName; - public object businessObject; - public string foundText; - public object foundObject; - public object containingObject; - public int foundHash; - - public bool Equals(SearchResultItem other) - { - if (other == null) - return false; - - return this.qualifiedNameHead == other.qualifiedNameHead && - this.metaModelName == other.metaModelName && - this.businessObject == other.businessObject && - this.containingObject == other.containingObject && - this.foundText == other.foundText && - this.foundHash == other.foundHash; - } - } - - public class SearchResults - { - public int foundIndex = 0; - public List foundResults = new List(); - - public void Clear() - { - foundIndex = -1; - foundResults.Clear(); - } - } - - public static void CheckSearchable( - SearchResults results, SearchOptions options, string qualifiedNameHead, object businessObject, - MemberInfo mi, object memberValue, object containingObject, Func getMemberHash) - { - // try get a speaking name - var metaModelName = ""; - var x1 = mi.GetCustomAttribute(); - if (x1 != null && x1.name != null) - metaModelName = x1.name; - - // check if this object is searchable - var x2 = mi.GetCustomAttribute(); - if (x2 != null) - { - // what to check? - string foundText = "" + memberValue?.ToString(); - - // find options - var found = true; - if (options.findText != null) - found = foundText.IndexOf( - options.findText, options.isIgnoreCase ? StringComparison.CurrentCultureIgnoreCase : 0) >= 0; - - // add? - if (found) - { - var sri = new SearchResultItem(); - sri.searchOptions = options; - sri.qualifiedNameHead = qualifiedNameHead; - sri.metaModelName = metaModelName; - sri.businessObject = businessObject; - sri.foundText = foundText; - sri.foundObject = memberValue; - sri.containingObject = containingObject; - if (getMemberHash != null) - sri.foundHash = getMemberHash(); - - // avoid duplicates - if (!results.foundResults.Contains(sri)) - results.foundResults.Add(sri); - } - } - } - - public static void EnumerateSearchable( - SearchResults results, object obj, string qualifiedNameHead, int depth, SearchOptions options, - object businessObject = null) - { - // access - if (results == null || obj == null || options == null) - return; - Type objType = obj.GetType(); - - // depth - if (depth > options.maxDepth) - return; - - // try to get element name of an AAS entity - string elName = null; - if (obj is AdminShell.Referable) - { - elName = (obj as AdminShell.Referable).GetElementName(); - businessObject = obj; - } - - // enrich qualified name, accordingly - var qualifiedName = qualifiedNameHead; - if (elName != null) - qualifiedName = qualifiedName + (qualifiedName.Length > 0 ? "." : "") + elName; - - // do NOT dive into objects, which are not in the reight assembly - if (options.allowedAssemblies == null || !options.allowedAssemblies.Contains(objType.Assembly)) - return; - - // do not dive into enums - if (objType.IsEnum) - return; - - // look at fields, first - var fields = objType.GetFields(); - foreach (var fi in fields) - { - // is the object marked to be skipped? - var x3 = fi.GetCustomAttribute(); - if (x3 != null) - continue; - - var x4 = fi.GetCustomAttribute(); - if (x4 != null) - continue; - - // get value(s) - var fieldValue = fi.GetValue(obj); - if (fieldValue == null) - continue; - var valueElems = fieldValue as IList; - if (valueElems != null) - { - // field is a collection .. dive deeper, if allowed - foreach (var el in valueElems) - EnumerateSearchable(results, el, qualifiedName, depth + 1, options, businessObject); - } - else - { - // field is a single entity .. check it - CheckSearchable( - results, options, qualifiedName, businessObject, fi, fieldValue, obj, - () => { return fieldValue.GetHashCode(); }); - - // dive deeper .. - EnumerateSearchable(results, fieldValue, qualifiedName, depth + 1, options, businessObject); - } - } - - // properties & objects behind - var properties = objType.GetProperties(); - foreach (var pi in properties) - { - var gip = pi.GetIndexParameters(); - if (gip.Length > 0) - // no indexed properties, yet - continue; - - // is the object marked to be skipped? - var x3 = pi.GetCustomAttribute(); - if (x3 != null) - continue; - - var x4 = pi.GetCustomAttribute(); - if (x4 != null) - continue; - - // get value(s) - var propValue = pi.GetValue(obj, null); - if (propValue == null) - continue; - var valueElems = propValue as IList; - if (valueElems != null) - { - // property is a collection .. dive deeper, if allowed - foreach (var el in valueElems) - EnumerateSearchable(results, el, qualifiedName, depth + 1, options, businessObject); - } - else - { - // field is a single entity .. check it - CheckSearchable( - results, options, qualifiedName, businessObject, pi, propValue, obj, - () => { return propValue.GetHashCode(); }); - - // dive deeper .. - EnumerateSearchable(results, propValue, qualifiedName, depth + 1, options, businessObject); - } - } - } - - // - // String manipulations - // - - public static string ReplacePercentPlaceholder( - string input, - string searchFor, - Func substLamda, - StringComparison comparisonType = StringComparison.InvariantCulture) - { - // access - if (input == null || searchFor == null || searchFor == "") - return input; - - // find - while (true) - { - // any occurence - var p = input.IndexOf(searchFor, comparisonType); - if (p < 0) - break; - - // split - var left = input.Substring(0, p); - var right = ""; - var rp = p + searchFor.Length; - if (rp < input.Length) - right = input.Substring(rp); - - // lambda - var repl = "" + substLamda?.Invoke(); - - // build new - input = left + repl + right; - } - - // ok - return input; - } - - // - // Base 64 - // - - public static string Base64Encode(string plainText) - { - var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); - return System.Convert.ToBase64String(plainTextBytes); - } - - public static string Base64Decode(string base64EncodedData) - { - var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData); - return System.Text.Encoding.UTF8.GetString(base64EncodedBytes); - } - - // - // Generation of Ids - // - - private static Random MyRnd = new Random(); - - public static string GenerateIdAccordingTemplate(string tpl) - { - // generate a deterministic decimal digit string - var decimals = String.Format("{0:ffffyyMMddHHmmss}", DateTime.UtcNow); - decimals = new string(decimals.Reverse().ToArray()); - // convert this to an int - if (!Int64.TryParse(decimals, out Int64 decii)) - decii = MyRnd.Next(Int32.MaxValue); - // make an hex out of this - string hexamals = decii.ToString("X"); - // make an alphanumeric string out of this - string alphamals = ""; - var dii = decii; - while (dii >= 1) - { - var m = dii % 26; - alphamals += Convert.ToChar(65 + m); - dii = dii / 26; - } - - // now, "salt" the strings - for (int i = 0; i < 32; i++) - { - var c = Convert.ToChar(48 + MyRnd.Next(10)); - decimals += c; - hexamals += c; - alphamals += c; - } - - // now, can just use the template - var id = ""; - foreach (var tpli in tpl) - { - if (tpli == 'D' && decimals.Length > 0) - { - id += decimals[0]; - decimals = decimals.Remove(0, 1); - } - else - if (tpli == 'X' && hexamals.Length > 0) - { - id += hexamals[0]; - hexamals = hexamals.Remove(0, 1); - } - else - if (tpli == 'A' && alphamals.Length > 0) - { - id += alphamals[0]; - alphamals = alphamals.Remove(0, 1); - } - else - id += tpli; - } - - // ok - return id; - } - - } -} diff --git a/src/AasxCsharpLibrary/AasxCompatibilityModels/V20/AdminShellValidate.cs b/src/AasxCsharpLibrary/AasxCompatibilityModels/V20/AdminShellValidate.cs deleted file mode 100644 index 1119c235e..000000000 --- a/src/AasxCsharpLibrary/AasxCompatibilityModels/V20/AdminShellValidate.cs +++ /dev/null @@ -1,320 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using JetBrains.Annotations; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text.RegularExpressions; -using System.Xml; -using System.Xml.Schema; - -//namespace AdminShellNS -namespace AdminShell_V20 -{ - /// - /// validates the XML content against the AASX XML schema. - /// - /// Please produce instances with . - /// - public class XmlValidator - { - private System.Xml.Schema.XmlSchemaSet xmlSchemaSet; - - internal XmlValidator(XmlSchemaSet xmlSchemaSet) - { - this.xmlSchemaSet = xmlSchemaSet; - } - - /// - /// validates the given XML content and stores the results in the . - /// - /// Validation records - /// Content to be validated - public void Validate(AasValidationRecordList recs, Stream xmlContent) - { - if (recs == null) - throw new ArgumentException($"Unexpected null {nameof(recs)}"); - - if (xmlContent == null) - throw new ArgumentException($"Unexpected null {nameof(xmlContent)}"); - - // load/ validate on same records - var settings = new System.Xml.XmlReaderSettings(); - settings.ValidationType = System.Xml.ValidationType.Schema; - settings.Schemas = xmlSchemaSet; - - settings.ValidationEventHandler += - (object sender, System.Xml.Schema.ValidationEventArgs e) => - { - recs.Add( - new AasValidationRecord( - AasValidationSeverity.Serialization, null, - $"XML: {e?.Exception?.LineNumber}, {e?.Exception?.LinePosition}: {e?.Message}")); - }; - - // use the xml stream - using (var reader = System.Xml.XmlReader.Create(xmlContent, settings)) - { - while (reader.Read()) - { - // Invoke callbacks - }; - } - } - } - - public enum AasValidationSeverity - { - Hint, Warning, SpecViolation, SchemaViolation, Serialization - } - - [UsedImplicitlyAttribute] // for eventual use - public enum AasValidationAction - { - No, ToBeDeleted - } - - public class AasValidationRecord - { - public AasValidationSeverity Severity = AasValidationSeverity.Hint; - public AasxCompatibilityModels.AdminShellV20.Referable Source = null; - public string Message = ""; - - public Action Fix = null; - - public AasValidationRecord(AasValidationSeverity Severity, AasxCompatibilityModels.AdminShellV20.Referable Source, - string Message, Action Fix = null) - { - this.Severity = Severity; - this.Source = Source; - this.Message = Message; - this.Fix = Fix; - } - - public override string ToString() - { - return $"[{Severity.ToString()}] in {"" + Source?.ToString()}: {"" + Message}"; - } - - public string DisplaySeverity { get { return "" + Severity.ToString(); } } - public string DisplaySource - { - get - { - return "" + ((Source != null) ? Source.ToString() : "(whole content)"); - } - } - public string DisplayMessage { get { return "" + Message?.ToString(); } } - } - - public class AasValidationRecordList : List - { - } - - public static class AasSchemaValidation - { - public enum SerializationFormat { XML, JSON } - - public static string[] GetSchemaResources(SerializationFormat fmt) - { - if (fmt == SerializationFormat.XML) - { - return new[] - { - "AdminShellNS.Resources.schemaV201.AAS.xsd", - "AdminShellNS.Resources.schemaV201.AAS_ABAC.xsd", - "AdminShellNS.Resources.schemaV201.IEC61360.xsd" - }; - } - if (fmt == SerializationFormat.JSON) - { - return new[] - { - "AdminShellNS.Resources.schemaV201.aas.json" - }; - } - return null; - } - - /// - /// produces a validator which validates XML AASX files. - /// - /// initialized validator - public static XmlValidator NewXmlValidator() - { - // Load the schema files - var files = GetSchemaResources(SerializationFormat.XML); - if (files == null) - throw new InvalidOperationException("No XML schema files could be found in the resources."); - - var xmlSchemaSet = new System.Xml.Schema.XmlSchemaSet(); - xmlSchemaSet.XmlResolver = new System.Xml.XmlUrlResolver(); - - try - { - Assembly myAssembly = Assembly.GetExecutingAssembly(); - foreach (var schemaFn in files) - { - using (Stream schemaStream = myAssembly.GetManifestResourceStream(schemaFn)) - { - using (XmlReader schemaReader = XmlReader.Create(schemaStream)) - { - xmlSchemaSet.Add(null, schemaReader); - } - } - } - } - catch (Exception ex) - { - throw new FileNotFoundException( - $"Error accessing embedded resource schema files: {ex.Message}"); - } - - var newRecs = new AasValidationRecordList(); - - // set up messages - xmlSchemaSet.ValidationEventHandler += (object sender, System.Xml.Schema.ValidationEventArgs e) => - { - newRecs.Add( - new AasValidationRecord( - AasValidationSeverity.Serialization, null, - $"{e?.Exception?.LineNumber}, {e?.Exception?.LinePosition}: {e?.Message}")); - }; - - // compile - try - { - xmlSchemaSet.Compile(); - } - catch (Exception ex) - { - throw new InvalidOperationException( - $"Error compiling schema files: {ex.Message}"); - } - - if (newRecs.Count > 0) - { - var parts = new List { $"Failed to compile the schema files:" }; - parts.AddRange(newRecs.Select((r) => r.Message)); - throw new InvalidOperationException(string.Join(System.Environment.NewLine, parts)); - } - - return new XmlValidator(xmlSchemaSet); - } - - /// - /// creates an XML validator and applies it on the given content. - /// - /// If you repeatedly need to validate XML against a schema, re-use an instance of - /// produced with . - /// - /// Validation records - /// Content to be validated - public static void ValidateXML(AasValidationRecordList recs, Stream xmlContent) - { - var validator = NewXmlValidator(); - validator.Validate(recs, xmlContent); - } - - public static int ValidateJSONAlternative(AasValidationRecordList recs, Stream jsonContent) - { - // see: https://github.com/RicoSuter/NJsonSchema/wiki/JsonSchemaValidator - var newRecs = new AasValidationRecordList(); - - // access - if (recs == null || jsonContent == null) - return -1; - - // Load the schema files - // right now: exactly ONE schema file - var files = GetSchemaResources(SerializationFormat.JSON); - if (files == null || files.Length != 1) - return -1; - - NJsonSchema.JsonSchema schema = null; - - try - { - Assembly myAssembly = Assembly.GetExecutingAssembly(); - foreach (var schemaFn in files) - { - using (Stream schemaStream = myAssembly.GetManifestResourceStream(schemaFn)) - { - using (var streamReader = new StreamReader(schemaStream)) - { - var allTxt = streamReader.ReadToEnd(); - schema = NJsonSchema.JsonSchema.FromJsonAsync(allTxt).GetAwaiter().GetResult(); - break; - } - } - } - } - catch (Exception ex) - { - throw new FileNotFoundException("ValidateJSON: Error loading schema: " + - ex.Message); - } - - if (schema == null) - { - throw new FileNotFoundException("ValidateJSON: Schema not found properly."); - } - - // create validator - var validator = new NJsonSchema.Validation.JsonSchemaValidator(); - - // load the JSON content - string jsonTxt = null; - try - { - using (var streamReader = new StreamReader(jsonContent)) - { - jsonTxt = streamReader.ReadToEnd(); - } - } - catch (Exception ex) - { - throw new InvalidOperationException("ValidateJSON: Error loading JSON content: " + - ex.Message); - } - - if (jsonTxt == null || jsonTxt == "") - throw new InvalidOperationException("ValidateJSON: Error loading JSON content gave null."); - - // validate - ICollection errors; - try - { - errors = validator.Validate(jsonTxt, schema); - } - catch (Exception ex) - { - throw new InvalidOperationException("ValidateJSON: Error when validating: " + - ex.Message); - } - - // re-format messages - if (errors != null) - foreach (var ve in errors) - { - var msg = ("" + ve.ToString()); - msg = Regex.Replace(msg, @"\s+", " "); - newRecs.Add(new AasValidationRecord(AasValidationSeverity.Serialization, null, - $"JSON: {ve.LineNumber,5},{ve.LinePosition:3}: {msg}")); - } - - // result - recs.AddRange(newRecs); - return newRecs.Count; - } - } -} diff --git a/src/AasxCsharpLibrary/AasxCsharpLibrary.csproj b/src/AasxCsharpLibrary/AasxCsharpLibrary.csproj deleted file mode 100644 index 6ea306ec8..000000000 --- a/src/AasxCsharpLibrary/AasxCsharpLibrary.csproj +++ /dev/null @@ -1,45 +0,0 @@ - - - net6.0 - Library - AdminShellNS - false - - - TRACE;UseAasxCompatibilityModels - - - - - - - PreserveNewest - - - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - - - - - - - - - - - - - diff --git a/src/AasxCsharpLibrary/AdminShellCollections.cs b/src/AasxCsharpLibrary/AdminShellCollections.cs deleted file mode 100644 index 32e6774ab..000000000 --- a/src/AasxCsharpLibrary/AdminShellCollections.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System.Collections.Generic; - -namespace AdminShellNS -{ - /// - /// Just add some convenience methods to Dictionary - /// Note: Not an extension class in order to not interfere with really - /// commonly used standard class. - /// - public class ConvenientDictionary : Dictionary - { - public V GetValueOrDefault(K key) - { - if (key != null && this.ContainsKey(key)) - return this[key]; - return default(V); - } - } - - public class MultiValueDictionary - { - private Dictionary> dict = new Dictionary>(); - public void Add(K key, V value) - { - if (dict.TryGetValue(key, out var list)) - list.Add(value); - else - dict.Add(key, new List { value }); - } - - public bool ContainsKey(K key) => dict.ContainsKey(key); - - public List this[K key] => dict[key]; - - public IEnumerable> Keys - { - get - { - return dict.Values; - } - } - } - - public class DoubleSidedDict - { - private Dictionary _forward = new Dictionary(); - private Dictionary _backward = new Dictionary(); - - public void AddPair(T1 item1, T2 item2) - { - _forward.Add(item1, item2); - _backward.Add(item2, item1); - } - - public bool Contains1(T1 key1) => _forward.ContainsKey(key1); - public bool Contains2(T2 key2) => _backward.ContainsKey(key2); - - public T2 Get2(T1 key1) => _forward[key1]; - public T1 Get1(T2 key2) => _backward[key2]; - - public T2 Get2OrDefault(T1 key1) - => (key1 != null && _forward.ContainsKey(key1)) ? _forward[key1] : default(T2); - public T1 Get1OrDefault(T2 key2) - => (key2 != null && _backward.ContainsKey(key2)) ? _backward[key2] : default(T1); - - public void Clear() { _forward.Clear(); _backward.Clear(); } - } - - public class IntValueDictionary : Dictionary - { - public void IncKey(K key) - { - if (!this.ContainsKey(key)) - this.Add(key, 1); - else - { - var i = this[key]; - this.Remove(key); - this.Add(key, i + 1); - } - } - } -} diff --git a/src/AasxCsharpLibrary/AdminShellConverters.cs b/src/AasxCsharpLibrary/AdminShellConverters.cs deleted file mode 100644 index f75a1588c..000000000 --- a/src/AasxCsharpLibrary/AdminShellConverters.cs +++ /dev/null @@ -1,327 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using Extensions; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Newtonsoft.Json.Serialization; -using System; -using System.IO; -using System.Reflection; - -namespace AdminShellNS -{ - public static class AdminShellConverters - { - /// - /// This converter is used for reading JSON files; it claims to be responsible for - /// "Referable" (the base class) - /// and decides, which sub-class of the base class shall be populated. - /// If the object is SubmodelElement, the decision, shich special sub-class to create is done in a factory - /// SubmodelElementWrapper.CreateAdequateType(), - /// in order to have all sub-class specific decisions in one place (SubmodelElementWrapper) - /// Remark: There is a NuGet package JsonSubTypes, which could have done the job, except the fact of having - /// "modelType" being a class property with a contained property "name". - /// - public class JsonAasxConverter : JsonConverter - { - private string UpperClassProperty = "modelType"; - private string LowerClassProperty = "name"; - - public JsonAasxConverter() : base() - { - } - - public JsonAasxConverter(string UpperClassProperty, string LowerClassProperty) : base() - { - this.UpperClassProperty = UpperClassProperty; - this.LowerClassProperty = LowerClassProperty; - } - - public override bool CanConvert(Type objectType) - { - // Info MIHO 21 APR 2020: changed this from SubmodelElement to Referable - if (typeof(IReferable).IsAssignableFrom(objectType)) - return true; - return false; - } - - public override bool CanWrite - { - get { return false; } - } - - public override object ReadJson(JsonReader reader, - Type objectType, - object existingValue, - JsonSerializer serializer) - { - // Load JObject from stream - JObject jObject = JObject.Load(reader); - - // Create target object based on JObject - IReferable target = null; - - if (jObject.ContainsKey(UpperClassProperty)) - { - var j2 = jObject[UpperClassProperty]; - if (j2 != null) - foreach (var c in j2.Children()) - { - var cprop = c as Newtonsoft.Json.Linq.JProperty; - if (cprop == null) - continue; - if (cprop.Name == LowerClassProperty && cprop.Value.Type.ToString() == "String") - { - var cpval = cprop.Value.ToObject(); - if (cpval == null) - continue; - // Info MIHO 21 APR 2020: use Referable.CreateAdequateType instead of SMW... - var o = CreateAdequateType(cpval); - if (o != null) - target = o; - } - } - } - - // Populate the object properties - serializer.Populate(jObject.CreateReader(), target); - - return target; - } - - public static IReferable CreateAdequateType(string elementName) - { - if (elementName == KeyTypes.AssetAdministrationShell.ToString()) - return new AssetAdministrationShell("", null); - // dead-csharp off - //TODO (jtikekar, 0000-00-00): refactor default - //if (elementName == "Asset") - //TODO (jtikekar, 0000-00-00): Change - // return new AssetInformation(AssetKind.Instance); - if (elementName == KeyTypes.ConceptDescription.ToString()) - return new ConceptDescription(""); - if (elementName == KeyTypes.Submodel.ToString()) - return new Submodel(""); - //if (elementName == KeyTypes.View) - // return new View(); - // dead-csharp on - return CreateSubmodelElementIstance(elementName); - } - - private static ISubmodelElement CreateSubmodelElementIstance(string typeName) - { - //TODO (jtikekar, 0000-00-00): Need to test - Type type = Type.GetType(typeName); - if (type == null || !type.IsSubclassOf(typeof(ISubmodelElement))) - return null; - var sme = Activator.CreateInstance(type) as ISubmodelElement; - return sme; - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - throw new NotImplementedException(); - } - } - - /// - /// This converter / contract resolver for Json.NET adaptively filters different levels of depth - /// of nested AASX structures. - /// - public class AdaptiveFilterContractResolver : DefaultContractResolver - { - public bool AasHasViews = true; - public bool BlobHasValue = true; - public bool SubmodelHasElements = true; - public bool SmcHasValue = true; - public bool OpHasVariables = true; - - public AdaptiveFilterContractResolver() { } - - public AdaptiveFilterContractResolver(bool deep = true, bool complete = true) - { - if (!deep) - { - this.SubmodelHasElements = false; - this.SmcHasValue = false; - this.OpHasVariables = false; - } - if (!complete) - { - this.AasHasViews = false; - this.BlobHasValue = false; - } - - } - - // see: https://stackoverflow.com/questions/4963160/ - // how-to-determine-if-a-type-implements-an-interface-with-c-sharp-reflection - - protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) - { - JsonProperty property = base.CreateProperty(member, memberSerialization); - var icic = StringComparison.InvariantCultureIgnoreCase; - - if (!BlobHasValue && typeof(IBlob).IsAssignableFrom(property.DeclaringType) - && property.PropertyName.Equals("value", icic)) - property.ShouldSerialize = instance => { return false; }; - - if (!SubmodelHasElements && typeof(ISubmodel).IsAssignableFrom(property.DeclaringType) - && property.PropertyName.Equals("submodelElements", icic)) - property.ShouldSerialize = instance => { return false; }; - - if (!SmcHasValue && typeof(ISubmodelElementCollection).IsAssignableFrom(property.DeclaringType) - && property.PropertyName.Equals("value", icic)) - property.ShouldSerialize = instance => { return false; }; - - if (!OpHasVariables && typeof(IOperation).IsAssignableFrom(property.DeclaringType) - && (property.PropertyName.Equals("in", icic) - || property.PropertyName.Equals("out", icic))) - property.ShouldSerialize = instance => { return false; }; - - if (!AasHasViews && typeof(IAssetAdministrationShell).IsAssignableFrom(property.DeclaringType) - && property.PropertyName.Equals("views", icic)) - property.ShouldSerialize = instance => { return false; }; - - return property; - } - } - - public class AdaptiveAasIClassConverter : JsonConverter - { - public enum ConversionMode - { - /// - /// For (known) nodes of the AAS meta model, the converison of Newtonsoft.Json - /// is used. This is done by invoking creation of the real data type for the - /// desired interface types. - /// Assumption: fast, sloppy, fault-tolerant - /// - - Typecast, - /// - /// For (known) nodes of the AAS meta model, the sub-node content is converted - /// to string representation and subsequently converted by the AAS core deserialization. - /// Assumption: slow, precise but provide maximum compatibility. - /// - AasCore - }; - - public ConversionMode Mode = ConversionMode.Typecast; - - public bool WriteRawAasCore = false; - - /// - /// For **SERIALIZATION** and **JsonConverter attribute** a parameterless - /// constructor is needed. - /// - public AdaptiveAasIClassConverter() : base() - { - Mode = ConversionMode.AasCore; - } - - public AdaptiveAasIClassConverter(ConversionMode mode) : base() - { - Mode = mode; - } - - public override bool CanConvert(Type objectType) - { - if (typeof(IReference).IsAssignableFrom(objectType) - || typeof(IKey).IsAssignableFrom(objectType)) - return true; - return false; - } - - public override bool CanWrite - { - get { return true; } - } - - public override object ReadJson(JsonReader reader, - Type objectType, - object existingValue, - JsonSerializer serializer) - { - // check - if (reader.TokenType == JsonToken.Null) - return null; - - // spooky? - if (Mode == ConversionMode.AasCore) - { - var json = JRaw.Create(reader).ToString(); - var node = System.Text.Json.Nodes.JsonNode.Parse(json); - return ExtendIClass.IClassFrom(objectType, node); - } - - // Load JObject from stream - JObject jObject = JObject.Load(reader); - - // Create target object based on JObject - object target = null; - if (typeof(IReference).IsAssignableFrom(objectType)) - target = new Reference(ReferenceTypes.ExternalReference, null); - if (typeof(IKey).IsAssignableFrom(objectType)) - target = new Key(KeyTypes.GlobalReference, ""); - - // Populate the object properties - serializer.Populate(jObject.CreateReader(), target); - - return target; - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - if (value is IClass ic) - { - // serialize by AAS core - var jsonStr = Jsonization.Serialize.ToJsonObject(ic) - .ToJsonString(new System.Text.Json.JsonSerializerOptions() - { - WriteIndented = true - }); - - // how to write - if (WriteRawAasCore) - { - // directly write raw string into serializer - // drawback: no indentation - writer.WriteStartObject(); - jsonStr = jsonStr.TrimStart('{').TrimEnd('}'); - writer.WriteRaw(jsonStr); - writer.WriteEndObject(); - } - else - { - // double-digest by a text reader and rewrite token stream - // pro: indentation - // con: run time performance, chance of de-serialization issues - using (var reader = new JsonTextReader(new StringReader(jsonStr)) - { - DateParseHandling = DateParseHandling.None, - FloatParseHandling = FloatParseHandling.Decimal - }) - { - writer.WriteToken(reader); - } - } - } - else - { - // normal serialization - var jo = JObject.FromObject(value); - jo.WriteTo(writer); - } - } - } - - } -} diff --git a/src/AasxCsharpLibrary/AdminShellPackageEnv.cs b/src/AasxCsharpLibrary/AdminShellPackageEnv.cs deleted file mode 100644 index 1d726e98a..000000000 --- a/src/AasxCsharpLibrary/AdminShellPackageEnv.cs +++ /dev/null @@ -1,1695 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using Extensions; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.IO; -using System.IO.Packaging; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using System.Xml; -using System.Xml.Serialization; - -namespace AdminShellNS -{ - /// - /// This class lets an outer functionality keep track on the supplementary files, which are in or - /// are pending to be added or deleted to an Package. - /// - public class AdminShellPackageSupplementaryFile /*: IReferable*/ - { - public delegate byte[] SourceGetByteChunk(); - - public enum LocationType { InPackage, AddPending, DeletePending } - - public enum SpecialHandlingType { None, EmbedAsThumbnail } - - public readonly Uri Uri = null; - - public readonly string UseMimeType = null; - - public readonly string SourceLocalPath = null; - public readonly SourceGetByteChunk SourceGetBytesDel = null; - - public LocationType Location; - public readonly SpecialHandlingType SpecialHandling; - - public AdminShellPackageSupplementaryFile( - Uri uri, string sourceLocalPath = null, LocationType location = LocationType.InPackage, - SpecialHandlingType specialHandling = SpecialHandlingType.None, - SourceGetByteChunk sourceGetBytesDel = null, string useMimeType = null) - { - Uri = uri; - UseMimeType = useMimeType; - SourceLocalPath = sourceLocalPath; - SourceGetBytesDel = sourceGetBytesDel; - Location = location; - SpecialHandling = specialHandling; - } - - // class derives from Referable in order to provide GetElementName - public string GetElementName() - { - return "File"; - } - - } - - public class ListOfAasSupplementaryFile : List - { - public AdminShellPackageSupplementaryFile FindByUri(string path) - { - if (path == null) - return null; - - return this.FirstOrDefault( - x => x?.Uri?.ToString().Trim() == path.Trim()); - } - } - - /// - /// Provides (static?) helpers for serializing AAS.. - /// - public static class AdminShellSerializationHelper - { - - public static string TryReadXmlFirstElementNamespaceURI(Stream s) - { - string res = null; - try - { - var xr = System.Xml.XmlReader.Create(s); - int i = 0; - while (xr.Read()) - { - // limit amount of read - i++; - if (i > 99) - // obviously not found - break; - - // find element - if (xr.NodeType == System.Xml.XmlNodeType.Element) - { - res = xr.NamespaceURI; - break; - } - } - xr.Close(); - } - catch (Exception ex) - { - LogInternally.That.SilentlyIgnoredError(ex); - } - - // return to zero pos - s.Seek(0, SeekOrigin.Begin); - - // give back - return res; - } - - /// - /// Skips first few tokens of an XML content until first "real" element is encountered - /// - /// - public static void XmlSkipHeader(XmlReader xmlReader) - { - while (xmlReader.NodeType == XmlNodeType.XmlDeclaration || - xmlReader.NodeType == XmlNodeType.Whitespace || - xmlReader.NodeType == XmlNodeType.Comment || - xmlReader.NodeType == XmlNodeType.None) - xmlReader.Read(); - } - - /// - /// De-serialize an open stream into Environment. Does version/ compatibility management. - /// - /// Open for read stream - /// - public static AasCore.Aas3_0.Environment DeserializeXmlFromStreamWithCompat(Stream s) - { - // not sure - AasCore.Aas3_0.Environment res = null; - - // try get first element - var nsuri = TryReadXmlFirstElementNamespaceURI(s); - - // read V1.0? - if (nsuri != null && nsuri.Trim() == "http://www.admin-shell.io/aas/1/0") - { -#if !DoNotUseAasxCompatibilityModels - XmlSerializer serializer = new XmlSerializer( - typeof(AasxCompatibilityModels.AdminShellV10.AdministrationShellEnv), - "http://www.admin-shell.io/aas/1/0"); - var v10 = serializer.Deserialize(s) as AasxCompatibilityModels.AdminShellV10.AdministrationShellEnv; - res = new AasCore.Aas3_0.Environment(new List(), new List(), new List()); - res.ConvertFromV10(v10); - return res; -#else - throw (new Exception("Cannot handle AAS file format http://www.admin-shell.io/aas/1/0 !")); -#endif - } - - // read V2.0? - if (nsuri != null && nsuri.Trim() == "http://www.admin-shell.io/aas/2/0") - { -#if !DoNotUseAasxCompatibilityModels - XmlSerializer serializer = new XmlSerializer( - typeof(AasxCompatibilityModels.AdminShellV20.AdministrationShellEnv), - "http://www.admin-shell.io/aas/2/0"); - var v20 = serializer.Deserialize(s) as AasxCompatibilityModels.AdminShellV20.AdministrationShellEnv; - res = new AasCore.Aas3_0.Environment(new List(), new List(), new List()); - res.ConvertFromV20(v20); - return res; -#else - throw (new Exception("Cannot handle AAS file format http://www.admin-shell.io/aas/1/0 !")); -#endif - } - - // read V3.0? - if (nsuri != null && nsuri.Trim() == Xmlization.NS) - { - // dead-csharp off - //XmlSerializer serializer = new XmlSerializer( - // typeof(AasCore.Aas3_0_RC02.Environment), "http://www.admin-shell.io/aas/3/0"); - //res = serializer.Deserialize(s) as AasCore.Aas3_0_RC02.Environment; - // dead-csharp on - using (var xmlReader = XmlReader.Create(s)) - { - // TODO (MIHO, 2022-12-26): check if could be feature of AAS core - XmlSkipHeader(xmlReader); - res = Xmlization.Deserialize.EnvironmentFrom(xmlReader); - return res; - } - } - - // nope! - return null; - } - // dead-csharp off - //public static JsonSerializer BuildDefaultAasxJsonSerializer() - //{ - // var serializer = new JsonSerializer(); - // serializer.Converters.Add( - // new AdminShellConverters.JsonAasxConverter( - // "modelType", "name")); - // return serializer; - //} - public static T DeserializeFromJSON(string data) where T : IReferable - { - //using (var tr = new StringReader(data)) - //{ - //var serializer = BuildDefaultAasxJsonSerializer(); - //var rf = (T)serializer.Deserialize(tr, typeof(T)); - - var node = System.Text.Json.Nodes.JsonNode.Parse(data); - var rf = Jsonization.Deserialize.IReferableFrom(node); - - return (T)rf; - //} - } - - //public static T DeserializeFromJSON(JToken obj) where T : IReferable - //{ - // if (obj == null) - // return default(T); - // var serializer = BuildDefaultAasxJsonSerializer(); - // var rf = obj.ToObject(serializer); - // return rf; - //} - - ///// - ///// Use this, if DeserializeFromJSON is too tight. - ///// - //public static T DeserializePureObjectFromJSON(string data) - //{ - // using (var tr = new StringReader(data)) - // { - // //var serializer = BuildDefaultAasxJsonSerializer(); - // //var rf = (T)serializer.Deserialize(tr, typeof(T)); - // return null; - // } - //} - // dead-csharp on - } - - /// - /// This class encapsulates an AdminShellEnvironment and supplementary files into an AASX Package. - /// Specifically has the capability to load, update and store .XML, .JSON and .AASX packages. - /// - public class AdminShellPackageEnv : IDisposable - { - private string _fn = "New Package"; - - private string _tempFn = null; - - private AasCore.Aas3_0.Environment _aasEnv = new AasCore.Aas3_0.Environment(new List(), new List(), new List()); - private Package _openPackage = null; - private readonly ListOfAasSupplementaryFile _pendingFilesToAdd = new ListOfAasSupplementaryFile(); - private readonly ListOfAasSupplementaryFile _pendingFilesToDelete = new ListOfAasSupplementaryFile(); - - public AdminShellPackageEnv() { } - - public AdminShellPackageEnv(AasCore.Aas3_0.Environment env) - { - if (env != null) - _aasEnv = env; - } - - public AdminShellPackageEnv(string fn, bool indirectLoadSave = false) - { - Load(fn, indirectLoadSave); - } - - public bool IsOpen - { - get - { - return _openPackage != null; - } - } - - public void SetFilename(string fileName) - { - _fn = fileName; - } - - public string Filename - { - get - { - return _fn; - } - } - - public AasCore.Aas3_0.Environment AasEnv - { - get - { - return _aasEnv; - } - } - - private static AasCore.Aas3_0.Environment LoadXml(string fn) - { - try - { - using (var reader = new StreamReader(fn)) - { - var aasEnv = AdminShellSerializationHelper.DeserializeXmlFromStreamWithCompat( - reader.BaseStream); - - if (aasEnv == null) - throw new Exception("Type error for XML file"); - - return aasEnv; - } - } - catch (Exception ex) - { - throw new Exception( - $"While reading AAS {fn} at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}"); - } - } - - private static AasCore.Aas3_0.Environment LoadJson(string fn) - { - try - { - using (var file = System.IO.File.OpenRead(fn)) - { - // dead-csharp off - //// TODO (Michael Hoffmeister, 2020-08-01): use a unified function to create a serializer - //var serializer = new JsonSerializer(); - //serializer.Converters.Add( - // new AdminShellConverters.JsonAasxConverter( - // "modelType", "name")); - - //var aasEnv = (AasCore.Aas3_0_RC02.Environment)serializer.Deserialize( - // file, typeof(AasCore.Aas3_0_RC02.Environment)); - // dead-csharp on - var node = System.Text.Json.Nodes.JsonNode.Parse(file); - var aasEnv = Jsonization.Deserialize.EnvironmentFrom(node); - - return aasEnv; - } - } - catch (Exception ex) - { - throw new Exception( - $"While reading AAS {fn} at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}"); - } - } - - /// is unequal if indirectLoadSave is used. - private static (AasCore.Aas3_0.Environment, Package) LoadPackageAasx(string fn, string fnToLoad) - { - AasCore.Aas3_0.Environment aasEnv; - Package openPackage = null; - - Package package; - try - { - package = Package.Open(fnToLoad, FileMode.Open); - } - catch (Exception ex) - { - throw new Exception( - fn == fnToLoad - ? $"While opening the package to read AASX {fn} " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}" - : $"While opening the package to read AASX {fn} indirectly from {fnToLoad} " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}"); - } - - try - { - // get the origin from the package - PackagePart originPart = null; - var xs = package.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - //originPart = package.GetPart(x.TargetUri); - var absoluteURI = PackUriHelper.ResolvePartUri(x.SourceUri, x.TargetUri); - if (package.PartExists(absoluteURI)) - { - originPart = package.GetPart(absoluteURI); - } - break; - } - - if (originPart == null) - throw (new Exception("Unable to find AASX origin. Aborting!")); - - // get the specs from the package - PackagePart specPart = null; - xs = originPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-spec"); - foreach (var x in xs) - { - //specPart = package.GetPart(x.TargetUri); - var absoluteURI = PackUriHelper.ResolvePartUri(x.SourceUri, x.TargetUri); - if (package.PartExists(absoluteURI)) - { - specPart = package.GetPart(absoluteURI); - } - break; - } - - if (specPart == null) - throw (new Exception("Unable to find AASX spec(s). Aborting!")); - - // open spec part to read - try - { - if (specPart.Uri.ToString().ToLower().Trim().EndsWith("json")) - { - using (var s = specPart.GetStream(FileMode.Open)) - { - // dead-csharp off - //using (var file = new StreamReader(s)) - //{ - //JsonSerializer serializer = new JsonSerializer(); - //serializer.Converters.Add( - // new AdminShellConverters.JsonAasxConverter( - // "modelType", "name")); - - //aasEnv = (AasCore.Aas3_0_RC02.Environment)serializer.Deserialize( - // file, typeof(AasCore.Aas3_0_RC02.Environment)); - - var node = System.Text.Json.Nodes.JsonNode.Parse(s); - aasEnv = Jsonization.Deserialize.EnvironmentFrom(node); - //} - // dead-csharp on - } - } - else - { - using (var s = specPart.GetStream(FileMode.Open)) - { - // own catch loop to be more specific - aasEnv = AdminShellSerializationHelper.DeserializeXmlFromStreamWithCompat(s); - openPackage = package; - - if (aasEnv == null) - throw new Exception("Type error for XML file!"); - } - } - } - catch (Exception ex) - { - throw new Exception( - fn == fnToLoad - ? $"While reading spec from the AASX {fn} " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}" - : $"While reading spec from the {fn} (and indirectly over {fnToLoad}) " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}"); - } - } - catch (Exception ex) - { - throw new Exception( - fn == fnToLoad - ? $"While reading the AASX {fn} " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}" - : $"While reading the {fn} (and indirectly over {fnToLoad}) " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}"); - } - finally - { - if (openPackage == null) - { - package.Close(); - } - } - - return (aasEnv, openPackage); - } - - public void Load(string fn, bool indirectLoadSave = false) - { - _fn = fn; - _openPackage?.Close(); - _openPackage = null; - - string extension = Path.GetExtension(fn).ToLower(); - switch (extension) - { - case ".xml": - { - _aasEnv = LoadXml(fn); - break; - } - case ".json": - { - _aasEnv = LoadJson(fn); - break; - } - case ".aasx": - { - var fnToLoad = fn; - _tempFn = null; - if (indirectLoadSave) - { - try - { - _tempFn = System.IO.Path.GetTempFileName().Replace(".tmp", ".aasx"); - System.IO.File.Copy(fn, _tempFn); - fnToLoad = _tempFn; - - } - catch (Exception ex) - { - throw new Exception( - $"While copying AASX {fn} for indirect load to {fnToLoad} " + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}"); - } - } - - // load package AASX - (_aasEnv, _openPackage) = LoadPackageAasx(fn, fnToLoad); - break; - } - default: - throw new Exception( - $"Does not know how to handle the extension {extension} of the file: {fn}"); - } - } - - public void SetTempFn(string fn) - { - try - { - _tempFn = System.IO.Path.GetTempFileName().Replace(".tmp", ".aasx"); - System.IO.File.Copy(fn, _tempFn); - - } - catch (Exception ex) - { - throw new Exception( - $"While copying AASX {fn}" + - $"at {AdminShellUtil.ShortLocation(ex)} gave: {ex.Message}"); - } - } - - public void LoadFromAasEnvString(string content) - { - try - { - // dead-csharp off - //using (var file = new StringReader(content)) - //{ - // TODO (Michael Hoffmeister, 2020-08-01): use a unified function to create a serializer - //JsonSerializer serializer = new JsonSerializer(); - //serializer.Converters.Add(new AdminShellConverters.JsonAasxConverter("modelType", "name")); - //_aasEnv = (AasCore.Aas3_0_RC02.Environment)serializer.Deserialize( - // file, typeof(AasCore.Aas3_0_RC02.Environment)); - - var node = System.Text.Json.Nodes.JsonNode.Parse(content); - _aasEnv = Jsonization.Deserialize.EnvironmentFrom(node); - //} - // dead-csharp on - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While reading AASENV string {0} gave: {1}", - AdminShellUtil.ShortLocation(ex), ex.Message))); - } - } - - public enum SerializationFormat { None, Xml, Json }; - // dead-csharp off - //public static XmlSerializerNamespaces GetXmlDefaultNamespaces() - //{ - // var nss = new XmlSerializerNamespaces(); - // nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - // nss.Add("aas", "http://www.admin-shell.io/aas/2/0"); - // nss.Add("IEC", "http://www.admin-shell.io/IEC61360/2/0"); - // nss.Add("abac", "http://www.admin-shell.io/aas/abac/2/0"); - // return nss; - //} - // dead-csharp on - public bool SaveAs(string fn, bool writeFreshly = false, SerializationFormat prefFmt = SerializationFormat.None, - MemoryStream useMemoryStream = null, bool saveOnlyCopy = false) - { - // silently fix flaws - _aasEnv?.SilentFix30(); - - // ok, which format? - if (fn.ToLower().EndsWith(".xml")) - { - // save only XML - if (!saveOnlyCopy) - _fn = fn; - try - { - Stream s = (useMemoryStream != null) - ? (Stream)useMemoryStream - : System.IO.File.Open(fn, FileMode.Create, FileAccess.Write); - - try - { - // dead-csharp off - // TODO (Michael Hoffmeister, 2020-08-01): use a unified function to create a serializer - //var serializer = new XmlSerializer(typeof(AasCore.Aas3_0_RC02.Environment)); - //var nss = GetXmlDefaultNamespaces(); - //serializer.Serialize(s, _aasEnv, nss); - // dead-csharp on - var writer = XmlWriter.Create(s, new XmlWriterSettings() - { - Indent = true, - OmitXmlDeclaration = true - }); - Xmlization.Serialize.To( - _aasEnv, writer); - writer.Flush(); - writer.Close(); - s.Flush(); - } - finally - { - // close? - if (useMemoryStream == null) - s.Close(); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While writing AAS {0} at {1} gave: {2}", - fn, AdminShellUtil.ShortLocation(ex), ex.Message))); - } - return true; - } - - if (fn.ToLower().EndsWith(".json")) - { - // save only JSON - // This functionality is an initial test. - if (!saveOnlyCopy) - _fn = fn; - try - { - Stream s = (useMemoryStream != null) ? (Stream)useMemoryStream - : System.IO.File.Open(fn, FileMode.Create, FileAccess.Write); - - try - { - // dead-csharp off - //// TODO (Michael Hoffmeister, 2020-08-01): use a unified function to create a serializer - //JsonSerializer serializer = new JsonSerializer() - //{ - // NullValueHandling = NullValueHandling.Ignore, - // ReferenceLoopHandling = ReferenceLoopHandling.Serialize, - // Formatting = Newtonsoft.Json.Formatting.Indented - //}; - - //var sw = new StreamWriter(s); - //var writer = new JsonTextWriter(sw); - - //serializer.Serialize(writer, _aasEnv); - //writer.Flush(); - //sw.Flush(); - //s.Flush(); - - //if (useMemoryStream == null) - //{ - // writer.Close(); - // sw.Close(); - //} - // dead-csharp on - using (var wr = new System.Text.Json.Utf8JsonWriter(s)) - { - Jsonization.Serialize.ToJsonObject(_aasEnv).WriteTo(wr, - new System.Text.Json.JsonSerializerOptions() - { - WriteIndented = true - }); - wr.Flush(); - s.Flush(); - } - } - finally - { - // close? - if (useMemoryStream == null) - s.Close(); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While writing AAS {0} at {1} gave: {2}", - fn, AdminShellUtil.ShortLocation(ex), ex.Message))); - } - return true; - } - - if (fn.ToLower().EndsWith(".aasx")) - { - // save package AASX - try - { - // We want existing contents to be preserved, but do not want to allow the change of the file name. - // Therefore: copy the file to a new name, then re-open. - // fn could be changed, therefore close "old" package first - if (_openPackage != null) - { - try - { - _openPackage.Close(); - if (!writeFreshly) - { - if (_tempFn != null) - System.IO.File.Copy(_tempFn, fn); - else - { - /* TODO (MIHO, 2021-01-02): check again. - * Revisiting this code after a while, and after - * the code has undergo some changes by MR, the following copy command needed - * to be amended with a if to protect against self-copy. */ - if (_fn != fn) - System.IO.File.Copy(_fn, fn); - } - } - } - catch (Exception ex) - { - LogInternally.That.SilentlyIgnoredError(ex); - } - _openPackage = null; - } - - // approach is to utilize the existing package, if possible. If not, create from scratch - Package package = null; - if (useMemoryStream != null) - { - package = Package.Open( - useMemoryStream, (writeFreshly) ? FileMode.Create : FileMode.OpenOrCreate); - } - else - { - package = Package.Open( - (_tempFn != null) ? _tempFn : fn, - (writeFreshly) ? FileMode.Create : FileMode.OpenOrCreate); - } - _fn = fn; - - // get the origin from the package - PackagePart originPart = null; - var xs = package.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - //originPart = package.GetPart(x.TargetUri); - var absoluteURI = PackUriHelper.ResolvePartUri(x.SourceUri, x.TargetUri); - if (package.PartExists(absoluteURI)) - { - originPart = package.GetPart(absoluteURI); - } - break; - } - if (originPart == null) - { - // create, as not existing - originPart = package.CreatePart( - new Uri("/aasx/aasx-origin", UriKind.RelativeOrAbsolute), - System.Net.Mime.MediaTypeNames.Text.Plain, CompressionOption.Maximum); - using (var s = originPart.GetStream(FileMode.Create)) - { - var bytes = System.Text.Encoding.ASCII.GetBytes("Intentionally empty"); - s.Write(bytes, 0, bytes.Length); - } - package.CreateRelationship( - originPart.Uri, TargetMode.Internal, - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - } - - // get the specs from the package - PackagePart specPart = null; - PackageRelationship specRel = null; - xs = originPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-spec"); - foreach (var x in xs) - { - specRel = x; - //specPart = package.GetPart(x.TargetUri); - var absoluteURI = PackUriHelper.ResolvePartUri(x.SourceUri, x.TargetUri); - if (package.PartExists(absoluteURI)) - { - specPart = package.GetPart(absoluteURI); - } - break; - } - - // check, if we have to change the spec part - if (specPart != null && specRel != null) - { - var name = System.IO.Path.GetFileNameWithoutExtension( - specPart.Uri.ToString()).ToLower().Trim(); - var ext = System.IO.Path.GetExtension(specPart.Uri.ToString()).ToLower().Trim(); - if ((ext == ".json" && prefFmt == SerializationFormat.Xml) - || (ext == ".xml" && prefFmt == SerializationFormat.Json) - || (name.StartsWith("aasenv-with-no-id"))) - { - // try kill specpart - try - { - originPart.DeleteRelationship(specRel.Id); - package.DeletePart(specPart.Uri); - } - catch (Exception ex) - { - LogInternally.That.SilentlyIgnoredError(ex); - } - finally { specPart = null; specRel = null; } - } - } - - if (specPart == null) - { - // create, as not existing - var frn = "aasenv-with-no-id"; - if (_aasEnv.AssetAdministrationShells.Count > 0) - frn = _aasEnv.AssetAdministrationShells[0].GetFriendlyName() ?? frn; - var aas_spec_fn = "/aasx/#/#.aas"; - if (prefFmt == SerializationFormat.Json) - aas_spec_fn += ".json"; - else - aas_spec_fn += ".xml"; - aas_spec_fn = aas_spec_fn.Replace("#", "" + frn); - specPart = package.CreatePart( - new Uri(aas_spec_fn, UriKind.RelativeOrAbsolute), - System.Net.Mime.MediaTypeNames.Text.Xml, CompressionOption.Maximum); - originPart.CreateRelationship( - specPart.Uri, TargetMode.Internal, - "http://www.admin-shell.io/aasx/relationships/aas-spec"); - } - - // now, specPart shall be != null! - if (specPart.Uri.ToString().ToLower().Trim().EndsWith("json")) - { - using (var s = specPart.GetStream(FileMode.Create)) - { - JsonSerializer serializer = new JsonSerializer(); - serializer.NullValueHandling = NullValueHandling.Ignore; - serializer.ReferenceLoopHandling = ReferenceLoopHandling.Serialize; - serializer.Formatting = Newtonsoft.Json.Formatting.Indented; - using (var sw = new StreamWriter(s)) - { - using (JsonWriter writer = new JsonTextWriter(sw)) - { - serializer.Serialize(writer, _aasEnv); - } - } - } - } - else - { - using (var s = specPart.GetStream(FileMode.Create)) - { - - var writer = XmlWriter.Create(s, new XmlWriterSettings() - { - Indent = true, - OmitXmlDeclaration = true - }); - Xmlization.Serialize.To( - _aasEnv, writer); - writer.Flush(); - writer.Close(); - s.Flush(); - } - } - - // there might be pending files to be deleted (first delete, then add, - // in case of identical files in both categories) - foreach (var psfDel in _pendingFilesToDelete) - { - // try find an existing part for that file .. - var found = false; - - // normal files - xs = specPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-suppl"); - foreach (var x in xs) - if (x.TargetUri == psfDel.Uri) - { - // try to delete - specPart.DeleteRelationship(x.Id); - package.DeletePart(psfDel.Uri); - found = true; - break; - } - - // thumbnails - xs = package.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.TargetUri == psfDel.Uri) - { - // try to delete - package.DeleteRelationship(x.Id); - package.DeletePart(psfDel.Uri); - found = true; - break; - } - - if (!found) - throw (new Exception( - $"Not able to delete pending file {psfDel.Uri} in saving package {fn}")); - } - - // after this, there are no more pending for delete files - _pendingFilesToDelete.Clear(); - - // write pending supplementary files - foreach (var psfAdd in _pendingFilesToAdd) - { - // make sure .. - if ((psfAdd.SourceLocalPath == null && psfAdd.SourceGetBytesDel == null) || - psfAdd.Location != AdminShellPackageSupplementaryFile.LocationType.AddPending) - continue; - - // normal file? - if (psfAdd.SpecialHandling == AdminShellPackageSupplementaryFile.SpecialHandlingType.None || - psfAdd.SpecialHandling == - AdminShellPackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail) - { - - // try find an existing part for that file .. - PackagePart filePart = null; - if (psfAdd.SpecialHandling == AdminShellPackageSupplementaryFile.SpecialHandlingType.None) - { - xs = specPart.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aas-suppl"); - foreach (var x in xs) - if (x.TargetUri == psfAdd.Uri) - { - //filePart = package.GetPart(x.TargetUri); - var absoluteURI = PackUriHelper.ResolvePartUri(x.SourceUri, x.TargetUri); - if (package.PartExists(absoluteURI)) - { - filePart = package.GetPart(absoluteURI); - } - break; - } - } - if (psfAdd.SpecialHandling == - AdminShellPackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail) - { - xs = package.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/" && x.TargetUri == psfAdd.Uri) - { - //filePart = package.GetPart(x.TargetUri); - var absoluteURI = PackUriHelper.ResolvePartUri(x.SourceUri, x.TargetUri); - if (package.PartExists(absoluteURI)) - { - filePart = package.GetPart(absoluteURI); - } - break; - } - } - - if (filePart == null) - { - // determine mimeType - var mimeType = psfAdd.UseMimeType; - // reconcile mime - if (mimeType == null && psfAdd.SourceLocalPath != null) - mimeType = AdminShellPackageEnv.GuessMimeType(psfAdd.SourceLocalPath); - // still null? - if (mimeType == null) - // see: https://stackoverflow.com/questions/6783921/ - // which-mime-type-to-use-for-a-binary-file-thats-specific-to-my-program - mimeType = "application/octet-stream"; - - // create new part and link - filePart = package.CreatePart(psfAdd.Uri, mimeType, CompressionOption.Maximum); - if (psfAdd.SpecialHandling == - AdminShellPackageSupplementaryFile.SpecialHandlingType.None) - specPart.CreateRelationship( - filePart.Uri, TargetMode.Internal, - "http://www.admin-shell.io/aasx/relationships/aas-suppl"); - if (psfAdd.SpecialHandling == - AdminShellPackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail) - package.CreateRelationship( - filePart.Uri, TargetMode.Internal, - "http://schemas.openxmlformats.org/package/2006/" + - "relationships/metadata/thumbnail"); - } - - // now should be able to write - using (var s = filePart.GetStream(FileMode.Create)) - { - if (psfAdd.SourceLocalPath != null) - { - var bytes = System.IO.File.ReadAllBytes(psfAdd.SourceLocalPath); - s.Write(bytes, 0, bytes.Length); - } - - if (psfAdd.SourceGetBytesDel != null) - { - var bytes = psfAdd.SourceGetBytesDel(); - if (bytes != null) - s.Write(bytes, 0, bytes.Length); - } - } - } - } - - // after this, there are no more pending for add files - _pendingFilesToAdd.Clear(); - - // flush, but leave open - package.Flush(); - _openPackage = package; - - // if in temp fn, close the package, copy to original fn, re-open the package - if (_tempFn != null) - try - { - package.Close(); - System.IO.File.Copy(_tempFn, _fn, overwrite: true); - _openPackage = Package.Open(_tempFn, FileMode.OpenOrCreate); - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While write AASX {0} indirectly at {1} gave: {2}", - fn, AdminShellUtil.ShortLocation(ex), ex.Message))); - } - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While write AASX {0} at {1} gave: {2}", - fn, AdminShellUtil.ShortLocation(ex), ex.Message))); - } - return true; - } - - // Don't know to handle - throw new Exception($"Does not know how to handle the file: {fn}"); - } - - /// - /// Temporariyl saves & closes package and executes lambda. Afterwards, the package is re-opened - /// under the same file name - /// - /// Action which is to be executed while the file is CLOSED - /// Format for the saved file - public void TemporarilySaveCloseAndReOpenPackage( - Action lambda, - AdminShellPackageEnv.SerializationFormat prefFmt = AdminShellPackageEnv.SerializationFormat.None) - { - // access - if (!this.IsOpen) - throw (new Exception( - string.Format("Could not temporarily close and re-open AASX {0}, because package" + - "not open as expected!", Filename))); - - try - { - // save (it will be open, still) - SaveAs(this.Filename, prefFmt: prefFmt); - - // close - _openPackage.Flush(); - _openPackage.Close(); - - // execute lambda - lambda?.Invoke(); - } - catch (Exception ex) - { - throw (new Exception( - string.Format("While temporarily close and re-open AASX {0} at {1} gave: {2}", - Filename, AdminShellUtil.ShortLocation(ex), ex.Message))); - } - finally - { - // even after failing of the lambda, the package shall be re-opened - if (Filename.ToLower().EndsWith(".aasx")) - { - _openPackage = Package.Open(Filename, FileMode.OpenOrCreate); - - } - } - } - - private int BackupIndex = 0; - - public void BackupInDir(string backupDir, int maxFiles) - { - // access - if (backupDir == null || maxFiles < 1) - return; - - // we do it not caring on any errors - try - { - // get index in form - if (BackupIndex == 0) - { - // do not always start at 0!! - var rnd = new Random(); - BackupIndex = rnd.Next(maxFiles); - } - var ndx = BackupIndex % maxFiles; - BackupIndex += 1; - - // build a filename - var bdfn = Path.Combine(backupDir, $"backup{ndx:000}.xml"); - - // raw save - using (var s = new StreamWriter(bdfn)) - { - // dead-csharp off - //var serializer = new XmlSerializer(typeof(AasCore.Aas3_0_RC02.Environment)); - //var nss = new XmlSerializerNamespaces(); - //nss.Add("xsi", System.Xml.Schema.XmlSchema.InstanceNamespace); - //nss.Add("aas", "http://www.admin-shell.io/aas/2/0"); - //nss.Add("IEC61360", "http://www.admin-shell.io/IEC61360/2/0"); - //serializer.Serialize(s, _aasEnv, nss); - // dead-csharp on - var writer = XmlWriter.Create(s, new XmlWriterSettings() - { - Indent = true, - OmitXmlDeclaration = true - }); - Xmlization.Serialize.To( - _aasEnv, writer); - writer.Flush(); - writer.Close(); - s.Flush(); - } - } - catch (Exception ex) - { - LogInternally.That.SilentlyIgnoredError(ex); - } - } - - public Stream GetStreamFromUriOrLocalPackage(string uriString, - FileMode mode = FileMode.Open, - FileAccess access = FileAccess.Read) - { - // local - if (IsLocalFile(uriString)) - return GetLocalStreamFromPackage(uriString, mode, access); - - // no .. - return System.IO.File.Open(uriString, mode, access); - } - - public byte[] GetByteArrayFromUriOrLocalPackage(string uriString) - { - try - { - using (var input = GetStreamFromUriOrLocalPackage(uriString)) - { - using (MemoryStream ms = new MemoryStream()) - { - input.CopyTo(ms); - return ms.ToArray(); - } - } - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - return null; - } - } - - public bool IsLocalFile(string uriString) - { - // access - if (_openPackage == null) - return false; - if (uriString == null || uriString == "" || !uriString.StartsWith("/")) - return false; - - // check - var isLocal = _openPackage.PartExists(new Uri(uriString, UriKind.RelativeOrAbsolute)); - return isLocal; - } - - private static WebProxy proxy = null; - - public Stream GetLocalStreamFromPackage(string uriString, FileMode mode = FileMode.Open, FileAccess access = FileAccess.Read) - { - // Check, if remote - if (uriString.ToLower().Substring(0, 4) == "http") - { - if (proxy == null) - { - string proxyAddress = ""; - string username = ""; - string password = ""; - - string proxyFile = "proxy.txt"; - if (System.IO.File.Exists(proxyFile)) - { - try - { // Open the text file using a stream reader. - using (StreamReader sr = new StreamReader(proxyFile)) - { - proxyFile = sr.ReadLine(); - } - } - catch (IOException e) - { - Console.WriteLine("proxy.txt could not be read:"); - Console.WriteLine(e.Message); - } - } - - try - { - using (StreamReader sr = new StreamReader(proxyFile)) - { - proxyAddress = sr.ReadLine(); - username = sr.ReadLine(); - password = sr.ReadLine(); - } - } - catch (Exception e) - { - Console.WriteLine(e.Message); - Console.WriteLine(proxyFile + " not found!"); - } - - if (proxyAddress != "") - { - proxy = new WebProxy(); - Uri newUri = new Uri(proxyAddress); - proxy.Address = newUri; - proxy.Credentials = new NetworkCredential(username, password); - Console.WriteLine("Using proxy: " + proxyAddress); - } - } - - var handler = new HttpClientHandler(); - - if (proxy != null) - handler.Proxy = proxy; - else - handler.DefaultProxyCredentials = CredentialCache.DefaultCredentials; - var hc = new HttpClient(handler); - - var response = hc.GetAsync(uriString).GetAwaiter().GetResult(); - - // if you call response.EnsureSuccessStatusCode here it will throw an exception - if (response.StatusCode == HttpStatusCode.Moved - || response.StatusCode == HttpStatusCode.Found) - { - var location = response.Headers.Location; - response = hc.GetAsync(location).GetAwaiter().GetResult(); - } - - response.EnsureSuccessStatusCode(); - var s = response.Content.ReadAsStreamAsync().GetAwaiter().GetResult(); - - if (s.Length < 500) // indirect load? - { - StreamReader reader = new StreamReader(s); - string json = reader.ReadToEnd(); - var parsed = JObject.Parse(json); - try - { - string url = parsed.SelectToken("url").Value(); - response = hc.GetAsync(url).GetAwaiter().GetResult(); - response.EnsureSuccessStatusCode(); - s = response.Content.ReadAsStreamAsync().GetAwaiter().GetResult(); - } - catch - { - } - } - - return s; - } - - // access - if (_openPackage == null) - throw (new Exception(string.Format($"AASX Package {_fn} not opened. Aborting!"))); - - // exist - var puri = new Uri(uriString, UriKind.RelativeOrAbsolute); - if (!_openPackage.PartExists(puri)) - throw (new Exception(string.Format($"AASX Package has no part {uriString}. Aborting!"))); - - // get part - var part = _openPackage.GetPart(puri); - if (part == null) - throw (new Exception( - string.Format($"Cannot access part {uriString} in {_fn}. Aborting!"))); - return part.GetStream(mode, access); - } - - public async Task ReplaceSupplementaryFileInPackageAsync(string sourceUri, string targetFile, string targetContentType, Stream fileContent) - { - // access - if (_openPackage == null) - throw (new Exception(string.Format($"AASX Package {_fn} not opened. Aborting!"))); - - if (!string.IsNullOrEmpty(sourceUri)) - { - _openPackage.DeletePart(new Uri(sourceUri, UriKind.RelativeOrAbsolute)); - - } - var targetUri = PackUriHelper.CreatePartUri(new Uri(targetFile, UriKind.RelativeOrAbsolute)); - PackagePart packagePart = _openPackage.CreatePart(targetUri, targetContentType); - fileContent.Position = 0; - using (Stream dest = packagePart.GetStream()) - { - fileContent.CopyTo(dest); - } - } - - public long GetStreamSizeFromPackage(string uriString) - { - long res = 0; - try - { - if (_openPackage == null) - return 0; - - PackagePart part = null; - var uri = new Uri(uriString, UriKind.RelativeOrAbsolute); - if (_openPackage.PartExists(uri)) - { - part = _openPackage.GetPart(uri); - } - if (part != null) - { - using (var s = part.GetStream(FileMode.Open)) - { - res = s.Length; - } - } - } - catch (Exception ex) - { - LogInternally.That.SilentlyIgnoredError(ex); - return 0; - } - return res; - } - - /// - /// Ensures: - ///
  • result == null || result.CanRead
- ///
- public Stream GetLocalThumbnailStream(ref Uri thumbUri) - { - // access - if (_openPackage == null) - throw (new Exception(string.Format($"AASX Package {_fn} not opened. Aborting!"))); - // get the thumbnail over the relationship - PackagePart thumbPart = null; - var xs = _openPackage.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - //thumbPart = _openPackage.GetPart(x.TargetUri); - var absoluteURI = PackUriHelper.ResolvePartUri(x.SourceUri, x.TargetUri); - if (_openPackage.PartExists(absoluteURI)) - { - thumbPart = _openPackage.GetPart(absoluteURI); - } - thumbUri = x.TargetUri; - break; - } - if (thumbPart == null) - throw (new Exception("Unable to find AASX thumbnail. Aborting!")); - - var result = thumbPart.GetStream(FileMode.Open); - - // Post-condition - if (!(result == null || result.CanRead)) - { - throw new InvalidOperationException("Unexpected unreadable result stream"); - } - - return result; - } - - /// - /// Ensures: - ///
  • result == null || result.CanRead
- ///
- public Stream GetLocalThumbnailStream() - { - Uri dummy = null; - var result = GetLocalThumbnailStream(ref dummy); - - // Post-condition - if (!(result == null || result.CanRead)) - { - throw new InvalidOperationException("Unexpected unreadable result stream"); - } - - return result; - } - - public ListOfAasSupplementaryFile GetListOfSupplementaryFiles() - { - // new result - var result = new ListOfAasSupplementaryFile(); - - // access - if (_openPackage != null) - { - - // get the thumbnail(s) from the package - var xs = _openPackage.GetRelationshipsByType( - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - result.Add(new AdminShellPackageSupplementaryFile( - x.TargetUri, - location: AdminShellPackageSupplementaryFile.LocationType.InPackage, - specialHandling: AdminShellPackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail)); - } - - // get the origin from the package - PackagePart originPart = null; - xs = _openPackage.GetRelationshipsByType( - "http://www.admin-shell.io/aasx/relationships/aasx-origin"); - foreach (var x in xs) - if (x.SourceUri.ToString() == "/") - { - //originPart = _openPackage.GetPart(x.TargetUri); - var absoluteURI = PackUriHelper.ResolvePartUri(x.SourceUri, x.TargetUri); - if (_openPackage.PartExists(absoluteURI)) - { - originPart = _openPackage.GetPart(absoluteURI); - } - break; - } - - if (originPart != null) - { - // get the specs from the origin - PackagePart specPart = null; - xs = originPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-spec"); - foreach (var x in xs) - { - //specPart = _openPackage.GetPart(x.TargetUri); - var absoluteURI = PackUriHelper.ResolvePartUri(x.SourceUri, x.TargetUri); - if (_openPackage.PartExists(absoluteURI)) - { - specPart = _openPackage.GetPart(absoluteURI); - } - break; - } - - if (specPart != null) - { - // get the supplementaries from the package, derived from spec - xs = specPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-suppl"); - foreach (var x in xs) - { - result.Add( - new AdminShellPackageSupplementaryFile( - x.TargetUri, location: AdminShellPackageSupplementaryFile.LocationType.InPackage)); - } - } - } - } - - // add or modify the files to delete - foreach (var psfDel in _pendingFilesToDelete) - { - // already in - var found = result.Find(x => { return x.Uri == psfDel.Uri; }); - if (found != null) - found.Location = AdminShellPackageSupplementaryFile.LocationType.DeletePending; - else - { - psfDel.Location = AdminShellPackageSupplementaryFile.LocationType.DeletePending; - result.Add(psfDel); - } - } - - // add the files to store as well - foreach (var psfAdd in _pendingFilesToAdd) - { - // already in (should not happen ?!) - var found = result.Find(x => { return x.Uri == psfAdd.Uri; }); - if (found != null) - found.Location = AdminShellPackageSupplementaryFile.LocationType.AddPending; - else - { - psfAdd.Location = AdminShellPackageSupplementaryFile.LocationType.AddPending; - result.Add(psfAdd); - } - } - - // done - return result; - } - - public static string GuessMimeType(string fn) - { - var file_ext = System.IO.Path.GetExtension(fn).ToLower().Trim(); - var content_type = System.Net.Mime.MediaTypeNames.Text.Plain; - if (file_ext == ".pdf") content_type = System.Net.Mime.MediaTypeNames.Application.Pdf; - if (file_ext == ".xml") content_type = System.Net.Mime.MediaTypeNames.Text.Xml; - if (file_ext == ".txt") content_type = System.Net.Mime.MediaTypeNames.Text.Plain; - if (file_ext == ".igs") content_type = "application/iges"; - if (file_ext == ".iges") content_type = "application/iges"; - if (file_ext == ".stp") content_type = "application/step"; - if (file_ext == ".step") content_type = "application/step"; - if (file_ext == ".jpg") content_type = System.Net.Mime.MediaTypeNames.Image.Jpeg; - if (file_ext == ".jpeg") content_type = System.Net.Mime.MediaTypeNames.Image.Jpeg; - if (file_ext == ".png") content_type = "image/png"; - if (file_ext == ".gif") content_type = System.Net.Mime.MediaTypeNames.Image.Gif; - return content_type; - } - - public void PrepareSupplementaryFileParameters(ref string targetDir, ref string targetFn) - { - // re-work target dir - if (targetDir != null) - targetDir = targetDir.Replace(@"\", "/"); - - // rework targetFn - if (targetFn != null) - targetFn = Regex.Replace(targetFn, @"[^A-Za-z0-9-.]+", "_"); - } - - /// - /// Add a file as supplementary file to package. Operation will be pending, package needs to be saved in order - /// materialize embedding. - /// - /// Target path of file in package - public string AddSupplementaryFileToStore( - string sourcePath, string targetDir, string targetFn, bool embedAsThumb, - AdminShellPackageSupplementaryFile.SourceGetByteChunk sourceGetBytesDel = null, string useMimeType = null) - { - // beautify parameters - if ((sourcePath == null && sourceGetBytesDel == null) || targetDir == null || targetFn == null) - return null; - - // build target path - targetDir = targetDir.Trim(); - if (!targetDir.EndsWith("/")) - targetDir += "/"; - targetFn = targetFn.Trim(); - if (sourcePath == "" || targetDir == "" || targetFn == "") - throw (new Exception("Trying add supplementary file with empty name or path!")); - - var targetPath = "" + targetDir.Trim() + targetFn.Trim(); - - // base function - AddSupplementaryFileToStore(sourcePath, targetPath, embedAsThumb, sourceGetBytesDel, useMimeType); - - // return target path - return targetPath; - } - - public void AddSupplementaryFileToStore(string sourcePath, string targetPath, bool embedAsThumb, - AdminShellPackageSupplementaryFile.SourceGetByteChunk sourceGetBytesDel = null, string useMimeType = null) - { - // beautify parameters - if ((sourcePath == null && sourceGetBytesDel == null) || targetPath == null) - return; - - sourcePath = sourcePath?.Trim(); - targetPath = targetPath.Trim(); - - // add record - _pendingFilesToAdd.Add( - new AdminShellPackageSupplementaryFile( - new Uri(targetPath, UriKind.RelativeOrAbsolute), - sourcePath, - location: AdminShellPackageSupplementaryFile.LocationType.AddPending, - specialHandling: (embedAsThumb - ? AdminShellPackageSupplementaryFile.SpecialHandlingType.EmbedAsThumbnail - : AdminShellPackageSupplementaryFile.SpecialHandlingType.None), - sourceGetBytesDel: sourceGetBytesDel, - useMimeType: useMimeType) - ); - - } - - public void DeleteSupplementaryFile(AdminShellPackageSupplementaryFile psf) - { - if (psf == null) - throw (new Exception("No supplementary file given!")); - - if (psf.Location == AdminShellPackageSupplementaryFile.LocationType.AddPending) - { - // is still pending in add list -> remove - _pendingFilesToAdd.RemoveAll((x) => { return x.Uri == psf.Uri; }); - } - - if (psf.Location == AdminShellPackageSupplementaryFile.LocationType.InPackage) - { - // add to pending delete list - _pendingFilesToDelete.Add(psf); - } - } - - public void Close() - { - _openPackage?.Close(); - _openPackage = null; - _fn = ""; - _aasEnv = null; - } - - public void Flush() - { - if (_openPackage != null) - _openPackage.Flush(); - } - - public void Dispose() - { - Close(); - } - - public string MakePackageFileAvailableAsTempFile(string packageUri, bool keepFilename = false) - { - // access - if (packageUri == null) - return null; - - // get input stream - using (var input = GetLocalStreamFromPackage(packageUri)) - { - // generate tempfile name - string tempext = System.IO.Path.GetExtension(packageUri); - string temppath = System.IO.Path.GetTempFileName().Replace(".tmp", tempext); - - // maybe modify tempfile name? - if (keepFilename) - { - var masterFn = System.IO.Path.GetFileNameWithoutExtension(packageUri); - var tmpDir = System.IO.Path.GetDirectoryName(temppath); - var tmpFnExt = System.IO.Path.GetFileName(temppath); - - temppath = System.IO.Path.Combine(tmpDir, "" + masterFn + "_" + tmpFnExt); - } - - // copy to temp file - using (var temp = System.IO.File.OpenWrite(temppath)) - { - input.CopyTo(temp); - return temppath; - } - } - } - - public void EmbeddAssetInformationThumbnail(IResource defaultThumbnail, Stream fileContent) - { - // access - if (_openPackage == null) - throw (new Exception(string.Format($"AASX Package {_fn} not opened. Aborting!"))); - - if (!string.IsNullOrEmpty(defaultThumbnail.Path)) - { - var sourceUri = defaultThumbnail.Path.Replace(Path.DirectorySeparatorChar, '/'); - _openPackage.DeletePart(new Uri(sourceUri, UriKind.RelativeOrAbsolute)); - - } - var targetUri = PackUriHelper.CreatePartUri(new Uri(defaultThumbnail.Path, UriKind.RelativeOrAbsolute)); - - PackagePart packagePart = _openPackage.CreatePart(targetUri, defaultThumbnail.ContentType, compressionOption: CompressionOption.Maximum); - - _openPackage.CreateRelationship(packagePart.Uri, TargetMode.Internal, - "http://schemas.openxmlformats.org/package/2006/" + - "relationships/metadata/thumbnail"); - - //Write to the part - fileContent.Position = 0; - using (Stream dest = packagePart.GetStream()) - { - fileContent.CopyTo(dest); - } - } - } -} \ No newline at end of file diff --git a/src/AasxCsharpLibrary/AdminShellUtil.cs b/src/AasxCsharpLibrary/AdminShellUtil.cs deleted file mode 100644 index 34ba39821..000000000 --- a/src/AasxCsharpLibrary/AdminShellUtil.cs +++ /dev/null @@ -1,1129 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using AasxCompatibilityModels; -using Extensions; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.IO.Packaging; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; - -namespace AdminShellNS -{ - public static class AdminShellUtil - { - - #region Various utilities - // ------------------------------------------------------------------------------------ - - public static T[] GetEnumValues() where T : Enum - => (T[])Enum.GetValues(typeof(T)); - - public static IEnumerable GetEnumValues(T[] excludes) where T : Enum - { - foreach (var v in (T[])Enum.GetValues(typeof(T))) - if (!excludes.Contains(v)) - yield return v; - } - - #endregion - - #region V3 Methods - - public static void EnumerateSearchable( - SearchResults results, object obj, string qualifiedNameHead, int depth, SearchOptions options, - object businessObject = null) - { - // access - if (results == null || obj == null || options == null) - return; - Type objType = obj.GetType(); - - // depth - if (depth > options.maxDepth) - return; - - // try to get element name of an AAS entity - string elName = null; - if (obj is IReferable) - { - elName = (obj as IReferable).GetType().Name; - businessObject = obj; - } - - // enrich qualified name, accordingly - var qualifiedName = qualifiedNameHead; - if (elName != null) - qualifiedName = qualifiedName + (qualifiedName.Length > 0 ? "." : "") + elName; - - // do NOT dive into objects, which are not in the reight assembly - if (options.allowedAssemblies == null || !options.allowedAssemblies.Contains(objType.Assembly)) - return; - - // do not dive into enums - if (objType.IsEnum) - return; - - // look at fields, first - var fields = objType.GetFields(); - foreach (var fi in fields) - { - // is the object marked to be skipped? - var x3 = fi.GetCustomAttribute(); - if (x3 != null) - continue; - - var x4 = fi.GetCustomAttribute(); - if (x4 != null) - continue; - - // get value(s) - var fieldValue = fi.GetValue(obj); - if (fieldValue == null) - continue; - var valueElems = fieldValue as IList; - if (valueElems != null) - { - // field is a collection .. dive deeper, if allowed - foreach (var el in valueElems) - EnumerateSearchable(results, el, qualifiedName, depth + 1, options, businessObject); - } - else - { - // field is a single entity .. check it - CheckSearchable( - results, options, qualifiedName, businessObject, fi, fieldValue, obj, - () => { return fieldValue.GetHashCode(); }); - - // dive deeper .. - EnumerateSearchable(results, fieldValue, qualifiedName, depth + 1, options, businessObject); - } - } - - // properties & objects behind - var properties = objType.GetProperties(); - foreach (var pi in properties) - { - var gip = pi.GetIndexParameters(); - if (gip.Length > 0) - // no indexed properties, yet - continue; - - // is the object marked to be skipped? - var x3 = pi.GetCustomAttribute(); - if (x3 != null) - continue; - - var x4 = pi.GetCustomAttribute(); - if (x4 != null) - continue; - - // get value(s) - var propValue = pi.GetValue(obj, null); - if (propValue == null) - continue; - var valueElems = propValue as IList; - if (valueElems != null) - { - // property is a collection .. dive deeper, if allowed - foreach (var el in valueElems) - EnumerateSearchable(results, el, qualifiedName, depth + 1, options, businessObject); - } - else - { - // field is a single entity .. check it - CheckSearchable( - results, options, qualifiedName, businessObject, pi, propValue, obj, - () => { return propValue.GetHashCode(); }); - - // dive deeper .. - EnumerateSearchable(results, propValue, qualifiedName, depth + 1, options, businessObject); - } - } - } - - public static void CheckSearchable( - SearchResults results, SearchOptions options, string qualifiedNameHead, object businessObject, - MemberInfo mi, object memberValue, object containingObject, Func getMemberHash) - { - // try get a speaking name - var metaModelName = ""; - var x1 = mi.GetCustomAttribute(); - if (x1 != null && x1.name != null) - metaModelName = x1.name; - - // check if this object is searchable - var x2 = mi.GetCustomAttribute(); - if (x2 != null) - { - // what to check? - string foundText = "" + memberValue?.ToString(); - - // find options - var found = true; - if (options.findText != null) - found = foundText.IndexOf( - options.findText, options.isIgnoreCase ? StringComparison.CurrentCultureIgnoreCase : 0) >= 0; - - // add? - if (found) - { - var sri = new SearchResultItem(); - sri.searchOptions = options; - sri.qualifiedNameHead = qualifiedNameHead; - sri.metaModelName = metaModelName; - sri.businessObject = businessObject; - sri.foundText = foundText; - sri.foundObject = memberValue; - sri.containingObject = containingObject; - if (getMemberHash != null) - sri.foundHash = getMemberHash(); - - // avoid duplicates - if (!results.foundResults.Contains(sri)) - results.foundResults.Add(sri); - } - } - } - - public class SearchResultItem : IEquatable - { - public SearchOptions searchOptions; - public string qualifiedNameHead; - public string metaModelName; - public object businessObject; - public string foundText; - public object foundObject; - public object containingObject; - public int foundHash; - - public bool Equals(SearchResultItem other) - { - if (other == null) - return false; - - return this.qualifiedNameHead == other.qualifiedNameHead && - this.metaModelName == other.metaModelName && - this.businessObject == other.businessObject && - this.containingObject == other.containingObject && - this.foundText == other.foundText && - this.foundHash == other.foundHash; - } - } - - public class SearchResults - { - public int foundIndex = 0; - public List foundResults = new List(); - - public void Clear() - { - foundIndex = -1; - foundResults.Clear(); - } - } - - public class SearchOptions - { - public Assembly[] allowedAssemblies = null; - public int maxDepth = int.MaxValue; - public bool findFirst = false; - public int skipFirstResults = 0; - public string findText = null; - public bool isIgnoreCase = false; - public bool isRegex = false; - } - - public static string[] GetPopularMimeTypes() - { - return - new[] { - System.Net.Mime.MediaTypeNames.Text.Plain, - System.Net.Mime.MediaTypeNames.Text.Xml, - System.Net.Mime.MediaTypeNames.Text.Html, - "text/markdown", - "text/asciidoc", - "application/json", - "application/rdf+xml", - System.Net.Mime.MediaTypeNames.Application.Pdf, - System.Net.Mime.MediaTypeNames.Image.Jpeg, - "image/png", - System.Net.Mime.MediaTypeNames.Image.Gif, - "application/iges", - "application/step" - }; - } - - public static bool CheckForTextContentType(string input) - { - if (input == null) - return false; - input = input.Trim().ToLower(); - foreach (var tst in new[] { - System.Net.Mime.MediaTypeNames.Text.Plain, - System.Net.Mime.MediaTypeNames.Text.Xml, - System.Net.Mime.MediaTypeNames.Text.Html, - "text/markdown", - "text/asciidoc", - "application/json", - "application/rdf+xml" - }) - if (input.Contains(tst.ToLower())) - return true; - return false; - } - - public static IEnumerable GetAdequateEnums(AasSubmodelElements[] excludeValues = null, AasSubmodelElements[] includeValues = null) - { - if (includeValues != null) - { - foreach (var en in includeValues) - yield return en; - } - else - { - foreach (var en in (AasSubmodelElements[])Enum.GetValues(typeof(AasSubmodelElements))) - { - if (en == AasSubmodelElements.SubmodelElement) - continue; - if (excludeValues != null && excludeValues.Contains(en)) - continue; - yield return en; - } - } - } - - public static AasSubmodelElements? AasSubmodelElementsFrom() where T : ISubmodelElement - { - if (typeof(T) == typeof(Property)) - return AasSubmodelElements.Property; - if (typeof(T) == typeof(MultiLanguageProperty)) - return AasSubmodelElements.MultiLanguageProperty; - if (typeof(T) == typeof(AasCore.Aas3_0.Range)) - return AasSubmodelElements.Range; - if (typeof(T) == typeof(AasCore.Aas3_0.File)) - return AasSubmodelElements.File; - if (typeof(T) == typeof(Blob)) - return AasSubmodelElements.Blob; - if (typeof(T) == typeof(ReferenceElement)) - return AasSubmodelElements.ReferenceElement; - if (typeof(T) == typeof(RelationshipElement)) - return AasSubmodelElements.RelationshipElement; - if (typeof(T) == typeof(AnnotatedRelationshipElement)) - return AasSubmodelElements.AnnotatedRelationshipElement; - if (typeof(T) == typeof(Capability)) - return AasSubmodelElements.Capability; - if (typeof(T) == typeof(SubmodelElementCollection)) - return AasSubmodelElements.SubmodelElementCollection; - if (typeof(T) == typeof(Operation)) - return AasSubmodelElements.Operation; - if (typeof(T) == typeof(BasicEventElement)) - return AasSubmodelElements.BasicEventElement; - if (typeof(T) == typeof(Entity)) - return AasSubmodelElements.Entity; - return null; - } - - public static ISubmodelElement CreateSubmodelElementFromEnum(AasSubmodelElements smeEnum, ISubmodelElement sourceSme = null) - { - switch (smeEnum) - { - case AasSubmodelElements.Property: - { - return new Property(DataTypeDefXsd.String).UpdateFrom(sourceSme); - } - case AasSubmodelElements.MultiLanguageProperty: - { - return new MultiLanguageProperty().UpdateFrom(sourceSme); - } - case AasSubmodelElements.Range: - { - return new AasCore.Aas3_0.Range(DataTypeDefXsd.String).UpdateFrom(sourceSme); - } - case AasSubmodelElements.File: - { - return new AasCore.Aas3_0.File("").UpdateFrom(sourceSme); - } - case AasSubmodelElements.Blob: - { - return new Blob("").UpdateFrom(sourceSme); - } - case AasSubmodelElements.ReferenceElement: - { - // TODO (??, 0000-00-00): AAS core crashes without this - return new ReferenceElement( - value: new Reference(ReferenceTypes.ExternalReference, new List()) - ).UpdateFrom(sourceSme); - } - case AasSubmodelElements.RelationshipElement: - { - return new RelationshipElement( - new Reference(ReferenceTypes.ExternalReference, new List()), - new Reference(ReferenceTypes.ExternalReference, new List())) - .UpdateFrom(sourceSme); - } - case AasSubmodelElements.AnnotatedRelationshipElement: - { - return new AnnotatedRelationshipElement( - new Reference(ReferenceTypes.ExternalReference, new List()), - new Reference(ReferenceTypes.ExternalReference, new List())) - .UpdateFrom(sourceSme); - } - case AasSubmodelElements.Capability: - { - return new Capability().UpdateFrom(sourceSme); - } - case AasSubmodelElements.SubmodelElementCollection: - { - return new SubmodelElementCollection().UpdateFrom(sourceSme); - } - case AasSubmodelElements.SubmodelElementList: - { - return new SubmodelElementList(AasSubmodelElements.SubmodelElement).UpdateFrom(sourceSme); - } - case AasSubmodelElements.Operation: - { - return new Operation().UpdateFrom(sourceSme); - } - case AasSubmodelElements.BasicEventElement: - { - return new BasicEventElement(null, Direction.Input, StateOfEvent.Off).UpdateFrom(sourceSme); - } - case AasSubmodelElements.Entity: - { - return new Entity(EntityType.SelfManagedEntity).UpdateFrom(sourceSme); - } - default: - { - return null; - } - } - } - - #endregion - public static string EvalToNonNullString(string fmt, object o, string elseString = "") - { - if (o == null) - return elseString; - return string.Format(fmt, o); - } - - public static string EvalToNonEmptyString(string fmt, string o, string elseString = "") - { - if (o == null || o == "") - return elseString; - return string.Format(fmt, o); - } - - /// - /// If len of exceeds then - /// string is shortened and returned with an ellipsis(…) at the end. - /// - /// Shortened string - public static string ShortenWithEllipses(string str, int maxLen) - { - if (str == null) - return null; - if (maxLen >= 0 && str.Length > maxLen) - str = str.Substring(0, maxLen) + "\u2026"; - return str; - } - - /// - /// Returns a string without newlines and shortened (with ellipsis) - /// to a certain length - /// - /// Single-line, shortened string - public static string ToSingleLineShortened(string str, int maxLen, string textNewLine = " ") - { - str = str.ReplaceLineEndings(textNewLine); - return ShortenWithEllipses(str, maxLen); - } - - /// Creates a filter-friendly name from the source. - /// - /// Assert.AreEqual("", AdminShellUtil.FilterFriendlyName("")); - /// Assert.AreEqual("someName", AdminShellUtil.FilterFriendlyName("someName")); - /// Assert.AreEqual("some__name", AdminShellUtil.FilterFriendlyName("some!;name")); - /// - public static string FilterFriendlyName(string src) - { - if (src == null) - return null; - return Regex.Replace(src, @"[^a-zA-Z0-9\-_]", "_"); - } - - /// - /// Assert.IsFalse(AdminShellUtil.HasWhitespace("")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace(" ")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace("aa bb")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace(" aabb")); - /// Assert.IsTrue(AdminShellUtil.HasWhitespace("aabb ")); - /// Assert.IsFalse(AdminShellUtil.HasWhitespace("aabb")); - /// - public static bool HasWhitespace(string src) - { - if (src == null) - throw new ArgumentNullException(nameof(src)); - foreach (var s in src) - if (char.IsWhiteSpace(s)) - return true; - return false; - } - - /// Assert.IsTrue(AdminShellUtil.ComplyIdShort("")); - public static bool ComplyIdShort(string src) - { - if (src == null) - throw new ArgumentNullException(nameof(src)); - var res = true; - foreach (var s in src) - if (!Char.IsLetterOrDigit(s) && s != '_') - res = false; - if (src.Length > 0 && !Char.IsLetter(src[0])) - res = false; - return res; - } - - public static string ByteSizeHumanReadable(long len) - { - // see: https://stackoverflow.com/questions/281640/ - // how-do-i-get-a-human-readable-file-size-in-bytes-abbreviation-using-net - string[] sizes = { "B", "KB", "MB", "GB", "TB" }; - int order = 0; - while (len >= 1024 && order < sizes.Length - 1) - { - order++; - len = len / 1024; - } - // Adjust the format string to your preferences. For example "{0:0.#}{1}" would - // show a single decimal place, and no space. - string res = String.Format("{0:0.##} {1}", len, sizes[order]); - return res; - } - - public static string ExtractPascalCasingLetters(string src) - { - // access - src = src?.Trim(); - if (src == null || src.Length < 1) - return null; - - // walk through - var res = ""; - var arm = true; - foreach (var c in src) - { - // take? - if (arm && Char.IsUpper(c)) - res += c; - // state for next iteration - arm = !Char.IsUpper(c); - } - - // result - return res; - } - - public static string FromDouble(double input, string format) - { - return string.Format(CultureInfo.InvariantCulture, format, input); - } - - public static int CountHeadingSpaces(string line) - { - if (line == null) - return 0; - int j; - for (j = 0; j < line.Length; j++) - if (!Char.IsWhiteSpace(line[j])) - break; - return j; - } - - /// - /// Used to re-reformat a C# here string, which is multiline string introduced by @" ... "; - /// - public static string[] CleanHereStringToArray(string here) - { - if (here == null) - return null; - - // convert all weird breaks to pure new lines - here = here.Replace("\r\n", "\n"); - here = here.Replace("\n\r", "\n"); - - // convert all tabs to spaces - here = here.Replace("\t", " "); - - // split these - var lines = new List(here.Split('\n')); - if (lines.Count < 1) - return lines.ToArray(); - - // the first line could be special - string firstLine = null; - if (lines[0].Trim() != "") - { - firstLine = lines[0].Trim(); - lines.RemoveAt(0); - } - - // detect an constant amount of heading spaces - var headSpaces = int.MaxValue; - foreach (var line in lines) - if (line.Trim() != "") - headSpaces = Math.Min(headSpaces, CountHeadingSpaces(line)); - - // multi line trim possible? - if (headSpaces != int.MaxValue && headSpaces > 0) - for (int i = 0; i < lines.Count; i++) - if (lines[i].Length > headSpaces) - lines[i] = lines[i].Substring(headSpaces); - - // re-compose again - if (firstLine != null) - lines.Insert(0, firstLine); - - // return - return lines.ToArray(); - } - - /// - /// Used to re-reformat a C# here string, which is multiline string introduced by @" ... "; - /// - public static string CleanHereStringWithNewlines(string here, string nl = null) - { - if (nl == null) - nl = System.Environment.NewLine; - var lines = CleanHereStringToArray(here); - if (lines == null) - return null; - return String.Join(nl, lines); - } - - public static string ShortLocation(Exception ex) - { - if (ex == null || ex.StackTrace == null) - return ""; - string[] lines = ex.StackTrace.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None); - if (lines.Length < 1) - return ""; - // search for " in " - // as the most actual stacktrace might be a built-in function, this might not work and therefore - // go down in the stack - int currLine = 0; - while (true) - { - // nothing found at all - if (currLine >= lines.Length) - return ""; - // access current line - /* TODO (MIHO, 2020-11-12): replace with Regex for multi language. Ideally have Exception messages - always as English. */ - var p = lines[currLine].IndexOf(" in ", StringComparison.Ordinal); - if (p < 0) - p = lines[currLine].IndexOf(" bei ", StringComparison.Ordinal); - if (p < 0) - { - // advance to next oldest line - currLine++; - continue; - } - // search last "\" or "/", to get only filename portion and position - p = lines[currLine].LastIndexOfAny(new[] { '\\', '/' }); - if (p < 0) - { - // advance to next oldest line - currLine++; - continue; - } - // return this - return lines[currLine].Substring(p); - } - } - - public static string MapIntToStringArray(int? input, string ifNull, string[] choices) - { - if (input == null || choices == null || choices.Length < 1) - return ifNull; - int i = input ?? 0; - if (i < 0 || i >= choices.Length) - return ifNull; - return choices[i]; - } - - public static string MapBoolToStringArray(bool? input, string ifNull, string[] choices) - { - if (input == null || choices == null || choices.Length != 2) - return ifNull; - bool b = input ?? false; - return choices[b ? 1 : 0]; - } - - public enum ConstantFoundEnum { No, AnyCase, ExactCase } - - public static ConstantFoundEnum CheckIfInConstantStringArray(string[] arr, string str) - { - if (arr == null || str == null) - return ConstantFoundEnum.No; - - bool anyCaseFound = false; - bool exactCaseFound = false; - foreach (var a in arr) - { - anyCaseFound = anyCaseFound || str.ToLower() == a.ToLower(); - exactCaseFound = exactCaseFound || str == a; - } - if (exactCaseFound) - return ConstantFoundEnum.ExactCase; - if (anyCaseFound) - return ConstantFoundEnum.AnyCase; - return ConstantFoundEnum.No; - } - - public static string CorrectCasingForConstantStringArray(string[] arr, string str) - { - if (arr == null || str == null) - return str; - - foreach (var a in arr) - if (str.ToLower() == a.ToLower()) - return a; - - return str; - } - - // - // String manipulations - // - - public static string ReplacePercentPlaceholder( - string input, - string searchFor, - Func substLamda, - StringComparison comparisonType = StringComparison.InvariantCulture) - { - // access - if (input == null || searchFor == null || searchFor == "") - return input; - - // find - while (true) - { - // any occurence - var p = input.IndexOf(searchFor, comparisonType); - if (p < 0) - break; - - // split - var left = input.Substring(0, p); - var right = ""; - var rp = p + searchFor.Length; - if (rp < input.Length) - right = input.Substring(rp); - - // lambda - var repl = "" + substLamda?.Invoke(); - - // build new - input = left + repl + right; - } - - // ok - return input; - } - - public static string WrapLinesAtColumn(string text, int columnLimit) - { - // access - if (text == null) - return null; - if (columnLimit < 10) - return text; - - // idea: - // https://stackoverflow.com/questions/3961278/word-wrap-a-string-in-multiple-lines - // but: outer loop to handle line breaks, inner loop to handle words - - // split lines, preserving empty lines - var lines = Regex.Split(text, "\r\n|\r|\n"); - var outLines = new StringBuilder(); - foreach (var textLine in lines) - { - // now words. In future, may use regex? - var words = text.Split(new string[] { " " }, StringSplitOptions.None); - var sumLine = ""; - foreach (var word in words) - { - sumLine += word + " "; - if (sumLine.Length >= columnLimit) - { - outLines.AppendLine(sumLine); - sumLine = ""; - } - } - } - - // ok, result - return outLines.ToString(); - } - - // - // Reflection - // - - public static void SetFieldLazyValue(FieldInfo f, object obj, object value) - { - // access - if (f == null || obj == null) - return; - - switch (Type.GetTypeCode(f.FieldType)) - { - case TypeCode.String: - f.SetValue(obj, "" + value); - break; - - case TypeCode.Byte: - if (Byte.TryParse("" + value, out var ui8)) - f.SetValue(obj, ui8); - break; - - case TypeCode.SByte: - if (SByte.TryParse("" + value, out var i8)) - f.SetValue(obj, i8); - break; - - case TypeCode.Int16: - if (Int16.TryParse("" + value, out var i16)) - f.SetValue(obj, i16); - break; - - case TypeCode.Int32: - if (Int32.TryParse("" + value, out var i32)) - f.SetValue(obj, i32); - break; - - case TypeCode.Int64: - if (Int64.TryParse("" + value, out var i64)) - f.SetValue(obj, i64); - break; - - case TypeCode.UInt16: - if (UInt16.TryParse("" + value, out var ui16)) - f.SetValue(obj, ui16); - break; - - case TypeCode.UInt32: - if (UInt32.TryParse("" + value, out var ui32)) - f.SetValue(obj, ui32); - break; - - case TypeCode.UInt64: - if (UInt64.TryParse("" + value, out var ui64)) - f.SetValue(obj, ui64); - break; - - case TypeCode.Single: - if (Single.TryParse("" + value, NumberStyles.Float, - CultureInfo.InvariantCulture, out var sgl)) - f.SetValue(obj, sgl); - break; - - case TypeCode.Double: - if (Double.TryParse("" + value, NumberStyles.Float, - CultureInfo.InvariantCulture, out var dbl)) - f.SetValue(obj, dbl); - break; - - case TypeCode.Boolean: - var isFalse = value == null - || (value is int vi && vi == 0) - || (value is string vs && (vs == "" || vs == "false")) - || (value is bool vb && !vb); - f.SetValue(obj, !isFalse); - break; - } - } - - // - // temp file utilities - // - - // see: https://stackoverflow.com/questions/278439/creating-a-temporary-directory-in-windows - public static string GetTemporaryDirectory() - { - string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - Directory.CreateDirectory(tempDirectory); - return tempDirectory; - } - - // see: https://stackoverflow.com/questions/6386113/using-system-io-packaging-to-generate-a-zip-file - public static void AddFileToZip( - string zipFilename, string fileToAdd, - CompressionOption compression = CompressionOption.Normal, - FileMode fileMode = FileMode.OpenOrCreate) - { - using (Package zip = System.IO.Packaging.Package.Open(zipFilename, FileMode.OpenOrCreate)) - { - string destFilename = ".\\" + Path.GetFileName(fileToAdd); - Uri uri = PackUriHelper.CreatePartUri(new Uri(destFilename, UriKind.Relative)); - if (zip.PartExists(uri)) - { - zip.DeletePart(uri); - } - PackagePart part = zip.CreatePart(uri, "", compression); - using (FileStream fileStream = new FileStream(fileToAdd, FileMode.Open, FileAccess.Read)) - { - using (Stream dest = part.GetStream()) - { - fileStream.CopyTo(dest); - } - } - } - } - - // - // some URL enabled path handling - // - - /// - /// Uses System.IO.Path.GetExtension() to determine the extension part - /// of a path. If a URL based query is added to the extension, remove this. - /// - public static string GetExtensionWoQuery(string fn) - { - // access - if (fn == null) - return null; - - // use system function - var ext = System.IO.Path.GetExtension(fn).ToLower().Trim(); - - // as URLs *might* have an extension, but a loto f query string afterwards, - // lets try to cut of it - var extMatch = Regex.Match(ext, @"([._A-Za-z0-9]+)"); - if (extMatch.Success) - ext = extMatch.Groups[1].ToString(); - - // ok - return ext; - } - - // - // Base 64 - // - - public static string Base64Encode(string plainText) - { - var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); - return System.Convert.ToBase64String(plainTextBytes); - } - - public static string Base64Decode(string base64EncodedData) - { - var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData); - return System.Text.Encoding.UTF8.GetString(base64EncodedBytes); - } - - public static bool CheckIfAsciiOnly(byte[] data, int bytesToCheck = int.MaxValue) - { - if (data == null) - return true; - - var ascii = true; - for (int i = 0; i < Math.Min(data.Length, bytesToCheck); i++) - if (data[i] >= 128) - ascii = false; - return ascii; - } - - // see: https://stackoverflow.com/questions/5209506/how-can-i-know-what-image-format-i-get-from-a-stream - // based on https://devblogs.microsoft.com/scripting/psimaging-part-1-test-image/ - // see https://en.wikipedia.org/wiki/List_of_file_signatures - /* Bytes in c# have a range of 0 to 255 so each byte can be represented as - * a two digit hex string. */ - private static readonly Dictionary SignatureTable = new Dictionary - { - { - ".jpg", - new[] - { - new[] {"FF", "D8", "FF", "DB"}, - new[] {"FF", "D8", "FF", "EE"}, - new[] {"FF", "D8", "FF", "E0", "00", "10", "4A", "46", "49", "46", "00", "01"} - } - }, - { - ".gif", - new[] - { - new [] { "47", "49", "46", "38", "37", "61" }, - new [] { "47", "49", "46", "38", "39", "61" } - } - }, - { - ".png", - new[] - { - new[] {"89", "50", "4E", "47", "0D", "0A", "1A", "0A"} - } - }, - { - ".bmp", - new [] - { - new[] { "42", "4D" } - } - } - }; - - /// - /// Takes a byte array and determines the image file type by - /// comparing the first few bytes of the file to a list of known - /// image file signatures. - /// - public static string GuessImageTypeExtension(byte[] imageData) - { - foreach (KeyValuePair signatureEntry in SignatureTable) - { - foreach (string[] signature in signatureEntry.Value) - { - bool isMatch = true; - for (int i = 0; i < signature.Length; i++) - { - string signatureByte = signature[i]; - - // ToString("X") gets the hex representation and pads it to always be length 2 - string imageByte = imageData[i] - .ToString("X2"); - - if (signatureByte == imageByte) - continue; - isMatch = false; - break; - } - - if (isMatch) - { - return signatureEntry.Key; - } - } - } - - return null; - } - - // - // Generation of Ids - // - - private static Random MyRnd = new Random(); - - public static string GenerateIdAccordingTemplate(string tpl) - { - // generate a deterministic decimal digit string - var decimals = String.Format("{0:ffffyyMMddHHmmss}", DateTime.UtcNow); - decimals = new string(decimals.Reverse().ToArray()); - // convert this to an int - if (!Int64.TryParse(decimals, out Int64 decii)) - decii = MyRnd.Next(Int32.MaxValue); - // make an hex out of this - string hexamals = decii.ToString("X"); - // make an alphanumeric string out of this - string alphamals = ""; - var dii = decii; - while (dii >= 1) - { - var m = dii % 26; - alphamals += Convert.ToChar(65 + m); - dii = dii / 26; - } - - // now, "salt" the strings - for (int i = 0; i < 32; i++) - { - var c = Convert.ToChar(48 + MyRnd.Next(10)); - decimals += c; - hexamals += c; - alphamals += c; - } - - // now, can just use the template - var id = ""; - foreach (var tpli in tpl) - { - if (tpli == 'D' && decimals.Length > 0) - { - id += decimals[0]; - decimals = decimals.Remove(0, 1); - } - else - if (tpli == 'X' && hexamals.Length > 0) - { - id += hexamals[0]; - hexamals = hexamals.Remove(0, 1); - } - else - if (tpli == 'A' && alphamals.Length > 0) - { - id += alphamals[0]; - alphamals = alphamals.Remove(0, 1); - } - else - id += tpli; - } - - // ok - return id; - } - - public static string RemoveNewLinesAndLimit(string input, int maxLength = -1, string ellipsis = "..") - { - // access - if (input == null) - return null; - - // maybe do a generouse limit first - if (maxLength >= 1 && input.Length > 2 * maxLength) - input = input.Substring(0, 2 * maxLength); - - // now do expensive operations - input = input.Replace('\r', ' '); - input = input.Replace('\n', ' '); - input = Regex.Replace(input, @"\s+", " ", RegexOptions.Compiled); - - // now apply exact limit - if (maxLength >= 1 && input.Length > maxLength) - input = input.Substring(0, maxLength) + ellipsis; - - // ok - return input; - } - - // - // language handling - // (used by some function on this basic level) - // - - public static string DefaultLngIso639 = "en?"; - - public static string GetDefaultLngIso639() - { - return DefaultLngIso639; - } - } -} diff --git a/src/AasxCsharpLibrary/AdminShellValidate.cs b/src/AasxCsharpLibrary/AdminShellValidate.cs deleted file mode 100644 index 028062908..000000000 --- a/src/AasxCsharpLibrary/AdminShellValidate.cs +++ /dev/null @@ -1,320 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using JetBrains.Annotations; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text.RegularExpressions; -using System.Xml; -using System.Xml.Schema; -using Environment = System.Environment; - -namespace AdminShellNS -{ - /// - /// validates the XML content against the AASX XML schema. - /// - /// Please produce instances with . - /// - public class XmlValidator - { - private System.Xml.Schema.XmlSchemaSet xmlSchemaSet; - - internal XmlValidator(XmlSchemaSet xmlSchemaSet) - { - this.xmlSchemaSet = xmlSchemaSet; - } - - /// - /// validates the given XML content and stores the results in the . - /// - /// Validation records - /// Content to be validated - public void Validate(AasValidationRecordList recs, Stream xmlContent) - { - if (recs == null) - throw new ArgumentException($"Unexpected null {nameof(recs)}"); - - if (xmlContent == null) - throw new ArgumentException($"Unexpected null {nameof(xmlContent)}"); - - // load/ validate on same records - var settings = new System.Xml.XmlReaderSettings(); - settings.ValidationType = System.Xml.ValidationType.Schema; - settings.Schemas = xmlSchemaSet; - - settings.ValidationEventHandler += - (object sender, System.Xml.Schema.ValidationEventArgs e) => - { - recs.Add( - new AasValidationRecord( - AasValidationSeverity.Serialization, null, - $"XML: {e?.Exception?.LineNumber}, {e?.Exception?.LinePosition}: {e?.Message}")); - }; - - // use the xml stream - using (var reader = System.Xml.XmlReader.Create(xmlContent, settings)) - { - while (reader.Read()) - { - // Invoke callbacks - }; - } - } - } - - public enum AasValidationSeverity - { - Hint, Warning, SpecViolation, SchemaViolation, Serialization - } - - [UsedImplicitlyAttribute] // for eventual use - public enum AasValidationAction - { - No, ToBeDeleted - } - - public class AasValidationRecord - { - public AasValidationSeverity Severity = AasValidationSeverity.Hint; - public IReferable Source = null; - public string Message = ""; - - public Action Fix = null; - - public AasValidationRecord(AasValidationSeverity Severity, IReferable Source, - string Message, Action Fix = null) - { - this.Severity = Severity; - this.Source = Source; - this.Message = Message; - this.Fix = Fix; - } - - public override string ToString() - { - return $"[{Severity.ToString()}] in {"" + Source?.ToString()}: {"" + Message}"; - } - - public string DisplaySeverity { get { return "" + Severity.ToString(); } } - public string DisplaySource - { - get - { - return "" + ((Source != null) ? Source.ToString() : "(whole content)"); - } - } - public string DisplayMessage { get { return "" + Message?.ToString(); } } - } - - public class AasValidationRecordList : List - { - } - - public static class AasSchemaValidation - { - public enum SerializationFormat { XML, JSON } - - public static string[] GetSchemaResources(SerializationFormat fmt) - { - if (fmt == SerializationFormat.XML) - { - return new[] - { - "AdminShellNS.Resources.schemaV201.AAS.xsd", - "AdminShellNS.Resources.schemaV201.AAS_ABAC.xsd", - "AdminShellNS.Resources.schemaV201.IEC61360.xsd" - }; - } - if (fmt == SerializationFormat.JSON) - { - return new[] - { - "AdminShellNS.Resources.schemaV201.aas.json" - }; - } - return null; - } - - /// - /// produces a validator which validates XML AASX files. - /// - /// initialized validator - public static XmlValidator NewXmlValidator() - { - // Load the schema files - var files = GetSchemaResources(SerializationFormat.XML); - if (files == null) - throw new InvalidOperationException("No XML schema files could be found in the resources."); - - var xmlSchemaSet = new System.Xml.Schema.XmlSchemaSet(); - xmlSchemaSet.XmlResolver = new System.Xml.XmlUrlResolver(); - - try - { - Assembly myAssembly = Assembly.GetExecutingAssembly(); - foreach (var schemaFn in files) - { - using (Stream schemaStream = myAssembly.GetManifestResourceStream(schemaFn)) - { - using (XmlReader schemaReader = XmlReader.Create(schemaStream)) - { - xmlSchemaSet.Add(null, schemaReader); - } - } - } - } - catch (Exception ex) - { - throw new FileNotFoundException( - $"Error accessing embedded resource schema files: {ex.Message}"); - } - - var newRecs = new AasValidationRecordList(); - - // set up messages - xmlSchemaSet.ValidationEventHandler += (object sender, System.Xml.Schema.ValidationEventArgs e) => - { - newRecs.Add( - new AasValidationRecord( - AasValidationSeverity.Serialization, null, - $"{e?.Exception?.LineNumber}, {e?.Exception?.LinePosition}: {e?.Message}")); - }; - - // compile - try - { - xmlSchemaSet.Compile(); - } - catch (Exception ex) - { - throw new InvalidOperationException( - $"Error compiling schema files: {ex.Message}"); - } - - if (newRecs.Count > 0) - { - var parts = new List { $"Failed to compile the schema files:" }; - parts.AddRange(newRecs.Select((r) => r.Message)); - throw new InvalidOperationException(string.Join(Environment.NewLine, parts)); - } - - return new XmlValidator(xmlSchemaSet); - } - - /// - /// creates an XML validator and applies it on the given content. - /// - /// If you repeatedly need to validate XML against a schema, re-use an instance of - /// produced with . - /// - /// Validation records - /// Content to be validated - public static void ValidateXML(AasValidationRecordList recs, Stream xmlContent) - { - var validator = NewXmlValidator(); - validator.Validate(recs, xmlContent); - } - - public static int ValidateJSONAlternative(AasValidationRecordList recs, Stream jsonContent) - { - // see: https://github.com/RicoSuter/NJsonSchema/wiki/JsonSchemaValidator - var newRecs = new AasValidationRecordList(); - - // access - if (recs == null || jsonContent == null) - return -1; - - // Load the schema files - // right now: exactly ONE schema file - var files = GetSchemaResources(SerializationFormat.JSON); - if (files == null || files.Length != 1) - return -1; - - NJsonSchema.JsonSchema schema = null; - - try - { - Assembly myAssembly = Assembly.GetExecutingAssembly(); - foreach (var schemaFn in files) - { - using (Stream schemaStream = myAssembly.GetManifestResourceStream(schemaFn)) - { - using (var streamReader = new StreamReader(schemaStream)) - { - var allTxt = streamReader.ReadToEnd(); - schema = NJsonSchema.JsonSchema.FromJsonAsync(allTxt).GetAwaiter().GetResult(); - break; - } - } - } - } - catch (Exception ex) - { - throw new FileNotFoundException("ValidateJSON: Error loading schema: " + - ex.Message); - } - - if (schema == null) - { - throw new FileNotFoundException("ValidateJSON: Schema not found properly."); - } - - // create validator - var validator = new NJsonSchema.Validation.JsonSchemaValidator(); - - // load the JSON content - string jsonTxt = null; - try - { - using (var streamReader = new StreamReader(jsonContent)) - { - jsonTxt = streamReader.ReadToEnd(); - } - } - catch (Exception ex) - { - throw new InvalidOperationException("ValidateJSON: Error loading JSON content: " + - ex.Message); - } - - if (jsonTxt == null || jsonTxt == "") - throw new InvalidOperationException("ValidateJSON: Error loading JSON content gave null."); - - // validate - ICollection errors; - try - { - errors = validator.Validate(jsonTxt, schema); - } - catch (Exception ex) - { - throw new InvalidOperationException("ValidateJSON: Error when validating: " + - ex.Message); - } - - // re-format messages - if (errors != null) - foreach (var ve in errors) - { - var msg = ("" + ve.ToString()); - msg = Regex.Replace(msg, @"\s+", " "); - newRecs.Add(new AasValidationRecord(AasValidationSeverity.Serialization, null, - $"JSON: {ve.LineNumber,5},{ve.LinePosition:3}: {msg}")); - } - - // result - recs.AddRange(newRecs); - return newRecs.Count; - } - } -} diff --git a/src/AasxCsharpLibrary/Display/EnumerationPlacmentBase.cs b/src/AasxCsharpLibrary/Display/EnumerationPlacmentBase.cs deleted file mode 100644 index cabfedcf0..000000000 --- a/src/AasxCsharpLibrary/Display/EnumerationPlacmentBase.cs +++ /dev/null @@ -1,15 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -namespace AdminShellNS -{ - public class EnumerationPlacmentBase - { - - } -} diff --git a/src/AasxCsharpLibrary/Display/EnumerationPlacmentOperationVariable.cs b/src/AasxCsharpLibrary/Display/EnumerationPlacmentOperationVariable.cs deleted file mode 100644 index 39e005483..000000000 --- a/src/AasxCsharpLibrary/Display/EnumerationPlacmentOperationVariable.cs +++ /dev/null @@ -1,16 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -namespace AdminShellNS -{ - public class EnumerationPlacmentOperationVariable : EnumerationPlacmentBase - { - public OperationVariableDirection Direction; - public OperationVariable OperationVariable; - } -} diff --git a/src/AasxCsharpLibrary/Display/OperationVariableDirection.cs b/src/AasxCsharpLibrary/Display/OperationVariableDirection.cs deleted file mode 100644 index 479344aa0..000000000 --- a/src/AasxCsharpLibrary/Display/OperationVariableDirection.cs +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -namespace AdminShellNS -{ - public enum OperationVariableDirection - { - In, - Out, - InOut - } -} diff --git a/src/AasxCsharpLibrary/Exceptions/MetamodelVerificationException.cs b/src/AasxCsharpLibrary/Exceptions/MetamodelVerificationException.cs deleted file mode 100644 index c392c6441..000000000 --- a/src/AasxCsharpLibrary/Exceptions/MetamodelVerificationException.cs +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; -using System.Collections.Generic; -using static AasCore.Aas3_0.Reporting; - -namespace AdminShellNS.Exceptions -{ - public class MetamodelVerificationException : Exception - { - public List ErrorList { get; } - - public MetamodelVerificationException(List errorList) : base($"The request body not conformant with the metamodel. Found {errorList.Count} errors !!") - { - ErrorList = errorList; - } - - - } -} diff --git a/src/AasxCsharpLibrary/Exceptions/NullValueException.cs b/src/AasxCsharpLibrary/Exceptions/NullValueException.cs deleted file mode 100644 index bd6eea201..000000000 --- a/src/AasxCsharpLibrary/Exceptions/NullValueException.cs +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; - -namespace AdminShellNS.Exceptions -{ - public class NullValueException : Exception - { - public NullValueException(string field) : base($"The field {field} is null!!") - { - - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/AasElementSelfDescription.cs b/src/AasxCsharpLibrary/Extensions/AasElementSelfDescription.cs deleted file mode 100644 index 30f50dee3..000000000 --- a/src/AasxCsharpLibrary/Extensions/AasElementSelfDescription.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -namespace Extensions -{ - public class AasElementSelfDescription - { - public string AasElementName { get; set; } - - public string ElementAbbreviation { get; set; } - - public KeyTypes? KeyType { get; set; } - - public AasSubmodelElements? SmeType { get; set; } - - public AasElementSelfDescription(string aasElementName, string elementAbbreviation, - KeyTypes? keyType, AasSubmodelElements? smeType) - { - AasElementName = aasElementName; - ElementAbbreviation = elementAbbreviation; - KeyType = keyType; - SmeType = smeType; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ComparerUtils.cs b/src/AasxCsharpLibrary/Extensions/ComparerUtils.cs deleted file mode 100644 index b3cf12662..000000000 --- a/src/AasxCsharpLibrary/Extensions/ComparerUtils.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System.Collections.Generic; -using System.Globalization; - -namespace Extensions -{ - public static class CompareUtils - { - public static bool Compare(T x, T y) - { - return EqualityComparer.Default.Equals(x, y); - } - } - public class ComparerIdShort : IComparer - { - public int Compare(IReferable a, IReferable b) - { - return string.Compare(a?.IdShort, b?.IdShort, - CultureInfo.InvariantCulture, CompareOptions.IgnoreCase); - } - } - - public class ComparerIdentification : IComparer - { - public int Compare(IIdentifiable a, IIdentifiable b) - { - return string.Compare(a.Id, b.Id, - CultureInfo.InvariantCulture, CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace); - } - } - - - - public class ComparerIndexed : IComparer - { - public int NullIndex = int.MaxValue; - public Dictionary Index = new(); - - public int Compare(IReferable a, IReferable b) - { - var ca = Index.ContainsKey(a); - var cb = Index.ContainsKey(b); - - if (!ca && !cb) - return 0; - // make CDs without usage to appear at end of list - if (!ca) - return +1; - if (!cb) - return -1; - - var ia = Index[a]; - var ib = Index[b]; - - if (ia == ib) - return 0; - if (ia < ib) - return -1; - return +1; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendAnnotatedRelationshipElement.cs b/src/AasxCsharpLibrary/Extensions/ExtendAnnotatedRelationshipElement.cs deleted file mode 100644 index 3538adfa1..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendAnnotatedRelationshipElement.cs +++ /dev/null @@ -1,132 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; -using AdminShellNS.Extensions; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendAnnotatedRelationshipElement - { - #region AasxPackageExplorer - - public static void Add(this AnnotatedRelationshipElement annotatedRelationshipElement, ISubmodelElement submodelElement) - { - if (annotatedRelationshipElement != null) - { - annotatedRelationshipElement.Annotations ??= new(); - - submodelElement.Parent = annotatedRelationshipElement; - - annotatedRelationshipElement.Annotations.Add((IDataElement)submodelElement); - } - } - - public static void Remove(this AnnotatedRelationshipElement annotatedRelationshipElement, ISubmodelElement submodelElement) - { - if (annotatedRelationshipElement != null) - { - if (annotatedRelationshipElement.Annotations != null) - { - annotatedRelationshipElement.Annotations.Remove((IDataElement)submodelElement); - } - } - } - - public static object AddChild( - this AnnotatedRelationshipElement annotatedRelationshipElement, - ISubmodelElement childSubmodelElement, - EnumerationPlacmentBase placement = null) - { - if (childSubmodelElement == null || childSubmodelElement is not IDataElement) - return null; - - annotatedRelationshipElement.Annotations ??= new(); - - if (childSubmodelElement != null) - childSubmodelElement.Parent = annotatedRelationshipElement; - - annotatedRelationshipElement.Annotations.Add((IDataElement)childSubmodelElement); - return childSubmodelElement; - } - - #endregion - public static AnnotatedRelationshipElement ConvertAnnotationsFromV20(this AnnotatedRelationshipElement annotatedRelationshipElement, AasxCompatibilityModels.AdminShellV20.AnnotatedRelationshipElement sourceAnnotedRelElement) - { - if (sourceAnnotedRelElement == null) - { - return null; - } - - if (!sourceAnnotedRelElement.annotations.IsNullOrEmpty()) - { - annotatedRelationshipElement.Annotations ??= new List(); - foreach (var submodelElementWrapper in sourceAnnotedRelElement.annotations) - { - var sourceSubmodelElement = submodelElementWrapper.submodelElement; - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelElement != null) - { - outputSubmodelElement = outputSubmodelElement.ConvertFromV20(sourceSubmodelElement); - } - annotatedRelationshipElement.Annotations.Add((IDataElement)outputSubmodelElement); - } - } - - return annotatedRelationshipElement; - } - - public static T FindFirstIdShortAs(this AnnotatedRelationshipElement annotedRelationshipElement, string idShort) where T : ISubmodelElement - { - - var submodelElements = annotedRelationshipElement.Annotations.Where(sme => sme != null && sme is T && sme.IdShort.Equals(idShort, StringComparison.OrdinalIgnoreCase)); - - if (submodelElements.Any()) - { - return (T)submodelElements.First(); - } - - return default; - } - - public static AnnotatedRelationshipElement Set(this AnnotatedRelationshipElement elem, - Reference first, Reference second) - { - elem.First = first; - elem.Second = second; - return elem; - } - - public static AnnotatedRelationshipElement UpdateFrom( - this AnnotatedRelationshipElement elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is ReferenceElement srcRef) - { - if (srcRef.Value != null) - elem.First = srcRef.Value.Copy(); - } - - if (source is RelationshipElement srcRel) - { - if (srcRel.First != null) - elem.First = srcRel.First.Copy(); - } - - return elem; - } - - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendAssetAdministrationShell.cs b/src/AasxCsharpLibrary/Extensions/ExtendAssetAdministrationShell.cs deleted file mode 100644 index b2d2407b8..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendAssetAdministrationShell.cs +++ /dev/null @@ -1,271 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; -using AdminShellNS.Extensions; -using System; -using System.Collections.Generic; -using System.Text.RegularExpressions; - -namespace Extensions -{ - public static class ExtendAssetAdministrationShell - { - #region AasxPackageExplorer - - public static Tuple ToCaptionInfo(this IAssetAdministrationShell assetAdministrationShell) - { - var caption = AdminShellUtil.EvalToNonNullString("\"{0}\" ", assetAdministrationShell.IdShort, "\"AAS\""); - if (assetAdministrationShell.Administration != null) - caption += "V" + assetAdministrationShell.Administration.Version + "." + assetAdministrationShell.Administration.Revision; - - var info = ""; - if (assetAdministrationShell.Id != null) - info = $"[{assetAdministrationShell.Id}]"; - return Tuple.Create(caption, info); - } - - public static IEnumerable FindAllReferences(this IAssetAdministrationShell assetAdministrationShell) - { - // dead-csharp off - // Asset - //TODO (jtikekar, 0000-00-00): support asset - //if (assetAdministrationShell.AssetInformation != null) - // yield return new LocatedReference(assetAdministrationShell, assetAdministrationShell.AssetInformation); - // dead-csharp on - // Submodel references - if (assetAdministrationShell.Submodels != null) - foreach (var r in assetAdministrationShell.Submodels) - yield return new LocatedReference(assetAdministrationShell, r); - - } - - #endregion - - public static bool HasSubmodelReference(this IAssetAdministrationShell assetAdministrationShell, Reference submodelReference) - { - if (submodelReference == null) - { - return false; - } - - foreach (var aasSubmodelReference in assetAdministrationShell.Submodels) - { - if (aasSubmodelReference.Matches(submodelReference)) - { - return true; - } - } - - return false; - } - - public static void AddSubmodelReference(this IAssetAdministrationShell assetAdministrationShell, IReference newSubmodelReference) - { - if (assetAdministrationShell.Submodels == null) - { - assetAdministrationShell.Submodels = new List(); - } - - assetAdministrationShell.Submodels.Add(newSubmodelReference); - } - - //TODO (jtikekar, 0000-00-00): Change the name, currently based on older implementation - public static string GetFriendlyName(this IAssetAdministrationShell assetAdministrationShell) - { - if (string.IsNullOrEmpty(assetAdministrationShell.IdShort)) - { - return null; - } - - return Regex.Replace(assetAdministrationShell.IdShort, @"[^a-zA-Z0-9\-_]", "_"); - } - - public static AssetAdministrationShell ConvertFromV10(this AssetAdministrationShell assetAdministrationShell, AasxCompatibilityModels.AdminShellV10.AdministrationShell sourceAas) - { - if (sourceAas == null) - { - return null; - } - - if (string.IsNullOrEmpty(sourceAas.idShort)) - { - assetAdministrationShell.IdShort = ""; - } - else - { - assetAdministrationShell.IdShort = sourceAas.idShort; - } - - if (sourceAas.description != null) - { - assetAdministrationShell.Description = ExtensionsUtil.ConvertDescriptionFromV10(sourceAas.description); - } - - if (sourceAas.administration != null) - { - assetAdministrationShell.Administration = new AdministrativeInformation(version: sourceAas.administration.version, revision: sourceAas.administration.revision); - } - - if (sourceAas.derivedFrom != null) - { - var newKeyList = new List(); - - foreach (var sourceKey in sourceAas.derivedFrom.Keys) - { - var keyType = Stringification.KeyTypesFromString(sourceKey.type); - if (keyType != null) - { - newKeyList.Add(new Key((KeyTypes)keyType, sourceKey.value)); - } - else - { - Console.WriteLine($"KeyType value {sourceKey.type} not found."); - } - } - assetAdministrationShell.DerivedFrom = new Reference(ReferenceTypes.ExternalReference, newKeyList); - } - - if (!sourceAas.submodelRefs.IsNullOrEmpty()) - { - foreach (var submodelRef in sourceAas.submodelRefs) - { - if (!submodelRef.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in submodelRef.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - assetAdministrationShell.Submodels ??= new List(); - assetAdministrationShell.Submodels.Add(new Reference(ReferenceTypes.ModelReference, keyList)); - } - } - } - - if (sourceAas.hasDataSpecification != null && sourceAas.hasDataSpecification.reference.Count > 0) - { - //TODO (jtikekar, 0000-00-00): EmbeddedDataSpecification?? (as per old implementation) - assetAdministrationShell.EmbeddedDataSpecifications ??= new List(); - foreach (var dataSpecification in sourceAas.hasDataSpecification.reference) - { - if (!dataSpecification.IsEmpty) - { - assetAdministrationShell.EmbeddedDataSpecifications.Add(new EmbeddedDataSpecification( - ExtensionsUtil.ConvertReferenceFromV10(dataSpecification, ReferenceTypes.ExternalReference), - null)); - } - } - } - - return assetAdministrationShell; - } - - public static AssetAdministrationShell ConvertFromV20(this AssetAdministrationShell assetAdministrationShell, AasxCompatibilityModels.AdminShellV20.AdministrationShell sourceAas) - { - if (sourceAas == null) - { - return null; - } - - if (string.IsNullOrEmpty(sourceAas.idShort)) - { - assetAdministrationShell.IdShort = ""; - } - else - { - assetAdministrationShell.IdShort = sourceAas.idShort; - } - - if (sourceAas.description != null) - { - assetAdministrationShell.Description = ExtensionsUtil.ConvertDescriptionFromV20(sourceAas.description); - } - - if (sourceAas.administration != null) - { - assetAdministrationShell.Administration = new AdministrativeInformation(version: sourceAas.administration.version, revision: sourceAas.administration.revision); - } - - if (sourceAas.derivedFrom != null) - { - var newKeyList = new List(); - - foreach (var sourceKey in sourceAas.derivedFrom.Keys) - { - var keyType = Stringification.KeyTypesFromString(sourceKey.type); - if (keyType != null) - { - newKeyList.Add(new Key((KeyTypes)keyType, sourceKey.value)); - } - else - { - Console.WriteLine($"KeyType value {sourceKey.type} not found."); - } - } - assetAdministrationShell.DerivedFrom = new Reference(ReferenceTypes.ExternalReference, newKeyList); - } - - if (!sourceAas.submodelRefs.IsNullOrEmpty()) - { - foreach (var submodelRef in sourceAas.submodelRefs) - { - if (!submodelRef.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in submodelRef.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - assetAdministrationShell.Submodels ??= new List(); - assetAdministrationShell.Submodels.Add(new Reference(ReferenceTypes.ModelReference, keyList)); - } - } - } - - if (sourceAas.hasDataSpecification != null && sourceAas.hasDataSpecification.Count > 0) - { - //TODO (jtikekar, 0000-00-00): EmbeddedDataSpecification?? (as per old implementation) - if (assetAdministrationShell.EmbeddedDataSpecifications == null) - { - assetAdministrationShell.EmbeddedDataSpecifications = new List(); - } - - //TODO (jtikekar, 0000-00-00): DataSpecificationContent?? (as per old implementation) - foreach (var sourceDataSpec in sourceAas.hasDataSpecification) - { - if (sourceDataSpec.dataSpecification != null) - { - assetAdministrationShell.EmbeddedDataSpecifications.Add( - new EmbeddedDataSpecification( - ExtensionsUtil.ConvertReferenceFromV20(sourceDataSpec.dataSpecification, ReferenceTypes.ExternalReference), - null)); - } - } - } - - return assetAdministrationShell; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendAssetInformation.cs b/src/AasxCsharpLibrary/Extensions/ExtendAssetInformation.cs deleted file mode 100644 index 29250c4c3..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendAssetInformation.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; - -namespace Extensions -{ - public static class ExtendAssetInformation - { - #region AasxPackageExplorer - - public static Tuple ToCaptionInfo(this IAssetInformation assetInformation) - { - // dead-csharp off - //TODO (jtikekar, 0000-00-00): support KeyType.AssetInformation - //var caption = Key.AssetInformation; - // dead-csharp on - var caption = "AssetInformation"; - var info = "" + assetInformation.GlobalAssetId; - return Tuple.Create(caption, info); - } - - #endregion - public static AssetInformation ConvertFromV10(this AssetInformation assetInformation, AasxCompatibilityModels.AdminShellV10.Asset sourceAsset) - { - //Determine AssetKind - var assetKind = AssetKind.Instance; - if (sourceAsset.kind.IsType) - { - assetKind = AssetKind.Type; - } - - assetInformation.AssetKind = assetKind; - - - //Assign GlobalAssetId - assetInformation.GlobalAssetId = sourceAsset.identification.id; - - return assetInformation; - } - - public static AssetInformation ConvertFromV20(this AssetInformation assetInformation, AasxCompatibilityModels.AdminShellV20.Asset sourceAsset) - { - //Determine AssetKind - var assetKind = AssetKind.Instance; - if (sourceAsset.kind.IsType) - { - assetKind = AssetKind.Type; - } - - assetInformation.AssetKind = assetKind; - - - //Assign GlobalAssetId - assetInformation.GlobalAssetId = sourceAsset.identification.id; - - return assetInformation; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendBlob.cs b/src/AasxCsharpLibrary/Extensions/ExtendBlob.cs deleted file mode 100644 index d8ee065e8..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendBlob.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System.Text; - -namespace Extensions -{ - public static class ExtendBlob - { - public static void Set(this Blob blob, - string contentType = "", byte[]? value = null) - { - blob.ContentType = contentType; - blob.Value = value; - } - - public static Blob ConvertFromV10(this Blob blob, AasxCompatibilityModels.AdminShellV10.Blob sourceBlob) - { - blob.ContentType = sourceBlob.mimeType; - blob.Value = Encoding.ASCII.GetBytes(sourceBlob.value); - return blob; - } - - public static Blob ConvertFromV20(this Blob blob, AasxCompatibilityModels.AdminShellV20.Blob sourceBlob) - { - blob.ContentType = sourceBlob.mimeType; - if (!string.IsNullOrEmpty(sourceBlob.value)) - { - blob.Value = Encoding.ASCII.GetBytes(sourceBlob.value); - } - return blob; - } - - public static Blob UpdateFrom(this Blob elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is Property srcProp) - { - if (srcProp.Value != null) - elem.Value = Encoding.Default.GetBytes(srcProp.Value); - } - - if (source is AasCore.Aas3_0.Range srcRng) - { - if (srcRng.Min != null) - elem.Value = Encoding.Default.GetBytes(srcRng.Min); - } - - if (source is MultiLanguageProperty srcMlp) - { - var s = srcMlp.Value?.GetDefaultString(); - if (s != null) - elem.Value = Encoding.Default.GetBytes(s); - } - - if (source is File srcFile) - { - if (srcFile.Value != null) - elem.Value = Encoding.Default.GetBytes(srcFile.Value); - } - - return elem; - } - - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendCollection.cs b/src/AasxCsharpLibrary/Extensions/ExtendCollection.cs deleted file mode 100644 index 3acde94a4..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendCollection.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; - -namespace AdminShellNS.Extensions -{ - public static class ExtendCollection - { - public static bool IsNullOrEmpty(this List list) - { - if (list != null && list.Count != 0) - { - return false; - } - - return true; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendConceptDescription.cs b/src/AasxCsharpLibrary/Extensions/ExtendConceptDescription.cs deleted file mode 100644 index 7bb64c7e8..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendConceptDescription.cs +++ /dev/null @@ -1,320 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendConceptDescription - { - #region AasxPackageExplorer - - public static string GetDefaultPreferredName(this IConceptDescription conceptDescription, string defaultLang = null) - { - return "" + - conceptDescription.GetIEC61360()? - .PreferredName?.GetDefaultString(defaultLang); - } - - public static EmbeddedDataSpecification SetIEC61360Spec(this IConceptDescription conceptDescription, - string[] preferredNames = null, - string shortName = "", - string unit = "", - Reference unitId = null, - string valueFormat = null, - string sourceOfDefinition = null, - string symbol = null, - string dataType = "", - string[] definition = null - ) - { - var eds = new EmbeddedDataSpecification( - new Reference(ReferenceTypes.ExternalReference, - new List { ExtendIDataSpecificationContent.GetKeyForIec61360() }), - new DataSpecificationIec61360( - ExtendLangStringSet.CreateManyPreferredNamesFromStringArray(preferredNames), - new List { - new LangStringShortNameTypeIec61360(AdminShellUtil.GetDefaultLngIso639(), shortName) }, - unit, - unitId, - sourceOfDefinition, - symbol, - Stringification.DataTypeIec61360FromString(dataType), - ExtendLangStringSet.CreateManyDefinitionFromStringArray(definition) - )); - - conceptDescription.EmbeddedDataSpecifications = new List { eds }; - // dead-csharp off - // TODO (MIHO, 2022-12-22): Check, but I think it makes no sense - // conceptDescription.IsCaseOf ??= new List(); - // conceptDescription.IsCaseOf.Add(new Reference(ReferenceTypes.ModelReference, new List() { new Key(KeyTypes.ConceptDescription, conceptDescription.Id) })); - - return eds; - } - - /* - - public static DataSpecificationIec61360 CreateDataSpecWithContentIec61360(this ConceptDescription conceptDescription) - { - var eds = EmbeddedDataSpecification.CreateIEC61360WithContent(); - conceptDescription.EmbeddedDataSpecification ??= new HasDataSpecification(); - conceptDescription.EmbeddedDataSpecification.Add(eds); - return eds.DataSpecificationContent?.DataSpecificationIEC61360; - } - - */ - // dead-csharp on - - public static Tuple ToCaptionInfo(this IConceptDescription conceptDescription) - { - var caption = ""; - if (!string.IsNullOrEmpty(conceptDescription.IdShort)) - caption = $"\"{conceptDescription.IdShort.Trim()}\""; - if (conceptDescription.Id != null) - caption = (caption + " " + conceptDescription.Id).Trim(); - - var info = "" + conceptDescription.GetDefaultShortName(); - - return Tuple.Create(caption, info); - } - - public static string GetDefaultShortName(this IConceptDescription conceptDescription, string defaultLang = null) - { - return "" + - conceptDescription.GetIEC61360()? - .ShortName?.GetDefaultString(defaultLang); - } - - public static DataSpecificationIec61360 GetIEC61360(this IConceptDescription conceptDescription) - { - return conceptDescription.EmbeddedDataSpecifications?.GetIEC61360Content(); - } - - //TODO (jtikekar, 0000-00-00): DataSpecificationPhysicalUnit -#if SupportDataSpecificationPhysicalUnit - public static DataSpecificationPhysicalUnit GetPhysicalUnit(this ConceptDescription conceptDescription) - { - return conceptDescription.EmbeddedDataSpecifications?.GetPhysicalUnitContent(); - } -#endif - - public static IEnumerable FindAllReferences(this IConceptDescription conceptDescription) - { - yield break; - } - - #endregion - #region ListOfConceptDescription - public static IConceptDescription AddConceptDescriptionOrReturnExisting(this List conceptDescriptions, ConceptDescription newConceptDescription) - { - if (newConceptDescription == null) - { - return null; - } - if (conceptDescriptions != null) - { - var existingCd = conceptDescriptions.Where(c => c.Id == newConceptDescription.Id).FirstOrDefault(); - if (existingCd != null) - { - return existingCd; - } - else - { - conceptDescriptions.Add(newConceptDescription); - } - } - - return newConceptDescription; - } - #endregion - - public static void Validate( - this IConceptDescription conceptDescription, AasValidationRecordList results) - { - // access - if (results == null) - return; - - // dead-csharp off - // check CD itself - //Handled by BaseValidation Method - //conceptDescription.Validate(results); - - // check IEC61360 spec - - //TODO (jtikekar, 0000-00-00): Temporarily Removed - //var eds61360 = this.IEC61360DataSpec; - //if (eds61360 != null) - //{ - // // check data spec - // if (eds61360.dataSpecification == null || - // !(eds61360.dataSpecification.MatchesExactlyOneKey(DataSpecificationIEC61360.GetKey()))) - // results.Add(new AasValidationRecord( - // AasValidationSeverity.SpecViolation, this, - // "HasDataSpecification: data specification content set to IEC61360, but no " + - // "data specification reference set!", - // () => - // { - // eds61360.dataSpecification = new DataSpecificationRef( - // new Reference( - // DataSpecificationIEC61360.GetKey())); - // })); - - // // validate content - // if (eds61360.dataSpecificationContent?.dataSpecificationIEC61360 == null) - // { - // results.Add(new AasValidationRecord( - // AasValidationSeverity.SpecViolation, this, - // "HasDataSpecification: data specification reference set to IEC61360, but no " + - // "data specification content set!", - // () => - // { - // eds61360.dataSpecificationContent = new DataSpecificationContent(); - // eds61360.dataSpecificationContent.dataSpecificationIEC61360 = - // new DataSpecificationIEC61360(); - // })); - // } - // else - // { - // // validate - // eds61360.dataSpecificationContent.dataSpecificationIEC61360.Validate(results, this); - // } - // dead-csharp on - } - - public static Key GetSingleKey(this IConceptDescription conceptDescription) - { - return new Key(KeyTypes.ConceptDescription, conceptDescription.Id); - } - - public static ConceptDescription ConvertFromV10( - this ConceptDescription conceptDescription, AasxCompatibilityModels.AdminShellV10.ConceptDescription sourceConceptDescription) - { - if (sourceConceptDescription == null) - { - return null; - } - - if (string.IsNullOrEmpty(sourceConceptDescription.idShort)) - { - conceptDescription.IdShort = ""; - } - else - { - conceptDescription.IdShort = sourceConceptDescription.idShort; - } - - if (sourceConceptDescription.description != null) - { - conceptDescription.Description = ExtensionsUtil.ConvertDescriptionFromV10(sourceConceptDescription.description); - } - - if (sourceConceptDescription.administration != null) - { - conceptDescription.Administration = new AdministrativeInformation(version: sourceConceptDescription.administration.version, revision: sourceConceptDescription.administration.revision); - } - - if (sourceConceptDescription.IsCaseOf != null && sourceConceptDescription.IsCaseOf.Count != 0) - { - if (conceptDescription.IsCaseOf == null) - { - conceptDescription.IsCaseOf = new List(); - } - foreach (var caseOf in sourceConceptDescription.IsCaseOf) - { - conceptDescription.IsCaseOf.Add(ExtensionsUtil.ConvertReferenceFromV10(caseOf, ReferenceTypes.ModelReference)); - } - } - - return conceptDescription; - } - - public static ConceptDescription ConvertFromV20( - this ConceptDescription cd, AasxCompatibilityModels.AdminShellV20.ConceptDescription srcCD) - { - if (srcCD == null) - return null; - - if (string.IsNullOrEmpty(srcCD.idShort)) - cd.IdShort = ""; - else - cd.IdShort = srcCD.idShort; - - if (srcCD.identification?.id != null) - cd.Id = srcCD.identification.id; - - if (srcCD.description != null && srcCD.description.langString.Count >= 1) - cd.Description = ExtensionsUtil.ConvertDescriptionFromV20(srcCD.description); - - if (srcCD.administration != null) - cd.Administration = new AdministrativeInformation( - version: srcCD.administration.version, revision: srcCD.administration.revision); - - if (srcCD.IsCaseOf != null && srcCD.IsCaseOf.Count != 0) - { - foreach (var caseOf in srcCD.IsCaseOf) - { - IReference newCaseOf = null; - if(caseOf != null && !caseOf.IsEmpty) - { - newCaseOf = ExtensionsUtil.ConvertReferenceFromV20(caseOf, ReferenceTypes.ModelReference); - } - - if(newCaseOf != null) - { - cd.IsCaseOf ??= new List(); - cd.IsCaseOf.Add(newCaseOf); - } - } - } - - //jtikekar:as per old implementation - if (srcCD.embeddedDataSpecification != null && srcCD.embeddedDataSpecification.Count > 0) - { - foreach (var sourceEds in srcCD.embeddedDataSpecification) - { - var eds = new EmbeddedDataSpecification(null, null); - eds.ConvertFromV20(sourceEds); - cd.AddEmbeddedDataSpecification(eds); - } - } - - return cd; - } - - public static EmbeddedDataSpecification AddEmbeddedDataSpecification( - this IConceptDescription cd, EmbeddedDataSpecification eds) - { - if (cd == null) - return null; - if (cd.EmbeddedDataSpecifications == null) - cd.EmbeddedDataSpecifications = new List(); - if (eds == null) - return null; - cd.EmbeddedDataSpecifications.Add(eds); - return eds; - } - - public static Reference GetCdReference(this IConceptDescription conceptDescription) - { - var key = new Key(KeyTypes.GlobalReference, conceptDescription.Id); - return new Reference(ReferenceTypes.ExternalReference, new List { key }); - } - - public static void AddIsCaseOf(this IConceptDescription cd, - Reference ico) - { - if (cd.IsCaseOf == null) - cd.IsCaseOf = new List(); - cd.IsCaseOf.Add(ico); - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendDataElement.cs b/src/AasxCsharpLibrary/Extensions/ExtendDataElement.cs deleted file mode 100644 index 717fcefcb..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendDataElement.cs +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -namespace Extensions -{ - public static class ExtendDataElement - { - public static DataTypeDefXsd[] ValueTypes_Number = - new[] { DataTypeDefXsd.Decimal, DataTypeDefXsd.Double, DataTypeDefXsd.Float, - DataTypeDefXsd.Integer, DataTypeDefXsd.Long, DataTypeDefXsd.Int, DataTypeDefXsd.Short, - DataTypeDefXsd.Byte, DataTypeDefXsd.NonNegativeInteger, DataTypeDefXsd.NonPositiveInteger, - DataTypeDefXsd.UnsignedInt, DataTypeDefXsd.Integer, DataTypeDefXsd.UnsignedByte, - DataTypeDefXsd.UnsignedLong, DataTypeDefXsd.UnsignedShort, DataTypeDefXsd.NegativeInteger }; - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendDataSpecificationIEC61360.cs b/src/AasxCsharpLibrary/Extensions/ExtendDataSpecificationIEC61360.cs deleted file mode 100644 index 85f3cdee2..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendDataSpecificationIEC61360.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System.Collections.Generic; - -namespace Extensions -{ - public static class ExtendDataSpecificationIEC61360 - { - public static DataSpecificationIec61360 ConvertFromV20(this DataSpecificationIec61360 ds61360, AasxCompatibilityModels.AdminShellV20.DataSpecificationIEC61360 src616360) - { - if (src616360.preferredName != null) - ds61360.PreferredName = new List().ConvertFromV20(src616360.preferredName); - - if (src616360.shortName != null) - ds61360.ShortName = new List().ConvertFromV20(src616360.shortName); - - if (!string.IsNullOrEmpty(src616360.unit)) - { - ds61360.Unit = src616360.unit; - } - - if (src616360.unitId != null) - ds61360.UnitId = ExtensionsUtil.ConvertReferenceFromV20(AasxCompatibilityModels.AdminShellV20.Reference.CreateNew(src616360.unitId.keys), ReferenceTypes.ExternalReference); - - ds61360.ValueFormat = src616360.valueFormat; - ds61360.SourceOfDefinition = src616360.sourceOfDefinition; - ds61360.Symbol = src616360.symbol; - if (!(string.IsNullOrEmpty(src616360.dataType))) - { - var dt = src616360.dataType; - if (!dt.StartsWith("xs:")) - dt = "xs:" + dt; - ds61360.DataType = Stringification.DataTypeIec61360FromString(dt); - } - if (src616360.definition != null) - ds61360.Definition = new List().ConvertFromV20(src616360.definition); - - //TODO (jtikekar, 0000-00-00): check with Andreas - ds61360.Value = ""; - - return ds61360; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendEmbeddedDataSpecification.cs b/src/AasxCsharpLibrary/Extensions/ExtendEmbeddedDataSpecification.cs deleted file mode 100644 index f914e75f8..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendEmbeddedDataSpecification.cs +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System.Collections.Generic; - -namespace Extensions -{ - // TODO (Jui, 2022-12-21): I do not know, if to put the List<> extension here or in a separate file - public static class ExtendListOfEmbeddedDataSpecification - { - public static IEmbeddedDataSpecification FindFirstIEC61360Spec(this List list) - { - foreach (var eds in list) - if (eds?.DataSpecificationContent is DataSpecificationIec61360 - || eds?.DataSpecification?.MatchesExactlyOneKey( - ExtendIDataSpecificationContent.GetKeyForIec61360()) == true) - return eds; - return null; - } - - public static DataSpecificationIec61360 GetIEC61360Content(this List list) - { - foreach (var eds in list) - if (eds?.DataSpecificationContent is DataSpecificationIec61360 dsiec) - return dsiec; - return null; - } - - //TODO (jtikekar, 0000-00-00): DataSpecificationPhysicalUnit -#if SupportDataSpecificationPhysicalUnit - public static DataSpecificationPhysicalUnit GetPhysicalUnitContent(this List list) - { - foreach (var eds in list) - if (eds?.DataSpecificationContent is DataSpecificationPhysicalUnit dspu) - return dspu; - return null; - } -#endif - } - - public static class ExtendEmbeddedDataSpecification - { - public static EmbeddedDataSpecification ConvertFromV20(this EmbeddedDataSpecification embeddedDataSpecification, AasxCompatibilityModels.AdminShellV20.EmbeddedDataSpecification sourceEmbeddedSpec) - { - if (sourceEmbeddedSpec != null) - { - if (sourceEmbeddedSpec.dataSpecification != null) - { - embeddedDataSpecification.DataSpecification = ExtensionsUtil.ConvertReferenceFromV20(sourceEmbeddedSpec.dataSpecification, ReferenceTypes.ExternalReference); - - // TODO (MIHO, 2022-19-12): check again, see questions - var oldid = new[] { - "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0", - "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360", - "www.admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360" - }; - var newid = "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0"; - - // map all "usable" old ids to new one .. - foreach (var oi in oldid) - if (sourceEmbeddedSpec.dataSpecification?.Matches("", false, "IRI", oi, - AasxCompatibilityModels.AdminShellV20.Key.MatchMode.Identification) == true) - { - embeddedDataSpecification.DataSpecification.Keys[0].Value = newid; - } - } - - if (sourceEmbeddedSpec.dataSpecificationContent != null) - { - if (sourceEmbeddedSpec.dataSpecificationContent?.dataSpecificationIEC61360 != null) - { - embeddedDataSpecification.DataSpecificationContent = - new DataSpecificationIec61360(null).ConvertFromV20( - sourceEmbeddedSpec.dataSpecificationContent.dataSpecificationIEC61360); - } - } - } - - return embeddedDataSpecification; - } - - public static EmbeddedDataSpecification CreateIec61360WithContent(DataSpecificationIec61360 content = null) - { - if (content == null) - content = new DataSpecificationIec61360( - new List()); - - var res = new EmbeddedDataSpecification( - new Reference(ReferenceTypes.ExternalReference, - new List(new[] { ExtendIDataSpecificationContent.GetKeyForIec61360() })), - content); - return res; - } - - public static bool FixReferenceWrtContent(this IEmbeddedDataSpecification eds) - { - // does content tell something? - var ctc = ExtendIDataSpecificationContent.GuessContentTypeFor(eds?.DataSpecificationContent); - var ctr = ExtendIDataSpecificationContent.GuessContentTypeFor(eds?.DataSpecification); - - if (ctc == ExtendIDataSpecificationContent.ContentTypes.NoInfo) - return false; - - if (ctr == ctc) - return false; - - // ok, fix - eds.DataSpecification = new Reference(ReferenceTypes.ExternalReference, - new List { ExtendIDataSpecificationContent.GetKeyFor(ctc) }); - return true; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendEntity.cs b/src/AasxCsharpLibrary/Extensions/ExtendEntity.cs deleted file mode 100644 index 7d0376105..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendEntity.cs +++ /dev/null @@ -1,117 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; -using AdminShellNS.Extensions; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendEntity - { - #region AasxPackageExplorer - - public static void Add(this Entity entity, ISubmodelElement submodelElement) - { - if (entity != null) - { - entity.Statements ??= new(); - - submodelElement.Parent = entity; - - entity.Statements.Add(submodelElement); - } - } - - public static void Remove(this Entity entity, ISubmodelElement submodelElement) - { - if (entity != null) - { - if (entity.Statements != null) - { - entity.Statements.Remove(submodelElement); - } - } - } - - public static object AddChild(this Entity entity, ISubmodelElement childSubmodelElement, EnumerationPlacmentBase placement = null) - { - if (childSubmodelElement == null) - return null; - if (entity.Statements == null) - entity.Statements = new(); - if (childSubmodelElement != null) - childSubmodelElement.Parent = entity; - entity.Statements.Add(childSubmodelElement); - return childSubmodelElement; - } - - #endregion - public static Entity ConvertFromV20(this Entity entity, AasxCompatibilityModels.AdminShellV20.Entity sourceEntity) - { - if (sourceEntity == null) - { - return null; - } - - if (!sourceEntity.statements.IsNullOrEmpty()) - { - entity.Statements ??= new List(); - foreach (var submodelElementWrapper in sourceEntity.statements) - { - var sourceSubmodelElement = submodelElementWrapper.submodelElement; - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelElement != null) - { - outputSubmodelElement = outputSubmodelElement.ConvertFromV20(sourceSubmodelElement); - } - entity.Statements.Add(outputSubmodelElement); - } - } - - if (sourceEntity.assetRef != null) - { - //TODO (jtikekar, 0000-00-00): whether to convert to Global or specific asset id - var assetRef = ExtensionsUtil.ConvertReferenceFromV20(sourceEntity.assetRef, ReferenceTypes.ExternalReference); - if (assetRef != null) - { - entity.GlobalAssetId = assetRef.GetAsIdentifier(); - } - } - - return entity; - } - - public static T FindFirstIdShortAs(this Entity entity, string idShort) where T : ISubmodelElement - { - - var submodelElements = entity.Statements.Where(sme => (sme != null) && (sme is T) && sme.IdShort.Equals(idShort, StringComparison.OrdinalIgnoreCase)); - - if (submodelElements.Any()) - { - return (T)submodelElements.First(); - } - - return default; - } - - public static T CreateSMEForCD( - this Entity ent, - ConceptDescription conceptDescription, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false, bool isTemplate = false) - where T : ISubmodelElement - { - if (ent.Statements == null) - ent.Statements = new List(); - return ent.Statements.CreateSMEForCD( - conceptDescription, category, idShort, idxTemplate, maxNum, addSme, isTemplate); - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendEnvironment.cs b/src/AasxCsharpLibrary/Extensions/ExtendEnvironment.cs deleted file mode 100644 index 7440d83d3..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendEnvironment.cs +++ /dev/null @@ -1,1092 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; -using AdminShellNS.Extensions; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Extensions -{ - public static class ExtendEnvironment - { - #region Environment - - #region AasxPackageExplorer - - public static void RecurseOnReferables(this AasCore.Aas3_0.Environment environment, - object state, Func, IReferable, bool> lambda, bool includeThis = false) - { - // includeThis does not make sense, as no Referable - // just use the others - foreach (var idf in environment.FindAllReferable(onlyIdentifiables: true)) - idf?.RecurseOnReferables(state, lambda, includeThis); - } - - #endregion - - /// - /// Deprecated? Not compatible with AAS core? - /// - public static AasValidationRecordList ValidateAll(this AasCore.Aas3_0.Environment environment) - { - // collect results - var results = new AasValidationRecordList(); - - // all entities - foreach (var rf in environment.FindAllReferable()) - rf.Validate(results); - - // give back - return results; - } - - /// - /// Deprecated? Not compatible with AAS core? - /// - public static int AutoFix(this AasCore.Aas3_0.Environment environment, IEnumerable records) - { - // access - if (records == null) - return -1; - - // collect Referables (expensive safety measure) - var allowedReferables = environment.FindAllReferable().ToList(); - - // go thru records - int res = 0; - foreach (var rec in records) - { - // access - if (rec == null || rec.Fix == null || rec.Source == null) - continue; - - // minimal safety measure - if (!allowedReferables.Contains(rec.Source)) - continue; - - // apply fix - res++; - try - { - rec.Fix.Invoke(); - } - catch - { - res--; - } - } - - // return number of applied fixes - return res; - } - - /// - /// This function tries to silently fix some issues preventing the environment - /// are parts of it to be properly serilaized. - /// - /// Number of fixes taken - public static int SilentFix30(this AasCore.Aas3_0.Environment env) - { - // access - int res = 0; - if (env == null) - return res; - - // AAS core crashes without AssetInformation - if (env.AssetAdministrationShells != null) - foreach (var aas in env.AssetAdministrationShells) - if (aas.AssetInformation == null) - { - aas.AssetInformation = new AssetInformation(assetKind: AssetKind.NotApplicable); - res++; - } - - // AAS core crashes without EmbeddedDataSpecification.DataSpecificationContent - // AAS core crashes without EmbeddedDataSpecification.DataSpecificationContent.PreferredName - foreach (var rf in env.FindAllReferable()) - if (rf is IHasDataSpecification hds) - if (hds.EmbeddedDataSpecifications != null) - foreach (var eds in hds.EmbeddedDataSpecifications) - { - if (eds.DataSpecificationContent == null) - eds.DataSpecificationContent = - new DataSpecificationIec61360( - new List()); - } - - // ok - return res; - } - - public static IEnumerable FindAllReferable(this AasCore.Aas3_0.Environment environment, bool onlyIdentifiables = false) - { - if (environment.AssetAdministrationShells != null) - foreach (var aas in environment.AssetAdministrationShells) - if (aas != null) - { - // AAS itself - yield return aas; - } - - if (environment.Submodels != null) - foreach (var sm in environment.Submodels) - if (sm != null) - { - yield return sm; - - if (!onlyIdentifiables) - { - // TODO (MIHO, 2020-08-26): not very elegant, yet. Avoid temporary collection - var allsme = new List(); - sm.RecurseOnSubmodelElements(null, (state, parents, sme) => - { - allsme.Add(sme); return true; - }); - foreach (var sme in allsme) - yield return sme; - } - } - - if (environment.ConceptDescriptions != null) - foreach (var cd in environment.ConceptDescriptions) - if (cd != null) - yield return cd; - } - -#if !DoNotUseAasxCompatibilityModels - - public static AasCore.Aas3_0.Environment ConvertFromV10(this AasCore.Aas3_0.Environment environment, AasxCompatibilityModels.AdminShellV10.AdministrationShellEnv sourceEnvironement) - { - //Convert Administration Shells - if (!sourceEnvironement.AdministrationShells.IsNullOrEmpty()) - { - environment.AssetAdministrationShells ??= new List(); - foreach (var sourceAas in sourceEnvironement.AdministrationShells) - { - var sourceAsset = sourceEnvironement?.FindAsset(sourceAas.assetRef); - if (sourceAsset != null) - { - var newAssetInformation = new AssetInformation(AssetKind.Instance); - newAssetInformation = newAssetInformation.ConvertFromV10(sourceAsset); - - var newAas = new AssetAdministrationShell(id: sourceAas.identification.id, newAssetInformation); - newAas = newAas.ConvertFromV10(sourceAas); - - environment.AssetAdministrationShells.Add(newAas); - } - - } - } - - //Convert Submodels - if (!sourceEnvironement.Submodels.IsNullOrEmpty()) - { - environment.Submodels ??= new List(); - foreach (var sourceSubmodel in sourceEnvironement.Submodels) - { - var newSubmodel = new Submodel(sourceSubmodel.identification.id); - newSubmodel = newSubmodel.ConvertFromV10(sourceSubmodel); - environment.Submodels.Add(newSubmodel); - } - } - - if (!sourceEnvironement.ConceptDescriptions.IsNullOrEmpty()) - { - environment.ConceptDescriptions ??= new List(); - foreach (var sourceConceptDescription in sourceEnvironement.ConceptDescriptions) - { - var newConceptDescription = new ConceptDescription(sourceConceptDescription.identification.id); - newConceptDescription = newConceptDescription.ConvertFromV10(sourceConceptDescription); - environment.ConceptDescriptions.Add(newConceptDescription); - } - } - - return environment; - } - - - public static AasCore.Aas3_0.Environment ConvertFromV20(this AasCore.Aas3_0.Environment environment, AasxCompatibilityModels.AdminShellV20.AdministrationShellEnv sourceEnvironement) - { - //Convert Administration Shells - if (!sourceEnvironement.AdministrationShells.IsNullOrEmpty()) - { - environment.AssetAdministrationShells ??= new List(); - foreach (var sourceAas in sourceEnvironement.AdministrationShells) - { - // first make the AAS - var newAas = new AssetAdministrationShell(id: sourceAas.identification.id, null); - newAas = newAas.ConvertFromV20(sourceAas); - environment.AssetAdministrationShells.Add(newAas); - - var sourceAsset = sourceEnvironement?.FindAsset(sourceAas.assetRef); - if (sourceAsset != null) - { - var newAssetInformation = new AssetInformation(AssetKind.Instance); - newAssetInformation = newAssetInformation.ConvertFromV20(sourceAsset); - newAas.AssetInformation = newAssetInformation; - } - - } - } - - //Convert Submodels - if (!sourceEnvironement.Submodels.IsNullOrEmpty()) - { - environment.Submodels ??= new List(); - foreach (var sourceSubmodel in sourceEnvironement.Submodels) - { - var newSubmodel = new Submodel(sourceSubmodel.identification.id); - newSubmodel = newSubmodel.ConvertFromV20(sourceSubmodel); - environment.Submodels.Add(newSubmodel); - } - } - - if (!sourceEnvironement.ConceptDescriptions.IsNullOrEmpty()) - { - environment.ConceptDescriptions ??= new List(); - foreach (var sourceConceptDescription in sourceEnvironement.ConceptDescriptions) - { - var newConceptDescription = new ConceptDescription(sourceConceptDescription.identification.id); - newConceptDescription = newConceptDescription.ConvertFromV20(sourceConceptDescription); - environment.ConceptDescriptions.Add(newConceptDescription); - } - } - - return environment; - } - -#endif - - //TODO (jtikekar, 0000-00-00): to test - public static AasCore.Aas3_0.Environment CreateFromExistingEnvironment(this AasCore.Aas3_0.Environment environment, - AasCore.Aas3_0.Environment sourceEnvironment, List filterForAas = null, List filterForAssets = null, List filterForSubmodel = null, - List filterForConceptDescriptions = null) - { - if (filterForAas == null) - { - filterForAas = new List(); - } - - if (filterForAssets == null) - { - filterForAssets = new List(); - } - - if (filterForSubmodel == null) - { - filterForSubmodel = new List(); - } - - if (filterForConceptDescriptions == null) - { - filterForConceptDescriptions = new List(); - } - - //Copy AssetAdministrationShells - foreach (var aas in sourceEnvironment.AssetAdministrationShells) - { - if (filterForAas.Contains(aas)) - { - environment.AssetAdministrationShells.Add(aas); - - if (aas.Submodels != null && aas.Submodels.Count > 0) - { - foreach (var submodelReference in aas.Submodels) - { - var submodel = sourceEnvironment.FindSubmodel(submodelReference); - if (submodel != null) - { - filterForSubmodel.Add(submodel); - } - } - } - } - } - - //Copy Submodel - foreach (var submodel in sourceEnvironment.Submodels) - { - if (filterForSubmodel.Contains(submodel)) - { - environment.Submodels.Add(submodel); - - //Find Used CDs - environment.CreateFromExistingEnvRecurseForCDs(sourceEnvironment, submodel.SubmodelElements, ref filterForConceptDescriptions); - } - } - - //Copy ConceptDescription - foreach (var conceptDescription in sourceEnvironment.ConceptDescriptions) - { - if (filterForConceptDescriptions.Contains(conceptDescription)) - { - environment.ConceptDescriptions.Add(conceptDescription); - } - } - - return environment; - - } - - public static void CreateFromExistingEnvRecurseForCDs(this AasCore.Aas3_0.Environment environment, AasCore.Aas3_0.Environment sourceEnvironment, - List submodelElements, ref List filterForConceptDescription) - { - if (submodelElements == null || submodelElements.Count == 0 || filterForConceptDescription == null || filterForConceptDescription.Count == 0) - { - return; - } - - foreach (var submodelElement in submodelElements) - { - if (submodelElement == null) - { - return; - } - - if (submodelElement.SemanticId != null) - { - var conceptDescription = sourceEnvironment.FindConceptDescriptionByReference(submodelElement.SemanticId); - if (conceptDescription != null) - { - filterForConceptDescription.Add(conceptDescription); - } - } - - if (submodelElement is SubmodelElementCollection smeColl) - { - environment.CreateFromExistingEnvRecurseForCDs(sourceEnvironment, smeColl.Value, ref filterForConceptDescription); - } - - if (submodelElement is SubmodelElementList smeList) - { - environment.CreateFromExistingEnvRecurseForCDs(sourceEnvironment, smeList.Value, ref filterForConceptDescription); - } - - if (submodelElement is Entity entity) - { - environment.CreateFromExistingEnvRecurseForCDs(sourceEnvironment, entity.Statements, ref filterForConceptDescription); - } - - if (submodelElement is AnnotatedRelationshipElement annotatedRelationshipElement) - { - var annotedELements = new List(); - foreach (var annotation in annotatedRelationshipElement.Annotations) - { - annotedELements.Add(annotation); - } - environment.CreateFromExistingEnvRecurseForCDs(sourceEnvironment, annotedELements, ref filterForConceptDescription); - } - - if (submodelElement is Operation operation) - { - var operationELements = new List(); - foreach (var inputVariable in operation.InputVariables) - { - operationELements.Add(inputVariable.Value); - } - - foreach (var outputVariable in operation.OutputVariables) - { - operationELements.Add(outputVariable.Value); - } - - foreach (var inOutVariable in operation.InoutputVariables) - { - operationELements.Add(inOutVariable.Value); - } - - environment.CreateFromExistingEnvRecurseForCDs(sourceEnvironment, operationELements, ref filterForConceptDescription); - - } - } - } - - public static ConceptDescription Add(this AasCore.Aas3_0.Environment env, ConceptDescription cd) - { - if (cd == null) - return null; - if (env.ConceptDescriptions == null) - env.ConceptDescriptions = new(); - env.ConceptDescriptions.Add(cd); - return cd; - } - - public static Submodel Add(this AasCore.Aas3_0.Environment env, Submodel sm) - { - if (sm == null) - return null; - if (env.Submodels == null) - env.Submodels = new(); - env.Submodels.Add(sm); - return sm; - } - - public static AssetAdministrationShell Add(this AasCore.Aas3_0.Environment env, AssetAdministrationShell aas) - { - if (aas == null) - return null; - if (env.AssetAdministrationShells == null) - env.AssetAdministrationShells = new(); - env.AssetAdministrationShells.Add(aas); - return aas; - } - - public static JsonWriter SerialiazeJsonToStream(this AasCore.Aas3_0.Environment environment, StreamWriter streamWriter, bool leaveJsonWriterOpen = false) - { - streamWriter.AutoFlush = true; - - JsonSerializer serializer = new JsonSerializer() - { - NullValueHandling = NullValueHandling.Ignore, - ReferenceLoopHandling = ReferenceLoopHandling.Serialize, - Formatting = Newtonsoft.Json.Formatting.Indented - }; - - JsonWriter writer = new JsonTextWriter(streamWriter); - serializer.Serialize(writer, environment); - if (leaveJsonWriterOpen) - return writer; - writer.Close(); - return null; - } - - #endregion - - #region Submodel Queries - - public static IEnumerable FindAllSubmodelGroupedByAAS(this AasCore.Aas3_0.Environment environment, Func p = null) - { - if (environment.AssetAdministrationShells == null || environment.Submodels == null) - yield break; - foreach (var aas in environment.AssetAdministrationShells) - { - if (aas?.Submodels == null) - continue; - foreach (var smref in aas.Submodels) - { - var sm = environment.FindSubmodel(smref); - if (sm != null && (p == null || p(aas, sm))) - yield return sm; - } - } - } - public static ISubmodel FindSubmodel(this AasCore.Aas3_0.Environment environment, IReference submodelReference) - { - if (environment == null || submodelReference == null) - { - return null; - } - - if (submodelReference.Keys.Count != 1) // Can have only one reference key - { - return null; - } - - var key = submodelReference.Keys[0]; - if (key.Type != KeyTypes.Submodel) - { - return null; - } - - var submodels = environment.Submodels.Where(s => s.Id.Equals(key.Value, StringComparison.OrdinalIgnoreCase)); - if (submodels.Any()) - { - return submodels.First(); - } - - return null; - } - - public static ISubmodel FindSubmodelById(this AasCore.Aas3_0.Environment environment, string submodelId) - { - if (string.IsNullOrEmpty(submodelId)) - { - return null; - } - - var submodels = environment.Submodels.Where(s => s.Id.Equals(submodelId)); - if (submodels.Any()) - { - return submodels.First(); - } - - return null; - } - // dead-csharp off - //public static IEnumerable FindAllSubmodelsGroupedByAAS(this AasCore.Aas3_0.Environment environment, Func p = null) - //{ - // if (environment.AssetAdministrationShells == null || environment.Submodels == null) - // yield break; - // foreach (var aas in environment.AssetAdministrationShells) - // { - // if (aas?.Submodels == null) - // continue; - // foreach (var submodelReference in aas.Submodels) - // { - // var submodel = environment.FindSubmodel(submodelReference); - // if (submodel != null && (p == null || p(aas, submodel))) - // yield return submodel; - // } - // } - //} - // dead-csharp on - public static IEnumerable FindAllSubmodelBySemanticId(this AasCore.Aas3_0.Environment environment, string semanticId) - { - if (semanticId == null) - yield break; - - foreach (var submodel in environment.Submodels) - if (true == submodel.SemanticId?.Matches(semanticId)) - yield return submodel; - } - - #endregion - - #region AssetAdministrationShell Queries - public static IAssetAdministrationShell FindAasWithSubmodelId(this AasCore.Aas3_0.Environment environment, string submodelId) - { - if (submodelId == null) - { - return null; - } - - var aas = environment.AssetAdministrationShells.Where(a => (a.Submodels?.Where(s => s.Matches(submodelId)).FirstOrDefault()) != null).FirstOrDefault(); - - return aas; - } - - public static IAssetAdministrationShell FindAasById(this AasCore.Aas3_0.Environment environment, string aasId) - { - if (string.IsNullOrEmpty(aasId)) - { - return null; - } - - var aas = environment.AssetAdministrationShells.Where(a => a.Id.Equals(aasId)).First(); - - return aas; - } - - #endregion - - #region ConceptDescription Queries - - public static IConceptDescription FindConceptDescriptionById( - this AasCore.Aas3_0.Environment env, string cdId) - { - if (string.IsNullOrEmpty(cdId)) - return null; - - if (env.ConceptDescriptions == null || env.ConceptDescriptions.Count == 0) - return null; - - var conceptDescription = env.ConceptDescriptions.Where(c => c.Id.Equals(cdId)).FirstOrDefault(); - return conceptDescription; - } - - public static IConceptDescription FindConceptDescriptionByReference( - this AasCore.Aas3_0.Environment env, IReference rf) - { - if (rf == null) - return null; - - return env.FindConceptDescriptionById(rf.GetAsIdentifier()); - } - - #endregion - - #region Referable Queries - - /// - /// Result of FindReferable in Environment - /// - public class ReferableRootInfo - { - public AssetAdministrationShell AAS = null; - public AssetInformation Asset = null; - public Submodel Submodel = null; - public ConceptDescription CD = null; - - public int NrOfRootKeys = 0; - - public bool IsValid - { - get - { - return NrOfRootKeys > 0 && (AAS != null || Submodel != null || Asset != null); - } - } - } - - //TODO (jtikekar, 0000-00-00): Need to test - public static IReferable FindReferableByReference( - this AasCore.Aas3_0.Environment environment, - IReference reference, - int keyIndex = 0, - IEnumerable submodelElems = null, - ReferableRootInfo rootInfo = null) - { - // access - var keyList = reference?.Keys; - if (keyList == null || keyList.Count == 0 || keyIndex >= keyList.Count) - return null; - - // shortcuts - var firstKeyType = keyList[keyIndex].Type; - var firstKeyId = keyList[keyIndex].Value; - - // different pathes - switch (firstKeyType) - { - case KeyTypes.AssetAdministrationShell: - { - var aas = environment.FindAasById(firstKeyId); - - // side info? - if (rootInfo != null) - { - rootInfo.AAS = aas as AssetAdministrationShell; - rootInfo.NrOfRootKeys = 1 + keyIndex; - } - - //Not found or already at the end of our search - if (aas == null || keyIndex >= keyList.Count - 1) - { - return aas; - } - - return environment.FindReferableByReference(reference, ++keyIndex); - } - // dead-csharp off - // TODO (MIHO, 2023-01-01): stupid generalization :-( - case KeyTypes.GlobalReference: - case KeyTypes.ConceptDescription: - { - // In meta model V3, multiple important things might by identified - // by a flat GlobalReference :-( - - // find an Asset by that id? - - var keyedAas = environment.FindAasWithAssetInformation(firstKeyId); - if (keyedAas?.AssetInformation != null) - { - // found an Asset - - // side info? - if (rootInfo != null) - { - rootInfo.AAS = keyedAas as AssetAdministrationShell; - rootInfo.Asset = (AssetInformation)(keyedAas?.AssetInformation); - rootInfo.NrOfRootKeys = 1 + keyIndex; - } - - // give back the AAS - return keyedAas; - } - - // Concept?Description - var keyedCd = environment.FindConceptDescriptionById(firstKeyId); - if (keyedCd != null) - { - // side info? - if (rootInfo != null) - { - rootInfo.CD = keyedCd as ConceptDescription; - rootInfo.NrOfRootKeys = 1 + keyIndex; - } - - // give back the CD - return keyedCd; - } - - // Nope - return null; - } - // dead-csharp on - case KeyTypes.Submodel: - { - var submodel = environment.FindSubmodelById(firstKeyId); - // No? - if (submodel == null) - return null; - - // notice in side info - if (rootInfo != null) - { - rootInfo.Submodel = submodel as Submodel; - rootInfo.NrOfRootKeys = 1 + keyIndex; - - // add even more info - if (rootInfo.AAS == null) - { - foreach (var aas2 in environment.AssetAdministrationShells) - { - var smref2 = environment.FindSubmodelById(submodel.Id); - if (smref2 != null) - { - rootInfo.AAS = (AssetAdministrationShell)aas2; - break; - } - } - } - } - - // at the end of the journey? - if (keyIndex >= keyList.Count - 1) - return submodel; - - return environment.FindReferableByReference(reference, ++keyIndex, submodel.SubmodelElements); - } - } - - - - if (firstKeyType.IsSME() && submodelElems != null) - { - ISubmodelElement submodelElement; - //check if key.value is index - bool isIndex = int.TryParse(firstKeyId, out int index); - if (isIndex) - { - var smeList = submodelElems.ToList(); - submodelElement = smeList[index]; - } - else - { - submodelElement = submodelElems.Where( - sme => sme.IdShort.Equals(keyList[keyIndex].Value, - StringComparison.OrdinalIgnoreCase)).First(); - } - - //This is required element - if (keyIndex + 1 >= keyList.Count) - { - return submodelElement; - } - - //Recurse again - if (submodelElement?.EnumeratesChildren() == true) - return environment.FindReferableByReference(reference, ++keyIndex, submodelElement.EnumerateChildren()); - } - - //Nothing in this environment - return null; - } - - #endregion - - #region AasxPackageExplorer - - public static IEnumerable FindAllSubmodelElements(this AasCore.Aas3_0.Environment environment, - Predicate match = null, AssetAdministrationShell onlyForAAS = null) where T : ISubmodelElement - { - // more or less two different schemes - if (onlyForAAS != null) - { - if (onlyForAAS.Submodels == null) - yield break; - foreach (var smr in onlyForAAS.Submodels) - { - var sm = environment.FindSubmodel(smr); - if (sm?.SubmodelElements != null) - foreach (var x in sm.SubmodelElements.FindDeep(match)) - yield return x; - } - } - else - { - if (environment.Submodels != null) - foreach (var sm in environment.Submodels) - if (sm?.SubmodelElements != null) - foreach (var x in sm.SubmodelElements.FindDeep(match)) - yield return x; - } - } - - public static IEnumerable FindAllReferences(this AasCore.Aas3_0.Environment environment) - { - if (environment.AssetAdministrationShells != null) - foreach (var aas in environment.AssetAdministrationShells) - if (aas != null) - foreach (var r in aas.FindAllReferences()) - yield return r; - - if (environment.Submodels != null) - foreach (var sm in environment.Submodels) - if (sm != null) - foreach (var r in sm.FindAllReferences()) - yield return r; - - if (environment.ConceptDescriptions != null) - foreach (var cd in environment.ConceptDescriptions) - if (cd != null) - foreach (var r in cd.FindAllReferences()) - yield return new LocatedReference(cd, r); - } - - /// - /// Tries renaming an Identifiable, specifically: the identification of an Identifiable and - /// all references to it. - /// Currently supported: ConceptDescriptions - /// Returns a list of Referables, which were changed or null in case of error - /// - public static List RenameIdentifiable(this AasCore.Aas3_0.Environment environment, string oldId, string newId) - where T : IClass - { - // access - if (oldId == null || newId == null || oldId.Equals(newId)) - return null; - - var res = new List(); - - if (typeof(T) == typeof(ConceptDescription)) - { - // check, if exist or not exist - var cdOld = environment.FindConceptDescriptionById(oldId); - if (cdOld == null || environment.FindConceptDescriptionById(newId) != null) - return null; - - // rename old cd - cdOld.Id = newId; - res.Add(cdOld); - - // search all SMEs referring to this CD - foreach (var sme in environment.FindAllSubmodelElements(match: (s) => - { - return (s != null && s.SemanticId != null && s.SemanticId.Matches(oldId)); - })) - { - sme.SemanticId.Keys[0].Value = newId; - res.Add(sme); - } - - // seems fine - return res; - } - else - if (typeof(T) == typeof(Submodel)) - { - // check, if exist or not exist - var smOld = environment.FindSubmodelById(oldId); - if (smOld == null || environment.FindSubmodelById(newId) != null) - return null; - - // recurse all possible Referenes in the aas env - foreach (var lr in environment.FindAllReferences()) - { - var r = lr?.Reference; - if (r != null) - for (int i = 0; i < r.Keys.Count; i++) - if (r.Keys[i].Matches(KeyTypes.Submodel, oldId, MatchMode.Relaxed)) - { - // directly replace - r.Keys[i].Value = newId; - if (res.Contains(lr.Identifiable)) - res.Add(lr.Identifiable); - } - } - - // rename old Submodel - smOld.Id = newId; - - // seems fine - return res; - } - else - if (typeof(T) == typeof(AssetAdministrationShell)) - { - // check, if exist or not exist - var aasOld = environment.FindAasById(oldId); - if (aasOld == null || environment.FindAasById(newId) != null) - return null; - - // recurse? -> no? - - // rename old Asset - aasOld.Id = newId; - - // seems fine - return res; - } - else - //TODO (jtikekar, 0000-00-00): support asset - if (typeof(T) == typeof(AssetInformation)) - { - // check, if exist or not exist - var assetOld = environment.FindAasWithAssetInformation(oldId); - if (assetOld == null || environment.FindAasWithAssetInformation(newId) != null) - return null; - - // recurse all possible Referenes in the aas env - foreach (var lr in environment.FindAllReferences()) - { - var r = lr?.Reference; - if (r != null) - for (int i = 0; i < r.Keys.Count; i++) - if (r.Keys[i].Matches(KeyTypes.GlobalReference, oldId)) - { - // directly replace - r.Keys[i].Value = newId; - if (res.Contains(lr.Identifiable)) - res.Add(lr.Identifiable); - } - } - - // rename old Asset - assetOld.AssetInformation.GlobalAssetId = newId; - - // seems fine - return res; - } - - // no result is false, as well - return null; - } - - public static IAssetAdministrationShell FindAasWithAssetInformation(this AasCore.Aas3_0.Environment environment, string globalAssetId) - { - if (string.IsNullOrEmpty(globalAssetId)) - { - return null; - } - - foreach (var aas in environment.AssetAdministrationShells) - { - if (aas.AssetInformation.GlobalAssetId.Equals(globalAssetId)) - { - return aas; - } - } - - return null; - } - - public static ComparerIndexed CreateIndexedComparerCdsForSmUsage(this AasCore.Aas3_0.Environment environment) - { - var cmp = new ComparerIndexed(); - int nr = 0; - foreach (var sm in environment.FindAllSubmodelGroupedByAAS()) - foreach (var sme in sm.FindDeep()) - { - if (sme.SemanticId == null) - continue; - var cd = environment.FindConceptDescriptionByReference(sme.SemanticId); - if (cd == null) - continue; - if (cmp.Index.ContainsKey(cd)) - continue; - cmp.Index[cd] = nr++; - } - return cmp; - } - - public static ISubmodelElement CopySubmodelElementAndCD(this AasCore.Aas3_0.Environment environment, - AasCore.Aas3_0.Environment srcEnv, ISubmodelElement srcElem, bool copyCD = false, bool shallowCopy = false) - { - // access - if (srcEnv == null || srcElem == null) - return null; - - // 1st result pretty easy (calling function will add this to the appropriate Submodel) - var res = srcElem.Copy(); - - // copy the CDs.. - if (copyCD) - environment.CopyConceptDescriptionsFrom(srcEnv, srcElem, shallowCopy); - - // give back - return res; - } - - public static IReference CopySubmodelRefAndCD(this AasCore.Aas3_0.Environment environment, - AasCore.Aas3_0.Environment srcEnv, IReference srcSubRef, bool copySubmodel = false, bool copyCD = false, - bool shallowCopy = false) - { - // access - if (srcEnv == null || srcSubRef == null) - return null; - - // need to have the source Submodel - var srcSub = srcEnv.FindSubmodel(srcSubRef); - if (srcSub == null) - return null; - - // 1st result pretty easy (calling function will add this to the appropriate AAS) - var dstSubRef = srcSubRef.Copy(); - - // get the destination and shall src != dst - var dstSub = environment.FindSubmodel(dstSubRef); - if (srcSub == dstSub) - return null; - - // maybe we need the Submodel in our environment, as well - if (dstSub == null && copySubmodel) - { - dstSub = srcSub.Copy(); - environment.Submodels.Add(dstSub); - } - else - if (dstSub != null) - { - // there is already an submodel, just add members - if (!shallowCopy && srcSub.SubmodelElements != null) - { - if (dstSub.SubmodelElements == null) - dstSub.SubmodelElements = new List(); - foreach (var smw in srcSub.SubmodelElements) - dstSub.SubmodelElements.Add( - smw.Copy()); - } - } - - // copy the CDs.. - if (copyCD && srcSub.SubmodelElements != null) - foreach (var smw in srcSub.SubmodelElements) - environment.CopyConceptDescriptionsFrom(srcEnv, smw, shallowCopy); - - // give back - return dstSubRef; - } - - private static void CopyConceptDescriptionsFrom(this AasCore.Aas3_0.Environment environment, - AasCore.Aas3_0.Environment srcEnv, ISubmodelElement src, bool shallowCopy = false) - { - // access - if (srcEnv == null || src == null || src.SemanticId == null) - return; - - // check for this SubmodelElement in Source - var cdSrc = srcEnv.FindConceptDescriptionByReference(src.SemanticId); - if (cdSrc == null) - return; - - // check for this SubmodelElement in Destnation (this!) - var cdDest = environment.FindConceptDescriptionByReference(src.SemanticId); - if (cdDest == null) - { - // copy new - environment.ConceptDescriptions.Add(cdSrc.Copy()); - } - - // recurse? - if (!shallowCopy) - foreach (var m in src.EnumerateChildren()) - environment.CopyConceptDescriptionsFrom(srcEnv, m, shallowCopy: false); - - } - #endregion - - } - - - -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendFile.cs b/src/AasxCsharpLibrary/Extensions/ExtendFile.cs deleted file mode 100644 index d2fbf79b0..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendFile.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -namespace Extensions -{ - public static class ExtendFile - { - public static string ValueAsText(this File file) - { - return "" + file.Value; - } - - public static void Set(this File file, - string contentType = "", string value = "") - { - file.ContentType = contentType; - file.Value = value; - } - - public static File ConvertFromV10(this File file, AasxCompatibilityModels.AdminShellV10.File sourceFile) - { - file.ContentType = sourceFile.mimeType; - file.Value = sourceFile.value; - return file; - } - public static File ConvertFromV20(this File file, AasxCompatibilityModels.AdminShellV20.File sourceFile) - { - file.ContentType = sourceFile.mimeType; - file.Value = sourceFile.value; - return file; - } - - public static File UpdateFrom(this File elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is Property srcProp) - { - elem.Value = srcProp.Value; - } - - if (source is AasCore.Aas3_0.Range srcRng) - { - elem.Value = srcRng.Min; - } - - if (source is MultiLanguageProperty srcMlp) - { - elem.Value = "" + srcMlp.Value?.GetDefaultString(); - } - - if (source is File srcFile) - { - elem.Value = "" + srcFile.Value; - } - - return elem; - } - - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendHasDataSpecification.cs b/src/AasxCsharpLibrary/Extensions/ExtendHasDataSpecification.cs deleted file mode 100644 index ca440e3cb..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendHasDataSpecification.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -namespace Extensions -{ - public static class ExtendHasDataSpecification - { - public static IHasDataSpecification ConvertFromV20(this IHasDataSpecification embeddedDataSpecifications, AasxCompatibilityModels.AdminShellV20.HasDataSpecification sourceSpecification) - { - foreach (var sourceSpec in sourceSpecification) - { - var newEmbeddedSpec = new EmbeddedDataSpecification(null, null); - newEmbeddedSpec.ConvertFromV20(sourceSpec); - embeddedDataSpecifications.EmbeddedDataSpecifications.Add(newEmbeddedSpec); - } - - return embeddedDataSpecifications; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendIAdministrativeInformation.cs b/src/AasxCsharpLibrary/Extensions/ExtendIAdministrativeInformation.cs deleted file mode 100644 index bb5617a66..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendIAdministrativeInformation.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendIAdministrativeInformation - { - public static string ToStringExtended(this IAdministrativeInformation ls, int fmt) - { - if (fmt == 2) - return String.Format("/{0}/{1}", ls.Version, ls.Revision); - return String.Format("[ver={0}, rev={1}, tmpl={2}, crea={3}]", - ls.Version, ls.Revision, ls.TemplateId, ls.Creator?.ToStringExtended(fmt)); - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendIClass.cs b/src/AasxCsharpLibrary/Extensions/ExtendIClass.cs deleted file mode 100644 index 0db74f58a..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendIClass.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendIClass - { - // TODO (MIHO, 2023-05-28): liase with AAS core team to provide a general desrialization - /// - /// Deserializes a given objectType from its given JSON node representation. - /// Operates on a range of known AAS IClass subtypes (not all!!) - /// - /// Hint for IClass subtype - /// JSON representation - /// Null, if not a known IClass subtype - public static IClass IClassFrom(System.Type objectType, System.Text.Json.Nodes.JsonNode node) - { - if (typeof(IReference).IsAssignableFrom(objectType)) - return Jsonization.Deserialize.ReferenceFrom(node); - - if (typeof(IKey).IsAssignableFrom(objectType)) - return Jsonization.Deserialize.KeyFrom(node); - - if (typeof(IReferable).IsAssignableFrom(objectType)) - return Jsonization.Deserialize.IReferableFrom(node); - - if (typeof(IIdentifiable).IsAssignableFrom(objectType)) - return Jsonization.Deserialize.IIdentifiableFrom(node); - - return null; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendIDataSpecificationContent.cs b/src/AasxCsharpLibrary/Extensions/ExtendIDataSpecificationContent.cs deleted file mode 100644 index 8e76f302e..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendIDataSpecificationContent.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; -using System.Collections.Generic; - -namespace Extensions -{ - public static class ExtendIDataSpecificationContent - { - public enum ContentTypes { NoInfo, Iec61360, PhysicalUnit } - - public static Key GetKeyForIec61360() - { - return new Key(KeyTypes.GlobalReference, - "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0"); - } - - public static Reference GetReferencForIec61360() - { - return new Reference(ReferenceTypes.ExternalReference, new List { GetKeyForIec61360() }); - } - - public static Key GetKeyForPhysicalUnit() - { - return new Key(KeyTypes.GlobalReference, - "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0"); - } - - public static Key GetKeyFor(ContentTypes ct) - { - if (ct == ContentTypes.Iec61360) - return GetKeyForIec61360(); - if (ct == ContentTypes.PhysicalUnit) - return GetKeyForPhysicalUnit(); - return null; - } - - public static IDataSpecificationContent ContentFactoryFor(ContentTypes ct) - { - if (ct == ContentTypes.Iec61360) - return new DataSpecificationIec61360( - new List()); - //TODO (jtikekar, 0000-00-00): DataSpecificationPhysicalUnit -#if SupportDataSpecificationPhysicalUnit - if (ct == ContentTypes.PhysicalUnit) - return new DataSpecificationPhysicalUnit("", "", null); -#endif - return null; - } - - public static ContentTypes GuessContentTypeFor(IReference rf) - { - foreach (var v in AdminShellUtil.GetEnumValues(new[] { ContentTypes.NoInfo })) - if (rf?.MatchesExactlyOneKey(GetKeyFor(v)) == true) - return v; - return ContentTypes.NoInfo; - } - - public static ContentTypes GuessContentTypeFor(IDataSpecificationContent content) - { - if (content is DataSpecificationIec61360) - return ContentTypes.Iec61360; - //TODO (jtikekar, 0000-00-00): DataSpecificationPhysicalUnit -#if SupportDataSpecificationPhysicalUnit - if (content is DataSpecificationPhysicalUnit) - return ContentTypes.PhysicalUnit; -#endif - return ContentTypes.NoInfo; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendIIdentifiable.cs b/src/AasxCsharpLibrary/Extensions/ExtendIIdentifiable.cs deleted file mode 100644 index 97aa254c9..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendIIdentifiable.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendIIdentifiable - { - #region List of Identifiers - - public static string ToStringExtended(this List identifiables, string delimiter = ",") - { - return string.Join(delimiter, identifiables.Select((x) => x.Id)); - } - - #endregion - public static IReference GetReference(this IIdentifiable identifiable) - { - var key = new Key(ExtensionsUtil.GetKeyType(identifiable), identifiable.Id); - //TODO (jtikekar, 0000-00-00): if model or Global reference? - var outputReference = new Reference(ReferenceTypes.ModelReference, new List() { key }); - - return outputReference; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendILangStringDefinitionTypeIec61360.cs b/src/AasxCsharpLibrary/Extensions/ExtendILangStringDefinitionTypeIec61360.cs deleted file mode 100644 index 46062fade..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendILangStringDefinitionTypeIec61360.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; -using System.Collections.Generic; - -namespace Extensions -{ - public static class ExtendILangStringDefinitionTypeIec61360 - { - public static List CreateLangStringDefinitionType(string language, string text) - { - return new List { new LangStringDefinitionTypeIec61360(language, text) }; - } - public static string GetDefaultString(this List langStringSet, string defaultLang = null) - { - // start - if (defaultLang == null) - defaultLang = "en"; //Default Lang in old implementation is en - - string res = null; - - // search - foreach (var langString in langStringSet) - if (langString.Language.Equals(defaultLang, StringComparison.OrdinalIgnoreCase)) - res = langString.Text; - - if (res == null && langStringSet.Count > 0) - res = langStringSet[0].Text; - - // found? - return res; - } - public static List ConvertFromV20( - this List lss, - AasxCompatibilityModels.AdminShellV20.LangStringSetIEC61360 src) - { - lss = new List(); - if (src != null && src.Count != 0) - { - foreach (var sourceLangString in src) - { - //Remove ? in the end added by AdminShellV20, to avoid verification error - string lang = sourceLangString.lang; - if (!string.IsNullOrEmpty(sourceLangString.lang) && sourceLangString.lang.EndsWith("?")) - { - lang = sourceLangString.lang.Remove(sourceLangString.lang.Length - 1); - } - var langString = new LangStringDefinitionTypeIec61360(lang, sourceLangString.str); - lss.Add(langString); - } - } - else - { - //set default preferred name - lss.Add(new LangStringDefinitionTypeIec61360("en", "")); - } - return lss; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendILangStringNameType.cs b/src/AasxCsharpLibrary/Extensions/ExtendILangStringNameType.cs deleted file mode 100644 index e222b5c20..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendILangStringNameType.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendILangStringNameType - { - public static string ToStringExtended(this ILangStringNameType ls, int fmt) - { - if (fmt == 2) - return String.Format("{0}@{1}", ls.Text, ls.Language); - return String.Format("[{0},{1}]", ls.Language, ls.Text); - } - - public static string ToStringExtended(this List elems, - int format = 1, string delimiter = ",") - { - return string.Join(delimiter, elems.Select((k) => k.ToStringExtended(format))); - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendILangStringPreferredNameTypeIec61360.cs b/src/AasxCsharpLibrary/Extensions/ExtendILangStringPreferredNameTypeIec61360.cs deleted file mode 100644 index abff939d3..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendILangStringPreferredNameTypeIec61360.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; -using System.Collections.Generic; - -namespace Extensions -{ - public static class ExtendILangStringPreferredNameTypeIec61360 - { - public static List CreateLangStringPreferredNameType(string language, string text) - { - return new List { new LangStringPreferredNameTypeIec61360(language, text) }; - } - - public static string GetDefaultString(this List langStringSet, string defaultLang = null) - { - return ExtendLangString.GetDefaultStringGen(langStringSet, defaultLang); - // dead-csharp off - //// start - //if (defaultLang == null) - // defaultLang = "en"; //Default Lang in old implementation is en - - //string res = null; - - //// search - //foreach (var langString in langStringSet) - // if (langString.Language.Equals(defaultLang, StringComparison.OrdinalIgnoreCase)) - // res = langString.Text; - - //if (res == null && langStringSet.Count > 0) - // res = langStringSet[0].Text; - - //// found? - //return res; - // dead-csharp on - } - - public static List ConvertFromV20( - this List lss, - AasxCompatibilityModels.AdminShellV20.LangStringSetIEC61360 src) - { - lss = new List(); - if (src != null && src.Count != 0) - { - foreach (var sourceLangString in src) - { - //Remove ? in the end added by AdminShellV20, to avoid verification error - string lang = sourceLangString.lang; - if (!string.IsNullOrEmpty(sourceLangString.lang) && sourceLangString.lang.EndsWith("?")) - { - lang = sourceLangString.lang.Remove(sourceLangString.lang.Length - 1); - } - var langString = new LangStringPreferredNameTypeIec61360(lang, sourceLangString.str); - lss.Add(langString); - } - } - else - { - //set default preferred name - lss.Add(new LangStringPreferredNameTypeIec61360("en", "")); - } - return lss; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendILangStringShortNameTypeIec61360.cs b/src/AasxCsharpLibrary/Extensions/ExtendILangStringShortNameTypeIec61360.cs deleted file mode 100644 index 8cdb0e3e3..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendILangStringShortNameTypeIec61360.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; -using System.Collections.Generic; - -namespace Extensions -{ - public static class ExtendILangStringShortNameTypeIec61360 - { - public static List CreateLangStringShortNameType(string language, string text) - { - return new List { new LangStringShortNameTypeIec61360(language, text) }; - } - - public static string GetDefaultString(this List langStringSet, string defaultLang = null) - { - return ExtendLangString.GetDefaultStringGen(langStringSet, defaultLang); - // dead-csharp off - //// start - //if (defaultLang == null) - // defaultLang = "en"; //Default Lang in old implementation is en - - //string res = null; - - //// search - //foreach (var langString in langStringSet) - // if (langString.Language.Equals(defaultLang, StringComparison.OrdinalIgnoreCase)) - // res = langString.Text; - - //if (res == null && langStringSet.Count > 0) - // res = langStringSet[0].Text; - - //// found? - //return res; - // dead-csharp on - } - - public static List ConvertFromV20( - this List lss, - AasxCompatibilityModels.AdminShellV20.LangStringSetIEC61360 src) - { - lss = new List(); - if (src != null && src.Count != 0) - { - foreach (var sourceLangString in src) - { - //Remove ? in the end added by AdminShellV20, to avoid verification error - string lang = sourceLangString.lang; - if (!string.IsNullOrEmpty(sourceLangString.lang) && sourceLangString.lang.EndsWith("?")) - { - lang = sourceLangString.lang.Remove(sourceLangString.lang.Length - 1); - } - var langString = new LangStringShortNameTypeIec61360(lang, sourceLangString.str); - lss.Add(langString); - } - } - else - { - //set default preferred name - lss.Add(new LangStringShortNameTypeIec61360("en", "")); - } - return lss; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendILangStringTextType.cs b/src/AasxCsharpLibrary/Extensions/ExtendILangStringTextType.cs deleted file mode 100644 index bb5dfd3eb..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendILangStringTextType.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendILangStringTextType - { - public static string GetDefaultString(this List langStringSet, string defaultLang = null) - { - return ExtendLangString.GetDefaultStringGen(langStringSet, defaultLang); - } - - public static string ToStringExtended(this ILangStringTextType ls, int fmt) - { - if (fmt == 2) - return String.Format("{0}@{1}", ls.Text, ls.Language); - return String.Format("[{0},{1}]", ls.Language, ls.Text); - } - - public static string ToStringExtended(this List elems, - int format = 1, string delimiter = ",") - { - return string.Join(delimiter, elems.Select((k) => k.ToStringExtended(format))); - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendIReferable.cs b/src/AasxCsharpLibrary/Extensions/ExtendIReferable.cs deleted file mode 100644 index 1c0e0597b..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendIReferable.cs +++ /dev/null @@ -1,624 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendIReferable - { - #region AasxPackageExplorer - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. Include this element, as well. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// Include this element as well. parents will then - /// include this element as well! - public static void RecurseOnReferables(this IReferable referable, - object state, Func, IReferable, bool> lambda, - bool includeThis = false) - { - // TODO (MIHO, 2023-07-28): not all elements are covered - if (referable is Submodel submodel) - { - submodel.RecurseOnReferables(state, lambda, includeThis); - } - else if (referable is SubmodelElementCollection submodelElementCollection) - { - submodelElementCollection.RecurseOnReferables(state, lambda, includeThis); - } - else if (referable is SubmodelElementList submodelElementList) - { - submodelElementList.RecurseOnReferables(state, lambda, includeThis); - } - else if (includeThis) - lambda(state, null, referable); - } - - public static void Remove(this IReferable referable, ISubmodelElement submodelElement) - { - if (referable is Submodel submodel) - { - submodel.Remove(submodelElement); - } - else if (referable is AnnotatedRelationshipElement annotatedRelationshipElement) - { - annotatedRelationshipElement.Remove(submodelElement); - } - else if (referable is SubmodelElementCollection submodelElementCollection) - { - submodelElementCollection.Remove(submodelElement); - } - else if (referable is SubmodelElementList submodelElementList) - { - submodelElementList.Remove(submodelElement); - } - else if (referable is Entity entity) - { - entity.Remove(submodelElement); - } - } - - public static void Add(this IReferable referable, ISubmodelElement submodelElement) - { - if (referable is Submodel submodel) - { - submodel.Add(submodelElement); - } - else if (referable is AnnotatedRelationshipElement annotatedRelationshipElement) - { - annotatedRelationshipElement.Add(submodelElement); - } - else if (referable is SubmodelElementCollection submodelElementCollection) - { - submodelElementCollection.Add(submodelElement); - } - else if (referable is SubmodelElementList submodelElementList) - { - submodelElementList.Add(submodelElement); - } - else if (referable is Entity entity) - { - entity.Add(submodelElement); - } - } - - #region Display - - public static EnumerationPlacmentBase GetChildrenPlacement(this IReferable referable, ISubmodelElement submodelElement) - { - if (referable is Operation operation) - { - return operation.GetChildrenPlacement(submodelElement); - } - - return null; - } - - #endregion - - public static IIdentifiable FindParentFirstIdentifiable(this IReferable referable) - { - IReferable curr = referable; - while (curr != null) - { - if (curr is IIdentifiable curri) - return curri; - curr = curr.Parent as IReferable; - } - return null; - } - - #endregion - - #region ListOfReferables - public static Reference GetReference(this List referables) - { - return new Reference(ReferenceTypes.ExternalReference, referables.ToKeyList()); - } - - public static List ToKeyList(this List referables) - { - var res = new List(); - foreach (var rf in referables) - res.Add(new Key(rf.GetSelfDescription()?.KeyType ?? KeyTypes.GlobalReference, rf.IdShort)); - return res; - } - #endregion - - public static string ToIdShortString(this IReferable rf) - { - if (rf.IdShort == null || rf.IdShort.Trim().Length < 1) - return (""); - return rf.IdShort.Trim(); - } - - public static IReference GetReference(this IReferable referable) - { - if (referable is IIdentifiable identifiable) - { - return identifiable.GetReference(); - } - else if (referable is ISubmodelElement submodelElement) - { - return submodelElement.GetModelReference(); - } - else - return null; - } - - public static void Validate(this IReferable referable, AasValidationRecordList results) - { - referable.BaseValidation(results); - - if (referable is ConceptDescription conceptDescription) - { - conceptDescription.Validate(results); - } - else if (referable is Submodel submodel) - { - submodel.Validate(results); - } - else if (referable is ISubmodelElement submodelElement) - { - // No further validation for SME - } - } - - public static void BaseValidation(this IReferable referable, AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check - if (string.IsNullOrEmpty(referable.IdShort)) - results.Add(new AasValidationRecord( - AasValidationSeverity.SpecViolation, referable, - "Referable: missing idShort", - () => - { - referable.IdShort = "TO_FIX"; - })); - - if (referable.Description != null && (referable.Description.Count < 1)) - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, referable, - "Referable: existing description with missing langString", - () => - { - referable.Description = null; - })); - } - - /// - /// Tells, if the IReferable is used with an index instead of idShort. - /// - public static bool IsIndexed(this IReferable rf) - { - return rf is SubmodelElementList; - } - - public static AasElementSelfDescription GetSelfDescription(this IReferable referable) - { - if (referable is AssetAdministrationShell) - { - return new AasElementSelfDescription("AssetAdministrationShell", "AAS", - KeyTypes.AssetAdministrationShell, null); - } - else if (referable is ConceptDescription) - { - return new AasElementSelfDescription("ConceptDescription", "CD", - KeyTypes.ConceptDescription, null); - } - else if (referable is Submodel) - { - return new AasElementSelfDescription("Submodel", "SM", - KeyTypes.Submodel, null); - } - else if (referable is Property) - { - return new AasElementSelfDescription("Property", "Prop", - KeyTypes.Property, AasSubmodelElements.Property); - } - else if (referable is MultiLanguageProperty) - { - return new AasElementSelfDescription("MultiLanguageProperty", "MLP", - KeyTypes.MultiLanguageProperty, AasSubmodelElements.MultiLanguageProperty); - } - else if (referable is AasCore.Aas3_0.Range) - { - return new AasElementSelfDescription("Range", "Range", - KeyTypes.Range, AasSubmodelElements.Range); - } - else if (referable is Blob) - { - return new AasElementSelfDescription("Blob", "Blob", - KeyTypes.Blob, AasSubmodelElements.Blob); - } - else if (referable is AasCore.Aas3_0.File) - { - return new AasElementSelfDescription("File", "File", - KeyTypes.File, AasSubmodelElements.File); - } - else if (referable is ReferenceElement) - { - return new AasElementSelfDescription("ReferenceElement", "Ref", - KeyTypes.ReferenceElement, AasSubmodelElements.ReferenceElement); - } - else if (referable is RelationshipElement) - { - return new AasElementSelfDescription("RelationshipElement", "Rel", - KeyTypes.RelationshipElement, AasSubmodelElements.RelationshipElement); - } - else if (referable is AnnotatedRelationshipElement) - { - return new AasElementSelfDescription("AnnotatedRelationshipElement", "RelA", - KeyTypes.AnnotatedRelationshipElement, AasSubmodelElements.AnnotatedRelationshipElement); - } - else if (referable is Capability) - { - return new AasElementSelfDescription("Capability", "Cap", - KeyTypes.Capability, AasSubmodelElements.Capability); - } - else if (referable is SubmodelElementCollection) - { - return new AasElementSelfDescription("SubmodelElementCollection", "SMC", - KeyTypes.SubmodelElementCollection, AasSubmodelElements.SubmodelElementCollection); - } - else if (referable is SubmodelElementList) - { - return new AasElementSelfDescription("SubmodelElementList", "SML", - KeyTypes.SubmodelElementList, AasSubmodelElements.SubmodelElementList); - } - else if (referable is Operation) - { - return new AasElementSelfDescription("Operation", "Opr", - KeyTypes.Operation, AasSubmodelElements.Operation); - } - else if (referable is Entity) - { - return new AasElementSelfDescription("Entity", "Ent", - KeyTypes.Entity, AasSubmodelElements.Entity); - } - else if (referable is BasicEventElement) - { - return new AasElementSelfDescription("BasicEventElement", "Evt", - - KeyTypes.BasicEventElement, AasSubmodelElements.BasicEventElement); - } - else if (referable is IDataElement) - { - return new AasElementSelfDescription("DataElement", "DE", - KeyTypes.DataElement, AasSubmodelElements.DataElement); - } - else if (referable is ISubmodelElement) - { - return new AasElementSelfDescription("SubmodelElement", "SME", - KeyTypes.SubmodelElement, AasSubmodelElements.SubmodelElement); - } - else - { - return new AasElementSelfDescription("Referable", "Ref", - KeyTypes.Referable, null); - } - } - public static void CollectReferencesByParent(this IReferable referable, List refs) - { - // access - if (refs == null) - return; - - // check, if this is identifiable - if (referable is IIdentifiable) - { - var idf = referable as IIdentifiable; - if (idf != null) - { - - var key = new Key((KeyTypes)Stringification.KeyTypesFromString(idf.GetType().Name), idf.Id); - refs.Insert(0, key); - } - } - else - { - var key = new Key((KeyTypes)Stringification.KeyTypesFromString(referable.GetType().Name), referable.IdShort); - refs.Insert(0, key); - // recurse upwards! - if (referable.Parent is IReferable prf) - prf.CollectReferencesByParent(refs); - } - } - public static void SetTimeStamp(this IReferable referable, DateTime timeStamp) - { - IReferable newReferable = referable; - do - { - newReferable.TimeStamp = timeStamp; - if (newReferable != newReferable.Parent) - { - newReferable = (IReferable)newReferable.Parent; - } - else - newReferable = null; - } - while (newReferable != null); - } - - public static bool EnumeratesChildren(this ISubmodelElement elem) - { - var num = elem.EnumerateChildren().Count(); - return (num > 0); - } - - public static IEnumerable EnumerateChildren(this IReferable rf) - { - // the code below was done by Jui - // MIHO: I think, we should now use the methods of AAS core - - if (rf == null) - yield break; - - foreach (var desc in rf.DescendOnce()) - if (desc is ISubmodelElement sme) - yield return sme; - -#if __old - if (referable is Submodel submodel && submodel.SubmodelElements != null) - { - if (submodel.SubmodelElements != null) - { - foreach (var submodelElement in submodel.SubmodelElements) - { - yield return submodelElement; - } - } - } - else if (referable is SubmodelElementCollection submodelElementCollection) - { - if (submodelElementCollection.Value != null) - { - foreach (var submodelElement in submodelElementCollection.Value) - { - yield return submodelElement; - } - } - } - else if (referable is SubmodelElementList submodelElementList) - { - if (submodelElementList.Value != null) - { - foreach (var submodelElement in submodelElementList.Value) - { - yield return submodelElement; - } - } - } - else if (referable is AnnotatedRelationshipElement annotatedRelationshipElement) - { - if (annotatedRelationshipElement.Annotations != null) - { - foreach (var submodelElement in annotatedRelationshipElement.Annotations) - { - yield return submodelElement; - } - } - } - else if (referable is Entity entity) - { - if (entity.Statements != null) - { - foreach (var submodelElement in entity.Statements) - { - yield return submodelElement; - } - } - } - else if (referable is Operation operation) - { - if (operation.InputVariables != null) - foreach (var inputVariable in operation.InputVariables) - { - yield return inputVariable.Value; - } - - if (operation.OutputVariables != null) - foreach (var outputVariable in operation.OutputVariables) - { - yield return outputVariable.Value; - } - - if (operation.InoutputVariables != null) - foreach (var inOutVariable in operation.InoutputVariables) - { - yield return inOutVariable.Value; - } - } - else - { - yield break; - } -#endif - } - - - public static void SetAllParentsAndTimestamps(this IReferable referable, IReferable parent, DateTime timeStamp, DateTime timeStampCreate) - { - if (parent == null) - return; - - referable.Parent = parent; - referable.TimeStamp = timeStamp; - referable.TimeStampCreate = timeStampCreate; - - foreach (var submodelElement in referable.EnumerateChildren()) - { - submodelElement.SetAllParentsAndTimestamps(referable, timeStamp, timeStampCreate); - } - } - - public static Submodel GetParentSubmodel(this IReferable referable) - { - IReferable parent = referable; - while (parent is not Submodel && parent != null) - parent = (IReferable)parent.Parent; - return parent as Submodel; - } - - public static string CollectIdShortByParent(this IReferable referable) - { - // recurse first - var head = ""; - if (referable is not IIdentifiable && referable.Parent is IReferable parentReferable) - // can go up - head = parentReferable.CollectIdShortByParent() + "/"; - // add own - var myid = ""; - if (!string.IsNullOrEmpty(referable.IdShort)) - myid = referable.IdShort.Trim(); - // together - return head + myid; - } - - public static void AddDescription(this IReferable referable, string language, string Text) - { - if (referable.Description == null) - referable.Description = new List(); - referable.Description.Add(new LangStringTextType(language, Text)); - } - - public static List ListOfIReferableFrom( - System.Text.Json.Nodes.JsonNode node) - { - var res = new List(); - if (node == null) - return res; - var array = node.AsArray(); - foreach (var it in array) - { - var ir = Jsonization.Deserialize.IReferableFrom(it); - res.Add(ir); - } - return res; - } - - public static Key ToKey(this IReferable rf) - { - var sd = rf.GetSelfDescription(); - if (sd == null || !sd.KeyType.HasValue) - return null; - if (rf is IIdentifiable rfi) - return new Key(sd.KeyType.Value, rfi.Id); - return new Key(sd.KeyType.Value, rf.IdShort); - } - - public static System.Text.Json.Nodes.JsonNode ToJsonObject(List classes) - { - var jar = new System.Text.Json.Nodes.JsonArray(); - if (classes != null) - foreach (var c in classes) - jar.Add(Jsonization.Serialize.ToJsonObject(c)); - return jar; - } - - public static IEnumerable FindAllQualifierType(this IReferable rf, string qualifierType) - { - if (!(rf is IQualifiable rfq) || rfq.Qualifiers == null || qualifierType == null) - yield break; - foreach (var q in rfq.Qualifiers) - if (q.Type.Trim().ToLower() == qualifierType.Trim().ToLower()) - yield return q; - } - - public static IQualifier HasQualifierOfType(this IReferable rf, string qualifierType) - { - if (!(rf is IQualifiable rfq) || rfq.Qualifiers == null) - return null; - foreach (var q in rfq.Qualifiers) - if (q.Type?.Trim().ToLower() == qualifierType?.Trim().ToLower()) - return q; - return null; - } - - public static Qualifier Add(this IReferable rf, Qualifier q) - { - if (!(rf is IQualifiable rfq)) - return null; - if (rfq.Qualifiers == null) - rfq.Qualifiers = new List(); - rfq.Qualifiers.Add(q); - return q; - } - - public static IEnumerable FindAllExtensionName(this IReferable rf, string extensionName) - { - if (!(rf is IHasExtensions rfe) || rfe.Extensions == null) - yield break; - foreach (var e in rfe.Extensions) - if (e.Name?.Trim().ToLower() == extensionName?.Trim().ToLower()) - yield return e; - } - - - public static IExtension HasExtensionOfName(this IReferable rf, string extensionName) - { - if (!(rf is IHasExtensions rfe) || rfe.Extensions == null) - return null; - foreach (var e in rfe.Extensions) - if (e.Name?.Trim().ToLower() == extensionName?.Trim().ToLower()) - return e; - return null; - } - - public static Extension Add(this IReferable rf, Extension ext) - { - if (rf.Extensions == null) - rf.Extensions = new List(); - rf.Extensions.Add(ext); - return ext; - } - - public static void MigrateV20QualifiersToExtensions(this IReferable rf) - { - // access - if (!(rf is IQualifiable iq) || iq.Qualifiers == null || !(rf is IHasExtensions ihe)) - return; - - // Qualifiers to migrate - var toMigrate = new[] { - "Animate.Args", "Plotting.Args", "TimeSeries.Args", "BOM.Args", "ImageMap.Args" - }; - - List toMove = new List(); - foreach (var q in iq.Qualifiers) - foreach (var tm in toMigrate) - if (q?.Type?.Equals(tm, StringComparison.InvariantCultureIgnoreCase) == true) - toMove.Add(q); - - // now move these - for (int i = 0; i < toMove.Count; i++) - { - var q = toMove[i]; - var ext = new Extension( - name: q.Type, semanticId: q.SemanticId, - valueType: q.ValueType, value: q.Value); - rf.Add(ext); - iq.Qualifiers.Remove(q); - } - } - - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendISubmodelElement.cs b/src/AasxCsharpLibrary/Extensions/ExtendISubmodelElement.cs deleted file mode 100644 index 1d8e9fa37..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendISubmodelElement.cs +++ /dev/null @@ -1,1551 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AasxCompatibilityModels; -using AdminShellNS; -using AdminShellNS.Extensions; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendISubmodelElement - { - // constants - public static Type[] PROP_MLP = new Type[] { - typeof(MultiLanguageProperty), typeof(Property) }; - - #region AasxPackageExplorer - - public static List Copy(this List original) - { - var res = new List(); - if (original != null) - foreach (var o in original) - res.Add(o.Copy()); - return res; - } - - public static object AddChild(this ISubmodelElement submodelElement, ISubmodelElement childSubmodelElement, EnumerationPlacmentBase placement = null) - { - if (submodelElement is AnnotatedRelationshipElement annotatedRelationshipElement) - { - return annotatedRelationshipElement.AddChild(childSubmodelElement, placement); - } - else if (submodelElement is SubmodelElementCollection submodelElementCollection) - { - return submodelElementCollection.AddChild(childSubmodelElement, placement); - } - else if (submodelElement is SubmodelElementList submodelElementList) - { - return submodelElementList.AddChild(childSubmodelElement, placement); - } - else if (submodelElement is Operation operation) - { - return operation.AddChild(childSubmodelElement, placement); - } - else if (submodelElement is Entity entity) - { - return entity.AddChild(childSubmodelElement, placement); - } - else - return childSubmodelElement; - } - - public static List GetChildsAsList(this ISubmodelElement sme) - { - return sme.DescendOnce().Where((x) => x is ISubmodelElement).Cast().ToList(); - } - - public static Tuple ToCaptionInfo(this ISubmodelElement submodelElement) - { - var caption = AdminShellUtil.EvalToNonNullString("\"{0}\" ", submodelElement.IdShort, ""); - var info = ""; - // TODO (MIHO, 2021-07-08): obvious error .. info should receive semanticId .. but would change - // display presentation .. therefore to be checked again - if (submodelElement.SemanticId != null) - AdminShellUtil.EvalToNonEmptyString("\u21e8 {0}", submodelElement.SemanticId.ToStringExtended(), ""); - return Tuple.Create(caption, info); - } - - public static void ValueFromText(this ISubmodelElement submodelElement, string text, string defaultLang = null) - { - switch (submodelElement) - { - case Property property: - { - property.ValueFromText(text); - break; - } - case MultiLanguageProperty multiLanguageProperty: - { - multiLanguageProperty.ValueFromText(text, defaultLang); - break; - } - default: - { - throw new Exception("Unhandled submodel element type"); - } - } - } - - #endregion - public static IEnumerable FindAllParents(this ISubmodelElement submodelElement, - Predicate p, - bool includeThis = false, bool includeSubmodel = false, - bool passOverMiss = false) - { - // call for this? - if (includeThis) - { - if (p == null || p.Invoke(submodelElement)) - yield return submodelElement; - else - if (!passOverMiss) - yield break; - } - - // daisy chain all parents .. - if (submodelElement.Parent != null) - { - if (submodelElement.Parent is ISubmodelElement psme) - { - foreach (var q in psme.FindAllParents(p, includeThis: true, - passOverMiss: passOverMiss)) - yield return q; - } - else if (includeSubmodel && submodelElement.Parent is Submodel psm) - { - if (p == null || p.Invoke(psm)) - yield return submodelElement; - } - } - } - - public static IEnumerable FindAllParentsWithSemanticId( - this ISubmodelElement submodelElement, IReference semId, - bool includeThis = false, bool includeSubmodel = false, bool passOverMiss = false) - { - return (FindAllParents(submodelElement, - (rf) => (true == (rf as IHasSemantics)?.SemanticId?.Matches(semId, - matchMode: MatchMode.Relaxed)), - includeThis: includeThis, includeSubmodel: includeSubmodel, passOverMiss: passOverMiss)); - } - - public static string ValueAsText(this ISubmodelElement submodelElement, string defaultLang = null) - { - //TODO (??, 0000-00-00): Need to check/test this logic again - if (submodelElement is Property property) - { - return property.ValueAsText(); - } - - if (submodelElement is MultiLanguageProperty multiLanguageProperty) - { - return multiLanguageProperty.ValueAsText(defaultLang); - } - - if (submodelElement is AasCore.Aas3_0.Range range) - { - return range.ValueAsText(); - } - - if (submodelElement is File file) - { - return file.ValueAsText(); - } - - return ""; - } - - public static IQualifier FindQualifierOfType(this ISubmodelElement submodelElement, string qualifierType) - { - if (submodelElement.Qualifiers == null || submodelElement.Qualifiers.Count == 0) - { - return null; - } - - foreach (var qualifier in submodelElement.Qualifiers) - { - if (qualifier.Type.Equals(qualifierType, StringComparison.OrdinalIgnoreCase)) - { - return qualifier; - } - } - - return null; - - } - - public static IReference GetModelReference(this ISubmodelElement sme, bool includeParents = true) - { - // this will be the tail of our chain - var keyList = new List(); - var keyType = ExtensionsUtil.GetKeyType(sme); - var key = new Key(keyType, sme.IdShort); - keyList.Add(key); - - // keys for Parents will be INSERTED in front, iteratively - var currentParent = sme.Parent; - while (includeParents && currentParent != null) - { - if (currentParent is IIdentifiable identifiable) - { - var currentParentKey = new Key(ExtensionsUtil.GetKeyType(identifiable), identifiable.Id); - keyList.Insert(0, currentParentKey); - currentParent = null; - } - else if (currentParent is IReferable referable) - { - var currentParentKey = new Key(ExtensionsUtil.GetKeyType(referable), referable.IdShort); - keyList.Insert(0, currentParentKey); - currentParent = referable.Parent; - } - - } - - var outputReference = new Reference(ReferenceTypes.ModelReference, keyList); - outputReference.ReferredSemanticId = sme.SemanticId; - return outputReference; - } - - public static IEnumerable FindDeep(this ISubmodelElement submodelElement) - { - if (submodelElement is T) - { - yield return (T)submodelElement; - } - - foreach (var x in submodelElement.Descend().OfType()) - yield return x; - } - - public static ISubmodelElement ConvertFromV10(this ISubmodelElement submodelElement, AdminShellV10.SubmodelElement sourceSubmodelElement, bool shallowCopy = false) - { - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelElement != null) - { - if (sourceSubmodelElement is AdminShellV10.SubmodelElementCollection collection) - { - var newSmeCollection = new SubmodelElementCollection(); - outputSubmodelElement = newSmeCollection.ConvertFromV10(collection, shallowCopy); - } - else if (sourceSubmodelElement is AdminShellV10.Property sourceProperty) - { - var newProperty = new Property(DataTypeDefXsd.String); - outputSubmodelElement = newProperty.ConvertFromV10(sourceProperty); - } - else if (sourceSubmodelElement is AdminShellV10.File sourceFile) - { - var newFile = new File(""); - outputSubmodelElement = newFile.ConvertFromV10(sourceFile); - } - else if (sourceSubmodelElement is AdminShellV10.Blob blob) - { - var newBlob = new Blob(""); - outputSubmodelElement = newBlob.ConvertFromV10(blob); - } - else if (sourceSubmodelElement is AdminShellV10.ReferenceElement sourceReferenceElement) - { - outputSubmodelElement = new ReferenceElement(); - } - else if (sourceSubmodelElement is AdminShellV10.RelationshipElement sourceRelationshipElement) - { - var newFirst = ExtensionsUtil.ConvertReferenceFromV10(sourceRelationshipElement.first, ReferenceTypes.ModelReference); - var newSecond = ExtensionsUtil.ConvertReferenceFromV10(sourceRelationshipElement.second, ReferenceTypes.ModelReference); - outputSubmodelElement = new RelationshipElement(newFirst, newSecond); - } - else if (sourceSubmodelElement is AdminShellV10.Operation sourceOperation) - { - var newInputVariables = new List(); - var newOutputVariables = new List(); - if (!sourceOperation.valueIn.IsNullOrEmpty()) - { - - foreach (var inputVariable in sourceOperation.valueIn) - { - if (inputVariable.value.submodelElement != null) - { - ISubmodelElement newSubmodelElement = null; - newSubmodelElement = newSubmodelElement.ConvertFromV10(inputVariable.value.submodelElement); - var newOpVariable = new OperationVariable(newSubmodelElement); - newInputVariables.Add(newOpVariable); - } - } - } - - if (!sourceOperation.valueOut.IsNullOrEmpty()) - { - foreach (var outputVariable in sourceOperation.valueOut) - { - if (outputVariable.value.submodelElement != null) - { - ISubmodelElement newSubmodelElement = null; - newSubmodelElement = newSubmodelElement.ConvertFromV10(outputVariable.value.submodelElement); - var newOpVariable = new OperationVariable(newSubmodelElement); - newOutputVariables.Add(newOpVariable); - } - } - } - - outputSubmodelElement = new Operation(inputVariables: newInputVariables, outputVariables: newOutputVariables); - } - - if (outputSubmodelElement != null) - { - outputSubmodelElement.BasicConversionFromV10(sourceSubmodelElement); - } - } - - return outputSubmodelElement; - } - - private static void BasicConversionFromV10(this ISubmodelElement submodelElement, AdminShellV10.SubmodelElement sourceSubmodelElement) - { - if (!string.IsNullOrEmpty(sourceSubmodelElement.idShort)) - { - submodelElement.IdShort = sourceSubmodelElement.idShort; - } - - if (!string.IsNullOrEmpty(sourceSubmodelElement.category)) - { - submodelElement.Category = sourceSubmodelElement.category; - } - - if (sourceSubmodelElement.description != null) - { - submodelElement.Description = ExtensionsUtil.ConvertDescriptionFromV10(sourceSubmodelElement.description); - } - - if (sourceSubmodelElement.semanticId != null && !sourceSubmodelElement.semanticId.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in sourceSubmodelElement.semanticId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - submodelElement.SemanticId = new Reference(ReferenceTypes.ExternalReference, keyList); - } - - if (sourceSubmodelElement.kind != null) - { - //SubmodelElement does not have kind anymore - } - - if (!sourceSubmodelElement.qualifiers.IsNullOrEmpty()) - { - if (submodelElement.Qualifiers == null && submodelElement.Qualifiers.Count != 0) - { - submodelElement.Qualifiers = new List(); - } - - foreach (var sourceQualifier in sourceSubmodelElement.qualifiers) - { - var newQualifier = new Qualifier("", DataTypeDefXsd.String); - newQualifier = newQualifier.ConvertFromV10(sourceQualifier); - submodelElement.Qualifiers.Add(newQualifier); - } - } - - if (sourceSubmodelElement.hasDataSpecification != null && !sourceSubmodelElement.hasDataSpecification.reference.IsNullOrEmpty()) - { - //TODO (jtikekar, 0000-00-00): EmbeddedDataSpecification?? (as per old implementation) - submodelElement.EmbeddedDataSpecifications ??= new List(); - foreach (var dataSpecification in sourceSubmodelElement.hasDataSpecification.reference) - { - if (!dataSpecification.IsEmpty) - { - submodelElement.EmbeddedDataSpecifications.Add( - new EmbeddedDataSpecification( - ExtensionsUtil.ConvertReferenceFromV10(dataSpecification, ReferenceTypes.ExternalReference), - null)); - } - } - } - } - - public static ISubmodelElement ConvertFromV20(this ISubmodelElement submodelElement, AdminShellV20.SubmodelElement sourceSubmodelElement, bool shallowCopy = false) - { - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelElement != null) - { - if (sourceSubmodelElement is AdminShellV20.SubmodelElementCollection collection) - { - var newSmeCollection = new SubmodelElementCollection(); - outputSubmodelElement = newSmeCollection.ConvertFromV20(collection, shallowCopy); - } - else if (sourceSubmodelElement is AdminShellV20.Property sourceProperty) - { - var newProperty = new Property(DataTypeDefXsd.String); - outputSubmodelElement = newProperty.ConvertFromV20(sourceProperty); - } - else if (sourceSubmodelElement is AdminShellV20.MultiLanguageProperty sourceMultiLangProp) - { - var newMultiLangProperty = new MultiLanguageProperty(); - outputSubmodelElement = newMultiLangProperty.ConvertFromV20(sourceMultiLangProp); - } - else if (sourceSubmodelElement is AdminShellV20.Range sourceRange) - { - var newRange = new AasCore.Aas3_0.Range(DataTypeDefXsd.String); - outputSubmodelElement = newRange.ConvertFromV20(sourceRange); - } - else if (sourceSubmodelElement is AdminShellV20.File sourceFile) - { - var newFile = new File(""); - outputSubmodelElement = newFile.ConvertFromV20(sourceFile); - } - else if (sourceSubmodelElement is AdminShellV20.Blob blob) - { - var newBlob = new Blob(""); - outputSubmodelElement = newBlob.ConvertFromV20(blob); - } - else if (sourceSubmodelElement is AdminShellV20.ReferenceElement sourceReferenceElement) - { - var newReference = ExtensionsUtil.ConvertReferenceFromV20(sourceReferenceElement.value, ReferenceTypes.ModelReference); - outputSubmodelElement = new ReferenceElement(value: newReference); - } - else if (sourceSubmodelElement is AdminShellV20.AnnotatedRelationshipElement sourceAnnotedRelationshipElement) - { - var newFirst = ExtensionsUtil.ConvertReferenceFromV20(sourceAnnotedRelationshipElement.first, ReferenceTypes.ModelReference); - var newSecond = ExtensionsUtil.ConvertReferenceFromV20(sourceAnnotedRelationshipElement.second, ReferenceTypes.ModelReference); - var newAnnotedRelElement = new AnnotatedRelationshipElement(newFirst, newSecond); - outputSubmodelElement = newAnnotedRelElement.ConvertAnnotationsFromV20(sourceAnnotedRelationshipElement); - } - else if (sourceSubmodelElement is AdminShellV20.RelationshipElement sourceRelationshipElement) - { - var newFirst = ExtensionsUtil.ConvertReferenceFromV20(sourceRelationshipElement.first, ReferenceTypes.ModelReference); - var newSecond = ExtensionsUtil.ConvertReferenceFromV20(sourceRelationshipElement.second, ReferenceTypes.ModelReference); - outputSubmodelElement = new RelationshipElement(newFirst, newSecond); - } - else if (sourceSubmodelElement is AdminShellV20.BasicEvent sourceBasicEvent) - { - var newObserved = ExtensionsUtil.ConvertReferenceFromV20(sourceBasicEvent.observed, ReferenceTypes.ModelReference); - - outputSubmodelElement = new BasicEventElement(newObserved, Direction.Input, StateOfEvent.Off); - //TODO (jtikekar, 0000-00-00): default values of enums - } - else if (sourceSubmodelElement is AdminShellV20.Entity sourceEntity) - { - var entityType = Stringification.EntityTypeFromString(sourceEntity.entityType); - var newEntity = new Entity(entityType ?? EntityType.CoManagedEntity); - outputSubmodelElement = newEntity.ConvertFromV20(sourceEntity); - } - else if (sourceSubmodelElement is AdminShellV20.Operation sourceOperation) - { - var newInputVariables = new List(); - var newOutputVariables = new List(); - var newInOutVariables = new List(); - if (!sourceOperation.inputVariable.IsNullOrEmpty()) - { - - foreach (var inputVariable in sourceOperation.inputVariable) - { - if (inputVariable.value.submodelElement != null) - { - ISubmodelElement newSubmodelElement = null; - newSubmodelElement = newSubmodelElement.ConvertFromV20(inputVariable.value.submodelElement); - var newOpVariable = new OperationVariable(newSubmodelElement); - newInputVariables.Add(newOpVariable); - } - } - } - if (!sourceOperation.outputVariable.IsNullOrEmpty()) - { - foreach (var outputVariable in sourceOperation.outputVariable) - { - if (outputVariable.value.submodelElement != null) - { - ISubmodelElement newSubmodelElement = null; - newSubmodelElement = newSubmodelElement.ConvertFromV20(outputVariable.value.submodelElement); - var newOpVariable = new OperationVariable(newSubmodelElement); - newOutputVariables.Add(newOpVariable); - } - } - } - - if (!sourceOperation.inoutputVariable.IsNullOrEmpty()) - { - foreach (var inOutVariable in sourceOperation.inoutputVariable) - { - if (inOutVariable.value.submodelElement != null) - { - ISubmodelElement newSubmodelElement = null; - newSubmodelElement = newSubmodelElement.ConvertFromV20(inOutVariable.value.submodelElement); - var newOpVariable = new OperationVariable(newSubmodelElement); - newInOutVariables.Add(newOpVariable); - } - } - } - - outputSubmodelElement = new Operation(inputVariables: newInputVariables, outputVariables: newOutputVariables, inoutputVariables: newInOutVariables); - } - else if (sourceSubmodelElement is AdminShellV20.Capability) - { - outputSubmodelElement = new Capability(); - } - - if (outputSubmodelElement != null) - { - outputSubmodelElement.BasicConversionFromV20(sourceSubmodelElement); - } - } - - return outputSubmodelElement; - } - - private static void BasicConversionFromV20(this ISubmodelElement submodelElement, AdminShellV20.SubmodelElement sourceSubmodelElement) - { - if (!string.IsNullOrEmpty(sourceSubmodelElement.idShort)) - submodelElement.IdShort = sourceSubmodelElement.idShort; - - if (!string.IsNullOrEmpty(sourceSubmodelElement.category)) - submodelElement.Category = sourceSubmodelElement.category; - - if (sourceSubmodelElement.description != null) - submodelElement.Description = ExtensionsUtil.ConvertDescriptionFromV20(sourceSubmodelElement.description); - - if (sourceSubmodelElement.semanticId != null && !sourceSubmodelElement.semanticId.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in sourceSubmodelElement.semanticId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - // DECISION: After phone call with Birgit, set all CD to GlobalReference - // assuming it is always a external concept - if (keyType == KeyTypes.ConceptDescription) - keyType = KeyTypes.GlobalReference; - - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - submodelElement.SemanticId = new Reference(ReferenceTypes.ExternalReference, keyList); - } - - - if (!sourceSubmodelElement.qualifiers.IsNullOrEmpty()) - { - if (submodelElement.Qualifiers == null || submodelElement.Qualifiers.Count == 0) - submodelElement.Qualifiers = new List(); - - foreach (var sourceQualifier in sourceSubmodelElement.qualifiers) - { - var newQualifier = new Qualifier("", DataTypeDefXsd.String); - newQualifier = newQualifier.ConvertFromV20(sourceQualifier); - submodelElement.Qualifiers.Add(newQualifier); - } - } - - if (sourceSubmodelElement.hasDataSpecification != null && sourceSubmodelElement.hasDataSpecification.Count > 0) - { - foreach (var sourceEmbeddedDataSpec in sourceSubmodelElement.hasDataSpecification) - { - var newEmbeddedDataSpec = new EmbeddedDataSpecification (null, null); - newEmbeddedDataSpec.ConvertFromV20(sourceEmbeddedDataSpec); - if(newEmbeddedDataSpec.DataSpecification != null || newEmbeddedDataSpec.DataSpecificationContent != null) - { - submodelElement.EmbeddedDataSpecifications ??= new List(); - submodelElement.EmbeddedDataSpecifications.Add(newEmbeddedDataSpec); - } - } - } - - // move Qualifiers to Extensions - submodelElement.MigrateV20QualifiersToExtensions(); - } - - #region List - - public static IReferable FindReferableByReference( - this List submodelElements, Reference rf, int keyIndex) - { - return FindReferableByReference(submodelElements, rf?.Keys, keyIndex); - } - - public static IReferable FindReferableByReference( - this List submodelElements, List keys, int keyIndex) - { - // first index needs to exist .. - if (submodelElements == null || keys == null || keyIndex >= keys.Count) - return null; - - - // over all wrappers - foreach (var smw in submodelElements) - if (smw != null && smw.IdShort.Equals(keys[keyIndex].Value, StringComparison.OrdinalIgnoreCase)) - { - // match on this level. Did we find a leaf element? - if ((keyIndex + 1) >= keys.Count) - return smw; - - // dive into SMC? - if (smw is SubmodelElementCollection smc) - { - var found = FindReferableByReference(smc.Value, keys, keyIndex + 1); - if (found != null) - return found; - } - // dive into SML? - if (smw is SubmodelElementList submodelElementList) - { - var found = FindReferableByReference(submodelElementList.Value, keys, keyIndex + 1); - if (found != null) - return found; - } - - // dive into AnnotedRelationshipElement? - if (smw is AnnotatedRelationshipElement annotatedRelationshipElement) - { - var annotations = new List(annotatedRelationshipElement.Annotations); - var found = FindReferableByReference(annotations, keys, keyIndex + 1); - if (found != null) - return found; - } - - // dive into Entity statements? - if (smw is Entity ent) - { - var found = FindReferableByReference(ent.Statements, keys, keyIndex + 1); - if (found != null) - return found; - } - - // else: - return null; - } - - // no? - return null; - } - - public static IEnumerable FindDeep(this IEnumerable submodelElements, Predicate match = null) where T : ISubmodelElement - { - foreach (var smw in submodelElements) - { - var current = smw; - if (current == null) - continue; - - // call lambda for this element - if (current is T) - if (match == null || match.Invoke((T)current)) - yield return (T)current; - - // dive into? - // TODO (MIHO, 2020-07-31): would be nice to use IEnumerateChildren for this .. - // TODO (MIHO, 2023-01-01): would be nice to use AasCore.DescendOnce() for this .. -#if __old__ - if (current is SubmodelElementCollection smc && smc.Value != null) - foreach (var x in smc.Value.FindDeep(match)) - yield return x; - - if (current is AnnotatedRelationshipElement are && are.Annotations != null) - { - var annotationsList = new List(are.Annotations); - foreach (var x in annotationsList.FindDeep(match)) - yield return x; - } - - if (current is Entity ent && ent.Statements != null) - foreach (var x in ent.Statements.FindDeep(match)) - yield return x; - - if (current is Operation op) - { - var operationVariables = new List(); - foreach (var opVariable in op.InputVariables) - { - operationVariables.Add(opVariable.Value); - } - - foreach (var opVariable in op.InoutputVariables) - { - operationVariables.Add(opVariable.Value); - } - - foreach (var opVariable in op.OutputVariables) - { - operationVariables.Add(opVariable.Value); - } - - foreach (var x in operationVariables.FindDeep(match)) - yield return x; - } -#else - var smeChilds = current.DescendOnce().Where((ic) => ic is ISubmodelElement) - .Cast(); - foreach (var x in smeChilds.FindDeep(match)) - yield return x; -#endif - } - } - - public static void CopyManySMEbyCopy(this List submodelElements, ConceptDescription destCD, - List sourceSmc, ConceptDescription sourceCD, - bool createDefault = false, Action setDefault = null, - MatchMode matchMode = MatchMode.Relaxed) where T : ISubmodelElement - { - submodelElements.CopyManySMEbyCopy(destCD.GetSingleKey(), sourceSmc, sourceCD.GetSingleKey(), - createDefault ? destCD : null, setDefault, matchMode); - } - - public static void CopyManySMEbyCopy(this List submodelElements, Key destSemanticId, - List sourceSmc, Key sourceSemanticId, - ConceptDescription createDefault = null, Action setDefault = null, - MatchMode matchMode = MatchMode.Relaxed) where T : ISubmodelElement - { - // bool find possible sources - bool foundSrc = false; - if (sourceSmc == null) - return; - foreach (var src in sourceSmc.FindAllSemanticIdAs(sourceSemanticId, matchMode)) - { - // type of found src? - AasSubmodelElements aeSrc = (AasSubmodelElements)Enum.Parse(typeof(AasSubmodelElements), src.GetType().Name); - - // ok? - if (src == null || aeSrc == AasSubmodelElements.SubmodelElement) - continue; - foundSrc = true; - - // ok, create new one - var dst = AdminShellNS.AdminShellUtil.CreateSubmodelElementFromEnum(aeSrc, src); - if (dst != null) - { - // make same things sure - dst.IdShort = src.IdShort; - dst.Category = src.Category; - dst.SemanticId = new Reference(ReferenceTypes.ModelReference, new List() { destSemanticId }); - - // instantanously add it? - submodelElements.Add(dst); - } - } - - // default? - if (createDefault != null && !foundSrc) - { - // ok, default - var dflt = submodelElements.CreateSMEForCD(createDefault, addSme: true); - - // set default? - setDefault?.Invoke(dflt); - } - } - - public static T CopyOneSMEbyCopy(this List submodelElements, ConceptDescription destCD, - List sourceSmc, Key[] sourceKeys, - bool createDefault = false, Action setDefault = null, - MatchMode matchMode = MatchMode.Relaxed, - string idShort = null, bool addSme = false) where T : ISubmodelElement - { - return submodelElements.CopyOneSMEbyCopy(destCD?.GetSingleKey(), sourceSmc, sourceKeys, - createDefault ? destCD : null, setDefault, matchMode, idShort, addSme); - } - - public static T CopyOneSMEbyCopy(this List submodelELements, ConceptDescription destCD, - List sourceSmc, ConceptDescription sourceCD, - bool createDefault = false, Action setDefault = null, - MatchMode matchMode = MatchMode.Relaxed, - string idShort = null, bool addSme = false) where T : ISubmodelElement - { - return submodelELements.CopyOneSMEbyCopy(destCD?.GetSingleKey(), sourceSmc, new[] { sourceCD?.GetSingleKey() }, - createDefault ? destCD : null, setDefault, matchMode, idShort, addSme); - } - - public static T CopyOneSMEbyCopy(this List submodelElements, Key destSemanticId, - List sourceSmc, Key[] sourceSemanticId, - ConceptDescription createDefault = null, Action setDefault = null, - MatchMode matchMode = MatchMode.Relaxed, - string idShort = null, bool addSme = false) where T : ISubmodelElement - { - // get source - var src = sourceSmc.FindFirstAnySemanticIdAs(sourceSemanticId, matchMode); - - // may be make an adaptive conversion - if (src == null) - { - var anySrc = sourceSmc?.FindFirstAnySemanticId(sourceSemanticId, matchMode: matchMode); - src = submodelElements.AdaptiveConvertTo(anySrc, createDefault, - idShort: idShort, addSme: false); - } - - // proceed - AasSubmodelElements aeSrc = (AasSubmodelElements)Enum.Parse(typeof(AasSubmodelElements), src?.GetType().Name); - if (src == null || aeSrc == AasSubmodelElements.SubmodelElement) - { - // create a default? - if (createDefault == null) - return default(T); - - // ok, default - var dflt = submodelElements.CreateSMEForCD(createDefault, idShort: idShort, addSme: addSme); - - // set default? - setDefault?.Invoke(dflt); - - // return - return dflt; - } - - // ok, create new one - var dst = AdminShellNS.AdminShellUtil.CreateSubmodelElementFromEnum(aeSrc, src); - if (dst == null) - return default(T); - - // make same things sure - dst.IdShort = src.IdShort; - dst.Category = src.Category; - dst.SemanticId = new Reference(ReferenceTypes.ModelReference, new List() { destSemanticId }); - - // instantanously add it? - if (addSme) - submodelElements.Add(dst); - - // give back - return (T)dst; - } - - public static T AdaptiveConvertTo(this List submodelElements, - ISubmodelElement anySrc, - ConceptDescription createDefault = null, - string idShort = null, bool addSme = false) where T : ISubmodelElement - { - if (typeof(T) == typeof(MultiLanguageProperty) - && anySrc is Property srcProp) - { - var res = submodelElements.CreateSMEForCD(createDefault, idShort: idShort, addSme: addSme); - if (res is MultiLanguageProperty mlp) - { - mlp.Value = new List() { - new LangStringTextType(AdminShellUtil.GetDefaultLngIso639(), srcProp.Value) }; - mlp.ValueId = srcProp.ValueId; - return res; - } - } - - if (typeof(T) == typeof(Property) - && anySrc is MultiLanguageProperty srcMlp) - { - var res = submodelElements.CreateSMEForCD(createDefault, idShort: idShort, addSme: addSme); - if (res is Property prp) - { - prp.Value = "" + srcMlp.Value?.GetDefaultString(); - prp.ValueId = srcMlp.ValueId; - return res; - } - } - - return default(T); - } - - public static IEnumerable FindAllIdShort(this List submodelElements, - string idShort) - { - foreach (var smw in submodelElements) - if (smw != null) - if (smw.IdShort.Trim().ToLower() == idShort.Trim().ToLower()) - yield return smw; - } - - public static IEnumerable FindAllIdShortAs(this List submodelElements, - string idShort) where T : class, ISubmodelElement - { - foreach (var smw in submodelElements) - if (smw is T) - if (smw.IdShort.Trim().ToLower() == idShort.Trim().ToLower()) - yield return smw as T; - } - - public static ISubmodelElement FindFirstIdShort(this List submodelElements, - string idShort) - { - return submodelElements.FindAllIdShort(idShort)?.FirstOrDefault(); - } - - public static T FindFirstIdShortAs(this List submodelElements, - string idShort) where T : class, ISubmodelElement - { - return submodelElements.FindAllIdShortAs(idShort)?.FirstOrDefault(); - } - - - public static ISubmodelElement FindFirstAnySemanticId(this List submodelElements, - Key[] semId, Type[] allowedTypes = null, MatchMode matchMode = MatchMode.Strict) - { - if (semId == null) - return null; - foreach (var si in semId) - { - var found = submodelElements.FindAllSemanticId(si, allowedTypes, matchMode)? - .FirstOrDefault(); - if (found != null) - return found; - } - return null; - } - - public static T FindFirstAnySemanticIdAs( - this List submodelElements, IKey[] semId, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - if (semId == null) - return default(T); - foreach (var si in semId) - { - var found = submodelElements.FindAllSemanticIdAs(si, matchMode).FirstOrDefault(); - if (found != null) - return found; - } - return default(T); - } - - public static T CreateNew( - string idShort = null, string category = null, IReference semanticId = null) - where T : ISubmodelElement, new() - { - var res = new T(); - if (idShort != null) - res.IdShort = idShort; - if (category != null) - res.Category = category; - if (semanticId != null) - res.SemanticId = semanticId.Copy(); - return res; - } - - public static T CreateSMEForCD(this List submodelELements, IConceptDescription conceptDescription, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false, bool isTemplate = false) - where T : ISubmodelElement - { - // access - if (conceptDescription == null) - return default(T); - - // fin type enum - var smeType = AdminShellUtil.AasSubmodelElementsFrom(); - if (!smeType.HasValue) - return default(T); - - // try to potentially figure out idShort - var ids = conceptDescription.IdShort; - - //TODO (jtikekar, 0000-00-00): Temporarily removed - if ((ids == null || ids.Trim() == "") && conceptDescription.GetIEC61360() != null) - ids = conceptDescription.GetIEC61360().ShortName? - .GetDefaultString(); - - if (idShort != null) - ids = idShort; - - if (ids == null) - return default(T); - - // unique? - if (idxTemplate != null) - ids = submodelELements.IterateIdShortTemplateToBeUnique(idxTemplate, maxNum); - - // make a new instance - var semanticId = conceptDescription.GetCdReference(); - ISubmodelElement sme = AdminShellUtil.CreateSubmodelElementFromEnum(smeType.Value); - if (sme == null) - return default(T); - sme.IdShort = ids; - sme.SemanticId = semanticId.Copy(); - if (category != null) - sme.Category = category; - - // if its a SMC, make sure its accessible - if (sme is SubmodelElementCollection smc) - smc.Value = new List(); - - // instantanously add it? - if (addSme) - submodelELements.Add(sme); - - // give back - return (T)sme; - } - - public static IEnumerable FindAllSemanticIdAs(this List submodelELements, - IKey semId, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - if (submodelELements.IsNullOrEmpty()) - yield return default(T); - foreach (var submodelElement in submodelELements) - if (submodelElement != null && submodelElement is T - && submodelElement.SemanticId != null) - if (submodelElement.SemanticId.MatchesExactlyOneKey(semId, matchMode)) - yield return (T)submodelElement; - } - - public static IEnumerable FindAllSemanticIdAs(this List submodelELements, - IReference semId, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - foreach (var submodelElement in submodelELements) - if (submodelElement != null && submodelElement is T - && submodelElement.SemanticId != null) - if (submodelElement.SemanticId.Matches(semId, matchMode)) - yield return (T)submodelElement; - } - - public static T FindFirstSemanticIdAs(this List submodelElements, - IKey semId, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - return submodelElements.FindAllSemanticIdAs(semId, matchMode).FirstOrDefault(); - } - - public static T FindFirstSemanticIdAs(this List submodelElements, - IReference semId, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - return submodelElements.FindAllSemanticIdAs(semId, matchMode).FirstOrDefault(); - } - - public static List GetChildListFromFirstSemanticId( - this List submodelElements, - IKey semKey, MatchMode matchMode = MatchMode.Strict) - { - return FindFirstSemanticIdAs(submodelElements, semKey, matchMode)?.GetChildsAsList(); - } - - public static List GetChildListFromFirstSemanticId( - this List submodelElements, - IReference semId, MatchMode matchMode = MatchMode.Strict) - { - return FindFirstSemanticIdAs(submodelElements, semId, matchMode)?.GetChildsAsList(); - } - - public static IEnumerable> GetChildListsFromAllSemanticId( - this List submodelElements, - IKey semKey, MatchMode matchMode = MatchMode.Strict) - { - foreach (var child in FindAllSemanticIdAs(submodelElements, semKey, matchMode)) - yield return child.GetChildsAsList()?.ToList(); - } - - public static IEnumerable> GetChildListsFromAllSemanticId( - this List submodelElements, - IReference semId, MatchMode matchMode = MatchMode.Strict) - { - foreach (var child in FindAllSemanticIdAs(submodelElements, semId, matchMode)) - yield return child.GetChildsAsList()?.ToList(); - } - - public static IEnumerable Join(params IEnumerable[] lists) - { - if (lists == null || lists.Length < 1) - yield break; - foreach (var l in lists) - foreach (var sme in l) - yield return sme; - } - - public static void RecurseOnReferables( - this List submodelElements, object state, List parents, - Func, IReferable, bool> lambda) - { - if (lambda == null) - return; - if (parents == null) - parents = new List(); - - // over all elements - foreach (var submodelElement in submodelElements) - { - var current = submodelElement; - if (current == null) - continue; - - // call lambda for this element - // AND decide, if to recurse! - var goDeeper = lambda(state, parents, current); - - if (goDeeper) - { - // add to parents - parents.Add(current); - - // dive into? - if (current is SubmodelElementCollection smc) - smc.Value?.RecurseOnReferables(state, parents, lambda); - - if (current is Entity ent) - ent.Statements?.RecurseOnReferables(state, parents, lambda); - - if (current is Operation operation) - { - SubmodelElementCollection opVariableCollection = new SubmodelElementCollection(); - opVariableCollection.Value = new List(); - foreach (var inputVariable in operation.InputVariables) - { - opVariableCollection.Value.Add(inputVariable.Value); - } - - foreach (var outputVariable in operation.OutputVariables) - { - opVariableCollection.Value.Add(outputVariable.Value); - } - - foreach (var inOutVariable in operation.InoutputVariables) - { - opVariableCollection.Value.Add(inOutVariable.Value); - } - - opVariableCollection.Value.RecurseOnReferables(state, parents, lambda); - } - - if (current is AnnotatedRelationshipElement annotatedRelationshipElement) - { - var annotationElements = new List(); - if (annotatedRelationshipElement.Annotations != null) - foreach (var annotation in annotatedRelationshipElement.Annotations) - { - annotationElements.Add(annotation); - } - annotationElements.RecurseOnReferables(state, parents, lambda); - } - - // remove from parents - parents.RemoveAt(parents.Count - 1); - } - } - } - - public static void RecurseOnSubmodelElements( - this List submodelElements, object state, - List parents, Action, ISubmodelElement> lambda) - { - // trivial - if (lambda == null) - return; - if (parents == null) - parents = new List(); - - // over all elements - foreach (var smw in submodelElements) - { - var current = smw; - if (current == null) - continue; - - // call lambda for this element - lambda(state, parents, current); - - // add to parents - parents.Add(current); - - // dive into? - if (current is SubmodelElementCollection smc) - smc.Value?.RecurseOnSubmodelElements(state, parents, lambda); - - if (current is Entity ent) - ent.Statements?.RecurseOnSubmodelElements(state, parents, lambda); - - if (current is Operation operation) - { - SubmodelElementCollection opVariableCollection = new SubmodelElementCollection(); - foreach (var inputVariable in operation.InputVariables) - { - opVariableCollection.Value.Add(inputVariable.Value); - } - - foreach (var outputVariable in operation.OutputVariables) - { - opVariableCollection.Value.Add(outputVariable.Value); - } - - foreach (var inOutVariable in operation.InoutputVariables) - { - opVariableCollection.Value.Add(inOutVariable.Value); - } - - opVariableCollection.Value.RecurseOnSubmodelElements(state, parents, lambda); - } - - if (current is AnnotatedRelationshipElement annotatedRelationshipElement) - { - var annotationElements = new List(); - foreach (var annotation in annotatedRelationshipElement.Annotations) - { - annotationElements.Add(annotation); - } - annotationElements.RecurseOnSubmodelElements(state, parents, lambda); - } - - // remove from parents - parents.RemoveAt(parents.Count - 1); - } - } - - public static IEnumerable FindAllSemanticIdAs( - this List submodelELements, string semanticId) where T : ISubmodelElement - { - foreach (var submodelElement in submodelELements) - { - if (submodelElement != null && submodelElement is T && submodelElement.SemanticId != null) - { - if (submodelElement.SemanticId.Matches(semanticId)) - { - yield return (T)submodelElement; - } - } - } - } - - public static T FindFirstSemanticIdAs( - this List submodelELements, string semanticId) where T : ISubmodelElement - { - return submodelELements.FindAllSemanticIdAs(semanticId).FirstOrDefault(); - } - - public static T FindFirstAnySemanticIdAs( - this List submodelELements, string[] semanticIds) where T : ISubmodelElement - { - if (semanticIds == null) - return default; - foreach (var semanticId in semanticIds) - { - var found = submodelELements.FindFirstSemanticIdAs(semanticId); - if (found != null) - return found; - } - return default; - } - - public static IEnumerable FindAllSemanticId( - this List smes, - string[] allowedSemanticIds, - bool invertedAllowed = false) where T : ISubmodelElement - { - if (allowedSemanticIds == null || allowedSemanticIds.Length < 1) - yield break; - - foreach (var sme in smes) - { - if (sme == null || !(sme is T)) - continue; - - if (sme.SemanticId == null || sme.SemanticId.Keys.Count < 1) - { - if (invertedAllowed) - yield return (T)sme; - continue; - } - - var found = false; - foreach (var semanticId in allowedSemanticIds) - if (sme.SemanticId.Matches(semanticId)) - { - found = true; - break; - } - - if (invertedAllowed) - found = !found; - - if (found) - yield return (T)sme; - } - } - - public static T FindFirstAnySemanticId( - this List submodelElements, string[] allowedSemanticIds, - bool invertAllowed = false) where T : ISubmodelElement - { - return submodelElements.FindAllSemanticId(allowedSemanticIds, invertAllowed).FirstOrDefault(); - } - - public static IEnumerable FindAllSemanticId( - this List smes, - IKey[] allowedSemanticIds, MatchMode mm = MatchMode.Strict, - bool invertedAllowed = false) where T : ISubmodelElement - { - if (allowedSemanticIds == null || allowedSemanticIds.Length < 1) - yield break; - - foreach (var sme in smes) - { - if (sme == null || !(sme is T)) - continue; - - if (sme.SemanticId == null || sme.SemanticId.Keys.Count < 1) - { - if (invertedAllowed) - yield return (T)sme; - continue; - } - - var found = false; - foreach (var semanticId in allowedSemanticIds) - if (sme.SemanticId.MatchesExactlyOneKey(semanticId, mm)) - { - found = true; - break; - } - - if (invertedAllowed) - found = !found; - - if (found) - yield return (T)sme; - } - } - - public static T FindFirstAnySemanticId( - this List submodelElements, - IKey[] allowedSemanticIds, MatchMode mm = MatchMode.Strict, - bool invertAllowed = false) where T : ISubmodelElement - { - return submodelElements.FindAllSemanticId(allowedSemanticIds, mm, invertAllowed).FirstOrDefault(); - } - - public static IEnumerable FindAllSemanticId( - this List submodelElements, IKey semId, - Type[] allowedTypes = null, - MatchMode matchMode = MatchMode.Strict) - { - foreach (var smw in submodelElements) - if (smw != null && smw.SemanticId != null) - { - if (smw == null) - continue; - - if (allowedTypes != null) - { - var smwt = smw.GetType(); - if (!allowedTypes.Contains(smwt)) - continue; - } - - if (smw.SemanticId.MatchesExactlyOneKey(semId, matchMode)) - yield return smw; - } - } - - public static ISubmodelElement FindFirstSemanticId( - this List submodelElements, - IKey semId, Type[] allowedTypes = null, MatchMode matchMode = MatchMode.Strict) - { - return submodelElements.FindAllSemanticId(semId, allowedTypes, matchMode)?.FirstOrDefault(); - } - - public static IEnumerable FindAllSemanticIdAs( - this List smes, - ConceptDescription cd, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - foreach (var x in FindAllSemanticIdAs(smes, cd.GetReference(), matchMode)) - yield return x; - } - - public static T FindFirstSemanticIdAs( - this List smes, - ConceptDescription cd, MatchMode matchMode = MatchMode.Strict) - where T : ISubmodelElement - { - return smes.FindAllSemanticIdAs(cd, matchMode).FirstOrDefault(); - } - - public static string IterateIdShortTemplateToBeUnique(this List submodelElements, string idShortTemplate, int maxNum) - { - if (idShortTemplate == null || maxNum < 1 || !idShortTemplate.Contains("{0")) - return null; - - int i = 1; - while (i < maxNum) - { - var ids = string.Format(idShortTemplate, i); - if (submodelElements.CheckIdShortIsUnique(ids)) - return ids; - i++; - } - - return null; - } - - /// - /// Returns false, if there is another element with same idShort in the list - /// - public static bool CheckIdShortIsUnique(this List submodelElements, string idShort) - { - idShort = idShort?.Trim(); - if (idShort == null || idShort.Length < 1) - return false; - - var res = true; - foreach (var smw in submodelElements) - if (smw != null && smw.IdShort != null && smw.IdShort == idShort) - { - res = false; - break; - } - - return res; - } - - #endregion - - public static ISubmodelElement UpdateFrom(this ISubmodelElement elem, ISubmodelElement source) - { - if (source == null) - return elem; - - // IReferable - elem.Category = source.Category; - elem.IdShort = source.IdShort; - elem.DisplayName = source.DisplayName?.Copy(); - elem.Description = source.Description?.Copy(); - - - // IHasSemantics - if (source.SemanticId != null) - elem.SemanticId = source.SemanticId.Copy(); - if (source.SupplementalSemanticIds != null) - elem.SupplementalSemanticIds = source.SupplementalSemanticIds.Copy(); - - // IQualifiable - if (source.Qualifiers != null) - elem.Qualifiers = source.Qualifiers.Copy(); - - // IHasDataSpecification - if (source.EmbeddedDataSpecifications != null) - elem.EmbeddedDataSpecifications = source.EmbeddedDataSpecifications.Copy(); - - return elem; - } - - // - // Factories - // - - private static readonly Dictionary AasSubmodelElementsToAbbrev = ( - new Dictionary() - { - { AasSubmodelElements.AnnotatedRelationshipElement, "RelA" }, - { AasSubmodelElements.BasicEventElement, "BEvt" }, - { AasSubmodelElements.Blob, "Blob" }, - { AasSubmodelElements.Capability, "Cap" }, - { AasSubmodelElements.DataElement, "DE" }, - { AasSubmodelElements.Entity, "Ent" }, - { AasSubmodelElements.EventElement, "Evt" }, - { AasSubmodelElements.File, "File" }, - { AasSubmodelElements.MultiLanguageProperty, "MLP" }, - { AasSubmodelElements.Operation, "Opr" }, - { AasSubmodelElements.Property, "Prop" }, - { AasSubmodelElements.Range, "Range" }, - { AasSubmodelElements.ReferenceElement, "Ref" }, - { AasSubmodelElements.RelationshipElement, "Rel" }, - { AasSubmodelElements.SubmodelElement, "SME" }, - { AasSubmodelElements.SubmodelElementList, "SML" }, - { AasSubmodelElements.SubmodelElementCollection, "SMC" } - }); - - /// - /// Retrieve the string abbreviation of . - /// - /// - /// If is not a valid literal, return null. - /// - public static string? ToString(AasSubmodelElements? that) - { - if (!that.HasValue) - { - return null; - } - else - { - if (AasSubmodelElementsToAbbrev.TryGetValue(that.Value, out string? value)) - { - return value; - } - else - { - return null; - } - } - } - - private static readonly Dictionary _aasSubmodelElementsFromAbbrev = ( - new Dictionary() - { - { "RelA", AasSubmodelElements.AnnotatedRelationshipElement }, - { "BEvt", AasSubmodelElements.BasicEventElement }, - { "Blob", AasSubmodelElements.Blob }, - { "Cap", AasSubmodelElements.Capability }, - { "DE", AasSubmodelElements.DataElement }, - { "Ent", AasSubmodelElements.Entity }, - { "Evt", AasSubmodelElements.EventElement }, - { "File", AasSubmodelElements.File }, - { "MLP", AasSubmodelElements.MultiLanguageProperty }, - { "Opr", AasSubmodelElements.Operation }, - { "Prop", AasSubmodelElements.Property }, - { "Range", AasSubmodelElements.Range }, - { "Ref", AasSubmodelElements.ReferenceElement }, - { "Rel", AasSubmodelElements.RelationshipElement }, - { "SME", AasSubmodelElements.SubmodelElement }, - { "SML", AasSubmodelElements.SubmodelElementList }, - { "SMC", AasSubmodelElements.SubmodelElementCollection } - }); - - /// - /// Parse the string abbreviation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static AasSubmodelElements? AasSubmodelElementsFromAbbrev(string text) - { - if (_aasSubmodelElementsFromAbbrev.TryGetValue(text, out AasSubmodelElements value)) - { - return value; - } - else - { - return null; - } - } - - /// - /// Parse the string representation or the abbreviation of . - /// - /// - /// If is not a valid string representation - /// of a literal of , - /// return null. - /// - public static AasSubmodelElements? AasSubmodelElementsFromStringOrAbbrev(string text) - { - var res = Stringification.AasSubmodelElementsFromString(text); - if (res.HasValue) - return res; - - return AasSubmodelElementsFromAbbrev(text); - } - - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendKey.cs b/src/AasxCsharpLibrary/Extensions/ExtendKey.cs deleted file mode 100644 index f2c09ffa6..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendKey.cs +++ /dev/null @@ -1,268 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text.RegularExpressions; - -namespace Extensions -{ - public static class ExtendKey - { - public static IKey CreateFrom(Reference r) - { - if (r == null || r.Count() != 1) - return null; - return r.Keys[0].Copy(); - } - - public static bool Matches(this IKey key, - KeyTypes type, string id, MatchMode matchMode = MatchMode.Strict) - { - key.Value = key.Value.Trim(); - id = id.Trim(); - - if (matchMode == MatchMode.Strict) - return key.Type == type && key.Value.Replace("*01", "") == id.Replace("*01", ""); - - if (matchMode == MatchMode.Relaxed) - return (key.Type == type || key.Type == KeyTypes.GlobalReference || type == KeyTypes.GlobalReference) - && key.Value.Replace("*01", "") == id.Replace("*01", ""); - - if (matchMode == MatchMode.Identification) - return key.Value.Replace("*01", "") == id.Replace("*01", ""); - - return false; - } - public static bool Matches(this IKey key, IKey otherKey) - { - key.Value = key.Value.Trim(); - otherKey.Value = otherKey.Value.Trim(); - - if (otherKey == null) - { - return false; - } - - if (key.Type == otherKey.Type && key.Value.Replace("*01", "").Equals(otherKey.Value.Replace("*01", ""))) - { - return true; - } - - return false; - } - - public static bool Matches(this IKey key, IKey otherKey, MatchMode matchMode = MatchMode.Strict) - { - key.Value = key.Value.Trim(); - otherKey.Value = otherKey.Value.Trim(); - - if (matchMode == MatchMode.Strict) - return key.Type == otherKey.Type && key.Value.Replace("*01", "") == otherKey.Value.Replace("*01", ""); - - if (matchMode == MatchMode.Relaxed) - return (key.Type == otherKey.Type || key.Type == KeyTypes.GlobalReference || otherKey.Type == KeyTypes.GlobalReference) - && (key.Value.Replace("*01", "") == otherKey.Value.Replace("*01", "")); - - if (matchMode == MatchMode.Identification) - return key.Value.Replace("*01", "") == otherKey.Value.Replace("*01", ""); - - return false; - } - - public static bool MatchesSetOfTypes(this IKey key, IEnumerable set) - { - foreach (var kt in set) - if (key.Type == kt) - return true; - return false; - } - - public static AasValidationAction Validate(this IKey key, AasValidationRecordList results, IReferable container) - { - // access - if (results == null || container == null) - return AasValidationAction.No; - - var res = AasValidationAction.No; - - // check - if (key == null) - { - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SpecViolation, container, - "Key: is null", - () => - { - res = AasValidationAction.ToBeDeleted; - })); - } - else - { - - // check type - var tf = AdminShellUtil.CheckIfInConstantStringArray(Enum.GetNames(typeof(KeyTypes)), Stringification.ToString(key.Type)); - if (tf == AdminShellUtil.ConstantFoundEnum.No) - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - "Key: type is not in allowed enumeration values", - () => - { - key.Type = KeyTypes.GlobalReference; - })); - if (tf == AdminShellUtil.ConstantFoundEnum.AnyCase) - // violation case - // dead-csharp off - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - "Key: type in wrong casing", - () => - { - //NO IdType in V3 - //key.idType = AdminShellUtil.CorrectCasingForConstantStringArray( - // KeyElements, key.type); - })); - // dead-csharp on - } - - // may give result "to be deleted" - return res; - } - - public static string ToStringExtended(this IKey key, int format = 1) - { - if (format == 2) - return "" + key.Value; - return $"[{key.Type}, {key.Value}]"; - } - - public static bool IsAbsolute(this IKey key) - { - return key.Type == KeyTypes.GlobalReference || key.Type == KeyTypes.AssetAdministrationShell || key.Type == KeyTypes.Submodel; - } - - public static Key Parse(string cell, KeyTypes typeIfNotSet = KeyTypes.GlobalReference, - bool allowFmtAll = false, bool allowFmt0 = false, - bool allowFmt1 = false, bool allowFmt2 = false) - { - // access and defaults? - if (cell == null || cell.Trim().Length < 1) - return null; - - // format == 1 - if (allowFmtAll || allowFmt1) - { - var m = Regex.Match(cell, @"\((\w+)\)( ?)(.*)$"); - if (m.Success) - { - return new Key( - Stringification.KeyTypesFromString(m.Groups[1].ToString()) ?? KeyTypes.GlobalReference, - m.Groups[3].ToString()); - } - } - - // format == 2 - if (allowFmtAll || allowFmt2) - { - var m = Regex.Match(cell, @"( ?)(.*)$"); - if (m.Success) - { - return new Key( - typeIfNotSet, m.Groups[2].ToString()); - } - } - - // format == 0 - if (allowFmtAll || allowFmt0) - { - var m = Regex.Match(cell, @"\[(\w+),( ?)(.*)\]"); - if (m.Success) - { - return new Key( - Stringification.KeyTypesFromString(m.Groups[1].ToString()) ?? KeyTypes.GlobalReference, - m.Groups[3].ToString()); - } - } - - // no - return null; - } - - #region Guess identification types - - public enum IdType { Unknown = 0, IRI, IRDI }; - - public static IdType GuessIdType(string id) - { - // start - if (id == null) - return IdType.Unknown; - id = id.Trim().ToLower(); - - // IRDI? - if (Regex.IsMatch(id, @"(\d{3,4})\W+")) - return IdType.IRDI; - - // IRI? - // TODO (??, 0000-00-00): check for escaping - if (Regex.IsMatch(id, @"(\w{3,5})://")) - return IdType.IRI; - - // unsure - return IdType.Unknown; - } - - #endregion - - // dead-csharp off - // ------------------------------------------------------------------------------------------------------------- - #region Handling with enums for KeyTypes - - // see: https://stackoverflow.com/questions/27372816/how-to-read-the-value-for-an-enummember-attribute - //public static string? GetEnumMemberValue(this T value) - // where T : Enum - //{ - // return typeof(T) - // .GetTypeInfo() - // .DeclaredMembers - // .SingleOrDefault(x => x.Name == value.ToString()) - // ?.GetCustomAttribute(false) - // ?.Value; - //} - - //public static KeyTypes? MapFrom(AasReferables input) - //{ - // var st = input.GetEnumMemberValue(); - // var res = Stringification.KeyTypesFromString(st); - // return res; - //} - - //public static List MapFrom(IEnumerable input) - //{ - // List res = new(); - // foreach (var i in input) - // { - // var x = MapFrom(i); - // if (x.HasValue) - // res.Add(x.Value); - // } - // return res; - //} - - //public static List GetAllKeyTypesForAasReferables() - // => ExtendKey.MapFrom(Enum.GetValues(typeof(AasReferables)).OfType()); - - #endregion - // dead-csharp on - - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendKeyList.cs b/src/AasxCsharpLibrary/Extensions/ExtendKeyList.cs deleted file mode 100644 index d33903f44..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendKeyList.cs +++ /dev/null @@ -1,194 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using Extensions; -using System.Collections.Generic; -using System.Linq; -using AdminShellNS; -using Aas = AasCore.Aas3_0; - -namespace Extensions -{ - public static class ExtendKeyList - { - public static bool IsEmpty(this List keys) - { - return keys.Count < 1; - } - - public static bool Matches(this List keys, List other, MatchMode matchMode = MatchMode.Strict) - { - if (other == null || other.Count != keys.Count) - return false; - - var same = true; - for (int i = 0; i < keys.Count; i++) - same = same && keys[i].Matches(other[i], matchMode); - - return same; - } - - public static List ReplaceLastKey(this List keys, List newKeys) - { - var res = new List(keys); - if (res.Count < 1 || newKeys == null || newKeys.Count < 1) - return res; - - res.Remove(res.Last()); - res.AddRange(newKeys); - return res; - } - - public static bool StartsWith(this List keyList, List otherKeyList) - { - if (otherKeyList == null || otherKeyList.Count == 0) - return false; - - // simply test element-wise - for (int i = 0; i < otherKeyList.Count; i++) - { - // does head have more elements than this list? - if (i >= keyList.Count) - return false; - - if (!otherKeyList[i].Matches(keyList[i])) - return false; - } - - // ok! - return true; - } - - public static bool StartsWith(this List keyList, List head, bool emptyIsTrue = false, - MatchMode matchMode = MatchMode.Relaxed) - { - // access - if (head == null) - return false; - if (head.Count == 0) - return emptyIsTrue; - - // simply test element-wise - for (int i = 0; i < head.Count; i++) - { - // does head have more elements than this list? - if (i >= keyList.Count) - return false; - - if (!head[i].Matches(keyList[i], matchMode)) - return false; - } - - // ok! - return true; - } - - public static string ToStringExtended(this List keys, int format = 1, string delimiter = ",") - { - return string.Join(delimiter, keys.Select((k) => k.ToStringExtended(format))); - } - - public static void Validate(this List keys, AasValidationRecordList results, - IReferable container) - { - // access - if (results == null || keys == null || container == null) - return; - - // iterate thru - var idx = 0; - while (idx < keys.Count) - { - var act = keys[idx].Validate(results, container); - if (act == AasValidationAction.ToBeDeleted) - { - keys.RemoveAt(idx); - continue; - } - idx++; - } - } - - public static bool MatchesSetOfTypes(this List key, IEnumerable set) - { - var res = true; - foreach (var kt in key) - if (!key.MatchesSetOfTypes(set)) - res = false; - return res; - } - - public static List Parse(string input) - { - // access - if (input == null) - return null; - - // split - var parts = input.Split(',', ';'); - var kl = new List(); - - foreach (var p in parts) - { - var k = ExtendKey.Parse(p); - if (k != null) - kl.Add(k); - } - - return kl; - } - - /// - /// Take only idShort from Referables, ignore all other key-types and create a '/'-separated list - /// - /// Empty string or list of idShorts - public static string BuildIdShortPath(this List keyList, - int startPos = 0, int count = int.MaxValue) - { - if (keyList == null || startPos >= keyList.Count) - return ""; - int nr = 0; - var res = ""; - for (int i = startPos; i < keyList.Count && nr < count; i++) - { - nr++; - //// if (keyList[i].Type.Trim().ToLower() == Key.IdShort.Trim().ToLower()) - if (Aas.Constants.AasReferableNonIdentifiables.Contains(keyList[i].Type)) - { - if (res != "") - res += "/"; - res += keyList[i].Value; - } - } - return res; - } - - public static List SubList(this List keyList, - int startPos, int count = int.MaxValue) - { - var res = new List(); - if (startPos >= keyList.Count()) - return res; - int nr = 0; - for (int i = startPos; i < keyList.Count() && nr < count; i++) - { - nr++; - res.Add(keyList[i]); - } - return res; - } - - public static List ToKeyList(this List keyList) - { - var res = new List(); - foreach (var ki in keyList) - res.Add(new Key(ki.Type, ki.Value)); - return res; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendKeyTypes.cs b/src/AasxCsharpLibrary/Extensions/ExtendKeyTypes.cs deleted file mode 100644 index c8dc4ae40..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendKeyTypes.cs +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -namespace Extensions -{ - public static class ExtendKeyTypes - { - public static bool IsSME(this KeyTypes keyType) - { - foreach (var kt in Constants.AasSubmodelElementsAsKeys) - if (kt.HasValue && kt.Value == keyType) - return true; - return false; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendLangString.cs b/src/AasxCsharpLibrary/Extensions/ExtendLangString.cs deleted file mode 100644 index 24f54f9af..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendLangString.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System.Collections.Generic; - -namespace Extensions -{ - //TODO (jtikekar, 0000-00-00): remove - public static class ExtendLangString - { - // constants - public static string LANG_DEFAULT = "en"; - - // new version - public static string GetDefaultStringGen(List langStrings, string defaultLang = null) - where T : IAbstractLangString - { - // start - if (defaultLang == null) - defaultLang = "en"; - defaultLang = defaultLang.Trim().ToLower(); - string res = null; - - // search - foreach (var ls in langStrings) - if (ls.Language.Trim().ToLower() == defaultLang) - res = ls.Text; - if (res == null && langStrings.Count > 0) - res = langStrings[0].Text; - - // found? - return res; - } - - public static IAbstractLangString Create(string language, string text) where T : IAbstractLangString - { - if (typeof(T).IsAssignableFrom(typeof(ILangStringTextType))) - { - return new LangStringTextType(language, text); - } - else if (typeof(T).IsAssignableFrom(typeof(ILangStringNameType))) - { - return new LangStringNameType(language, text); - } - else if (typeof(T).IsAssignableFrom(typeof(ILangStringPreferredNameTypeIec61360))) - { - return new LangStringPreferredNameTypeIec61360(language, text); - } - else if (typeof(T).IsAssignableFrom(typeof(ILangStringShortNameTypeIec61360))) - { - return new LangStringShortNameTypeIec61360(language, text); - } - else if (typeof(T).IsAssignableFrom(typeof(ILangStringDefinitionTypeIec61360))) - { - return new LangStringDefinitionTypeIec61360(language, text); - } - else - return null; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendLangStringSet.cs b/src/AasxCsharpLibrary/Extensions/ExtendLangStringSet.cs deleted file mode 100644 index de4477e3f..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendLangStringSet.cs +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; -using System.Collections.Generic; -using System.Text.RegularExpressions; - -namespace Extensions -{ - //TODO (jtikekar, 0000-00-00): remove or seperate - public static class ExtendLangStringSet - { - #region AasxPackageExplorer - - public static bool IsValid(this List langStringSet) - { - if (langStringSet != null && langStringSet.Count >= 1) - { - return true; - } - - return false; - } - - #endregion - public static bool IsEmpty(this List langStringSet) - { - if (langStringSet == null || langStringSet.Count == 0) - { - return true; - } - - return false; - } - // dead-csharp off - //public static string GetDefaultString(this List langStringSet, string defaultLang = null) - //{ - // return ExtendLangString.GetDefaultStringGen(langStringSet, defaultLang); - //// start - //if (defaultLang == null) - // defaultLang = "en"; //Default Lang in old implementation is en - - //string res = null; - - //// search - //foreach (var langString in langStringSet) - // if (langString.Language.Equals(defaultLang, StringComparison.OrdinalIgnoreCase)) - // res = langString.Text; - - //if (res == null && langStringSet.Count > 0) - // res = langStringSet[0].Text; - - //// found? - //return res; - //} - // dead-csharp on - public static List Create(string language, string text) where T : IAbstractLangString, new() - { - return new List { new T { Language = language, Text = text } }; - } - - public static List CreateLangStringNameType(string language, string text) - { - return new List { new LangStringNameType(language, text) }; - } - - public static List CreateLangStringTextType(string language, string text) - { - return new List { new LangStringTextType(language, text) }; - } - - public static List CreateManyPreferredNamesFromStringArray(string[] s) - { - if (s == null) - return null; - var r = new List(); - var i = 0; - while ((i + 1) < s.Length) - { - r.Add(new LangStringPreferredNameTypeIec61360(s[i], s[i + 1])); - i += 2; - } - return r; - } - public static List CreateManyDefinitionFromStringArray(string[] s) - { - if (s == null) - return null; - var r = new List(); - var i = 0; - while ((i + 1) < s.Length) - { - r.Add(new LangStringDefinitionTypeIec61360(s[i], s[i + 1])); - i += 2; - } - return r; - } - - public static List Set(this List lss, string lang, string text) - { - foreach (var ls in lss) - if (ls.Language.Trim().ToLower() == lang?.Trim().ToLower()) - { - ls.Text = text; - return lss; - } - lss.Add(new LangStringTextType(lang, text)); - return lss; - } - - public static List ConvertFromV20( - this List langStringSet, - AasxCompatibilityModels.AdminShellV20.LangStringSet sourceLangStrings) - { - - if (sourceLangStrings.langString != null && sourceLangStrings.langString.Count != 0) - { - langStringSet = new List(); - foreach (var sourceLangString in sourceLangStrings.langString) - { - var langString = new LangStringTextType(sourceLangString.lang, sourceLangString.str); - langStringSet.Add(langString); - } - } - return langStringSet; - } - - public static List Parse(string cell, - Func createLs) where T : class - { - // access - if (cell == null || createLs == null) - return null; - - // iterative approach - var res = new List(); - while (true) - { - // trivial case and finite end - if (!cell.Contains("@")) - { - if (cell.Trim() != "") - { - res.Add(createLs(ExtendLangString.LANG_DEFAULT, cell)); - } - break; - } - - // OK, pick the next couple - var m = Regex.Match(cell, @"(.*?)@(\w+)", RegexOptions.Singleline); - if (!m.Success) - { - // take emergency exit? - res.Add(createLs("??", cell)); - } - - // use the match and shorten cell .. - res.Add(createLs(m.Groups[2].ToString(), m.Groups[1].ToString().Trim())); - cell = cell.Substring(m.Index + m.Length); - } - - return res; - } - - public static void Add(this List list, string language, string text) where T : IAbstractLangString - { - if (typeof(T).IsAssignableFrom(typeof(ILangStringTextType))) - { - (list as List) - .Add(new LangStringTextType(language, text)); - } - else if (typeof(T).IsAssignableFrom(typeof(ILangStringNameType))) - { - (list as List) - .Add(new LangStringNameType(language, text)); - } - else if (typeof(T).IsAssignableFrom(typeof(ILangStringPreferredNameTypeIec61360))) - { - (list as List) - .Add(new LangStringPreferredNameTypeIec61360(language, text)); - } - else if (typeof(T).IsAssignableFrom(typeof(ILangStringShortNameTypeIec61360))) - { - (list as List) - .Add(new LangStringShortNameTypeIec61360(language, text)); - } - else if (typeof(T).IsAssignableFrom(typeof(ILangStringDefinitionTypeIec61360))) - { - (list as List) - .Add(new LangStringDefinitionTypeIec61360(language, text)); - } - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendModelKind.cs b/src/AasxCsharpLibrary/Extensions/ExtendModelKind.cs deleted file mode 100644 index 75ad82fba..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendModelKind.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; - -namespace Extensions -{ - public static class ExtendModelKind - { - public static void Validate(this ModellingKind modelingKind, AasValidationRecordList results, IReferable container) - { - // access - if (results == null || container == null) - return; - - // check - if (modelingKind != ModellingKind.Template && modelingKind != ModellingKind.Instance) - { - // violation case - results.Add(new AasValidationRecord( - AasValidationSeverity.SchemaViolation, container, - $"ModelingKind: enumeration value neither Template nor Instance", - () => - { - modelingKind = ModellingKind.Instance; - })); - } - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendMultiLanguageProperty.cs b/src/AasxCsharpLibrary/Extensions/ExtendMultiLanguageProperty.cs deleted file mode 100644 index 4d0c9f65b..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendMultiLanguageProperty.cs +++ /dev/null @@ -1,140 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; -using System; -using System.Collections.Generic; - -namespace Extensions -{ - public static class ExtendMultiLanguageProperty - { - #region AasxPackageExplorer - - public static void ValueFromText(this MultiLanguageProperty multiLanguageProperty, string text, string defaultLang) - { - multiLanguageProperty.Value ??= new List(); - - multiLanguageProperty.Value.Add(new LangStringTextType(defaultLang == null ? "en" : defaultLang, text)); - } - - #endregion - - public static string ValueAsText(this MultiLanguageProperty multiLanguageProperty, string defaultLang = null) - { - // dead-csharp off - //TODO (jtikekar, 0000-00-00): need to check/test again - //return "" + multiLanguageProperty.Value?.LangStrings.FirstOrDefault().Text; - // dead-csharp on - return "" + multiLanguageProperty.Value?.GetDefaultString(defaultLang); - } - - public static MultiLanguageProperty ConvertFromV20(this MultiLanguageProperty property, AasxCompatibilityModels.AdminShellV20.MultiLanguageProperty sourceProperty) - { - if (sourceProperty == null) - { - return null; - } - - if (sourceProperty.valueId != null) - { - var keyList = new List(); - foreach (var refKey in sourceProperty.valueId.Keys) - { - - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value not found for property {property.IdShort}"); - } - } - property.ValueId = new Reference(ReferenceTypes.ExternalReference, keyList); - } - - if (sourceProperty.value != null && !sourceProperty.value.IsEmpty) - { - var newLangStrings = new List(); - - List newLangStringSet = new(newLangStrings); - - property.Value = newLangStringSet.ConvertFromV20(sourceProperty.value); - } - - return property; - - } - - public static MultiLanguageProperty UpdateFrom( - this MultiLanguageProperty elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is Property srcProp) - { - elem.Value = new List { - new LangStringTextType(AdminShellUtil.GetDefaultLngIso639(), srcProp.Value) }; - if (srcProp.ValueId != null) - elem.ValueId = srcProp.ValueId.Copy(); - } - - if (source is MultiLanguageProperty srcMlp) - { - if (srcMlp.Value != null) - elem.Value = srcMlp.Value.Copy(); - if (srcMlp.ValueId != null) - elem.ValueId = srcMlp.ValueId.Copy(); - } - - if (source is AasCore.Aas3_0.Range srcRng) - { - if (srcRng.Min != null) - elem.Value = new List { - new LangStringTextType(AdminShellUtil.GetDefaultLngIso639(), srcRng.Min) }; - } - - if (source is File srcFile) - { - elem.Value = new List { - new LangStringTextType(AdminShellUtil.GetDefaultLngIso639(), srcFile.Value) }; - } - - return elem; - } - - public static MultiLanguageProperty Set(this MultiLanguageProperty mlp, - List ls) - { - mlp.Value = ls; - return mlp; - } - - public static MultiLanguageProperty Set(this MultiLanguageProperty mlp, - LangStringTextType ls) - { - if (ls == null) - return mlp; - if (mlp.Value == null) - mlp.Value = new List(); - mlp.Value.Set(ls.Language, ls.Text); - return mlp; - } - - public static MultiLanguageProperty Set(this MultiLanguageProperty mlp, - string lang, string str) - { - return mlp.Set(new LangStringTextType(lang, str)); - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendObject.cs b/src/AasxCsharpLibrary/Extensions/ExtendObject.cs deleted file mode 100644 index ccc968476..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendObject.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; -using System.Collections.Generic; -using System.Reflection; -using Extensions.ArrayExtensions; - -namespace Extensions -{ - public static class ExtendObject - { - private static readonly MethodInfo CloneMethod = typeof(Object).GetMethod("MemberwiseClone", BindingFlags.NonPublic | BindingFlags.Instance); - - public static bool IsPrimitive(this Type type) - { - if (type == typeof(String)) return true; - return (type.IsValueType & type.IsPrimitive); - } - - public static Object Copy(this Object originalObject) - { - return InternalCopy(originalObject, new Dictionary(new ReferenceEqualityComparer())); - } - - private static Object InternalCopy(Object originalObject, IDictionary visited) - { - if (originalObject == null) return null; - var typeToReflect = originalObject.GetType(); - if (IsPrimitive(typeToReflect)) return originalObject; - if (visited.ContainsKey(originalObject)) return visited[originalObject]; - if (typeof(Delegate).IsAssignableFrom(typeToReflect)) return null; - var cloneObject = CloneMethod.Invoke(originalObject, null); - if (typeToReflect.IsArray) - { - var arrayType = typeToReflect.GetElementType(); - if (IsPrimitive(arrayType) == false) - { - Array clonedArray = (Array)cloneObject; - clonedArray.ForEach((array, indices) => array.SetValue(InternalCopy(clonedArray.GetValue(indices), visited), indices)); - } - - } - visited.Add(originalObject, cloneObject); - CopyFields(originalObject, visited, cloneObject, typeToReflect); - RecursiveCopyBaseTypePrivateFields(originalObject, visited, cloneObject, typeToReflect); - return cloneObject; - } - - private static void RecursiveCopyBaseTypePrivateFields(object originalObject, IDictionary visited, object cloneObject, Type typeToReflect) - { - if (typeToReflect.BaseType != null) - { - RecursiveCopyBaseTypePrivateFields(originalObject, visited, cloneObject, typeToReflect.BaseType); - CopyFields(originalObject, visited, cloneObject, typeToReflect.BaseType, BindingFlags.Instance | BindingFlags.NonPublic, info => info.IsPrivate); - } - } - - private static void CopyFields(object originalObject, IDictionary visited, object cloneObject, Type typeToReflect, - BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.FlattenHierarchy, - Func filter = null) - { - foreach (FieldInfo fieldInfo in typeToReflect.GetFields(bindingFlags)) - { - if (filter != null && filter(fieldInfo) == false) continue; - if (IsPrimitive(fieldInfo.FieldType)) continue; - var originalFieldValue = fieldInfo.GetValue(originalObject); - var clonedFieldValue = InternalCopy(originalFieldValue, visited); - fieldInfo.SetValue(cloneObject, clonedFieldValue); - } - } - public static T Copy(this T original) - { - return (T)Copy((Object)original); - } - } - - public class ReferenceEqualityComparer : EqualityComparer - { - public override bool Equals(object x, object y) - { - return ReferenceEquals(x, y); - } - public override int GetHashCode(object obj) - { - if (obj == null) return 0; - return obj.GetHashCode(); - } - } - - namespace ArrayExtensions - { - public static class ArrayExtensions - { - public static void ForEach(this Array array, Action action) - { - if (array.LongLength == 0) return; - ArrayTraverse walker = new ArrayTraverse(array); - do action(array, walker.Position); - while (walker.Step()); - } - } - - internal class ArrayTraverse - { - public int[] Position; - private int[] maxLengths; - - public ArrayTraverse(Array array) - { - maxLengths = new int[array.Rank]; - for (int i = 0; i < array.Rank; ++i) - { - maxLengths[i] = array.GetLength(i) - 1; - } - Position = new int[array.Rank]; - } - - public bool Step() - { - for (int i = 0; i < Position.Length; ++i) - { - if (Position[i] < maxLengths[i]) - { - Position[i]++; - for (int j = 0; j < i; j++) - { - Position[j] = 0; - } - return true; - } - } - return false; - } - } - } - -} - diff --git a/src/AasxCsharpLibrary/Extensions/ExtendOperation.cs b/src/AasxCsharpLibrary/Extensions/ExtendOperation.cs deleted file mode 100644 index d6ff4e2c1..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendOperation.cs +++ /dev/null @@ -1,157 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendOperation - { - #region AasxPackageExplorer - - public static object AddChild(this IOperation operation, ISubmodelElement childSubmodelElement, EnumerationPlacmentBase placement = null) - { - // not enough information to select list of children? - var pl = placement as EnumerationPlacmentOperationVariable; - if (childSubmodelElement == null || pl == null) - return null; - - // ok, use information - var ov = new OperationVariable(childSubmodelElement); - - if (childSubmodelElement != null) - childSubmodelElement.Parent = operation; - - if (pl.Direction == OperationVariableDirection.In) - { - operation.InputVariables ??= new List(); - operation.InputVariables.Add(ov); - } - - if (pl.Direction == OperationVariableDirection.Out) - { - operation.OutputVariables ??= new List(); - operation.OutputVariables.Add(ov); - } - - if (pl.Direction == OperationVariableDirection.InOut) - { - operation.InoutputVariables ??= new List(); - operation.InoutputVariables.Add(ov); - } - - return ov; - } - - public static EnumerationPlacmentBase GetChildrenPlacement(this IOperation operation, ISubmodelElement child) - { - // trivial - if (child == null) - return null; - - // search - OperationVariableDirection? dir = null; - IOperationVariable opvar = null; - if (operation.InputVariables != null) - foreach (var ov in operation.InputVariables) - if (ov?.Value == child) - { - dir = OperationVariableDirection.In; - opvar = ov; - } - - if (operation.OutputVariables != null) - foreach (var ov in operation.OutputVariables) - if (ov?.Value == child) - { - dir = OperationVariableDirection.Out; - opvar = ov; - } - - if (operation.InoutputVariables != null) - foreach (var ov in operation.InoutputVariables) - if (ov?.Value == child) - { - dir = OperationVariableDirection.InOut; - opvar = ov; - } - - // found - if (!dir.HasValue) - return null; - return new EnumerationPlacmentOperationVariable() - { - Direction = dir.Value, - OperationVariable = opvar as OperationVariable - }; - } - - public static List GetVars(this IOperation op, OperationVariableDirection dir) - { - if (dir == OperationVariableDirection.In) - return op.InputVariables; - if (dir == OperationVariableDirection.Out) - return op.OutputVariables; - return op.InoutputVariables; - } - - public static List SetVars( - this IOperation op, OperationVariableDirection dir, List value) - { - if (dir == OperationVariableDirection.In) - { - op.InputVariables = value; - return op.InputVariables; - } - if (dir == OperationVariableDirection.Out) - { - op.OutputVariables = value; - return op.OutputVariables; - } - - op.InoutputVariables = value; - return op.InoutputVariables; - } - - #endregion - - public static IOperation UpdateFrom( - this IOperation elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is SubmodelElementCollection srcColl) - { - if (srcColl.Value != null) - { - List operationVariables = srcColl.Value.Copy().Select( - (isme) => new OperationVariable(isme)).ToList(); - elem.InputVariables = operationVariables.ConvertAll(op => (IOperationVariable)op); - } - - } - - if (source is SubmodelElementCollection srcList) - { - if (srcList.Value != null) - { - List operationVariables = srcList.Value.Copy().Select( - (isme) => new OperationVariable(isme)).ToList(); - elem.InputVariables = operationVariables.ConvertAll(op => (IOperationVariable)op); - } - } - - return elem; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendProperty.cs b/src/AasxCsharpLibrary/Extensions/ExtendProperty.cs deleted file mode 100644 index f77a3765f..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendProperty.cs +++ /dev/null @@ -1,269 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; - -namespace Extensions -{ - public static class ExtendProperty - { - #region AasxPackageExplorer - - public static void ValueFromText(this Property property, string text) - { - property.Value = text; - } - - #endregion - public static bool IsValueTrue(this Property property) - { - if (property.ValueType == DataTypeDefXsd.Boolean) - { - if (property.Value.Equals("true", StringComparison.OrdinalIgnoreCase)) - { - return true; - } - } - - return false; - } - - public static string ValueAsText(this Property property) - { - return "" + property.Value; - } - - public static double? ValueAsDouble(this Property prop) - { - // pointless - if (prop.Value == null || prop.Value.Trim() == "") - return null; - - // type? - if (!ExtendDataElement.ValueTypes_Number.Contains(prop.ValueType)) - return null; - - // try convert - if (double.TryParse(prop.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out double dbl)) - return dbl; - - // no - return null; - } - public static Property ConvertFromV10(this Property property, AasxCompatibilityModels.AdminShellV10.Property sourceProperty) - { - if (sourceProperty == null) - { - return null; - } - var propertyType = Stringification.DataTypeDefXsdFromString("xs:" + sourceProperty.valueType); - if (propertyType != null) - { - property.ValueType = (DataTypeDefXsd)propertyType; - } - else - { - Console.WriteLine($"ValueType {sourceProperty.valueType} not found for property {sourceProperty.idShort}"); - } - property.Value = sourceProperty.value; - if (sourceProperty.valueId != null && !sourceProperty.valueId.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in sourceProperty.valueId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {sourceProperty.valueType} not found for property {property.IdShort}"); - } - } - property.ValueId = new Reference(ReferenceTypes.ExternalReference, keyList); - } - - return property; - } - - public static Property ConvertFromV20(this Property property, AasxCompatibilityModels.AdminShellV20.Property sourceProperty) - { - if (sourceProperty == null) - { - return null; - } - - var propertyType = Stringification.DataTypeDefXsdFromString("xs:" + sourceProperty.valueType); - if (propertyType != null) - { - property.ValueType = (DataTypeDefXsd)propertyType; - } - else - { - Console.WriteLine($"ValueType {sourceProperty.valueType} not found for property {sourceProperty.idShort}"); - } - property.Value = sourceProperty.value; - if (sourceProperty.valueId != null && !sourceProperty.valueId.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in sourceProperty.valueId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {sourceProperty.valueType} not found for property {property.IdShort}"); - } - } - property.ValueId = new Reference(ReferenceTypes.ExternalReference, keyList); - } - - return property; - } - - public static Property UpdateFrom(this Property elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is Property srcProp) - { - elem.ValueType = srcProp.ValueType; - elem.Value = srcProp.Value; - if (srcProp.ValueId != null) - elem.ValueId = srcProp.ValueId.Copy(); - } - - if (source is AasCore.Aas3_0.Range srcRng) - { - elem.ValueType = srcRng.ValueType; - elem.Value = srcRng.Min; - } - - if (source is MultiLanguageProperty srcMlp) - { - elem.ValueType = DataTypeDefXsd.String; - elem.Value = "" + srcMlp.Value?.GetDefaultString(); - if (srcMlp.ValueId != null) - elem.ValueId = srcMlp.ValueId.Copy(); - } - - if (source is File srcFile) - { - elem.ValueType = DataTypeDefXsd.String; - elem.Value = "" + srcFile.Value; - } - - return elem; - } - - // MIHO: Jui, why was this required? -#if OLD - - public static void UpdatePropertyFrom(this Property property, Property sourceProperty) - { - if (sourceProperty.Extensions != null) - { - property.Extensions = sourceProperty.Extensions; - } - if (sourceProperty.Category != null) - { - property.Category = sourceProperty.Category; - } - if (sourceProperty.IdShort != null) - { - property.IdShort = sourceProperty.IdShort; - } - if (sourceProperty.DisplayName != null) - { - property.DisplayName = sourceProperty.DisplayName; - } - if (sourceProperty.Description != null) - { - property.Description = sourceProperty.Description; - } - if (sourceProperty.Checksum != null) - { - property.Checksum = sourceProperty.Checksum; - } - if (sourceProperty.Kind != null) - { - property.Kind = sourceProperty.Kind; - } - if (sourceProperty.SemanticId != null) - { - property.SemanticId = sourceProperty.SemanticId; - } - if (sourceProperty.SupplementalSemanticIds != null) - { - property.SupplementalSemanticIds = sourceProperty.SupplementalSemanticIds; - } - if (sourceProperty.Qualifiers != null) - { - property.Qualifiers = sourceProperty.Qualifiers; - } - if (sourceProperty.EmbeddedDataSpecifications != null) - { - property.EmbeddedDataSpecifications = sourceProperty.EmbeddedDataSpecifications; - } - if (true) - { - property.ValueType = sourceProperty.ValueType; - } - if (sourceProperty.ValueId != null) - { - property.ValueId = sourceProperty.ValueId; - } - if (sourceProperty.Value != null) - { - property.Value = sourceProperty.Value; - } - } -#endif - - public static Property Set(this Property prop, - DataTypeDefXsd valueType = DataTypeDefXsd.String, string value = "") - { - prop.ValueType = valueType; - prop.Value = value; - return prop; - } - - public static Property Set(this Property prop, - KeyTypes type, string value) - { - prop.ValueId = ExtendReference.CreateFromKey(new Key(type, value)); - return prop; - } - - public static Property Set(this Property prop, - Qualifier q) - { - if (q != null) - prop.Add(q); - return prop; - } - - public static Property Set(this Property prop, - Extension ext) - { - if (ext != null) - prop.Add(ext); - return prop; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendQualifier.cs b/src/AasxCsharpLibrary/Extensions/ExtendQualifier.cs deleted file mode 100644 index 1851d4f06..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendQualifier.cs +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; -using System.Collections.Generic; -using System.Text.RegularExpressions; - -namespace Extensions -{ - public static class ExtendQualifier - { - public static Qualifier ConvertFromV10(this Qualifier qualifier, AasxCompatibilityModels.AdminShellV10.Qualifier sourceQualifier) - { - if (sourceQualifier.semanticId != null && !sourceQualifier.semanticId.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in sourceQualifier.semanticId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - qualifier.SemanticId = new Reference(ReferenceTypes.ExternalReference, keyList); - } - - qualifier.Type = sourceQualifier.qualifierType; - qualifier.Value = sourceQualifier.qualifierValue; - - if (sourceQualifier.qualifierValueId != null && !sourceQualifier.qualifierValueId.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in sourceQualifier.qualifierValueId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - qualifier.ValueId = new Reference(ReferenceTypes.ExternalReference, keyList); - } - - return qualifier; - } - - public static Qualifier ConvertFromV20(this Qualifier qualifier, AasxCompatibilityModels.AdminShellV20.Qualifier sourceQualifier) - { - if (sourceQualifier.semanticId != null && !sourceQualifier.semanticId.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in sourceQualifier.semanticId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - - } - qualifier.SemanticId = new Reference(ReferenceTypes.ExternalReference, keyList); - } - - qualifier.Type = sourceQualifier.type; - qualifier.Value = sourceQualifier.value; - - if (sourceQualifier.valueId != null && !sourceQualifier.valueId.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in sourceQualifier.valueId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - qualifier.ValueId = new Reference(ReferenceTypes.ExternalReference, keyList); - } - - return qualifier; - } - - // ReSharper disable MethodOverloadWithOptionalParameter .. this seems to work, anyhow - // ReSharper disable RedundantArgumentDefaultValue - public static string ToStringExtended(this IQualifier q, - int format = 0, string delimiter = ",") - { - var res = "" + q.Type; - if (res == "") - res += "" + q.SemanticId?.ToStringExtended(format, delimiter); - - if (q.Value != null) - res += " = " + q.Value; - else if (q.ValueId != null) - res += " = " + q.ValueId?.ToStringExtended(format, delimiter); - - return res; - } - // ReSharper enable MethodOverloadWithOptionalParameter - // ReSharper enable RedundantArgumentDefaultValue - - // - // - // List - // - // - - #region QualifierCollection - - public static IQualifier FindQualifierOfType(this List qualifiers, string qualifierType) - { - if (qualifierType == null) - { - return null; - } - - foreach (var qualifier in qualifiers) - { - if (qualifier != null && qualifierType.Equals(qualifier.Type)) - { - return qualifier; - } - } - - return null; - } - - // ReSharper disable MethodOverloadWithOptionalParameter .. this seems to work, anyhow - // ReSharper disable RedundantArgumentDefaultValue - public static string ToStringExtended(this List qualifiers, - int format = 0, string delimiter = ";", string referencesDelimiter = ",") - { - var res = ""; - foreach (var q in qualifiers) - { - if (res != "") - res += delimiter; - res += q.ToStringExtended(format, referencesDelimiter); - } - return res; - } - // ReSharper enable MethodOverloadWithOptionalParameter - // ReSharper enable RedundantArgumentDefaultValue - - public static IQualifier FindType(this List qualifiers, string type) - { - if (type == null || qualifiers == null) - return null; - foreach (var q in qualifiers) - if (q != null && q.Type != null && q.Type.Trim() == type.Trim()) - return q; - return null; - } - - public static Qualifier Parse(string input) - { - var m = Regex.Match(input, @"\s*([^,]*)(,[^=]+){0,1}\s*=\s*([^,]*)(,.+){0,1}\s*"); - if (!m.Success) - return null; - - return new Qualifier( - valueType: DataTypeDefXsd.String, - type: m.Groups[1].ToString().Trim(), - semanticId: ExtendReference.Parse(m.Groups[1].ToString().Trim()), - value: m.Groups[3].ToString().Trim(), - valueId: ExtendReference.Parse(m.Groups[1].ToString().Trim()) - ); - } - - #endregion - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendRange.cs b/src/AasxCsharpLibrary/Extensions/ExtendRange.cs deleted file mode 100644 index e3317b77a..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendRange.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; -using AAS = AasCore.Aas3_0; - -namespace Extensions -{ - public static class ExtendRange - { - public static string ValueAsText(this AasCore.Aas3_0.Range range) - { - return "" + range.Min + " .. " + range.Max; - } - - public static AasCore.Aas3_0.Range ConvertFromV20(this AasCore.Aas3_0.Range range, AasxCompatibilityModels.AdminShellV20.Range sourceRange) - { - if (sourceRange == null) - { - return null; - } - - var propertyType = AAS.Stringification.DataTypeDefXsdFromString("xs:" + sourceRange.valueType); - if (propertyType != null) - { - range.ValueType = (AAS.DataTypeDefXsd)propertyType; - } - else - { - Console.WriteLine($"ValueType {sourceRange.valueType} not found for property {range.IdShort}"); - } - - range.Max = sourceRange.max; - range.Min = sourceRange.min; - - return range; - } - - public static AAS.Range UpdateFrom(this AAS.Range elem, AAS.ISubmodelElement source) - { - if (source == null) - return elem; - - ((AAS.ISubmodelElement)elem).UpdateFrom(source); - - if (source is AAS.Property srcProp) - { - elem.ValueType = srcProp.ValueType; - elem.Min = srcProp.Value; - elem.Max = elem.Min; - } - - if (source is AAS.MultiLanguageProperty srcMlp) - { - elem.ValueType = AAS.DataTypeDefXsd.String; - elem.Min = "" + srcMlp.Value?.GetDefaultString(); - elem.Max = elem.Min; - } - - if (source is AAS.File srcFile) - { - elem.ValueType = AAS.DataTypeDefXsd.String; - elem.Min = "" + srcFile.Value; - elem.Max = elem.Min; - } - - return elem; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendReference.cs b/src/AasxCsharpLibrary/Extensions/ExtendReference.cs deleted file mode 100644 index 61bb53df6..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendReference.cs +++ /dev/null @@ -1,309 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS.Exceptions; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendReference - { - #region AasxPackageExplorer - - public static AasElementSelfDescription GetSelfDescription(this Reference reference) - { - return new AasElementSelfDescription("Reference", "Rfc", null, null); - } - - public static bool IsValid(this IReference reference) - { - return reference.Keys != null && !reference.Keys.IsEmpty(); - } - - public static bool IsValid(this List references) - { - bool isValid = false; - foreach (var reference in references) - { - isValid = IsValid(reference); - if (!isValid) - { - return false; - } - } - return isValid; - } - - /// - /// Formaly a static constructor. - /// Creates a Reference from a key, guessing Reference.Type. - /// - /// Given single Key - /// Reference with guessed type - public static Reference CreateFromKey(IKey k) - { - var res = new Reference(ReferenceTypes.ExternalReference, new List { k }); - res.Type = res.GuessType(); - return res; - } - - /// - /// Formaly a static constructor. - /// Creates a Reference from a key, guessing Reference.Type. - /// - public static Reference CreateFromKey(KeyTypes type, - string value) - { - var res = new Reference(ReferenceTypes.ExternalReference, - new List { new Key(type, value) }); - res.Type = res.GuessType(); - return res; - } - - /// - /// Formaly a static constructor. - /// Creates a Reference from a list of keys, guessing Reference.Type. - /// - /// - /// - public static Reference CreateNew(List lk) - { - var res = new Reference(ReferenceTypes.ExternalReference, new List()); - if (lk == null) - return res; - res.Keys.AddRange(lk.Copy()); - res.Type = res.GuessType(); - return res; - } - - // TODO (Jui, 2023-01-05): Check why the generic Copy does not apply here?! - public static Reference Copy(this Reference original) - { - var res = new Reference(original.Type, new List()); - if (original != null) - foreach (var o in original.Keys) - res.Add(o.Copy()); - return res; - } - - - public static Reference Parse(string input) - { - var res = new Reference(ReferenceTypes.ExternalReference, new List()); - if (input == null) - return res; - - res.Keys = ExtendKeyList.Parse(input); - res.Type = res.GuessType(); - return res; - } - - //This is alternative for operator overloding method +, as operator overloading cannot be done in extension classes - public static IReference Add(this IReference a, IReference b) - { - a.Keys?.AddRange(b?.Keys); - return a; - } - - public static IReference Add(this IReference a, IKey k) - { - if (k != null) - a.Keys?.Add(k); - return a; - } - - public static bool IsEmpty(this IReference reference) - { - if (reference == null || reference.Keys == null || reference.Keys.Count < 1) - { - return true; - } - - return false; - } - - #endregion - - public static bool Matches(this IReference reference, KeyTypes keyType, string id, MatchMode matchMode = MatchMode.Strict) - { - if (reference.IsEmpty()) - { - return false; - } - - if (reference.Keys.Count == 1) - { - var key = reference.Keys[0]; - return key.Matches(new Key(keyType, id), matchMode); - } - - return false; - } - - public static bool Matches(this IReference reference, string id) - { - if (string.IsNullOrEmpty(id)) - { - return false; - } - - if (reference.Keys.Count == 1) // As per old implementation - { - if (reference.Keys[0].Value == id) - return true; - } - - return false; - } - - public static bool Matches(this IReference reference, IReference otherReference, MatchMode matchMode = MatchMode.Strict) - { - if (reference.Keys == null || reference.Keys.Count == 0 - || otherReference?.Keys == null || otherReference.Keys.Count == 0 - || reference.Keys.Count != otherReference.Keys.Count) - { - return false; - } - - bool match = true; - for (int i = 0; i < reference.Keys.Count; i++) - { - match = match && reference.Keys[i].Matches(otherReference.Keys[i], matchMode); - } - - return match; - } - - public static bool MatchesExactlyOneKey(this IReference reference, IKey key, MatchMode matchMode = MatchMode.Strict) - { - if (key == null || reference.Keys == null || reference.Keys.Count != 1) - { - return false; - } - - var referenceKey = reference.Keys[0]; - return referenceKey.Matches(key, matchMode); - } - - public static string GetAsIdentifier(this IReference reference) - { - - if (reference != null && reference.Type == ReferenceTypes.ExternalReference) // Applying only to Global Reference, based on older implementation, TODO:Make it Generic - { - if (reference.Keys == null || reference.Keys.Count < 1) - { - return null; - } - - return reference.Keys[0].Value; - } - - //TODO (jtikekar, 2024-03-06): Refactor, added w.r.t. GitHub issue 11 - if(reference.Type == ReferenceTypes.ModelReference) - { - if (reference.Keys == null || reference.Keys.Count < 1) - { - return null; - } - - return reference.Keys[0].Value; - } - - return null; - } - - public static string MostSignificantInfo(this IReference reference) - { - if (reference.Keys.Count < 1) - { - return "-"; - } - - var i = reference.Keys.Count - 1; - var output = reference.Keys[i].Value; - if (reference.Keys[i].Type == KeyTypes.FragmentReference && i > 0) - output += reference.Keys[i - 1].Value; - return output; - } - - public static Key GetAsExactlyOneKey(this IReference reference) - { - if (reference.Keys == null || reference.Keys.Count != 1) - { - return null; - } - - var key = reference.Keys[0]; - return new Key(key.Type, key.Value); - } - - /// - /// Formats: 1 = [key, value] 2 = value - /// - public static string ToStringExtended(this IReference reference, int format = 1, string delimiter = ",") - { - if (reference.Keys == null) - { - throw new NullValueException("Keys"); - } - - return reference.Keys.ToStringExtended(format, delimiter); - } - - public static ReferenceTypes GuessType(this IReference reference) - { - var setAasRefs = Constants.AasReferables.Where((kt) => kt != null).Select(kt => kt.Value).ToArray(); - var allAasRefs = true; - foreach (var k in reference.Keys) - if (!k.MatchesSetOfTypes(setAasRefs)) - allAasRefs = false; - if (allAasRefs) - return ReferenceTypes.ModelReference; - else - return ReferenceTypes.ExternalReference; - } - - public static int Count(this IReference rf) - { - return rf.Keys.Count; - } - // dead-csharp off - //TODO (??, 0000-00-00): check if required - //public static int Count(this Reference rf) - //{ - // return rf.Keys.Count; - //} - // dead-csharp on - public static IKey Last(this IReference rf) - { - return rf.Keys.Last(); - } - // dead-csharp off - //TODO (??, 0000-00-00): check if required - //public static IKey Last(this Reference rf) - //{ - // return rf.Keys.Last(); - //} - // dead-csharp on - public static string ListOfValues(this Reference rf, string delim) - { - string res = ""; - if (rf.Keys != null) - foreach (var x in rf.Keys) - { - if (x == null) - continue; - if (res != "") res += delim; - res += x.Value; - } - return res; - } - } - -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendReferenceElement.cs b/src/AasxCsharpLibrary/Extensions/ExtendReferenceElement.cs deleted file mode 100644 index e68d0065d..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendReferenceElement.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AAS = AasCore.Aas3_0; - -namespace Extensions -{ - public static class ExtendReferenceElement - { - public static AAS.ReferenceElement Set(this AAS.ReferenceElement elem, - Reference rf) - { - elem.Value = rf; - return elem; - } - - public static AAS.ReferenceElement UpdateFrom( - this AAS.ReferenceElement elem, AAS.ISubmodelElement source) - { - if (source == null) - return elem; - - ((AAS.ISubmodelElement)elem).UpdateFrom(source); - - if (source is AAS.RelationshipElement srcRel) - { - if (srcRel.First != null) - elem.Value = srcRel.First.Copy(); - } - - if (source is AAS.AnnotatedRelationshipElement srcRelA) - { - if (srcRelA.First != null) - elem.Value = srcRelA.First.Copy(); - } - - return elem; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendRelationshipElement.cs b/src/AasxCsharpLibrary/Extensions/ExtendRelationshipElement.cs deleted file mode 100644 index 04634059a..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendRelationshipElement.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AAS = AasCore.Aas3_0; - -namespace Extensions -{ - public static class ExtendRelationshipElement - { - public static AAS.RelationshipElement Set(this AAS.RelationshipElement elem, - AAS.Reference first, AAS.Reference second) - { - elem.First = first; - elem.Second = second; - return elem; - } - - public static AAS.RelationshipElement UpdateFrom( - this AAS.RelationshipElement elem, AAS.ISubmodelElement source) - { - if (source == null) - return elem; - - ((AAS.ISubmodelElement)elem).UpdateFrom(source); - - if (source is AAS.ReferenceElement srcRef) - { - if (srcRef.Value != null) - elem.First = srcRef.Value.Copy(); - } - - if (source is AAS.AnnotatedRelationshipElement srcRelA) - { - if (srcRelA.First != null) - elem.First = srcRelA.First.Copy(); - } - - return elem; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendSpecificAssetId.cs b/src/AasxCsharpLibrary/Extensions/ExtendSpecificAssetId.cs deleted file mode 100644 index 6aa1552c6..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendSpecificAssetId.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using Extensions; -using System.Collections.Generic; -using System.Linq; - -namespace AdminShellNS.Extensions -{ - public static class ExtendSpecificAssetId - { - public static bool Matches(this ISpecificAssetId specificAssetId, ISpecificAssetId other) - { - if (specificAssetId == null) return false; - if (other == null) return false; - - //check mandatory parameters first - if (specificAssetId.Name != other.Name) return false; - if (specificAssetId.Value != other.Value) return false; - if (!specificAssetId.ExternalSubjectId.Matches(other.ExternalSubjectId)) return false; - - //TODO (jtikekar, 0000-00-00): Check optional parameter i.e., Semantic Id and supplementatry semantic id - - return true; - } - - #region ListOfSpecificAssetIds - - public static bool ContainsSpecificAssetId(this List specificAssetIds, ISpecificAssetId other) - { - if (specificAssetIds == null) return false; - if (other == null) return false; - - var foundIds = specificAssetIds.Where(assetId => assetId.Matches(other)); - if (foundIds.Any()) return true; - - return false; - } - - #endregion - - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendStream.cs b/src/AasxCsharpLibrary/Extensions/ExtendStream.cs deleted file mode 100644 index 09f582d5b..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendStream.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System.IO; - -namespace Extensions -{ - public static class ExtendStream - { - public static byte[] ToByteArray(this Stream stream) - { - using (stream) - { - using MemoryStream memStream = new(); - stream.CopyTo(memStream); - return memStream.ToArray(); - } - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendStringification.cs b/src/AasxCsharpLibrary/Extensions/ExtendStringification.cs deleted file mode 100644 index 0e153f191..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendStringification.cs +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendStringification - { - public static IEnumerable DataTypeXsdToStringArray() => - Enum.GetValues(typeof(DataTypeDefXsd)).OfType().Select((dt) => Stringification.ToString(dt)); - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendSubmodel.cs b/src/AasxCsharpLibrary/Extensions/ExtendSubmodel.cs deleted file mode 100644 index d008af091..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendSubmodel.cs +++ /dev/null @@ -1,470 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; -using AdminShellNS.Extensions; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendSubmodel - { - #region AasxPackageExplorer - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. Include this element, as well. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// Include this element as well. parents will then - /// include this element as well! - public static void RecurseOnReferables(this Submodel submodel, - object state, Func, IReferable, bool> lambda, - bool includeThis = false) - { - var parents = new List(); - if (includeThis) - { - lambda(state, null, submodel); - parents.Add(submodel); - } - submodel.SubmodelElements?.RecurseOnReferables(state, parents, lambda); - } - - public static void Remove(this Submodel submodel, ISubmodelElement submodelElement) - { - if (submodel != null) - { - if (submodel.SubmodelElements != null) - { - submodel.SubmodelElements.Remove(submodelElement); - } - } - } - - public static object AddChild( - this ISubmodel submodel, ISubmodelElement childSubmodelElement, - EnumerationPlacmentBase placement = null) - { - if (childSubmodelElement == null) - return null; - submodel.SubmodelElements ??= new(); - if (childSubmodelElement != null) - childSubmodelElement.Parent = submodel; - submodel.SubmodelElements.Add(childSubmodelElement); - return childSubmodelElement; - } - - public static Tuple ToCaptionInfo(this ISubmodel submodel) - { - var caption = AdminShellUtil.EvalToNonNullString("\"{0}\" ", submodel.IdShort, ""); - if (submodel.Administration != null) - caption += "V" + submodel.Administration.Version + "." + submodel.Administration.Revision; - var info = ""; - if (submodel.Id != null) - info = $"[{submodel.Id}]"; - return Tuple.Create(caption, info); - } - - public static IEnumerable FindAllReferences(this ISubmodel submodel) - { - // not nice: use temp list - var temp = new List(); - - // recurse - submodel.RecurseOnSubmodelElements(null, (state, parents, sme) => - { - if (sme is ReferenceElement re) - if (re.Value != null) - temp.Add(re.Value); - if (sme is RelationshipElement rl) - { - if (rl.First != null) - temp.Add(rl.First); - if (rl.Second != null) - temp.Add(rl.Second); - } - // recurse - return true; - }); - - // now, give back - foreach (var r in temp) - yield return new LocatedReference(submodel, r); - } - - #endregion - public static void Validate(this Submodel submodel, AasValidationRecordList results) - { - // access - if (results == null) - return; - - // check - submodel.BaseValidation(results); - submodel.Kind?.Validate(results, submodel); - if (submodel.SemanticId != null && !submodel.SemanticId.IsEmpty()) - { - submodel.SemanticId.Keys.Validate(results, submodel); - } - } - - public static Submodel ConvertFromV10(this Submodel submodel, AasxCompatibilityModels.AdminShellV10.Submodel sourceSubmodel, bool shallowCopy = false) - { - if (sourceSubmodel == null) - { - return null; - } - - if (string.IsNullOrEmpty(sourceSubmodel.idShort)) - { - submodel.IdShort = ""; - } - else - { - submodel.IdShort = sourceSubmodel.idShort; - } - - if (sourceSubmodel.description != null) - { - submodel.Description = ExtensionsUtil.ConvertDescriptionFromV10(sourceSubmodel.description); - } - - if (sourceSubmodel.administration != null) - { - submodel.Administration = new AdministrativeInformation(version: sourceSubmodel.administration.version, revision: sourceSubmodel.administration.revision); - } - - if (sourceSubmodel.semanticId != null && !sourceSubmodel.semanticId.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in sourceSubmodel.semanticId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - submodel.SemanticId = new Reference(ReferenceTypes.ExternalReference, keyList); - } - - if (sourceSubmodel.kind != null) - { - if (sourceSubmodel.kind.IsInstance) - { - submodel.Kind = ModellingKind.Instance; - } - else - { - submodel.Kind = ModellingKind.Template; - } - } - - if (!sourceSubmodel.qualifiers.IsNullOrEmpty()) - { - if (submodel.Qualifiers == null && submodel.Qualifiers.Count != 0) - { - submodel.Qualifiers = new List(); - } - - foreach (var sourceQualifier in sourceSubmodel.qualifiers) - { - var newQualifier = new Qualifier("", DataTypeDefXsd.String); - newQualifier = newQualifier.ConvertFromV10(sourceQualifier); - submodel.Qualifiers.Add(newQualifier); - } - } - - if (!shallowCopy && !sourceSubmodel.submodelElements.IsNullOrEmpty()) - { - submodel.SubmodelElements ??= new List(); - - foreach (var submodelElementWrapper in sourceSubmodel.submodelElements) - { - var sourceSubmodelELement = submodelElementWrapper.submodelElement; - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelELement != null) - { - outputSubmodelElement = outputSubmodelElement.ConvertFromV10(sourceSubmodelELement, shallowCopy); - submodel.SubmodelElements.Add(outputSubmodelElement); - } - - } - } - - return submodel; - - } - - public static Submodel ConvertFromV20(this Submodel sm, AasxCompatibilityModels.AdminShellV20.Submodel srcSM, bool shallowCopy = false) - { - if (srcSM == null) - return null; - - if (string.IsNullOrEmpty(srcSM.idShort)) - sm.IdShort = ""; - else - sm.IdShort = srcSM.idShort; - - if (srcSM.identification?.id != null) - sm.Id = srcSM.identification.id; - - if (srcSM.description != null) - sm.Description = ExtensionsUtil.ConvertDescriptionFromV20(srcSM.description); - - if (srcSM.administration != null) - sm.Administration = new AdministrativeInformation( - version: srcSM.administration.version, revision: srcSM.administration.revision); - - if (srcSM.semanticId != null && !srcSM.semanticId.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in srcSM.semanticId.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - sm.SemanticId = new Reference(ReferenceTypes.ExternalReference, keyList); - } - - if (srcSM.kind != null) - { - if (srcSM.kind.IsInstance) - { - sm.Kind = ModellingKind.Instance; - } - else - { - sm.Kind = ModellingKind.Template; - } - } - - if (!srcSM.qualifiers.IsNullOrEmpty()) - { - sm.Qualifiers ??= new List(); - - foreach (var sourceQualifier in srcSM.qualifiers) - { - var newQualifier = new Qualifier("", DataTypeDefXsd.String); - newQualifier = newQualifier.ConvertFromV20(sourceQualifier); - sm.Qualifiers.Add(newQualifier); - } - } - - if (!shallowCopy && !srcSM.submodelElements.IsNullOrEmpty()) - { - sm.SubmodelElements ??= new List(); - - foreach (var submodelElementWrapper in srcSM.submodelElements) - { - var sourceSubmodelELement = submodelElementWrapper.submodelElement; - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelELement != null) - { - outputSubmodelElement = outputSubmodelElement.ConvertFromV20(sourceSubmodelELement, shallowCopy); - sm.SubmodelElements.Add(outputSubmodelElement); - } - - } - } - - // move Qualifiers to Extensions - sm.MigrateV20QualifiersToExtensions(); - - return sm; - } - - public static T FindFirstIdShortAs(this ISubmodel submodel, string idShort) where T : ISubmodelElement - { - - var submodelElement = submodel.SubmodelElements.Where(sme => (sme != null) && (sme is T) && sme.IdShort.Equals(idShort, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); - - return (T)submodelElement; - } - - public static IEnumerable FindDeep(this ISubmodel submodel) - { - if (submodel.SubmodelElements == null || submodel.SubmodelElements.Count == 0) - { - yield break; - } - - foreach (var submodelElement in submodel.SubmodelElements) - { - foreach (var x in submodelElement.FindDeep()) - yield return x; - } - } - - public static Reference GetModelReference(this ISubmodel submodel) - { - var key = new Key(KeyTypes.Submodel, submodel.Id); - var outputReference = new Reference(ReferenceTypes.ModelReference, new List() { key }) - { - ReferredSemanticId = submodel.SemanticId - }; - - return outputReference; - } - - /// - /// If instance, return semanticId as one key. - /// If template, return identification as key. - /// - public static Key GetSemanticKey(this Submodel submodel) - { - if (submodel.Kind == ModellingKind.Instance) - return submodel.SemanticId.GetAsExactlyOneKey(); - else - return new Key(KeyTypes.Submodel, submodel.Id); - } - - /// - /// If instance, return semanticId as one key. - /// If template, return identification as key. - /// - public static IReference GetSemanticRef(this Submodel submodel) - { - if (submodel.Kind == ModellingKind.Instance) - return submodel.SemanticId; - else - return new Reference(ReferenceTypes.ModelReference, new[] { - new Key(KeyTypes.Submodel, submodel.Id) }.Cast().ToList()); - } - - public static List SmeForWrite(this Submodel submodel) - { - if (submodel.SubmodelElements == null) - submodel.SubmodelElements = new(); - return submodel.SubmodelElements; - } - - public static void RecurseOnSubmodelElements(this ISubmodel submodel, object state, Func, ISubmodelElement, bool> lambda) - { - submodel.SubmodelElements?.RecurseOnReferables(state, null, (o, par, rf) => - { - if (rf is ISubmodelElement sme) - return lambda(o, par, sme); - else - return true; - }); - } - - public static ISubmodelElement FindSubmodelElementByIdShort(this ISubmodel submodel, string smeIdShort) - { - if (submodel.SubmodelElements == null || submodel.SubmodelElements.Count == 0) - { - return null; - } - - var submodelElements = submodel.SubmodelElements.Where(sme => (sme != null) && sme.IdShort.Equals(smeIdShort, StringComparison.OrdinalIgnoreCase)); - if (submodelElements.Any()) - { - return submodelElements.First(); - } - else - { - return null; - } - } - - public static void SetAllParents(this ISubmodel submodel, DateTime timestamp) - { - if (submodel.SubmodelElements != null) - foreach (var sme in submodel.SubmodelElements) - SetParentsForSME(submodel, sme, timestamp); - } - - public static void SetParentsForSME(IReferable parent, ISubmodelElement submodelElement, DateTime timestamp) - { - if (submodelElement == null) - return; - - submodelElement.Parent = parent; - submodelElement.TimeStamp = timestamp; - submodelElement.TimeStampCreate = timestamp; - - foreach (var childElement in submodelElement.EnumerateChildren()) - { - SetParentsForSME(submodelElement, childElement, timestamp); - } - } - - public static void SetParentsForSME(IReferable parent, ISubmodelElement submodelElement) - { - if (submodelElement == null) - return; - - submodelElement.Parent = parent; - - foreach (var childElement in submodelElement.EnumerateChildren()) - { - SetParentsForSME(submodelElement, childElement); - } - } - - public static void SetAllParents(this ISubmodel submodel) - { - if (submodel.SubmodelElements != null) - foreach (var sme in submodel.SubmodelElements) - SetParentsForSME(submodel, sme); - } - - public static void Add(this Submodel submodel, ISubmodelElement submodelElement) - { - if (submodel.SubmodelElements == null) - { - submodel.SubmodelElements = new List(); - } - - submodelElement.Parent = submodel; - submodel.SubmodelElements.Add(submodelElement); - } - - public static void Insert(this ISubmodel submodel, int index, ISubmodelElement submodelElement) - { - if (submodel.SubmodelElements == null) - { - submodel.SubmodelElements = new List(); - } - - submodelElement.Parent = submodel; - submodel.SubmodelElements.Insert(index, submodelElement); - } - - public static T CreateSMEForCD( - this Submodel sm, - ConceptDescription conceptDescription, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false, bool isTemplate = false) - where T : ISubmodelElement - { - if (sm.SubmodelElements == null) - sm.SubmodelElements = new List(); - return sm.SubmodelElements.CreateSMEForCD( - conceptDescription, category, idShort, idxTemplate, maxNum, addSme, isTemplate); - } - - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementCollection.cs b/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementCollection.cs deleted file mode 100644 index 628561c52..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementCollection.cs +++ /dev/null @@ -1,193 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendSubmodelElementCollection - { - #region AasxPackageExplorer - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. Include this element, as well. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// Include this element as well. parents will then - /// include this element as well! - public static void RecurseOnReferables(this SubmodelElementCollection submodelElementCollection, - object state, Func, IReferable, bool> lambda, - bool includeThis = false) - { - var parents = new List(); - if (includeThis) - { - lambda(state, null, submodelElementCollection); - parents.Add(submodelElementCollection); - } - submodelElementCollection.Value?.RecurseOnReferables(state, parents, lambda); - } - - public static void Remove(this SubmodelElementCollection submodelElementCollection, ISubmodelElement submodelElement) - { - if (submodelElementCollection != null) - { - if (submodelElementCollection.Value != null) - { - submodelElementCollection.Value.Remove(submodelElement); - } - } - } - - public static object AddChild(this SubmodelElementCollection submodelElementCollection, ISubmodelElement childSubmodelElement, EnumerationPlacmentBase placement = null) - { - if (childSubmodelElement == null) - return null; - if (submodelElementCollection.Value == null) - submodelElementCollection.Value = new(); - if (childSubmodelElement != null) - childSubmodelElement.Parent = submodelElementCollection; - submodelElementCollection.Value.Add(childSubmodelElement); - return childSubmodelElement; - } - - #endregion - public static T FindFirstIdShortAs(this SubmodelElementCollection submodelElementCollection, string idShort) where T : ISubmodelElement - { - - var submodelElement = submodelElementCollection.Value.Where(sme => (sme != null) && (sme is T) && sme.IdShort.Equals(idShort, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); - - return (T)submodelElement; - } - - public static SubmodelElementCollection ConvertFromV10(this SubmodelElementCollection submodelElementCollection, AasxCompatibilityModels.AdminShellV10.SubmodelElementCollection sourceSmeCollection, bool shallowCopy = false) - { - if (sourceSmeCollection == null) - return null; - - submodelElementCollection.Value ??= new List(); - - if (!shallowCopy) - { - foreach (var submodelElementWrapper in sourceSmeCollection.value) - { - var sourceSubmodelElement = submodelElementWrapper.submodelElement; - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelElement != null) - { - outputSubmodelElement = outputSubmodelElement.ConvertFromV10(sourceSubmodelElement, shallowCopy); - } - - submodelElementCollection.Value.Add(outputSubmodelElement); - } - } - - return submodelElementCollection; - } - - public static SubmodelElementCollection ConvertFromV20(this SubmodelElementCollection submodelElementCollection, AasxCompatibilityModels.AdminShellV20.SubmodelElementCollection sourceSmeCollection, bool shallowCopy = false) - { - if (sourceSmeCollection == null) - return null; - - submodelElementCollection.Value ??= new List(); - - if (!shallowCopy) - { - foreach (var submodelElementWrapper in sourceSmeCollection.value) - { - var sourceSubmodelElement = submodelElementWrapper.submodelElement; - ISubmodelElement outputSubmodelElement = null; - if (sourceSubmodelElement != null) - { - outputSubmodelElement = outputSubmodelElement.ConvertFromV20(sourceSubmodelElement, shallowCopy); - } - - submodelElementCollection.Value.Add(outputSubmodelElement); - } - } - - return submodelElementCollection; - } - - public static void Add(this SubmodelElementCollection submodelElementCollection, ISubmodelElement submodelElement) - { - submodelElementCollection.Value ??= new List(); - - submodelElement.Parent = submodelElementCollection; - submodelElementCollection.Value.Add(submodelElement); - } - - public static void Insert(this SubmodelElementCollection submodelElementCollection, int index, ISubmodelElement submodelElement) - { - if (submodelElementCollection.Value == null) - { - submodelElementCollection.Value = new List(); - } - - submodelElement.Parent = submodelElementCollection; - submodelElementCollection.Value.Insert(index, submodelElement); - } - - public static T CreateSMEForCD( - this SubmodelElementCollection smc, - ConceptDescription conceptDescription, string category = null, string idShort = null, - string idxTemplate = null, int maxNum = 999, bool addSme = false, bool isTemplate = false) - where T : ISubmodelElement - { - if (smc.Value == null) - smc.Value = new List(); - return smc.Value.CreateSMEForCD( - conceptDescription, category, idShort, idxTemplate, maxNum, addSme, isTemplate); - } - - public static SubmodelElementCollection UpdateFrom( - this SubmodelElementCollection elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is SubmodelElementList srcList) - { - if (srcList.Value != null) - elem.Value = srcList.Value.Copy(); - } - - if (source is Operation srcOp) - { - Action, List> appov = (dst, src) => - { - if (src == null) - return; - foreach (var ov in src) - if (ov.Value != null) - dst.Append(ov.Value.Copy()); - }; - - elem.Value = new(); - appov(elem.Value, srcOp.InputVariables); - appov(elem.Value, srcOp.InoutputVariables); - appov(elem.Value, srcOp.OutputVariables); - if (elem.Value.Count < 1) - elem.Value = null; - } - - return elem; - } - - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementList.cs b/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementList.cs deleted file mode 100644 index a3a27c53d..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementList.cs +++ /dev/null @@ -1,206 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AdminShellNS; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Extensions -{ - public static class ExtendSubmodelElementList - { - #region AasxPackageExplorer - - /// - /// Recurses on all Submodel elements of a Submodel or SME, which allows children. - /// The state object will be passed to the lambda function in order to provide - /// stateful approaches. Include this element, as well. - /// - /// State object to be provided to lambda. Could be null. - /// The lambda function as (state, parents, SME) - /// The lambda shall return TRUE in order to deep into recursion. - /// Include this element as well. parents will then - /// include this element as well! - public static void RecurseOnReferables(this SubmodelElementList submodelElementList, - object state, Func, IReferable, bool> lambda, - bool includeThis = false) - { - var parents = new List(); - if (includeThis) - { - lambda(state, null, submodelElementList); - parents.Add(submodelElementList); - } - submodelElementList.Value?.RecurseOnReferables(state, parents, lambda); - } - - public static void Add(this SubmodelElementList submodelElementList, ISubmodelElement submodelElement) - { - if (submodelElementList != null) - { - submodelElementList.Value ??= new(); - - submodelElement.Parent = submodelElementList; - - submodelElementList.Value.Add(submodelElement); - } - } - - public static void Remove(this SubmodelElementList submodelElementList, ISubmodelElement submodelElement) - { - if (submodelElementList != null) - { - if (submodelElementList.Value != null) - { - submodelElementList.Value.Remove(submodelElement); - } - } - } - - public static object AddChild( - this SubmodelElementList submodelElementList, ISubmodelElement childSubmodelElement, - EnumerationPlacmentBase placement = null) - { - if (childSubmodelElement == null) - return null; - if (submodelElementList.Value == null) - submodelElementList.Value = new(); - if (childSubmodelElement != null) - childSubmodelElement.Parent = submodelElementList; - submodelElementList.Value.Add(childSubmodelElement); - return childSubmodelElement; - } - - #endregion - public static T FindFirstIdShortAs(this SubmodelElementList submodelElementList, string idShort) where T : ISubmodelElement - { - - var submodelElements = submodelElementList.Value.Where(sme => sme != null && sme is T && sme.IdShort.Equals(idShort, StringComparison.OrdinalIgnoreCase)); - - if (submodelElements.Any()) - { - return (T)submodelElements.First(); - } - - return default; - } - - public static SubmodelElementList UpdateFrom( - this SubmodelElementList elem, ISubmodelElement source) - { - if (source == null) - return elem; - - ((ISubmodelElement)elem).UpdateFrom(source); - - if (source is SubmodelElementCollection srcColl) - { - if (srcColl.Value != null) - elem.Value = srcColl.Value.Copy(); - } - - if (source is Operation srcOp) - { - Action, List> appov = (dst, src) => - { - if (src == null) - return; - foreach (var ov in src) - if (ov.Value != null) - dst.Append(ov.Value.Copy()); - }; - - elem.Value = new(); - appov(elem.Value, srcOp.InputVariables); - appov(elem.Value, srcOp.InoutputVariables); - appov(elem.Value, srcOp.OutputVariables); - if (elem.Value.Count < 1) - elem.Value = null; - } - - return elem; - } - - // advanced checks - - public class ConstraintStat - { - /// - /// Constraint AASd-107: If a first level child element in a SubmodelElementList has a semanticId - /// it shall be identical to SubmodelElementList/semanticIdListElement. - /// - public bool AllChildSemIdMatch = true; - - /// - /// Constraint AASd-108: All first level child elements in a SubmodelElementList shall have the - /// same submodel element type as specified in SubmodelElementList/typeValueListElement. - /// - public bool AllChildSmeTypeMatch = true; - - /// - /// Constraint AASd-109: If SubmodelElementList/typeValueListElement equal to Property or Range, - /// SubmodelElementList/valueTypeListElement shall be set and all first level child elements in - /// the SubmodelElementList shall have the the value type as specified in - /// SubmodelElementList/valueTypeListElement - /// - public bool AllChildValueTypeMatch = true; - } - - public static ConstraintStat EvalConstraintStat(this SubmodelElementList list) - { - // access - var res = new ConstraintStat(); - if (list.Value == null) - return res; - - // prepare SME type - var smeTypeToCheck = list.TypeValueListElement; - - // prepare value type - var valueTypeToCheck = list.ValueTypeListElement; - - // eval - foreach (var sme in list.Value) - { - // need self description - var smesd = sme.GetSelfDescription(); - if (smesd == null) - continue; - - // sem id? - if (res.AllChildSemIdMatch - && list.SemanticIdListElement?.IsValid() == true - && sme.SemanticId?.IsValid() == true - && !list.SemanticIdListElement.Matches(sme.SemanticId)) - res.AllChildSemIdMatch = false; - - // type of SME? - if (res.AllChildSmeTypeMatch - && smesd.SmeType != smeTypeToCheck) - res.AllChildSmeTypeMatch = false; - - // value type to check - if (valueTypeToCheck.HasValue - && res.AllChildValueTypeMatch - && sme is Property prop - && prop.ValueType != valueTypeToCheck.Value) - res.AllChildValueTypeMatch = false; - - if (valueTypeToCheck.HasValue - && res.AllChildValueTypeMatch - && sme is AasCore.Aas3_0.Range range - && range.ValueType != valueTypeToCheck.Value) - res.AllChildValueTypeMatch = false; - } - - // ok - return res; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/ExtensionsUtil.cs b/src/AasxCsharpLibrary/Extensions/ExtensionsUtil.cs deleted file mode 100644 index 32200d1a7..000000000 --- a/src/AasxCsharpLibrary/Extensions/ExtensionsUtil.cs +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -using AasxCompatibilityModels; -using System; -using System.Collections.Generic; - -namespace Extensions -{ - public static class ExtensionsUtil - { - - public static Reference ConvertReferenceFromV10(AdminShellV10.Reference sourceReference, ReferenceTypes referenceTypes) - { - Reference outputReference = null; - if (sourceReference != null && !sourceReference.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in sourceReference.Keys) - { - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - outputReference = new Reference(referenceTypes, keyList); - } - - return outputReference; - } - - public static Reference ConvertReferenceFromV20(AdminShellV20.Reference sourceReference, ReferenceTypes referenceTypes) - { - Reference outputReference = null; - if (sourceReference != null && !sourceReference.IsEmpty) - { - var keyList = new List(); - foreach (var refKey in sourceReference.Keys) - { - // Fix, as Asset does not exist anymore - if (refKey.type?.Trim().Equals("Asset", StringComparison.InvariantCultureIgnoreCase) == true) - refKey.type = "GlobalReference"; - - var keyType = Stringification.KeyTypesFromString(refKey.type); - if (keyType != null) - { - keyList.Add(new Key((KeyTypes)keyType, refKey.value)); - } - else - { - Console.WriteLine($"KeyType value {refKey.type} not found."); - } - } - outputReference = new Reference(referenceTypes, keyList); - } - - return outputReference; - } - - internal static List ConvertDescriptionFromV10(AdminShellV10.Description sourceDescription) - { - var newLangStrList = new List(); - foreach (var ls in sourceDescription.langString) - { - newLangStrList.Add(new LangStringTextType(ls.lang, ls.str)); - } - - return new List(newLangStrList); - } - - internal static List ConvertDescriptionFromV20(AdminShellV20.Description sourceDescription) - { - var newLangStrList = new List(); - foreach (var ls in sourceDescription.langString) - { - newLangStrList.Add(new LangStringTextType(ls.lang, ls.str)); - } - - return new List(newLangStrList); - } - - internal static KeyTypes GetKeyType(IClass aasElement) - { - return aasElement switch - { - AssetAdministrationShell => KeyTypes.AssetAdministrationShell, - Submodel => KeyTypes.Submodel, - ConceptDescription => KeyTypes.ConceptDescription, - SubmodelElementCollection => KeyTypes.SubmodelElementCollection, - SubmodelElementList => KeyTypes.SubmodelElementList, - BasicEventElement => KeyTypes.BasicEventElement, - Blob => KeyTypes.Blob, - Entity => KeyTypes.Entity, - File => KeyTypes.File, - MultiLanguageProperty => KeyTypes.MultiLanguageProperty, - Property => KeyTypes.Property, - Operation => KeyTypes.Operation, - AasCore.Aas3_0.Range => KeyTypes.Range, - ReferenceElement => KeyTypes.ReferenceElement, - RelationshipElement => KeyTypes.RelationshipElement, - AnnotatedRelationshipElement => KeyTypes.AnnotatedRelationshipElement, - IIdentifiable => KeyTypes.Identifiable, - IReferable => KeyTypes.Referable, - Reference => KeyTypes.GlobalReference, - //TODO (jtikekar, 0000-00-00): what about model reference - _ => KeyTypes.SubmodelElement, // default case - }; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/LocatedReference.cs b/src/AasxCsharpLibrary/Extensions/LocatedReference.cs deleted file mode 100644 index 26916c5b7..000000000 --- a/src/AasxCsharpLibrary/Extensions/LocatedReference.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -namespace Extensions -{ - public class LocatedReference - { - public IIdentifiable Identifiable; - public IReference Reference; - - public LocatedReference() { } - public LocatedReference(IIdentifiable identifiable, IReference reference) - { - Identifiable = identifiable; - Reference = reference; - } - } -} diff --git a/src/AasxCsharpLibrary/Extensions/MatchMode.cs b/src/AasxCsharpLibrary/Extensions/MatchMode.cs deleted file mode 100644 index 12792aa1a..000000000 --- a/src/AasxCsharpLibrary/Extensions/MatchMode.cs +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ -namespace Extensions -{ - public enum MatchMode - { - Strict, //may be not needed in future, as no local flag in V3 - Relaxed, //should be as default - Identification - } -} diff --git a/src/AasxCsharpLibrary/IAasxOnlineConnection.cs b/src/AasxCsharpLibrary/IAasxOnlineConnection.cs deleted file mode 100644 index 550bd7e21..000000000 --- a/src/AasxCsharpLibrary/IAasxOnlineConnection.cs +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System.IO; - -namespace AasxIntegrationBase -{ - /// - /// This interface describes a connection for a server resource of AASX contents, such as OPC UA or REST - /// - public interface IAasxOnlineConnection - { - bool IsValid(); - bool IsConnected(); - string GetInfo(); - Stream GetThumbnailStream(); - string UpdatePropertyValue( - AasCore.Aas3_0.Environment env, Submodel submodel, ISubmodelElement sme); - } -} diff --git a/src/AasxCsharpLibrary/LICENSE.txt b/src/AasxCsharpLibrary/LICENSE.txt deleted file mode 100644 index 01f9cb5eb..000000000 --- a/src/AasxCsharpLibrary/LICENSE.txt +++ /dev/null @@ -1,1475 +0,0 @@ -Copyright (c) 2018-2023 Festo SE & Co. KG -, -author: Michael Hoffmeister - -Copyright (c) 2019-2021 PHOENIX CONTACT GmbH & Co. KG -, -author: Andreas Orzelski - -Copyright (c) 2019-2020 Fraunhofer IOSB-INA Lemgo, - eine rechtlich nicht selbstaendige Einrichtung der Fraunhofer-Gesellschaft - zur Foerderung der angewandten Forschung e.V. - -Copyright (c) 2020 Schneider Electric Automation GmbH -, -author: Marco Mendes - -Copyright (c) 2020 SICK AG - -Copyright (c) 2021 KEB Automation KG - -Copyright (c) 2021 Lenze SE -author: Jonas Grote, Denis Göllner, Sebastian Bischof - -The AASX Package Explorer is licensed under the Apache License 2.0 -(Apache-2.0, see below). - -The AASX Package Explorer is a sample application for demonstration of the -features of the Asset Administration Shell. -The implementation uses the concepts of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed -under Creative Commons CC BY-ND 3.0 DE. - -When using eCl@ss or IEC CDD data, please check the corresponding license -conditions. - -------------------------------------------------------------------------------- - -The components below are used in AASX Package Explorer. -The related licenses are listed for information purposes only. -Some licenses may only apply to their related plugins. - -The browser functionality is licensed under the cefSharp license (see below). - -The Newtonsoft.JSON serialization is licensed under the MIT License -(MIT, see below). - -The QR code generation is licensed under the MIT license (MIT, see below). - -The Zxing.Net Dot Matrix Code (DMC) generation is licensed under -the Apache License 2.0 (Apache-2.0, see below). - -The Grapevine REST server framework is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The AutomationML.Engine is licensed under the MIT license (MIT, see below). - -The MQTT server and client is licensed under the MIT license (MIT, see below). - -The ClosedXML Excel reader/writer is licensed under the MIT license (MIT, -see below). - -The CountryFlag WPF control is licensed under the Code Project Open License -(CPOL, see below). - -The DocumentFormat.OpenXml SDK is licensed under the MIT license (MIT, -see below). - -The ExcelNumberFormat number parser is licensed under the MIT license (MIT, -see below). - -The FastMember reflection access is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The IdentityModel OpenID client is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The jose-jwt object signing and encryption is licensed under the -MIT license (MIT, see below). - -The ExcelDataReader is licensed under the MIT license (MIT, see below). - -Portions copyright (c) by OPC Foundation, Inc. and licensed under the -Reciprocal Community License (RCL, see below) - -The OPC UA Example Code of OPC UA Standard is licensed under the MIT license -(MIT, see below). - -The MSAGL (Microsoft Automatic Graph Layout) is licensed under the MIT license -(MIT, see below) - -Glob (https://www.nuget.org/packages/Glob/) is licensed under the MIT license -(MIT, see below). - -The Magick.NET library is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The SSharp.NET library (https://github.com/PetroProtsyk/SSharp) is licensed -under Apache License 2.0 (Apache-2.0, see below). - -------------------------------------------------------------------------------- - - -With respect to AASX Package Explorer -===================================== - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to cefSharp -======================== - -(https://raw.githubusercontent.com/cefsharp/CefSharp/master/LICENSE) - -Copyright © The CefSharp Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google Inc. nor the name Chromium Embedded - Framework nor the name CefSharp nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -With respect to Newtonsoft.Json -=============================== - -(https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md) - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to QRcoder -======================= - -(https://github.com/codebude/QRCoder/blob/master/LICENSE.txt) - -The MIT License (MIT) - -Copyright (c) 2013-2018 Raffael Herrmann - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to ZXing.Net -========================= -With respect to Grapevine -========================= -With respect to FastMember -========================== -With respect to IdentityModel -============================= - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - -With respect to MQTTnet -======================= - -(https://github.com/chkr1011/MQTTnet/blob/master/LICENSE) - -MIT License - -MQTTnet Copyright (c) 2016-2019 Christian Kratky - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to ClosedXML -========================= - -(https://github.com/ClosedXML/ClosedXML/blob/develop/LICENSE) - -MIT License - -Copyright (c) 2016 ClosedXML - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to CountryFlag -=========================== - -(https://www.codeproject.com/Articles/190722/WPF-CountryFlag-Control) - -The Code Project Open License (CPOL) 1.02 - -Copyright © 2017 Meshack Musundi - -Preamble - -This License governs Your use of the Work. This License is intended to allow -developers to use the Source Code and Executable Files provided as part of -the Work in any application in any form. - -The main points subject to the terms of the License are: - - Source Code and Executable Files can be used in commercial applications; - Source Code and Executable Files can be redistributed; and - Source Code can be modified to create derivative works. - No claim of suitability, guarantee, or any warranty whatsoever is provided. - The software is provided "as-is". - The Article(s) accompanying the Work may not be distributed or republished - without the Author's consent - -This License is entered between You, the individual or other entity reading or -otherwise making use of the Work licensed pursuant to this License and the -individual or other entity which offers the Work under the terms of this -License ("Author"). - -License - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS -CODE PROJECT OPEN LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT -AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED -UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE -TO BE BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS -CONTAINED HEREIN IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND -CONDITIONS. IF YOU DO NOT AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS -LICENSE, YOU CANNOT MAKE ANY USE OF THE WORK. - -Definitions. - "Articles" means, collectively, all articles written by Author which -describes how the Source Code and Executable Files for the Work may -be used by a user. - "Author" means the individual or entity that offers the Work under -the terms of this License. - "Derivative Work" means a work based upon the Work or upon the Work -and other pre-existing works. - "Executable Files" refer to the executables, binary files, -configuration and any required data files included in the Work. - "Publisher" means the provider of the website, magazine, CD-ROM, -DVD or other medium from or by which the Work is obtained by You. - "Source Code" refers to the collection of source code and -configuration files used to create the Executable Files. - "Standard Version" refers to such a Work if it has not been modified, -or has been modified in accordance with the consent of the Author, -such consent being in the full discretion of the Author. - "Work" refers to the collection of files distributed by the Publisher, -including the Source Code, Executable Files, binaries, data files, -documentation, whitepapers and the Articles. - "You" is you, an individual or entity wishing to use the Work and -exercise your rights under this License. - -Fair Use/Fair Use Rights. Nothing in this License is intended to reduce, -limit, or restrict any rights arising from fair use, fair dealing, -first sale or other limitations on the exclusive rights of the -copyright owner under copyright law or other applicable laws. - -License Grant. Subject to the terms and conditions of this License, the -Author hereby grants You a worldwide, royalty-free, non-exclusive, -perpetual (for the duration of the applicable copyright) license -to exercise the rights in the Work as stated below: - You may use the standard version of the Source Code or Executable -Files in Your own applications. - You may apply bug fixes, portability fixes and other modifications -obtained from the Public Domain or from the Author. A Work modified -in such a way shall still be considered the standard version and will -be subject to this License. - You may otherwise modify Your copy of this Work (excluding the Articles) -in any way to create a Derivative Work, provided that You insert a prominent -notice in each changed file stating how, when and where You changed that file. - You may distribute the standard version of the Executable Files and Source -Code or Derivative Work in aggregate with other (possibly commercial) -programs as part of a larger (possibly commercial) software distribution. - The Articles discussing the Work published in any form by the author may -not be distributed or republished without the Author's consent. The author -retains copyright to any such Articles. You may use the Executable Files and -Source Code pursuant to this License but you may not repost or republish or -otherwise distribute or make available the Articles, without the prior written -consent of the Author. - -Any subroutines or modules supplied by You and linked into the Source Code -or Executable Files of this Work shall not be considered part of this Work -and will not be subject to the terms of this License. - -Patent License. Subject to the terms and conditions of this License, each -Author hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, -royalty-free, irrevocable (except as stated in this section) patent license -to make, have made, use, import, and otherwise transfer the Work. - -Restrictions. The license granted in Section 3 above is expressly made subject -to and limited by the following restrictions: - You agree not to remove any of the original copyright, patent, trademark, -and attribution notices and associated disclaimers that may appear in the -Source Code or Executable Files. - You agree not to advertise or in any way imply that this Work is a product -of Your own. - The name of the Author may not be used to endorse or promote products -derived from the Work without the prior written consent of the Author. - You agree not to sell, lease, or rent any part of the Work. This does -not restrict you from including the Work or any part of the Work inside -a larger software distribution that itself is being sold. The Work by itself, -though, cannot be sold, leased or rented. - You may distribute the Executable Files and Source Code only under the terms -of this License, and You must include a copy of, or the Uniform Resource -Identifier for, this License with every copy of the Executable Files or -Source Code You distribute and ensure that anyone receiving such Executable -Files and Source Code agrees that the terms of this License apply to such -Executable Files and/or Source Code. You may not offer or impose any terms -on the Work that alter or restrict the terms of this License or the -recipients' exercise of the rights granted hereunder. You may not sublicense -the Work. You must keep intact all notices that refer to this License and to -the disclaimer of warranties. You may not distribute the Executable Files or -Source Code with any technological measures that control access or use of the -Work in a manner inconsistent with the terms of this License. - You agree not to use the Work for illegal, immoral or improper -purposes, or on pages containing illegal, immoral or improper material. -The Work is subject to applicable export laws. You agree to comply with all -such laws and regulations that may apply to the Work after Your receipt of -the Work. - -Representations, Warranties and Disclaimer. THIS WORK IS PROVIDED "AS IS", -"WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OR -CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE, -INCLUDING COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. -AUTHOR EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES -OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS -OF MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR -PURPOSE, OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK -(OR ANY PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES. -YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE -WORKS. - -Indemnity. You agree to defend, indemnify and hold harmless the Author and the -Publisher from and against any claims, suits, losses, damages, liabilities, -costs, and expenses (including reasonable legal or attorneys’ fees) -resulting from or relating to any use of the Work by You. - -Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, -IN NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL -THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY -DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE, -EVEN IF THE AUTHOR OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH DAMAGES. - -Termination. - This License and the rights granted hereunder will terminate -automatically upon any breach by You of any term of this License. -Individuals or entities who have received Derivative Works from You under -this License, however, will not have their licenses terminated provided such -individuals or entities remain in full compliance with those licenses. -Sections 1, 2, 6, 7, 8, 9, 10 and 11 will survive any termination of -this License. - If You bring a copyright, trademark, patent or any other infringement -claim against any contributor over infringements You claim are made by the -Work, your License from such contributor to the Work ends automatically. - Subject to the above terms and conditions, this License is perpetual -(for the duration of the applicable copyright in the Work). -Notwithstanding the above, the Author reserves the right to release the Work -under different license terms or to stop distributing the Work at any time; -provided, however that any such election will not serve to withdraw this -License (or any other license that has been, or is required to be, -granted under the terms of this License), and this License will continue -in full force and effect unless terminated as stated above. - -Publisher. The parties hereby confirm that the Publisher shall not, under -any circumstances, be responsible for and shall not have any liability -in respect of the subject matter of this License. The Publisher makes no -warranty whatsoever in connection with the Work and shall not be liable -to You or any party on any legal theory for any damages whatsoever, including -without limitation any general, special, incidental or consequential damages -arising in connection to this license. The Publisher reserves the right to -cease making the Work available to You at any time without notice - -Miscellaneous - This License shall be governed by the laws of the location of the head -office of the Author or if the Author is an individual, the laws of -location of the principal place of residence of the Author. - If any provision of this License is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of the -remainder of the terms of this License, and without further action by the -parties to this License, such provision shall be reformed to the minimum -extent necessary to make such provision valid and enforceable. - No term or provision of this License shall be deemed waived and no -breach consented to unless such waiver or consent shall be in writing -and signed by the party to be charged with such waiver or consent. - This License constitutes the entire agreement between the parties -with respect to the Work licensed herein. There are no understandings, -agreements or representations with respect to the Work not specified herein. -The Author shall not be bound by any additional provisions that may appear -in any communication from You. This License may not be modified without -the mutual written agreement of the Author and You. - - -With respect to DocumentFormat.OpenXml -====================================== - -(https://github.com/OfficeDev/Open-XML-SDK/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to ExcelNumberFormat -================================= - -(https://github.com/andersnm/ExcelNumberFormat/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2017 andersnm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to jose-jwt -======================== - -(https://github.com/dvsekhvalnov/jose-jwt/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014-2019 dvsekhvalnov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With resepect to ExcelDataReader -================================ - -(https://github.com/ExcelDataReader/ExcelDataReader/blob/develop/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014 ExcelDataReader - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepect to OPC UA Example Code -==================================== - - * Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. - * - * OPC Foundation MIT License 1.00 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * The complete license agreement can be found here: - * http://opcfoundation.org/License/MIT/1.00/ - - -With respect to OPC Foundation -============================== - -RCL License -Reciprocal Community License 1.00 (RCL1.00) -Version 1.00, June 24, 2009 -Copyright (C) 2008,2009 OPC Foundation, Inc., All Rights Reserved. - -https://opcfoundation.org/license/rcl.html - -Remark: PHOENIX CONTACT GmbH & Co. KG and Festo SE & Co. KG are members -of OPC foundation. - -With respect to MSAGL (Microsoft Automatic Graph Layout) -======================================================== -(see: https://github.com/microsoft/automatic-graph-layout/blob/master/LICENSE) - -Microsoft Automatic Graph Layout, MSAGL - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With respect to Glob (https://www.nuget.org/packages/Glob/) -=========================================================== -(see: https://raw.githubusercontent.com/kthompson/glob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2013-2019 Kevin Thompson - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to Magick.NET -========================== - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -With respect to SSharp.NET library -================================== - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/AasxCsharpLibrary/LogInternally.cs b/src/AasxCsharpLibrary/LogInternally.cs deleted file mode 100644 index 5b8061292..000000000 --- a/src/AasxCsharpLibrary/LogInternally.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright (c) 2020 ZHAW Zürcher Hochschule für Angewandte Wissenschaften -Author: Marko Ristin - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using Exception = System.Exception; - -namespace AdminShellNS -{ - public static class Logging - { - // see: https://stackoverflow.com/questions/9314172/getting-all-messages-from-innerexceptions - private static string GetExceptionMessages(this Exception e, string msgs = "") - { - if (e == null) return string.Empty; - if (msgs == "") msgs = e.Message; - if (e.InnerException != null) - msgs += "\r\nInnerException: " + GetExceptionMessages(e.InnerException); - return msgs; - } - - public static string FormatError(Exception ex, string where) - { - var res = string.Format("Error: {0}: {1} {2} at {3}.", - where, - ex.Message, - ex.GetExceptionMessages(), - ex.StackTrace); - - var inner = ex.InnerException; - while (inner != null) - { - res += $"Inner message: {inner.Message}" + System.Environment.NewLine; - inner = inner.InnerException; - } - - return res; - } - } - - public class InternalLog - { - /// - /// Logs the exception to STDERR. - /// - public void Error(Exception ex, string where) - { - System.Console.Error.WriteLine(Logging.FormatError(ex, where)); - } - - /// - /// Logs that the exception is silently ignored to STDERR. - /// - public void SilentlyIgnoredError(Exception ex) - { - System.Console.Error.WriteLine("The exception is silently ignored: {0} {1} at {2}.", - ex.Message, - ((ex.InnerException != null) ? ex.InnerException.Message : ""), - ex.StackTrace); - } - - /// - /// Does no logging at all. Allows to have non-empty catch clauses. - /// - public void CompletelyIgnoredError(Exception ex) - { - } - } - - /// - /// Handles logging meant to be read by developers (*i.e*, not by the users of the software). - /// - /// Please see AasxIntegrationBase\LogInstance.cs for how to keep logs intended - /// for the user. - public static class LogInternally - { - public static readonly InternalLog That = new InternalLog(); - } -} \ No newline at end of file diff --git a/src/AasxCsharpLibrary/Properties/AssemblyInfo.cs b/src/AasxCsharpLibrary/Properties/AssemblyInfo.cs deleted file mode 100644 index 1c46e4aa6..000000000 --- a/src/AasxCsharpLibrary/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("AasxCsharpLibrary")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AasxCsharpLibrary")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("9863799b-4e44-4da2-9120-c85c7985bc6d")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, -// indem Sie "*" wie unten gezeigt eingeben: -//// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/AasxCsharpLibrary/Resources/schemaV201/AAS.xsd b/src/AasxCsharpLibrary/Resources/schemaV201/AAS.xsd deleted file mode 100644 index 2e6c24f6b..000000000 --- a/src/AasxCsharpLibrary/Resources/schemaV201/AAS.xsd +++ /dev/null @@ -1,555 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/AasxCsharpLibrary/Resources/schemaV201/AAS_ABAC.xsd b/src/AasxCsharpLibrary/Resources/schemaV201/AAS_ABAC.xsd deleted file mode 100644 index 4048a5746..000000000 --- a/src/AasxCsharpLibrary/Resources/schemaV201/AAS_ABAC.xsd +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/AasxCsharpLibrary/Resources/schemaV201/IEC61360.xsd b/src/AasxCsharpLibrary/Resources/schemaV201/IEC61360.xsd deleted file mode 100644 index d52f04f1e..000000000 --- a/src/AasxCsharpLibrary/Resources/schemaV201/IEC61360.xsd +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/AasxCsharpLibrary/Resources/schemaV201/aas.json b/src/AasxCsharpLibrary/Resources/schemaV201/aas.json deleted file mode 100644 index 9583c2b1f..000000000 --- a/src/AasxCsharpLibrary/Resources/schemaV201/aas.json +++ /dev/null @@ -1,1148 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "title": "AssetAdministrationShellEnvironment", - "$id": "http://www.admin-shell.io/schema/json/v2.0.1", - "type": "object", - "required": ["assetAdministrationShells", "submodels", "assets", "conceptDescriptions"], - "properties": { - "assetAdministrationShells": { - "type": "array", - "items": { - "$ref": "#/definitions/AssetAdministrationShell" - } - }, - "submodels": { - "type": "array", - "items": { - "$ref": "#/definitions/Submodel" - } - }, - "assets": { - "type": "array", - "items": { - "$ref": "#/definitions/Asset" - } - }, - "conceptDescriptions": { - "type": "array", - "items": { - "$ref": "#/definitions/ConceptDescription" - } - } - }, - "definitions": { - "Referable": { - "type": "object", - "properties": { - "idShort": { - "type": "string" - }, - "category": { - "type": "string" - }, - "description": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - } - }, - "parent": { - "$ref": "#/definitions/Reference" - }, - "modelType": { - "$ref": "#/definitions/ModelType" - } - }, - "required": [ "idShort", "modelType" ] - }, - "Identifiable": { - "allOf": [ - { "$ref": "#/definitions/Referable" }, - { "properties": { - "identification": { - "$ref": "#/definitions/Identifier" - }, - "administration": { - "$ref": "#/definitions/AdministrativeInformation" - } - }, - "required": [ "identification" ] - } - ] - }, - "Qualifiable": { - "type": "object", - "properties": { - "qualifiers": { - "type": "array", - "items": { - "$ref": "#/definitions/Constraint" - } - } - } - }, - "HasSemantics": { - "type": "object", - "properties": { - "semanticId": { - "$ref": "#/definitions/Reference" - } - } - }, - "HasDataSpecification": { - "type": "object", - "properties": { - "embeddedDataSpecifications": { - "type": "array", - "items": { - "$ref": "#/definitions/EmbeddedDataSpecification" - } - } - } - }, - "AssetAdministrationShell": { - "allOf": [ - { "$ref": "#/definitions/Identifiable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "properties": { - "derivedFrom": { - "$ref": "#/definitions/Reference" - }, - "asset": { - "$ref": "#/definitions/Reference" - }, - "submodels": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - }, - "views": { - "type": "array", - "items": { - "$ref": "#/definitions/View" - } - }, - "conceptDictionaries": { - "type": "array", - "items": { - "$ref": "#/definitions/ConceptDictionary" - } - }, - "security": { - "$ref": "#/definitions/Security" - } - }, - "required": [ "asset" ] - } - ] - }, - "Identifier": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "idType": { - "$ref": "#/definitions/KeyType" - } - }, - "required": [ "id", "idType" ] - }, - "KeyType": { - "type": "string", - "enum": ["Custom", "IRDI", "IRI", "IdShort", "FragmentId"] - }, - "AdministrativeInformation": { - "type": "object", - "properties": { - "version": { - "type": "string" - }, - "revision": { - "type": "string" - } - } - }, - "LangString": { - "type": "object", - "properties": { - "language": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": [ "language", "text" ] - }, - "Reference": { - "type": "object", - "properties": { - "keys": { - "type": "array", - "items": { - "$ref": "#/definitions/Key" - } - } - }, - "required": [ "keys" ] - }, - "Key": { - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/KeyElements" - }, - "idType": { - "$ref": "#/definitions/KeyType" - }, - "value": { - "type": "string" - }, - "local": { - "type": "boolean" - } - }, - "required": [ "type", "idType", "value", "local" ] - }, - "KeyElements": { - "type": "string", - "enum": [ - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel", - "AccessPermissionRule", - "AnnotatedRelationshipElement", - "BasicEvent", - "Blob", - "Capability", - "ConceptDictionary", - "DataElement", - "File", - "Entity", - "Event", - "MultiLanguageProperty", - "Operation", - "Property", - "Range", - "ReferenceElement", - "RelationshipElement", - "SubmodelElement", - "SubmodelElementCollection", - "View", - "GlobalReference", - "FragmentReference" - ] - }, - "ModelTypes": { - "type": "string", - "enum": [ - "Asset", - "AssetAdministrationShell", - "ConceptDescription", - "Submodel", - "AccessPermissionRule", - "AnnotatedRelationshipElement", - "BasicEvent", - "Blob", - "Capability", - "ConceptDictionary", - "DataElement", - "File", - "Entity", - "Event", - "MultiLanguageProperty", - "Operation", - "Property", - "Range", - "ReferenceElement", - "RelationshipElement", - "SubmodelElement", - "SubmodelElementCollection", - "View", - "GlobalReference", - "FragmentReference", - "Constraint", - "Formula", - "Qualifier" - ] - }, - "ModelType": { - "type": "object", - "properties": { - "name": { - "$ref": "#/definitions/ModelTypes" - } - }, - "required": [ "name" ] - }, - "EmbeddedDataSpecification": { - "type": "object", - "properties": { - "dataSpecification": { - "$ref": "#/definitions/Reference" - }, - "dataSpecificationContent": { - "$ref": "#/definitions/DataSpecificationContent" - } - }, - "required": [ "dataSpecification", "dataSpecificationContent" ] - }, - "DataSpecificationContent": { - "oneOf": [ - { "$ref": "#/definitions/DataSpecificationIEC61360Content" }, - { "$ref": "#/definitions/DataSpecificationPhysicalUnitContent" } - ] - }, - "DataSpecificationPhysicalUnitContent": { - "type": "object", - "properties": { - "unitName": { - "type": "string" - }, - "unitSymbol": { - "type": "string" - }, - "definition": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - } - }, - "siNotation": { - "type": "string" - }, - "siName": { - "type": "string" - }, - "dinNotation": { - "type": "string" - }, - "eceName": { - "type": "string" - }, - "eceCode": { - "type": "string" - }, - "nistName": { - "type": "string" - }, - "sourceOfDefinition": { - "type": "string" - }, - "conversionFactor": { - "type": "string" - }, - "registrationAuthorityId": { - "type": "string" - }, - "supplier": { - "type": "string" - } - }, - "required": [ "unitName", "unitSymbol", "definition" ] - }, - "DataSpecificationIEC61360Content": { - "allOf": [ - { "$ref": "#/definitions/ValueObject" }, - { - "type": "object", - "properties": { - "dataType": { - "enum": [ - "DATE", - "STRING", - "STRING_TRANSLATABLE", - "REAL_MEASURE", - "REAL_COUNT", - "REAL_CURRENCY", - "BOOLEAN", - "URL", - "RATIONAL", - "RATIONAL_MEASURE", - "TIME", - "TIMESTAMP", - "INTEGER_COUNT", - "INTEGER_MEASURE", - "INTEGER_CURRENCY" - ] - }, - "definition": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - } - }, - "preferredName": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - } - }, - "shortName": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - } - }, - "sourceOfDefinition": { - "type": "string" - }, - "symbol": { - "type": "string" - }, - "unit": { - "type": "string" - }, - "unitId": { - "$ref": "#/definitions/Reference" - }, - "valueFormat": { - "type": "string" - }, - "valueList": { - "$ref": "#/definitions/ValueList" - }, - "levelType": { - "type": "array", - "items": { - "$ref": "#/definitions/LevelType" - } - } - }, - "required": [ "preferredName" ] - } - ] - }, - "LevelType": { - "type": "string", - "enum": [ "Min", "Max", "Nom", "Typ" ] - }, - "ValueList": { - "type": "object", - "properties": { - "valueReferencePairTypes": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/ValueReferencePairType" - } - } - }, - "required": [ "valueReferencePairTypes" ] - }, - "ValueReferencePairType": { - "allOf": [ - { "$ref": "#/definitions/ValueObject" } - ] - }, - "ValueObject": { - "type": "object", - "properties": { - "value": { "type": "string" }, - "valueId": { - "$ref": "#/definitions/Reference" - }, - "valueType": { - "type": "string", - "enum": [ - "anyUri", - "base64Binary", - "boolean", - "date", - "dateTime", - "dateTimeStamp", - "decimal", - "integer", - "long", - "int", - "short", - "byte", - "nonNegativeInteger", - "positiveInteger", - "unsignedLong", - "unsignedInt", - "unsignedShort", - "unsignedByte", - "nonPositiveInteger", - "negativeInteger", - "double", - "duration", - "dayTimeDuration", - "yearMonthDuration", - "float", - "gDay", - "gMonth", - "gMonthDay", - "gYear", - "gYearMonth", - "hexBinary", - "NOTATION", - "QName", - "string", - "normalizedString", - "token", - "language", - "Name", - "NCName", - "ENTITY", - "ID", - "IDREF", - "NMTOKEN", - "time" - ]} - } - }, - "Asset": { - "allOf": [ - { "$ref": "#/definitions/Identifiable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "properties": { - "kind": { - "$ref": "#/definitions/AssetKind" - }, - "assetIdentificationModel": { - "$ref": "#/definitions/Reference" - }, - "billOfMaterial": { - "$ref": "#/definitions/Reference" - } - }, - "required": [ "kind" ] - } - ] - }, - "AssetKind": { - "type": "string", - "enum": ["Type", "Instance"] - }, - "ModelingKind": { - "type": "string", - "enum": ["Template", "Instance"] - }, - "Submodel": { - "allOf": [ - { "$ref": "#/definitions/Identifiable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "$ref": "#/definitions/Qualifiable" }, - { "$ref": "#/definitions/HasSemantics" }, - { "properties": { - "kind": { - "$ref": "#/definitions/ModelingKind" - }, - "submodelElements": { - "type": "array", - "items": { - "$ref": "#/definitions/SubmodelElement" - } - } - } - } - ] - }, - "Constraint": { - "type": "object", - "properties": { - "modelType": { - "$ref": "#/definitions/ModelType" - } - }, - "required": [ "modelType" ] - }, - "Operation": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "inputVariable": { - "type": "array", - "items": { - "$ref": "#/definitions/OperationVariable" - } - }, - "outputVariable": { - "type": "array", - "items": { - "$ref": "#/definitions/OperationVariable" - } - }, - "inoutputVariable": { - "type": "array", - "items": { - "$ref": "#/definitions/OperationVariable" - } - } - } - } - ] - }, - "OperationVariable": { - "type": "object", - "properties": { - "value": { - "oneOf": [ - { "$ref": "#/definitions/Blob" }, - { "$ref": "#/definitions/File" }, - { "$ref": "#/definitions/Capability" }, - { "$ref": "#/definitions/Entity" }, - { "$ref": "#/definitions/Event" }, - { "$ref": "#/definitions/BasicEvent" }, - { "$ref": "#/definitions/MultiLanguageProperty" }, - { "$ref": "#/definitions/Operation" }, - { "$ref": "#/definitions/Property" }, - { "$ref": "#/definitions/Range" }, - { "$ref": "#/definitions/ReferenceElement" }, - { "$ref": "#/definitions/RelationshipElement" }, - { "$ref": "#/definitions/SubmodelElementCollection" } - ] - } - }, - "required": [ "value" ] - }, - "SubmodelElement": { - "allOf": [ - { "$ref": "#/definitions/Referable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "$ref": "#/definitions/HasSemantics" }, - { "$ref": "#/definitions/Qualifiable" }, - { "properties": { - "kind": { - "$ref": "#/definitions/ModelingKind" - } - } - } - ] - }, - "Event": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" } - ] - }, - "BasicEvent": { - "allOf": [ - { "$ref": "#/definitions/Event" }, - { "properties": { - "observed": { - "$ref": "#/definitions/Reference" - } - }, - "required": [ "observed" ] - } - ] - }, - "EntityType": { - "type": "string", - "enum": ["CoManagedEntity", "SelfManagedEntity"] - }, - "Entity": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "statements": { - "type": "array", - "items": { - "$ref": "#/definitions/SubmodelElement" - } - }, - "entityType": { - "$ref": "#/definitions/EntityType" - }, - "asset": { - "$ref": "#/definitions/Reference" - } - }, - "required": [ "entityType" ] - } - ] - }, - "View": { - "allOf": [ - { "$ref": "#/definitions/Referable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "$ref": "#/definitions/HasSemantics" }, - { "properties": { - "containedElements": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - } - } - } - ] - }, - "ConceptDictionary": { - "allOf": [ - { "$ref": "#/definitions/Referable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "properties": { - "conceptDescriptions": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - } - } - } - ] - }, - "ConceptDescription": { - "allOf": [ - { "$ref": "#/definitions/Identifiable" }, - { "$ref": "#/definitions/HasDataSpecification" }, - { "properties": { - "isCaseOf": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - } - } - } - ] - }, - "Capability": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" } - ] - }, - "Property": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "$ref": "#/definitions/ValueObject" } - ] - }, - "Range": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "valueType": { - "type": "string", - "enum": [ - "anyUri", - "base64Binary", - "boolean", - "date", - "dateTime", - "dateTimeStamp", - "decimal", - "integer", - "long", - "int", - "short", - "byte", - "nonNegativeInteger", - "positiveInteger", - "unsignedLong", - "unsignedInt", - "unsignedShort", - "unsignedByte", - "nonPositiveInteger", - "negativeInteger", - "double", - "duration", - "dayTimeDuration", - "yearMonthDuration", - "float", - "gDay", - "gMonth", - "gMonthDay", - "gYear", - "gYearMonth", - "hexBinary", - "NOTATION", - "QName", - "string", - "normalizedString", - "token", - "language", - "Name", - "NCName", - "ENTITY", - "ID", - "IDREF", - "NMTOKEN", - "time" - ] - }, - "min": { "type": "string" }, - "max": { "type": "string" } - }, - "required": [ "valueType"] - } - ] - }, - "MultiLanguageProperty": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - } - }, - "valueId": { - "$ref": "#/definitions/Reference" - } - } - } - ] - }, - "File": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "value": { - "type": "string" - }, - "mimeType": { - "type": "string" - } - }, - "required": [ "mimeType" ] - } - ] - }, - "Blob": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "value": { - "type": "string" - }, - "mimeType": { - "type": "string" - } - }, - "required": [ "mimeType" ] - } - ] - }, - "ReferenceElement": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "value": { - "$ref": "#/definitions/Reference" - } - } - } - ] - }, - "SubmodelElementCollection": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "value": { - "type": "array", - "items": { - "oneOf": [ - { "$ref": "#/definitions/Blob" }, - { "$ref": "#/definitions/File" }, - { "$ref": "#/definitions/Capability" }, - { "$ref": "#/definitions/Entity" }, - { "$ref": "#/definitions/Event" }, - { "$ref": "#/definitions/BasicEvent" }, - { "$ref": "#/definitions/MultiLanguageProperty" }, - { "$ref": "#/definitions/Operation" }, - { "$ref": "#/definitions/Property" }, - { "$ref": "#/definitions/Range" }, - { "$ref": "#/definitions/ReferenceElement" }, - { "$ref": "#/definitions/RelationshipElement" }, - { "$ref": "#/definitions/SubmodelElementCollection" } - ] - } - }, - "allowDuplicates": { - "type": "boolean" - }, - "ordered": { - "type": "boolean" - } - } - } - ] - }, - "RelationshipElement": { - "allOf": [ - { "$ref": "#/definitions/SubmodelElement" }, - { "properties": { - "first": { - "$ref": "#/definitions/Reference" - }, - "second": { - "$ref": "#/definitions/Reference" - } - }, - "required": [ "first", "second" ] - } - ] - }, - "AnnotatedRelationshipElement": { - "allOf": [ - { "$ref": "#/definitions/RelationshipElement" }, - { "properties": { - "annotation": { - "type": "array", - "items": { - "oneOf": [ - { "$ref": "#/definitions/Blob" }, - { "$ref": "#/definitions/File" }, - { "$ref": "#/definitions/MultiLanguageProperty" }, - { "$ref": "#/definitions/Property" }, - { "$ref": "#/definitions/Range" }, - { "$ref": "#/definitions/ReferenceElement" } - ] - } - } - } - } - ] - }, - "Qualifier": { - "allOf": [ - { "$ref": "#/definitions/Constraint" }, - { "$ref": "#/definitions/HasSemantics" }, - { "$ref": "#/definitions/ValueObject" }, - { "properties": { - "type": { - "type": "string" - } - }, - "required": [ "type" ] - } - ] - }, - "Formula": { - "allOf": [ - { "$ref": "#/definitions/Constraint" }, - { "properties": { - "dependsOn": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - } - } - } - ] - }, - "Security": { - "type": "object", - "properties": { - "accessControlPolicyPoints": { - "$ref": "#/definitions/AccessControlPolicyPoints" - }, - "certificate": { - "type": "array", - "items": { - "oneOf": [ - { "$ref": "#/definitions/BlobCertificate" } - ] - } - }, - "requiredCertificateExtension": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - } - }, - "required": [ "accessControlPolicyPoints" ] - }, - "Certificate": { - "type": "object" - }, - "BlobCertificate": { - "allOf": [ - { "$ref": "#/definitions/Certificate" }, - { "properties": { - "blobCertificate": { - "$ref": "#/definitions/Blob" - }, - "containedExtension": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - }, - "lastCertificate": { - "type": "boolean" - } - } - } - ] - }, - "AccessControlPolicyPoints": { - "type": "object", - "properties": { - "policyAdministrationPoint": { - "$ref": "#/definitions/PolicyAdministrationPoint" - }, - "policyDecisionPoint": { - "$ref": "#/definitions/PolicyDecisionPoint" - }, - "policyEnforcementPoint": { - "$ref": "#/definitions/PolicyEnforcementPoint" - }, - "policyInformationPoints": { - "$ref": "#/definitions/PolicyInformationPoints" - } - }, - "required": [ "policyAdministrationPoint", "policyDecisionPoint", "policyEnforcementPoint" ] - }, - "PolicyAdministrationPoint": { - "type": "object", - "properties": { - "localAccessControl": { - "$ref": "#/definitions/AccessControl" - }, - "externalAccessControl": { - "type": "boolean" - } - }, - "required": [ "externalAccessControl" ] - }, - "PolicyInformationPoints": { - "type": "object", - "properties": { - "internalInformationPoint": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - } - }, - "externalInformationPoint": { - "type": "boolean" - } - }, - "required": [ "externalInformationPoint" ] - }, - "PolicyEnforcementPoint": { - "type": "object", - "properties": { - "externalPolicyEnforcementPoint": { - "type": "boolean" - } - }, - "required": [ "externalPolicyEnforcementPoint" ] - }, - "PolicyDecisionPoint": { - "type": "object", - "properties": { - "externalPolicyDecisionPoints": { - "type": "boolean" - } - }, - "required": [ "externalPolicyDecisionPoints" ] - }, - "AccessControl": { - "type": "object", - "properties": { - "selectableSubjectAttributes": { - "$ref": "#/definitions/Reference" - }, - "defaultSubjectAttributes": { - "$ref": "#/definitions/Reference" - }, - "selectablePermissions": { - "$ref": "#/definitions/Reference" - }, - "defaultPermissions": { - "$ref": "#/definitions/Reference" - }, - "selectableEnvironmentAttributes": { - "$ref": "#/definitions/Reference" - }, - "defaultEnvironmentAttributes": { - "$ref": "#/definitions/Reference" - }, - "accessPermissionRule": { - "type": "array", - "items": { - "$ref": "#/definitions/AccessPermissionRule" - } - } - } - }, - "AccessPermissionRule": { - "allOf": [ - { "$ref": "#/definitions/Referable" }, - { "$ref": "#/definitions/Qualifiable" }, - { "properties": { - "targetSubjectAttributes": { - "type": "array", - "items": { - "$ref": "#/definitions/SubjectAttributes" - }, - "minItems": 1 - }, - "permissionsPerObject": { - "type": "array", - "items": { - "$ref": "#/definitions/PermissionsPerObject" - } - } - }, - "required": [ "targetSubjectAttributes" ] - } - ] - }, - "SubjectAttributes": { - "type": "object", - "properties": { - "subjectAttributes": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - }, - "minItems": 1 - } - } - }, - "PermissionsPerObject": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/Reference" - }, - "targetObjectAttributes": { - "$ref": "#/definitions/ObjectAttributes" - }, - "permission": { - "type": "array", - "items": { - "$ref": "#/definitions/Permission" - } - } - } - }, - "ObjectAttributes": { - "type": "object", - "properties": { - "objectAttribute": { - "type": "array", - "items": { - "$ref": "#/definitions/Property" - }, - "minItems": 1 - } - } - }, - "Permission": { - "type": "object", - "properties": { - "permission": { - "$ref": "#/definitions/Reference" - }, - "kindOfPermission": { - "type": "string", - "enum": ["Allow", "Deny", "NotApplicable", "Undefined"] - } - }, - "required": [ "permission", "kindOfPermission" ] - } - } -} diff --git a/src/AasxFileServerRestLibrary/AasxFileServerRestLibrary.csproj b/src/AasxFileServerRestLibrary/AasxFileServerRestLibrary.csproj index 52809af00..b55afcbe7 100644 --- a/src/AasxFileServerRestLibrary/AasxFileServerRestLibrary.csproj +++ b/src/AasxFileServerRestLibrary/AasxFileServerRestLibrary.csproj @@ -10,12 +10,10 @@ + - - - \ No newline at end of file diff --git a/src/AasxOpenidClient/AasxOpenidClient.csproj b/src/AasxOpenidClient/AasxOpenidClient.csproj index d784ee510..9a1817fd1 100644 --- a/src/AasxOpenidClient/AasxOpenidClient.csproj +++ b/src/AasxOpenidClient/AasxOpenidClient.csproj @@ -22,6 +22,7 @@ + @@ -30,6 +31,5 @@ - diff --git a/src/AasxPackageExplorer.sln b/src/AasxPackageExplorer.sln index f6856e50d..4fe7b9913 100644 --- a/src/AasxPackageExplorer.sln +++ b/src/AasxPackageExplorer.sln @@ -56,8 +56,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxSignature", "AasxSignat EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxOpenidClient", "AasxOpenidClient\AasxOpenidClient.csproj", "{7788AC2B-7F97-4755-B343-C4196FA90198}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxCsharpLibrary.Tests", "AasxCsharpLibrary.Tests\AasxCsharpLibrary.Tests.csproj", "{2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BaseCode", "BaseCode", "{DDA9C372-F8ED-4099-A53C-01B9333FD985}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxDictionaryImport.Tests", "AasxDictionaryImport.Tests\AasxDictionaryImport.Tests.csproj", "{B540EBF4-C026-45A4-9721-909AF0CC14C1}" @@ -117,8 +115,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AnyUi", "AnyUi\AnyUi.csproj EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorUI", "BlazorUI\BlazorUI.csproj", "{BCE9B9F3-35CD-4CEA-8C88-68B0FD48DFD5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SSIExtension", "SSIExtension\SSIExtension.csproj", "{03255E23-87A8-417F-A229-B9A626EA94FD}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxPluginKnownSubmodels", "AasxPluginKnownSubmodels\AasxPluginKnownSubmodels.csproj", "{49046502-71CE-4F6A-97C5-324F88FA6F75}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UIComponents.Flags.Blazor", "UIComponents.Flags.Blazor\UIComponents.Flags.Blazor.csproj", "{BEB47CF1-976D-4BF4-B668-586F314608F6}" @@ -129,17 +125,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxFileServerRestLibrary", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxBammRdfImExport", "AasxBammRdfImExport\AasxBammRdfImExport.csproj", "{00F5EA49-F66D-4104-A621-AF668DD58C05}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "jsoncanonicalizer", "jsoncanonicalizer\jsoncanonicalizer.csproj", "{A713E962-38FB-4FD0-9687-30F530E95E91}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "es6numberserializer", "es6numberserializer\es6numberserializer.csproj", "{AB60370B-DC87-414D-8A6C-7B095F940A1B}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Setup", "Setup", "{5BA4D327-1907-4F5A-BC90-5EA939497BFC}" EndProject Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "AasxPackageExplorerSetup", "AASXPackageExplorerSetup\AasxPackageExplorerSetup.wixproj", "{8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}" - ProjectSection(ProjectDependencies) = postProject - {AB60370B-DC87-414D-8A6C-7B095F940A1B} = {AB60370B-DC87-414D-8A6C-7B095F940A1B} - {A713E962-38FB-4FD0-9687-30F530E95E91} = {A713E962-38FB-4FD0-9687-30F530E95E91} - EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projektmappenelemente", "Projektmappenelemente", "{087C80D2-F815-401C-96ED-3BD61A768FF3}" ProjectSection(SolutionItems) = preProject @@ -152,10 +140,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AasxSchemaExport.Tests", "A EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorExplorer", "BlazorExplorer\BlazorExplorer.csproj", "{FF0DEFE4-84F7-4DC0-8C65-5ACE5153DD94}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasCore.Aas3_0", "AasCore.Aas3_0\AasCore.Aas3_0.csproj", "{6A1F717C-8F43-4260-98A6-49345F983EFC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxCsharpLibrary", "AasxCsharpLibrary\AasxCsharpLibrary.csproj", "{D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxPluginDigitalNameplate", "AasxPluginDigitalNameplate\AasxPluginDigitalNameplate.csproj", "{DA75828B-E5AC-4E9D-AE1F-398F8FF5AE25}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxPluginContactInformation", "AasxPluginContactInformation\AasxPluginContactInformation.csproj", "{938BB137-DC45-4A84-B0C9-AC46DA321FDB}" @@ -833,35 +817,6 @@ Global {7788AC2B-7F97-4755-B343-C4196FA90198}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU {7788AC2B-7F97-4755-B343-C4196FA90198}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {7788AC2B-7F97-4755-B343-C4196FA90198}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Debug|x64.ActiveCfg = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Debug|x64.Build.0 = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Debug|x86.ActiveCfg = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Debug|x86.Build.0 = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.DebugSlow|x64.Build.0 = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.DebugSlow|x86.Build.0 = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Release|Any CPU.Build.0 = Release|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Release|x64.ActiveCfg = Release|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Release|x64.Build.0 = Release|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Release|x86.ActiveCfg = Release|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.Release|x86.Build.0 = Release|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU {B540EBF4-C026-45A4-9721-909AF0CC14C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B540EBF4-C026-45A4-9721-909AF0CC14C1}.Debug|Any CPU.Build.0 = Debug|Any CPU {B540EBF4-C026-45A4-9721-909AF0CC14C1}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1460,36 +1415,6 @@ Global {BCE9B9F3-35CD-4CEA-8C88-68B0FD48DFD5}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU {BCE9B9F3-35CD-4CEA-8C88-68B0FD48DFD5}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {BCE9B9F3-35CD-4CEA-8C88-68B0FD48DFD5}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.Debug|x64.ActiveCfg = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.Debug|x64.Build.0 = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.Debug|x86.ActiveCfg = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.Debug|x86.Build.0 = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.DebugSlow|x64.Build.0 = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.DebugSlow|x86.Build.0 = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.Release|Any CPU.Build.0 = Release|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.Release|x64.ActiveCfg = Release|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.Release|x64.Build.0 = Release|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.Release|x86.ActiveCfg = Release|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.Release|x86.Build.0 = Release|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {03255E23-87A8-417F-A229-B9A626EA94FD}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU {49046502-71CE-4F6A-97C5-324F88FA6F75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {49046502-71CE-4F6A-97C5-324F88FA6F75}.Debug|Any CPU.Build.0 = Debug|Any CPU {49046502-71CE-4F6A-97C5-324F88FA6F75}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1640,66 +1565,6 @@ Global {00F5EA49-F66D-4104-A621-AF668DD58C05}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU {00F5EA49-F66D-4104-A621-AF668DD58C05}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {00F5EA49-F66D-4104-A621-AF668DD58C05}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.Debug|x64.ActiveCfg = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.Debug|x64.Build.0 = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.Debug|x86.ActiveCfg = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.Debug|x86.Build.0 = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.DebugSlow|x64.Build.0 = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.DebugSlow|x86.Build.0 = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.Release|Any CPU.Build.0 = Release|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.Release|x64.ActiveCfg = Release|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.Release|x64.Build.0 = Release|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.Release|x86.ActiveCfg = Release|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.Release|x86.Build.0 = Release|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {A713E962-38FB-4FD0-9687-30F530E95E91}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.Debug|x64.ActiveCfg = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.Debug|x64.Build.0 = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.Debug|x86.ActiveCfg = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.Debug|x86.Build.0 = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.DebugSlow|x64.Build.0 = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.DebugSlow|x86.Build.0 = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.Release|Any CPU.Build.0 = Release|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.Release|x64.ActiveCfg = Release|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.Release|x64.Build.0 = Release|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.Release|x86.ActiveCfg = Release|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.Release|x86.Build.0 = Release|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {AB60370B-DC87-414D-8A6C-7B095F940A1B}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Debug|Any CPU.ActiveCfg = Debug|x86 {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Debug|x64.ActiveCfg = Debug|x86 {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Debug|x86.ActiveCfg = Debug|x86 @@ -1813,66 +1678,6 @@ Global {FF0DEFE4-84F7-4DC0-8C65-5ACE5153DD94}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU {FF0DEFE4-84F7-4DC0-8C65-5ACE5153DD94}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {FF0DEFE4-84F7-4DC0-8C65-5ACE5153DD94}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.Debug|x64.ActiveCfg = Debug|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.Debug|x64.Build.0 = Debug|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.Debug|x86.ActiveCfg = Debug|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.Debug|x86.Build.0 = Debug|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.DebugSlow|Any CPU.ActiveCfg = DebugSlow|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.DebugSlow|Any CPU.Build.0 = DebugSlow|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.DebugSlow|x64.ActiveCfg = DebugSlow|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.DebugSlow|x64.Build.0 = DebugSlow|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.DebugSlow|x86.ActiveCfg = DebugSlow|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.DebugSlow|x86.Build.0 = DebugSlow|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.DebugWithoutCEF|Any CPU.ActiveCfg = DebugSlow|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.DebugWithoutCEF|Any CPU.Build.0 = DebugSlow|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.DebugWithoutCEF|x64.ActiveCfg = DebugSlow|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.DebugWithoutCEF|x64.Build.0 = DebugSlow|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.DebugWithoutCEF|x86.ActiveCfg = DebugSlow|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.DebugWithoutCEF|x86.Build.0 = DebugSlow|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.Release|Any CPU.Build.0 = Release|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.Release|x64.ActiveCfg = Release|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.Release|x64.Build.0 = Release|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.Release|x86.ActiveCfg = Release|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.Release|x86.Build.0 = Release|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {6A1F717C-8F43-4260-98A6-49345F983EFC}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.Debug|x64.ActiveCfg = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.Debug|x64.Build.0 = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.Debug|x86.ActiveCfg = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.Debug|x86.Build.0 = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.DebugSlow|x64.Build.0 = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.DebugSlow|x86.Build.0 = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.Release|Any CPU.Build.0 = Release|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.Release|x64.ActiveCfg = Release|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.Release|x64.Build.0 = Release|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.Release|x86.ActiveCfg = Release|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.Release|x86.Build.0 = Release|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU {DA75828B-E5AC-4E9D-AE1F-398F8FF5AE25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DA75828B-E5AC-4E9D-AE1F-398F8FF5AE25}.Debug|Any CPU.Build.0 = Debug|Any CPU {DA75828B-E5AC-4E9D-AE1F-398F8FF5AE25}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1960,7 +1765,6 @@ Global {DEC389BC-59BC-48E5-B163-6E44CE782C4A} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} {69824EF3-30F8-4C8A-874E-9B1F5873D25E} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} {7788AC2B-7F97-4755-B343-C4196FA90198} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} - {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9} = {DDA9C372-F8ED-4099-A53C-01B9333FD985} {B540EBF4-C026-45A4-9721-909AF0CC14C1} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} {F6CF3948-C67A-40FC-812A-3733F673EA21} = {C1752DB5-0157-4666-A25D-2666089457BB} {7A612803-BAE2-4FED-BBCE-56079EDB8594} = {66D730EB-B9D7-4C3A-8954-0F86240AD612} @@ -1982,18 +1786,13 @@ Global {45C60157-657F-4213-B5B0-185132CEA861} = {98C89299-C429-4F0B-9938-4B7775943393} {E9AC7B0F-58FC-4BD8-A1C9-97BBB34A4E99} = {DDA9C372-F8ED-4099-A53C-01B9333FD985} {BCE9B9F3-35CD-4CEA-8C88-68B0FD48DFD5} = {98C89299-C429-4F0B-9938-4B7775943393} - {03255E23-87A8-417F-A229-B9A626EA94FD} = {98C89299-C429-4F0B-9938-4B7775943393} {49046502-71CE-4F6A-97C5-324F88FA6F75} = {66D730EB-B9D7-4C3A-8954-0F86240AD612} {4B7BB0FD-0025-4B9F-AE2E-DA3467DBB40A} = {DDA9C372-F8ED-4099-A53C-01B9333FD985} {6BBAE5AF-8993-48D7-A80C-AA9550EE49D6} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} {00F5EA49-F66D-4104-A621-AF668DD58C05} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} - {A713E962-38FB-4FD0-9687-30F530E95E91} = {98C89299-C429-4F0B-9938-4B7775943393} - {AB60370B-DC87-414D-8A6C-7B095F940A1B} = {98C89299-C429-4F0B-9938-4B7775943393} {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34} = {5BA4D327-1907-4F5A-BC90-5EA939497BFC} {4EB64F40-1A01-46BB-BEED-D1A75313C7F8} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} {BE68E42C-28CB-4298-9F34-A18AF92FC4DE} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} - {6A1F717C-8F43-4260-98A6-49345F983EFC} = {DDA9C372-F8ED-4099-A53C-01B9333FD985} - {D39BC0A4-64EA-4C7B-B72C-BF0A80FF29FE} = {DDA9C372-F8ED-4099-A53C-01B9333FD985} {DA75828B-E5AC-4E9D-AE1F-398F8FF5AE25} = {66D730EB-B9D7-4C3A-8954-0F86240AD612} {938BB137-DC45-4A84-B0C9-AC46DA321FDB} = {66D730EB-B9D7-4C3A-8954-0F86240AD612} EndGlobalSection diff --git a/src/AasxPackageExplorer/options-debug.json b/src/AasxPackageExplorer/options-debug.json index 72231d660..87ed2365a 100644 --- a/src/AasxPackageExplorer/options-debug.json +++ b/src/AasxPackageExplorer/options-debug.json @@ -60,18 +60,18 @@ "PluginPrefer": "ANYUI", "PluginDll": [ - { - "Path": "..\\..\\..\\..\\..\\..\\AasxPluginUaNetServer\\bin\\Debug\\net6.0-windows\\AasxPluginUaNetServer.dll", - "Args": [ - "-single-nodeids", - "-single-keys", - "-ns", - "2", - "-ns", - "3" - ], - "Options": null - }, + //{ + // "Path": "..\\..\\..\\..\\..\\..\\AasxPluginUaNetServer\\bin\\Debug\\net6.0-windows\\AasxPluginUaNetServer.dll", + // "Args": [ + // "-single-nodeids", + // "-single-keys", + // "-ns", + // "2", + // "-ns", + // "3" + // ], + // "Options": null + //}, /*{ "Path": "..\\..\\..\\..\\..\\AasxPluginUaNetClient\\bin\\Debug\\net472\\AasxPluginUaNetClient.dll", "Args": [], @@ -90,10 +90,10 @@ "Args": [] } */ - { - "Path": "..\\..\\..\\..\\..\\..\\AasxPluginAssetInterfaceDesc\\bin\\Debug\\net6.0-windows\\AasxPluginAssetInterfaceDesc.dll", - "Args": [] - }, + //{ + // "Path": "..\\..\\..\\..\\..\\..\\AasxPluginAssetInterfaceDesc\\bin\\Debug\\net6.0-windows\\AasxPluginAssetInterfaceDesc.dll", + // "Args": [] + //}, { "Path": "..\\..\\..\\..\\..\\..\\AasxPluginKnownSubmodels\\bin\\Debug\\net6.0-windows\\AasxPluginKnownSubmodels.dll", "Args": [] @@ -106,10 +106,10 @@ "Path": "..\\..\\..\\..\\..\\..\\AasxPluginDocumentShelf\\bin\\Debug\\net6.0-windows\\AasxPluginDocumentShelf.dll", "Args": [] }, - { - "Path": "..\\..\\..\\..\\..\\..\\AasxPluginGenericForms\\bin\\Debug\\net6.0-windows\\AasxPluginGenericForms.dll", - "Args": [] - }, + //{ + // "Path": "..\\..\\..\\..\\..\\..\\AasxPluginGenericForms\\bin\\Debug\\net6.0-windows\\AasxPluginGenericForms.dll", + // "Args": [] + //}, { "Path": "..\\..\\..\\..\\..\\..\\AasxPluginAdvancedTextEditor\\bin\\Debug\\net6.0-windows\\AasxPluginAdvancedTextEditor.dll", "Args": [] diff --git a/src/AasxPackageLogic/AasxPackageLogic.csproj b/src/AasxPackageLogic/AasxPackageLogic.csproj index fea93b71c..0478447f7 100644 --- a/src/AasxPackageLogic/AasxPackageLogic.csproj +++ b/src/AasxPackageLogic/AasxPackageLogic.csproj @@ -31,6 +31,7 @@ + @@ -50,8 +51,6 @@ - -