Skip to content

Commit 5b0b495

Browse files
committed
Add EXPRESS links and YAML serialization to ELF 5006 spec
EBNF grammar: - Add express_link production for <<express:schema.element,display>> syntax - Remove source_decl from entity_mapping and attribute_mapping - Update entity_mapping to accept express_link for entity name - Update aim_element_decl and ASSERTION_TO to accept express_link Specification (04-spec.adoc): - Add new EXPRESS link section documenting the cross-reference syntax - Remove source declaration section (redundant with EXPRESS links) - Update entity mapping, AIM element, and attribute mapping sections - Update all examples to use EXPRESS links Validation rules (05-validation.adoc): - Add EXPRESS link validation rules - Remove source validation rule - Update entity and attribute mapping validation for EXPRESS links Examples and use cases: - Replace Product example with Activity module (real-world EXPRESS links) - Update all examples to use EXPRESS links, remove SOURCE declarations New annex (ab-yaml-serialization.adoc): - Define YAML serialization format for mapping.yaml files - Document entity mapping, attribute mapping, and reference path fields - Specify EXPRESS link format in YAML values - Correspondence table between EBNF constructs and YAML keys - Complete Activity module example in YAML format Closes #9
1 parent 154fdc0 commit 5b0b495

7 files changed

Lines changed: 586 additions & 193 deletions

File tree

sources/document.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,6 @@ include::sections/08-summary.adoc[]
4848

4949
include::sections/aa-example.adoc[]
5050

51+
include::sections/ab-yaml-serialization.adoc[]
52+
5153
include::sections/az-bibliography.adoc[]

sources/resources/express-q.ebnf

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
express_q_file = { entity_mapping } ;
22
3-
entity_mapping = "ENTITY_MAPPING" entity_name ";" newline
3+
entity_mapping = "ENTITY_MAPPING" entity_ref ";" newline
44
[ extensible_decl ]
55
[ aim_element_decl ]
6-
[ source_decl ]
76
[ express_ref_decl ]
87
[ refpath_decl ]
98
[ alt_map_decl ]
@@ -12,9 +11,7 @@ entity_mapping = "ENTITY_MAPPING" entity_name ";" newline
1211
1312
extensible_decl = "EXTENSIBLE" ":" boolean ";" newline ;
1413
15-
aim_element_decl = "AIM_ELEMENT" ":" string ";" newline ;
16-
17-
source_decl = "SOURCE" ":" string ";" newline ;
14+
aim_element_decl = "AIM_ELEMENT" ":" ( express_link | string ) ";" newline ;
1815
1916
express_ref_decl = "EXPRESS_REF" ":" "[" [ string { "," string } ] "]" ";" newline ;
2017
@@ -28,7 +25,7 @@ refpath_line = [ indentation ] reference_expression newline ;
2825
2926
reference_expression = entity_reference [ relationship { relationship } ] ;
3027
31-
relationship = path_relation | supertype_relation | subtype_relation |
28+
relationship = path_relation | supertype_relation | subtype_relation |
3229
select_extension | constraint ;
3330
3431
entity_reference = identifier ;
@@ -50,17 +47,26 @@ indentation = ? one or more spaces or tabs ? ;
5047
alt_map_decl = "ALT_MAP" ":" "[" [ string { "," string } ] "]" ";" newline ;
5148
5249
attribute_mapping = "ATTRIBUTE_MAPPING" attribute_name ";" newline
53-
"ASSERTION_TO" ":" string ";" newline
50+
"ASSERTION_TO" ":" ( express_link | string ) ";" newline
5451
[ aim_element_decl ]
55-
[ source_decl ]
5652
[ express_ref_decl ]
5753
[ refpath_decl ]
5854
"END_ATTRIBUTE_MAPPING" ";" newline ;
5955
56+
entity_ref = express_link | entity_name ;
57+
6058
entity_name = identifier ;
6159
6260
attribute_name = identifier ;
6361
62+
express_link = "<<express:" schema_name "." element_name "," display_name ">>" ;
63+
64+
schema_name = identifier ;
65+
66+
element_name = identifier ;
67+
68+
display_name = identifier ;
69+
6470
identifier = letter { letter | digit | "_" } ;
6571
6672
boolean = "TRUE" | "FALSE" ;

