seems {some.parameter[0]}
retains quality (as opposed to {some.parameter}[0]
?… ahhhh but it parses {value[0]}
as a tagPath instead of a property
but the former is kinda useless in this case because...
this is blowing my mind:
- I can nest QVs anywhere I want with a script transform
- I can nest QVs only in objects/mappings/dicts in an expression structure binding - but not inside lists/arrays??
- of course I can manually nest QVs anywhere in a complex object by binding individual child values
- but If I bind another parameter to it (the parent object), then all the nested QVs are retained (inlcuding inside lists/arrays)!?
- i’m guessing the behavior you describe is somewhere in the mix here, but not everywhere? Perhaps because when it works it’s referencing an existing object, as opposed to being constructed? But that alone doesn’t seem to explain it.
this completely solved my issue(s)!!! - that qvAt()
is
!
but I’m scared it’s gonna be a breaking change for others?
that being said, i’d honestly avocate doing the same with asList/Map whatever other functions move nested qualities to the parent
small suggestion that might make this even better until IA gives the root issue some consideration:
retain the tag quality at each top-level array object like this transform does for the first (because it’s the only one i care about)
{
"type": "expr",
"config": {
"expression": "qvAt(\r\n\twhere(\r\n\t\ttags({this.custom.paths}),\r\n\t\tqualityOf(qvAt(it(), 1)) !\u003d \"Bad_NotFound\"\r\n\t),\r\n\t0\r\n)"
},
"transforms": [
{
"expression": "qualifiedValue({value}, split(qualityOf(qvAt({value}, 1)),\u0027_\u0027)[0], qualityOf(qvAt({value}, 1)))",
"type": "expression"
}
]
}
which would allow a 'downstream' binding like this to retain quality without a separate indirect tag binding to the tagPath
{
"type": "property",
"config": {
"path": "this.custom.tagData.value"
},
"transforms": [
{
"expression": "{value}[1]",
"type": "expression"
}
]
}
I think otherwise to get both tagPath and tag value with quality (based on said tagPath), I either need two nearly identical tags()
functions or one tags()
function and an indirect tag binding.
if that happens, unsure the quality would even still be necessary or useful/accessible directly on the tag value - unless you turned it into a map instead of a list?…
oooh this (ugly) binding seems to put the quality at the top level presumably because of asMap’s current implementation...
{
"type": "expr",
"config": {
"expression": "asMap(\r\n\t\u0027path\u0027,\r\n\tqvAt(\r\n\t\tqvAt(\r\n\t\t\twhere(\r\n\t\t\t\ttags({this.custom.paths}),\r\n\t\t\t\tqualityOf(qvAt(it(), 1)) !\u003d \"Bad_NotFound\"\r\n\t\t\t),\r\n\t\t\t0\r\n\t\t),\r\n\t\t0\r\n\t),\r\n\t\u0027value\u0027,\r\n\tqvAt(\r\n\t\tqvAt(\r\n\t\t\twhere(\r\n\t\t\t\ttags({this.custom.paths}),\r\n\t\t\t\tqualityOf(qvAt(it(), 1)) !\u003d \"Bad_NotFound\"\r\n\t\t\t),\r\n\t\t\t0\r\n\t\t),\r\n\t\t1\r\n\t)\r\n)"
},
"transforms": [
{
"expression": "{value}\r\n//qualifiedValue({value}, split(qualityOf(qvAt({value}, 1)),\u0027_\u0027)[0], qualityOf(qvAt({value}, 1)))",
"type": "expression"
}
]
}
but I have a hunch based on my poking around above that if you modify asMap
...
and perspective might not discard them? maybe just a tagsAsQvMap()
alternative?
Thank you for your incredible help by the way!