Skip to content
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

Mapping spec #54

Closed
wants to merge 12 commits into from
Closed

Mapping spec #54

wants to merge 12 commits into from

Conversation

Kantiran91
Copy link
Member

Add the Spec for the umati Dashboard PubSub

Spec.md Outdated Show resolved Hide resolved
Spec.md Outdated Show resolved Hide resolved
@GoetzGoerisch GoetzGoerisch changed the base branch from main to upstream July 1, 2024 06:25
@GoetzGoerisch GoetzGoerisch changed the base branch from upstream to develop July 1, 2024 06:25
Spec.md Outdated Show resolved Hide resolved
Spec.md Outdated Show resolved Hide resolved
Spec.md Outdated Show resolved Hide resolved
Spec.md Outdated Show resolved Hide resolved
Spec.md Outdated Show resolved Hide resolved
Spec.md Outdated Show resolved Hide resolved
@GoetzGoerisch GoetzGoerisch force-pushed the develop branch 2 times, most recently from 976edd5 to 5d64fd8 Compare July 1, 2024 09:39
Spec.md Outdated Show resolved Hide resolved
Spec.md Outdated

A field can also contain properties but no other variables, even though the address space can contain more hierarchies. Properties of objects also cannot be mapped to the properties of a field. Therefore, a uniform mapping is used for objects and variables so that access is always consistent.

