Proposed AQL changes

This page outlines the changes to AQL being explored by Ocean Informatics. In general the changes presented here intend to generalise and extend the capability of AQL.

Identifed paths

Do not break the path down into its path parts

This will simplify the grammar and improve parser performance. The is currently no identifed need to have the path broken down into the path parts except to validate the path syntax. This can be achieved using a terminal definition rather than a rule.

BNF Changes

  1. Add an IdentifiedPath terminal
  2. remove <IdentifiedPath>, <Predicate>, <NodePredicate>, <NodePredicateOr>, <NodePredicateAnd>, <NodePredicateComparable>, <PredicateOperand>, <ObjectPath>, <PathPart> rules

FROM Clause

Remove specific class names in FROM class definitions such as VERSIONED_OBJECT, VERSION and EHR

This generalises the utility of the language to other reference models including demographics

BNF Changes

  1. Remove <FromEHR> from <From>
  2. Remove <FromEHR> rule
  3. Replace <SimpleClassExpr> with <ArchetypedClassExpr> in <ClassExpr> rule
  4. Remove <SimpleClassExpr>, <VersionedClassExpr> and <VersionClassExpr> rules
  5. Remove <StandardPredicate>, <PredicateExpr>, <PredicateOr>, <PredicateAnd>, <PredicateEquality>

Remove general attribute predicates in Class Expressions

This ensure that only archetype ID predicate expressions can be specified on classes in the FROM clause. All other RM attribute constrains must be expressed as WHERE criteria. This change is intended to make the rules about what attributes can be used in the FROM CLASS expressions interoperable. It also provides a better correlation to a relational model query where an archetyped class can be thought of as a relational table.

BNF Changes

  • The BNF changes specified above achieves this change.

Add NOT operator

Allow a NOT CONTAINS statement to be made

WHERE Clause

Add matches operator

Allow ADL like expressions to provide value set, value range and regular expression criteria. For example:
items[...]/value/defining_code/code_string MATCHES { '13452.2', '14062.3' }

Also allow TYPE based criteria. For example:
items[..]/value MATCHES { DV_TEXT }

See AQL Operators#matches

BNF Changes

  • include a <MatchesExpression> that supports a subset of cADL including C_COMPLEX_OBJECT and C_PRIMITIVE_OBJECT

Add NOT operator

Allow a NOT MATCHES statement and other bollean and comparable expressions