- PQL is our language to create algebra expressions à Create a logical query model (quite similar to the relational algebra)
- To allow an easy extension, the PQL parser knows nothing about concrete operators
- The parser only knows about (abstract) logical operators and configurations
- Concrete operators are pluged into the parser
- For this:
- An annotation model
- An automatic loading mechanismen (no need to write services for operators)
Logical Operator Model
- Schema provides (meta-)information about the stream:
- What stream type (tuple, key value, xml …)
- Out of order
- For tuple: set of attributes
- Constraints
- …
Annotation Model
- @LogicalOperator: State ILogicalOperator implementation as PQL operator
- maxInputPorts, minInputPorts: How many input must be bound, can be bound
- Name: Name of the operator in PQL
- Helper for user interface
- Doc: A text describing the operator function
- Url: Link to documentation
- Category: Kind of operator
- Typically, each logical operator has a set of properties (e.g. in SELECT the predicate)
- A large set of specialized parameter handler (e.g.PredicateParameter)
- Can (of course) be extended ;-)
- The PQL parser does some preprocessing and delegates parameter handling to the parameter classes
Different predefined parameter classes
PQL and Parameter
- Text inside of „“ or ‚‘ are directly parsed, e.g. StringParameter
- Numbers/Boolean are parsed as types, e.g. IntegerParameter
Usage in logical operator
Predicate Parameter
Only one handler for all predicate types
- If isList = true, then input will be interpreted as List, must be enclosed by „[" and „]“
- Create List of elements
- No new parameter handler is needed!
- Example Rename:
- Example Schemacreation (here from AbstractAccessAO)
- Example Attributereference (here from ProjectAO)