Diffing DataTypeTemplates
child elements
#8
Replies: 6 comments 2 replies
-
A few thoughts on your questions:
Ultimately, we need to qualify our diffing with respect to some purpose, goal, objective or aim.: Consider:
So for some purposes, description matter and for others, not at all so we may have different types of diffing functions and need to build up our data structures to allow this kind of optionality. Eventually, we may have top-level functions which relate to these use cases although at the moment it is not entirely clear what those might be or how they should be used (to me at least!).
Again, I think we must qualify WRT purpose. If we are wanting to identify if say an IED has changed in "substance", then the id is just a key to allow referencing using the DataTypeTemplates. If I have two datatypes which are identical except for the id and I collapse them, nothing has changed, the IED is semantically the same as before. However for other purposes ("show me what changes this tool made to my SCL file") it may be important if we want to provide a very "low-level", porcelain style diff (I am thinking of the analogy between porcelain and plumbing commands in git for example). In general for many "useful compare functions" I think we want to collapse the datatypes back into the IED and for this, I currently view the id as containing no relevant information. In fact, from this point of view, there is no difference between the origin from a template and an instantiated data item. |
Beta Was this translation helpful? Give feedback.
-
Hmmm... but that means we either provide various set of functions or we have a way to exclude attributes, child elements from the comparison. Is that something we can/should do @ca-d? |
Beta Was this translation helpful? Give feedback.
-
I am not sure what this means @ca-d to be honest with you. Do you mean we need to find for each of those a set of attributes that always need to be taken into the diff? |
Beta Was this translation helpful? Give feedback.
-
How about this very general API: type IgnoreOtions = {
/** The tag name of the children element to ignore */
children?: string[]
/** The attribute keys to ignore */
attributes?: string []
...
}
/** @returns Either a diff funtion that allows to determin a configurable isEqual or undefined in case there is not diff for a specific tag name yet*/
function isEqualSclElement(ours: Element, theirs:Element): ((ignore: IgnoreOptions) => boolean) | undefined |
Beta Was this translation helpful? Give feedback.
-
With the above, we cannot really set an |
Beta Was this translation helpful? Give feedback.
-
I added the intermediate results of yesterday's API discussions as a comment to #10 |
Beta Was this translation helpful? Give feedback.
-
Little disclamer before I kick off the discussion:
##
DO
fromtDO
name
,type
,accessControl
andtransient
##
DA
fromtDA
fc
,dchg
,qchg
,dupd
,name
,bType
,type
,count
,sAddr
,valKind
,valImport
Val
,ProtNs
##
BDA
fromtBDA
name
,bType
,type
,count
,sAddr
,valKind
,valImport
Val
##
EnumVal
fromtEnumVal
ord
##
EnumType
fromtEnumType
id
EnumVal
##
DAType
fromtDAType
id
,iedType
BDA
,ProtNs
##
DOType
fromtDOType
id
,iedType
,cdc
DA
,SDO
##
LNodeType
fromtLNodeType
id
,iedType
,lnClass
DO
##
Val
fromtVal
sGroup
##
ProtNs
fromtProNs
type
The above is pretty obvious to me. I personally have some question I would need to be answered before starting to work on this topic:
desc
field. I am not sure. This is a description of a thing, not really the thing itself.id
? When I want to compare twoLNodeTypes
for exampled regarding their content I want to takelnClass
andiedType
into account but theid
?Beta Was this translation helpful? Give feedback.
All reactions