-
Bug
-
Resolution: Done
-
Medium
-
None
Since CPS Path has support of and, or, multiple and's, multiple or's . It supports and/or also but the result is not as expected since leaf elements are stored in map the order of map is not preserved which impacts the expected result.
For examples we have
cps-path : //books[@title="Good Omens" or @price=15 and @edition=1983]
//books[@numberOfBooks=1 and @title=matilda or @price=150]
The outcome of query is is completely differ from given cps-path
Query formed : SELECT * FROM FRAGMENT WHERE anchor_id = :anchorId AND xpath ~ :xpathRegex AND ( attributes @> '{"price":15}' or attributes @> '{"edition":1983}' and attributes @> '{"title":"Good Omens"}'
Expected query: SELECT * FROM FRAGMENT WHERE anchor_id = :anchorId AND xpath ~ :xpathRegex AND ( attributes @> '{"title":"Good Omens"{color}}' or attributes @> '{"price":15}' and attributes @> '{"edition":1983}'
https://wiki.onap.org/display/DW/CPS-1215+OR+operator+changes
A/C:
Insert leaf elements in proper order in map
write test for combination of and/or CPS Path
Demo
CPS Path documentation updates
- mentioned in
-
Page Loading...