Gem Version Ubuntu Build Status OSX Build Status Windows Build Status Code Climate Pull Requests Commits since latest

Purpose

The stepmod-utils Ruby gem provides a number of tools to work with the STEPmod repository.

Installation

gem install stepmod-utils

Or include it in your gemspec.

Usage

# Extracts from specified stepmod/data/ directory
$ stepmod-extract-terms -p {stepmod-data-directory} -i {path-to-repository_index.xml}

Then these files will be created:

  • 031-generated-terms.adoc all terms extracted

  • 991-generated-bibliography.adoc all bibliographic sources where the terms come from

Conversion of STEPmod descriptions.xml into adoc

$ stepmod-convert-express-description /path/to/the/stepmod/descriptions.xml

Example output:

(*"application_context_schema"

*)
(*"application_context_schema.exchange_identification_context_select"
 The *exchange\_identification\_context\_select* type allows for the designation of the data types express_ref:[management_resources_schema:ir_express:management_resources_schema.identification_assignment] and express_ref:[person_organization_schema:ir_express:person_organization_schema.organization] .
*)
(*"application_context_schema.application_context"
 An *application\_context*, as defined in ISO 10303-1, is a context in which product data is defined and has meaning. An *application\_context* represents various types of information that relate to product data and may affect the meaning and usage of that data.
*)
(*"application_context_schema.application_context.application"

the express_ref:[support_resource_schema:ir_express:support_resource_schema.label] by which the *application\_context* is known.

[NOTE]
--
The meaning of this attribute can be defined in the annotated EXPRESS schemas that use or specialize this entity, or in an agreement of common understanding between the partners sharing this information.
--

*)

Conversion of STEPmod resource.xml into adoc

Given resource.xml file contents:

<schema name="contract_schema" number="8369" version="3">
  <introduction>
    The subject of the <b>contract_schema</b> is the description of contract agreements.
  </introduction>
  <fund_cons>
    Contract information may be attached to any aspect of a product data.
  </fund_cons>
  <express-g>
    <imgfile file="contract_schemaexpg1.xml"/>
    <imgfile file="contract_schemaexpg2.xml"/>
  </express-g>
</schema>

Command:

$ stepmod-convert-express-resource resource.xml

Will give output:

== Introduction

The subject of the *contract_schema* is the description of contract agreements.

== Fundamental concerns

Contract information may be attached to any aspect of a product data.

expg_image:contract_schemaexpg1.xml[]
expg_image:contract_schemaexpg2.xml[]

Convertion of all schema history information into independent per-schema YAML files

Command:

$ stepmod-extract-changes -p {stepmod-data-directory}

Examples

Given the following XML

<change version="4">
   <arm.changes>
      <arm.modifications>
         <modified.object type="TYPE" name="ap242_requirement_assignment_item" />
         <!-- ... -->
      </arm.modifications>
   </arm.changes>
   <mim.changes>
      <mim.additions>
         <modified.object type="CONSTANT" name="ap242_shape_representation_reference_types" />
         <!-- ... -->
      </mim.additions>
      <mim.modifications>
         <modified.object type="CONSTANT" name="deprecated_interfaced_data_types" />
         <!-- ... -->
      </mim.modifications>
      <mim.deletions>
         <modified.object type="RULE" name="subtype_mandatory_shape_representation" />
      </mim.deletions>
   </mim.changes>

   <arm_longform.changes>
      <arm.additions>
         <modified.object type="TYPE" name="advanced_face_model" />
         <!-- ... -->
      </arm.additions>
      <arm.modifications>
         <modified.object type="TYPE" name="assembly_constraint_select">
            <description>
               <ul>
                  <li>Remove SELECT value 'ENTITY Binary_assembly_constraint'</li>
               <!-- ... -->
               </ul>
            </description>
         </modified.object>
         <!-- ... -->
      </arm.modifications>
      <arm.deletions>
         <modified.object type="TYPE" name="axis_placement_mapping_source" />
      </arm.deletions>
   </arm_longform.changes>

   <mim_longform.changes>
      <mim.additions>
         <modified.object type="CONSTANT" name="ap242_shape_representation_reference_types" />
      </mim.additions>

      <mim.modifications>
         <modified.object type="CONSTANT" name="deprecated_constructed_data_types">
            <description>
               CONSTANT 'deprecated_constructed_data_types': Expression Changed
            </description>
         </modified.object>
         <!-- ... -->
      </mim.modifications>

      <mim.deletions>
         <modified.object type="TYPE" name="connected_edge_with_length_set_items" />
         <!-- ... -->
      </mim.deletions>
   </mim_longform.changes>

</change>

Will Generate 4 files:

  • arm.changes.yml

  • mim.changes.yml

  • arm_lf.changes.yml

  • mim_lf.changes.yml

arm.changes.yml:

---
schema: Ap242_managed_model_based_3d_engineering_arm
change_edition:
- version: 4
   description:
   modifications:
   - type: TYPE
   name: ap242_requirement_assignment_item

mim.changes.yml:

---
schema: Ap242_managed_model_based_3d_engineering_mim
change_edition:
- version: 4
  description:
  additions:
  - type: CONSTANT
    name: ap242_shape_representation_reference_types
  modifications:
  - type: CONSTANT
    name: deprecated_interfaced_data_types
  deletions:
  - type: RULE
    name: subtype_mandatory_shape_representation

arm_lf.changes.yml:

---
schema: Ap242_managed_model_based_3d_engineering_arm_LF
change_edition:
- version: 4
  description:
  additions:
  - type: TYPE
    name: advanced_face_model
  modifications:
  - type: TYPE
    name: assembly_constraint_select
    descriptions:
    - Remove SELECT value 'ENTITY Binary_assembly_constraint'
  deletions:
  - type: TYPE
    name: axis_placement_mapping_source

mim_lf.changes.yml:

---
schema: Ap242_managed_model_based_3d_engineering_mim_LF
change_edition:
- version: 4
  description:
  additions:
  - type: CONSTANT
    name: ap242_shape_representation_reference_types
  modifications:
  - type: CONSTANT
    name: deprecated_constructed_data_types
    description: |
      CONSTANT 'deprecated_constructed_data_types': Expression Changed
  deletions:
  - type: TYPE
    name: connected_edge_with_length_set_items

Git repository

If the STEPmod repository is a Git repository, term extract will work.

Sample output:

[stepmod-utils] INFO: STEPmod directory set to ../iso-10303-stepmod.
[stepmod-utils] INFO: Detecting paths...
[stepmod-utils] INFO: Processing XML file data/application_protocols/boundary_representation_for_iso_14306_open_jt/application_protocol.xml
[stepmod-utils] INFO: skipped ISO/CD 10303-243 as it is not IS, DIS or TS
[stepmod-utils] INFO: Processing XML file data/application_protocols/configuration_control_3d_design_ed2/application_protocol.xml
[stepmod-utils] INFO: Completed processing XML file data/application_protocols/configuration_control_3d_design_ed2/application_protocol.xml
[stepmod-utils] INFO: Processing XML file data/application_protocols/electronic_assembly_interconnect_and_packaging_design/application_protocol.xml
[stepmod-utils] INFO: skipped ISO/CD 10303-210:2019 as it is not IS, DIS or TS
[stepmod-utils] INFO: Processing XML file data/application_protocols/functional_data_and_their_schematic_representation_for_process_plant/application_protocol.xml
[stepmod-utils] INFO: Completed processing XML file data/application_protocols/functional_data_and_their_schematic_representation_for_process_plant/application_protocol.xml
...