Overview
EXPRESS-Q is a query language designed to work with EXPRESS schemas, particularly in the context of STEP (Standard for the Exchange of Product model data) application protocols. It provides a formal mechanism for defining mappings between Application Reference Model (ARM) and Model Implementation Model (MIM) schemas, as well as specifying constraints on datasets that comply with these schemas.
The primary purpose of EXPRESS-Q is to bridge the gap between conceptual models (ARM) and their implementations (MIM), ensuring that data exchange between different systems maintains semantic consistency.
Key features
ENTITY_MAPPING declarations — define how ARM entities correspond to MIM entities
ATTRIBUTE_MAPPING definitions — map individual ARM attributes to MIM elements
Reference paths — precise navigation through schema relationships using operators like
→,⇐,⇒EXPRESS links — cross-schema references with automatic resolution
Alternative mappings — support for multiple valid representations
Constraint expressions — conditional constraints within reference paths
YAML serialization — machine-readable format for automated processing
Syntax
EXPRESS-Q uses a structured syntax built around entity and attribute mappings:
ENTITY_MAPPING <Activity_schema.Activity>;
EXTENSIBLE: FALSE;
AIM_ELEMENT: "<action_schema.executed_action>";
EXPRESS_REF: ["action_schema"];
REFPATH: {
executed_action <= action
};
ATTRIBUTE_MAPPING name;
ASSERTION_TO: "name";
AIM_ELEMENT: "action.name";
REFPATH: {
executed_action
executed_action <= action
action.name
};
END_ATTRIBUTE_MAPPING;
END_ENTITY_MAPPING;Reference path symbols
| The attribute references the entity or select type that follows |
| The entity is referenced by the attribute that follows |
| The entity is a supertype of the entity that follows |
| The entity is a subtype of the entity that follows |
| The select or enumeration type is extended into the type that follows |
| The select or enumeration type is an extension of the type that follows |
| The attribute is an aggregate; any element is referred to |
| The attribute is an ordered aggregate; member n is referred to |
| Enclosed section constrains multiple MIM elements |
| Enclosed section identifies alternatives within the mapping |
| Enclosed section constrains the reference path |
| Negative constraint on the mapping |
| Comment or clause reference |
EBNF grammar
The following EBNF defines the syntax of EXPRESS-Q:
express_q_file = { entity_mapping } ;
entity_mapping = "ENTITY_MAPPING" entity_ref ";" newline
[ extensible_decl ]
[ aim_element_decl ]
[ express_ref_decl ]
[ refpath_decl ]
[ alt_map_decl ]
{ attribute_mapping }
"END_ENTITY_MAPPING" ";" ;
extensible_decl = "EXTENSIBLE" ":" boolean ";" newline ;
aim_element_decl = "AIM_ELEMENT" ":" ( express_link | string ) ";" newline ;
express_ref_decl = "EXPRESS_REF" ":" "[" [ string { "," string } ] "]" ";" newline ;
refpath_decl = "REFPATH" ":" "{" newline refpath_content "}" ";" newline ;
alt_map_decl = "ALT_MAP" ":" "[" [ string { "," string } ] "]" ";" newline ;
attribute_mapping = "ATTRIBUTE_MAPPING" attribute_name ";" newline
"ASSERTION_TO" ":" ( express_link | string ) ";" newline
[ aim_element_decl ]
[ express_ref_decl ]
[ refpath_decl ]
"END_ATTRIBUTE_MAPPING" ";" newline ;
entity_ref = express_link | entity_name ;
express_link = "<" schema_name "." element_name ">" ;Reference path examples
REFPATH: {
product.id -> id
}REFPATH: {
mechanical_context <= product_context
}REFPATH: {
shape_representation <= representation
{representation.items[i] -> representation_item
representation_item =>
(geometric_representation_item
[geometric_representation_item.dim = 3] |
mapped_item)
}
}REFPATH: {
product_definition_formation
!{product_definition_formation.make_or_buy = bought_item}
}Standardization
EXPRESS-Q is an EXPRESS Language Foundation specification, developed alongside EXPRESS-X:
EXPRESS-Q Language Specification — Published by the EXPRESS Language Foundation
ISO 10303-11:2004 — The EXPRESS language reference manual (reference)
ISO 10303-1:2024 — Overview and fundamental principles (reference)
Validation rules
Validation of EXPRESS-Q files ensures correctness and consistency of ARM-to-MIM mappings:
Each ENTITY_MAPPING shall correspond to an entity or type defined in the ARM schema
The AIM_ELEMENT specified shall exist in the MIM schema or be a recognized keyword (PATH, IDENTICAL MAPPING, NO MAPPING EXTENSION PROVIDED)
All referenced entities and attributes shall exist in the corresponding ARM or MIM schema
Relationships between entities (supertype, subtype, attribute reference) shall be consistent with schema definitions
Constraints shall use valid attributes or functions for the constrained entity
Select type extensions shall be consistent with schema definitions
Aggregate references (using
[i]or[n]) shall be applied only to attributes defined as aggregates
Applications
ARM-to-MIM mapping — defining how application reference models map to implementation models
Data validation — querying datasets for compliance with schema constraints
Supply chain integration — ensuring semantic consistency across data exchange
Documentation generation — automated cross-referencing in published standards
Schema transformation — converting between different EXPRESS schema representations
YAML serialization
EXPRESS-Q mappings can be serialized as YAML for machine processing. Each module’s mapping specification is stored as mapping.yaml:
ae:
- entity: <Activity_schema.Activity>
aimelt: <action_schema.executed_action>
aa:
- attribute: name
aimelt: action.name
refpath:
content: |-
executed_action
executed_action <= action
action.name
- attribute: chosen_method
assertion_to: <Activity_method_schema.Activity_method>
aimelt: PATH
refpath:
content: |-
executed_action
executed_action <= action
action.chosen_method -> action_method
action_methodThe YAML fields correspond to the EBNF constructs:
| EBNF construct | YAML key | Notes |
|---|---|---|
|
| EXPRESS link or plain name |
|
| EXPRESS link or string |
|
| EXPRESS link or plain string |
|
| Boolean |
|
| List of strings |
|
| Multi-line string |
History
EXPRESS-Q was developed alongside EXPRESS-X, recognizing that schema mapping and querying are complementary operations in the EXPRESS data management lifecycle.
Learn more
EXPRESS Tutorials — learn about EXPRESS and the language family
EXPRESS-X — the companion schema mapping language
Standards & BNF — ISO standards references