sources/sections/04-spec.adoc

Lines changed: 114 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ introduces new constructs specific to querying and mapping.
1010
An EXPRESS-Q file typically consists of one or more entity mappings, each of
1111
which defines how an ARM entity and its attributes correspond to MIM elements.
1212
These mappings can include various declarations such as extensibility, AIM
13-
elements, sources, EXPRESS references, reference paths, and alternative
13+
elements, EXPRESS references, reference paths, and alternative
1414
mappings.
1515

16+
Entity names, AIM element names, and assertion targets use EXPRESS links to
17+
identify both the schema and element, enabling cross-document reference
18+
resolution in published documentation.
19+
1620
=== EBNF grammar
1721

1822
The following EBNF (Extended Backus-Naur Form) grammar defines the syntax of
@@ -32,14 +36,40 @@ of relationships between entities and constraints, and various declarations.
3236

3337
This section describes the meaning and usage of each major construct in EXPRESS-Q.
3438

39+
==== EXPRESS link
40+
41+
[source,ebnf]
42+
----
43+
express_link = "<<express:" schema_name "." element_name "," display_name ">>" ;
44+
----
45+
46+
An EXPRESS link is a cross-reference that identifies an element within a
47+
specific EXPRESS schema. It encodes the schema name, element name, and a
48+
display name used for rendering.
49+
50+
The schema origin of a referenced element is derived from the EXPRESS link,
51+
eliminating the need for a separate source declaration.
52+
53+
Usage::
54+
* Use in entity mapping names to identify the ARM entity and its schema.
55+
* Use in AIM_ELEMENT declarations to identify the MIM entity and its schema.
56+
* Use in ASSERTION_TO declarations to identify the target entity and its schema.
57+
* The `display_name` is used for rendering in published documentation.
58+
59+
[example]
60+
----
61+
<<express:Activity_arm.Activity,Activity>>
62+
<<express:action_schema.executed_action,executed_action>>
63+
<<express:Activity_method_arm.Activity_method,Activity_method>>
64+
----
65+
3566
==== Entity mapping
3667

3768
[source,ebnf]
3869
----
39-
entity_mapping = "ENTITY_MAPPING" entity_name ";" newline
70+
entity_mapping = "ENTITY_MAPPING" entity_ref ";" newline
4071
[ extensible_decl ]
4172
[ aim_element_decl ]
42-
[ source_decl ]
4373
[ express_ref_decl ]
4474
[ refpath_decl ]
4575
[ alt_map_decl ]
@@ -49,26 +79,33 @@ entity_mapping = "ENTITY_MAPPING" entity_name ";" newline
4979

5080
An entity mapping defines how an ARM entity corresponds to one or more MIM entities or constructs. It encapsulates all the information needed to map a single ARM entity to its MIM counterpart(s).
5181

82+
The entity name shall be an EXPRESS link identifying the ARM entity and its
83+
schema, or a plain entity name for backward compatibility.
84+
5285
Usage::
53-
* Begin with "ENTITY_MAPPING" followed by the ARM entity name.
54-
* Include optional declarations for extensibility, AIM element, source, EXPRESS references, reference path, and alternative mappings.
86+
* Begin with "ENTITY_MAPPING" followed by the ARM entity reference (EXPRESS link or plain name).
87+
* Include optional declarations for extensibility, AIM element, EXPRESS references, reference path, and alternative mappings.
5588
* Include attribute mappings for the entity's attributes.
5689
* End with "END_ENTITY_MAPPING".
5790

