Example:
Original Tags:
Original Tags
{
"tags": [
{
"name": "Folder A",
"tagType": "Folder",
"tags": [
{
"valueSource": "memory",
"dataType": "Float8",
"name": "Tag AA",
"value": 12,
"tagType": "AtomicTag",
"engUnit": "°C"
},
{
"valueSource": "memory",
"dataType": "Boolean",
"name": "Tag AB",
"value": true,
"tagType": "AtomicTag",
"engUnit": ""
}
]
},
{
"valueSource": "memory",
"dataType": "Float8",
"name": "Tag A",
"value": 12,
"tagType": "AtomicTag",
"engUnit": "°C"
},
{
"valueSource": "memory",
"dataType": "Boolean",
"name": "Tag B",
"value": true,
"tagType": "AtomicTag",
"engUnit": ""
}
]
}
Changed/New Tags:
Changed Tags
{
"tags": [
{
"name": "Folder A",
"tagType": "Folder",
"tags": [
{
"valueSource": "memory",
"dataType": "Float8",
"name": "Tag AA",
"value": 12,
"tagType": "AtomicTag",
"engUnit": "°C"
},
{
"valueSource": "memory",
"dataType": "Boolean",
"name": "Tag AC",
"value": true,
"tagType": "AtomicTag",
"engUnit": ""
}
]
},
{
"name": "Folder B",
"tagType": "Folder",
"tags": [
{
"valueSource": "memory",
"dataType": "Float8",
"name": "Tag BA",
"value": 12,
"tagType": "AtomicTag",
"engUnit": "°C"
},
{
"valueSource": "memory",
"dataType": "Boolean",
"name": "Tag BC",
"value": true,
"tagType": "AtomicTag",
"engUnit": ""
}
]
},
{
"valueSource": "memory",
"dataType": "String",
"name": "Tag B",
"value": "Hello World!",
"tagType": "AtomicTag",
"engUnit": ""
}
]
}
What I'm expecting to be able to see from a diff is:
Folder A/Tag BB: Removed
Folder A/Tag CC: Added
Folder B: Added
Folder B/Tag BA: Added
Folder B/Tag BB: Added
Tag A: Removed
Tag B.dataType: Boolean -> String
Results from a semantic diff (note I've sorted the tag json above):
This output is garbage, and this is a
simple example.
What you get is:
Folder A/Tag AB
renamed to Tag AC
(wrong)
Folder B
was added (correct)
Tag A
was moved into? and renamed to Folder B/Tag BA
(wrong)
Folder B/Tag BC
added (correct)
Tag B
was removed (wrong)
Tag B
was added again?? (wrong)
With my script, you get:
tagpath |
tagtype |
change |
from |
to |
root/Folder A/Tag BB |
AtomicTag |
Tag removed |
None |
None |
root/Folder A/Tag CC |
AtomicTag |
Tag added |
None |
None |
root/Tag B.dataType |
AtomicTag |
Property modified |
Boolean |
String |
root/Tag B.value |
AtomicTag |
Property modified |
TRUE |
Hello World! |
root/Tag A |
AtomicTag |
Tag removed |
None |
None |
root/Folder B |
Folder |
Tag added |
None |
None |
root/Folder B/Tag BA |
AtomicTag |
Tag added |
None |
None |
root/Folder B/Tag BC |
AtomicTag |
Tag added |
None |
None |
Which is exactly what i'm expecting to see (and I can see that I missed a change of the Tag B value in my expectations list)
But even if a diff DID work, it would be so hard to actually tell what's changed due to the nature of JSON. If you had lots of tags in deeply nested folders, in order to know the tagpath of the tags you will be constantly scrolling up trying to work out the folders each nest level is, concatenating mentally as you go, then you have to go and find the tag again to find the differences.
Personally, I'd prefer a table that just listed the tagpaths and their changes