Repository navigation
In Network Query Processing
This Page describes briefly the encoding of queries for the In-Network Query Processing component (INQP). The implementation can be found in wiselib.testing/algorithms/rdf/inqp/.
A query consists of the following: * A numeric id (one byte, assumed to uniquely identify the query during its existence in the network) * A set of operators
Operators and their parameters are encoded in a compact format and can be transmitted individually to the INQP communicator. INQP will start processing the query once its set of operators is complete. All operator types have a common set of base fields, described below. Depending on the operator type, each operator also features different options. Operators form a query tree, each operator has 2 input ports and one output (for some operators only the left input port is being used). Each operator implicitely also defines a subsequent projection (this way, unenecessary allocations for throw-away columns are avoided).
| QUERY ID | TYPE | PARENT ID | PROJECTION INFO |
| 1 byte | 1 byte | 1 byte | 4 bytes |
Numerical query id, see above
Operator type, one of
| Value | Meaning |
| 'g' | Graph Pattern Selection |
| 's' | (General) Selection |
| 'j' | Simple Local Join |
| 'c' | Collect |
| 'C' | Construct |
| 'a' | Aggregate |
| 'D' | Delete |
The set of operators in a query form a directed tree, in general, data is input at the leaves and output at the root. The parent id specifies where to connect the output port of the current operator, that is a target operator (by operator id) plus a port (left or right).
The MSB defines the parent port, the remaining 7 bits the parent operator id, i.e.:
parent_id = (parent_op_id & 0x7f) | (left ? 0 : 0x80)
The projection info defines for each output column of the operator it is attached to, whether to keep it or to drop it. For easier processing, the projection info also re-states the type of each column it defines to be kept. Data in INQP can have three types: INTEGER, FLOAT or STRING.
For each column, 2 bits are stored, defining whether to drop/ignore the column or to keep it and if so, its type.
| Hi | Low | Meaning |
| 0 | 0 | IGNORE |
| 0 | 1 | INTEGER |
| 1 | 0 | FLOAT |
| 1 | 1 | STRING |
The first output column is defined by the two least-significant bits of the first byte of the projection info, the second column by the 3rd and 4th bit, etc...