## Mapping of References
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think including the TypeDefintion of the Objects and maybe even the nested VariableTypes (e.g. FiniteStateVariableType for CurrentState) the is also needed, as the Frontend has some conditional rendering logic based on TypeDefinitions. I suggest adding Fields with TypeDefintion for the ObjectNode of the DataSet. E.g.:

        "Fields": [
            {
                "Name": "TypeDefinition",
                "Description": {
                    "Locale": "",
                    "Text": ""
                },
                "FieldFlags": 0,
                "BuiltInType": 0,
                "DataType": {
                    "Id": 0
                },
                "ValueRank": 1926237584,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "DataSetFieldId": "57B13D4E-3F71-2A07-5AE5-1E9107E09EF9",
                "Properties": []
            },

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I´m not sure. The TypeDeifnition is given in the MetaData. If it is part of the DataSet a lot of value which do not change will send in every message.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it matters much, except that using the description may not be semantically straightforward.
Wouldn't we use Delta Frames if we were interested in low bandwidth anyway?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Key and Delta Frames, should be followed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, both solutions are not elegant as they misuse some concepts of the specification. I understand your point about mapping as a field, keeping the information in the same place, but with Delta Frames, this information is also missing, and a client would need a mapping logic.

The solution with the JSON description has the advantage of being extendable, and we also need to encode references somewhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do you think using the field is violating the Spec?

We add MetaData (the TypeDefinition) to the DataSet

E.g, how to serialize the TypeDefintion (FiniteStateVariableType) of the CurrentState if it is part of the State's DataSet.

The CurrentState has a own Topic that describes the Type.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but nothing in the spec forbids this, I guess, as arbitrary fields can be added.
Ah ok, then this should be updated:

The image shows a part of an address space. Each object is mapped to a DataSet:

Production
ActiveProgram
State

If CurrentState gets its own message, we break the semantics, that each ObjectNode (object?) gets its own DataSet?
What would be the semantics? There is always an own DataSet for nodes, if they are object nodes or if they are VariableTypes with properties? It they are VariableTypes with properties they get their own Topic, otherwise they are added to the parent?

I find the simpler mapping of ObjectType -> Own topic, VariableType -> no own topic more straightforward.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The semantic idea was that a topic contains the childs. So the value of a Variable is in the DataSet of the Object an the childs are in the new Topic.

The question in a straightforward mapping is, how to handle that variable also can have childs and grandchilds?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but nothing in the spec forbids this, I guess, as arbitrary fields can be added.

Yes also nothing forbids to use the description. Both solution are ugly in my point of view. The description solution try to map metadata to metadata and data to data.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wlkrm I try to describe both variants. Can you please check if I describe the Field solution correct?
If it is okay for you I would suggest to send this doc with both variants to the OPC Foundation and get their opinion.

@ccvca
Copy link
Member

ccvca commented Jul 1, 2024

How to derive the Topic-Path for specifictions like CNC, where Nodes have multiple BrowsePaths?
Whats the topic of Nodes without a BrowsePath (e.g. Events that are not hierarchical connected to the address space)

@Kantiran91 Kantiran91 linked an issue Jul 1, 2024 that may be closed by this pull request
Spec.md Outdated Show resolved Hide resolved
@GoetzGoerisch
Copy link
Member

@Kantiran91 could you please rebase onto of the latest develop?

@Kantiran91
Copy link
Member Author

How to derive the Topic-Path for specifictions like CNC, where Nodes have multiple BrowsePaths? Whats the topic of Nodes without a BrowsePath (e.g. Events that are not hierarchical connected to the address space)

For multiple BrowsePath I add a field in the description. An other solution (also with some problems) to send the same message to different topics.

Topic of Nodes without a BrowsePath are currently not described. For Event a solution to use the BrowsePath of the SourceNode as Topic.

Spec.md Outdated Show resolved Hide resolved
@wlkrm
Copy link

wlkrm commented Jul 2, 2024

Additional Questions from @ccvca and me:

  • Use NodeId as topics?
  • How to identify machine dataset to find entry point for reconstruction
  • How do you handle inheritance, i.e., custom types based on spec types? Publish ObjectTypeDefinition address space part

@Kantiran91
Copy link
Member Author

Additional Questions from @ccvca and me:

  • Use NodeId as topics?

Than you have a lots of topic without a semantic and this make debugging an mapping more complex

  • How to identify machine dataset to find entry point for reconstruction

With the TypeDefinition

  • How do you handle inheritance, i.e., custom types based on spec types? Publish ObjectTypeDefinition address space part

Currently we also have not add this information. We can add a Field for that.

Spec.md Outdated Show resolved Hide resolved
Spec.md Outdated Show resolved Hide resolved
Spec.md Outdated Show resolved Hide resolved
Spec.md Outdated Show resolved Hide resolved
@wlkrm
Copy link

wlkrm commented Jul 3, 2024

Additional Questions from @ccvca and me:

  • Use NodeId as topics?

Than you have a lots of topic without a semantic and this make debugging an mapping more complex

Yes, our concern is, that using non-unique BorwsePaths isn't a good semantic as well. Is this problem solved by the current mapping?

  • How to identify machine dataset to find entry point for reconstruction

With the TypeDefinition

See below. How to know, which level of inheritance is the one to include in the TypeDefinition?

  • How do you handle inheritance, i.e., custom types based on spec types? Publish ObjectTypeDefinition address space part

Currently we also have not add this information. We can add a Field for that.

Not sure if a field is enough, how would one know, which level in the hierarchy is the correct "Spec"-TypeDefinition. We had some issues with that in the past, because essentially you cannot know, which is the correct level in the hierarchy. Ideally we would expose the AddressSpace part of the Types as well to be prepared...

@Kantiran91
Copy link
Member Author

Kantiran91 commented Jul 3, 2024

Additional Questions from @ccvca and me:

  • Use NodeId as topics?

Than you have a lots of topic without a semantic and this make debugging an mapping more complex

Yes, our concern is, that using non-unique BorwsePaths isn't a good semantic as well. Is this problem solved by the current mapping?

The last solution is that we use the HierachicalReference to create an subtopic (I will change the spec tomorrow) and the BrowseName as TopicName with an Itteration if more as one fit. The unique identification should be done in the MetaData (Including NodeId and BrowsePath).

  • How to identify machine dataset to find entry point for reconstruction

With the TypeDefinition

See below. How to know, which level of inheritance is the one to include in the TypeDefinition?

  • How do you handle inheritance, i.e., custom types based on spec types? Publish ObjectTypeDefinition address space part

Currently we also have not add this information. We can add a Field for that.

Not sure if a field is enough, how would one know, which level in the hierarchy is the correct "Spec"-TypeDefinition. We had some issues with that in the past, because essentially you cannot know, which is the correct level in the hierarchy. Ideally we would expose the AddressSpace part of the Types as well to be prepared...

Yes I think we should give the complete inheritance tree in this field as Array. And as second field also the Implemented Interfaces.

Spec.md Outdated Show resolved Hide resolved
@GoetzGoerisch GoetzGoerisch self-requested a review July 11, 2024 12:14
Copy link
Member

@ccvca ccvca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NodeId of the objects and variables is not published anywhere? I was just thinking about variales, which have a NodeId as Value to point to something (because a subscription is easier than a ModelChange event)

requirements/Spec.md Outdated Show resolved Hide resolved
requirements/Spec.md Outdated Show resolved Hide resolved
renovate bot and others added 2 commits July 12, 2024 08:53
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@GoetzGoerisch
Copy link
Member

@Kantiran91 how are the next steps here?

@GoetzGoerisch GoetzGoerisch force-pushed the develop branch 5 times, most recently from 3de6a7d to f64289e Compare September 3, 2024 08:40
@GoetzGoerisch GoetzGoerisch force-pushed the develop branch 2 times, most recently from 4f72173 to 3bb453d Compare September 23, 2024 14:03
Copy link
Member Author

@Kantiran91 Kantiran91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add some changes

Copy link
Member Author

@Kantiran91 Kantiran91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add some changes

@Kantiran91 Kantiran91 closed this Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EPIC: Define a mapping of Addressspace infos to OPC UA PubSub
5 participants