5891
[example]
5992
----
60-
ENTITY_MAPPING Product;
93+
ENTITY_MAPPING <<express:Activity_arm.Activity,Activity>>;
6194
EXTENSIBLE: FALSE;
62-
AIM_ELEMENT: "product";
63-
SOURCE: "ISO 10303-41";
64-
EXPRESS_REF: ["product_definition_schema"];
95+
AIM_ELEMENT: "<<express:action_schema.executed_action,executed_action>>";
96+
EXPRESS_REF: ["action_schema"];
6597
REFPATH: {
66-
product <= product_definition_formation
67-
product_definition_formation.of_product -> product
98+
executed_action <= action
99+
};
100+
ATTRIBUTE_MAPPING chosen_method;
101+
ASSERTION_TO: "<<express:Activity_method_arm.Activity_method,Activity_method>>";
102+
AIM_ELEMENT: "PATH";
103+
REFPATH: {
104+
executed_action
105+
executed_action <= action
106+
action.chosen_method -> action_method
107+
action_method
68108
};
69-
ATTRIBUTE_MAPPING id;
70-
ASSERTION_TO: "id";
71-
AIM_ELEMENT: "product.id";
72109
END_ATTRIBUTE_MAPPING;
73110
END_ENTITY_MAPPING;
74111
----
@@ -88,7 +125,7 @@ Usage::
88125

89126
[example]
90127
----
91-
ENTITY_MAPPING ProductCategory;
128+
ENTITY_MAPPING <<express:Activity_arm.activity_item,activity_item>>;
92129
EXTENSIBLE: TRUE;
93130
...
94131
END_ENTITY_MAPPING;
@@ -98,42 +135,55 @@ END_ENTITY_MAPPING;
98135

99136
[source,ebnf]
100137
----
101-
aim_element_decl = "AIM_ELEMENT" ":" string ";" newline ;
138+
aim_element_decl = "AIM_ELEMENT" ":" ( express_link | string ) ";" newline ;
102139
----
103140

104-
The AIM element declaration specifies the corresponding AIM (MIM) element for the ARM entity, providing a direct link between the ARM and MIM schemas.
141+
The AIM element declaration specifies the corresponding AIM (MIM) element for
142+
the ARM entity, providing a direct link between the ARM and MIM schemas.
143+
144+
When the AIM element is an entity or type defined in an EXPRESS schema, the
145+
value shall be an EXPRESS link. When the AIM element is a keyword (such as
146+
`PATH`, `IDENTICAL MAPPING`, or `NO MAPPING EXTENSION PROVIDED`) or a dotted
147+
attribute path (such as `action.name`), the value shall be a plain string.
105148

106149
Usage::
107-
* Specify the AIM element name as a string.
150+
* Specify the AIM element as an EXPRESS link for entity references.
151+
* Specify the AIM element as a plain string for keywords and attribute paths.
108152

109153
[example]
154+
.Entity-level AIM element with EXPRESS link
110155
----
111-
ENTITY_MAPPING Product;
112-
AIM_ELEMENT: "product";
156+
ENTITY_MAPPING <<express:Activity_arm.Activity,Activity>>;
157+
AIM_ELEMENT: "<<express:action_schema.executed_action,executed_action>>";
113158
...
114159
END_ENTITY_MAPPING;
115160
----
116161

117-
==== Source declaration
118-
119-
[source,ebnf]
162+
[example]
163+
.Attribute-level AIM element with plain string
120164
----
121-
source_decl = "SOURCE" ":" string ";" newline ;
165+
ATTRIBUTE_MAPPING name;
166+
ASSERTION_TO: "name";
167+
AIM_ELEMENT: "action.name";
168+
END_ATTRIBUTE_MAPPING;
122169
----
123170

