item = itemName value; infra = "@" itemName value; value = [argument] (";" / "{" *(item|infra) "}");
Axiom Syntax
This is a snapshot of the specification that was created during midPrivacy: provenance prototype project. For the latest development version of the document please look in Axiom workspace. |
Axiom syntax closely emulates basic Axiom concepts of item & value.
Language syntax was inspired by YANG modeling language from IETF, which tries to strike balance between readability and authoring. (YANG 1.1: 6.3 Statements) |
item
-
Normal data item
value
-
Value of item. In case of simple type values, argument represents value. In case of complex values, argument represent value of item based on
argument
in type definition. itemName
-
Name of item, expected value is prefixed name (also without prefix).
infra
-
Infra data item - used to specify inframodel specific data.
argument
-
value of item in case of simple type item, nested value could be prefixed name, number or string.
This provides basic simple structure for language and allows for simpler parser (See ANTLR4 syntax below.)
The omission of actual item names from grammar allows for addition of keywords and language extensions without need to change grammar definition (and lexer code). Sharing of same concepts with data model also allows Axiom to be used for data serialization / authoring.
Simple model syntax example
|
Data written in Axiom
Same data in Axiom using arguments
Same data in YAML
|
Examples
model "prism-types" {
namespace https://ns.evolveum.com/ns/axiom/prism-types;
version 4.0;
type PolyString {
documentation """
Polymorphic string.
String that may have more than one representation at
the same time. The primary representation is the original version that is
composed of the full Unicode character set. The other versions may be
normalized to trim it, normalize character case, normalize spaces,
remove national characters or even transliterate the string.
There is an alternative syntactic short-cut representation of PolyString. If no
child element is present then the text entire text content of this element is
considered as if it was present in the 'orig' element. That's the reason for making
this type 'mixed'.
This is considered to be primitive built-in type for prism objects.
"""
argument orig; // Allows PolyString to be specified as normal string
property orig {
type string;
}
property norm {
type string;
documentation """
Normalized value of the string.
The values is processed by the default normalization algorithm defined
in the system.""";
}
container translation {
type PolyStringTranslation;
documentation """
Definition of string value by using localization key and parameters.
"""
since 4.0;
}
container lang {
type PolyStringLang;
}
}
type PolyStringLang {
item lang {
type string;
documentation "Language code";
}
}
}