From a71fd3c58caa54493ca6001bff661488fde87244 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 13 Sep 2025 01:26:35 +0000 Subject: [PATCH 1/2] Replace all 'must' with 'shall' in sources directory Co-authored-by: TRThurman <1623380+TRThurman@users.noreply.github.com> --- metanorma.asciidoc.log.txt | 36 + sources/document.asciidoc.log.txt | 1007 +++++++++++++++ sources/document.err.html | 262 ++++ sources/document.html | 1860 +++++++++++++++++++++++++++ sources/sections/04-spec.adoc | 16 +- sources/sections/05-validation.adoc | 32 +- 6 files changed, 3189 insertions(+), 24 deletions(-) create mode 100644 metanorma.asciidoc.log.txt create mode 100644 sources/document.asciidoc.log.txt create mode 100644 sources/document.err.html create mode 100644 sources/document.html diff --git a/metanorma.asciidoc.log.txt b/metanorma.asciidoc.log.txt new file mode 100644 index 0000000..426ad0e --- /dev/null +++ b/metanorma.asciidoc.log.txt @@ -0,0 +1,36 @@ += X +A +:semantic-metadata-headless: true +:no-isobib: +:novalid: +:!sectids: + +== copyright-statement + + + +[[boilerplate-copyright-default]] +=== {blank} + +[[boilerplate-year]] +© span:std_publisher[ISO ]span:date[2024] + +[[boilerplate-message]] +All rights reserved. Unless otherwise specified, or required in the context of its implementation, +no part of this publication may be +reproduced or utilized otherwise in any form or by any means, electronic or +mechanical, including photocopying, or posting on the internet or an intranet, +without prior written permission. Permission can be requested from either ISO +at the address below or ISO's member body in the country of the requester. + +[[boilerplate-address]] +[align=left] +ISO copyright office + +CP 401 • Ch. de Blandonnet 8 + +CH-1214 Vernier, Geneva + +Phone: +41 22 749 01 11 + +Email: copyright@iso.org + +Website: link:++https://www.iso.org/++[www.iso.org] + +[[boilerplate-place]] +Published in Switzerland \ No newline at end of file diff --git a/sources/document.asciidoc.log.txt b/sources/document.asciidoc.log.txt new file mode 100644 index 0000000..7fa896e --- /dev/null +++ b/sources/document.asciidoc.log.txt @@ -0,0 +1,1007 @@ += EXPRESS-Q: EXPRESS Query Language Specification +:docnumber: 10303 +:partnumber: 81 +:edition: 1 +:copyright-year: 2024 +:revdate: 2024-10-10 +:language: en +:title-intro-en: EXPRESS Language Foundation +:title-main-en: EXPRESS Query Language Specification +:title-intro-fr: Fondation pour le langage EXPRESS +:title-main-fr: Spécification du langage de requête EXPRESS +:doctype: international-standard +:docstage: 00 +:docsubstage: 00 +:technical-committee-number: 184 +:technical-committee: Industrial automation systems and integration +:subcommittee-type: SC +:subcommittee-number: 4 +:subcommittee: Industrial data +:workgroup-type: WG +:workgroup-number: 12 +:workgroup: STEP product modelling and resources +:secretariat: ANSI +:imagesdir: images +:mn-document-class: iso +:mn-output-extensions: xml,html,doc,pdf,rxl +:local-cache-only: + + +.Foreword + +NOTE: This document is developed and published by the EXPRESS Language +Foundation. All rights reserved. + +The EXPRESS Language Foundation, maintainer of the EXPRESS data modeling language, +develops and maintains language standards and technologies. The work of +preparing EXPRESS standards is carried out through technical working groups. +Each member interested in a subject for which a working group has been +established has the right to participate in that group. International +organizations, both governmental and non-governmental, also take part in the +work. + +The procedures used to develop this document and those intended for its further +maintenance are described in the EXPRESS Language Foundation's documentation +guidelines. In particular, different approval criteria are needed for different +types of documents. This document was drafted in accordance with the EXPRESS +Language Foundation's editorial rules and guidelines. + +Attention is drawn to the possibility that some of the elements of this document +may be the subject of patent rights. The EXPRESS Language Foundation shall not +be held responsible for identifying any or all such patent rights. Details of +any patent rights identified during the development of the document will be in +the Introduction. + +Any trade name used in this document is information given for the convenience of +users and does not constitute an endorsement. + +For an explanation of the voluntary nature of standards and the meaning of +EXPRESS Language Foundation specific terms and expressions related to conformity +assessment, please refer to the Foundation's documentation guidelines. + +This document was prepared by the EXPRESS Language Foundation's Technical +Working Group. + +EXPRESS is organized as a series of specifications, each published separately. +The structure of EXPRESS is described in the Core Language Specification. + +Each specification is a member of one of the following series: description +methods, implementation methods, conformance testing methodology and framework, +integrated generic resources, integrated application resources, application +protocols, abstract test suites, application interpreted constructs, and +application modules. This part is a member of the description methods series. + + +[[introduction]] +== Introduction + +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. By providing a standardized +way to express these mappings and constraints, EXPRESS-Q facilitates more robust +and reliable data exchange in complex engineering and manufacturing +environments. + + +[[scope]] +== Scope + +This document specifies EXPRESS-Q, including its syntax, semantics, and usage within the context of EXPRESS schemas and STEP application protocols. + +The specification covers: + +. The grammar and syntax of EXPRESS-Q +. The semantics of EXPRESS-Q constructs +. The reference path syntax used for defining detailed mappings +. Validation rules for EXPRESS-Q files +. Guidelines for implementing EXPRESS-Q parsers and validators + +This specification is intended for use by software developers, data modelers, +and systems integrators working with EXPRESS schemas and STEP application +protocols. + + +[bibliography] +== Normative references + +* [[[ISO10303-1,ISO 10303-1:2024]]] + +* [[[ISO10303-11,ISO 10303-11:2004]]] + +* [[[ISO8824-1,ISO/IEC 8824-1:2008]]] + +* [[[ISO10646,ISO/IEC 10646:2011]]] + + +== Terms and definitions + +=== EXPRESS-Q + +query language for EXPRESS schemas, used to define mappings and constraints +between ARM and MIM schemas + + +// ARM:: Application Reference Model, a conceptual schema that defines the +// information requirements for a specific application domain + +// MIM:: Model Implementation Model, an implementation schema that realizes the +// concepts defined in the ARM using constructs from integrated resources + +// STEP:: Standard for the Exchange of Product model data, a comprehensive ISO +// standard (ISO 10303) for the computer-interpretable representation and +// exchange of product manufacturing information + +== EXPRESS-Q language specification + +=== Overview + +EXPRESS-Q is designed to work alongside EXPRESS schemas, providing a mechanism +to define mappings between ARM and MIM schemas, as well as specifying +constraints on datasets. The language uses a syntax similar to EXPRESS but +introduces new constructs specific to querying and mapping. + +An EXPRESS-Q file typically consists of one or more entity mappings, each of +which defines how an ARM entity and its attributes correspond to MIM elements. +These mappings can include various declarations such as extensibility, AIM +elements, sources, EXPRESS references, reference paths, and alternative +mappings. + +=== EBNF grammar + +The following EBNF (Extended Backus-Naur Form) grammar defines the syntax of +EXPRESS-Q: + +[source,ebnf] +---- +express_q_file = { entity_mapping } ; + +entity_mapping = "ENTITY_MAPPING" entity_name ";" newline + [ extensible_decl ] + [ aim_element_decl ] + [ source_decl ] + [ express_ref_decl ] + [ refpath_decl ] + [ alt_map_decl ] + { attribute_mapping } + "END_ENTITY_MAPPING" ";" ; + +extensible_decl = "EXTENSIBLE" ":" boolean ";" newline ; + +aim_element_decl = "AIM_ELEMENT" ":" string ";" newline ; + +source_decl = "SOURCE" ":" string ";" newline ; + +express_ref_decl = "EXPRESS_REF" ":" "[" [ string { "," string } ] "]" ";" newline ; + +refpath_decl = "REFPATH" ":" "{" newline + refpath_content + "}" ";" newline ; + +refpath_content = { refpath_line } ; + +refpath_line = [ indentation ] reference_expression newline ; + +reference_expression = entity_reference [ relationship { relationship } ] ; + +relationship = path_relation | supertype_relation | subtype_relation | + select_extension | constraint ; + +entity_reference = identifier ; + +path_relation = "->" entity_reference ; + +supertype_relation = "=>" entity_reference ; + +subtype_relation = "<=" entity_reference ; + +select_extension = "*" ">" entity_reference | "<" "*" entity_reference ; + +constraint = "[" constraint_expression "]" ; + +constraint_expression = ? expression following EXPRESS syntax ? ; + +indentation = ? one or more spaces or tabs ? ; + +alt_map_decl = "ALT_MAP" ":" "[" [ string { "," string } ] "]" ";" newline ; + +attribute_mapping = "ATTRIBUTE_MAPPING" attribute_name ";" newline + "ASSERTION_TO" ":" string ";" newline + [ aim_element_decl ] + [ source_decl ] + [ express_ref_decl ] + [ refpath_decl ] + "END_ATTRIBUTE_MAPPING" ";" newline ; + +entity_name = identifier ; + +attribute_name = identifier ; + +identifier = letter { letter | digit | "_" } ; + +boolean = "TRUE" | "FALSE" ; + +string = '"' { character } '"' ; + +letter = "A" | ... | "Z" | "a" | ... | "z" ; + +digit = "0" | ... | "9" ; + +character = ? any printable character ? ; + +indentation = ? one or more spaces or tabs ? ; + +newline = ? line break character(s) ? ; +---- + +This grammar defines the overall structure of an EXPRESS-Q file, including +entity mappings, attribute mappings, reference paths, including various types +of relationships between entities and constraints, and various declarations. + + +=== Semantics + +This section describes the meaning and usage of each major construct in EXPRESS-Q. + +==== Entity mapping + +[source,ebnf] +---- +entity_mapping = "ENTITY_MAPPING" entity_name ";" newline + [ extensible_decl ] + [ aim_element_decl ] + [ source_decl ] + [ express_ref_decl ] + [ refpath_decl ] + [ alt_map_decl ] + { attribute_mapping } + "END_ENTITY_MAPPING" ";" ; +---- + +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). + +Usage:: +* Begin with "ENTITY_MAPPING" followed by the ARM entity name. +* Include optional declarations for extensibility, AIM element, source, EXPRESS references, reference path, and alternative mappings. +* Include attribute mappings for the entity's attributes. +* End with "END_ENTITY_MAPPING". + +[example] +---- +ENTITY_MAPPING Product; +EXTENSIBLE: FALSE; +AIM_ELEMENT: "product"; +SOURCE: "ISO 10303-41"; +EXPRESS_REF: ["product_definition_schema"]; +REFPATH: { + product <= product_definition_formation + product_definition_formation.of_product -> product +}; +ATTRIBUTE_MAPPING id; +ASSERTION_TO: "id"; +AIM_ELEMENT: "product.id"; +END_ATTRIBUTE_MAPPING; +END_ENTITY_MAPPING; +---- + +==== Extensible declaration + +[source,ebnf] +---- +extensible_decl = "EXTENSIBLE" ":" boolean ";" newline ; +---- + +The extensible declaration specifies whether the entity mapping is extensible, corresponding to the extensibility of SELECT types in EXPRESS schemas. + +Usage:: +* Use "EXTENSIBLE: TRUE;" for extensible mappings. +* Use "EXTENSIBLE: FALSE;" for non-extensible mappings. + +[example] +---- +ENTITY_MAPPING ProductCategory; +EXTENSIBLE: TRUE; +... +END_ENTITY_MAPPING; +---- + +==== AIM element declaration + +[source,ebnf] +---- +aim_element_decl = "AIM_ELEMENT" ":" string ";" newline ; +---- + +The AIM element declaration specifies the corresponding AIM (MIM) element for the ARM entity, providing a direct link between the ARM and MIM schemas. + +Usage:: +* Specify the AIM element name as a string. + +[example] +---- +ENTITY_MAPPING Product; +AIM_ELEMENT: "product"; +... +END_ENTITY_MAPPING; +---- + +==== Source declaration + +[source,ebnf] +---- +source_decl = "SOURCE" ":" string ";" newline ; +---- + +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. + +Usage:: +* Specify the source as a string, typically an ISO standard number. + +[example] +---- +ENTITY_MAPPING Product; +SOURCE: "ISO 10303-41"; +... +END_ENTITY_MAPPING; +---- + +==== EXPRESS reference declaration + +[source,ebnf] +---- +express_ref_decl = "EXPRESS_REF" ":" "[" [ string { "," string } ] "]" ";" newline ; +---- + +The EXPRESS reference declaration lists EXPRESS references related to the mapping, used to link the mapping to specific parts of the EXPRESS schemas or other relevant documentation. + +Usage:: +* Provide a comma-separated list of references enclosed in square brackets. +* Use an empty list "[]" if there are no references. + +[example] +---- +ENTITY_MAPPING Product; +EXPRESS_REF: ["product_definition_schema", "management_resources_schema"]; +... +END_ENTITY_MAPPING; +---- + + +==== Reference path declaration + +===== General + +The reference path syntax in EXPRESS-Q is based on the ISO 10303 Mapping +Specification and is used within the REFPATH sections to define precise mappings +between ARM and MIM elements. This syntax allows for complex relationships and +constraints to be expressed concisely. + +[source,ebnf] +---- +refpath_decl = "REFPATH" ":" "{" newline + refpath_content + "}" ";" newline ; +---- + +The reference path declaration defines the detailed mapping between ARM and MIM elements using the reference path syntax described earlier. + +Usage:: +* Begin with `REFPATH: {` and end with `};`. +* Each line in the content describes a step in the mapping path. +* Use indentation to indicate nested structures. +* Use symbols like `<=`, `=>`, `->` to indicate relationships between entities and attributes. + +[example] +---- +ENTITY_MAPPING Product; +REFPATH: { + product <= product_definition_formation + product_definition_formation.of_product -> product + {product.name -> product.name + product.description -> product.description} +}; +... +END_ENTITY_MAPPING; +---- + + + +===== Symbols and meaning + +The reference path syntax uses several symbols to express relationships and constraints. These symbols are derived from the ISO 10303 Mapping Specification: + +`[]`:: +Enclosed section constrains multiple MIM elements or sections of the reference +path required to satisfy an information requirement. + +`()`:: +Enclosed section constrains multiple MIM elements or sections of the reference +path identified as alternatives within the mapping. + +`{}`:: +Enclosed section constrains the reference path to satisfy an information +requirement. + +`<>`:: +Enclosed section constrains one or more required reference paths. + +`||`:: +Enclosed section constrains the supertype entity. + +`->`:: +The attribute whose name precedes the symbol references the entity or select type whose name follows the symbol. + +`<-`:: +The entity or select type whose name precedes the symbol is referenced by the entity attribute whose name follows the symbol. + +`[i]`:: +The attribute whose name precedes the symbol is an aggregate; any element of that aggregate is referred to. + +`[n]`:: +The attribute whose name precedes the symbol is an ordered aggregate; member n of that aggregate is referred to. + +`=>`:: +The entity whose name precedes the symbol is a supertype of the entity whose name follows the symbol. + +`<=`:: +The entity whose name precedes the symbol is a subtype of the entity whose name follows the symbol. + +`=`:: +The string, select, or enumeration type is constrained to a choice or value. + +`\`:: +The reference path expression continues on the next line. + +`*`:: +One or more instances of the relationship entity data type may be assembled in a relationship tree structure. + +`--`:: +The text following is a comment or introduces a clause reference. + +`*>`:: +The select or enumeration type whose name precedes the symbol is extended into the select or enumeration type whose name follows the symbol. + +`<*`:: +The select or enumeration type whose name precedes the symbol is an extension of the select or enumeration type whose name follows the symbol. + +`!{}`:: +Section enclosed by `{}` indicates a negative constraint placed on the mapping. + + +===== Usage and examples + +The reference path syntax is used to define precise mappings between ARM and MIM +elements. Here are some examples demonstrating various aspects of the syntax: + +[example] +.Simple attribute mapping +==== +[source] +---- +REFPATH: { + product.id -> id +} +---- +==== + +[example] +.Subtype relationship +==== +[source] +---- +REFPATH: { + mechanical_context <= product_context +} +---- +==== + +[example] +.Complex mapping with alternatives and constraints +==== +[source] +---- +REFPATH: { + shape_representation <= representation + {representation.items[i] -> representation_item + representation_item => + (geometric_representation_item + [geometric_representation_item.dim = 3] | + mapped_item) + } +} +---- +==== + +[example] +.Select type extension +==== +[source] +---- +REFPATH: { + person_and_organization_select *> organization +} +---- +==== + +[example] +.Negative constraint +==== +[source] +---- +REFPATH: { + product_definition_formation + !{product_definition_formation.make_or_buy = bought_item} +} +---- +==== + +===== Validation rules for reference paths + +When validating reference paths, the following rules should be applied: + +1. All referenced entities and attributes shall exist in the corresponding ARM or MIM schema. +2. The relationships between entities (supertype, subtype, attribute reference) shall be consistent with the schema definitions. +3. Constraints shall be syntactically correct and use only attributes or functions that are valid for the constrained entity. +4. Select type extensions shall be consistent with the schema definitions. +5. Aggregate references (using `[i]` or `[n]`) shall be applied only to attributes defined as aggregates in the schema. +6. Alternative mappings (using parentheses) shall all be valid according to the schema. +7. Negative constraints shall be logically consistent with the rest of the mapping and the schema definitions. +8. The overall structure of the reference path shall form a valid path through the schema, connecting the source ARM entity to the target MIM entity or attribute. + + +==== Alternative mapping declaration + +[source,ebnf] +---- +alt_map_decl = "ALT_MAP" ":" "[" [ string { "," string } ] "]" ";" newline ; +---- + +The alternative mapping declaration specifies alternative mappings, allowing for flexibility in cases where multiple valid mappings exist. + +Usage:: +* Provide a comma-separated list of alternative mappings enclosed in square brackets. +* Use an empty list "[]" if there are no alternative mappings. + +[example] +---- +ENTITY_MAPPING GeometricRepresentation; +ALT_MAP: ["shape_representation", "tessellated_shape_representation"]; +... +END_ENTITY_MAPPING; +---- + +==== Attribute mapping + +[source,ebnf] +---- +attribute_mapping = "ATTRIBUTE_MAPPING" attribute_name ";" newline + "ASSERTION_TO" ":" string ";" newline + [ aim_element_decl ] + [ source_decl ] + [ express_ref_decl ] + [ refpath_decl ] + "END_ATTRIBUTE_MAPPING" ";" newline ; +---- + +An attribute mapping defines how an individual attribute of an ARM entity corresponds to elements in the MIM schema. + +Usage:: +* Begin with "ATTRIBUTE_MAPPING" followed by the attribute name. +* Specify the ASSERTION_TO value, which indicates the corresponding MIM element or type. +* Optionally include AIM_ELEMENT, SOURCE, EXPRESS_REF, and REFPATH declarations. +* End with "END_ATTRIBUTE_MAPPING". + +[example] +---- +ENTITY_MAPPING Product; +ATTRIBUTE_MAPPING id; +ASSERTION_TO: "id"; +AIM_ELEMENT: "product.id"; +REFPATH: { + product.id -> id +}; +END_ATTRIBUTE_MAPPING; + +ATTRIBUTE_MAPPING name; +ASSERTION_TO: "label"; +AIM_ELEMENT: "product.name"; +SOURCE: "ISO 10303-41"; +EXPRESS_REF: ["product_definition_schema"]; +REFPATH: { + product.name -> name +}; +END_ATTRIBUTE_MAPPING; +END_ENTITY_MAPPING; +---- + +== Validation rules + +=== General + +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. + +=== Entity mapping validation + +1. Each ENTITY_MAPPING shall correspond to an entity defined in the ARM schema. +2. The AIM_ELEMENT specified shall exist in the MIM schema. +3. The SOURCE referenced shall be a valid ISO standard or other recognized source. +4. All EXPRESS_REF entries shall refer to valid EXPRESS schemas. +5. The REFPATH shall form a valid path from the ARM entity to the specified AIM_ELEMENT. +6. If ALT_MAP is specified, all alternative mappings shall be valid MIM entities. + +=== Attribute mapping validation + +1. Each ATTRIBUTE_MAPPING shall correspond to an attribute of the ARM entity being mapped. +2. The ASSERTION_TO value shall be a valid type or entity in the MIM schema. +3. If specified, the AIM_ELEMENT shall exist in the MIM schema. +4. The REFPATH for an attribute shall form a valid path from the ARM attribute to the specified MIM element. + +=== Reference path validation + +1. All entities and attributes referenced in the REFPATH shall exist in either the ARM or MIM schema, as appropriate. +2. Relationships between entities (e.g., subtype, supertype) shall be consistent with the schema definitions. +3. Constraints specified in the REFPATH shall use valid attributes or functions for the entities they constrain. +4. SELECT type extensions shall be consistent with the schema definitions. +5. Aggregate references (using `[i]` or `[n]`) shall only be applied to attributes defined as aggregates in the schema. + +=== Overall consistency + +1. The complete set of mappings shall cover all entities and attributes in the ARM schema. +2. There should be no conflicting mappings (e.g., two different mappings for the same ARM entity or attribute). +3. The overall set of mappings should form a consistent and complete transformation from the ARM to the MIM schema. + + +== Implementation guidelines + +=== General + +When implementing an EXPRESS-Q parser and validator, consider the following guidelines. + +=== Parsing + +1. Implement a lexical analyzer to tokenize the EXPRESS-Q input. +2. Develop a parser based on the EBNF grammar provided in this specification. +3. Create an abstract syntax tree (AST) or similar internal representation of the parsed EXPRESS-Q file. + +=== Schema loading + +1. Implement an EXPRESS schema parser or use an existing library to load and interpret ARM and MIM schemas. +2. Create internal representations of the schemas that allow for efficient querying of entities, attributes, and relationships. + +=== Validation + +1. Implement validation checks based on the rules outlined in the "Validation rules" section. +2. Perform two-pass validation: + a. First pass: Check syntax and basic semantic rules (e.g., entity and attribute existence). + b. Second pass: Validate complex semantic rules (e.g., consistency of reference paths). +3. Provide clear and informative error messages for validation failures. + +=== Reference path interpretation + +1. Implement a separate parser for the reference path syntax. +2. Develop algorithms to traverse reference paths within the context of the loaded schemas. +3. Implement functions to evaluate constraints specified in reference paths. + +=== Performance considerations + +1. Use efficient data structures (e.g., hash tables) for quick lookups of schema elements. +2. Implement caching mechanisms for frequently accessed schema information. +3. Consider parallel processing for validating multiple entity or attribute mappings simultaneously. + +=== Extensibility + +1. Design the implementation to be extensible, allowing for future enhancements to the EXPRESS-Q language. +2. Use modular design to separate concerns (e.g., parsing, schema handling, validation). + +=== Integration + +1. Provide APIs or interfaces for integrating the EXPRESS-Q parser and validator into larger systems or workflows. +2. Consider implementing export functionality to generate reports or machine-readable representations of the validation results. + + +== Use cases and examples + +=== General + +This section provides examples of how EXPRESS-Q can be used in various scenarios +related to STEP application protocols. + +=== Use case 1: Mapping a complex product structure + +In this example, we'll demonstrate how EXPRESS-Q can be used to map a complex product structure from an ARM schema to a MIM schema. + +[example] +---- +ENTITY_MAPPING Product; +AIM_ELEMENT: "product"; +SOURCE: "ISO 10303-41"; +REFPATH: { + product <= product_definition_formation + product_definition_formation.of_product -> product +}; + +ATTRIBUTE_MAPPING id; +ASSERTION_TO: "id"; +AIM_ELEMENT: "product.id"; +END_ATTRIBUTE_MAPPING; + +ATTRIBUTE_MAPPING name; +ASSERTION_TO: "label"; +AIM_ELEMENT: "product.name"; +END_ATTRIBUTE_MAPPING; + +ATTRIBUTE_MAPPING description; +ASSERTION_TO: "text"; +AIM_ELEMENT: "product.description"; +END_ATTRIBUTE_MAPPING; + +ATTRIBUTE_MAPPING components; +ASSERTION_TO: "SET OF Component"; +REFPATH: { + product <- product_definition_formation + product_definition_formation <- product_definition + product_definition <- product_definition_relationship.relating_product_definition + product_definition_relationship -> + product_definition_relationship.related_product_definition + product_definition_relationship.related_product_definition -> product_definition + product_definition -> product_definition_formation + product_definition_formation -> product +}; +END_ATTRIBUTE_MAPPING; + +END_ENTITY_MAPPING; + +ENTITY_MAPPING Component; +AIM_ELEMENT: "product"; +SOURCE: "ISO 10303-41"; +REFPATH: { + product <= product_definition_formation + product_definition_formation.of_product -> product +}; + +ATTRIBUTE_MAPPING id; +ASSERTION_TO: "id"; +AIM_ELEMENT: "product.id"; +END_ATTRIBUTE_MAPPING; + +ATTRIBUTE_MAPPING name; +ASSERTION_TO: "label"; +AIM_ELEMENT: "product.name"; +END_ATTRIBUTE_MAPPING; + +ATTRIBUTE_MAPPING quantity; +ASSERTION_TO: "measure_with_unit"; +REFPATH: { + product <- product_definition_formation + product_definition_formation <- product_definition + product_definition <- product_definition_relationship + product_definition_relationship.related_product_definition_quantity -> measure_with_unit +}; +END_ATTRIBUTE_MAPPING; + +END_ENTITY_MAPPING; +---- + +This example demonstrates how a product with multiple components can be mapped from an ARM schema to a MIM schema using EXPRESS-Q. It shows the use of complex reference paths to navigate relationships between entities in the MIM schema. + +=== Use case 2: Mapping with alternative representations + +This example shows how EXPRESS-Q can handle cases where an ARM entity might be mapped to different MIM representations based on certain conditions. + +[example] +---- +ENTITY_MAPPING GeometricRepresentation; +ALT_MAP: ["shape_representation", "tessellated_shape_representation"]; +SOURCE: "ISO 10303-42"; + +REFPATH: { + (shape_representation <= representation + [representation.context_of_items->geometric_representation_context]) | + (tessellated_shape_representation <= representation + [representation.context_of_items->geometric_representation_context]) +}; + +ATTRIBUTE_MAPPING items; +ASSERTION_TO: "SET OF geometric_representation_item"; +REFPATH: { + representation.items[i] -> geometric_representation_item +}; +END_ATTRIBUTE_MAPPING; + +END_ENTITY_MAPPING; +---- + +This example demonstrates how EXPRESS-Q can handle alternative mappings for a single ARM entity. The GeometricRepresentation entity can be mapped to either a shape_representation or a tessellated_shape_representation in the MIM schema, depending on the specific requirements of the application. + +== Summary + +EXPRESS-Q provides a powerful and flexible language for defining mappings between ARM and MIM schemas in the context of STEP application protocols. By offering a standardized way to express these mappings, EXPRESS-Q facilitates more robust and reliable data exchange in complex engineering and manufacturing environments. + +Key features of EXPRESS-Q include: + +1. A syntax that is familiar to users of EXPRESS, reducing the learning curve. +2. The ability to define detailed mappings between ARM and MIM entities and attributes. +3. Support for complex reference paths, allowing for navigation through intricate schema relationships. +4. Mechanisms for specifying constraints and alternative mappings. +5. Clear separation of entity and attribute mappings for improved readability and maintainability. + +The validation rules and implementation guidelines provided in this specification aim to ensure consistent interpretation and implementation of EXPRESS-Q across different tools and systems. + +== Future considerations + +As the use of EXPRESS-Q grows and evolves, several areas may be considered for future enhancements: + +=== Extended constraint language + +Future versions of EXPRESS-Q might benefit from a more expressive constraint language, allowing for more complex conditions and transformations to be specified within mappings. + +=== Integration with other standards + +Consideration should be given to how EXPRESS-Q can be integrated with other relevant standards and technologies, such as ontology languages or model transformation frameworks. + +=== Tool support + +Development of standardized libraries and tools for parsing, validating, and processing EXPRESS-Q files would greatly facilitate its adoption and use. + +=== Reverse mapping capabilities + +Future versions might include capabilities for defining bi-directional mappings, allowing for the generation of ARM instances from MIM data. + +=== Performance optimizations + +As EXPRESS-Q is used with increasingly large and complex schemas, performance optimizations in both the language design and implementation guidelines may become necessary. + + +[appendix,obligation=informative] +== Complete EXPRESS-Q file example + +This annex provides a complete example of an EXPRESS-Q file, demonstrating +various features of the language in a cohesive context. + +[source] +---- +-- Example EXPRESS-Q file for a simplified product data model + +ENTITY_MAPPING Product; +EXTENSIBLE: FALSE; +AIM_ELEMENT: "product"; +SOURCE: "ISO 10303-41"; +EXPRESS_REF: ["product_definition_schema"]; +REFPATH: { + product <= product_definition_formation + product_definition_formation.of_product -> product +}; + +ATTRIBUTE_MAPPING id; +ASSERTION_TO: "identifier"; +AIM_ELEMENT: "product.id"; +REFPATH: { + product.id -> id +}; +END_ATTRIBUTE_MAPPING; + +ATTRIBUTE_MAPPING name; +ASSERTION_TO: "label"; +AIM_ELEMENT: "product.name"; +REFPATH: { + product.name -> name +}; +END_ATTRIBUTE_MAPPING; + +ATTRIBUTE_MAPPING description; +ASSERTION_TO: "text"; +AIM_ELEMENT: "product.description"; +REFPATH: { + product.description -> description +}; +END_ATTRIBUTE_MAPPING; + +ATTRIBUTE_MAPPING category; +ASSERTION_TO: "product_category"; +REFPATH: { + product <- product_category_assignment.products[i] + product_category_assignment -> product_category_assignment.assigned_category + product_category_assignment.assigned_category -> product_category +}; +END_ATTRIBUTE_MAPPING; + +END_ENTITY_MAPPING; + +ENTITY_MAPPING Assembly; +EXTENSIBLE: FALSE; +AIM_ELEMENT: "product"; +SOURCE: "ISO 10303-44"; +EXPRESS_REF: ["product_structure_schema"]; +REFPATH: { + product <= product_definition_formation + product_definition_formation.of_product -> product + [product <- product_definition_formation + product_definition_formation <- product_definition + product_definition <- assembly_component_usage.relating_product_definition] +}; + +ATTRIBUTE_MAPPING components; +ASSERTION_TO: "SET OF AssemblyComponent"; +REFPATH: { + product <- product_definition_formation + product_definition_formation <- product_definition + product_definition <- assembly_component_usage.relating_product_definition + assembly_component_usage -> assembly_component_usage.related_product_definition + assembly_component_usage.related_product_definition -> product_definition + product_definition -> product_definition_formation + product_definition_formation -> product +}; +END_ATTRIBUTE_MAPPING; + +END_ENTITY_MAPPING; + +ENTITY_MAPPING AssemblyComponent; +EXTENSIBLE: FALSE; +AIM_ELEMENT: "product"; +SOURCE: "ISO 10303-44"; +EXPRESS_REF: ["product_structure_schema"]; +REFPATH: { + product <= product_definition_formation + product_definition_formation.of_product -> product +}; + +ATTRIBUTE_MAPPING quantity; +ASSERTION_TO: "measure_with_unit"; +REFPATH: { + product <- product_definition_formation + product_definition_formation <- product_definition + product_definition <- assembly_component_usage + assembly_component_usage.quantity -> measure_with_unit +}; +END_ATTRIBUTE_MAPPING; + +END_ENTITY_MAPPING; + +ENTITY_MAPPING GeometricRepresentation; +EXTENSIBLE: TRUE; +ALT_MAP: ["shape_representation", "tessellated_shape_representation"]; +SOURCE: "ISO 10303-42"; +EXPRESS_REF: ["geometric_model_schema"]; + +REFPATH: { + (shape_representation <= representation + [representation.context_of_items->geometric_representation_context]) | + (tessellated_shape_representation <= representation + [representation.context_of_items->geometric_representation_context]) +}; + +ATTRIBUTE_MAPPING items; +ASSERTION_TO: "SET OF geometric_representation_item"; +REFPATH: { + representation.items[i] -> geometric_representation_item +}; +END_ATTRIBUTE_MAPPING; + +END_ENTITY_MAPPING; +---- + +This example demonstrates a simplified product data model, including mappings +for products, assemblies, assembly components, and geometric representations. It +showcases various features of EXPRESS-Q, including: + +- Entity and attribute mappings +- Reference paths with complex relationships +- Alternative mappings +- Constraints within reference paths +- Use of SELECT types (implied by the EXTENSIBLE: TRUE; in GeometricRepresentation) + +This example is not exhaustive but provides a realistic scenario that +illustrates how EXPRESS-Q can be used to define mappings between ARM and MIM +schemas in a STEP application protocol context. + + +[bibliography] +== Bibliography + +* [[[ISO10303-21,ISO 10303-21:2016]]] \ No newline at end of file diff --git a/sources/document.err.html b/sources/document.err.html new file mode 100644 index 0000000..1033f9f --- /dev/null +++ b/sources/document.err.html @@ -0,0 +1,262 @@ +sources/document.err.html errors + + +

sources/document.err.html errors

+ +

Style

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineIDMessageContextSeverity
000058_bcb6f41d-8baa-7f9c-5118-5131b7cd6377Foreword may contain permission: Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights
<foreword id="_bcb6f41d-8baa-7f9c-5118-5131b7cd6377" obligation="informative">
+<title id="_41c9fad3-d4c1-eecc-4fad-f91704acc026">Foreword</title>
+<note id="_4c9dbebf-660c-1fe0-0f5b-ecad18ab11ac"> <p id="_8a662cf2-2101-56ae-5b0d-883b85f1c32b">This document is developed and published by the EXPRESS Language Foundation. All rights reserved.</p>
+</note>
+
2
000058_bcb6f41d-8baa-7f9c-5118-5131b7cd6377Foreword may contain requirement: The EXPRESS Language Foundation shall not be held responsible for identifying any or all such patent rights
<foreword id="_bcb6f41d-8baa-7f9c-5118-5131b7cd6377" obligation="informative">
+<title id="_41c9fad3-d4c1-eecc-4fad-f91704acc026">Foreword</title>
+<note id="_4c9dbebf-660c-1fe0-0f5b-ecad18ab11ac"> <p id="_8a662cf2-2101-56ae-5b0d-883b85f1c32b">This document is developed and published by the EXPRESS Language Foundation. All rights reserved.</p>
+</note>
+
2
000078introductionIntroduction may contain requirement: 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
<introduction id="_25035b03-3ac3-3b39-337c-a9bfe1ff729d" anchor="introduction" obligation="informative">
+<title id="_2b2e98d1-114a-3da4-8556-01ae0a724280">Introduction</title>
+<p id="_6720da92-414b-98bb-fb22-c20d022dec08">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.</p>
+
+<p id="_68b45e84-91b0-8054-9b1c-3ae9ba1f65d3">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. By providing a standardized way to express these mappings and constraints, EXPRESS-Q facilitates more robust and reliable data exchange in complex engineering and manufacturing environments.</p>
2
000091_627a7dae-567a-2d2f-4a8e-846d87ff6532List entry of separate sentences must end with full stop: The grammar and syntax of EXPRESS-Q
<li> <p id="_fde1e7c5-e806-0383-2cbb-5cd460318f98">The grammar and syntax of EXPRESS-Q</p>
+</li>
2
000093_627a7dae-567a-2d2f-4a8e-846d87ff6532List entry of separate sentences must end with full stop: The semantics of EXPRESS-Q constructs
<li> <p id="_bf5f748d-95b8-3caa-f8a9-24ac93b4e2b8">The semantics of EXPRESS-Q constructs</p>
+</li>
2
000095_627a7dae-567a-2d2f-4a8e-846d87ff6532List entry of separate sentences must end with full stop: The reference path syntax used for defining detailed mappings
<li> <p id="_ac710207-fa28-5240-d798-d940a4942e0d">The reference path syntax used for defining detailed mappings</p>
+</li>
2
000097_627a7dae-567a-2d2f-4a8e-846d87ff6532List entry of separate sentences must end with full stop: Validation rules for EXPRESS-Q files
<li> <p id="_d59492d9-34df-aa0c-0bfb-26462f188018">Validation rules for EXPRESS-Q files</p>
+</li>
2
000099_627a7dae-567a-2d2f-4a8e-846d87ff6532List entry of separate sentences must end with full stop: Guidelines for implementing EXPRESS-Q parsers and validators
<li> <p id="_2c39638f-8ced-1a12-41c3-c8134a1d9189">Guidelines for implementing EXPRESS-Q parsers and validators</p>
+</li>
2
000222_15f098db-c1b8-02c4-b49b-2a0592805390Hanging paragraph in clause
<clause id="_15f098db-c1b8-02c4-b49b-2a0592805390" inline-header="false" obligation="normative">
+<title id="_55f6da5f-0b02-2b51-a3c7-a0f6056a6b3a">Semantics</title>
+<p id="_8eb1049a-6605-dd70-89db-964dd855b9a4">This section describes the meaning and usage of each major construct in EXPRESS-Q.</p>
+
+<clause id="_df830fe4-59b9-7c6a-574e-117785041d4b" inline-header="false" obligation="normative">
2
000242_44c9275d-9b40-325c-3b2e-0f772c82eb84All lists must be preceded by colon or full stop: Usage
<ul id="_44c9275d-9b40-325c-3b2e-0f772c82eb84"> <li> <p id="_fe64dbd4-296d-f281-eceb-683432efc908">Begin with “ENTITY_MAPPING” followed by the ARM entity name.</p>
+</li>
+<li> <p id="_1150e65e-1906-ae64-1b77-ff57106e4326">Include optional declarations for extensibility, AIM element, source, EXPRESS references, reference path, and alternative mappings.</p>
+</li>
+<li> <p id="_0b0cda59-9b7f-e7e4-611b-7c6c77c58856">Include attribute mappings for the entity’s attributes.</p>
2
000279_bf1da4b4-f69e-0a98-3389-7909d2734325All lists must be preceded by colon or full stop: Usage
<ul id="_bf1da4b4-f69e-0a98-3389-7909d2734325"> <li> <p id="_f3dcf0dd-f5b7-048e-0499-326d7f4245d0">Use “EXTENSIBLE: TRUE;” for extensible mappings.</p>
+</li>
+<li> <p id="_c7bd0416-bcae-713f-31bd-8beb31661f91">Use “EXTENSIBLE: FALSE;” for non-extensible mappings.</p>
+</li>
+</ul>
2
000302_a9bd525c-0a7c-c58f-06f9-bf70ad954e45All lists must be preceded by colon or full stop: Usage
<ul id="_a9bd525c-0a7c-c58f-06f9-bf70ad954e45"> <li> <p id="_b0c4775a-46e1-ba03-7c93-3259ac93c578">Specify the AIM element name as a string.</p>
+</li>
+</ul>
2
000323_f9e66dd9-7757-fa96-a874-fd7c3e04a743All lists must be preceded by colon or full stop: Usage
<ul id="_f9e66dd9-7757-fa96-a874-fd7c3e04a743"> <li> <p id="_21e2f2c5-7c6f-873d-ddeb-1428b2763054">Specify the source as a string, typically an ISO standard number.</p>
+</li>
+</ul>
2
000344_3e6c82b2-72f9-b617-eaf4-cdb4ebd1a4efAll lists must be preceded by colon or full stop: Usage
<ul id="_3e6c82b2-72f9-b617-eaf4-cdb4ebd1a4ef"> <li> <p id="_0f08cec6-45c3-9821-d4d4-cd115b9f6fc0">Provide a comma-separated list of references enclosed in square brackets.</p>
+</li>
+<li> <p id="_a7e41245-434f-e782-376b-8cec0ab87982">Use an empty list “[]” if there are no references.</p>
+</li>
+</ul>
2
000373_7bd56e6a-b891-c0f9-901d-20538647bab8All lists must be preceded by colon or full stop: Usage
<ul id="_7bd56e6a-b891-c0f9-901d-20538647bab8"> <li> <p id="_e6d054c6-61cf-a2aa-88d4-7bed3b2a41d3">Begin with <tt>REFPATH: {</tt> and end with <tt>};</tt>.</p>
+</li>
+<li> <p id="_f7a6aea3-af79-7b55-dc99-909a3dc7a844">Each line in the content describes a step in the mapping path.</p>
+</li>
+<li> <p id="_9b65d58b-5127-dddd-52d5-2aeeb47173bb">Use indentation to indicate nested structures.</p>
2
000542_bd361943-6f1a-f934-5f09-838e9e74e77cAll lists must be preceded by colon or full stop: Usage
<ul id="_bd361943-6f1a-f934-5f09-838e9e74e77c"> <li> <p id="_c97782a8-1d1e-937a-92a3-6fda43033ff0">Provide a comma-separated list of alternative mappings enclosed in square brackets.</p>
+</li>
+<li> <p id="_39f45cc9-90c4-d225-3684-4b36f8313488">Use an empty list “[]” if there are no alternative mappings.</p>
+</li>
+</ul>
2
000571_7d9edcaf-f4e7-a8bb-9016-9660a74f55b1All lists must be preceded by colon or full stop: Usage
<ul id="_7d9edcaf-f4e7-a8bb-9016-9660a74f55b1"> <li> <p id="_2243bc4f-ed11-a269-4bc7-1b516a573da5">Begin with “ATTRIBUTE_MAPPING” followed by the attribute name.</p>
+</li>
+<li> <p id="_ccb88e5f-27c6-113d-8664-29139e613bc3">Specify the ASSERTION_TO value, which indicates the corresponding MIM element or type.</p>
+</li>
+<li> <p id="_51f0665a-29d3-45ca-70e3-8b2846b5865a">Optionally include AIM_ELEMENT, SOURCE, EXPRESS_REF, and REFPATH declarations.</p>
2
000616_0887f4c3-db2c-fe3c-f9a3-f48262561519All lists must be preceded by colon or full stop: Entity mapping validation
<ol id="_0887f4c3-db2c-fe3c-f9a3-f48262561519"> <li> <p id="_0ecedf8c-cac2-2acb-5452-568a46c56251">Each ENTITY_MAPPING shall correspond to an entity defined in the ARM schema.</p>
+</li>
+<li> <p id="_8e140049-6c61-1f8d-9f08-c969c39cc43c">The AIM_ELEMENT specified shall exist in the MIM schema.</p>
+</li>
+<li> <p id="_c5b10fa6-9819-bb63-d296-d96c8cc47dcd">The SOURCE referenced shall be a valid ISO standard or other recognized source.</p>
2
000633_f27c3168-85d2-ef78-6a54-468a7559bda1All lists must be preceded by colon or full stop: Attribute mapping validation
<ol id="_f27c3168-85d2-ef78-6a54-468a7559bda1"> <li> <p id="_c6665749-5331-9d78-ebc7-b2b4a8238dc3">Each ATTRIBUTE_MAPPING shall correspond to an attribute of the ARM entity being mapped.</p>
+</li>
+<li> <p id="_f0ff9b2b-71c7-7307-1df1-75a180edf31d">The ASSERTION_TO value shall be a valid type or entity in the MIM schema.</p>
+</li>
+<li> <p id="_3c2c2444-456e-dab1-3b1b-579f309af8e9">If specified, the AIM_ELEMENT shall exist in the MIM schema.</p>
2
000646_7de141cc-211b-0518-4f54-5ced28d6ed82All lists must be preceded by colon or full stop: Reference path validation
<ol id="_7de141cc-211b-0518-4f54-5ced28d6ed82"> <li> <p id="_6e07bf6d-3bc0-1bdf-1a37-82a01a6a0c28">All entities and attributes referenced in the REFPATH shall exist in either the ARM or MIM schema, as appropriate.</p>
+</li>
+<li> <p id="_38d83504-fc01-8bcc-bd55-177f1dd7860d">Relationships between entities (e.g., subtype, supertype) shall be consistent with the schema definitions.</p>
+</li>
+<li> <p id="_7cc8733d-f5c8-4901-ed96-d5c0e02a98da">Constraints specified in the REFPATH shall use valid attributes or functions for the entities they constrain.</p>
2
000661_4ba8a1f5-2ade-4218-b5e6-dbf90c88c93aAll lists must be preceded by colon or full stop: Overall consistency
<ol id="_4ba8a1f5-2ade-4218-b5e6-dbf90c88c93a"> <li> <p id="_f77d37ca-fbe4-f08d-bff9-a19935f1c15a">The complete set of mappings shall cover all entities and attributes in the ARM schema.</p>
+</li>
+<li> <p id="_c5f4e134-c618-a59b-8fe1-0d6f6151467f">There should be no conflicting mappings (e.g., two different mappings for the same ARM entity or attribute).</p>
+</li>
+<li> <p id="_210170da-cfba-beea-dfce-9389e94b52bc">The overall set of mappings should form a consistent and complete transformation from the ARM to the MIM schema.</p>
2
000680_5b338adc-297d-7ea1-e123-f5b21a23e383All lists must be preceded by colon or full stop: Parsing
<ol id="_5b338adc-297d-7ea1-e123-f5b21a23e383"> <li> <p id="_7ab71d47-eaaf-4bd3-908e-984073532cfb">Implement a lexical analyzer to tokenize the EXPRESS-Q input.</p>
+</li>
+<li> <p id="_99fb11b3-1449-333e-ae9b-8a2f7823a85a">Develop a parser based on the EBNF grammar provided in this specification.</p>
+</li>
+<li> <p id="_8055cc6e-2c54-e749-3d55-0be48fecb666">Create an abstract syntax tree (AST) or similar internal representation of the parsed EXPRESS-Q file.</p>
2
000691_856615f0-3f0c-1647-4c02-2e7759850d70All lists must be preceded by colon or full stop: Schema loading
<ol id="_856615f0-3f0c-1647-4c02-2e7759850d70"> <li> <p id="_bbecbb7a-6e7b-77fa-0fc8-9259ae805ab5">Implement an EXPRESS schema parser or use an existing library to load and interpret ARM and MIM schemas.</p>
+</li>
+<li> <p id="_22259b9a-b452-4658-5664-96b3d08cca72">Create internal representations of the schemas that allow for efficient querying of entities, attributes, and relationships.</p>
+</li>
+</ol>
2
000700_2eabfe18-c3ec-870c-40d4-4c48301fb7e2All lists must be preceded by colon or full stop: Validation
<ol id="_2eabfe18-c3ec-870c-40d4-4c48301fb7e2"> <li> <p id="_efef517e-76a6-202e-eab9-4189a49b2c4c">Implement validation checks based on the rules outlined in the “Validation rules” section.</p>
+</li>
+<li> <p id="_24c3185b-6eec-0623-8925-bcccff2c0d36">Perform two-pass validation:</p>
+<ol id="_de7f3886-fe6a-c0ee-e215-f5d73b165dfe"> <li> <p id="_6204db8d-4437-a427-772b-762c926f9d85">First pass: Check syntax and basic semantic rules (e.g., entity and attribute existence).</p>
+</li>
2
000716_a1711cc9-a848-4810-fd1d-30410d5548edAll lists must be preceded by colon or full stop: Reference path interpretation
<ol id="_a1711cc9-a848-4810-fd1d-30410d5548ed"> <li> <p id="_a86d6340-bf3a-11a2-5f8d-3ea4c7db1891">Implement a separate parser for the reference path syntax.</p>
+</li>
+<li> <p id="_cf883208-a76b-d9fb-a2e6-5734d6ea8fa5">Develop algorithms to traverse reference paths within the context of the loaded schemas.</p>
+</li>
+<li> <p id="_affa6278-7aec-d8c9-79b5-d2e2276f619e">Implement functions to evaluate constraints specified in reference paths.</p>
2
000727_38a8ac16-a538-2e04-95d7-b6eef1d2a25aAll lists must be preceded by colon or full stop: Performance considerations
<ol id="_38a8ac16-a538-2e04-95d7-b6eef1d2a25a"> <li> <p id="_68f972eb-6da9-f98c-3aea-6c26b42b2480">Use efficient data structures (e.g., hash tables) for quick lookups of schema elements.</p>
+</li>
+<li> <p id="_bac68cb0-edab-8203-813b-a14ef079aafb">Implement caching mechanisms for frequently accessed schema information.</p>
+</li>
+<li> <p id="_8f90318d-57fc-1c6b-a60e-c3025e676e21">Consider parallel processing for validating multiple entity or attribute mappings simultaneously.</p>
2
000738_5acf938e-16c7-b844-662c-649c5ad9f97cAll lists must be preceded by colon or full stop: Extensibility
<ol id="_5acf938e-16c7-b844-662c-649c5ad9f97c"> <li> <p id="_ef8b2042-8f3f-465b-627e-1984274dfa0d">Design the implementation to be extensible, allowing for future enhancements to the EXPRESS-Q language.</p>
+</li>
+<li> <p id="_811549c8-5eb4-c7c2-43c3-f7aa4cc647de">Use modular design to separate concerns (e.g., parsing, schema handling, validation).</p>
+</li>
+</ol>
2
000747_3a121c98-8c99-871d-106a-399d1fc6eeceAll lists must be preceded by colon or full stop: Integration
<ol id="_3a121c98-8c99-871d-106a-399d1fc6eece"> <li> <p id="_1e30fd28-a504-aefa-754e-b278205a5f12">Provide APIs or interfaces for integrating the EXPRESS-Q parser and validator into larger systems or workflows.</p>
+</li>
+<li> <p id="_0e017fc7-617f-11ea-286d-cca0793287d2">Consider implementing export functionality to generate reports or machine-readable representations of the validation results.</p>
+</li>
+</ol>
2
000841_55e3cd2b-1991-7f44-edf6-34abbcbf3934may contain ambiguous provision: This example shows how EXPRESS-Q can handle cases where an ARM entity might be mapped to different MIM representations based on certain conditions.
<p id="_55e3cd2b-1991-7f44-edf6-34abbcbf3934">This example shows how EXPRESS-Q can handle cases where an ARM entity might be mapped to different MIM representations based on certain conditions.</p>
2
000889_9fe975fc-e6b4-1af8-89e1-2e1bb8c191b8Hanging paragraph in clause
<clause id="_9fe975fc-e6b4-1af8-89e1-2e1bb8c191b8" inline-header="false" obligation="normative">
+<title id="_c25ad391-aa3c-533a-46fb-5b71ac154745">Future considerations</title>
+<p id="_62ba8cbc-353a-76f6-ac96-9686963e845d">As the use of EXPRESS-Q grows and evolves, several areas may be considered for future enhancements:</p>
+
+<clause id="_c2b817e1-5bbe-c886-fc6c-4e2e06693364" inline-header="false" obligation="normative">
2
000895_d53ef69f-7270-2802-ad94-17e56df2fe72may contain ambiguous provision: Future versions of EXPRESS-Q might benefit from a more expressive constraint language,​ allowing for more complex conditions and transformations to be specified within mappings.​
<p id="_d53ef69f-7270-2802-ad94-17e56df2fe72">Future versions of EXPRESS-Q might benefit from a more expressive constraint language, allowing for more complex conditions and transformations to be specified within mappings.</p>
2
000910_9485e94e-f305-ee96-5da7-043034e6b27emay contain ambiguous provision: Future versions might include capabilities for defining bi-directional mappings,​ allowing for the generation of ARM instances from MIM data.
<p id="_9485e94e-f305-ee96-5da7-043034e6b27e">Future versions might include capabilities for defining bi-directional mappings, allowing for the generation of ARM instances from MIM data.</p>
2
000922_edc4e68c-7694-74ba-f69b-7cab359f5100Annex has not been cross-referenced within document
<annex id="_edc4e68c-7694-74ba-f69b-7cab359f5100" inline-header="false" obligation="informative">
+<title id="_895176c0-7012-de53-ab92-1675513bacf3">Complete EXPRESS-Q file example</title>
+<p id="_109982b6-9835-3cdf-d6aa-f9e568da7e29">This annex provides a complete example of an EXPRESS-Q file, demonstrating various features of the language in a cohesive context.</p>
+
+<sourcecode id="_92603d37-d405-4c01-1ec5-7e31e50e9c66"> <body>-- Example EXPRESS-Q file for a simplified product data model
1
001048_46e42dd0-a5e8-a408-222f-1a0027416d24List entry of separate sentences must end with full stop: Entity and attribute mappings
<li> <p id="_8f95e861-4714-1783-c11b-4b9237090d17">Entity and attribute mappings</p>
+</li>
2
001050_46e42dd0-a5e8-a408-222f-1a0027416d24List entry of separate sentences must end with full stop: Reference paths with complex relationships
<li> <p id="_b21ccecb-4563-aa89-8835-9adb4863863e">Reference paths with complex relationships</p>
+</li>
2
001052_46e42dd0-a5e8-a408-222f-1a0027416d24List entry of separate sentences must end with full stop: Alternative mappings
<li> <p id="_2332c048-2e6d-7e76-e399-e50a121ef114">Alternative mappings</p>
+</li>
2
001054_46e42dd0-a5e8-a408-222f-1a0027416d24List entry of separate sentences must end with full stop: Constraints within reference paths
<li> <p id="_ec420559-ba09-71ea-defe-8cd7ffe98071">Constraints within reference paths</p>
+</li>
2
001056_46e42dd0-a5e8-a408-222f-1a0027416d24List entry of separate sentences must end with full stop: Use of SELECT types (implied by the EXTENSIBLE: TRUE; in GeometricRepresenta­tion)
<li> <p id="_e5699728-5944-09a7-e974-fc511c917314">Use of SELECT types (implied by the EXTENSIBLE: TRUE; in GeometricRepresentation)</p>
+</li>
2
+

Metanorma XML Syntax

+ + + + + + + + + + + + + + + + + + + +
LineIDMessageContextSeverity
XML Line 001145:18text not allowed here; expected the element end-tag or element "city", "country", "formattedPlace", "region" or "uri"
2
XML Line 001225:18text not allowed here; expected the element end-tag or element "city", "country", "formattedPlace", "region" or "uri"
2
XML Line 001367:18text not allowed here; expected the element end-tag or element "city", "country", "formattedPlace", "region" or "uri"
2
XML Line 001509:18text not allowed here; expected the element end-tag or element "city", "country", "formattedPlace", "region" or "uri"
2
XML Line 001572:18text not allowed here; expected the element end-tag or element "city", "country", "formattedPlace", "region" or "uri"
2
+ diff --git a/sources/document.html b/sources/document.html new file mode 100644 index 0000000..332f053 --- /dev/null +++ b/sources/document.html @@ -0,0 +1,1860 @@ + + + + + + + +EXPRESS-Q: EXPRESS Query Language Specification + + + + + +
+
+
+
+ + + + + +
+
Note
+
+
Foreword
+This document is developed and published by the EXPRESS Language +Foundation. All rights reserved. +
+
+
+

The EXPRESS Language Foundation, maintainer of the EXPRESS data modeling language, +develops and maintains language standards and technologies. The work of +preparing EXPRESS standards is carried out through technical working groups. +Each member interested in a subject for which a working group has been +established has the right to participate in that group. International +organizations, both governmental and non-governmental, also take part in the +work.

+
+
+

The procedures used to develop this document and those intended for its further +maintenance are described in the EXPRESS Language Foundation’s documentation +guidelines. In particular, different approval criteria are needed for different +types of documents. This document was drafted in accordance with the EXPRESS +Language Foundation’s editorial rules and guidelines.

+
+
+

Attention is drawn to the possibility that some of the elements of this document +may be the subject of patent rights. The EXPRESS Language Foundation shall not +be held responsible for identifying any or all such patent rights. Details of +any patent rights identified during the development of the document will be in +the Introduction.

+
+
+

Any trade name used in this document is information given for the convenience of +users and does not constitute an endorsement.

+
+
+

For an explanation of the voluntary nature of standards and the meaning of +EXPRESS Language Foundation specific terms and expressions related to conformity +assessment, please refer to the Foundation’s documentation guidelines.

+
+
+

This document was prepared by the EXPRESS Language Foundation’s Technical +Working Group.

+
+
+

EXPRESS is organized as a series of specifications, each published separately. +The structure of EXPRESS is described in the Core Language Specification.

+
+
+

Each specification is a member of one of the following series: description +methods, implementation methods, conformance testing methodology and framework, +integrated generic resources, integrated application resources, application +protocols, abstract test suites, application interpreted constructs, and +application modules. This part is a member of the description methods series.

+
+
+
+
+

Introduction

+
+
+

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. By providing a standardized +way to express these mappings and constraints, EXPRESS-Q facilitates more robust +and reliable data exchange in complex engineering and manufacturing +environments.

+
+
+
+
+

Scope

+
+
+

This document specifies EXPRESS-Q, including its syntax, semantics, and usage within the context of EXPRESS schemas and STEP application protocols.

+
+
+

The specification covers:

+
+
+
    +
  1. +

    The grammar and syntax of EXPRESS-Q

    +
  2. +
  3. +

    The semantics of EXPRESS-Q constructs

    +
  4. +
  5. +

    The reference path syntax used for defining detailed mappings

    +
  6. +
  7. +

    Validation rules for EXPRESS-Q files

    +
  8. +
  9. +

    Guidelines for implementing EXPRESS-Q parsers and validators

    +
  10. +
+
+
+

This specification is intended for use by software developers, data modelers, +and systems integrators working with EXPRESS schemas and STEP application +protocols.

+
+
+
+
+

Normative references

+
+
+
    +
  • +

    [ISO 10303-1:2024]

    +
  • +
  • +

    [ISO 10303-11:2004]

    +
  • +
  • +

    [ISO/IEC 8824-1:2008]

    +
  • +
  • +

    [ISO/IEC 10646:2011]

    +
  • +
+
+
+
+
+

Terms and definitions

+
+
+

EXPRESS-Q

+
+

query language for EXPRESS schemas, used to define mappings and constraints +between ARM and MIM schemas

+
+
+
+
+
+

EXPRESS-Q language specification

+
+
+

Overview

+
+

EXPRESS-Q is designed to work alongside EXPRESS schemas, providing a mechanism +to define mappings between ARM and MIM schemas, as well as specifying +constraints on datasets. The language uses a syntax similar to EXPRESS but +introduces new constructs specific to querying and mapping.

+
+
+

An EXPRESS-Q file typically consists of one or more entity mappings, each of +which defines how an ARM entity and its attributes correspond to MIM elements. +These mappings can include various declarations such as extensibility, AIM +elements, sources, EXPRESS references, reference paths, and alternative +mappings.

+
+
+
+

EBNF grammar

+
+

The following EBNF (Extended Backus-Naur Form) grammar defines the syntax of +EXPRESS-Q:

+
+
+
+
express_q_file = { entity_mapping } ;
+
+entity_mapping = "ENTITY_MAPPING" entity_name ";" newline
+                 [ extensible_decl ]
+                 [ aim_element_decl ]
+                 [ source_decl ]
+                 [ express_ref_decl ]
+                 [ refpath_decl ]
+                 [ alt_map_decl ]
+                 { attribute_mapping }
+                 "END_ENTITY_MAPPING" ";" ;
+
+extensible_decl = "EXTENSIBLE" ":" boolean ";" newline ;
+
+aim_element_decl = "AIM_ELEMENT" ":" string ";" newline ;
+
+source_decl = "SOURCE" ":" string ";" newline ;
+
+express_ref_decl = "EXPRESS_REF" ":" "[" [ string { "," string } ] "]" ";" newline ;
+
+refpath_decl = "REFPATH" ":" "{" newline
+               refpath_content
+               "}" ";" newline ;
+
+refpath_content = { refpath_line } ;
+
+refpath_line = [ indentation ] reference_expression newline ;
+
+reference_expression = entity_reference [ relationship { relationship } ] ;
+
+relationship = path_relation | supertype_relation | subtype_relation | 
+                select_extension | constraint ;
+
+entity_reference = identifier ;
+
+path_relation = "->" entity_reference ;
+
+supertype_relation = "=>" entity_reference ;
+
+subtype_relation = "<=" entity_reference ;
+
+select_extension = "*" ">" entity_reference | "<" "*" entity_reference ;
+
+constraint = "[" constraint_expression "]" ;
+
+constraint_expression = ? expression following EXPRESS syntax ? ;
+
+indentation = ? one or more spaces or tabs ? ;
+
+alt_map_decl = "ALT_MAP" ":" "[" [ string { "," string } ] "]" ";" newline ;
+
+attribute_mapping = "ATTRIBUTE_MAPPING" attribute_name ";" newline
+                    "ASSERTION_TO" ":" string ";" newline
+                    [ aim_element_decl ]
+                    [ source_decl ]
+                    [ express_ref_decl ]
+                    [ refpath_decl ]
+                    "END_ATTRIBUTE_MAPPING" ";" newline ;
+
+entity_name = identifier ;
+
+attribute_name = identifier ;
+
+identifier = letter { letter | digit | "_" } ;
+
+boolean = "TRUE" | "FALSE" ;
+
+string = '"' { character } '"' ;
+
+letter = "A" | ... | "Z" | "a" | ... | "z" ;
+
+digit = "0" | ... | "9" ;
+
+character = ? any printable character ? ;
+
+indentation = ? one or more spaces or tabs ? ;
+
+newline = ? line break character(s) ? ;
+
+
+
+

This grammar defines the overall structure of an EXPRESS-Q file, including +entity mappings, attribute mappings, reference paths, including various types +of relationships between entities and constraints, and various declarations.

+
+
+
+

Semantics

+
+

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

+
+
+

Entity mapping

+
+
+
entity_mapping = "ENTITY_MAPPING" entity_name ";" newline
+                 [ extensible_decl ]
+                 [ aim_element_decl ]
+                 [ source_decl ]
+                 [ express_ref_decl ]
+                 [ refpath_decl ]
+                 [ alt_map_decl ]
+                 { attribute_mapping }
+                 "END_ENTITY_MAPPING" ";" ;
+
+
+
+

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).

+
+
+
+
Usage
+
+
+
    +
  • +

    Begin with "ENTITY_MAPPING" followed by the ARM entity name.

    +
  • +
  • +

    Include optional declarations for extensibility, AIM element, source, EXPRESS references, reference path, and alternative mappings.

    +
  • +
  • +

    Include attribute mappings for the entity’s attributes.

    +
  • +
  • +

    End with "END_ENTITY_MAPPING".

    +
  • +
+
+
+
+
+
+
+
ENTITY_MAPPING Product;
+EXTENSIBLE: FALSE;
+AIM_ELEMENT: "product";
+SOURCE: "ISO 10303-41";
+EXPRESS_REF: ["product_definition_schema"];
+REFPATH: {
+  product <= product_definition_formation
+  product_definition_formation.of_product -> product
+};
+ATTRIBUTE_MAPPING id;
+ASSERTION_TO: "id";
+AIM_ELEMENT: "product.id";
+END_ATTRIBUTE_MAPPING;
+END_ENTITY_MAPPING;
+
+
+
+
+

Extensible declaration

+
+
+
extensible_decl = "EXTENSIBLE" ":" boolean ";" newline ;
+
+
+
+

The extensible declaration specifies whether the entity mapping is extensible, corresponding to the extensibility of SELECT types in EXPRESS schemas.

+
+
+
+
Usage
+
+
+
    +
  • +

    Use "EXTENSIBLE: TRUE;" for extensible mappings.

    +
  • +
  • +

    Use "EXTENSIBLE: FALSE;" for non-extensible mappings.

    +
  • +
+
+
+
+
+
+
+
ENTITY_MAPPING ProductCategory;
+EXTENSIBLE: TRUE;
+...
+END_ENTITY_MAPPING;
+
+
+
+
+

AIM element declaration

+
+
+
aim_element_decl = "AIM_ELEMENT" ":" string ";" newline ;
+
+
+
+

The AIM element declaration specifies the corresponding AIM (MIM) element for the ARM entity, providing a direct link between the ARM and MIM schemas.

+
+
+
+
Usage
+
+
+
    +
  • +

    Specify the AIM element name as a string.

    +
  • +
+
+
+
+
+
+
+
ENTITY_MAPPING Product;
+AIM_ELEMENT: "product";
+...
+END_ENTITY_MAPPING;
+
+
+
+
+

Source declaration

+
+
+
source_decl = "SOURCE" ":" string ";" newline ;
+
+
+
+

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.

+
+
+
+
Usage
+
+
+
    +
  • +

    Specify the source as a string, typically an ISO standard number.

    +
  • +
+
+
+
+
+
+
+
ENTITY_MAPPING Product;
+SOURCE: "ISO 10303-41";
+...
+END_ENTITY_MAPPING;
+
+
+
+
+

EXPRESS reference declaration

+
+
+
express_ref_decl = "EXPRESS_REF" ":" "[" [ string { "," string } ] "]" ";" newline ;
+
+
+
+

The EXPRESS reference declaration lists EXPRESS references related to the mapping, used to link the mapping to specific parts of the EXPRESS schemas or other relevant documentation.

+
+
+
+
Usage
+
+
+
    +
  • +

    Provide a comma-separated list of references enclosed in square brackets.

    +
  • +
  • +

    Use an empty list "[]" if there are no references.

    +
  • +
+
+
+
+
+
+
+
ENTITY_MAPPING Product;
+EXPRESS_REF: ["product_definition_schema", "management_resources_schema"];
+...
+END_ENTITY_MAPPING;
+
+
+
+
+

Reference path declaration

+
+
General
+
+

The reference path syntax in EXPRESS-Q is based on the ISO 10303 Mapping +Specification and is used within the REFPATH sections to define precise mappings +between ARM and MIM elements. This syntax allows for complex relationships and +constraints to be expressed concisely.

+
+
+
+
refpath_decl = "REFPATH" ":" "{" newline
+               refpath_content
+               "}" ";" newline ;
+
+
+
+

The reference path declaration defines the detailed mapping between ARM and MIM elements using the reference path syntax described earlier.

+
+
+
+
Usage
+
+
+
    +
  • +

    Begin with REFPATH: { and end with };.

    +
  • +
  • +

    Each line in the content describes a step in the mapping path.

    +
  • +
  • +

    Use indentation to indicate nested structures.

    +
  • +
  • +

    Use symbols like , , to indicate relationships between entities and attributes.

    +
  • +
+
+
+
+
+
+
+
ENTITY_MAPPING Product;
+REFPATH: {
+  product <= product_definition_formation
+  product_definition_formation.of_product -> product
+  {product.name -> product.name
+   product.description -> product.description}
+};
+...
+END_ENTITY_MAPPING;
+
+
+
+
+
Symbols and meaning
+
+

The reference path syntax uses several symbols to express relationships and constraints. These symbols are derived from the ISO 10303 Mapping Specification:

+
+
+
+
[]
+
+

Enclosed section constrains multiple MIM elements or sections of the reference +path required to satisfy an information requirement.

+
+
()
+
+

Enclosed section constrains multiple MIM elements or sections of the reference +path identified as alternatives within the mapping.

+
+
{}
+
+

Enclosed section constrains the reference path to satisfy an information +requirement.

+
+
<>
+
+

Enclosed section constrains one or more required reference paths.

+
+
||
+
+

Enclosed section constrains the supertype entity.

+
+
+
+

The attribute whose name precedes the symbol references the entity or select type whose name follows the symbol.

+
+
+
+

The entity or select type whose name precedes the symbol is referenced by the entity attribute whose name follows the symbol.

+
+
[i]
+
+

The attribute whose name precedes the symbol is an aggregate; any element of that aggregate is referred to.

+
+
[n]
+
+

The attribute whose name precedes the symbol is an ordered aggregate; member n of that aggregate is referred to.

+
+
+
+

The entity whose name precedes the symbol is a supertype of the entity whose name follows the symbol.

+
+
+
+

The entity whose name precedes the symbol is a subtype of the entity whose name follows the symbol.

+
+
=
+
+

The string, select, or enumeration type is constrained to a choice or value.

+
+
\
+
+

The reference path expression continues on the next line.

+
+
*
+
+

One or more instances of the relationship entity data type may be assembled in a relationship tree structure.

+
+
--
+
+

The text following is a comment or introduces a clause reference.

+
+
*>
+
+

The select or enumeration type whose name precedes the symbol is extended into the select or enumeration type whose name follows the symbol.

+
+
<*
+
+

The select or enumeration type whose name precedes the symbol is an extension of the select or enumeration type whose name follows the symbol.

+
+
!{}
+
+

Section enclosed by {} indicates a negative constraint placed on the mapping.

+
+
+
+
+
+
Usage and examples
+
+

The reference path syntax is used to define precise mappings between ARM and MIM +elements. Here are some examples demonstrating various aspects of the syntax:

+
+
+
Example 1. Simple attribute mapping
+
+
+
+
REFPATH: {
+  product.id -> id
+}
+
+
+
+
+
+
Example 2. Subtype relationship
+
+
+
+
REFPATH: {
+  mechanical_context <= product_context
+}
+
+
+
+
+
+
Example 3. Complex mapping with alternatives and constraints
+
+
+
+
REFPATH: {
+  shape_representation <= representation
+  {representation.items[i] -> representation_item
+   representation_item =>
+   (geometric_representation_item
+    [geometric_representation_item.dim = 3] |
+    mapped_item)
+  }
+}
+
+
+
+
+
+
Example 4. Select type extension
+
+
+
+
REFPATH: {
+  person_and_organization_select *> organization
+}
+
+
+
+
+
+
Example 5. Negative constraint
+
+
+
+
REFPATH: {
+  product_definition_formation
+  !{product_definition_formation.make_or_buy = bought_item}
+}
+
+
+
+
+
+
+
Validation rules for reference paths
+
+

When validating reference paths, the following rules should be applied:

+
+
+
    +
  1. +

    All referenced entities and attributes shall exist in the corresponding ARM or MIM schema.

    +
  2. +
  3. +

    The relationships between entities (supertype, subtype, attribute reference) shall be consistent with the schema definitions.

    +
  4. +
  5. +

    Constraints shall be syntactically correct and use only attributes or functions that are valid for the constrained entity.

    +
  6. +
  7. +

    Select type extensions shall be consistent with the schema definitions.

    +
  8. +
  9. +

    Aggregate references (using [i] or [n]) shall be applied only to attributes defined as aggregates in the schema.

    +
  10. +
  11. +

    Alternative mappings (using parentheses) shall all be valid according to the schema.

    +
  12. +
  13. +

    Negative constraints shall be logically consistent with the rest of the mapping and the schema definitions.

    +
  14. +
  15. +

    The overall structure of the reference path shall form a valid path through the schema, connecting the source ARM entity to the target MIM entity or attribute.

    +
  16. +
+
+
+
+
+

Alternative mapping declaration

+
+
+
alt_map_decl = "ALT_MAP" ":" "[" [ string { "," string } ] "]" ";" newline ;
+
+
+
+

The alternative mapping declaration specifies alternative mappings, allowing for flexibility in cases where multiple valid mappings exist.

+
+
+
+
Usage
+
+
+
    +
  • +

    Provide a comma-separated list of alternative mappings enclosed in square brackets.

    +
  • +
  • +

    Use an empty list "[]" if there are no alternative mappings.

    +
  • +
+
+
+
+
+
+
+
ENTITY_MAPPING GeometricRepresentation;
+ALT_MAP: ["shape_representation", "tessellated_shape_representation"];
+...
+END_ENTITY_MAPPING;
+
+
+
+
+

Attribute mapping

+
+
+
attribute_mapping = "ATTRIBUTE_MAPPING" attribute_name ";" newline
+                    "ASSERTION_TO" ":" string ";" newline
+                    [ aim_element_decl ]
+                    [ source_decl ]
+                    [ express_ref_decl ]
+                    [ refpath_decl ]
+                    "END_ATTRIBUTE_MAPPING" ";" newline ;
+
+
+
+

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

+
+
+
+
Usage
+
+
+
    +
  • +

    Begin with "ATTRIBUTE_MAPPING" followed by the attribute name.

    +
  • +
  • +

    Specify the ASSERTION_TO value, which indicates the corresponding MIM element or type.

    +
  • +
  • +

    Optionally include AIM_ELEMENT, SOURCE, EXPRESS_REF, and REFPATH declarations.

    +
  • +
  • +

    End with "END_ATTRIBUTE_MAPPING".

    +
  • +
+
+
+
+
+
+
+
ENTITY_MAPPING Product;
+ATTRIBUTE_MAPPING id;
+ASSERTION_TO: "id";
+AIM_ELEMENT: "product.id";
+REFPATH: {
+  product.id -> id
+};
+END_ATTRIBUTE_MAPPING;
+
+ATTRIBUTE_MAPPING name;
+ASSERTION_TO: "label";
+AIM_ELEMENT: "product.name";
+SOURCE: "ISO 10303-41";
+EXPRESS_REF: ["product_definition_schema"];
+REFPATH: {
+  product.name -> name
+};
+END_ATTRIBUTE_MAPPING;
+END_ENTITY_MAPPING;
+
+
+
+
+
+
+
+

Validation rules

+
+
+

General

+
+

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.

+
+
+
+

Entity mapping validation

+
+
    +
  1. +

    Each ENTITY_MAPPING shall correspond to an entity defined in the ARM schema.

    +
  2. +
  3. +

    The AIM_ELEMENT specified shall exist in the MIM schema.

    +
  4. +
  5. +

    The SOURCE referenced shall be a valid ISO standard or other recognized source.

    +
  6. +
  7. +

    All EXPRESS_REF entries shall refer to valid EXPRESS schemas.

    +
  8. +
  9. +

    The REFPATH shall form a valid path from the ARM entity to the specified AIM_ELEMENT.

    +
  10. +
  11. +

    If ALT_MAP is specified, all alternative mappings shall be valid MIM entities.

    +
  12. +
+
+
+
+

Attribute mapping validation

+
+
    +
  1. +

    Each ATTRIBUTE_MAPPING shall correspond to an attribute of the ARM entity being mapped.

    +
  2. +
  3. +

    The ASSERTION_TO value shall be a valid type or entity in the MIM schema.

    +
  4. +
  5. +

    If specified, the AIM_ELEMENT shall exist in the MIM schema.

    +
  6. +
  7. +

    The REFPATH for an attribute shall form a valid path from the ARM attribute to the specified MIM element.

    +
  8. +
+
+
+
+

Reference path validation

+
+
    +
  1. +

    All entities and attributes referenced in the REFPATH shall exist in either the ARM or MIM schema, as appropriate.

    +
  2. +
  3. +

    Relationships between entities (e.g., subtype, supertype) shall be consistent with the schema definitions.

    +
  4. +
  5. +

    Constraints specified in the REFPATH shall use valid attributes or functions for the entities they constrain.

    +
  6. +
  7. +

    SELECT type extensions shall be consistent with the schema definitions.

    +
  8. +
  9. +

    Aggregate references (using [i] or [n]) shall only be applied to attributes defined as aggregates in the schema.

    +
  10. +
+
+
+
+

Overall consistency

+
+
    +
  1. +

    The complete set of mappings shall cover all entities and attributes in the ARM schema.

    +
  2. +
  3. +

    There should be no conflicting mappings (e.g., two different mappings for the same ARM entity or attribute).

    +
  4. +
  5. +

    The overall set of mappings should form a consistent and complete transformation from the ARM to the MIM schema.

    +
  6. +
+
+
+
+
+
+

Implementation guidelines

+
+
+

General

+
+

When implementing an EXPRESS-Q parser and validator, consider the following guidelines.

+
+
+
+

Parsing

+
+
    +
  1. +

    Implement a lexical analyzer to tokenize the EXPRESS-Q input.

    +
  2. +
  3. +

    Develop a parser based on the EBNF grammar provided in this specification.

    +
  4. +
  5. +

    Create an abstract syntax tree (AST) or similar internal representation of the parsed EXPRESS-Q file.

    +
  6. +
+
+
+
+

Schema loading

+
+
    +
  1. +

    Implement an EXPRESS schema parser or use an existing library to load and interpret ARM and MIM schemas.

    +
  2. +
  3. +

    Create internal representations of the schemas that allow for efficient querying of entities, attributes, and relationships.

    +
  4. +
+
+
+
+

Validation

+
+
    +
  1. +

    Implement validation checks based on the rules outlined in the "Validation rules" section.

    +
  2. +
  3. +

    Perform two-pass validation:

    +
    +
      +
    1. +

      First pass: Check syntax and basic semantic rules (e.g., entity and attribute existence).

      +
    2. +
    3. +

      Second pass: Validate complex semantic rules (e.g., consistency of reference paths).

      +
    4. +
    +
    +
  4. +
  5. +

    Provide clear and informative error messages for validation failures.

    +
  6. +
+
+
+
+

Reference path interpretation

+
+
    +
  1. +

    Implement a separate parser for the reference path syntax.

    +
  2. +
  3. +

    Develop algorithms to traverse reference paths within the context of the loaded schemas.

    +
  4. +
  5. +

    Implement functions to evaluate constraints specified in reference paths.

    +
  6. +
+
+
+
+

Performance considerations

+
+
    +
  1. +

    Use efficient data structures (e.g., hash tables) for quick lookups of schema elements.

    +
  2. +
  3. +

    Implement caching mechanisms for frequently accessed schema information.

    +
  4. +
  5. +

    Consider parallel processing for validating multiple entity or attribute mappings simultaneously.

    +
  6. +
+
+
+
+

Extensibility

+
+
    +
  1. +

    Design the implementation to be extensible, allowing for future enhancements to the EXPRESS-Q language.

    +
  2. +
  3. +

    Use modular design to separate concerns (e.g., parsing, schema handling, validation).

    +
  4. +
+
+
+
+

Integration

+
+
    +
  1. +

    Provide APIs or interfaces for integrating the EXPRESS-Q parser and validator into larger systems or workflows.

    +
  2. +
  3. +

    Consider implementing export functionality to generate reports or machine-readable representations of the validation results.

    +
  4. +
+
+
+
+
+
+

Use cases and examples

+
+
+

General

+
+

This section provides examples of how EXPRESS-Q can be used in various scenarios +related to STEP application protocols.

+
+
+
+

Use case 1: Mapping a complex product structure

+
+

In this example, we’ll demonstrate how EXPRESS-Q can be used to map a complex product structure from an ARM schema to a MIM schema.

+
+
+
+
ENTITY_MAPPING Product;
+AIM_ELEMENT: "product";
+SOURCE: "ISO 10303-41";
+REFPATH: {
+  product <= product_definition_formation
+  product_definition_formation.of_product -> product
+};
+
+ATTRIBUTE_MAPPING id;
+ASSERTION_TO: "id";
+AIM_ELEMENT: "product.id";
+END_ATTRIBUTE_MAPPING;
+
+ATTRIBUTE_MAPPING name;
+ASSERTION_TO: "label";
+AIM_ELEMENT: "product.name";
+END_ATTRIBUTE_MAPPING;
+
+ATTRIBUTE_MAPPING description;
+ASSERTION_TO: "text";
+AIM_ELEMENT: "product.description";
+END_ATTRIBUTE_MAPPING;
+
+ATTRIBUTE_MAPPING components;
+ASSERTION_TO: "SET OF Component";
+REFPATH: {
+  product <- product_definition_formation
+  product_definition_formation <- product_definition
+  product_definition <- product_definition_relationship.relating_product_definition
+  product_definition_relationship ->
+  product_definition_relationship.related_product_definition
+  product_definition_relationship.related_product_definition -> product_definition
+  product_definition -> product_definition_formation
+  product_definition_formation -> product
+};
+END_ATTRIBUTE_MAPPING;
+
+END_ENTITY_MAPPING;
+
+ENTITY_MAPPING Component;
+AIM_ELEMENT: "product";
+SOURCE: "ISO 10303-41";
+REFPATH: {
+  product <= product_definition_formation
+  product_definition_formation.of_product -> product
+};
+
+ATTRIBUTE_MAPPING id;
+ASSERTION_TO: "id";
+AIM_ELEMENT: "product.id";
+END_ATTRIBUTE_MAPPING;
+
+ATTRIBUTE_MAPPING name;
+ASSERTION_TO: "label";
+AIM_ELEMENT: "product.name";
+END_ATTRIBUTE_MAPPING;
+
+ATTRIBUTE_MAPPING quantity;
+ASSERTION_TO: "measure_with_unit";
+REFPATH: {
+  product <- product_definition_formation
+  product_definition_formation <- product_definition
+  product_definition <- product_definition_relationship
+  product_definition_relationship.related_product_definition_quantity -> measure_with_unit
+};
+END_ATTRIBUTE_MAPPING;
+
+END_ENTITY_MAPPING;
+
+
+
+

This example demonstrates how a product with multiple components can be mapped from an ARM schema to a MIM schema using EXPRESS-Q. It shows the use of complex reference paths to navigate relationships between entities in the MIM schema.

+
+
+
+

Use case 2: Mapping with alternative representations

+
+

This example shows how EXPRESS-Q can handle cases where an ARM entity might be mapped to different MIM representations based on certain conditions.

+
+
+
+
ENTITY_MAPPING GeometricRepresentation;
+ALT_MAP: ["shape_representation", "tessellated_shape_representation"];
+SOURCE: "ISO 10303-42";
+
+REFPATH: {
+  (shape_representation <= representation
+   [representation.context_of_items->geometric_representation_context]) |
+  (tessellated_shape_representation <= representation
+   [representation.context_of_items->geometric_representation_context])
+};
+
+ATTRIBUTE_MAPPING items;
+ASSERTION_TO: "SET OF geometric_representation_item";
+REFPATH: {
+  representation.items[i] -> geometric_representation_item
+};
+END_ATTRIBUTE_MAPPING;
+
+END_ENTITY_MAPPING;
+
+
+
+

This example demonstrates how EXPRESS-Q can handle alternative mappings for a single ARM entity. The GeometricRepresentation entity can be mapped to either a shape_representation or a tessellated_shape_representation in the MIM schema, depending on the specific requirements of the application.

+
+
+
+
+
+

Summary

+
+
+

EXPRESS-Q provides a powerful and flexible language for defining mappings between ARM and MIM schemas in the context of STEP application protocols. By offering a standardized way to express these mappings, EXPRESS-Q facilitates more robust and reliable data exchange in complex engineering and manufacturing environments.

+
+
+

Key features of EXPRESS-Q include:

+
+
+
    +
  1. +

    A syntax that is familiar to users of EXPRESS, reducing the learning curve.

    +
  2. +
  3. +

    The ability to define detailed mappings between ARM and MIM entities and attributes.

    +
  4. +
  5. +

    Support for complex reference paths, allowing for navigation through intricate schema relationships.

    +
  6. +
  7. +

    Mechanisms for specifying constraints and alternative mappings.

    +
  8. +
  9. +

    Clear separation of entity and attribute mappings for improved readability and maintainability.

    +
  10. +
+
+
+

The validation rules and implementation guidelines provided in this specification aim to ensure consistent interpretation and implementation of EXPRESS-Q across different tools and systems.

+
+
+
+
+

Future considerations

+
+
+

As the use of EXPRESS-Q grows and evolves, several areas may be considered for future enhancements:

+
+
+

Extended constraint language

+
+

Future versions of EXPRESS-Q might benefit from a more expressive constraint language, allowing for more complex conditions and transformations to be specified within mappings.

+
+
+
+

Integration with other standards

+
+

Consideration should be given to how EXPRESS-Q can be integrated with other relevant standards and technologies, such as ontology languages or model transformation frameworks.

+
+
+
+

Tool support

+
+

Development of standardized libraries and tools for parsing, validating, and processing EXPRESS-Q files would greatly facilitate its adoption and use.

+
+
+
+

Reverse mapping capabilities

+
+

Future versions might include capabilities for defining bi-directional mappings, allowing for the generation of ARM instances from MIM data.

+
+
+
+

Performance optimizations

+
+

As EXPRESS-Q is used with increasingly large and complex schemas, performance optimizations in both the language design and implementation guidelines may become necessary.

+
+
+
+
+
+

Appendix A: Complete EXPRESS-Q file example

+
+
+

This annex provides a complete example of an EXPRESS-Q file, demonstrating +various features of the language in a cohesive context.

+
+
+
+
-- Example EXPRESS-Q file for a simplified product data model
+
+ENTITY_MAPPING Product;
+EXTENSIBLE: FALSE;
+AIM_ELEMENT: "product";
+SOURCE: "ISO 10303-41";
+EXPRESS_REF: ["product_definition_schema"];
+REFPATH: {
+  product <= product_definition_formation
+  product_definition_formation.of_product -> product
+};
+
+ATTRIBUTE_MAPPING id;
+ASSERTION_TO: "identifier";
+AIM_ELEMENT: "product.id";
+REFPATH: {
+  product.id -> id
+};
+END_ATTRIBUTE_MAPPING;
+
+ATTRIBUTE_MAPPING name;
+ASSERTION_TO: "label";
+AIM_ELEMENT: "product.name";
+REFPATH: {
+  product.name -> name
+};
+END_ATTRIBUTE_MAPPING;
+
+ATTRIBUTE_MAPPING description;
+ASSERTION_TO: "text";
+AIM_ELEMENT: "product.description";
+REFPATH: {
+  product.description -> description
+};
+END_ATTRIBUTE_MAPPING;
+
+ATTRIBUTE_MAPPING category;
+ASSERTION_TO: "product_category";
+REFPATH: {
+  product <- product_category_assignment.products[i]
+  product_category_assignment -> product_category_assignment.assigned_category
+  product_category_assignment.assigned_category -> product_category
+};
+END_ATTRIBUTE_MAPPING;
+
+END_ENTITY_MAPPING;
+
+ENTITY_MAPPING Assembly;
+EXTENSIBLE: FALSE;
+AIM_ELEMENT: "product";
+SOURCE: "ISO 10303-44";
+EXPRESS_REF: ["product_structure_schema"];
+REFPATH: {
+  product <= product_definition_formation
+  product_definition_formation.of_product -> product
+  [product <- product_definition_formation
+   product_definition_formation <- product_definition
+   product_definition <- assembly_component_usage.relating_product_definition]
+};
+
+ATTRIBUTE_MAPPING components;
+ASSERTION_TO: "SET OF AssemblyComponent";
+REFPATH: {
+  product <- product_definition_formation
+  product_definition_formation <- product_definition
+  product_definition <- assembly_component_usage.relating_product_definition
+  assembly_component_usage -> assembly_component_usage.related_product_definition
+  assembly_component_usage.related_product_definition -> product_definition
+  product_definition -> product_definition_formation
+  product_definition_formation -> product
+};
+END_ATTRIBUTE_MAPPING;
+
+END_ENTITY_MAPPING;
+
+ENTITY_MAPPING AssemblyComponent;
+EXTENSIBLE: FALSE;
+AIM_ELEMENT: "product";
+SOURCE: "ISO 10303-44";
+EXPRESS_REF: ["product_structure_schema"];
+REFPATH: {
+  product <= product_definition_formation
+  product_definition_formation.of_product -> product
+};
+
+ATTRIBUTE_MAPPING quantity;
+ASSERTION_TO: "measure_with_unit";
+REFPATH: {
+  product <- product_definition_formation
+  product_definition_formation <- product_definition
+  product_definition <- assembly_component_usage
+  assembly_component_usage.quantity -> measure_with_unit
+};
+END_ATTRIBUTE_MAPPING;
+
+END_ENTITY_MAPPING;
+
+ENTITY_MAPPING GeometricRepresentation;
+EXTENSIBLE: TRUE;
+ALT_MAP: ["shape_representation", "tessellated_shape_representation"];
+SOURCE: "ISO 10303-42";
+EXPRESS_REF: ["geometric_model_schema"];
+
+REFPATH: {
+  (shape_representation <= representation
+   [representation.context_of_items->geometric_representation_context]) |
+  (tessellated_shape_representation <= representation
+   [representation.context_of_items->geometric_representation_context])
+};
+
+ATTRIBUTE_MAPPING items;
+ASSERTION_TO: "SET OF geometric_representation_item";
+REFPATH: {
+  representation.items[i] -> geometric_representation_item
+};
+END_ATTRIBUTE_MAPPING;
+
+END_ENTITY_MAPPING;
+
+
+
+

This example demonstrates a simplified product data model, including mappings +for products, assemblies, assembly components, and geometric representations. It +showcases various features of EXPRESS-Q, including:

+
+
+
    +
  • +

    Entity and attribute mappings

    +
  • +
  • +

    Reference paths with complex relationships

    +
  • +
  • +

    Alternative mappings

    +
  • +
  • +

    Constraints within reference paths

    +
  • +
  • +

    Use of SELECT types (implied by the EXTENSIBLE: TRUE; in GeometricRepresentation)

    +
  • +
+
+
+

This example is not exhaustive but provides a realistic scenario that +illustrates how EXPRESS-Q can be used to define mappings between ARM and MIM +schemas in a STEP application protocol context.

+
+
+
+
+

Bibliography

+
+
+
    +
  • +

    [ISO 10303-21:2016]

    +
  • +
+
+
+
+
+ + + \ No newline at end of file diff --git a/sources/sections/04-spec.adoc b/sources/sections/04-spec.adoc index 5d60ab0..5cfde13 100644 --- a/sources/sections/04-spec.adoc +++ b/sources/sections/04-spec.adoc @@ -328,14 +328,14 @@ REFPATH: { When validating reference paths, the following rules should be applied: -1. All referenced entities and attributes must exist in the corresponding ARM or MIM schema. -2. The relationships between entities (supertype, subtype, attribute reference) must be consistent with the schema definitions. -3. Constraints must be syntactically correct and use only attributes or functions that are valid for the constrained entity. -4. Select type extensions must be consistent with the schema definitions. -5. Aggregate references (using `[i]` or `[n]`) must be applied only to attributes defined as aggregates in the schema. -6. Alternative mappings (using parentheses) must all be valid according to the schema. -7. Negative constraints must be logically consistent with the rest of the mapping and the schema definitions. -8. The overall structure of the reference path must form a valid path through the schema, connecting the source ARM entity to the target MIM entity or attribute. +1. All referenced entities and attributes shall exist in the corresponding ARM or MIM schema. +2. The relationships between entities (supertype, subtype, attribute reference) shall be consistent with the schema definitions. +3. Constraints shall be syntactically correct and use only attributes or functions that are valid for the constrained entity. +4. Select type extensions shall be consistent with the schema definitions. +5. Aggregate references (using `[i]` or `[n]`) shall be applied only to attributes defined as aggregates in the schema. +6. Alternative mappings (using parentheses) shall all be valid according to the schema. +7. Negative constraints shall be logically consistent with the rest of the mapping and the schema definitions. +8. The overall structure of the reference path shall form a valid path through the schema, connecting the source ARM entity to the target MIM entity or attribute. ==== Alternative mapping declaration diff --git a/sources/sections/05-validation.adoc b/sources/sections/05-validation.adoc index eabe651..f5130cb 100644 --- a/sources/sections/05-validation.adoc +++ b/sources/sections/05-validation.adoc @@ -6,31 +6,31 @@ Validation of EXPRESS-Q files is crucial to ensure the correctness and consisten === Entity mapping validation -1. Each ENTITY_MAPPING must correspond to an entity defined in the ARM schema. -2. The AIM_ELEMENT specified must exist in the MIM schema. -3. The SOURCE referenced must be a valid ISO standard or other recognized source. -4. All EXPRESS_REF entries must refer to valid EXPRESS schemas. -5. The REFPATH must form a valid path from the ARM entity to the specified AIM_ELEMENT. -6. If ALT_MAP is specified, all alternative mappings must be valid MIM entities. +1. Each ENTITY_MAPPING shall correspond to an entity defined in the ARM schema. +2. The AIM_ELEMENT specified shall exist in the MIM schema. +3. The SOURCE referenced shall be a valid ISO standard or other recognized source. +4. All EXPRESS_REF entries shall refer to valid EXPRESS schemas. +5. The REFPATH shall form a valid path from the ARM entity to the specified AIM_ELEMENT. +6. If ALT_MAP is specified, all alternative mappings shall be valid MIM entities. === Attribute mapping validation -1. Each ATTRIBUTE_MAPPING must correspond to an attribute of the ARM entity being mapped. -2. The ASSERTION_TO value must be a valid type or entity in the MIM schema. -3. If specified, the AIM_ELEMENT must exist in the MIM schema. -4. The REFPATH for an attribute must form a valid path from the ARM attribute to the specified MIM element. +1. Each ATTRIBUTE_MAPPING shall correspond to an attribute of the ARM entity being mapped. +2. The ASSERTION_TO value shall be a valid type or entity in the MIM schema. +3. If specified, the AIM_ELEMENT shall exist in the MIM schema. +4. The REFPATH for an attribute shall form a valid path from the ARM attribute to the specified MIM element. === Reference path validation -1. All entities and attributes referenced in the REFPATH must exist in either the ARM or MIM schema, as appropriate. -2. Relationships between entities (e.g., subtype, supertype) must be consistent with the schema definitions. -3. Constraints specified in the REFPATH must use valid attributes or functions for the entities they constrain. -4. SELECT type extensions must be consistent with the schema definitions. -5. Aggregate references (using `[i]` or `[n]`) must only be applied to attributes defined as aggregates in the schema. +1. All entities and attributes referenced in the REFPATH shall exist in either the ARM or MIM schema, as appropriate. +2. Relationships between entities (e.g., subtype, supertype) shall be consistent with the schema definitions. +3. Constraints specified in the REFPATH shall use valid attributes or functions for the entities they constrain. +4. SELECT type extensions shall be consistent with the schema definitions. +5. Aggregate references (using `[i]` or `[n]`) shall only be applied to attributes defined as aggregates in the schema. === Overall consistency -1. The complete set of mappings must cover all entities and attributes in the ARM schema. +1. The complete set of mappings shall cover all entities and attributes in the ARM schema. 2. There should be no conflicting mappings (e.g., two different mappings for the same ARM entity or attribute). 3. The overall set of mappings should form a consistent and complete transformation from the ARM to the MIM schema. From 1580e2a6e2988ddbc505c81d23a2fd8eb5234016 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 13 Sep 2025 01:27:16 +0000 Subject: [PATCH 2/2] Remove build artifacts and update .gitignore Co-authored-by: TRThurman <1623380+TRThurman@users.noreply.github.com> --- .gitignore | 5 + metanorma.asciidoc.log.txt | 36 - sources/document.asciidoc.log.txt | 1007 ---------------- sources/document.err.html | 262 ---- sources/document.html | 1860 ----------------------------- 5 files changed, 5 insertions(+), 3165 deletions(-) delete mode 100644 metanorma.asciidoc.log.txt delete mode 100644 sources/document.asciidoc.log.txt delete mode 100644 sources/document.err.html delete mode 100644 sources/document.html diff --git a/.gitignore b/.gitignore index 46649a2..e2ed054 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,8 @@ reference-docs/___these_are_the_earlier_editions_original_files___.txt /_site /_files /relaton + +# Build artifacts +*.html +*.log.txt +*.err.html diff --git a/metanorma.asciidoc.log.txt b/metanorma.asciidoc.log.txt deleted file mode 100644 index 426ad0e..0000000 --- a/metanorma.asciidoc.log.txt +++ /dev/null @@ -1,36 +0,0 @@ -= X -A -:semantic-metadata-headless: true -:no-isobib: -:novalid: -:!sectids: - -== copyright-statement - - - -[[boilerplate-copyright-default]] -=== {blank} - -[[boilerplate-year]] -© span:std_publisher[ISO ]span:date[2024] - -[[boilerplate-message]] -All rights reserved. Unless otherwise specified, or required in the context of its implementation, -no part of this publication may be -reproduced or utilized otherwise in any form or by any means, electronic or -mechanical, including photocopying, or posting on the internet or an intranet, -without prior written permission. Permission can be requested from either ISO -at the address below or ISO's member body in the country of the requester. - -[[boilerplate-address]] -[align=left] -ISO copyright office + -CP 401 • Ch. de Blandonnet 8 + -CH-1214 Vernier, Geneva + -Phone: +41 22 749 01 11 + -Email: copyright@iso.org + -Website: link:++https://www.iso.org/++[www.iso.org] - -[[boilerplate-place]] -Published in Switzerland \ No newline at end of file diff --git a/sources/document.asciidoc.log.txt b/sources/document.asciidoc.log.txt deleted file mode 100644 index 7fa896e..0000000 --- a/sources/document.asciidoc.log.txt +++ /dev/null @@ -1,1007 +0,0 @@ -= EXPRESS-Q: EXPRESS Query Language Specification -:docnumber: 10303 -:partnumber: 81 -:edition: 1 -:copyright-year: 2024 -:revdate: 2024-10-10 -:language: en -:title-intro-en: EXPRESS Language Foundation -:title-main-en: EXPRESS Query Language Specification -:title-intro-fr: Fondation pour le langage EXPRESS -:title-main-fr: Spécification du langage de requête EXPRESS -:doctype: international-standard -:docstage: 00 -:docsubstage: 00 -:technical-committee-number: 184 -:technical-committee: Industrial automation systems and integration -:subcommittee-type: SC -:subcommittee-number: 4 -:subcommittee: Industrial data -:workgroup-type: WG -:workgroup-number: 12 -:workgroup: STEP product modelling and resources -:secretariat: ANSI -:imagesdir: images -:mn-document-class: iso -:mn-output-extensions: xml,html,doc,pdf,rxl -:local-cache-only: - - -.Foreword - -NOTE: This document is developed and published by the EXPRESS Language -Foundation. All rights reserved. - -The EXPRESS Language Foundation, maintainer of the EXPRESS data modeling language, -develops and maintains language standards and technologies. The work of -preparing EXPRESS standards is carried out through technical working groups. -Each member interested in a subject for which a working group has been -established has the right to participate in that group. International -organizations, both governmental and non-governmental, also take part in the -work. - -The procedures used to develop this document and those intended for its further -maintenance are described in the EXPRESS Language Foundation's documentation -guidelines. In particular, different approval criteria are needed for different -types of documents. This document was drafted in accordance with the EXPRESS -Language Foundation's editorial rules and guidelines. - -Attention is drawn to the possibility that some of the elements of this document -may be the subject of patent rights. The EXPRESS Language Foundation shall not -be held responsible for identifying any or all such patent rights. Details of -any patent rights identified during the development of the document will be in -the Introduction. - -Any trade name used in this document is information given for the convenience of -users and does not constitute an endorsement. - -For an explanation of the voluntary nature of standards and the meaning of -EXPRESS Language Foundation specific terms and expressions related to conformity -assessment, please refer to the Foundation's documentation guidelines. - -This document was prepared by the EXPRESS Language Foundation's Technical -Working Group. - -EXPRESS is organized as a series of specifications, each published separately. -The structure of EXPRESS is described in the Core Language Specification. - -Each specification is a member of one of the following series: description -methods, implementation methods, conformance testing methodology and framework, -integrated generic resources, integrated application resources, application -protocols, abstract test suites, application interpreted constructs, and -application modules. This part is a member of the description methods series. - - -[[introduction]] -== Introduction - -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. By providing a standardized -way to express these mappings and constraints, EXPRESS-Q facilitates more robust -and reliable data exchange in complex engineering and manufacturing -environments. - - -[[scope]] -== Scope - -This document specifies EXPRESS-Q, including its syntax, semantics, and usage within the context of EXPRESS schemas and STEP application protocols. - -The specification covers: - -. The grammar and syntax of EXPRESS-Q -. The semantics of EXPRESS-Q constructs -. The reference path syntax used for defining detailed mappings -. Validation rules for EXPRESS-Q files -. Guidelines for implementing EXPRESS-Q parsers and validators - -This specification is intended for use by software developers, data modelers, -and systems integrators working with EXPRESS schemas and STEP application -protocols. - - -[bibliography] -== Normative references - -* [[[ISO10303-1,ISO 10303-1:2024]]] - -* [[[ISO10303-11,ISO 10303-11:2004]]] - -* [[[ISO8824-1,ISO/IEC 8824-1:2008]]] - -* [[[ISO10646,ISO/IEC 10646:2011]]] - - -== Terms and definitions - -=== EXPRESS-Q - -query language for EXPRESS schemas, used to define mappings and constraints -between ARM and MIM schemas - - -// ARM:: Application Reference Model, a conceptual schema that defines the -// information requirements for a specific application domain - -// MIM:: Model Implementation Model, an implementation schema that realizes the -// concepts defined in the ARM using constructs from integrated resources - -// STEP:: Standard for the Exchange of Product model data, a comprehensive ISO -// standard (ISO 10303) for the computer-interpretable representation and -// exchange of product manufacturing information - -== EXPRESS-Q language specification - -=== Overview - -EXPRESS-Q is designed to work alongside EXPRESS schemas, providing a mechanism -to define mappings between ARM and MIM schemas, as well as specifying -constraints on datasets. The language uses a syntax similar to EXPRESS but -introduces new constructs specific to querying and mapping. - -An EXPRESS-Q file typically consists of one or more entity mappings, each of -which defines how an ARM entity and its attributes correspond to MIM elements. -These mappings can include various declarations such as extensibility, AIM -elements, sources, EXPRESS references, reference paths, and alternative -mappings. - -=== EBNF grammar - -The following EBNF (Extended Backus-Naur Form) grammar defines the syntax of -EXPRESS-Q: - -[source,ebnf] ----- -express_q_file = { entity_mapping } ; - -entity_mapping = "ENTITY_MAPPING" entity_name ";" newline - [ extensible_decl ] - [ aim_element_decl ] - [ source_decl ] - [ express_ref_decl ] - [ refpath_decl ] - [ alt_map_decl ] - { attribute_mapping } - "END_ENTITY_MAPPING" ";" ; - -extensible_decl = "EXTENSIBLE" ":" boolean ";" newline ; - -aim_element_decl = "AIM_ELEMENT" ":" string ";" newline ; - -source_decl = "SOURCE" ":" string ";" newline ; - -express_ref_decl = "EXPRESS_REF" ":" "[" [ string { "," string } ] "]" ";" newline ; - -refpath_decl = "REFPATH" ":" "{" newline - refpath_content - "}" ";" newline ; - -refpath_content = { refpath_line } ; - -refpath_line = [ indentation ] reference_expression newline ; - -reference_expression = entity_reference [ relationship { relationship } ] ; - -relationship = path_relation | supertype_relation | subtype_relation | - select_extension | constraint ; - -entity_reference = identifier ; - -path_relation = "->" entity_reference ; - -supertype_relation = "=>" entity_reference ; - -subtype_relation = "<=" entity_reference ; - -select_extension = "*" ">" entity_reference | "<" "*" entity_reference ; - -constraint = "[" constraint_expression "]" ; - -constraint_expression = ? expression following EXPRESS syntax ? ; - -indentation = ? one or more spaces or tabs ? ; - -alt_map_decl = "ALT_MAP" ":" "[" [ string { "," string } ] "]" ";" newline ; - -attribute_mapping = "ATTRIBUTE_MAPPING" attribute_name ";" newline - "ASSERTION_TO" ":" string ";" newline - [ aim_element_decl ] - [ source_decl ] - [ express_ref_decl ] - [ refpath_decl ] - "END_ATTRIBUTE_MAPPING" ";" newline ; - -entity_name = identifier ; - -attribute_name = identifier ; - -identifier = letter { letter | digit | "_" } ; - -boolean = "TRUE" | "FALSE" ; - -string = '"' { character } '"' ; - -letter = "A" | ... | "Z" | "a" | ... | "z" ; - -digit = "0" | ... | "9" ; - -character = ? any printable character ? ; - -indentation = ? one or more spaces or tabs ? ; - -newline = ? line break character(s) ? ; ----- - -This grammar defines the overall structure of an EXPRESS-Q file, including -entity mappings, attribute mappings, reference paths, including various types -of relationships between entities and constraints, and various declarations. - - -=== Semantics - -This section describes the meaning and usage of each major construct in EXPRESS-Q. - -==== Entity mapping - -[source,ebnf] ----- -entity_mapping = "ENTITY_MAPPING" entity_name ";" newline - [ extensible_decl ] - [ aim_element_decl ] - [ source_decl ] - [ express_ref_decl ] - [ refpath_decl ] - [ alt_map_decl ] - { attribute_mapping } - "END_ENTITY_MAPPING" ";" ; ----- - -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). - -Usage:: -* Begin with "ENTITY_MAPPING" followed by the ARM entity name. -* Include optional declarations for extensibility, AIM element, source, EXPRESS references, reference path, and alternative mappings. -* Include attribute mappings for the entity's attributes. -* End with "END_ENTITY_MAPPING". - -[example] ----- -ENTITY_MAPPING Product; -EXTENSIBLE: FALSE; -AIM_ELEMENT: "product"; -SOURCE: "ISO 10303-41"; -EXPRESS_REF: ["product_definition_schema"]; -REFPATH: { - product <= product_definition_formation - product_definition_formation.of_product -> product -}; -ATTRIBUTE_MAPPING id; -ASSERTION_TO: "id"; -AIM_ELEMENT: "product.id"; -END_ATTRIBUTE_MAPPING; -END_ENTITY_MAPPING; ----- - -==== Extensible declaration - -[source,ebnf] ----- -extensible_decl = "EXTENSIBLE" ":" boolean ";" newline ; ----- - -The extensible declaration specifies whether the entity mapping is extensible, corresponding to the extensibility of SELECT types in EXPRESS schemas. - -Usage:: -* Use "EXTENSIBLE: TRUE;" for extensible mappings. -* Use "EXTENSIBLE: FALSE;" for non-extensible mappings. - -[example] ----- -ENTITY_MAPPING ProductCategory; -EXTENSIBLE: TRUE; -... -END_ENTITY_MAPPING; ----- - -==== AIM element declaration - -[source,ebnf] ----- -aim_element_decl = "AIM_ELEMENT" ":" string ";" newline ; ----- - -The AIM element declaration specifies the corresponding AIM (MIM) element for the ARM entity, providing a direct link between the ARM and MIM schemas. - -Usage:: -* Specify the AIM element name as a string. - -[example] ----- -ENTITY_MAPPING Product; -AIM_ELEMENT: "product"; -... -END_ENTITY_MAPPING; ----- - -==== Source declaration - -[source,ebnf] ----- -source_decl = "SOURCE" ":" string ";" newline ; ----- - -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. - -Usage:: -* Specify the source as a string, typically an ISO standard number. - -[example] ----- -ENTITY_MAPPING Product; -SOURCE: "ISO 10303-41"; -... -END_ENTITY_MAPPING; ----- - -==== EXPRESS reference declaration - -[source,ebnf] ----- -express_ref_decl = "EXPRESS_REF" ":" "[" [ string { "," string } ] "]" ";" newline ; ----- - -The EXPRESS reference declaration lists EXPRESS references related to the mapping, used to link the mapping to specific parts of the EXPRESS schemas or other relevant documentation. - -Usage:: -* Provide a comma-separated list of references enclosed in square brackets. -* Use an empty list "[]" if there are no references. - -[example] ----- -ENTITY_MAPPING Product; -EXPRESS_REF: ["product_definition_schema", "management_resources_schema"]; -... -END_ENTITY_MAPPING; ----- - - -==== Reference path declaration - -===== General - -The reference path syntax in EXPRESS-Q is based on the ISO 10303 Mapping -Specification and is used within the REFPATH sections to define precise mappings -between ARM and MIM elements. This syntax allows for complex relationships and -constraints to be expressed concisely. - -[source,ebnf] ----- -refpath_decl = "REFPATH" ":" "{" newline - refpath_content - "}" ";" newline ; ----- - -The reference path declaration defines the detailed mapping between ARM and MIM elements using the reference path syntax described earlier. - -Usage:: -* Begin with `REFPATH: {` and end with `};`. -* Each line in the content describes a step in the mapping path. -* Use indentation to indicate nested structures. -* Use symbols like `<=`, `=>`, `->` to indicate relationships between entities and attributes. - -[example] ----- -ENTITY_MAPPING Product; -REFPATH: { - product <= product_definition_formation - product_definition_formation.of_product -> product - {product.name -> product.name - product.description -> product.description} -}; -... -END_ENTITY_MAPPING; ----- - - - -===== Symbols and meaning - -The reference path syntax uses several symbols to express relationships and constraints. These symbols are derived from the ISO 10303 Mapping Specification: - -`[]`:: -Enclosed section constrains multiple MIM elements or sections of the reference -path required to satisfy an information requirement. - -`()`:: -Enclosed section constrains multiple MIM elements or sections of the reference -path identified as alternatives within the mapping. - -`{}`:: -Enclosed section constrains the reference path to satisfy an information -requirement. - -`<>`:: -Enclosed section constrains one or more required reference paths. - -`||`:: -Enclosed section constrains the supertype entity. - -`->`:: -The attribute whose name precedes the symbol references the entity or select type whose name follows the symbol. - -`<-`:: -The entity or select type whose name precedes the symbol is referenced by the entity attribute whose name follows the symbol. - -`[i]`:: -The attribute whose name precedes the symbol is an aggregate; any element of that aggregate is referred to. - -`[n]`:: -The attribute whose name precedes the symbol is an ordered aggregate; member n of that aggregate is referred to. - -`=>`:: -The entity whose name precedes the symbol is a supertype of the entity whose name follows the symbol. - -`<=`:: -The entity whose name precedes the symbol is a subtype of the entity whose name follows the symbol. - -`=`:: -The string, select, or enumeration type is constrained to a choice or value. - -`\`:: -The reference path expression continues on the next line. - -`*`:: -One or more instances of the relationship entity data type may be assembled in a relationship tree structure. - -`--`:: -The text following is a comment or introduces a clause reference. - -`*>`:: -The select or enumeration type whose name precedes the symbol is extended into the select or enumeration type whose name follows the symbol. - -`<*`:: -The select or enumeration type whose name precedes the symbol is an extension of the select or enumeration type whose name follows the symbol. - -`!{}`:: -Section enclosed by `{}` indicates a negative constraint placed on the mapping. - - -===== Usage and examples - -The reference path syntax is used to define precise mappings between ARM and MIM -elements. Here are some examples demonstrating various aspects of the syntax: - -[example] -.Simple attribute mapping -==== -[source] ----- -REFPATH: { - product.id -> id -} ----- -==== - -[example] -.Subtype relationship -==== -[source] ----- -REFPATH: { - mechanical_context <= product_context -} ----- -==== - -[example] -.Complex mapping with alternatives and constraints -==== -[source] ----- -REFPATH: { - shape_representation <= representation - {representation.items[i] -> representation_item - representation_item => - (geometric_representation_item - [geometric_representation_item.dim = 3] | - mapped_item) - } -} ----- -==== - -[example] -.Select type extension -==== -[source] ----- -REFPATH: { - person_and_organization_select *> organization -} ----- -==== - -[example] -.Negative constraint -==== -[source] ----- -REFPATH: { - product_definition_formation - !{product_definition_formation.make_or_buy = bought_item} -} ----- -==== - -===== Validation rules for reference paths - -When validating reference paths, the following rules should be applied: - -1. All referenced entities and attributes shall exist in the corresponding ARM or MIM schema. -2. The relationships between entities (supertype, subtype, attribute reference) shall be consistent with the schema definitions. -3. Constraints shall be syntactically correct and use only attributes or functions that are valid for the constrained entity. -4. Select type extensions shall be consistent with the schema definitions. -5. Aggregate references (using `[i]` or `[n]`) shall be applied only to attributes defined as aggregates in the schema. -6. Alternative mappings (using parentheses) shall all be valid according to the schema. -7. Negative constraints shall be logically consistent with the rest of the mapping and the schema definitions. -8. The overall structure of the reference path shall form a valid path through the schema, connecting the source ARM entity to the target MIM entity or attribute. - - -==== Alternative mapping declaration - -[source,ebnf] ----- -alt_map_decl = "ALT_MAP" ":" "[" [ string { "," string } ] "]" ";" newline ; ----- - -The alternative mapping declaration specifies alternative mappings, allowing for flexibility in cases where multiple valid mappings exist. - -Usage:: -* Provide a comma-separated list of alternative mappings enclosed in square brackets. -* Use an empty list "[]" if there are no alternative mappings. - -[example] ----- -ENTITY_MAPPING GeometricRepresentation; -ALT_MAP: ["shape_representation", "tessellated_shape_representation"]; -... -END_ENTITY_MAPPING; ----- - -==== Attribute mapping - -[source,ebnf] ----- -attribute_mapping = "ATTRIBUTE_MAPPING" attribute_name ";" newline - "ASSERTION_TO" ":" string ";" newline - [ aim_element_decl ] - [ source_decl ] - [ express_ref_decl ] - [ refpath_decl ] - "END_ATTRIBUTE_MAPPING" ";" newline ; ----- - -An attribute mapping defines how an individual attribute of an ARM entity corresponds to elements in the MIM schema. - -Usage:: -* Begin with "ATTRIBUTE_MAPPING" followed by the attribute name. -* Specify the ASSERTION_TO value, which indicates the corresponding MIM element or type. -* Optionally include AIM_ELEMENT, SOURCE, EXPRESS_REF, and REFPATH declarations. -* End with "END_ATTRIBUTE_MAPPING". - -[example] ----- -ENTITY_MAPPING Product; -ATTRIBUTE_MAPPING id; -ASSERTION_TO: "id"; -AIM_ELEMENT: "product.id"; -REFPATH: { - product.id -> id -}; -END_ATTRIBUTE_MAPPING; - -ATTRIBUTE_MAPPING name; -ASSERTION_TO: "label"; -AIM_ELEMENT: "product.name"; -SOURCE: "ISO 10303-41"; -EXPRESS_REF: ["product_definition_schema"]; -REFPATH: { - product.name -> name -}; -END_ATTRIBUTE_MAPPING; -END_ENTITY_MAPPING; ----- - -== Validation rules - -=== General - -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. - -=== Entity mapping validation - -1. Each ENTITY_MAPPING shall correspond to an entity defined in the ARM schema. -2. The AIM_ELEMENT specified shall exist in the MIM schema. -3. The SOURCE referenced shall be a valid ISO standard or other recognized source. -4. All EXPRESS_REF entries shall refer to valid EXPRESS schemas. -5. The REFPATH shall form a valid path from the ARM entity to the specified AIM_ELEMENT. -6. If ALT_MAP is specified, all alternative mappings shall be valid MIM entities. - -=== Attribute mapping validation - -1. Each ATTRIBUTE_MAPPING shall correspond to an attribute of the ARM entity being mapped. -2. The ASSERTION_TO value shall be a valid type or entity in the MIM schema. -3. If specified, the AIM_ELEMENT shall exist in the MIM schema. -4. The REFPATH for an attribute shall form a valid path from the ARM attribute to the specified MIM element. - -=== Reference path validation - -1. All entities and attributes referenced in the REFPATH shall exist in either the ARM or MIM schema, as appropriate. -2. Relationships between entities (e.g., subtype, supertype) shall be consistent with the schema definitions. -3. Constraints specified in the REFPATH shall use valid attributes or functions for the entities they constrain. -4. SELECT type extensions shall be consistent with the schema definitions. -5. Aggregate references (using `[i]` or `[n]`) shall only be applied to attributes defined as aggregates in the schema. - -=== Overall consistency - -1. The complete set of mappings shall cover all entities and attributes in the ARM schema. -2. There should be no conflicting mappings (e.g., two different mappings for the same ARM entity or attribute). -3. The overall set of mappings should form a consistent and complete transformation from the ARM to the MIM schema. - - -== Implementation guidelines - -=== General - -When implementing an EXPRESS-Q parser and validator, consider the following guidelines. - -=== Parsing - -1. Implement a lexical analyzer to tokenize the EXPRESS-Q input. -2. Develop a parser based on the EBNF grammar provided in this specification. -3. Create an abstract syntax tree (AST) or similar internal representation of the parsed EXPRESS-Q file. - -=== Schema loading - -1. Implement an EXPRESS schema parser or use an existing library to load and interpret ARM and MIM schemas. -2. Create internal representations of the schemas that allow for efficient querying of entities, attributes, and relationships. - -=== Validation - -1. Implement validation checks based on the rules outlined in the "Validation rules" section. -2. Perform two-pass validation: - a. First pass: Check syntax and basic semantic rules (e.g., entity and attribute existence). - b. Second pass: Validate complex semantic rules (e.g., consistency of reference paths). -3. Provide clear and informative error messages for validation failures. - -=== Reference path interpretation - -1. Implement a separate parser for the reference path syntax. -2. Develop algorithms to traverse reference paths within the context of the loaded schemas. -3. Implement functions to evaluate constraints specified in reference paths. - -=== Performance considerations - -1. Use efficient data structures (e.g., hash tables) for quick lookups of schema elements. -2. Implement caching mechanisms for frequently accessed schema information. -3. Consider parallel processing for validating multiple entity or attribute mappings simultaneously. - -=== Extensibility - -1. Design the implementation to be extensible, allowing for future enhancements to the EXPRESS-Q language. -2. Use modular design to separate concerns (e.g., parsing, schema handling, validation). - -=== Integration - -1. Provide APIs or interfaces for integrating the EXPRESS-Q parser and validator into larger systems or workflows. -2. Consider implementing export functionality to generate reports or machine-readable representations of the validation results. - - -== Use cases and examples - -=== General - -This section provides examples of how EXPRESS-Q can be used in various scenarios -related to STEP application protocols. - -=== Use case 1: Mapping a complex product structure - -In this example, we'll demonstrate how EXPRESS-Q can be used to map a complex product structure from an ARM schema to a MIM schema. - -[example] ----- -ENTITY_MAPPING Product; -AIM_ELEMENT: "product"; -SOURCE: "ISO 10303-41"; -REFPATH: { - product <= product_definition_formation - product_definition_formation.of_product -> product -}; - -ATTRIBUTE_MAPPING id; -ASSERTION_TO: "id"; -AIM_ELEMENT: "product.id"; -END_ATTRIBUTE_MAPPING; - -ATTRIBUTE_MAPPING name; -ASSERTION_TO: "label"; -AIM_ELEMENT: "product.name"; -END_ATTRIBUTE_MAPPING; - -ATTRIBUTE_MAPPING description; -ASSERTION_TO: "text"; -AIM_ELEMENT: "product.description"; -END_ATTRIBUTE_MAPPING; - -ATTRIBUTE_MAPPING components; -ASSERTION_TO: "SET OF Component"; -REFPATH: { - product <- product_definition_formation - product_definition_formation <- product_definition - product_definition <- product_definition_relationship.relating_product_definition - product_definition_relationship -> - product_definition_relationship.related_product_definition - product_definition_relationship.related_product_definition -> product_definition - product_definition -> product_definition_formation - product_definition_formation -> product -}; -END_ATTRIBUTE_MAPPING; - -END_ENTITY_MAPPING; - -ENTITY_MAPPING Component; -AIM_ELEMENT: "product"; -SOURCE: "ISO 10303-41"; -REFPATH: { - product <= product_definition_formation - product_definition_formation.of_product -> product -}; - -ATTRIBUTE_MAPPING id; -ASSERTION_TO: "id"; -AIM_ELEMENT: "product.id"; -END_ATTRIBUTE_MAPPING; - -ATTRIBUTE_MAPPING name; -ASSERTION_TO: "label"; -AIM_ELEMENT: "product.name"; -END_ATTRIBUTE_MAPPING; - -ATTRIBUTE_MAPPING quantity; -ASSERTION_TO: "measure_with_unit"; -REFPATH: { - product <- product_definition_formation - product_definition_formation <- product_definition - product_definition <- product_definition_relationship - product_definition_relationship.related_product_definition_quantity -> measure_with_unit -}; -END_ATTRIBUTE_MAPPING; - -END_ENTITY_MAPPING; ----- - -This example demonstrates how a product with multiple components can be mapped from an ARM schema to a MIM schema using EXPRESS-Q. It shows the use of complex reference paths to navigate relationships between entities in the MIM schema. - -=== Use case 2: Mapping with alternative representations - -This example shows how EXPRESS-Q can handle cases where an ARM entity might be mapped to different MIM representations based on certain conditions. - -[example] ----- -ENTITY_MAPPING GeometricRepresentation; -ALT_MAP: ["shape_representation", "tessellated_shape_representation"]; -SOURCE: "ISO 10303-42"; - -REFPATH: { - (shape_representation <= representation - [representation.context_of_items->geometric_representation_context]) | - (tessellated_shape_representation <= representation - [representation.context_of_items->geometric_representation_context]) -}; - -ATTRIBUTE_MAPPING items; -ASSERTION_TO: "SET OF geometric_representation_item"; -REFPATH: { - representation.items[i] -> geometric_representation_item -}; -END_ATTRIBUTE_MAPPING; - -END_ENTITY_MAPPING; ----- - -This example demonstrates how EXPRESS-Q can handle alternative mappings for a single ARM entity. The GeometricRepresentation entity can be mapped to either a shape_representation or a tessellated_shape_representation in the MIM schema, depending on the specific requirements of the application. - -== Summary - -EXPRESS-Q provides a powerful and flexible language for defining mappings between ARM and MIM schemas in the context of STEP application protocols. By offering a standardized way to express these mappings, EXPRESS-Q facilitates more robust and reliable data exchange in complex engineering and manufacturing environments. - -Key features of EXPRESS-Q include: - -1. A syntax that is familiar to users of EXPRESS, reducing the learning curve. -2. The ability to define detailed mappings between ARM and MIM entities and attributes. -3. Support for complex reference paths, allowing for navigation through intricate schema relationships. -4. Mechanisms for specifying constraints and alternative mappings. -5. Clear separation of entity and attribute mappings for improved readability and maintainability. - -The validation rules and implementation guidelines provided in this specification aim to ensure consistent interpretation and implementation of EXPRESS-Q across different tools and systems. - -== Future considerations - -As the use of EXPRESS-Q grows and evolves, several areas may be considered for future enhancements: - -=== Extended constraint language - -Future versions of EXPRESS-Q might benefit from a more expressive constraint language, allowing for more complex conditions and transformations to be specified within mappings. - -=== Integration with other standards - -Consideration should be given to how EXPRESS-Q can be integrated with other relevant standards and technologies, such as ontology languages or model transformation frameworks. - -=== Tool support - -Development of standardized libraries and tools for parsing, validating, and processing EXPRESS-Q files would greatly facilitate its adoption and use. - -=== Reverse mapping capabilities - -Future versions might include capabilities for defining bi-directional mappings, allowing for the generation of ARM instances from MIM data. - -=== Performance optimizations - -As EXPRESS-Q is used with increasingly large and complex schemas, performance optimizations in both the language design and implementation guidelines may become necessary. - - -[appendix,obligation=informative] -== Complete EXPRESS-Q file example - -This annex provides a complete example of an EXPRESS-Q file, demonstrating -various features of the language in a cohesive context. - -[source] ----- --- Example EXPRESS-Q file for a simplified product data model - -ENTITY_MAPPING Product; -EXTENSIBLE: FALSE; -AIM_ELEMENT: "product"; -SOURCE: "ISO 10303-41"; -EXPRESS_REF: ["product_definition_schema"]; -REFPATH: { - product <= product_definition_formation - product_definition_formation.of_product -> product -}; - -ATTRIBUTE_MAPPING id; -ASSERTION_TO: "identifier"; -AIM_ELEMENT: "product.id"; -REFPATH: { - product.id -> id -}; -END_ATTRIBUTE_MAPPING; - -ATTRIBUTE_MAPPING name; -ASSERTION_TO: "label"; -AIM_ELEMENT: "product.name"; -REFPATH: { - product.name -> name -}; -END_ATTRIBUTE_MAPPING; - -ATTRIBUTE_MAPPING description; -ASSERTION_TO: "text"; -AIM_ELEMENT: "product.description"; -REFPATH: { - product.description -> description -}; -END_ATTRIBUTE_MAPPING; - -ATTRIBUTE_MAPPING category; -ASSERTION_TO: "product_category"; -REFPATH: { - product <- product_category_assignment.products[i] - product_category_assignment -> product_category_assignment.assigned_category - product_category_assignment.assigned_category -> product_category -}; -END_ATTRIBUTE_MAPPING; - -END_ENTITY_MAPPING; - -ENTITY_MAPPING Assembly; -EXTENSIBLE: FALSE; -AIM_ELEMENT: "product"; -SOURCE: "ISO 10303-44"; -EXPRESS_REF: ["product_structure_schema"]; -REFPATH: { - product <= product_definition_formation - product_definition_formation.of_product -> product - [product <- product_definition_formation - product_definition_formation <- product_definition - product_definition <- assembly_component_usage.relating_product_definition] -}; - -ATTRIBUTE_MAPPING components; -ASSERTION_TO: "SET OF AssemblyComponent"; -REFPATH: { - product <- product_definition_formation - product_definition_formation <- product_definition - product_definition <- assembly_component_usage.relating_product_definition - assembly_component_usage -> assembly_component_usage.related_product_definition - assembly_component_usage.related_product_definition -> product_definition - product_definition -> product_definition_formation - product_definition_formation -> product -}; -END_ATTRIBUTE_MAPPING; - -END_ENTITY_MAPPING; - -ENTITY_MAPPING AssemblyComponent; -EXTENSIBLE: FALSE; -AIM_ELEMENT: "product"; -SOURCE: "ISO 10303-44"; -EXPRESS_REF: ["product_structure_schema"]; -REFPATH: { - product <= product_definition_formation - product_definition_formation.of_product -> product -}; - -ATTRIBUTE_MAPPING quantity; -ASSERTION_TO: "measure_with_unit"; -REFPATH: { - product <- product_definition_formation - product_definition_formation <- product_definition - product_definition <- assembly_component_usage - assembly_component_usage.quantity -> measure_with_unit -}; -END_ATTRIBUTE_MAPPING; - -END_ENTITY_MAPPING; - -ENTITY_MAPPING GeometricRepresentation; -EXTENSIBLE: TRUE; -ALT_MAP: ["shape_representation", "tessellated_shape_representation"]; -SOURCE: "ISO 10303-42"; -EXPRESS_REF: ["geometric_model_schema"]; - -REFPATH: { - (shape_representation <= representation - [representation.context_of_items->geometric_representation_context]) | - (tessellated_shape_representation <= representation - [representation.context_of_items->geometric_representation_context]) -}; - -ATTRIBUTE_MAPPING items; -ASSERTION_TO: "SET OF geometric_representation_item"; -REFPATH: { - representation.items[i] -> geometric_representation_item -}; -END_ATTRIBUTE_MAPPING; - -END_ENTITY_MAPPING; ----- - -This example demonstrates a simplified product data model, including mappings -for products, assemblies, assembly components, and geometric representations. It -showcases various features of EXPRESS-Q, including: - -- Entity and attribute mappings -- Reference paths with complex relationships -- Alternative mappings -- Constraints within reference paths -- Use of SELECT types (implied by the EXTENSIBLE: TRUE; in GeometricRepresentation) - -This example is not exhaustive but provides a realistic scenario that -illustrates how EXPRESS-Q can be used to define mappings between ARM and MIM -schemas in a STEP application protocol context. - - -[bibliography] -== Bibliography - -* [[[ISO10303-21,ISO 10303-21:2016]]] \ No newline at end of file diff --git a/sources/document.err.html b/sources/document.err.html deleted file mode 100644 index 1033f9f..0000000 --- a/sources/document.err.html +++ /dev/null @@ -1,262 +0,0 @@ -sources/document.err.html errors - - -

sources/document.err.html errors

- -

Style

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LineIDMessageContextSeverity
000058_bcb6f41d-8baa-7f9c-5118-5131b7cd6377Foreword may contain permission: Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights
<foreword id="_bcb6f41d-8baa-7f9c-5118-5131b7cd6377" obligation="informative">
-<title id="_41c9fad3-d4c1-eecc-4fad-f91704acc026">Foreword</title>
-<note id="_4c9dbebf-660c-1fe0-0f5b-ecad18ab11ac"> <p id="_8a662cf2-2101-56ae-5b0d-883b85f1c32b">This document is developed and published by the EXPRESS Language Foundation. All rights reserved.</p>
-</note>
-
2
000058_bcb6f41d-8baa-7f9c-5118-5131b7cd6377Foreword may contain requirement: The EXPRESS Language Foundation shall not be held responsible for identifying any or all such patent rights
<foreword id="_bcb6f41d-8baa-7f9c-5118-5131b7cd6377" obligation="informative">
-<title id="_41c9fad3-d4c1-eecc-4fad-f91704acc026">Foreword</title>
-<note id="_4c9dbebf-660c-1fe0-0f5b-ecad18ab11ac"> <p id="_8a662cf2-2101-56ae-5b0d-883b85f1c32b">This document is developed and published by the EXPRESS Language Foundation. All rights reserved.</p>
-</note>
-
2
000078introductionIntroduction may contain requirement: 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
<introduction id="_25035b03-3ac3-3b39-337c-a9bfe1ff729d" anchor="introduction" obligation="informative">
-<title id="_2b2e98d1-114a-3da4-8556-01ae0a724280">Introduction</title>
-<p id="_6720da92-414b-98bb-fb22-c20d022dec08">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.</p>
-
-<p id="_68b45e84-91b0-8054-9b1c-3ae9ba1f65d3">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. By providing a standardized way to express these mappings and constraints, EXPRESS-Q facilitates more robust and reliable data exchange in complex engineering and manufacturing environments.</p>
2
000091_627a7dae-567a-2d2f-4a8e-846d87ff6532List entry of separate sentences must end with full stop: The grammar and syntax of EXPRESS-Q
<li> <p id="_fde1e7c5-e806-0383-2cbb-5cd460318f98">The grammar and syntax of EXPRESS-Q</p>
-</li>
2
000093_627a7dae-567a-2d2f-4a8e-846d87ff6532List entry of separate sentences must end with full stop: The semantics of EXPRESS-Q constructs
<li> <p id="_bf5f748d-95b8-3caa-f8a9-24ac93b4e2b8">The semantics of EXPRESS-Q constructs</p>
-</li>
2
000095_627a7dae-567a-2d2f-4a8e-846d87ff6532List entry of separate sentences must end with full stop: The reference path syntax used for defining detailed mappings
<li> <p id="_ac710207-fa28-5240-d798-d940a4942e0d">The reference path syntax used for defining detailed mappings</p>
-</li>
2
000097_627a7dae-567a-2d2f-4a8e-846d87ff6532List entry of separate sentences must end with full stop: Validation rules for EXPRESS-Q files
<li> <p id="_d59492d9-34df-aa0c-0bfb-26462f188018">Validation rules for EXPRESS-Q files</p>
-</li>
2
000099_627a7dae-567a-2d2f-4a8e-846d87ff6532List entry of separate sentences must end with full stop: Guidelines for implementing EXPRESS-Q parsers and validators
<li> <p id="_2c39638f-8ced-1a12-41c3-c8134a1d9189">Guidelines for implementing EXPRESS-Q parsers and validators</p>
-</li>
2
000222_15f098db-c1b8-02c4-b49b-2a0592805390Hanging paragraph in clause
<clause id="_15f098db-c1b8-02c4-b49b-2a0592805390" inline-header="false" obligation="normative">
-<title id="_55f6da5f-0b02-2b51-a3c7-a0f6056a6b3a">Semantics</title>
-<p id="_8eb1049a-6605-dd70-89db-964dd855b9a4">This section describes the meaning and usage of each major construct in EXPRESS-Q.</p>
-
-<clause id="_df830fe4-59b9-7c6a-574e-117785041d4b" inline-header="false" obligation="normative">
2
000242_44c9275d-9b40-325c-3b2e-0f772c82eb84All lists must be preceded by colon or full stop: Usage
<ul id="_44c9275d-9b40-325c-3b2e-0f772c82eb84"> <li> <p id="_fe64dbd4-296d-f281-eceb-683432efc908">Begin with “ENTITY_MAPPING” followed by the ARM entity name.</p>
-</li>
-<li> <p id="_1150e65e-1906-ae64-1b77-ff57106e4326">Include optional declarations for extensibility, AIM element, source, EXPRESS references, reference path, and alternative mappings.</p>
-</li>
-<li> <p id="_0b0cda59-9b7f-e7e4-611b-7c6c77c58856">Include attribute mappings for the entity’s attributes.</p>
2
000279_bf1da4b4-f69e-0a98-3389-7909d2734325All lists must be preceded by colon or full stop: Usage
<ul id="_bf1da4b4-f69e-0a98-3389-7909d2734325"> <li> <p id="_f3dcf0dd-f5b7-048e-0499-326d7f4245d0">Use “EXTENSIBLE: TRUE;” for extensible mappings.</p>
-</li>
-<li> <p id="_c7bd0416-bcae-713f-31bd-8beb31661f91">Use “EXTENSIBLE: FALSE;” for non-extensible mappings.</p>
-</li>
-</ul>
2
000302_a9bd525c-0a7c-c58f-06f9-bf70ad954e45All lists must be preceded by colon or full stop: Usage
<ul id="_a9bd525c-0a7c-c58f-06f9-bf70ad954e45"> <li> <p id="_b0c4775a-46e1-ba03-7c93-3259ac93c578">Specify the AIM element name as a string.</p>
-</li>
-</ul>
2
000323_f9e66dd9-7757-fa96-a874-fd7c3e04a743All lists must be preceded by colon or full stop: Usage
<ul id="_f9e66dd9-7757-fa96-a874-fd7c3e04a743"> <li> <p id="_21e2f2c5-7c6f-873d-ddeb-1428b2763054">Specify the source as a string, typically an ISO standard number.</p>
-</li>
-</ul>
2
000344_3e6c82b2-72f9-b617-eaf4-cdb4ebd1a4efAll lists must be preceded by colon or full stop: Usage
<ul id="_3e6c82b2-72f9-b617-eaf4-cdb4ebd1a4ef"> <li> <p id="_0f08cec6-45c3-9821-d4d4-cd115b9f6fc0">Provide a comma-separated list of references enclosed in square brackets.</p>
-</li>
-<li> <p id="_a7e41245-434f-e782-376b-8cec0ab87982">Use an empty list “[]” if there are no references.</p>
-</li>
-</ul>
2
000373_7bd56e6a-b891-c0f9-901d-20538647bab8All lists must be preceded by colon or full stop: Usage
<ul id="_7bd56e6a-b891-c0f9-901d-20538647bab8"> <li> <p id="_e6d054c6-61cf-a2aa-88d4-7bed3b2a41d3">Begin with <tt>REFPATH: {</tt> and end with <tt>};</tt>.</p>
-</li>
-<li> <p id="_f7a6aea3-af79-7b55-dc99-909a3dc7a844">Each line in the content describes a step in the mapping path.</p>
-</li>
-<li> <p id="_9b65d58b-5127-dddd-52d5-2aeeb47173bb">Use indentation to indicate nested structures.</p>
2
000542_bd361943-6f1a-f934-5f09-838e9e74e77cAll lists must be preceded by colon or full stop: Usage
<ul id="_bd361943-6f1a-f934-5f09-838e9e74e77c"> <li> <p id="_c97782a8-1d1e-937a-92a3-6fda43033ff0">Provide a comma-separated list of alternative mappings enclosed in square brackets.</p>
-</li>
-<li> <p id="_39f45cc9-90c4-d225-3684-4b36f8313488">Use an empty list “[]” if there are no alternative mappings.</p>
-</li>
-</ul>
2
000571_7d9edcaf-f4e7-a8bb-9016-9660a74f55b1All lists must be preceded by colon or full stop: Usage
<ul id="_7d9edcaf-f4e7-a8bb-9016-9660a74f55b1"> <li> <p id="_2243bc4f-ed11-a269-4bc7-1b516a573da5">Begin with “ATTRIBUTE_MAPPING” followed by the attribute name.</p>
-</li>
-<li> <p id="_ccb88e5f-27c6-113d-8664-29139e613bc3">Specify the ASSERTION_TO value, which indicates the corresponding MIM element or type.</p>
-</li>
-<li> <p id="_51f0665a-29d3-45ca-70e3-8b2846b5865a">Optionally include AIM_ELEMENT, SOURCE, EXPRESS_REF, and REFPATH declarations.</p>
2
000616_0887f4c3-db2c-fe3c-f9a3-f48262561519All lists must be preceded by colon or full stop: Entity mapping validation
<ol id="_0887f4c3-db2c-fe3c-f9a3-f48262561519"> <li> <p id="_0ecedf8c-cac2-2acb-5452-568a46c56251">Each ENTITY_MAPPING shall correspond to an entity defined in the ARM schema.</p>
-</li>
-<li> <p id="_8e140049-6c61-1f8d-9f08-c969c39cc43c">The AIM_ELEMENT specified shall exist in the MIM schema.</p>
-</li>
-<li> <p id="_c5b10fa6-9819-bb63-d296-d96c8cc47dcd">The SOURCE referenced shall be a valid ISO standard or other recognized source.</p>
2
000633_f27c3168-85d2-ef78-6a54-468a7559bda1All lists must be preceded by colon or full stop: Attribute mapping validation
<ol id="_f27c3168-85d2-ef78-6a54-468a7559bda1"> <li> <p id="_c6665749-5331-9d78-ebc7-b2b4a8238dc3">Each ATTRIBUTE_MAPPING shall correspond to an attribute of the ARM entity being mapped.</p>
-</li>
-<li> <p id="_f0ff9b2b-71c7-7307-1df1-75a180edf31d">The ASSERTION_TO value shall be a valid type or entity in the MIM schema.</p>
-</li>
-<li> <p id="_3c2c2444-456e-dab1-3b1b-579f309af8e9">If specified, the AIM_ELEMENT shall exist in the MIM schema.</p>
2
000646_7de141cc-211b-0518-4f54-5ced28d6ed82All lists must be preceded by colon or full stop: Reference path validation
<ol id="_7de141cc-211b-0518-4f54-5ced28d6ed82"> <li> <p id="_6e07bf6d-3bc0-1bdf-1a37-82a01a6a0c28">All entities and attributes referenced in the REFPATH shall exist in either the ARM or MIM schema, as appropriate.</p>
-</li>
-<li> <p id="_38d83504-fc01-8bcc-bd55-177f1dd7860d">Relationships between entities (e.g., subtype, supertype) shall be consistent with the schema definitions.</p>
-</li>
-<li> <p id="_7cc8733d-f5c8-4901-ed96-d5c0e02a98da">Constraints specified in the REFPATH shall use valid attributes or functions for the entities they constrain.</p>
2
000661_4ba8a1f5-2ade-4218-b5e6-dbf90c88c93aAll lists must be preceded by colon or full stop: Overall consistency
<ol id="_4ba8a1f5-2ade-4218-b5e6-dbf90c88c93a"> <li> <p id="_f77d37ca-fbe4-f08d-bff9-a19935f1c15a">The complete set of mappings shall cover all entities and attributes in the ARM schema.</p>
-</li>
-<li> <p id="_c5f4e134-c618-a59b-8fe1-0d6f6151467f">There should be no conflicting mappings (e.g., two different mappings for the same ARM entity or attribute).</p>
-</li>
-<li> <p id="_210170da-cfba-beea-dfce-9389e94b52bc">The overall set of mappings should form a consistent and complete transformation from the ARM to the MIM schema.</p>
2
000680_5b338adc-297d-7ea1-e123-f5b21a23e383All lists must be preceded by colon or full stop: Parsing
<ol id="_5b338adc-297d-7ea1-e123-f5b21a23e383"> <li> <p id="_7ab71d47-eaaf-4bd3-908e-984073532cfb">Implement a lexical analyzer to tokenize the EXPRESS-Q input.</p>
-</li>
-<li> <p id="_99fb11b3-1449-333e-ae9b-8a2f7823a85a">Develop a parser based on the EBNF grammar provided in this specification.</p>
-</li>
-<li> <p id="_8055cc6e-2c54-e749-3d55-0be48fecb666">Create an abstract syntax tree (AST) or similar internal representation of the parsed EXPRESS-Q file.</p>
2
000691_856615f0-3f0c-1647-4c02-2e7759850d70All lists must be preceded by colon or full stop: Schema loading
<ol id="_856615f0-3f0c-1647-4c02-2e7759850d70"> <li> <p id="_bbecbb7a-6e7b-77fa-0fc8-9259ae805ab5">Implement an EXPRESS schema parser or use an existing library to load and interpret ARM and MIM schemas.</p>
-</li>
-<li> <p id="_22259b9a-b452-4658-5664-96b3d08cca72">Create internal representations of the schemas that allow for efficient querying of entities, attributes, and relationships.</p>
-</li>
-</ol>
2
000700_2eabfe18-c3ec-870c-40d4-4c48301fb7e2All lists must be preceded by colon or full stop: Validation
<ol id="_2eabfe18-c3ec-870c-40d4-4c48301fb7e2"> <li> <p id="_efef517e-76a6-202e-eab9-4189a49b2c4c">Implement validation checks based on the rules outlined in the “Validation rules” section.</p>
-</li>
-<li> <p id="_24c3185b-6eec-0623-8925-bcccff2c0d36">Perform two-pass validation:</p>
-<ol id="_de7f3886-fe6a-c0ee-e215-f5d73b165dfe"> <li> <p id="_6204db8d-4437-a427-772b-762c926f9d85">First pass: Check syntax and basic semantic rules (e.g., entity and attribute existence).</p>
-</li>
2
000716_a1711cc9-a848-4810-fd1d-30410d5548edAll lists must be preceded by colon or full stop: Reference path interpretation
<ol id="_a1711cc9-a848-4810-fd1d-30410d5548ed"> <li> <p id="_a86d6340-bf3a-11a2-5f8d-3ea4c7db1891">Implement a separate parser for the reference path syntax.</p>
-</li>
-<li> <p id="_cf883208-a76b-d9fb-a2e6-5734d6ea8fa5">Develop algorithms to traverse reference paths within the context of the loaded schemas.</p>
-</li>
-<li> <p id="_affa6278-7aec-d8c9-79b5-d2e2276f619e">Implement functions to evaluate constraints specified in reference paths.</p>
2
000727_38a8ac16-a538-2e04-95d7-b6eef1d2a25aAll lists must be preceded by colon or full stop: Performance considerations
<ol id="_38a8ac16-a538-2e04-95d7-b6eef1d2a25a"> <li> <p id="_68f972eb-6da9-f98c-3aea-6c26b42b2480">Use efficient data structures (e.g., hash tables) for quick lookups of schema elements.</p>
-</li>
-<li> <p id="_bac68cb0-edab-8203-813b-a14ef079aafb">Implement caching mechanisms for frequently accessed schema information.</p>
-</li>
-<li> <p id="_8f90318d-57fc-1c6b-a60e-c3025e676e21">Consider parallel processing for validating multiple entity or attribute mappings simultaneously.</p>
2
000738_5acf938e-16c7-b844-662c-649c5ad9f97cAll lists must be preceded by colon or full stop: Extensibility
<ol id="_5acf938e-16c7-b844-662c-649c5ad9f97c"> <li> <p id="_ef8b2042-8f3f-465b-627e-1984274dfa0d">Design the implementation to be extensible, allowing for future enhancements to the EXPRESS-Q language.</p>
-</li>
-<li> <p id="_811549c8-5eb4-c7c2-43c3-f7aa4cc647de">Use modular design to separate concerns (e.g., parsing, schema handling, validation).</p>
-</li>
-</ol>
2
000747_3a121c98-8c99-871d-106a-399d1fc6eeceAll lists must be preceded by colon or full stop: Integration
<ol id="_3a121c98-8c99-871d-106a-399d1fc6eece"> <li> <p id="_1e30fd28-a504-aefa-754e-b278205a5f12">Provide APIs or interfaces for integrating the EXPRESS-Q parser and validator into larger systems or workflows.</p>
-</li>
-<li> <p id="_0e017fc7-617f-11ea-286d-cca0793287d2">Consider implementing export functionality to generate reports or machine-readable representations of the validation results.</p>
-</li>
-</ol>
2
000841_55e3cd2b-1991-7f44-edf6-34abbcbf3934may contain ambiguous provision: This example shows how EXPRESS-Q can handle cases where an ARM entity might be mapped to different MIM representations based on certain conditions.
<p id="_55e3cd2b-1991-7f44-edf6-34abbcbf3934">This example shows how EXPRESS-Q can handle cases where an ARM entity might be mapped to different MIM representations based on certain conditions.</p>
2
000889_9fe975fc-e6b4-1af8-89e1-2e1bb8c191b8Hanging paragraph in clause
<clause id="_9fe975fc-e6b4-1af8-89e1-2e1bb8c191b8" inline-header="false" obligation="normative">
-<title id="_c25ad391-aa3c-533a-46fb-5b71ac154745">Future considerations</title>
-<p id="_62ba8cbc-353a-76f6-ac96-9686963e845d">As the use of EXPRESS-Q grows and evolves, several areas may be considered for future enhancements:</p>
-
-<clause id="_c2b817e1-5bbe-c886-fc6c-4e2e06693364" inline-header="false" obligation="normative">
2
000895_d53ef69f-7270-2802-ad94-17e56df2fe72may contain ambiguous provision: Future versions of EXPRESS-Q might benefit from a more expressive constraint language,​ allowing for more complex conditions and transformations to be specified within mappings.​
<p id="_d53ef69f-7270-2802-ad94-17e56df2fe72">Future versions of EXPRESS-Q might benefit from a more expressive constraint language, allowing for more complex conditions and transformations to be specified within mappings.</p>
2
000910_9485e94e-f305-ee96-5da7-043034e6b27emay contain ambiguous provision: Future versions might include capabilities for defining bi-directional mappings,​ allowing for the generation of ARM instances from MIM data.
<p id="_9485e94e-f305-ee96-5da7-043034e6b27e">Future versions might include capabilities for defining bi-directional mappings, allowing for the generation of ARM instances from MIM data.</p>
2
000922_edc4e68c-7694-74ba-f69b-7cab359f5100Annex has not been cross-referenced within document
<annex id="_edc4e68c-7694-74ba-f69b-7cab359f5100" inline-header="false" obligation="informative">
-<title id="_895176c0-7012-de53-ab92-1675513bacf3">Complete EXPRESS-Q file example</title>
-<p id="_109982b6-9835-3cdf-d6aa-f9e568da7e29">This annex provides a complete example of an EXPRESS-Q file, demonstrating various features of the language in a cohesive context.</p>
-
-<sourcecode id="_92603d37-d405-4c01-1ec5-7e31e50e9c66"> <body>-- Example EXPRESS-Q file for a simplified product data model
1
001048_46e42dd0-a5e8-a408-222f-1a0027416d24List entry of separate sentences must end with full stop: Entity and attribute mappings
<li> <p id="_8f95e861-4714-1783-c11b-4b9237090d17">Entity and attribute mappings</p>
-</li>
2
001050_46e42dd0-a5e8-a408-222f-1a0027416d24List entry of separate sentences must end with full stop: Reference paths with complex relationships
<li> <p id="_b21ccecb-4563-aa89-8835-9adb4863863e">Reference paths with complex relationships</p>
-</li>
2
001052_46e42dd0-a5e8-a408-222f-1a0027416d24List entry of separate sentences must end with full stop: Alternative mappings
<li> <p id="_2332c048-2e6d-7e76-e399-e50a121ef114">Alternative mappings</p>
-</li>
2
001054_46e42dd0-a5e8-a408-222f-1a0027416d24List entry of separate sentences must end with full stop: Constraints within reference paths
<li> <p id="_ec420559-ba09-71ea-defe-8cd7ffe98071">Constraints within reference paths</p>
-</li>
2
001056_46e42dd0-a5e8-a408-222f-1a0027416d24List entry of separate sentences must end with full stop: Use of SELECT types (implied by the EXTENSIBLE: TRUE; in GeometricRepresenta­tion)
<li> <p id="_e5699728-5944-09a7-e974-fc511c917314">Use of SELECT types (implied by the EXTENSIBLE: TRUE; in GeometricRepresentation)</p>
-</li>
2
-

Metanorma XML Syntax

- - - - - - - - - - - - - - - - - - - -
LineIDMessageContextSeverity
XML Line 001145:18text not allowed here; expected the element end-tag or element "city", "country", "formattedPlace", "region" or "uri"
2
XML Line 001225:18text not allowed here; expected the element end-tag or element "city", "country", "formattedPlace", "region" or "uri"
2
XML Line 001367:18text not allowed here; expected the element end-tag or element "city", "country", "formattedPlace", "region" or "uri"
2
XML Line 001509:18text not allowed here; expected the element end-tag or element "city", "country", "formattedPlace", "region" or "uri"
2
XML Line 001572:18text not allowed here; expected the element end-tag or element "city", "country", "formattedPlace", "region" or "uri"
2
- diff --git a/sources/document.html b/sources/document.html deleted file mode 100644 index 332f053..0000000 --- a/sources/document.html +++ /dev/null @@ -1,1860 +0,0 @@ - - - - - - - -EXPRESS-Q: EXPRESS Query Language Specification - - - - - -
-
-
-
- - - - - -
-
Note
-
-
Foreword
-This document is developed and published by the EXPRESS Language -Foundation. All rights reserved. -
-
-
-

The EXPRESS Language Foundation, maintainer of the EXPRESS data modeling language, -develops and maintains language standards and technologies. The work of -preparing EXPRESS standards is carried out through technical working groups. -Each member interested in a subject for which a working group has been -established has the right to participate in that group. International -organizations, both governmental and non-governmental, also take part in the -work.

-
-
-

The procedures used to develop this document and those intended for its further -maintenance are described in the EXPRESS Language Foundation’s documentation -guidelines. In particular, different approval criteria are needed for different -types of documents. This document was drafted in accordance with the EXPRESS -Language Foundation’s editorial rules and guidelines.

-
-
-

Attention is drawn to the possibility that some of the elements of this document -may be the subject of patent rights. The EXPRESS Language Foundation shall not -be held responsible for identifying any or all such patent rights. Details of -any patent rights identified during the development of the document will be in -the Introduction.

-
-
-

Any trade name used in this document is information given for the convenience of -users and does not constitute an endorsement.

-
-
-

For an explanation of the voluntary nature of standards and the meaning of -EXPRESS Language Foundation specific terms and expressions related to conformity -assessment, please refer to the Foundation’s documentation guidelines.

-
-
-

This document was prepared by the EXPRESS Language Foundation’s Technical -Working Group.

-
-
-

EXPRESS is organized as a series of specifications, each published separately. -The structure of EXPRESS is described in the Core Language Specification.

-
-
-

Each specification is a member of one of the following series: description -methods, implementation methods, conformance testing methodology and framework, -integrated generic resources, integrated application resources, application -protocols, abstract test suites, application interpreted constructs, and -application modules. This part is a member of the description methods series.

-
-
-
-
-

Introduction

-
-
-

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. By providing a standardized -way to express these mappings and constraints, EXPRESS-Q facilitates more robust -and reliable data exchange in complex engineering and manufacturing -environments.

-
-
-
-
-

Scope

-
-
-

This document specifies EXPRESS-Q, including its syntax, semantics, and usage within the context of EXPRESS schemas and STEP application protocols.

-
-
-

The specification covers:

-
-
-
    -
  1. -

    The grammar and syntax of EXPRESS-Q

    -
  2. -
  3. -

    The semantics of EXPRESS-Q constructs

    -
  4. -
  5. -

    The reference path syntax used for defining detailed mappings

    -
  6. -
  7. -

    Validation rules for EXPRESS-Q files

    -
  8. -
  9. -

    Guidelines for implementing EXPRESS-Q parsers and validators

    -
  10. -
-
-
-

This specification is intended for use by software developers, data modelers, -and systems integrators working with EXPRESS schemas and STEP application -protocols.

-
-
-
-
-

Normative references

-
-
-
    -
  • -

    [ISO 10303-1:2024]

    -
  • -
  • -

    [ISO 10303-11:2004]

    -
  • -
  • -

    [ISO/IEC 8824-1:2008]

    -
  • -
  • -

    [ISO/IEC 10646:2011]

    -
  • -
-
-
-
-
-

Terms and definitions

-
-
-

EXPRESS-Q

-
-

query language for EXPRESS schemas, used to define mappings and constraints -between ARM and MIM schemas

-
-
-
-
-
-

EXPRESS-Q language specification

-
-
-

Overview

-
-

EXPRESS-Q is designed to work alongside EXPRESS schemas, providing a mechanism -to define mappings between ARM and MIM schemas, as well as specifying -constraints on datasets. The language uses a syntax similar to EXPRESS but -introduces new constructs specific to querying and mapping.

-
-
-

An EXPRESS-Q file typically consists of one or more entity mappings, each of -which defines how an ARM entity and its attributes correspond to MIM elements. -These mappings can include various declarations such as extensibility, AIM -elements, sources, EXPRESS references, reference paths, and alternative -mappings.

-
-
-
-

EBNF grammar

-
-

The following EBNF (Extended Backus-Naur Form) grammar defines the syntax of -EXPRESS-Q:

-
-
-
-
express_q_file = { entity_mapping } ;
-
-entity_mapping = "ENTITY_MAPPING" entity_name ";" newline
-                 [ extensible_decl ]
-                 [ aim_element_decl ]
-                 [ source_decl ]
-                 [ express_ref_decl ]
-                 [ refpath_decl ]
-                 [ alt_map_decl ]
-                 { attribute_mapping }
-                 "END_ENTITY_MAPPING" ";" ;
-
-extensible_decl = "EXTENSIBLE" ":" boolean ";" newline ;
-
-aim_element_decl = "AIM_ELEMENT" ":" string ";" newline ;
-
-source_decl = "SOURCE" ":" string ";" newline ;
-
-express_ref_decl = "EXPRESS_REF" ":" "[" [ string { "," string } ] "]" ";" newline ;
-
-refpath_decl = "REFPATH" ":" "{" newline
-               refpath_content
-               "}" ";" newline ;
-
-refpath_content = { refpath_line } ;
-
-refpath_line = [ indentation ] reference_expression newline ;
-
-reference_expression = entity_reference [ relationship { relationship } ] ;
-
-relationship = path_relation | supertype_relation | subtype_relation | 
-                select_extension | constraint ;
-
-entity_reference = identifier ;
-
-path_relation = "->" entity_reference ;
-
-supertype_relation = "=>" entity_reference ;
-
-subtype_relation = "<=" entity_reference ;
-
-select_extension = "*" ">" entity_reference | "<" "*" entity_reference ;
-
-constraint = "[" constraint_expression "]" ;
-
-constraint_expression = ? expression following EXPRESS syntax ? ;
-
-indentation = ? one or more spaces or tabs ? ;
-
-alt_map_decl = "ALT_MAP" ":" "[" [ string { "," string } ] "]" ";" newline ;
-
-attribute_mapping = "ATTRIBUTE_MAPPING" attribute_name ";" newline
-                    "ASSERTION_TO" ":" string ";" newline
-                    [ aim_element_decl ]
-                    [ source_decl ]
-                    [ express_ref_decl ]
-                    [ refpath_decl ]
-                    "END_ATTRIBUTE_MAPPING" ";" newline ;
-
-entity_name = identifier ;
-
-attribute_name = identifier ;
-
-identifier = letter { letter | digit | "_" } ;
-
-boolean = "TRUE" | "FALSE" ;
-
-string = '"' { character } '"' ;
-
-letter = "A" | ... | "Z" | "a" | ... | "z" ;
-
-digit = "0" | ... | "9" ;
-
-character = ? any printable character ? ;
-
-indentation = ? one or more spaces or tabs ? ;
-
-newline = ? line break character(s) ? ;
-
-
-
-

This grammar defines the overall structure of an EXPRESS-Q file, including -entity mappings, attribute mappings, reference paths, including various types -of relationships between entities and constraints, and various declarations.

-
-
-
-

Semantics

-
-

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

-
-
-

Entity mapping

-
-
-
entity_mapping = "ENTITY_MAPPING" entity_name ";" newline
-                 [ extensible_decl ]
-                 [ aim_element_decl ]
-                 [ source_decl ]
-                 [ express_ref_decl ]
-                 [ refpath_decl ]
-                 [ alt_map_decl ]
-                 { attribute_mapping }
-                 "END_ENTITY_MAPPING" ";" ;
-
-
-
-

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).

-
-
-
-
Usage
-
-
-
    -
  • -

    Begin with "ENTITY_MAPPING" followed by the ARM entity name.

    -
  • -
  • -

    Include optional declarations for extensibility, AIM element, source, EXPRESS references, reference path, and alternative mappings.

    -
  • -
  • -

    Include attribute mappings for the entity’s attributes.

    -
  • -
  • -

    End with "END_ENTITY_MAPPING".

    -
  • -
-
-
-
-
-
-
-
ENTITY_MAPPING Product;
-EXTENSIBLE: FALSE;
-AIM_ELEMENT: "product";
-SOURCE: "ISO 10303-41";
-EXPRESS_REF: ["product_definition_schema"];
-REFPATH: {
-  product <= product_definition_formation
-  product_definition_formation.of_product -> product
-};
-ATTRIBUTE_MAPPING id;
-ASSERTION_TO: "id";
-AIM_ELEMENT: "product.id";
-END_ATTRIBUTE_MAPPING;
-END_ENTITY_MAPPING;
-
-
-
-
-

Extensible declaration

-
-
-
extensible_decl = "EXTENSIBLE" ":" boolean ";" newline ;
-
-
-
-

The extensible declaration specifies whether the entity mapping is extensible, corresponding to the extensibility of SELECT types in EXPRESS schemas.

-
-
-
-
Usage
-
-
-
    -
  • -

    Use "EXTENSIBLE: TRUE;" for extensible mappings.

    -
  • -
  • -

    Use "EXTENSIBLE: FALSE;" for non-extensible mappings.

    -
  • -
-
-
-
-
-
-
-
ENTITY_MAPPING ProductCategory;
-EXTENSIBLE: TRUE;
-...
-END_ENTITY_MAPPING;
-
-
-
-
-

AIM element declaration

-
-
-
aim_element_decl = "AIM_ELEMENT" ":" string ";" newline ;
-
-
-
-

The AIM element declaration specifies the corresponding AIM (MIM) element for the ARM entity, providing a direct link between the ARM and MIM schemas.

-
-
-
-
Usage
-
-
-
    -
  • -

    Specify the AIM element name as a string.

    -
  • -
-
-
-
-
-
-
-
ENTITY_MAPPING Product;
-AIM_ELEMENT: "product";
-...
-END_ENTITY_MAPPING;
-
-
-
-
-

Source declaration

-
-
-
source_decl = "SOURCE" ":" string ";" newline ;
-
-
-
-

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.

-
-
-
-
Usage
-
-
-
    -
  • -

    Specify the source as a string, typically an ISO standard number.

    -
  • -
-
-
-
-
-
-
-
ENTITY_MAPPING Product;
-SOURCE: "ISO 10303-41";
-...
-END_ENTITY_MAPPING;
-
-
-
-
-

EXPRESS reference declaration

-
-
-
express_ref_decl = "EXPRESS_REF" ":" "[" [ string { "," string } ] "]" ";" newline ;
-
-
-
-

The EXPRESS reference declaration lists EXPRESS references related to the mapping, used to link the mapping to specific parts of the EXPRESS schemas or other relevant documentation.

-
-
-
-
Usage
-
-
-
    -
  • -

    Provide a comma-separated list of references enclosed in square brackets.

    -
  • -
  • -

    Use an empty list "[]" if there are no references.

    -
  • -
-
-
-
-
-
-
-
ENTITY_MAPPING Product;
-EXPRESS_REF: ["product_definition_schema", "management_resources_schema"];
-...
-END_ENTITY_MAPPING;
-
-
-
-
-

Reference path declaration

-
-
General
-
-

The reference path syntax in EXPRESS-Q is based on the ISO 10303 Mapping -Specification and is used within the REFPATH sections to define precise mappings -between ARM and MIM elements. This syntax allows for complex relationships and -constraints to be expressed concisely.

-
-
-
-
refpath_decl = "REFPATH" ":" "{" newline
-               refpath_content
-               "}" ";" newline ;
-
-
-
-

The reference path declaration defines the detailed mapping between ARM and MIM elements using the reference path syntax described earlier.

-
-
-
-
Usage
-
-
-
    -
  • -

    Begin with REFPATH: { and end with };.

    -
  • -
  • -

    Each line in the content describes a step in the mapping path.

    -
  • -
  • -

    Use indentation to indicate nested structures.

    -
  • -
  • -

    Use symbols like , , to indicate relationships between entities and attributes.

    -
  • -
-
-
-
-
-
-
-
ENTITY_MAPPING Product;
-REFPATH: {
-  product <= product_definition_formation
-  product_definition_formation.of_product -> product
-  {product.name -> product.name
-   product.description -> product.description}
-};
-...
-END_ENTITY_MAPPING;
-
-
-
-
-
Symbols and meaning
-
-

The reference path syntax uses several symbols to express relationships and constraints. These symbols are derived from the ISO 10303 Mapping Specification:

-
-
-
-
[]
-
-

Enclosed section constrains multiple MIM elements or sections of the reference -path required to satisfy an information requirement.

-
-
()
-
-

Enclosed section constrains multiple MIM elements or sections of the reference -path identified as alternatives within the mapping.

-
-
{}
-
-

Enclosed section constrains the reference path to satisfy an information -requirement.

-
-
<>
-
-

Enclosed section constrains one or more required reference paths.

-
-
||
-
-

Enclosed section constrains the supertype entity.

-
-
-
-

The attribute whose name precedes the symbol references the entity or select type whose name follows the symbol.

-
-
-
-

The entity or select type whose name precedes the symbol is referenced by the entity attribute whose name follows the symbol.

-
-
[i]
-
-

The attribute whose name precedes the symbol is an aggregate; any element of that aggregate is referred to.

-
-
[n]
-
-

The attribute whose name precedes the symbol is an ordered aggregate; member n of that aggregate is referred to.

-
-
-
-

The entity whose name precedes the symbol is a supertype of the entity whose name follows the symbol.

-
-
-
-

The entity whose name precedes the symbol is a subtype of the entity whose name follows the symbol.

-
-
=
-
-

The string, select, or enumeration type is constrained to a choice or value.

-
-
\
-
-

The reference path expression continues on the next line.

-
-
*
-
-

One or more instances of the relationship entity data type may be assembled in a relationship tree structure.

-
-
--
-
-

The text following is a comment or introduces a clause reference.

-
-
*>
-
-

The select or enumeration type whose name precedes the symbol is extended into the select or enumeration type whose name follows the symbol.

-
-
<*
-
-

The select or enumeration type whose name precedes the symbol is an extension of the select or enumeration type whose name follows the symbol.

-
-
!{}
-
-

Section enclosed by {} indicates a negative constraint placed on the mapping.

-
-
-
-
-
-
Usage and examples
-
-

The reference path syntax is used to define precise mappings between ARM and MIM -elements. Here are some examples demonstrating various aspects of the syntax:

-
-
-
Example 1. Simple attribute mapping
-
-
-
-
REFPATH: {
-  product.id -> id
-}
-
-
-
-
-
-
Example 2. Subtype relationship
-
-
-
-
REFPATH: {
-  mechanical_context <= product_context
-}
-
-
-
-
-
-
Example 3. Complex mapping with alternatives and constraints
-
-
-
-
REFPATH: {
-  shape_representation <= representation
-  {representation.items[i] -> representation_item
-   representation_item =>
-   (geometric_representation_item
-    [geometric_representation_item.dim = 3] |
-    mapped_item)
-  }
-}
-
-
-
-
-
-
Example 4. Select type extension
-
-
-
-
REFPATH: {
-  person_and_organization_select *> organization
-}
-
-
-
-
-
-
Example 5. Negative constraint
-
-
-
-
REFPATH: {
-  product_definition_formation
-  !{product_definition_formation.make_or_buy = bought_item}
-}
-
-
-
-
-
-
-
Validation rules for reference paths
-
-

When validating reference paths, the following rules should be applied:

-
-
-
    -
  1. -

    All referenced entities and attributes shall exist in the corresponding ARM or MIM schema.

    -
  2. -
  3. -

    The relationships between entities (supertype, subtype, attribute reference) shall be consistent with the schema definitions.

    -
  4. -
  5. -

    Constraints shall be syntactically correct and use only attributes or functions that are valid for the constrained entity.

    -
  6. -
  7. -

    Select type extensions shall be consistent with the schema definitions.

    -
  8. -
  9. -

    Aggregate references (using [i] or [n]) shall be applied only to attributes defined as aggregates in the schema.

    -
  10. -
  11. -

    Alternative mappings (using parentheses) shall all be valid according to the schema.

    -
  12. -
  13. -

    Negative constraints shall be logically consistent with the rest of the mapping and the schema definitions.

    -
  14. -
  15. -

    The overall structure of the reference path shall form a valid path through the schema, connecting the source ARM entity to the target MIM entity or attribute.

    -
  16. -
-
-
-
-
-

Alternative mapping declaration

-
-
-
alt_map_decl = "ALT_MAP" ":" "[" [ string { "," string } ] "]" ";" newline ;
-
-
-
-

The alternative mapping declaration specifies alternative mappings, allowing for flexibility in cases where multiple valid mappings exist.

-
-
-
-
Usage
-
-
-
    -
  • -

    Provide a comma-separated list of alternative mappings enclosed in square brackets.

    -
  • -
  • -

    Use an empty list "[]" if there are no alternative mappings.

    -
  • -
-
-
-
-
-
-
-
ENTITY_MAPPING GeometricRepresentation;
-ALT_MAP: ["shape_representation", "tessellated_shape_representation"];
-...
-END_ENTITY_MAPPING;
-
-
-
-
-

Attribute mapping

-
-
-
attribute_mapping = "ATTRIBUTE_MAPPING" attribute_name ";" newline
-                    "ASSERTION_TO" ":" string ";" newline
-                    [ aim_element_decl ]
-                    [ source_decl ]
-                    [ express_ref_decl ]
-                    [ refpath_decl ]
-                    "END_ATTRIBUTE_MAPPING" ";" newline ;
-
-
-
-

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

-
-
-
-
Usage
-
-
-
    -
  • -

    Begin with "ATTRIBUTE_MAPPING" followed by the attribute name.

    -
  • -
  • -

    Specify the ASSERTION_TO value, which indicates the corresponding MIM element or type.

    -
  • -
  • -

    Optionally include AIM_ELEMENT, SOURCE, EXPRESS_REF, and REFPATH declarations.

    -
  • -
  • -

    End with "END_ATTRIBUTE_MAPPING".

    -
  • -
-
-
-
-
-
-
-
ENTITY_MAPPING Product;
-ATTRIBUTE_MAPPING id;
-ASSERTION_TO: "id";
-AIM_ELEMENT: "product.id";
-REFPATH: {
-  product.id -> id
-};
-END_ATTRIBUTE_MAPPING;
-
-ATTRIBUTE_MAPPING name;
-ASSERTION_TO: "label";
-AIM_ELEMENT: "product.name";
-SOURCE: "ISO 10303-41";
-EXPRESS_REF: ["product_definition_schema"];
-REFPATH: {
-  product.name -> name
-};
-END_ATTRIBUTE_MAPPING;
-END_ENTITY_MAPPING;
-
-
-
-
-
-
-
-

Validation rules

-
-
-

General

-
-

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.

-
-
-
-

Entity mapping validation

-
-
    -
  1. -

    Each ENTITY_MAPPING shall correspond to an entity defined in the ARM schema.

    -
  2. -
  3. -

    The AIM_ELEMENT specified shall exist in the MIM schema.

    -
  4. -
  5. -

    The SOURCE referenced shall be a valid ISO standard or other recognized source.

    -
  6. -
  7. -

    All EXPRESS_REF entries shall refer to valid EXPRESS schemas.

    -
  8. -
  9. -

    The REFPATH shall form a valid path from the ARM entity to the specified AIM_ELEMENT.

    -
  10. -
  11. -

    If ALT_MAP is specified, all alternative mappings shall be valid MIM entities.

    -
  12. -
-
-
-
-

Attribute mapping validation

-
-
    -
  1. -

    Each ATTRIBUTE_MAPPING shall correspond to an attribute of the ARM entity being mapped.

    -
  2. -
  3. -

    The ASSERTION_TO value shall be a valid type or entity in the MIM schema.

    -
  4. -
  5. -

    If specified, the AIM_ELEMENT shall exist in the MIM schema.

    -
  6. -
  7. -

    The REFPATH for an attribute shall form a valid path from the ARM attribute to the specified MIM element.

    -
  8. -
-
-
-
-

Reference path validation

-
-
    -
  1. -

    All entities and attributes referenced in the REFPATH shall exist in either the ARM or MIM schema, as appropriate.

    -
  2. -
  3. -

    Relationships between entities (e.g., subtype, supertype) shall be consistent with the schema definitions.

    -
  4. -
  5. -

    Constraints specified in the REFPATH shall use valid attributes or functions for the entities they constrain.

    -
  6. -
  7. -

    SELECT type extensions shall be consistent with the schema definitions.

    -
  8. -
  9. -

    Aggregate references (using [i] or [n]) shall only be applied to attributes defined as aggregates in the schema.

    -
  10. -
-
-
-
-

Overall consistency

-
-
    -
  1. -

    The complete set of mappings shall cover all entities and attributes in the ARM schema.

    -
  2. -
  3. -

    There should be no conflicting mappings (e.g., two different mappings for the same ARM entity or attribute).

    -
  4. -
  5. -

    The overall set of mappings should form a consistent and complete transformation from the ARM to the MIM schema.

    -
  6. -
-
-
-
-
-
-

Implementation guidelines

-
-
-

General

-
-

When implementing an EXPRESS-Q parser and validator, consider the following guidelines.

-
-
-
-

Parsing

-
-
    -
  1. -

    Implement a lexical analyzer to tokenize the EXPRESS-Q input.

    -
  2. -
  3. -

    Develop a parser based on the EBNF grammar provided in this specification.

    -
  4. -
  5. -

    Create an abstract syntax tree (AST) or similar internal representation of the parsed EXPRESS-Q file.

    -
  6. -
-
-
-
-

Schema loading

-
-
    -
  1. -

    Implement an EXPRESS schema parser or use an existing library to load and interpret ARM and MIM schemas.

    -
  2. -
  3. -

    Create internal representations of the schemas that allow for efficient querying of entities, attributes, and relationships.

    -
  4. -
-
-
-
-

Validation

-
-
    -
  1. -

    Implement validation checks based on the rules outlined in the "Validation rules" section.

    -
  2. -
  3. -

    Perform two-pass validation:

    -
    -
      -
    1. -

      First pass: Check syntax and basic semantic rules (e.g., entity and attribute existence).

      -
    2. -
    3. -

      Second pass: Validate complex semantic rules (e.g., consistency of reference paths).

      -
    4. -
    -
    -
  4. -
  5. -

    Provide clear and informative error messages for validation failures.

    -
  6. -
-
-
-
-

Reference path interpretation

-
-
    -
  1. -

    Implement a separate parser for the reference path syntax.

    -
  2. -
  3. -

    Develop algorithms to traverse reference paths within the context of the loaded schemas.

    -
  4. -
  5. -

    Implement functions to evaluate constraints specified in reference paths.

    -
  6. -
-
-
-
-

Performance considerations

-
-
    -
  1. -

    Use efficient data structures (e.g., hash tables) for quick lookups of schema elements.

    -
  2. -
  3. -

    Implement caching mechanisms for frequently accessed schema information.

    -
  4. -
  5. -

    Consider parallel processing for validating multiple entity or attribute mappings simultaneously.

    -
  6. -
-
-
-
-

Extensibility

-
-
    -
  1. -

    Design the implementation to be extensible, allowing for future enhancements to the EXPRESS-Q language.

    -
  2. -
  3. -

    Use modular design to separate concerns (e.g., parsing, schema handling, validation).

    -
  4. -
-
-
-
-

Integration

-
-
    -
  1. -

    Provide APIs or interfaces for integrating the EXPRESS-Q parser and validator into larger systems or workflows.

    -
  2. -
  3. -

    Consider implementing export functionality to generate reports or machine-readable representations of the validation results.

    -
  4. -
-
-
-
-
-
-

Use cases and examples

-
-
-

General

-
-

This section provides examples of how EXPRESS-Q can be used in various scenarios -related to STEP application protocols.

-
-
-
-

Use case 1: Mapping a complex product structure

-
-

In this example, we’ll demonstrate how EXPRESS-Q can be used to map a complex product structure from an ARM schema to a MIM schema.

-
-
-
-
ENTITY_MAPPING Product;
-AIM_ELEMENT: "product";
-SOURCE: "ISO 10303-41";
-REFPATH: {
-  product <= product_definition_formation
-  product_definition_formation.of_product -> product
-};
-
-ATTRIBUTE_MAPPING id;
-ASSERTION_TO: "id";
-AIM_ELEMENT: "product.id";
-END_ATTRIBUTE_MAPPING;
-
-ATTRIBUTE_MAPPING name;
-ASSERTION_TO: "label";
-AIM_ELEMENT: "product.name";
-END_ATTRIBUTE_MAPPING;
-
-ATTRIBUTE_MAPPING description;
-ASSERTION_TO: "text";
-AIM_ELEMENT: "product.description";
-END_ATTRIBUTE_MAPPING;
-
-ATTRIBUTE_MAPPING components;
-ASSERTION_TO: "SET OF Component";
-REFPATH: {
-  product <- product_definition_formation
-  product_definition_formation <- product_definition
-  product_definition <- product_definition_relationship.relating_product_definition
-  product_definition_relationship ->
-  product_definition_relationship.related_product_definition
-  product_definition_relationship.related_product_definition -> product_definition
-  product_definition -> product_definition_formation
-  product_definition_formation -> product
-};
-END_ATTRIBUTE_MAPPING;
-
-END_ENTITY_MAPPING;
-
-ENTITY_MAPPING Component;
-AIM_ELEMENT: "product";
-SOURCE: "ISO 10303-41";
-REFPATH: {
-  product <= product_definition_formation
-  product_definition_formation.of_product -> product
-};
-
-ATTRIBUTE_MAPPING id;
-ASSERTION_TO: "id";
-AIM_ELEMENT: "product.id";
-END_ATTRIBUTE_MAPPING;
-
-ATTRIBUTE_MAPPING name;
-ASSERTION_TO: "label";
-AIM_ELEMENT: "product.name";
-END_ATTRIBUTE_MAPPING;
-
-ATTRIBUTE_MAPPING quantity;
-ASSERTION_TO: "measure_with_unit";
-REFPATH: {
-  product <- product_definition_formation
-  product_definition_formation <- product_definition
-  product_definition <- product_definition_relationship
-  product_definition_relationship.related_product_definition_quantity -> measure_with_unit
-};
-END_ATTRIBUTE_MAPPING;
-
-END_ENTITY_MAPPING;
-
-
-
-

This example demonstrates how a product with multiple components can be mapped from an ARM schema to a MIM schema using EXPRESS-Q. It shows the use of complex reference paths to navigate relationships between entities in the MIM schema.

-
-
-
-

Use case 2: Mapping with alternative representations

-
-

This example shows how EXPRESS-Q can handle cases where an ARM entity might be mapped to different MIM representations based on certain conditions.

-
-
-
-
ENTITY_MAPPING GeometricRepresentation;
-ALT_MAP: ["shape_representation", "tessellated_shape_representation"];
-SOURCE: "ISO 10303-42";
-
-REFPATH: {
-  (shape_representation <= representation
-   [representation.context_of_items->geometric_representation_context]) |
-  (tessellated_shape_representation <= representation
-   [representation.context_of_items->geometric_representation_context])
-};
-
-ATTRIBUTE_MAPPING items;
-ASSERTION_TO: "SET OF geometric_representation_item";
-REFPATH: {
-  representation.items[i] -> geometric_representation_item
-};
-END_ATTRIBUTE_MAPPING;
-
-END_ENTITY_MAPPING;
-
-
-
-

This example demonstrates how EXPRESS-Q can handle alternative mappings for a single ARM entity. The GeometricRepresentation entity can be mapped to either a shape_representation or a tessellated_shape_representation in the MIM schema, depending on the specific requirements of the application.

-
-
-
-
-
-

Summary

-
-
-

EXPRESS-Q provides a powerful and flexible language for defining mappings between ARM and MIM schemas in the context of STEP application protocols. By offering a standardized way to express these mappings, EXPRESS-Q facilitates more robust and reliable data exchange in complex engineering and manufacturing environments.

-
-
-

Key features of EXPRESS-Q include:

-
-
-
    -
  1. -

    A syntax that is familiar to users of EXPRESS, reducing the learning curve.

    -
  2. -
  3. -

    The ability to define detailed mappings between ARM and MIM entities and attributes.

    -
  4. -
  5. -

    Support for complex reference paths, allowing for navigation through intricate schema relationships.

    -
  6. -
  7. -

    Mechanisms for specifying constraints and alternative mappings.

    -
  8. -
  9. -

    Clear separation of entity and attribute mappings for improved readability and maintainability.

    -
  10. -
-
-
-

The validation rules and implementation guidelines provided in this specification aim to ensure consistent interpretation and implementation of EXPRESS-Q across different tools and systems.

-
-
-
-
-

Future considerations

-
-
-

As the use of EXPRESS-Q grows and evolves, several areas may be considered for future enhancements:

-
-
-

Extended constraint language

-
-

Future versions of EXPRESS-Q might benefit from a more expressive constraint language, allowing for more complex conditions and transformations to be specified within mappings.

-
-
-
-

Integration with other standards

-
-

Consideration should be given to how EXPRESS-Q can be integrated with other relevant standards and technologies, such as ontology languages or model transformation frameworks.

-
-
-
-

Tool support

-
-

Development of standardized libraries and tools for parsing, validating, and processing EXPRESS-Q files would greatly facilitate its adoption and use.

-
-
-
-

Reverse mapping capabilities

-
-

Future versions might include capabilities for defining bi-directional mappings, allowing for the generation of ARM instances from MIM data.

-
-
-
-

Performance optimizations

-
-

As EXPRESS-Q is used with increasingly large and complex schemas, performance optimizations in both the language design and implementation guidelines may become necessary.

-
-
-
-
-
-

Appendix A: Complete EXPRESS-Q file example

-
-
-

This annex provides a complete example of an EXPRESS-Q file, demonstrating -various features of the language in a cohesive context.

-
-
-
-
-- Example EXPRESS-Q file for a simplified product data model
-
-ENTITY_MAPPING Product;
-EXTENSIBLE: FALSE;
-AIM_ELEMENT: "product";
-SOURCE: "ISO 10303-41";
-EXPRESS_REF: ["product_definition_schema"];
-REFPATH: {
-  product <= product_definition_formation
-  product_definition_formation.of_product -> product
-};
-
-ATTRIBUTE_MAPPING id;
-ASSERTION_TO: "identifier";
-AIM_ELEMENT: "product.id";
-REFPATH: {
-  product.id -> id
-};
-END_ATTRIBUTE_MAPPING;
-
-ATTRIBUTE_MAPPING name;
-ASSERTION_TO: "label";
-AIM_ELEMENT: "product.name";
-REFPATH: {
-  product.name -> name
-};
-END_ATTRIBUTE_MAPPING;
-
-ATTRIBUTE_MAPPING description;
-ASSERTION_TO: "text";
-AIM_ELEMENT: "product.description";
-REFPATH: {
-  product.description -> description
-};
-END_ATTRIBUTE_MAPPING;
-
-ATTRIBUTE_MAPPING category;
-ASSERTION_TO: "product_category";
-REFPATH: {
-  product <- product_category_assignment.products[i]
-  product_category_assignment -> product_category_assignment.assigned_category
-  product_category_assignment.assigned_category -> product_category
-};
-END_ATTRIBUTE_MAPPING;
-
-END_ENTITY_MAPPING;
-
-ENTITY_MAPPING Assembly;
-EXTENSIBLE: FALSE;
-AIM_ELEMENT: "product";
-SOURCE: "ISO 10303-44";
-EXPRESS_REF: ["product_structure_schema"];
-REFPATH: {
-  product <= product_definition_formation
-  product_definition_formation.of_product -> product
-  [product <- product_definition_formation
-   product_definition_formation <- product_definition
-   product_definition <- assembly_component_usage.relating_product_definition]
-};
-
-ATTRIBUTE_MAPPING components;
-ASSERTION_TO: "SET OF AssemblyComponent";
-REFPATH: {
-  product <- product_definition_formation
-  product_definition_formation <- product_definition
-  product_definition <- assembly_component_usage.relating_product_definition
-  assembly_component_usage -> assembly_component_usage.related_product_definition
-  assembly_component_usage.related_product_definition -> product_definition
-  product_definition -> product_definition_formation
-  product_definition_formation -> product
-};
-END_ATTRIBUTE_MAPPING;
-
-END_ENTITY_MAPPING;
-
-ENTITY_MAPPING AssemblyComponent;
-EXTENSIBLE: FALSE;
-AIM_ELEMENT: "product";
-SOURCE: "ISO 10303-44";
-EXPRESS_REF: ["product_structure_schema"];
-REFPATH: {
-  product <= product_definition_formation
-  product_definition_formation.of_product -> product
-};
-
-ATTRIBUTE_MAPPING quantity;
-ASSERTION_TO: "measure_with_unit";
-REFPATH: {
-  product <- product_definition_formation
-  product_definition_formation <- product_definition
-  product_definition <- assembly_component_usage
-  assembly_component_usage.quantity -> measure_with_unit
-};
-END_ATTRIBUTE_MAPPING;
-
-END_ENTITY_MAPPING;
-
-ENTITY_MAPPING GeometricRepresentation;
-EXTENSIBLE: TRUE;
-ALT_MAP: ["shape_representation", "tessellated_shape_representation"];
-SOURCE: "ISO 10303-42";
-EXPRESS_REF: ["geometric_model_schema"];
-
-REFPATH: {
-  (shape_representation <= representation
-   [representation.context_of_items->geometric_representation_context]) |
-  (tessellated_shape_representation <= representation
-   [representation.context_of_items->geometric_representation_context])
-};
-
-ATTRIBUTE_MAPPING items;
-ASSERTION_TO: "SET OF geometric_representation_item";
-REFPATH: {
-  representation.items[i] -> geometric_representation_item
-};
-END_ATTRIBUTE_MAPPING;
-
-END_ENTITY_MAPPING;
-
-
-
-

This example demonstrates a simplified product data model, including mappings -for products, assemblies, assembly components, and geometric representations. It -showcases various features of EXPRESS-Q, including:

-
-
-
    -
  • -

    Entity and attribute mappings

    -
  • -
  • -

    Reference paths with complex relationships

    -
  • -
  • -

    Alternative mappings

    -
  • -
  • -

    Constraints within reference paths

    -
  • -
  • -

    Use of SELECT types (implied by the EXTENSIBLE: TRUE; in GeometricRepresentation)

    -
  • -
-
-
-

This example is not exhaustive but provides a realistic scenario that -illustrates how EXPRESS-Q can be used to define mappings between ARM and MIM -schemas in a STEP application protocol context.

-
-
-
-
-

Bibliography

-
-
-
    -
  • -

    [ISO 10303-21:2016]

    -
  • -
-
-
-
-
- - - \ No newline at end of file