# Syntax Diagram for the Archetype Query Language **Category:** [Technical (archive)](https://discourse.openehr.org/c/technical-archive/156) **Created:** 2013-07-16 13:59 UTC **Views:** 3 **Replies:** 1 **URL:** https://discourse.openehr.org/t/syntax-diagram-for-the-archetype-query-language/14312 --- ## Post #1 by @ANASTASIOU_A1 Hello Everyone Since i needed an overview of AQL to understand its overall structure, i took a little bit of time to create its syntax diagram today\. A similar diagram is available from: http://www.openehr.org/wiki/display/spec/Archetype+Query+Language+Grammar The diagram i produced is based on the BNF rules found in the ANTLR AQL definition \(http://www.openehr.org/wiki/display/spec/ANTLR+AQL+grammar) and differs from the existing one in three points: 1\) It was rendered using http://railroad.my28msec.com/rr/ui 2\) I have taken a little bit of time to simplify the graphs \(i\.e\. merge edges without altering the meaning\)\. Therefore, i think that this diagram is more compact than the one linked above\. 3\) It uses SVG and its appearance can be customised through css\. I have deliberately omitted the elementary little leafs of the grammar such as datatypes \(Boolean, Float, Date, String, RegExPattern, etc\) and other identifiers \(UniqueID, ArchetypeID, etc\) primarily to keep the extent of the diagram short\. One more "merging iteration" could result in more immediate but crowded diagrams\. For example, the individual terms making up Query could be substituted so that the diagram at the level of Query tells the reader EXACTLY how the query is structured\.\.\.But that would take up the whole width of the document so i held on to that idea\. One small question that emerged from this analysis though is this: What is the meaning of \(m|M\)atchesOperand, \(i|I\)dentifiedOperand and R\(eg|EG\)E\(x|X\)Pattern? in the definition of IdentifiedEquality? Are these really different classes? \(Definition of IdentifiedEquality available at the end of this message\)\. At the moment i have treated them as case\-insensitive and they are not represented in the diagram but if they have to, i will correct it\. Please find the current output of the syntax diagram generator attached\. If anyone spots any obvious mistakes please don't keep them to your self :\) All the best Athanasios Anastasiou DEFINITION OF IDENTIFIEDEQUALITY [details="(attachments)"] [ui.xhtml|attachment](upload://wbBGIlKfthsekENqoGOINcABvLc.xhtml) (148 KB) [/details] --- ## Post #2 by @ANASTASIOU_A1 Hello Everyone Since i needed an overview of AQL to understand its overall structure, i took a little bit of time to create its syntax diagram today\. A similar diagram is available from: http://www.openehr.org/wiki/display/spec/Archetype+Query+Language+Grammar The diagram i produced is based on the BNF rules found in the ANTLR AQL definition \(http://www.openehr.org/wiki/display/spec/ANTLR+AQL+grammar) and differs from the existing one in three points: 1\) It was rendered using http://railroad.my28msec.com/rr/ui 2\) I have taken a little bit of time to simplify the graphs \(i\.e\. merge edges without altering the meaning\)\. Therefore, i think that this diagram is more compact than the one linked above\. 3\) It uses SVG and its appearance can be customised through css\. I have deliberately omitted the elementary little leafs of the grammar such as datatypes \(Boolean, Float, Date, String, RegExPattern, etc\) and other identifiers \(UniqueID, ArchetypeID, etc\) primarily to keep the extent of the diagram short\. One more "merging iteration" could result in more immediate but crowded diagrams\. For example, the individual terms making up Query could be substituted so that the diagram at the level of Query tells the reader EXACTLY how the query is structured\.\.\.But that would take up the whole width of the document so i held on to that idea\. One small question that emerged from this analysis though is this: What is the meaning of \(m|M\)atchesOperand, \(i|I\)dentifiedOperand and R\(eg|EG\)E\(x|X\)Pattern? in the definition of IdentifiedEquality? Are these really different classes? \(Definition of IdentifiedEquality available at the end of this message\)\. At the moment i have treated them as case\-insensitive and they are not represented in the diagram but if they have to, i will correct it\. Please find the current output of the syntax diagram generator attached\. If anyone spots any obvious mistakes please don't keep them to your self :\) All the best Athanasios Anastasiou DEFINITION OF IDENTIFIEDEQUALITY [details="(attachments)"] [ui.zip|attachment](upload://y3wztI1xmtfsBZJaKVoOlIKId36.zip) (11.5 KB) [/details] --- **Canonical:** https://discourse.openehr.org/t/syntax-diagram-for-the-archetype-query-language/14312 **Original content:** https://discourse.openehr.org/t/syntax-diagram-for-the-archetype-query-language/14312