ADOxx Documentation
Theory - Hands-On - Scenarios - Community - Development Tools
Theory
ADOxx Development Language: AQL
Extended Backus Naur Form (EBNF) notation is used for describing the AQL syntax.
Terminal symbols are symbols which cannot be split up further and are included by inverted commas ' … '
Non-terminal symbols are included by < ... >
Symbols { ... }, [ ... ] and | serve to formulate rules in a more compact form :
- {...} arbitrary number of iterations (even 0-times)
- [...] optional (0- or 1-time)
- | alternative
Rules start with a non-terminal symbol, followed by "::=" and the symbol's definition
AQL Terminal symbols
‘<‘ and ‘>‘ in this order are used to represent a class, a relation, a model, a model type, etc. (e.g. <"A"> ,<"My Model 01"> , <"My Model Type">)
‘:‘ is used for specifying the class of a certain object, or the model where a specific class is included (e.g. <"A":"My Model 01":"My First Model Type">)
‘>‘ and ‘<‘ in this order are used for filtering the results of a query by a specified class (e.g.: <"A"> <<- "Relation" >"B"< has as results all objects that fullfill the query criteria <"A"><<-"Relation" AND are of class B)
‘->‘ , ‘<-‘ , ‘->>‘, ‘<<-‘ , ‘-->‘ , ‘-->>‘ , ‘<--‘ are used for creating AQL expressions that involve relations in the query critera (will be detailed in the future slides)
‘{‘ and ‘}‘ are used to represent the object with the specified name (e.g.: {"A01"})
‘[‘ and ‘]‘ are used to introduce a criteria to an AQL expression ([?"Radius">"10"])
‘(‘ and ‘)‘ are used for deciding the order in which logical operators are evaluated i.e. ‘a OR b AND c‘ and ‘ (a OR b) AND c ‘ return different results.
‘?‘ is used for imposing a condition on an attribute in the query criteria (e.g.: <"A">[?"Description" like "*OK*"] returns all objects of class A, whose attribute „Description" contains the word „OK")
‘!‘ is used for imposing a condition on a variable during the simulation (e.g.: (<"A">[!"objectCount">"10"]) OR (<"B">[!"objectCount"<="10"]) returns all objects of class A, if the variable objectCount is higher than 10 and all objects of class B otherwise.
AQL Non-Terminal Symbols and Key Words
Names of classes, names of objects, names of relations, names of attributes, names of variables and constants are denoted by inverted commas (e.g.: "A" , "B" , "requires" , "Colour")
<Class> ::= ‘<‘class_name‘>‘
-
Represents a class (e.g. <"A">)
-
If the class is not included in the current model, the class has to be denoted explicitly through model name and model type: <Class>':'<ModelName>':'<ModelType> (e.g. <"A":"My Model 01":"My First Model Type">)
<Object> :: = ‘<‘object_name‘>‘
Represents an object within a concrete model (e.g. <"A01">)
-
Should the name of the objects be ambiguous, the name of the class has to be appended to the object's name:<Object>':'<Class> (e.g. <"A01" : "A">)
-
If the object referenced is not part of the current model, the object has to be denoted explicitly through model name and model type:
<Object>':'<Model name>':'<Model type> (e.g.: <"A01":"My Model 01":"My First Model Type">) or <Object>':'<Class>':'<Model name>':'<Model type> (e.g.: <"A01":"A":"My Model 02">:<"My First Model Type">)
<Relation> ::= ‘<‘relation_name‘>‘
-
Represents a relationclass (e.g. <"Relation">)
<Attribute> ::= ‘<‘attribute_name‘>‘
-
represents the name of an attribute (e.g. <"Color">, <"Description">)
<Value> ::= <Constant> | '!' <Variable> | '?' <Attribute>
- a value is either a constant, a variable preceded by the symbol ‘!‘ or an attribute preceded by the symbol ‘?‘
<Operator> ::= '>' | '>=' | '=>' | '=' | '<=' | '=<' | '<' |'!='| 'like' | 'unlike'
- 'like' and 'unlike' are used for alphanumerical signs
- ? and * are wildcards:„*" substitutes for any zero or more characters and „?" substitutes for any one character or less (123??? will match 12313 or 1233, but not 1239919991)
- the other operators are used for comparing numerical values
<LogicalOperator> ::= 'AND' | 'OR' | 'DIFF‘
- 'AND‘ : the result is the intersection set of the two expressions
- 'OR‘ : the result is the union set of the two expressions
- 'DIFF' : the result is the difference of the two expressions
- 'AND' links more strongly than 'OR' and 'OR' more strongly than 'DIFF'
<AQL expression> ::= '{' [<Object>] [ ',' <Object> ] '}'
- the result of an AQL expression is a set of objects (0,1 or more)
<AQL expression> ::= '(' <AQL expression> ')'
- expressions may contain parentheses
<AQL expression> ::= <AQL expression> {<LogicalOperator> <AQL expression>}
- expressions can be linked to one or more expressions by logical operators
<AQL expression> ::= <AQL expression> '>'<Class>'<'
- expression results can be filtered by a specific class
AQL Statements
'<' <class> '>'
- the result is all objects of the specified class
- Examples:
-
<"A">
-
<"Square":"SecondModel001":"My Second Model Type">
-
<"A"> [?"Name" like "????e?"]
-
<"B"> <- "requires"
-
<AQL expression> '->' | '<-' | '->>' | '<<-' <Relation>
- The result contains all objects which are linked through the he given relation with at least one object from the AQL expression
- '->' returns all direct targets of the relation
- '<-' returns all direct start objects of the relation
- '->>' returns all transitive targets of the relation
- '<<-' returns all transitive start objects of the relation
- Examples:
-
{"A1"}->"rel_out"
-
{"A4"}<-"rel_in"
-
<"A">->"rel_out"
-
<"A"><-"rel_in"
-
{"A01"}<-"rel_in"
-
({"A2"}->>"trans_rel_out") -> "rel_out"
-
{"A4"}<<-"trans_rel_in"
-
<"A"><<-"trans_rel_in"
-
<"A">->"rel_out" >"B"<
-
<AQL expression> '->' | '<-' '<' <Relation> '>'
- The result contains all connectors of the specified relation which have as start or target object one of the objects in the AQL expression
- '->' returns all connectors originating from the objects of the AQL expression
- '<-' returns all connectors ending in the objects of the AQL expression
- Please note similarities and differences with before: if you use the '<' and '>' symbols, the result contains the connectors and if you don't use them, it contains the objects
- Examples:
-
<"B">-><"rel_out">
-
<"A"><-<"rel_in">
-
{"B3"} <- <"rel_in">
-
{"A1"} -> <"rel_in">
-
<AQL expression> '-->' | '-->>' <InterRef_Attribute>
- The result contains all objects which are referenced in the specified attribute of any of the objects in the AQL expression
- The ‘-->>' operator returns is all objects which are transitively referenced in the specified attribute of any of the objects in the AQL expression
- Examples:
-
<"A"> --> "IsRunBy"
-
<"A"> -->> "IsRunBy"
-
{"A5"} --> "IsRunBy"
-
{"A5"} -->> "IsRunBy"
-
{"A5"} -->> "IsRunBy" >"Rectangle"<
-
<AQL expression> '<--'
- The result contains all objects which refer any of the objects in the AQL expression
- Example:
-
<"Rectangle"> <--
-
<AQL expression> '[' <Value> <Operator> <Value> ']'
- The result contains all objects, whose attributes fulfill the defined criteria
- Constants (numbers, strings) can only be at the right of the operator
- To the left of the operator there are only attributes or variable references
- Note: Queries with variable references as dynamic components in the performer assignment are only allowed in the simulation
- Examples:
-
(<"A">[?"attr_name" like "a*"]) AND (<"A">[?"a1" >= 0])
-
(<"A">[?"attr_name" = "a1"]) AND (<"A">[?"attr_name" >= 0])
-
<"A">[?"Name" like "????a?"]
-
<AQL expression> '['<Value>']' '['<Value> <Operator> <Value>']'
- The result contains all objects of the start query where their record attribute or attribute profile fulfills the defined criteria
- The first value specifies the name of the record attribute or attribute profile.
- See above the rules for the second expression
- Note: In case of a record attribute, the criteria is always fulfilled, if at least a table row of the record attribute meets the defined criteria.
- Examples:
-
record attribute: <"A">[?"attr_name"][?"column_name" = "column_value"]
-
attribute profile: <"A"> [?"attr_name"][?"AP_attr_name" >= 0]
-