Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ParameterisRequiredDescription
cps-pathyesnode path to be queried
descendantsnoNumber of descendants to be queried. default is none
resultIndexpageIndexnopage index starting from 1. 
resultSizenonumber of fragments per page starting from 1 10 (TBD). 

Query

QueryDescription
SELECT id, anchor_id AS anchorId, xpath, parent_id AS parentId, CAST(attributes AS TEXT) AS attributes FROM FRAGMENT WHERE xpath ~ :xpathRegex ORDERED BY id LIMIT :resultSize OFFSET  (:resultIndex - 1) * :resultSize Query limited fragments in order of fragment id


...

API : GET http://<IP>:<PORT>/cps/api/v2/dataspaces/{dataspace-name}/nodes/query?cps-path={cps-path}&descendants={descendants}&pageIndex={pageIndex}&anchorSizeresultSize={anchorSizeresultSize}

Request Parameters:

ParameterisRequiredDescription
cps-pathyesnode path to be queried
descendantsnoNumber of descendants to be queried. default is none
resultIndexpageIndexnoanchor page index starting from 1. 
anchorSizeresultSizenonumber of anchors records per request. It is nothing but number of anchors to be queried. Default value is 5(TBD).

Response Headers

requested number of anchors
Headerdescription
totalAnchorstotalResultstotal number of anchors
resultIndexrequested index of anchor
available records (achors)
totalPagestotal nulber of pages.anchorSize

Query

QueryDescription
SELECT id FROM anchor order by id LIMIT : anchorSize OFFSET : (resultIndex -1) * :anchorSize query list of anchors 
SELECT id, anchor_id AS anchorId, xpath, parent_id AS parentId, CAST(attributes AS TEXT) AS attributes FROM FRAGMENT WHERE anchor_id IN :anchorList AND xpath ~ :xpathRegexquery fragments for list of anchors from above query

...