Skip to content

Commit af3fcb7

Browse files
committed
Updates of the query mapping chapter
1 parent 2d5b195 commit af3fcb7

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

figure-source/queryTree.odg

24.3 KB
Binary file not shown.

source/img/queryTree.png

251 KB
Loading

source/plugin-querymap.rst

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
11
.. _QueryHandling:
22

3-
VSS query recognition and mapping
3+
VSS query parsing and mapping
44
=====================================
55

6-
Obviously, each node has it's own database structure.
7-
In order to fetch data requested by the NodeSoftware client,
8-
incoming query needs to be mapped into one or multiple queries to the node database.
6+
Vamdc nodes are queried using a common SQL-like keyword-based query language.
7+
A typical query looks like::
8+
9+
SELECT * WHERE (keyword1=value or keyword2=value2) and keyword3='value3'
10+
11+
where the keywords correspond to the different parts of the XSAMS document
12+
and are defined in the VAMDC Dictionary [VAMDCDict]_ as Restrictable keywords.
13+
Since every VAMDC node has a specific database structure,
14+
the incoming query keywords need to be mapped to
15+
the database fields in order to fetch the data corresponding to the query.
916
Java Node software tries to make the process of query mapping as simple and sophisticated as possible.
1017

1118

1219
Query keywords tree
1320
-----------------------
1421

15-
First, as Java node software receives a query, it validates it and parses into a tree of objects.
16-
Intermediate nodes of that tree are representing boolean relations and leafs keep the information about
17-
the query keywords, comparison operator and values.
18-
19-
For example, query::
22+
As a first step, on query reception the Java Node Software parses the query into a tree of objects
23+
using the **vamdctap-queryparser** library.
24+
Leaf nodes of that tree of objects represent the individual keyword expressions.
25+
The root node and the branches are reflecting the boolean relations between the leaves.
26+
For instance, a query::
2027

2128
SELECT * WHERE reactant1.AtomSymbol = 'C' AND reactant2.AtomSymbol = 'O'
2229
AND (CollisionCode='inel' or CollisionCode='elas')
2330
24-
would map into a tree
31+
would map into the tree
2532

2633
.. image:: img/queryTree.png
2734

2835

29-
3036
Tree objects
3137
---------------------
3238

0 commit comments

Comments
 (0)