MashZone NextGen 10.2 | Appendix | Legacy Presto components | MashZone NextGen Analytics | RAQL Queries | Dataset Paths, Locators, Names, and Datatypes | Adding Locators to Clarify RAQL Row Detection
 
Adding Locators to Clarify RAQL Row Detection
If you need to override the default XML or JSON objects in a dataset that RAQL treats as rows, you can add a specific path to the elements you need to the variable in the From clause. For this example:
select firstname, lastname, state
from congress/response/legislators/legislator
The variable is congress and /response/legislators/legislator is the path to the element for rows.
The path uses XPath syntax, starting with a slash (/) and separating each level of elements within the hierarchy with a slash. See Load Data with <invoke> for an example of a From clause using paths.
For overriding the default JSON locators, you can add a specific locator expression to the From clause. For this example:
select firstname, lastname, state
from congress/"?response?legislators?*"
The variable is congress and "?response?legislators?*" is the locator of the row objects. The locator uses XQuery map- and array-lookup syntax. A slash (/) indicates the presence of a locator expression, and the expression itself uses unary and postfix lookup operators (?). See https://www.w3.org/TR/xquery-31/#id-lookup for details.
See also Providing Dataset Path and Datatype Information in a Schema for an alternative way to set path information.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release