While non-relational queries do not use SQL, they are able to filter and manipulate the data before returning the result set. This also provides a common access metaphor, because all queries are interchangeable.
A Web Service query is very similar to an XML query. Therefore, the following example will explain how to create a query in either of the two data sources. An XML query consists of three major components: XML sub-tree selection, tree node filtering, and table construction.
#1 Ranking: Read how InetSoft was rated #1 for user adoption in G2's user survey-based index | Read More |
Selecting a branch of the XML tree is the starting point for creating an XML query.
Selection Tree Path Walkthrough
The selection tree path is a required component in XML queries.
Follow these steps in the Data Modeler:
A tree path selects a branch of the output tree to serve as the root of the output data. Once a path is selected, the nodes on the path are changed to the path icon. A single diamond icon is used for non-selection nodes, and a diamond icon in a box border is used for selection nodes. A node is a selection node if there can be multiple instances of the node in the tree.
For example, there can be one or more ‘Employee’ elements under a ‘Personnel’ node. This is indicated by a plus sign at the end of the node label. Therefore, the employee node is a selection node.
On the other hand, there is always only one ‘Personnel’ node in the XML stream, so it is a non-selection node. Apart from differences in their visual appearance on the schema tree, a selection node can also have a query condition attached to it. If a query condition is associated with a selection node, the condition is used to select a subset of the nodes based on the condition evaluation.
We will discuss the details of the query condition expressions in the next chapter. For non selection nodes there is always just one instance of the node, therefore, selection is never necessary. If the tree path contains multiple selection nodes and each selection node selects multiple instances of the nodes on that tree level, the tree path will select more than one subtree.
For example, if you select the ‘personnel. employee.skill’ subtree, because there is more than one employee, the result of the tree path selection could contain multiple ‘Skill’ subtrees. In this case, the subtrees are merged into one root node, with all subtrees as its children.
Previous: Accessing POJO Data Sources |