-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import simple NodeSet2 file is incomplete #510
Comments
Blocker for mpostol/ASMD#158 |
Transfer because the main functionality is implemented here. |
Further development will be conducted on the branch https://github.com/mpostol/OPC-UA-OOI/tree/SemanticData-6.1.3 |
Testing scope
|
- added Unit test against model in concern - UT 👍 - no unexpected errors reported
Test Name: eoursel510Test Test Outcome: Passed Result StandardOutput: Debug Trace: Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Entering IAddressSpaceContext.ValidateAndExportModel - starting for the http://tricycletypev1/ namespace. Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information AddressSpaceContext.ValidateAndExportModel - selected 8 nodes to be added to the model. Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Finishing Validator.ValidateExportModel - the model contains 8 nodes.
@eoursel the result of Test Name: eoursel510Test
Test Outcome: Passed
Result StandardOutput:
Debug Trace:
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Entering IAddressSpaceContext.ValidateAndExportModel - starting for the http://tricycletypev1/ namespace.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information AddressSpaceContext.ValidateAndExportModel - selected 8 nodes to be added to the model.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Finishing Validator.ValidateExportModel - the model contains 8 nodes.
generic export implementation has been used for testing. |
hi @mpostol, Thanks again |
@eoursel thanks, I haven't yet generated the ModelDesign file. The task |
@eoursel Except for simple errors in the code (let exclude this case for a while), the reason for the problem you have reported is conditions used to select nodes to validate and export. Now the method
Related issues:[ ] reconsider conditions used for selection of Nodes Comments are welcome, but for now, I will report the above-mentioned problems. |
hi @mpostol, i don't get your point. All the nodes are on the browse path. Do you have a concrete example of such a node? . I am using Siemens Siome which do not display any error in the validation of the NodeSet file. Regards |
@eoursel It is just a hypothesis. I will check it. At least this scenario is now not subject of validation, but in my opinion should be, shouldn't it? After improving this validation method I will get the list of nodes if any. I will work on it using above mentioned independent issues. I will be back with the results soon. |
@eoursel do you have a copy of the document OPC UA Companion Specification Template. It is not available on the OPC website - the page is empty for my account. I am collecting materials from the spec that can be used to resolve some questions related to |
Hi @mpostol should be in the harmonization working group. I am checking. |
Hi @eoursel, I have improved the error processing and logging infrastructure and the current result for the model in concern processing is as follows: Test Name: eoursel510Test
Test Outcome: Passed
Result StandardOutput:
Debug Trace:
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Entering AddressSpaceContext creator - starting creation the OPC UA Address Space.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Address Space - the OPC UA defined has been uploaded.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Entering AddressSpaceContext.ImportNodeSet - starting import UAOOI.SemanticData.UANodeSetValidation.XML.UAModelContext.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information AddressSpaceContext.ImportNodeSet - the context for the imported model is created and starting import nodes.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Finishing AddressSpaceContext.ImportNodeSet - imported 3909 nodes.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Address Space - has bee created successfully.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Entering AddressSpaceContextService.ImportUANodeSet - importing form file
Trace: Information, Error Focus:Diagnostic, ErrorID: P0-0001010000 Info: The XML attribute or element is not supported and neglected. Extensions is omitted during the import
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Entering AddressSpaceContext.ImportNodeSet - starting import UAOOI.SemanticData.UANodeSetValidation.XML.UAModelContext.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information AddressSpaceContext.ImportNodeSet - the context for the imported model is created and starting import nodes.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Finishing AddressSpaceContext.ImportNodeSet - imported 54 nodes.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Entering IAddressSpaceContext.ValidateAndExportModel - starting for the http://tricycletypev1/ namespace.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Selected 8 types to be validated.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Selected 0 instances referenced by the ObjectsFolder to be validated.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Finishing Validator.ValidateExportModel - the model contains 8 nodes, and nor errors reported
After removing inherited and instance declaration nodes the recovered information model contains 8 The result says that the model contains 54 nodes, but only 8 types and 0 instances referenced by the <UAObjectType NodeId="ns=1;i=12" BrowseName="1:VehicleType">
<DisplayName>VehicleType</DisplayName>
<References>
<Reference ReferenceType="HasSubtype" IsForward="false">i=58</Reference>
</References>
</UAObjectType>
<UAVariable DataType="DateTime" NodeId="ns=1;i=13" BrowseName="buildDate" ParentNodeId="ns=1;i=12">
<DisplayName>buildDate</DisplayName>
<References>
<Reference ReferenceType="HasProperty" IsForward="false">ns=1;i=12</Reference>
<Reference ReferenceType="HasTypeDefinition">i=63</Reference>
<Reference ReferenceType="HasModellingRule">i=78</Reference>
</References>
</UAVariable> The Any comments are welcome. I will wait for your opinion. |
Hi @mpostol but there is the HasProperty reference to link i=13 to i=12 with the IsForward = false. As a result the i=13 node is defined as a property of the object type i=12. And so this dammed variable is not orphaned but attached by a reverse reference. Because it is not forbidden by the schema to make reverse references some nodeset authors use this construct which is completely brain damaged I must admit. |
@eoursel I see. You are right and it makes sense to add randomly new components (members). I was sure that |
@eoursel working on the section Address Space Concept Executive Summary - in a document where I try to work out a conclusion of our findings - I try to figure out a scenario (sequence of services defined in Part 4)) for the OPC UA Client that it shall apply to get access to the Can you help me in this respect? |
@mpostol I can't get your point. For sure if you browse the Node VehicleType you should find a reference HasProperty to the node BuildDate. I just checked with UaExpert or any other client. I think that the way the NodeSet import is working in a server is that the two options are semantically identical
The server will create in memory This is true for any any kind of reference. Not only HasProperty. |
@eoursel I am not saying that something is wrong but I ony try to recover a services call sequence a client shall apply to browse to As you know I am not checking the results against any selected product, but rather against the specification. Of course, any results from the existing products are more than welcome. In the context of references, I am using three terms: The Node that contains the Reference is referred to as the `SourceNode` and the Node that is referenced is referred to as the `TargetNode`. Of course, it is not the only place defining the reference term but it doesn't mention something about |
- fixed errors and improved diagnostic information
- cleanup code - removed useless comments - unimportant changes - UT 👎
- updated NodeSet files using current ModelCompiler implementation - Removed graph HasEncoding references - added warning, because the round trip test cannot be resolved (Key extension is same for different nodes) - improved unit tests - UT :21:
- added SemanticData/BuildingErrorsHandling/IIdentifierSyntax.md to formaly define syntax of the build errors. - no code changes
@eoursel, The BuildError.Identifier provides details allowing to select of the appropriate section in the specification that has been used to derive this validation rule. The BuildError entries are preliminary and subject to further modifications. In the last commit, I have added a formal description of the It is hard to say if a reported problem is a critical one or just a warning because the specification is inconsistent, incomplete and work is in progress. At the very beginning, as a corporate member, I had submitted a preliminary list of IM validation problems as a starting point for further work on IM compliance to promote the reusability of the models at design-time. Unfortunately, there was no follow-up, so the work was put on hold. The list is prepared in XML to guarantee portability between different environments. |
Hi @eoursel, I hope you are still following me. To move forward the discussion related to the errors severity level I have abstracted a bunch of snippets referring to the BrowseName from the specification. I am trying to find a rule that can be applied to the model BrowseNameInheritedFrom0.xml to distinguish that |
- used Object.ReferenceEquals to compare references - refactoring definitions - unimportant changes
Import simple NodeSet2 file is incomplete #510
- tested possibility to convert NodeSet to ModelDesign
Import simple NodeSet2 file is incomplete #510
- tested possibility to open in the ASMD 👍
Import simple NodeSet2 file is incomplete #510
- possibility to compile ModelDesign and generate NodeSet file (round trip test) 👎 Error generated by the ModelCompiler At Build: 851392402 Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information; At Build: 851392402 Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information; !ERROR! The following has occurred: The BaseType reference for node TrailerType is not valid: VehicleType. at Opc.Ua.ModelCompiler.ModelCompilerValidator.FindNode(XmlQualifiedName symbolicId, Type requiredType, String sourceName, String referenceName) at Opc.Ua.ModelCompiler.ModelCompilerValidator.ImportType(TypeDesign type) at Opc.Ua.ModelCompiler.ModelCompilerValidator.Import(NodeDesign node, NodeDesign parent) at Opc.Ua.ModelCompiler.ModelCompilerValidator.Validate2(IList`1 designFilePaths, String identifierFilePath, Boolean generateIds) at Opc.Ua.ModelCompiler.ModelGenerator2.ValidateAndUpdateIds(IList`1 d
Compilation fails if the base type ( |
@eoursel it looks like your model has circular references created using the From the spec:
My point is that it should be recognized as a critical error. |
- possibility to compile ModelDesign and generate NodeSet file (round trip test) 👍 After swapping the definition of the types (the base type must be located before the derived types) the `ModelCompiler` works. ASMD `Browse View` works in any case.
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
-->Hi @mpostol I can’t see this refereence TrailerType -> HasOreredComponent -> TrailerType when i open the model with Siemens Siome. But there is a reference to a variable LoadedTricycle with a DataType TriCycleDataType. It looks good for me. I don’t understand how you can construct this circular reference that Siome do not detect. That’s said, i don’t want to attach a great value to this model, it was designed to test the behavior of complex types with the C# code generator and i am not the author of this model. Today, i would like to focus on VDMA models (Robotics Machine Vision) , AutomationML and Asset Administration Shells. I think we need support for C# code generation for these models which is not the case today. Regards De : MariuszEnvoyé le :jeudi 18 mars 2021 22:34À : mpostol/OPC-UA-OOICc : Eric OURSEL; MentionObjet :Re: [mpostol/OPC-UA-OOI] Import simple NodeSet2 file is incomplete ***@***.*** it looks like your model has circular references created using the HierhicalReferences. Can you confirm?From the spec:P03-0705 HasChild ReferenceType - the HasChild ReferenceType is an abstract ReferenceType; only subtypes of it can be used. It is a subtype of HierarchicalReferences.The semantic is to indicate that References of this type span a non-looping hierarchy.Starting from Node “A” and only following References of the subtypes of the HasChild ReferenceType it shall never be possible to return to “A”. But it is allowed that following the References there may be more than one path leading to another Node “B”.My point is that it should be recognized as a critical error.Waiting for your opinion.—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
|
@eoursel thanks for the feedback. Of course, my concern is not the model itself. I know that the model is just an example without any production value. My concern is how to prove that the methodology is correct. Recovering ModelDesign from UANodeSet is a complex process, therefore first I try to prove that the result is as expected. From your comment, I can derive that the recovered Opc.Ua.NodeSet2.TriCycleType_V1.1.ModelDesign.xml Refereing to the C# code genrator. My point is that it is much easier to implement UANodeSet => C# generator than UANodeSet =>ModelDesign=>C# multi-stage, multitool process. In all of the cases, we are discussing the domain-specific language (DSL). Following this idea consider starting from C#, and in this case, we need C#=>ModelDesign converter. The question is which one DSL should be the source. There is no universal answer for sure. The answer must be a result of research but not just a decision. Anyway, I am open to any suggestions. This work is community-driven so your opinion matters. |
- after fixing the #558 generated the following mode. As prviously compiler cannot compile it because of the sequence of type declarations
- final model recovered from the origin with changed sequence of nodes definition against the compiler
- recovered ModelDesign Opc.Ua.NodeSet2.TriCycleType_V1.1.ModelDesign.xml
Import simple NodeSet2 file is incomplete #510
@eoursel let me inform you that I have just generated the recovered ModelDesign. This folder also contains other associated files. The diagnostic log is attached to this comment. Hopefully, the content is as expected. Let me know how it works for you. |
@eoursel it will be continued in mpostol/UA-Nodeset#4. |
Describe the bug
When i try to import this NodeSet2 file which is just a useless type which contains some custom datatypes i observe several issues
To Reproduce
Import the attached NodeSet2 file.
Opc.Ua.NodeSet2.TriCycleType_V1.1.xml.zip
Additional context
Last source code from master branch
Best regards
The text was updated successfully, but these errors were encountered: