Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-1629

Ordering of leaf elements to support combination of AND/OR in cps-path

XMLWordPrintable

      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

            anupriya63 Rudrangi Anupriya
            anupriya63 Rudrangi Anupriya
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: