Contents
Introduction
This page presents a toolkit for developing applications which process the contents of a STEP Part 21 file. STEP is an international standard (ISO 10303) for the modelling of information used in manufacturing activities; Part 21 is the component of STEP which standardizes the exchange of this information through a text file. The development tools described here provide for reading Part 21 files and for presenting their contents both for user browsing and for making that information content available as input data to other applications. This development toolkit is based on the method of first translating a STEP Part 21 file into a file of Prolog facts, then using techniques of logic programming implemented by Prolog to process these facts and prepare output as needed. This development system offers the following distinctive features:
-
Allows for a scripting style of application development -- Once the Part 21 to Prolog translation is complete further processing is accomplished in the Prolog environment; and applications can be developed as Prolog scripts. As discussed in this document, Prolog processing allows for concise declarative execution of the often complex navigation among the data entities which make up Part 21 content.
-
Platform neutrality -- The Part 21 to Prolog translation is accomplished by a command line application written in C++; this application is compilable with the widely available gcc compiler. The Prolog interpreter used (SWI-Prolog) is also available for many computing platforms including Windows and the various Unix clan members. At its current stage of development this system does not include GUI (graphic user interface) components, however it is used to produce output as XML files which can be displayed with a variety of standard tools.
-
Schema flexibility -- A Part 21 file conforms to an EXPRESS language schema which defines an information model. For Part 21 files which are exchanged according to one of the application protocols of the STEP standard the schema is the AIM (application interpreted model) of the application protocol. The command line application which translates the Part 21 file into Prolog facts uses a text file of the governing schema in interpreting the Part 21 file; however no additional compilation of the EXPRESS schema is required. Because the several Application Protocols in STEP are built on a common set of building blocks (the "Integrated Resources") a common set of Prolog predicates can be used to process information content over diverse Application Protocols.
Downloads
The source code for the components of this toolkit is freely available and may be reused and redistributed under the terms of the GNU General Public License. Currently available are:
- Downloads of Prolog code demonstrating processing of a file of Prolog facts as converted from a Part 21 file. This code uses standard Prolog language features but was specifically prepared for the freely availabe SWI-Prolog interpreter.
- Availability of C++ source code for the translator, demonstrated below, which produces a file of Prolog facts from the content of a STEP Part 21 file.
Further Discussion
- Why Prolog? - A discussion of the motivation for and advantages of using logic programming to process Part 21 file content.
- Encoding a Part 21 file Describes the Prolog predicates used to define the translated Part files.
Applications
This development system has the design goal of extracting information from a Part 21 file and does not address writing Part 21 files from existing data. This system has been used develop applications which perform these tasks:
- Preparation of XML files from Part 21 files -- This class of applications prepares a XML formatted file which presents a particular view of the information content. Generally the intent was to present a view of the information content which is readily comprehended or interpreted by a user, and the XML file is presented to the user over standard browsing tools using XSLT stylesheets to govern formatting.
- Extraction of information for use by another computer application environment -- This class of application also uses the Prolog processing tools to prepare an XML formatted file, but with the goal of transmitting data to another computing application. An example would be making the information in a Part 21 file available to a program written in Python or Visual Basic, both of which can readily read and parse XML files, while leaving the tasks of parsing the Part 21 file and navigating the information content, to the components of this development system.
-
Sorting and testing of files -- After a Part 21 file has been translated into Prolog facts is it straightforward to develop a Prolog script which tests the information content against a specific condition. This script can be combined with file system tools to perform searches among sets of files for those that satisfy a condition. For example, a repository of Part 21 files can be searched for those that refer to a specified product, or for Part 21 files under STEP AP 238 (covering numerically-controlled machining) which use (or don't use) certain types of machining resources.
Online translation into Prolog
As a demonstration of the use of this development system the user of this page may perform a translation of a STEP Part 21 file into Prolog facts and download the results. This translation may be performed on an example STEP file stored on this server, or on a file uploaded to the server by the user. After translation the user may look at a few "views" of the information content as discussed in application #1 above.
Notes on translation:
-
For translation of an uploaded file or the example file the translation will be performed in real time and a reply in HTML format will be returned. For a successful translation this response will include a link to download the text file containing the translation into Prolog facts. The HTML response contains no frames, JavaScript, plug-in invocations, or any such nonsense.
-
The uploaded file is not stored on the server. For use in preparing the views the Prolog facts file is cached for approximately 24 hours.
-
Time consideration -- both the time to upload the file and translate the file depend on the input Part 21 file size.
As an example, the round trip time to upload (over broadband) and translate a 4 MB text file is of the order of 90 - 120 sec.
-
Schema support -- Currently this system will translate STEP files conforming to STEP AP 203 (configuration controlled design), AP 224, and AP 238. The appropriate schema for a file is determined from the file header information as specified in STEP Part 21 standard. As described above, translation of other application protocols, or EXPRESS schema, is readily provided by making the EXPRESS schema available to the translator; contact me by email at the address above if you would like this added to the online translator.
|