124-
The source declaration indicates the source (typically an ISO standard) of the MIM element, which is crucial for traceability and maintaining consistency with relevant standards.
125-
126-
Usage::
127-
* Specify the source as a string, typically an ISO standard number.
128-
129171
[example]
172+
.Attribute-level AIM element with PATH keyword
130173
----
131-
ENTITY_MAPPING Product;
132-
SOURCE: "ISO 10303-41";
133-
...
134-
END_ENTITY_MAPPING;
174+
ATTRIBUTE_MAPPING chosen_method;
175+
ASSERTION_TO: "<<express:Activity_method_arm.Activity_method,Activity_method>>";
176+
AIM_ELEMENT: "PATH";
177+
REFPATH: {
178+
executed_action
179+
executed_action <= action
180+
action.chosen_method -> action_method
181+
action_method
182+
};
183+
END_ATTRIBUTE_MAPPING;
135184
----
136185

186+
137187
==== EXPRESS reference declaration
138188

139189
[source,ebnf]
@@ -149,8 +199,8 @@ Usage::
149199

150200
[example]
151201
----
152-
ENTITY_MAPPING Product;
153-
EXPRESS_REF: ["product_definition_schema", "management_resources_schema"];
202+
ENTITY_MAPPING <<express:Activity_arm.Activity,Activity>>;
203+
EXPRESS_REF: ["action_schema", "management_resources_schema"];
154204
...
155205
END_ENTITY_MAPPING;
156206
----
@@ -182,12 +232,10 @@ Usage::
182232

183233
[example]
184234
----
185-
ENTITY_MAPPING Product;
235+
ENTITY_MAPPING <<express:Activity_arm.Activity,Activity>>;
186236
REFPATH: {
187-
product <= product_definition_formation
188-
product_definition_formation.of_product -> product
189-
{product.name -> product.name
190-
product.description -> product.description}
237+
executed_action <= action
238+
action.chosen_method -> action_method
191239
};
192240
...
193241
END_ENTITY_MAPPING;
@@ -292,7 +340,7 @@ REFPATH: {
292340
REFPATH: {
293341
shape_representation <= representation
294342
{representation.items[i] -> representation_item
295-
representation_item =>
343+
representation_item =>
296344
(geometric_representation_item
297345
[geometric_representation_item.dim = 3] |
298346
mapped_item)
@@ -364,41 +412,51 @@ END_ENTITY_MAPPING;
364412
[source,ebnf]
365413
----
366414
attribute_mapping = "ATTRIBUTE_MAPPING" attribute_name ";" newline
367-
"ASSERTION_TO" ":" string ";" newline
415+
"ASSERTION_TO" ":" ( express_link | string ) ";" newline
368416
[ aim_element_decl ]
369-
[ source_decl ]
370417
[ express_ref_decl ]
371418
[ refpath_decl ]
372419
"END_ATTRIBUTE_MAPPING" ";" newline ;
373420
----
374421

375422
An attribute mapping defines how an individual attribute of an ARM entity corresponds to elements in the MIM schema.
376423

424+
The ASSERTION_TO value shall be an EXPRESS link when the attribute refers to an
425+
entity data type or a SELECT type, and a plain string otherwise.
426+
377427
Usage::
378428
* Begin with "ATTRIBUTE_MAPPING" followed by the attribute name.
379-
* Specify the ASSERTION_TO value, which indicates the corresponding MIM element or type.
380-
* Optionally include AIM_ELEMENT, SOURCE, EXPRESS_REF, and REFPATH declarations.
429+
* Specify the ASSERTION_TO value as an EXPRESS link or plain string.
430+
* Optionally include AIM_ELEMENT, EXPRESS_REF, and REFPATH declarations.
381431
* End with "END_ATTRIBUTE_MAPPING".
382432

383433
[example]
434+
.Attribute mapping with EXPRESS link assertion
384435
----
385-
ENTITY_MAPPING Product;
386-
ATTRIBUTE_MAPPING id;
387-
ASSERTION_TO: "id";
388-
AIM_ELEMENT: "product.id";
436+
ENTITY_MAPPING <<express:Activity_arm.Activity,Activity>>;
437+
ATTRIBUTE_MAPPING chosen_method;
438+
ASSERTION_TO: "<<express:Activity_method_arm.Activity_method,Activity_method>>";
439+
AIM_ELEMENT: "PATH";
389440
REFPATH: {
390-
product.id -> id
441+
executed_action
442+
executed_action <= action
443+
action.chosen_method -> action_method
444+
action_method
391445
};
392446
END_ATTRIBUTE_MAPPING;
447+
END_ENTITY_MAPPING;
448+
----
393449

450+
[example]
451+
.Attribute mapping with plain string AIM element
452+
----
394453
ATTRIBUTE_MAPPING name;
395-
ASSERTION_TO: "label";
396-
AIM_ELEMENT: "product.name";
397-
SOURCE: "ISO 10303-41";
398-
EXPRESS_REF: ["product_definition_schema"];
454+
ASSERTION_TO: "name";
455+
AIM_ELEMENT: "action.name";
399456
REFPATH: {
400-
product.name -> name
457+
executed_action
458+
executed_action <= action
459+
action.name
401460
};
402461
END_ATTRIBUTE_MAPPING;
403-
END_ENTITY_MAPPING;
404462
----

sources/sections/05-validation.adoc

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,26 @@
44

55
Validation of EXPRESS-Q files is crucial to ensure the correctness and consistency of mappings between ARM and MIM schemas. The following rules should be applied when validating EXPRESS-Q files.
66

7+
=== EXPRESS link validation
8+
9+
1. Each EXPRESS link shall conform to the syntax `<<express:schema_name.element_name,display_name>>`.
10+
2. The `schema_name` shall identify a valid EXPRESS schema accessible to the mapping.
11+
3. The `element_name` shall identify an entity, type, or attribute defined in or imported into the referenced schema.
12+
4. The `display_name` shall match the `element_name`.
13+
714
=== Entity mapping validation
815

9-
1. Each ENTITY_MAPPING shall correspond to an entity defined in the ARM schema.
10-
2. The AIM_ELEMENT specified shall exist in the MIM schema.
11-
3. The SOURCE referenced shall be a valid ISO standard or other recognized source.
12-
4. All EXPRESS_REF entries shall refer to valid EXPRESS schemas.
13-
5. The REFPATH shall form a valid path from the ARM entity to the specified AIM_ELEMENT.
14-
6. If ALT_MAP is specified, all alternative mappings shall be valid MIM entities.
16+
1. Each ENTITY_MAPPING shall correspond to an entity or type defined in the ARM schema. When the entity name is an EXPRESS link, the referenced entity shall exist in the referenced ARM schema.
17+
2. The AIM_ELEMENT specified shall exist in the MIM schema or be a recognized keyword (`PATH`, `IDENTICAL MAPPING`, `NO MAPPING EXTENSION PROVIDED`, `/SUPERTYPE(...)/ `, `/SUBTYPE(...)/`). When the AIM element is an EXPRESS link, the referenced entity shall exist in the referenced MIM or resource schema.
18+
3. All EXPRESS_REF entries shall refer to valid EXPRESS schemas.
19+
4. The REFPATH shall form a valid path from the ARM entity to the specified AIM_ELEMENT.
20+
5. If ALT_MAP is specified, all alternative mappings shall be valid MIM entities.
1521

1622
=== Attribute mapping validation
1723

1824
1. Each ATTRIBUTE_MAPPING shall correspond to an attribute of the ARM entity being mapped.
19-
2. The ASSERTION_TO value shall be a valid type or entity in the MIM schema.
20-
3. If specified, the AIM_ELEMENT shall exist in the MIM schema.
25+
2. The ASSERTION_TO value shall be a valid type or entity in the ARM or MIM schema, as appropriate. When the value is an EXPRESS link, the referenced entity shall exist in the referenced schema.
26+
3. If specified, the AIM_ELEMENT shall exist in the MIM schema or be a recognized keyword or dotted attribute path.
2127
4. The REFPATH for an attribute shall form a valid path from the ARM attribute to the specified MIM element.
2228

2329
=== Reference path validation

0 commit comments

Comments
 (0)