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

Query across anchors returns datanodes not as trees

XMLWordPrintable

      Querying across anchors is returning results with datanodes from some anchors 'flattened', i.e. not correctly built into trees with child nodes. So a query across 2 anchors with same data may get back 5 top-level data-nodes instead of 2. For example:

      '/shops/shop[@id=1]/categories[@code=1]/book[@title="Dune"]' returns a list of datanodes:

      DataNode(
          anchorName=ANCHOR-004, 
          xpath=/shops/shop[@id='1']/categories[@code='1']/book, 
          leaves={price=5, title=Dune, labels=[special offer, classics, ]}, 
          childDataNodes=[
              DataNode(
                  anchorName=ANCHOR-004, 
                  xpath=/shops/shop[@id='1']/categories[@code='1']/book/author[@FirstName='Joe' and @Surname='Bloggs'], 
                  leaves={title=Dune, Surname=Bloggs, FirstName=Joe}, 
                  childDataNodes=[]
              )
          ]
      ),
      DataNode(
          anchorName=ANCHOR-005, 
          xpath=/shops/shop[@id='1']/categories[@code='1']/book, 
          leaves={price=5, title=Dune, labels=[special offer, classics, ]}, 
          childDataNodes=[]
      ),
      DataNode(
          anchorName=ANCHOR-005, 
          xpath=/shops/shop[@id='1']/categories[@code='1']/book/author[@FirstName='Joe' and @Surname='Bloggs'], 
          leaves={title=Dune, Surname=Bloggs, FirstName=Joe}, 
          childDataNodes=[]
      )

      '//phonenumbers[@type="mob"]/ancestor::info/contact' returns a list of datanodes:

      DataNode(
          anchorName=ANCHOR-004, 
          xpath=/shops/shop[@id='3']/info/contact, 
          childDataNodes=[
              DataNode(
                  anchorName=ANCHOR-004, 
                  xpath=/shops/shop[@id='3']/info/contact/phonenumbers[@type='landline'],
                  leaves={type=landline, number=012123456}, 
                  childDataNodes=[]
              ),
              DataNode(
                  anchorName=ANCHOR-004, 
                  xpath=/shops/shop[@id='3']/info/contact/phonenumbers[@type='mob'], 
                  leaves={type=mob, number=123123456}, 
                  childDataNodes=[]
              ), 
              DataNode(
                  anchorName=ANCHOR-004, 
                  xpath=/shops/shop[@id='3']/info/contact/website, 
                  leaves={address=myshop.ie}, 
                  childDataNodes=[]
              )
          ]
      ),
      DataNode(
          anchorName=ANCHOR-005, 
          xpath=/shops/shop[@id='3']/info/contact, 
          leaves={}, 
          childDataNodes=[]
      ),
      DataNode(
          anchorName=ANCHOR-005, 
          xpath=/shops/shop[@id='3']/info/contact/phonenumbers[@type='landline'], 
          leaves={type=landline, number=012123456}, 
          childDataNodes=[]
      ),
      DataNode(
          anchorName=ANCHOR-005, 
          xpath=/shops/shop[@id='3']/info/contact/phonenumbers[@type='mob'], 
          leaves={type=mob, number=123123456}, 
          childDataNodes=[]
      ),
      DataNode(
          anchorName=ANCHOR-005, 
          xpath=/shops/shop[@id='3']/info/contact/website, 
          leaves={address=myshop.ie}, 
          childDataNodes=[]
      )

      So the data from the first anchor is correctly structured into a tree, but from the second anchor the data is unstructured/flattened.

            danielhanrahan Daniel Hanrahan
            danielhanrahan Daniel Hanrahan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: