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.
Querying XML or Web Service Data Sources
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 |
Selection Tree Path
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:
- Select the ‘New Query’ button to create a new query.
- Enter the query name “All Employees”.
- Select ‘Personnel’ as the data source.
- Select ‘OK’ to create the query.
- Under the Data tab, select ‘default’ from the ‘Data source’ pane and add it to the ‘Request’ pane. Then press ‘Next’.
- Under the Fields tab, expand the ‘name’ node and add ‘lastname’ and ‘firstname’ to the report fields pane. Also add the ‘id’ node, then press ‘Finish’.
- Select the ‘employee’ node on the schema tree.
- Click on ‘Select Record’ to select the sub-tree as the output.
|
“We evaluated many reporting vendors and were most impressed at the speed with which the proof of concept could be developed. We found InetSoft to be the best option to meet our business requirements and integrate with our own technology.”
- John White, Senior Director, Information Technology at Livingston International |
Selection Nodes
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.