A Part 21 dataset is made up of a collection of instances of entities as defined in one of the schema of the STEP standard. Within the Part 21 file each instance is labelled by a string (denoted the ENTITY_INSTANCE_NAME) of the form "#023"; and this label is used when one instance refers to another as an attribute. For each instance the information encoded in the Part 21 file consists of the entities making up the instance and the values of the attributes of those entities. This information is presented as a sequence of Prolog ground facts of the predicates instance_entity and instance_attribute_value .
The instance_entity predicate takes two arguments. A Prolog fact
would as a logic programming statement be interpreted the instance with label #023 contains the attributes of the cartesian_point entity. In the Part 21 standard encoding of a data set the entity content for most of the instances (those which are encoded using the "internal mapping") are indicated only implicitly; while for the Prolog encoding used in this work all the entities making up an instance are explicitly defined with an instance_entity fact; including those entities which have no explicit attributes as defined in the schema.
The instance_attribute_value predicate takes 3 arguments. The fact
is interpreted the instance with label #023 has an attribute "name" with the value "Mechanical". The possible encodings of EXPRESS types which are used to define attribute values in a Part 21 file are translated to Prolog arguments according to the following table:
| EXPRESS Value | Prolog term |
|---|---|
| string | Prolog string |
| reference to instance | atom derived from label (e.g. '#012') |
| EXPRESS List | Prolog list |
| EXPRESS eumeration | atom derived from enumeration value |
| EXPRESS integer | integer |
As an example, first consider a fragment of the schema which defines cartesian_point entity and its ancestor entities:
A typical instance of a cartesian_point could appear in a Part 21 file as the following:
and would result in the following Prolog facts: