D3.1 Results of the Technology Validation

From S-TEN

Jump to: navigation, search

Contents

[edit] 1 Foreword

This document has been developed in a collaborative approach using the www.MediaWiki.org software running at the internal S-TEN website at www.s-ten.net. The MediaWiki software is known as the underlying platform for the famous www.Wikipedia.org site. The printable version of this document was compiled from individual pages by following guidelines from www.WikiBooks.org.

Organizations and persons in charge of this document together with their main responsibilities:

  • CAESAR
    • David Leal for the strategy on how to derive ontologies from STEP data models
  • FGH
    • Bernhard Schowe-von der Brelie for the quality review
  • LKBALTIC
    • Giedrius Liutkus for the SPARQL mapping and getting all working together
    • Vaidas Nargelas for the Jena - JSDAI link
  • LKSOFT
    • Lothar Klein for the core STEP data model, example and use cases

[edit] 1.1 Changes made for the second edition

Bugs have been fixed for these annexes:

11.4 STEP-derived Ontology used for the technical validation

  • In line <owl:intersectionOf rdf:parseType="Collection"/> the trailing "/" had been removed

11.7 Resulting STEP-OWL dataset

  • In line
    <!ENTITY step "http://www.s-ten.net/d3_1_basic_step_ontology.owl#
    a trailing ">" was missing
  • Two times <iso1000:meter_scale> has been replaced by <iso1000:metre_scale>

A new annex have been added due to comments from reviewers

  • 11.11 Example XSLT coversion from STEP to OWL

[edit] 2 Executive summary

For a core subset of STEP data-models, common to several STEP Application Protocols, a corresponding STEP-Ontology on the basis of OWL has been derived. The derived ontology is not a syntactical one-to-one mapping of the STEP data model but is a semantically and logically enriched model beyond what is explicitly defined in STEP. Because of this not every possible detail in STEP is preserved in OWL, but on the other hand the result of this work can lead to an improvement of STEP in future.

When converting from a STEP-File (p21) or a STEP-XML (p28) dataset to OWL the instance identifier are used as names (rdf.id) for the created classes and individuals. However the instance identifiers are not globally unique and when generating the same STEP dataset again there will be likely new instance identifiers for the same concepts. This makes it difficult to convert data back from OWL to STEP.

However in the case of a STEP database with an SDAI (p22) interface the instances identifiers change into persistent labels. Now it is possible to convert a STEP data-set into OWL and some time later to receive new OWL statements referring to the persistent identifiers. This is the basis of entering new data into a STEP database via OWL and to merge it with the data already present there without having the need to develop special converter and merging algorithm as it was e.g. done in the European funded IDA-STEP project (year 2000 to 2004).

The refined and extended goal of workpackage 3 is now to build up a STEP-database which can be queried and enhanced through the Semantic web. This means that internally data is stored according to STEP and bi-directional access to the data is realized with an OWL based semantic web services.

The current draft implementations are based on the JSDAI API from LKSoft for the STEP side and on the JENA framework and its SPARQL engine on the OWL/RDF side. Testing is done with an artificial hand-made example using all basic STEP elements. The data is converted from STEP to OWL and also from OWL to STEP. In addition we show how new data referencing existing data can be written back into a STEP database.

The STEP-Ontology together with the provided example are intended to become publicly available on the S-TEN web-site and will be presented on international conferences. The implementation details however will remain confidential know how of the consortium.


[edit] 3 Introduction

The purpose of this deliverable D3.1 is to report the results of Task 3.2 "Technological Validation" within WP3 "Linking with Design and Maintenance Knowledge" of the S-TEN project.

This task investigates the creation of an ontology from STEP (ISO 10303) which enables design data to be recorded using RDF/OWL. Ultimately the ontology derived from STEP will be integrated with other ontologies, as shown in the figure below.

Image:ontology_hierarchy.gif

The integration is not specified in this deliverable because it depends upon the top of the hierarchy, which is still being defined within task 2.1. The integration with the top of the hierachy will be specified within deliverable D3.2 "Methodology for deriving ontologies from information models".

[edit] 3.1 Excerpt from the Description of Work, WP3

Enabling seamless data exchange in both directions between STEP and OWL. This includes offering STEP design data available in a STEP database as OWL services and also being able to record actual OWL datasets in a STEP database. ... This will also allow to directly link design data with maintenance data in a STEP database using AP239.

The overall goal of WP3 is to make STEP data available to the OWL world and to merge OWL data back into STEP. From the current perspective we see that it makes most sense

  • to publish detailed design data, based on AP203/210/212/214, in OWL so that it can be used and referenced by other OWL devices, and
  • to collect actual configuration and maintenance data available in the OWL world in a STEP database using AP239 (PLCS) and to visualize it from there.

[edit] 3.2 Details for task 3.2 from DOW

In the task description 3.2 the following objects for D3.1 are defined:

  • creating and testing basic technology for linking STEP and OWL for a limited, small area of a selected STEP AP and a corresponding OWL representation.
  • developing early draft ontology for the limited STEP area.
  • developing basic software tools to demonstrate the feasibility of data exchanges, both from
    • STEP to OWL and from
    • OWL to STEP.

And it ends with: "The experiences and results gained in this task will be an important basis for the following, main tasks of WP3."

Because of this D3.1 contains draft results for the later deliverables in this workpackage:

  • D3.2 "Methodology for deriving ontologies from information models (initial version in month 16, final version in month 20)"
  • D3.3 "Ontologies derived from STEP data models (basis for possible standardization, covering major part of AP203, AP210, initial version in month 16, final version in month 20)"
  • D3.4 "Software prototype to convert STEP data to OWL and offering it to the web (month 30)"
  • D3.5 "Software prototype to convert OWL data to STEP and merging in with already existing STEP data (month 30)"

In addition this delivery is documenting how the milestone

  • MS3.1 "Technology validation completed (month 10). At this milestone, the basis for the further technology development in WP3 is available."

is achieved.


[edit] 4 Syntax based Express to OWL conversion

A first attempt to create ontologies from EXPRESS schemas was realized by an automatic translation tool on a pure syntactical basis. For this the functionality of the JSDAI toolkit is used. First the one or several EXPRESS schemas are compiled and a so called SDAI dictionary data is created. The Java application ExpressToOWL takes the SDAI-dictionary data as input and generate OWL ontologies out of it. Below you will find the specification how STEP elements are converted to OWL by this tool.

In the further progress of Task 3.1 the result of this tool was not used, because all the work was then based on carefully manually created ontologies. However when expanding the core concepts developed in D3.1 to bigger areas of STEP we likely will come back to this tool.

[edit] 4.1 Schema conversion

EXPRESS schema is converted to OWL ontology. OWL ontology assigned base URL in a form of

http://jsdai.net/express/schema_name

where schema_name is lowercased EXPRESS schema name.

Schema_definition is converted to Ontology. Ontology has imports attributes if schema imports declarations from other schemas; Label property is added also if schema identification is available.

[edit] 4.2 Entity conversion

Entity_definitions are converted to OWL Classes. Entity name is converted to OWL class id following these rules: First letter character is converted to upper case. All other letters that are preceded by underscore are not the first letter character in the name are converted to upper case and preceding underscore is removed. The rest of characters are coverted to lower case.

Complex entity_definitions (which have complex=.TRUE.) are skipped during conversion.

[edit] 4.3 Attribute conversion

Explicit_attributes and Inverse_attributes are converted OWL Properties.

Attributes and properties have some differences in scoping. Express attribute is local to the entity but property is global and has unique id in the ontology. The conversion makes joins attributes with the same name in the schema to single property if this makes no conflicts. Property id consists of base part optionally folowed by some extra sections separated by dash.

Attribute name is converted to OWL property id base part following these rules: All letters that are preceded by underscore and are not the first letter character in the name are converted to upper case and preceding underscore is removed. The rest of characters are coverted to lower case.

To ensure uniqueness and avoid name conflicts the following sections can be appended:

  • Inverting attribute name if this is inverted attribute
  • Redeclaring attribute id if this is redeclared attribute
  • Attribute domain id

Attribute parent entity is tagged as range and attribute domain is tagged as domain. Redeclared attributes are tagged as subPropertyOf redeclaring attribute. Inverse attributes are tagged with inverseOf. If attribute has a domain which is not aggregate then attribute is tagged as functional property.

[edit] 4.4 Defined type conversion

Defined_types are converted to OWL Classes.

Type name is converted to OWL class id following these rules:

All letter characters in the name are converted to upper case. If the name consists of less than 1 letter character the id is prefixed with "TYPE-".

[edit] 4.5 Data type conversion

Simple_types are converted to XSD data types: Integer_type to xsd:int Number_type to xsd:double Real_type to xsd:double Boolean_type to xsd:boolean Logical_type to xsd:NMTOKEN Binary_type to xsd.hexBinary String_type to xsd:string

If defined type is simple type then is is tagged as subClassOf simple type.

Aggregation_type is skipped but it affect containing property by not tagging it as functional property.

Selects is converted by making all selection classes subClassOf owning type. Extending selects of extensible selects are tagged as subClassesOf based on select.

Enumerations are converted to owning type enumerated class using owl:oneOf. Enumeration individuals are assigned id which is constructed by type name separed by dash and by adding enumeration name.

[edit] 4.6 Not (yet) converted elements and open issues

  • Optional/mandatory attribute information is not converted. It can be converted to minCardinality restriction at parent entity (class).
  • Aggregate bounds are not converted. They can be tagged with minCardinality/maxCardinality
  • The cases then the same entity is mentioned is several concurrent types is not expressable. The example of this is list_representation_item and set_representation_item in representation_schema. RepresentationItem class is subclass of both LIST_REPRESENTATION_ITEM and SET_REPRESENTATION_ITEM and there is no way to make the distinction between these types.
  • The information about abstract classes is lost. It is not yet clear how to describe abstract class in OWL.
  • If defined type can be a subclass of XSD type. This may not be acceptable is some circumstances.

[edit] 4.7 Further steps

The addition knowledge should be provided to ensure higher conversion quality. The most obvious enhancement would be to provide additional logic for combining many attributes into single property because unique and unified properties are the strength of OWL. The properties that span EXPRESS shemas should be created. In addition some attributes may already be defined in other available OWL ontologies and in these cases references to existing properties in the global OWL space should be used insted of creating STEPwise local properties. In addition extra steps have to be made to solve attribute name conflicts to avoid adding extra sections to property ids. Linking entities (classes) with other classes in OWL ontology space is not viewed as important as linking attributes (properties) to other OWL ontology properties by the author of this work.


[edit] 5 Requirements for STEP-OWL mapping language

This clause explains the basic structure of STEP and the semantics covered by it. Then basic requirements for a translation to OWL are defined and finally possible ways how to implement a converter are considered.

[edit] 5.1 Basic STEP structure and covered semantics

The semantics of STEP is covered by

  • application activity models (AAM) to provided an aid to understanding the scope and information requirements defined in application protocols, using the functional modelling language IDEF0
  • EXPRESS based data models, defining formal data-types and constraints. This is split in several hierarchies and layers, see below.
  • textual definitions
  • mapping between the EXPRESS data models ARM and AIM/MIM, see below
  • recommended practises

The EXPRESS modelling language is used at different levels which are build on each other:

  1. Integrated resources (IR) which are divided into
    1. Integrated generic resources in the 40 and 50 series
    2. Integrated application resources in the 100 series
  2. Application interpreted constructs (AIC) in the 500 series
  3. STEP modules (1000 series) and traditional non-modularized STEP APs (200 series). At this level we have to deal with two data-models in parallel:
    1. the Application Reference Model (ARM) which covers the specific application oriented aspects
    2. the Application Interpreted Model (AIM) for APs respectively Module Interpreted Module (MIM)for the modules. This is what has to be implemented by conforming applications.
    3. These two models are mapped to each other using a special mapping syntax. See clause 5.1 in APs and modules. The mapping is often rather complex and contain semantic as well.

It should be noted here that super-types and attributes e.g. relations must be introduced by the IRs only. The AICs, modules and APs are only allowed to constrain things further by global and local rules in subtypes.

[edit] 5.2 STEP ARM to MIM/AIM/AIC/IR mapping

The data-model of STEP APs and modules consist of two EXPRESS defined data models the Application Reference Model (ARM) and the Application Interpreted Model (AIM) for APs respectively the Module Interpreted Module (MIM) for modules and a mapping specification between them. For the data conversion all this tree elements ARM, AIM/MIM and mapping have to be taken care. In some areas such a geometry the IR is pretty sufficient. In other areas such a extended product structures things are only clear from the ARM. The mapping links both EXPRESS data models together.

For the purpose of creating ontologies and mapping STEP data to OWL we have to decide which element to take from the ARM and which from the AIM. LKSOFT and LKBALTIC decided to base the development on their proprietary XIM schemas because here ARM and MIM (for modules and AP214) are already merged together. In addition the XIM contains are further specialised ARM concepts (super-ARM) for particular usages, e.g. there is a specialised Organization_person_in_organization_assignment in the role id_owner. These concepts are directly mapped to OWL and so using the XIM schemas and related software simplifies the translation between OWL and STEP significantly.

[edit] 5.3 Requirements for the transformation language:

[edit] 5.3.1 Open versus closed world

What is means:

  • Closed world
    • It is assumed that all that is recorded is all that there is.
    • If it is only recorded that A is connected to B and A is connected to C, then it is assumed that A is not connected to D.
  • Open world
    • It is assumed that what is recorded may be only part of what there is.
    • To make is clear that A is not connected to D, it must be recorded that the set of all things to which A is connected is {B, C}.

Why it is relevant:

  • The closed world assumption is suitable for exchange
    • The 'world' is defined by the exchange file
    • ISO 10303 relies partly upon a closed world assumption
  • The closed world assumption can be made to work for a data warehouse
    • This requires the enforcement of procedures for the loading of data into the data warehouse
    • ISO 15926-2 relies upon a close world assumption
  • Data on the Web is an open world
    • An intra-net can be regarded as a data warehouse
    • OWL assumes an open world
    • There is nothing implicit – if we have closure then this must be stated

Requirement: Define which entities/relations define an open or closed world concept. By default OWL is open world environment. E.g. we may have only one version for a particular product, but there may be other version of the products somewhere around. On the other hand we assume that all property_definition and next_assembly_usage_occurrence (NAUO) for a product_definition are completely available. By this a product_definition is nothing else but the collection of its properties and NAUOs. This interpretation is in accordance with the definition in part 41 of STEP.

[edit] 5.3.2 Entity attributes defining rdfs:subClassOf or rdf:type

Specify which relation is taken as a member-of or subclass of. E.g. the attribute of_product of a Part_version is a subclass of Part. On the other hand a Product_as_individual_version may be a member of a Part_version.

[edit] 5.3.3 Too generic supertypes used in STEP

Too often STEP requires to use a supertpye of an entity in one case and to use specialised subtypes in other cases. For the first case specialised subtypes had to be taken as well. STEP is unable to fix such glitches because of upward-compatible issues. However when deriving an OWL ontology from STEP we have the chance to do things right from the beginning on. Example is representation_relationship_with_transformation which is originally defined as non-directed concept, but which is used in the case of assemblies as a definition concepts (the one representation takes part in the definition of the other representation).

[edit] 5.3.4 Supertype entities to be suppressed

Some supertype entities from STEP are not going to be represented in OWL at all. Example is the generic "product", both IR/MIM and ARM. We only represent specializations such as Part and Document.

[edit] 5.3.5 Generic attributes on supertypes

Rather often the supertype offers a generic set of string attributes such as id, name, description, role, but then for subtypes on the ARM level these attributes are no longer available because they are occupied by the mapping. Again there is a problem when these attributes are used for the supertype, but then are no longer available for the subtype. Example shape_aspect.name.

In addition often string attribute values are left blank (empty string) or are set to "/NULL" which indicate that the sending system has no value for them. These cases should not be translated to the OWL world.

[edit] 5.3.6 Invisible entities in ARM to MIM/AIM mapping

The ARM to AIM mapping sometimes require additional or dummy entities to populate, which have no semantic meaning. These entities should be eliminated when transforming the data to the OWL world (and needs to be added when translating data from OWL to the STEP world). Examples are simple properties such as weight which require a property_definition and a measure_with_unit and not needed intermediate property_definition_representation, representation, representation_context.

[edit] 5.3.7 Individual or Class

STEP does not say whether instances of entities define a class or some individual piece of information. So when creating STEP ontologies we have to add this additional semantic. E.g. instances of Part/Part_version are classes while instances of Product_as_individual/_version are individuals in the OWL sense.

[edit] 5.3.8 Attribute "name" and Multi linguism

The functionality provided by

 ISO/TS 10303-1105:2004 Multi linguism

or the equilvalent constructs in AP214 have to be mapped to the "xml:lang" functionality available in OWL. E.g. for the multi-lingual name of a product we may use something similar to this:

 <owl:Class rdf:ID="Wine"> 
   <rdfs:subClassOf rdf:resource="&food;PotableLiquid"/> 
   <rdfs:label xml:lang="en">wine</rdfs:label> 
   <rdfs:label xml:lang="fr">vin</rdfs:label> 

Here the product is given two names, "wine" for English and "vin" for France. Note that we are likely going to skip the name of the attribute, in this case "product.name".

[edit] 5.4 Possible strategies for mapping data between STEP and OWL

In this clause we investigate which formal language to use for mapping STEP data to OWL. The chosen language must be able to support the requirements listed above.

[edit] 5.4.1 A theoretical approach using AIM/MIM and XSLT

One theoretical approach to transform STEP data to OWL would be as follows:

  • convert the AIM/MIM schema(s) on a pure syntactical level into equivalent RDF triples
  • convert STEP data on the AIM/MIM level into equivalent RDF triples based on the schema-RDF given above.
  • Construct a static XSLT file wrapping up all the STEP semantics and run it on the RDF data-sets to produce good quality OWL for the STEP schemas and STEP data.

This approach would be nice from a standardisation point of view, but we have doubts that it would be practical useful. In a programming language there are many ways to tune execution speed and memory consumption. With XSLT this is very restricted. With big datasets XML+XSLT becomes typically very slow.

[edit] 5.4.2 Using the STEP ARM-AIM/MIM mapping approach

The mapping syntax used in STEP to relate the ARM model with the AIM/MIM model is in principle suitable to follow any graph or pattern. LKSOFT and LKBALTIC have developed a bigger software package to take advantage to the mapping syntax and so it was considered to use the STEP to OWL task as well.

This approach would require to have an Express schema for the resulting STEP ontology which we don't have. Also EXPRESS has no explicit support to support more than two levels of information. It has only entities which are a kind of class definitions and instances for these classes which are a kind of OWL individual. But it has not a concept of class-of-class which we need for the mapping to OWL.

[edit] 5.4.3 EXPRESS-X

Another approach is to define more semantically rich EXPRESS data models which are more closer to OWL and use EXPRESS-X (ISO 10303-14) to map from AIM/MIM to these new data-models. The ARM is not direct suitable for this because it is in too many places to close to the AIM/MIM. In addition this approach has the same problem as the STEP ARM-AIM/MIM approach explained above.

[edit] 5.4.4 Using a directly programmed translator based on JSDAI

JSDAI is a fully standard based implementation of STEP. And the used programming language Java is a de-facto standard anyway. A translator using JSDAI can take advantage of the rich API functionality and use all kinds of Java resources to realize an optimal conversion process.

Another main advantage of using JSDAI is that it provides a meta-repressentation of the used Express schemas in the form of the sdai-dictionary data. This data is created with the JSDAI Express compiler and is made available to an JSDAI application like any other application data. The only difference is that it is in real-only mode while application data can be modified (read-write mode). Processing dictionary data is very much simpler than parsing EXPRESS schemas. So an JSDAI application can easily use application data and meta/dictionary data together in parallel.

For the linkage to OWL we investigated the Jena API which is also Java based. This lead us to the next approach below.

[edit] 5.4.5 SPARQL + JSDAI XIM technology

The deliverables D1.1 and D1.2 list SPARQL as one of the candidates for the overall S-TEN architecture. While experimenting with SPARQL and comparing it with the STEP ARM-MIM mapping language and the JSDAI-Query language we figured out that it is also possible to use it for mapping purposes.

So the approach we finally chose for D3.1 is as follows:

  • use JSDAI to import a STEP-File on the AIM/MIM level
  • use the JSDAI XIM software to translate the AIM/MIM data to the XIM level
  • convert the XIM data into STEP-RDF triples using Jena
  • use SPARQL to convert STEP-RDF triples into STEP-OWL datasets

The same sequence in opposite direction is used to translate data from STEP-OWL to STEP-FILE, however using different Java and SPARQL code.

It will be possible to extend this approach so that it it can not only be used with STEP-files but also with STEP-databases, which are build on top of the JSDAI-DB technology. Here the internal structure will also be organised according to the XIM schema to this would fit ideally together.


[edit] 6 Core STEP data model and reference example

Below you can see an extract of STEP data models to be used for the technical validation. The models are defined in STEP modules and integrated resources (IR) and are common for the modular APs:

  • AP203 - Configuration controlled 3D design, TS and upcoming ed2 version
  • AP210 - Electronic assembly, interconnect and packaging design
  • AP236 - Furniture product data and project data
  • AP239 - Product life cycle support

In addition it is also applicable for

  • AP212 - Electrotechnical design and installation
  • AP214 - Core data for automotive mechanical design processes

and other APs on the AIM level. These APs have different ARM definitions.

We consider this extracted model as a core throughout most STEP-APs. So by supporting this model in OWL means all listed APs are supported in the STEP-OWL mapping.

[edit] 6.1 Graphical presentation of used entities (Express-G)

The extracted model is a mixture of ARM and IR/MIM entities. ARM entities start with a capital letter and cover the product management area. AIM entities on the other hand start with lower case letters and are used here for the property and representation area. Please be aware that in a STEP-File you'll find only IR/MIM entities. All ARM entities are mapped to the IR/MIM in the STEP modules. We will refer to this mapping as needed.

Only entity attributes which relates to other entities are shown. All string attributes are suppressed, otherwise the diagram would be hardly readable. Several intermediate select datatypes are suppressed as well. For complex sub-supertype trees Part_view_definition and Part_view_definition_relationship) only some essential datatypes are shown.

image:STEP_data_model_extract.PNG

[edit] 6.2 Example STEP-File

ISO-10303-21;
HEADER;
FILE_DESCRIPTION(
/* description */ ('Example for S-TEN project, D3.1 - Technological validation'),
/* implementation_level */ '2;1');
FILE_NAME(
/* name */ 'S-TEN_D31_example-1',
/* time_stamp */ '2007-01-04T18:10:41',
/* author */ ('Lothar Klein'),
/* organization */ ('LKSoft'),
/* preprocessor_version */ ' ',
/* originating_system */ 'IDA-STEP v1.4.3 build20051027-1703',
/* authorization */ 'Lothar Klein');
FILE_SCHEMA(('AUTOMOTIVE_DESIGN'));
ENDSEC;
DATA;
/* Person and Organization data */
#100=ORGANIZATION('VW','Volkswagen','company');
#101=PERSON('A0001','Doe','John',$,$,$);
#102=PERSON_AND_ORGANIZATION(#101,#100);
#103=NAME_ATTRIBUTE('technical director',#102);
#104=APPLIED_ORGANIZATION_ASSIGNMENT(#100,#105,(#310,#320));
#105=ORGANIZATION_ROLE('id owner');

/* Product specification */
#200=APPLICATION_CONTEXT(' ');
#201=PRODUCT_CONCEPT_CONTEXT('German car market',#200,' ');
#202=PRODUCT_CLASS('pc1','VW Beetle',' ',#201,'',$);
#203=PRODUCT_CLASS('pc2','VW Beetle CD',' ',#201,'',$);
#204=PRODUCT_CONCEPT_RELATIONSHIP('hierarchy',' ',#202,#203);
#220=CONFIGURATION_ITEM('pi1','VW Beetle \X2\2013\X0\ S_101',
                        '1200cc, sunroof, red paint, leather seats',#203,$);
#230=CONFIGURATION_DESIGN(#220,#311);
#231=NAME_ATTRIBUTE('product design',#230);

/* Parts general */
#300=APPLICATION_PROTOCOL_DEFINITION(' ','automotive_design',2007,#301);
#301=APPLICATION_CONTEXT('mechanical design');
#302=PRODUCT_CONTEXT(' ',#301,' ');
#303=PRODUCT_DEFINITION_CONTEXT('part definition',#301,'design');
#304=PRODUCT_DEFINITION_CONTEXT('assembly definition',#301,' ');
#305=PRODUCT_DEFINITION_CONTEXT_ROLE('part definition type',$);
#308=PRODUCT_RELATED_PRODUCT_CATEGORY('part',$,(#310,#320));
#309=PRODUCT_RELATED_PRODUCT_CATEGORY('assembly',$,(#310));

/* Part A0001 */
#310=PRODUCT('A0001','VW Beetle \X2\2013\X0\ P_101',$,(#302));
#311=PRODUCT_DEFINITION_FORMATION('1',$,#310);
#312=PRODUCT_DEFINITION('1',$,#311,#303);
#313=PRODUCT_DEFINITION_CONTEXT_ASSOCIATION(#312,#304,#305);
#314=PRODUCT_DEFINITION('2',$,#311,#303);

/* Part A0002 */
#320=PRODUCT('A0002','Engine-4/50KW-BX',$,(#302));
#321=PRODUCT_DEFINITION_FORMATION('1',$,#320);
#322=PRODUCT_DEFINITION('1',$,#321,#303);
#323=PRODUCT_DEFINITION_FORMATION('v2',$,#320);
#324=PRODUCT_DEFINITION('1',$,#323,#303);
#325=PRODUCT_DEFINITION_FORMATION_RELATIONSHIP(' ','sequence',$,#321,#323);

/* Assembly */
#400=NEXT_ASSEMBLY_USAGE_OCCURRENCE('SI0001',' ',$,#312,#322,$);
#401=PRODUCT_DEFINITION_OCCURRENCE_RELATIONSHIP(' ',$,#402,#400);
#402=PRODUCT_DEFINITION('SI0001',$,#321,#404);
#403=PRODUCT_DEFINITION_USAGE(' ','definition usage',$,#322,#402);
#404=PRODUCT_DEFINITION_CONTEXT('part occurrence',#301,' ');

/* Properties */
#500=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT($,.METRE.));
#501=(MASS_UNIT()NAMED_UNIT(*)SI_UNIT(.KILO.,.GRAM.));

/* Property "overall length" */
#510=GENERAL_PROPERTY('','Overall length',$);
#511=GENERAL_PROPERTY_ASSOCIATION(' ',$,#510,#512);
#512=PROPERTY_DEFINITION('Overall length',$,#314);
#513=PROPERTY_DEFINITION_REPRESENTATION(#512,#515);
#514=REPRESENTATION_CONTEXT(' ',' ');
#515=REPRESENTATION(' ',(#516),#514);
#516=(LENGTH_MEASURE_WITH_UNIT()MEASURE_REPRESENTATION_ITEM()
      MEASURE_WITH_UNIT(LENGTH_MEASURE(4.5),#500)REPRESENTATION_ITEM(' '));

/* Property "mass when empty" */
#520=GENERAL_PROPERTY('','mass when empty',$);
#521=GENERAL_PROPERTY_ASSOCIATION(' ',$,#520,#522);
#522=PROPERTY_DEFINITION('mass when empty',$,#314);
#523=PROPERTY_DEFINITION_REPRESENTATION(#522,#525);
#524=REPRESENTATION_CONTEXT(' ',' ');
#525=REPRESENTATION(' ',(#526),#524);
#526=(MASS_MEASURE_WITH_UNIT()MEASURE_REPRESENTATION_ITEM()
      MEASURE_WITH_UNIT(MASS_MEASURE(750),#501)REPRESENTATION_ITEM(' '));

/* Rental car classification */
#600=CLASS_SYSTEM('Rental Car System',' ');
#601=CLASSIFICATION_ROLE('class system membership',$);
#602=APPLIED_CLASSIFICATION_ASSIGNMENT(#600,#601,(#610));
#610=CLASS('Bighorn car rental \X2\2013\X0\ B_101','compact, 2 door, 4 person, 2 luggage items');
#611=CLASSIFICATION_ROLE(' ',$);
#612=APPLIED_CLASSIFICATION_ASSIGNMENT(#610,#611,(#310));
#613=ID_ATTRIBUTE('Bighorn car rental',#610); 

/* Product_as_individual */
#701=PRODUCT_DEFINITION_CONTEXT('physical occurrence',#301,' ');
#702=PRODUCT_RELATED_PRODUCT_CATEGORY('physically realized product',$,(#710,#780,#790));

/* Here the original state of my car as it was delivered with the original engine */
#710=PRODUCT('ABX123456789','my car',$,(#302));
#711=PRODUCT_DEFINITION_FORMATION('as-delivered',$,#710);
#712=PRODUCT_DEFINITION('1',$,#711,#701);
#713=PRODUCT_DEFINITION_RELATIONSHIP(' ','physical realization',$,#312,#712);
#714=ASSEMBLY_COMPONENT_USAGE(' ','physical occurrence usage',$,#712,#782, ' ');
#715=PRODUCT_DEFINITION_OCCURRENCE_RELATIONSHIP('physical realization',$,#402,#714); 

/* The state after my car got a new engine. Now it no longer fits with the original state */
#721=PRODUCT_DEFINITION_FORMATION('after engine replacement',$,#710);
#722=PRODUCT_DEFINITION('1',$,#721,#701);
#724=ASSEMBLY_COMPONENT_USAGE(' ','physical occurrence usage',$,#722,#792, ' ');
#725=PRODUCT_DEFINITION_OCCURRENCE_RELATIONSHIP('physical realization',$,#402,#724);

#780=PRODUCT('STU4567890123',' ',$,(#302));
#781=PRODUCT_DEFINITION_FORMATION('1',$,#780);
#782=PRODUCT_DEFINITION('1',$,#781,#701);
#783=PRODUCT_DEFINITION_RELATIONSHIP(' ','physical realization',$,#322,#782);

#790=PRODUCT('XYZ987654321 ',' ',$,(#302));
#791=PRODUCT_DEFINITION_FORMATION('1',$,#790);
#792=PRODUCT_DEFINITION('1',$,#791,#701);
#793=PRODUCT_DEFINITION_RELATIONSHIP(' ','physical realization',$,#324,#792);

/* Property "mass when empty" */
#821=GENERAL_PROPERTY_ASSOCIATION(' ',$,#520,#822);
#822=PROPERTY_DEFINITION('mass when empty',$,#722);
#823=PROPERTY_DEFINITION_REPRESENTATION(#822,#825);
#824=REPRESENTATION_CONTEXT(' ',' ');
#825=REPRESENTATION(' ',(#826),#824);
#826=(MASS_MEASURE_WITH_UNIT()MEASURE_REPRESENTATION_ITEM()
      MEASURE_WITH_UNIT(MASS_MEASURE(868),#501)REPRESENTATION_ITEM(' '));

ENDSEC;
END-ISO-10303-21;

[edit] 6.3 Walk through the data-model along the given example

The core of the example was created with the application IDA-STEP Center. The following screenshot shows the root-tree listing most of the elements and an info-page for Part_view_definition (Item-instance in AP214) with the properties.

image:IDA-STEP_screenshot_root-tree.PNG

[edit] 6.3.1 Product specification

There is a small hierarchy of two Product_classes, "pc1, VW Beetle" and the more specific CD one "pc2, VW Beetle CD". For pc2 a Product_configuration (= Product_identification in AP214) "pi1, VW Beetle – S_101" is defined. It has a description saying "1200cc, sunroof, red paint, leather seats". This should be covered by instances of Specification and Specification_category, but they are not (yet) available in IDA-STEP Center, used to create this example. So for now we go with Product_concept and Product_configuration, knowing that it should be Product_class and Product_specification respectively. The Product_configuration "pi1" is then assigned a design which is the Part_version "1" of Part "VW Beetle – P_101, A0001".

[edit] 6.3.2 Parts, assembly and properties

This example comes with two example parts, "VW Beetle – P_101, A0001" and "Engine-4/50KW-BX, A0002".

The engine A0002 is available in the two versions "1" and "A". A relationship between these versions tell us that "A" is the successor of "1". Each version has a design view so that it can be used as a component in a higher level assembly, but there are no further properties defined for these versions.

image:IDA-STEP_screenshot_assembly-tree.PNG

The VW Beetle A001 has one version only but this one has two views "1" and "2". View "1" is an assembly view (see screenshot above) and there is exactly one component (Definition_based_part_occurrence) "SI0001" which is of type "Engine-4/50KW-BX, A0002". View "2" is a view with specification properties and there are two properties defined here, an "Overall length" of 4.5m and a "mass when empty" of 750 Kg.

The instance pattern to be used for even simple properties is quite complex. First we need to define the units, here these are SI unit for "metre" (m) and for "kilogram" (Kg). A particular value is given by instances of measure_representation_items which have to be combined with the base quantities length_measure_with_unit and mass_measure_with_unit. Because a measure_representation_items is a subtype of representation_item it has to be "founded" in a representation_context via a representation. For simple properties the representation_context has no particular semantic, so it has empty string values. The representation is then related to the property_definition which links to the products/parts. In addition we have to say that "overall length" and "mass when empty" are stand-alone concepts which can in principle be re-used many times. This is covered by general_property and general_property_association.

[edit] 6.3.3 Classification

A Classification_system for a "Rental Car System" system is defined. For now it has only one class "Bighorn car rental – B_101". The part A0001 is defined to be a member of this class.

[edit] 6.3.4 Physical individual

Lets have a particular car with the serial number in the vehicle identification number (= chassis number) ABX123456789 and which is of type "VW Beetle – P_101, A0001" and it has an engine with the identification number STU4567890123 which is of type Engine-4/50KW-BX, A0002 version 1. Later the engine is replaced by another one with the identification number XYZ987654321 which is of type "Engine-4/50KW-BX, A0002" version 2. With the new engine to car weight is measured to be 868 Kg.

[edit] 6.4 Validation of the STEP example and observed problems

During the creation and validation of the example STEP file a couple of problems show up which require some extension and fixes of the standard.

[edit] 6.4.1 SEDS 1195: Mapping of Product_as_individual not harmonized with AP214

Part and Clause where Issue Originates: ISO/TS 10303-1164:2004 Product as individual

Other Parts Affected by the Issue: -

Related Issues: -

Summary/Abstract/Keywords: Mapping is not harmonized with AP214

Problem Description: (A) A Product_as_individual_view (ARM) is equivalent to Physical_individual in the AP214 ARM. Unfortunately the mapping is totally different and I would consider even invalid. To my knowledge there is no other place in STEP where we create subtypes of product on the MIM/AIM level. Instead the kind of product is always defined by a product_related_product_category. Because the known implementations of AP239 and 236 are so far only on the ARM level it should not make any problem to fix and align the mapping and AIM with AP214.

(B) A further problem is that Product_design_version_to_individual is neither on the ARM nor on the MIM compatible with AP214 Physical_instance.is_realization_of.

B1: In AP214 the link is done via a product_definition_relationship while in the module is a product_definition_formation_relationship

B2: In AP214 the Physical_instance can only be related to either a Design_discipline_item_definition or to Product_identification while the modules allow any kind of Product_version.

B3: Both Product_design_to_individual and Product_design_version_to_individual are semantically rather week concepts. The definition is rather week and so a receiving system can't deduce that e.g. properties defined for the design (Part, Part_version) are also valid for the Product_as_individual/_version. For Physical_instance.is_realization_of a more rich semantic is defined by "... that collects the information defining the Physical_instance". So a receiving system can deduce that the properties defined for a part_view_definition/Design_disciple_item_definition are also valid for the Physical_instance_view and _version.

Conditions Under Which the Issue Was Discovered: Implementing parts of AP239 on the normative MIM level.

Proposed Solution (Optional): 1) Change the mapping of Product_as_individual to

 product
 {product <- product_related_product_category.products[i]
 product_related_product_category <= product_category
 product_category.name='physically realized product'}

and remove the mim subtype product_as_individual.

2) Remove the mim subtype product_as_individual_version and map the ARM entity Product_as_individual_version to product_definition_formation only.

3) For AP214 a "Physical_instance is the denomination of a physically realized object". To be in sync with the older AP214 we have consequently to remove the MIM subtype product_as_realized and use the generic supertype product_definition_formation instead. But AP214 don't know a Product_as_planned. So we can keep the more specific MIM subtype product_as_planned <= product_definition_formation (change/update supertype only).

4) To solve the problem (B) we propose to keep the current product_design_to_individual and product_design_version_to_individual for both ARM and MIM but to update the mapping according to the topics above and to restrict the attributes product_design and product_design_version to be of type Part and Part_version respectively.

5) In addition we must introduce the AP214 equivalent of physical_instance.is_realization_of as a new ARM entity. Proposal:

 TYPE part_view_definition_or_product_configuration = SELECT
   (Part_view_definition, Product_configuration)
 END_TYPE;
 
 ENTITY Product_as_individual_view_realization;
   product_design : part_view_definition_or_product_configuration;
   individual_product : Product_as_individual_view;
 UNIQUE
   ur1 : individual_product;
 WHERE
   wr1 : xxx;
 END_ENTITY;

ur1 is to ensure that there can be at most one Product_as_individual_view_realization for a Product_as_individual_view. wr1 is to ensure that there are no product_design_to_individual and product_design_version_to_individual for the Product_as_individual_view referenced by individual_product.

Description: A Product_as_individual_view_realization relates a Part_view_definition or a Product_configuration that collects information to a defining Product_as_individual_view. In the case of a Part_view_definition all Assigned_attributes and the Item_shape if available are stated to be valid also for the Part_view_definition. In the case of a Product_configuration the information is given by the Specification if the subtype product_specification is used and by the Assigned_properties for the reference Product_concept if the subtype product_class is used.

Note: For Product_design_to_individual and Product_design_version_to_individual a receiving system can't be deduce the validity of any Assigned_property or Item_shape for the individual_product/_version.

This new entity might also be placed in a new module together with entities corresponding to the AP214 entities physical_assembly_relationship and physical_instance_test_result.


Additional Comment #1 From Lothar Klein 2007-01-30 07:12 Also the ARM entity Product_as_individual_view must map to a simple product_definition on the MIM to not conflict with AP214. Proposal is to remove in the MIM product_as_individual_view and update mapping accordingly.

[edit] 6.4.2 SEDS 1196: Mapping of Physical_assembly_relationship.is_realization_of

Part and Clause where Issue Originates: ISO 10303-214, 5.1

Other Parts Affected by the Issue: -

Related Issues: -

Summary/Abstract/Keywords: -

Problem Description: Mapping of Physical_assembly_relationship.is_realization_of

Description: The current mapping of Physical_assembly_relationship.is_realization_of is not working as it should. Here the current mapping:

 assembly_component_usage <=
 product_definition_usage <=
 product_definition_relationship
 {product_definition_relationship.name = 'physical occurrence usage'}
 product_definition_relationship.related_product_definition ->
 product_definition <-
 {product_definition.frame_of_reference ->
 product_definition_context <=
 application_context_element
 application_context_element.name = 'physical occurrence'}
 product_definition_relationship.related_product_definition
 product_definition_relationship
 {product_definition_relationship.name = 'physical realization'}
 product_definition_relationship.relating_product_definition ->
 product_definition
 {product_definition.frame_of_reference ->
 product_definition_context <=
 application_context_element
 application_context_element.name = 'part occurrence'}

We can see that the reference path follows product_definition_relationship.related_product_definition to a product_definition that is identical to the Physical_instance called out by the mapping of attribute physical_component. From here a second product_definition_relationship leads to the target product_definition for the Item_instance. With this mapping it is not possible to change the installation place of a physical_instance within another physical_instance to realize different Item_instance. E.g. we can't show that a physical_instance of a wheel was first mounted as the front-right wheel and later as the back-right wheel.

Proposed Solution (Optional): Change the mapping for the use of product_definition_occurrence_relationship instead of product_definition_relationship as it is given above:

 assembly_component_usage <-
 product_definition_occurrence_relationship.occurrence_usage
 product_definition_occurrence_relationship
 {product_definition_occurrence_relationship.name = 'physical realization'}
 product_definition_occurrence_relationship.occurrence ->
 product_definition
 {product_definition.frame_of_reference ->
 product_definition_context <=
 application_context_element
 application_context_element.name = 'part occurrence'}

This mapping is simpler and more direct compared with the original one. It directly reflects the ARM constraint and is also compatible with the S7 mapping of Item_instance.

This mapping has the advantage that .... (the official SEDS misses the end for unknown reasons)

[edit] 6.4.3 New module Product_as_individual_assembly

To fully address SEDS #1195 and #1196 we created a new module within the STEP modular repository. The plan is to ballot is as part of AP203ed2 in mid 2007 and on success to include it in AP239 afterwards.

Here the proposed content for this module.

[edit] 6.4.3.1 ARM:

SCHEMA Product_as_individual_assembly_arm;
 USE FROM Part_occurrence_arm;
 USE FROM Product_as_individual_arm;

 TYPE part_view_definition_or_product_configuration = SELECT
   (Part_view_definition, Product_configuration);
 END_TYPE;

 ENTITY Physical_assembly_relationship;
   physical_component : Product_as_individual_view;
   physical_assembly : Product_as_individual_view; 
   is_realization_of : Product_occurrence; --item_instance;
 END_ENTITY;

 ENTITY Product_as_individual_view_realization;
   product_design : part_view_definition_or_product_configuration;
   individual_product : Product_as_individual_view;
 DERIVE
   individual_product_version : Product_version := individual_product\Product_view_definition.defined_version;  
 UNIQUE
   UR1 : individual_product;
 WHERE
   WR1 : NOT('PRODUCT_AS_INDIVIDUAL_ARM.PRODUCT_DESIGN_VERSION_TO_INDIVIDUAL' IN
             TYPEOF(individual_product_version))
     AND NOT('PRODUCT_AS_INDIVIDUAL_ARM.PRODUCT_DESIGN_TO_INDIVIDUAL' IN
             TYPEOF(individual_product_version\Product_version.of_product));
 END_ENTITY;

END_SCHEMA;

[edit] 6.4.3.2 MIM:

SCHEMA Product_as_individual_assembly_mim;
 USE FROM Part_occurrence_mim;
 USE FROM Product_as_individual_mim;
END_SCHEMA;

[edit] 6.4.3.3 ARM to MIM mapping:

Physical_assembly_relationship

MIM element: assembly_component_usage

Source: ISO 10303-44

Reference path:

{assembly_component_usage <=
product_definition_usage <=
product_definition_relationship
product_definition_relationship.name = 'physical occurrence usage'}

Physical_assembly_relationship to Product_as_individual_view (as physical_component)

MIM element: PATH

Reference path:

assembly_component_usage <=
product_definition_usage <=
product_definition_relationship
product_definition_relationship.related_product_definition ->
product_definition

Physical_assembly_relationship to Product_as_individual_view (as physical_assembly)

MIM element: PATH

Reference path:

assembly_component_usage <=
product_definition_usage <=
product_definition_relationship
product_definition_relationship.relating_product_definition ->
product_definition

Physical_assembly_relationship to Product_occurrence (as is_realization_of)

MIM element: PATH

Reference path:

assembly_component_usage <-
product_definition_occurrence_relationship.occurrence_usage
product_definition_occurrence_relationship
{product_definition_occurrence_relationship.name = 'physical realization'}
product_definition_occurrence_relationship.occurrence ->
product_definition

Product_as_individual_view_realization

MIM element: (product_definition_relationship)(configuration_design)

Reference path:

(product_definition_relationship
{product_definition_relationship.name = 'physical realization'})
(configuration_design 
{configuration_design.name = 'physical instance basis'})

Product_as_individual_view_realization to Part_view_definition (as product_design)

MIM element: PATH

Reference path:

product_definition_relationship
product_definition_relationship.relating_product_definition ->
product_definition
{product_definition.frame_of_reference ->
product_definition_context <=
application_context_element
application_context_element.name = 'part definition'} 

Product_as_individual_view_realization to Product_configuration (as product_design)

MIM element: PATH

Reference path:

configuration_design
configuration_design.configuration ->
configuration_item

Product_as_individual_view_realization to part_view_definition_or_product_configuration (as product_design)

MIM element: PATH

Reference path:

(product_definition_relationship
product_definition_relationship.relating_product_definition ->
product_definition
{product_definition.frame_of_reference ->
product_definition_context <=
application_context_element
application_context_element.name = 'part definition'})
(configuration_design
configuration_design.configuration ->
configuration_item)

Product_as_individual_view_realization to Product_as_individual_view (as individual_product)

MIM element: PATH

Reference path:

(product_definition_relationship
product_definition_relationship.related_product_definition ->
product_definition)
(configuration_design
configuration_design.design ->
configuration_design_item
configuration_design_item = product_definition
product_definition)

[edit] 6.4.4 Validation result

The STEP file was finally validated with the JSDAI based validation application from LKSoft. We had to run this tool many times in an iterative loop till everything we could fixed was finally fixed. Here the result:

'Validate' program. Copyright 1999-2005, LKSoftWare GmbH
--- Exchange structure: S-TEN_D31_example-1.stp
--- Imported to the repository: 
--- Reading time=4sec
count of instances in model "default": 87
#715=PRODUCT_DEFINITION_OCCURRENCE_RELATIONSHIP('physical realization',$,#402,#714);
    Violation of where rule "wr3" in entity "product_definition_occurrence_relationship" 
#725=PRODUCT_DEFINITION_OCCURRENCE_RELATIONSHIP('physical realization',$,#402,#724);
    Violation of where rule "wr3" in entity "product_definition_occurrence_relationship" 
count of global rules in schema instance "schema1": 0
count of erroneous instances: 2
count of violated global rules: 0
count of violated uniqueness rules: 0
--- Validation time=1sec

The remaining errors on instances #715 and #725 on where rule wr3 of product_definition_occurrence_relationship are caused due to the new usage of this entity to link the assembly structure of Product_as_individuals with the assembly structure of Part_view_definition/Assembly_definition. It has to be resolved as a part of SEDS #1196.


[edit] 7 Core STEP-OWL mapping specification

This page defines an Ontology derived from core STEP (ISO 10303) entities into OWL together with a mapping specification so that it is possible to map application data from STEP to OWL and backwards. To explain the details of the mapping we have to refer to both, the STEP ARM (Application Reference Model) and partly the MIM (Modular Integrated Models) that is a specialization of the STEP Integrated Resources (IR).

[edit] 7.1 References

A typical OWL data-set for STEP will start with these references:

<rdf:RDF 
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema#" 
 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
 xmlns:step="http://owl.wikistep.org/s_ten/d3_1_basic_step_ontology.owl#"

 xmlns="xxx_your_data_set_uri_xxx#" >

[edit] 7.2 General

For the mapping from STEP to OWL we use some common mechanisms defined here.

[edit] 7.2.1 Meta levels

The STEP-OWL mapping is illustrated by the simple example as shown below. In this example an individual VW Beetle is a member of the following classes:

  • a part_version - a specification of what is manufactured;
  • a product_specification - a specification of what is supplied to the customer;
  • a product_class - a high level grouping within which there may be many product specifications
  • a user defined class, such as a classification defined by a hire car company.

Image:meta_levels_example.gif

STEP application data is available on three available meta levels:

  • individual products such as my notebook with a specific serial number "x123456789"
  • typical products such as the the "IBM ThinkPad T43"
  • classes of typical products such as "notebook types"

For the purpose of clearly separating out these meta levels we define corresponding OWL classes:

<owl:Class rdf:about="#Physical_object"/>

<owl:Class rdf:about="#Class_of_physical_object">
 <owl:equivalentClass>
  <owl:Restriction>
   <owl:onProperty rdf:resource="&rdfs;subClassOf"/>
   <owl:hasValue rdf:resource="#Physical_object"/>
  </owl:Restriction>
 </owl:equivalentClass>
</owl:Class>

<owl:Class rdf:about="#Class_of_class_of_physical_object">
 <owl:equivalentClass>
  <owl:Restriction>
   <owl:onProperty rdf:resource="&rdfs;subClassOf"/>
   <owl:hasValue rdf:resource="#Class_of_physical_object"/>
  </owl:Restriction>
 </owl:equivalentClass>
</owl:Class>

The restriction classes defined here ensure that

  • a member of Class_of_class_of_physical_object is also a subclass of Class_of_physical_object. So "notebook types" is an individual of type Class_of_class_of_physical_object and is also a sub-class of Class_of_physical_object.
  • a member of a Class_of_physical_object is also a subclass of Physical_object. So "IBM ThinkPad T43" is an individual of type Class_of_physical_object and of type "notebook types" and is also a sub-class of Physical_object.
  • My notebook "x123456789" is an individual of type "IBM ThinkPad T43" and also of type Physical_object.

It is important to understand that my notebook "x123456789" is not of type "notebook types". In STEP these things are not always clearly separated from each other which can lead to some confusion. When representing STEP data in the semantic web we must ensure this clarity because otherwise reasoning will not work.

[edit] 7.2.2 Instance Identifier

The instance-identifier in a STEP-File or the persistent-label in the SDAI environment maps to rdf:about or rdf:ID attributes and prefix the number with "_" because "#" is not possible here.

[edit] 7.2.3 String attributes

ISO 10303-41 defines the following STRING types with a specific semantic which are used throughout STEP for all IR/AIC/AIM/MIM schema:

TYPE identifier = STRING; END_TYPE;
TYPE label = STRING; END_TYPE
TYPE text = STRING; END_TYPE;

They map to corresponding OWL constructs defined in the core STEP ontology:

<owl:DatatypeProperty rdf:ID="label">
  <rdfs:range rdf:resource="&xsd;string"/>
  <rdfs:comment>XA label is an alphanumeric string that represents the human-interpretable name of
                something and shall have a natural-language meaning.</rdfs:comment>
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="text">
  <rdfs:range rdf:resource="&xsd;string"/>
  <rdfs:comment>A text is an alphanumeric string intended to be read and understood by a human being.
                It is for information purposes only.</rdfs:comment>
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="identifier">
  <rdfs:range rdf:resource="&xsd;string"/>
  <rdfs:comment>An identifier is a string suitable for identifying some product data.</rdfs:comment>
</owl:DatatypeProperty>

The specialized string types are used by many entity attributes such as

  id : identifier;
  name : label;
  description : text;
  version_id : identifier;
  role : label;

In OWL this maps to corresponding specialized DatatypeProperties which are sub-properties of the ones defined above:

<owl:DatatypeProperty rdf:ID="id">
  <rdfs:subPropertyOf rdf:resource="#identifier"/>
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="version_id">
  <rdfs:subPropertyOf rdf:resource="#identifier"/>
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="name">
  <rdfs:subPropertyOf rdf:resource="#label"/>
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="role">
  <rdfs:subPropertyOf rdf:resource="#label"/>
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="description">
  <rdfs:subPropertyOf rdf:resource="#text"/>
</owl:DatatypeProperty>

The handling of ARM-attributes shall follow their corresponding mapping on the MIM/IR level.

Example usage:

 <step:id rdf:datatype="&xsd;string">4711</step:id>
 <step:name rdf:datatype="&xsd;string">l-bracket assembly</step:name>
 <step:description rdf:datatype="&xsd;string">L-Bracket and Fixings</step:description>

[edit] 7.2.4 Units, quantities and representation of measure values

In a first approach for D3.1 we created a detailed "data model" kind of ontology for both ISO 1000 and ISO 31 to explicitly represent the structural concepts defined in these standards. The main problem addressed in this approach was to clearly work out the differences between the concepts of a unit, physical quantities and properties. This first approach had a problem that measurement values could not be fully addresses as a scaling relative to a unit value which is required for ISO 15692 ontologies. Also the later linking with a mathematical ontology would have been problematic.

We therefore developed new ontologies in this area with the focus of having a measurement represented as scaling of a unit value. The scaling is represented in OWL as an object property.

[edit] 7.2.4.1 Number with unit

The path to a formal approach to units of measure begins with the concept of "number with unit". This is a number with some information about what it means. For example we may have:

[  a              myOnt:number_with_unit ;
   myOnt:number   "27.0" ;
   myOnt:unit     si:metre ]
NOTE Examples are given in http://www.w3.org/DesignIssues/Notation3. They should be readable even if you do not know the format.

The problem with "number with unit" is that its meaning is vague. Is it not just a number, but is it a length or an information object which describes a length?

[edit] 7.2.4.2 Physical quantity value and description

The 27.0 metres is a length. Length is a "category of comparable physical quantities". (This phrase is taken from the introduction to ISO 31-0.) The length of 27.0 metres may be described by an information object that consists of a number and a unit. For example we may have:

[  a        myOnt:length ;
   myOnt:described_by
            [ a              myOnt:physical_quantity_description
              myOnt:number   "27.0" ;
              myOnt:unit     si:metre ]  ]

There is nothing wrong with this approach, but it ignores the mathematics of the relationship between categories of physical quantities and numbers. As a result we have to invent new information objects for all related concepts such as length intervals, probability distributions over length, etc..

[edit] 7.2.4.3 Numbers

In the examples so far, we have regarded numbers as just literals. If we wish to use mathematics it is necessary to recognize that:

  • A number is an object. A number can have a representation in decimal or hex. Some numbers have names, such as "pie" (3.14...).
  • A number space consists of a set of numbers, and relationships between the numbers which define the structure of the space. A number space is more than just a set.

A number space can be regarded as an owl:Class. Hence the literal "27" in the examples above can be replaced by the anonymous object:

[  a              maths:real ;
   maths:decimal  "27.0"  ]

or more concisely, just:

[  maths:decimal  "27.0"  ]

[edit] 7.2.4.4 Scales

A scale is a function from a "category of comparable physical quantities" (or "physical quantity space") to a number space. A physical quantity space consists of a set of physical quantities, and relationships between the physical quantities which define the structure of the space.

A scale has properties (such as being increasing or continuous) which depend upon the structures of its domain and range.

An ontology can define celsius and metre_scale, as follows:

:celsius      a             owl:FunctionalProperty;
             rdfs:domain  iso31:temperature  ;
             rdfs:range   maths:real  .
:metre_scale  a             owl:FunctionalProperty;
             rdfs:domain  iso31:length  ;
             rdfs:range   maths:real  .

Using an ontology of scales, the representation of a physical quantity value is simple, rigorous and concise. For the length 27.0 we have:

[  a               myOnt:length ;
  si:metre_scale  [  maths:decimal  "27.0"  ]  ]

or more concisely:

[  si:metre_scale  [  maths:decimal  "27.0"  ]  ]

Similarly the representation of the temperature 20 degrees Celsius is:

[  si:celsius  [  maths:decimal  "20.0"  ]  ]

[edit] 7.2.4.5 Scales and units

The suffix "_scale" has been included in the ID "metre_scale", because the SI concept of metre is not a scale but a named length. In an ontology, the metre would be:

:metre        a            iso31:length  ;
              rdfs:comment "Defined by the BIPM."  .

Because metre_scale (like all other scales derived from units) is linear, the metre_scale is completely defined by the statements:

:metre_scale  a  maths:linear_function  .
:metre  :metre_scale  [  maths:decimal  "1.0"  ]  .

The standards on units are not good at distinguishing between units and scales. It is clear that all the SI base units are indeed units and not scales. The only two scales in common use are Celsius and Fahrenheit.

NOTE The Kelvin is a unit. It is a named temperature. The Celsius is not a unit.

The temperature scale ITS-90 (see http://www.its-90.com/) is a scale. It is a practical approximation to the scale, that is derived from the Kelvin unit.

[edit] 7.3 Product_class and Product_concept

ARM-Express:

ENTITY Market;
  name : STRING;
  market_segment_type : OPTIONAL STRING;
END_ENTITY; 

ENTITY Product_concept;
  id : STRING;
  name : STRING;
  description : OPTIONAL STRING;
  target_market : OPTIONAL Market;
UNIQUE
  UR1 : id;
END_ENTITY;

ENTITY Product_class
  SUBTYPE OF (Product_concept);
  version_id : OPTIONAL STRING;
  level_type : OPTIONAL STRING;
WHERE
  WR1: NOT EXISTS(SELF\Product_concept.target_market);
END_ENTITY;

ENTITY Product_class_relationship;
  description : OPTIONAL STRING;
  relating : Product_class;
  related : Product_class;
  relation_type : STRING;
END_ENTITY;

For Product_class_relationship.relation_type the following values are defined:

  • 'derivation': the related Product_class is derived from the relating Product_class;
  • 'hierarchy': the relating Product_class is on a higher level in the hierarchy of Product_class instances than the related Product_class;
  • 'substitution': the related Product_class replaces the relating Product_class;
  • 'version sequence': the relating Product_class is the preceding version and the related Product_class is the following version.

For the restricted scope of the technological validation we support only 'hierarchy'.

MIM/IR-Express:

ENTITY product_concept_context
  SUBTYPE OF (application_context_element);
  market_segment_type : label;
END_ENTITY;

ENTITY product_concept;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  market_context : product_concept_context;
UNIQUE
  UR1 : id;
END_ENTITY;

ENTITY product_class
  SUBTYPE OF (product_concept, characterized_object);
END_ENTITY;

ENTITY product_concept_relationship;
  name : label;
  description : OPTIONAL text;
  relating_product_concept : product_concept;
  related_product_concept : product_concept;
END_ENTITY;

The ARM entity Market is not mapped to a class by itself but is only converted into a dataTypeProperty. On the OWL-level both ARM/IR entities Product_concept and Poduct_class are covered by one class only:

<Class_of_class_of_physical_object rdf:ID="Product_class">
  <rdfs:subClassOf rdf:resource="#Class_of_physical_object"/>
</Class_of_class_of_physical_object>

<owl:DatatypeProperty rdf:ID="market">
  <rdfs:subPropertyOf rdf:resource="#name"/>
  <rdfs:domain rdf:resource='#Product_class'/>
  <rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>

Issue: Product_class.id should be a functional property.

The reason is that the splitting of the concept in STEP into two entities is more because of historical reasons. A product_class can't be referenced by property_definition. Only when introducing a new subtype which includes characterized_object this is possible. is that from a users and logical perspective they are very similar.

The fact that a Product_class (ARM) is not allowed to have a target_market is also questionable on the IR level because product_concept.market_context is a mandatory attribute which requires to have a product_concept_context anyway, only it may have a name with an empty string. We consider this as a flaw of the STEP standard and will write a SEDS about this.

A Product_class_relationship with the relation type hierarchy shall be mapped into a subClassOf statement.


Example:

#200=APPLICATION_CONTEXT();
#201=PRODUCT_CONCEPT_CONTEXT('German car market',#200,);
#202=PRODUCT_CLASS('pc1','VW Beetle',,#201,$,$);
#203=PRODUCT_CLASS('pc2','VW Beetle CD',,#201,$,$);
#204=PRODUCT_CONCEPT_RELATIONSHIP('hierarchy',,#202,#203);
<step:Product_class rdf:about="#_202">
  <step:id rdf:datatype="&xsd;string">pc1</step:id>
  <step:name rdf:datatype="&xsd;string">VW Beetle</step:name>
  <step:market rdf:datatype="&xsd;string">German car market</step:market>
</step:Product_class>
<step:Product_class rdf:about="#_203">
  <rdfs:subClassOf rdf:resource="#_202"/>
  <step:id rdf:datatype="&xsd;string">pc2</step:id>
  <step:name rdf:datatype="&xsd;string">VW Beetle CD</step:name>
  <step:market rdf:datatype="&xsd;string">German car market</step:market>
</step:Product_class>

[edit] 7.4 Product_specification and Product_configuration

ARM-Express:

ENTITY Product_configuration;
  id : STRING;
  name : STRING;
  description : OPTIONAL STRING;
  item_context : Product_concept;
INVERSE
  corresponding_design : SET [0:1] OF Item_design_association FOR configuration;
END_ENTITY; 

ENTITY Product_specification
  SUBTYPE OF (Product_configuration);
  version_id : OPTIONAL STRING;
  SELF\Product_configuration.item_context : Product_class;
  defining_specifications : SET [0:?] OF Specification;
END_ENTITY; 

ENTITY Specification;
  id : STRING;
  version_id : OPTIONAL STRING;
  name : OPTIONAL STRING;
  description : OPTIONAL STRING;
  category : Specification_category;
  package : BOOLEAN;
END_ENTITY; 

ENTITY Specification_category;
  id : STRING;
  description : STRING;
  implicit_exclusive_condition : BOOLEAN;
END_ENTITY;

For the purpose of the technological validation we exclude Specification, Specification_category and all the extended specification logic as defined in module ISO/TS 10303-1103:2005 Product class.

IR/MIM-Express:

ENTITY configuration_item;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  item_concept : product_concept;
  purpose : OPTIONAL label;
END_ENTITY;

ENTITY product_identification
  SUBTYPE OF (configuration_item, characterized_object);
  SELF\configuration_item.item_concept : product_class;
WHERE
  WR1: SIZEOF(QUERY (cd <* USEDIN ( SELF,
     'CONFIGURATION_MANAGEMENT_SCHEMA.CONFIGURATION_DESIGN.CONFIGURATION' ) 
     ( 'PRODUCT_DEFINITION_SCHEMA.'+ 'PRODUCT_DEFINITION_FORMATION' 
     IN  TYPEOF( cd.design ) )  AND 
     ( SIZEOF ( QUERY ( prpc <* USEDIN(cd. design\product_definition_formation.of_product,
     'PRODUCT_DEFINITION_SCHEMA.PRODUCT_RELATED_PRODUCT_CATEGORY.PRODUCTS') | 
     prpc. name IN ['part' , 'raw material' , 'tool'] ) ) >0 ) ) ) <=1;
  WR2: NOT ( 'CONFIGURATION_MANAGEMENT_SCHEMA.'+ 'CONFIGURABLE_ITEM' IN  TYPEOF( SELF  ) ) 
            XOR ( 'SPECIFIED_PRODUCT_MIM.'+ 'PRODUCT_SPECIFICATION' IN TYPEOF ( SELF ) );
END_ENTITY; 

ENTITY configurable_item
  SUBTYPE OF (configuration_item);
  item_concept_feature : SET [1:?] OF product_concept_feature_association;
END_ENTITY;
ENTITY product_specification
 SUBTYPE OF (product_identification, configurable_item);
END_ENTITY;

ENTITY product_concept_feature_association;
  name : label;
  description : OPTIONAL text;
  concept : product_concept;
  feature : product_concept_feature;
END_ENTITY;

ENTITY product_concept_feature;
  id : identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

For the mapping to OWL we combine the ARM entities Product_configuration and Product_specification into a single class called Product_specification. On the IR/MIM this is equivalent to the combination of configuration_item, product_identification, configurable_item and product_specification:

<Class_of_class_of_physical_object rdf:ID="Product_specification">
  <rdfs:subClassOf rdf:resource="#Class_of_physical_object"/>
  <rdfs:subClassOf>
    <owl:Restriction>
      <owl:onProperty rdf:resource="&rdfs;subClassOf"/>
      <owl:allValuesFrom rdf:resource="#Product_class"/>
    </owl:Restriction>
  </rdfs:subClassOf>
  <owl:disjointWith rdf:resource="#Product_class"/>
</Class_of_class_of_physical_object>

All individuals of type Product_specification must also be sub-classes of a class that is of type Product_class. This covers the ARM relation

Product_configuration.item_context -> Product_concept
Product_specification.item_context -> Product_class

Example:

#220=CONFIGURATION_ITEM('pi1','VW Beetle \X2\2013\X0\ S_101',
                        '1200cc, sunroof, red paint, leather seats',#203,$);
<step:Product_specification rdf:about="#_220">
  <rdfs:subClassOf rdf:resource="#_203"/>
  <step:id rdf:datatype="&xsd;string">pi1</step:id>
  <step:name rdf:datatype="&xsd;string">VW Beetle / S_101</step:name>
  <step:description rdf:datatype="&xsd;string">1200cc, sunroof, red paint, leather seats</step:description>
</step:Product_specification>

Here the AIM/IR instance of type configuration_item is converted into an OWL individual of type Product_specification. When converting this data back from OWL to STEP this may result in an instance of type product_specification. We consider this as being equivalent for the given example.

[edit] 7.5 Part

ARM-Express:

ENTITY Product;
  id : STRING;
  name : OPTIONAL STRING;
  description : OPTIONAL STRING;
END_ENTITY

ENTITY Part
  SUBTYPE OF (Product);
WHERE
  WR1: SIZEOF(['part', 'raw material', 'tool']*types_of_product(SELF))=1;
END_ENTITY;

IR/MIM-Express:

ENTITY product_context
  SUBTYPE OF (application_context_element);
  discipline_type : label;
END_ENTITY;

ENTITY product;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  frame_of_reference : SET [1:?] OF product_context;
END_ENTITY;

ENTITY product_category;
  name : label;
  description : OPTIONAL text;
DERIVE
  id : identifier := get_id_value (SELF);
WHERE
  WR1: SIZEOF (USEDIN (SELF, 'BASIC_ATTRIBUTE_SCHEMA.' + 'ID_ATTRIBUTE.IDENTIFIED_ITEM')) <= 1;
END_ENTITY; 

ENTITY product_related_product_category
  SUBTYPE OF (product_category);
  products : SET [1:?] OF product;
END_ENTITY; 

ARM-Mapping: Every instance of Part (ARM) becomes an individual of class step:Part and vice versa. In the case that a product_related_product_category with the name raw_material or tool is present that the subclass step:Raw_material respectively step:Tool is to be used.

The attributes id, name and description maps to corresponding datatype properties

The fact that a Part is a subtype of Product is not available in OWL.

MIM/IR mapping: On the MIM Part maps to product. The product attribute "frame_of_reference : SET [1:?] OF product_context" is not mapped to OWL and consequently product_context, its supertype application_context_element, the referenced application_context and the referring application_protocol_definition are not mapped to OWL.

<Class_of_class_of_physical_object rdf:ID="Part">
  <rdfs:subClassOf rdf:resource="#Class_of_physical_object"/>
</Class_of_class_of_physical_object>

Example:

#300=APPLICATION_PROTOCOL_DEFINITION(,'automotive_design',2007,#301);
#301=APPLICATION_CONTEXT('mechanical design');
#302=PRODUCT_CONTEXT(' ',#301,' ');
#308=PRODUCT_RELATED_PRODUCT_CATEGORY('part',$,(#310,...));
#310=PRODUCT('A0001','VW Beetle \X2\2013\X0\ P_101',' ',(#302));
<step:Part rdf:ID="_310">
  <step:id rdf:datatype="&xsd;string">A0001</step:id>
  <step:name rdf:datatype="&xsd;string">VW Beetle / P_101</step:name>
</step:Part>

[edit] 7.6 Part_version

ARM-Express:

ENTITY Product_version;
  id : STRING;
  description : OPTIONAL STRING;
  of_product : Product;
END_ENTITY;

ENTITY Part_version
  SUBTYPE OF (Product_version);
  SELF\Product_version.of_product : Part;
END_ENTITY;

TYPE version_or_definition = SELECT (
  Product_version,
  Product_view_definition);
END_TYPE; 

ENTITY Item_design_association;
  configuration : Product_configuration;
  design : version_or_definition;
UNIQUE
  UR1 : configuration, design;
END_ENTITY; 

IR/MIM-Express:

ENTITY product_definition_formation;
  id : identifier;
  description : OPTIONAL text;
  of_product : product;
UNIQUE
  UR1 : id, of_product;
END_ENTITY;

TYPE configuration_design_item = SELECT (
  product_definition,
  product_definition_formation);
END_TYPE; 
 
ENTITY configuration_design;
  configuration : configuration_item;
  design : configuration_design_item;
DERIVE
  name : label := get_name_value (SELF);
  description : text := get_description_value (SELF);
UNIQUE
  UR1 : configuration, design;
WHERE
  WR1: SIZEOF (USEDIN (SELF, 'BASIC_ATTRIBUTE_SCHEMA.' + 'NAME_ATTRIBUTE.NAMED_ITEM')) <= 1;
  WR2: SIZEOF (USEDIN (SELF, 'BASIC_ATTRIBUTE_SCHEMA.' + 'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
END_ENTITY;

ARM-mapping: Every instance of Part_version (ARM) becomes an individual of class step:Part_version and vice versa. The attributes id and description maps to corresponding datatype properties The attribute SELF\Product_version.of_product : Part; is turned into a Part_version-instance subTypeOf of Part-instance statement. The fact that a Part_version is a subtype of Product_version is not available in OWL.

The relation established by Item_design_association is converted into subClassOf statement, making an individual of type Part a subClassOf another individual of type Product_specification.

AIM-mapping: Nothing in additional.

Open question: What to do with the unique ur1 constraint'

Issue: AP214 requires in the mapping of the ARM entity Product_design the additional constraint "{configuration_design.name = 'product design'}". It is not clear why this is not required in the corresponding STEP-modules. This needs to be further investigated and may result in a SEDS.

<Class_of_class_of_physical_object rdf:ID="Part_version">
  <rdfs:subClassOf rdf:resource="#Class_of_physical_object"/>
  <rdfs:subClassOf>
   <owl:Restriction>
    <owl:onProperty rdf:resource="&rdfs;subClassOf"/>
    <owl:allValuesFrom rdf:resource="#Part"/>
   </owl:Restriction>
  </rdfs:subClassOf>
</Class_of_class_of_physical_object>

Example:

#230=CONFIGURATION_DESIGN(#220,#311);
#231=NAME_ATTRIBUTE('product design',#230);
#311=PRODUCT_DEFINITION_FORMATION('1',$,#310);
<step:Part_version rdf:ID="_311">
  <rdfs:subClassOf rdf:resource="#_310"/>
  <rdfs:subClassOf rdf:resource="#_220"/>
  <step:id rdf:datatype="&xsd;string">1</step:id>
</step:Part_version>

Issue: What happen is the OWL data does not contain such a statement? <rdfs:subClassOf rdf:resource="#_1733"/>. Maybe we then have to create an artificial Part instance. And what happens if there are more than one such statements? - is it then a different part-instance for each? - duplicating of data.

[edit] 7.7 Product_version_relationship

ARM-Express:

ENTITY Product_version_relationship;
  relation_type : OPTIONAL STRING;
  description : OPTIONAL STRING;
  relating_version : Product_version;
  related_version : Product_version;
WHERE
  WR1: relating_version :<>: related_version;
  WR2: EXISTS(relation_type) OR (TYPEOF(SELF\Product_version_relationship) <> TYPEOF(SELF));
END_ENTITY;

The following relation_types are pre-defined:

  • 'derivation'
  • 'hierarchy'
  • 'sequence'

For the purpose of technological validation we will support only 'sequence'.

AIM-Express:

ENTITY product_definition_formation_relationship;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  relating_product_definition_formation : product_definition_formation;
  related_product_definition_formation : product_definition_formation;
END_ENTITY; 

ARM-MIM mapping: The mapping is straightforward 1:1. There is nothing special to consider.

ARM-OWL mapping: In STEP the relation between product version is made an instance by its own so that it is possible to assign attributes. In practise however this is not really needed and so this entity will map to an ObjectProperty. Because we decided to not support the supertype Product_version but only specific subtypes such as part_version the ObjectProperty will be between Part_versions only. In the case of the relation type 'sequence' the property is transitive and we can also define an inverse relation:

<owl:ObjectProperty rdf:ID='part_version_predecessor'>
  <rdf:type rdf:resource="&owl;TransitiveProperty" />
  <rdfs:domain rdf:resource='#Part_version'/>
  <rdfs:range rdf:resource='#Part_version'/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:ID='part_version_successor'>
  <owl:inverseOf rdf:resource='#part_version_predecessor'/>
  <rdfs:domain rdf:resource='#Part_version'/>
  <rdfs:range rdf:resource='#Part_version'/>
</owl:ObjectProperty>

Example: In this example the Part #320 has the two versions "1" and "A". Version "A" is the more recent one.

#320=PRODUCT('A0002','Engine-4/50KW-BX',,(#302));
#321=PRODUCT_DEFINITION_FORMATION('1',$,#320);
#323=PRODUCT_DEFINITION_FORMATION('A',$,#320);
#325=PRODUCT_DEFINITION_FORMATION_RELATIONSHIP(,'sequence',$,#321,#323);
<step:Part_version rdf:about="#_321">
  ...
</step:Part_version>
<step:Part_version rdf:about="#_323">
  <step:part_version_successor rdf:resource="#_321"/>
  ...
</step:Part_version>

[edit] 7.8 Part_view_definition

ARM Express:

ENTITY Product_view_definition;
  id : OPTIONAL STRING;
  name : OPTIONAL STRING;
  additional_characterization : OPTIONAL STRING;
  initial_context : View_definition_context;
  additional_contexts : SET [0:?] OF View_definition_context;
  defined_version : Product_version;
WHERE
  WR1: NOT (initial_context IN additional_contexts);
  WR2: EXISTS(id) OR (TYPEOF(SELF\Product_view_definition) <> TYPEOF(SELF));
END_ENTITY;

ENTITY Part_view_definition
  SUBTYPE OF (Product_view_definition);
  SELF\Product_view_definition.defined_version : Part_version;
END_ENTITY

AIM/IR Express:

ENTITY product_definition;
  id : identifier;
  description : OPTIONAL text;
  formation : product_definition_formation;
  frame_of_reference : product_definition_context;
DERIVE
  name : label := get_name_value (SELF);
WHERE
  WR1: SIZEOF (USEDIN (SELF, 'BASIC_ATTRIBUTE_SCHEMA.' + 'NAME_ATTRIBUTE.NAMED_ITEM')) <= 1;
END_ENTITY;

ENTITY product_definition_context
  SUBTYPE OF (application_context_element);
  life_cycle_stage : label;
END_ENTITY;

The ARM to AIM mapping of Part_view_definition requires a string constraint

product_definition
{product_definition.frame_of_reference -> product_definition_context
 product_definition_context <= application_context_element
 application_context_element.name = 'part definition'}

ARM-OWL mapping: Every instance of Part_view_definition (ARM) becomes an individual of class step:Part_view_definition. However not every individual of class step:Part_view_definition becomes an instance of Part_view_definition. This is only the case for those individuals of class step:Part_view_definition for which explicit "Part_version-instance subTypeOf of Part_view_definition-instance" statements are defined.

The attributes id, name and additional_characterization maps to corresponding datatype properties if present. additional_characterization is taken as description.

TBD: Mapping of initial_context: View_definition_context and additional_contexts: SET [0:?] OF View_definition_context

The attribute "SELF\Product_view_definition.defined_version: Part_version" is turned into a "Part_version-instance subTypeOf of Part_view_definition-instance" statement. By this a Part_version becomes the intersection of all its Part_view_definitions.

The fact that a Part_view_definition is a subtype of Product_view_definition is not available in OWL.

<Class_of_class_of_physical_object rdf:ID="Part_view_definition">
  <rdfs:subClassOf rdf:resource="#Class_of_physical_object"/>
</Class_of_class_of_physical_object>

Example:

#303=PRODUCT_DEFINITION_CONTEXT('part definition',#301,'design');
#311=PRODUCT_DEFINITION_FORMATION('1',$,#310);
#312=PRODUCT_DEFINITION('1',$,#311,#303);
#314=PRODUCT_DEFINITION('2',$,#311,#303);
<step_Part_version rdf_about="#_311">
  <rdfs:subClassOf rdf:resource="#_312"/>
  <rdfs:subClassOf rdf:resource="#_314"/>
<step_Part_version>
<step:Part_view_definition rdf:ID="_312">
  <step:id rdf:datatype="&xsd;string">1</step:id>
  ...
</step:Part>
<step:Part_view_definition rdf:ID="_314">
  <step:id rdf:datatype="&xsd;string">2</step:id>
  ...
</step:Part>

[edit] 7.9 Units, measure values and representation

We address this topic on the MIM/IR level only because the ARM level gives no further insight.

Here a typical example of a representation with measure with units values:

#500=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT($,.METRE.));
#501=(MASS_UNIT()NAMED_UNIT(*)SI_UNIT(.KILO.,.GRAM.));

#514=REPRESENTATION_CONTEXT(' ',' ');
#515=REPRESENTATION(' ',(#516),#514);
#516=(LENGTH_MEASURE_WITH_UNIT()MEASURE_REPRESENTATION_ITEM()
      MEASURE_WITH_UNIT(LENGTH_MEASURE(4.5),#500)REPRESENTATION_ITEM(' '));
 
#524=REPRESENTATION_CONTEXT(' ',' ');
#525=REPRESENTATION(' ',(#526),#524);
#526=(MASS_MEASURE_WITH_UNIT()MEASURE_REPRESENTATION_ITEM()MEASURE_WITH_UNIT(
      MASS_MEASURE(750),#501)REPRESENTATION_ITEM(' '));

The meaning is as follows:

  • First the units are defined in which the measurement is made, here it is meter (#500) and kilogram (#501).
  • Then two representations are defined (#515 and #525), each with its own representation context (#514 and #524).
  • Each representation contains a measure_representation_item. One for "4.5 m" (#516) and the other for "750 Kg" (#526).

This maps into this (almost) equivalent OWL representation:

<iso_31:Length rdf:about="#_516">
  <iso_1000:meter_scale>
    <iso:Real>
      <value rdf:datatype="&xsd;double">4.5</value>
    </iso:Real>
  </iso_1000:meter_scale>
</iso_31:Length>
  
<iso_31:Mass rdf:about="#_526">
  <iso_1000:kilogram_scale>
    <iso:Real>
      <value rdf:datatype="&xsd;double">750</value>
    </iso:Real>
  </iso_1000:kilogram_scale>
</iso_31:Mass>

Below we explain the details of the used express model and its mapping into OWL.

[edit] 7.9.1 Units

  • a unit is either a named_unit or a derived_unit. For D3.1 we address only named_unit.
  • a named_unit refers to dimensional exponents all all the 7 base SI unit. The exponents are typically integer numbers. E.g. to represent acceleration (m**/s) the length_exponent = 2 and time_exponent = -1;
  • a named_unit is either an si_unit or a conversion_based_unit or a context_dependent_unit. For D3.1 we consider only si_unit'
  • an si_unit defines wraps up the pre-defined units defined in ISO 1000. These are the 7 base units and 21 selected derived_units.
  • an si_unit may have one of the common si_prefix such as mega or milli.
  • for the 7 base_units and plane angle, solid angle, area, volume and ration specific subtypes are defined in addition which have to be used.
TYPE unit = SELECT (
  derived_unit,
  named_unit);
END_TYPE;

ENTITY named_unit
  SUPERTYPE OF ((ONEOF (si_unit, conversion_based_unit, context_dependent_unit) ANDOR 
   ONEOF (length_unit, mass_unit, time_unit, electric_current_unit, 
     thermodynamic_temperature_unit, amount_of_substance_unit, luminous_intensity_unit, 
     plane_angle_unit, solid_angle_unit, area_unit, volume_unit, ratio_unit)));
  dimensions : dimensional_exponents;
END_ENTITY; 

ENTITY dimensional_exponents;
  length_exponent : REAL;
  mass_exponent : REAL;
  time_exponent : REAL;
  electric_current_exponent : REAL;
  thermodynamic_temperature_exponent : REAL;
  amount_of_substance_exponent : REAL;
  luminous_intensity_exponent : REAL;
END_ENTITY; 

TYPE si_prefix = ENUMERATION (
  exa, peta, tera, giga,
  mega, kilo, hecto, deca,
  deci, centi, milli, micro,
  nano, pico, femto, atto );
END_TYPE; 

ENTITY si_unit
  SUBTYPE OF (named_unit);
  prefix : OPTIONAL si_prefix;
  name : si_unit_name;
DERIVE
  SELF\named_unit.dimensions : dimensional_exponents := dimensions_for_si_unit(name);
END_ENTITY;
-- Note: the dimensional exponents are set by function dimensions_for_si_unit

ENTITY length_unit
  SUBTYPE OF (named_unit);
WHERE
  WR1: (SELF\named_unit.dimensions.length_exponent = 1.0) 
   AND (SELF\named_unit.dimensions.mass_exponent = 0.0) 
   AND (SELF\named_unit.dimensions.time_exponent = 0.0) 
   AND (SELF\named_unit.dimensions.electric_current_exponent = 0.0) 
   AND (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) 
   AND (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) 
   AND (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0);
END_ENTITY; 
 
ENTITY mass_unit
  SUBTYPE OF (named_unit);
WHERE
  WR1: (SELF\named_unit.dimensions.length_exponent = 0.0) 
   AND (SELF\named_unit.dimensions.mass_exponent = 1.0) 
   AND (SELF\named_unit.dimensions.time_exponent = 0.0) 
   AND (SELF\named_unit.dimensions.electric_current_exponent = 0.0) 
   AND (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) 
   AND (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) 
   AND (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0);
END_ENTITY;

ARM to OWL mapping: The instances on units (#500 and #501) have a static characteristic. Therefore the corresponding OWL constructs will be defined only once in the is1000 ontology and can then be used many times. On further "application data" is needed to represent units.

In the ISO1000 ontology we have predefined functional properties for all units, e.g.:

<owl:FunctionalProperty rdf:about="#metre_scale">
  <rdfs:label xml:lang="en">metre</rdfs:label>
  <rdfs:comment>defined in ISO 1000:1992</rdfs:comment>
</owl:FunctionalProperty>
<owl:FunctionalProperty rdf:about="#kilogram_scale">
  <rdfs:label xml:lang="en">kilogram</rdfs:label>
  <rdfs:comment>defined in ISO 1000:1992</rdfs:comment>
</owl:FunctionalProperty>


[edit] 7.9.2 Measurements

For any measurement three pieces of information have to be given:

  • the value, in our examples 750 and 4.5
  • the unit (see above)
  • and the physical quantity

It is important to understand that more than one physical quantity can refer to the same unit. Examples are e.g. frequency and rotation speed which are both given as [1/s]. ISO 31 defines many physical quantities, however p41 of STEP has explicit support for only those 21 basic quantities which are mentioned in ISO 1000. For all the other physical quantities the STEP property mechanism has to be used (see below).

For the AIM express below we focus on length and mass quantities only and how to represent values of them:

TYPE mass_measure = REAL; END_TYPE; 
TYPE length_measure = REAL; END_TYPE; 
...
TYPE measure_value = SELECT (
  amount_of_substance_measure,
  area_measure,
  celsius_temperature_measure,
  context_dependent_measure,
  count_measure,
  descriptive_measure,
  electric_current_measure,
  length_measure,
  luminous_intensity_measure,
  mass_measure,
  numeric_measure,
  parameter_value,
  plane_angle_measure,
  positive_length_measure,
  positive_plane_angle_measure,
  positive_ratio_measure,
  ratio_measure,
  solid_angle_measure,
  thermodynamic_temperature_measure,
  time_measure,
  volume_measure);
END_TYPE; 

ENTITY measure_with_unit
  SUPERTYPE OF (ONEOF (length_measure_with_unit, mass_measure_with_unit, 
    time_measure_with_unit, electric_current_measure_with_unit, 
    thermodynamic_temperature_measure_with_unit, celsius_temperature_measure_with_unit, 
    amount_of_substance_measure_with_unit, luminous_intensity_measure_with_unit, 
    plane_angle_measure_with_unit, solid_angle_measure_with_unit, area_measure_with_unit, 
    volume_measure_with_unit, ratio_measure_with_unit));
  value_component : measure_value;
  unit_component : unit;
WHERE
  WR1: valid_units (SELF);
END_ENTITY;

ENTITY length_measure_with_unit
   SUBTYPE OF (measure_with_unit);
WHERE
  WR1: 'MEASURE_SCHEMA.LENGTH_UNIT' IN TYPEOF (SELF\measure_with_unit.unit_component);
END_ENTITY;

ENTITY mass_measure_with_unit
  SUBTYPE OF (measure_with_unit);
WHERE
  WR1: 'MEASURE_SCHEMA.MASS_UNIT' IN TYPEOF (SELF\measure_with_unit.unit_component);
END_ENTITY;

STEP to OWL mapping: In the ISO 31 a generic class for physical quantities is defined:

 <owl:Class rdf:ID="Physical_quantity_type">
  <rdfs:subClassOf rdf:resource="&owl;Class"/>
 </owl:Class>

Each particular physical quantity of ISO 31 becomes now an individual of the Physical_quantity_type class.

<Physical_quantity_type rdf:about="#Length"/>
<Physical_quantity_type rdf:about="#Mass"/>

For the representation of quantity values we use members of class Real:

 <owl:Class rdf:about="#Real"/>

[edit] 7.9.3 Representation entities

ENTITY representation;
  name : label;
  items : SET [1:?] OF representation_item;
  context_of_items : representation_context;
  ...
END_ENTITY; 

ENTITY representation_context;
  context_identifier : identifier;
  context_type : text;
INVERSE
  representations_in_context : SET [1:?] OF representation FOR context_of_items;
END_ENTITY; 
 
ENTITY representation_item;
  name : label;
WHERE
  WR1: SIZEOF(using_representations(SELF)) > 0;
END_ENTITY; 

ENTITY measure_representation_item
 SUBTYPE OF (representation_item, measure_with_unit);
END_ENTITY;

ARM to OWL mapping: For simple property values the representation and representation_context carry no additional semantic values. Because of this these entities don't show up in OWL at all. We only chose the instance identifier of the representation for reference, see below.

[edit] 7.10 Independent and assigned properties

ARM-Express:

ENTITY Assigned_property;
  id : OPTIONAL STRING;
  name : STRING;
  description : OPTIONAL STRING;
  described_element : property_assignment_select; -- leads to Product_view_definition and others
END_ENTITY;

ENTITY Applied_independent_property -- maps to property_definition
  SUBTYPE OF (Assigned_property);
  base_independent_property : Independent_property;
DERIVE
  SELF\Assigned_property.name : STRING := base_independent_property.property_type;
END_ENTITY;

ENTITY Independent_property;
  id : STRING;
  property_type : STRING;
  description : OPTIONAL STRING;
END_ENTITY;

ENTITY Property_definition_representation;
  ABSTRACT SUPERTYPE;
  description : OPTIONAL STRING;
  definition : represented_definition;
  rep : Representation;
  role : OPTIONAL STRING;
END_ENTITY;

ENTITY Property_representation
  SUBTYPE OF (Property_definition_representation);
  SELF\Property_definition_representation.definition RENAMED property : Assigned_property;
END_ENTITY;

Corresponding AIM-Express:

ENTITY general_property;
  id : identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

TYPE derived_property_select = SELECT (
  action_property,
  property_definition, -- we consider here only this one
  resource_property);
END_TYPE;
 
ENTITY general_property_association;
  name : label;
  description : OPTIONAL text;
  base_definition : general_property;
  derived_definition : derived_property_select;
WHERE
  WR1: SIZEOF( USEDIN( derived_definition, 'PRODUCT_PROPERTY_DEFINITION_SCHEMA.' +
                                           'GENERAL_PROPERTY_ASSOCIATION.' + 'DERIVED_DEFINITION')) = 1;
  WR2: derived_definition.name = base_definition.name;
END_ENTITY;

ENTITY property_definition;
  name : label;
  description : OPTIONAL text;
  definition : characterized_definition; -- nested select leads to product_definition and others
DERIVE
  id : identifier := get_id_value (SELF);
WHERE
  WR1: SIZEOF (USEDIN (SELF, 'BASIC_ATTRIBUTE_SCHEMA.' + 'ID_ATTRIBUTE.IDENTIFIED_ITEM')) <= 1;
END_ENTITY;

ARM to OWL mapping: In STEP data sets we may find just Assigned_property for some Product_view_definition or we can find the subtype Applied_independent_property together with a referenced Independent_property. The latter one is the preferred and required one by AP214 but it is not always available. For the mapping to OWL we consider both cases as practically equivalent; this means the generated OWL statements are identical. We can do this because of Applied_independent_property enforces Assigned_property.name be identical to Independent_property.property_type.

For every Assigned_independent_property that refers to either a Part_view_definition or a Product_as_individual_view via a corresponding Assigned_independent_property an OWL ObjectProperty must be created which is of type Physical_property_of_product_as_individual.

<owl:Class rdf:about="#Physical_property_of_product_as_individual">
 <owl:equivalentClass>
  <owl:Class>
   <owl:intersectionOf rdf:parseType="Collection"/>
    <owl:Restriction>
     <owl:onProperty rdf:resource="&rdfs;domain"/>
     <owl:allValuesFrom>
      <owl:Restriction>
       <owl:onProperty rdf:resource="&rdfs;subClassOf"/>
       <owl:hasValue rdf:resource="&step;Product_as_individual"/>
      </owl:Restriction>
     </owl:allValuesFrom>
    </owl:Restriction>
    <owl:Restriction>
     <owl:onProperty rdf:resource="&rdfs;range"/>
     <owl:allValuesFrom rdf:resource="&iso31;Physical_quantity_type"/>
    </owl:Restriction>
   </owl:intersectionOf>
  </owl:Class>
 </owl:equivalentClass>
</owl:Class> 

Example:

#314=PRODUCT_DEFINITION('2',$,#311,#303);

#510=GENERAL_PROPERTY('Overall length','Total length',$);
#511=GENERAL_PROPERTY_ASSOCIATION(' ',$,#510,#512);
#512=PROPERTY_DEFINITION('Overall length',$,#314);
#513=PROPERTY_DEFINITION_REPRESENTATION(#512,#515);
 
#520=GENERAL_PROPERTY('mass when empty','mass',$);
#521=GENERAL_PROPERTY_ASSOCIATION(' ',$,#520,#522);
#522=PROPERTY_DEFINITION('mass when empty',$,#314);
#523=PROPERTY_DEFINITION_REPRESENTATION(#522,#525);

The mapping to OWL for the Measure_representation_items together with their representations and units are sown above. Now we have to define OWL DataType properties for the STEP properties we are going to use. They correspond to the general_property instances #510 and #520 when available. In the case they are not available this has to be derived from the property_definition instances.

<owl:FunctionalProperty rdf:about="#_510">
 <rdf:type rdf:resource="#Physical_property_of_product_as_individual"/>
 <step:id rdf:datatype="&xsd;string">Overall length</step:id>
 <rdfs:range rdf:resource="&iso31;Length"/>
</owl:FunctionalProperty> 

<owl:FunctionalProperty rdf:about="#_520">
 <rdf:type rdf:resource="#Physical_property_of_product_as_individual"/>
 <step:id rdf:datatype="&xsd;string">mass when empty</step:id>
 <rdfs:range rdf:resource="&iso31;Mass"/>
</owl:FunctionalProperty> 

Next we define instance of the newly defined property types, using the identifiers of the property_definition instances #512 and #522.

<step:Property_definition rdf:about="#_512">
  <owl:equivalentClass>
    <owl:Restriction>
      <owl:onProperty rdf:resource="#_510" />
      <owl:hasValue rdf:resource="#_516" />
    </owl:Restriction>
  </owl:equivalentClass>
</step:Property_definition>

<step:Property_definition rdf:about="#_522">
  <owl:equivalentClass>
    <owl:Restriction>
      <owl:onProperty rdf:resource="#_520" />
      <owl:hasValue rdf:resource="#_526" />
    </owl:Restriction>
  </owl:equivalentClass>
</step:Property_definition>

And finally we have to link this with the Part_view_definition #314

<step:Part_view_definition rdf:about="#_314">
  <rdfs:subClassOf rdf:resource="#_512"/>
  <rdfs:subClassOf rdf:resource="#_522"/>
</step:Part_view_definition>

[edit] 7.11 Assembly and Product_occurrence

In STEP we have two different ways to define assemblies, a simple one where one Part_view_definition goes directly into another one via a relationship entity and a more extended one where we first define an occurrence of a part and then only this occurrence is related into a higher level Part_view_definition. In the early days of STEP only the simple approach was available. It had a couple of disadvantages and so the occurrence concept was introduced for more complex cases. Having occurrence objects allow to directly relate them to other structures such as breakdowns, to re-use the occurrences for several versions of the same part or to allow different views of a part_version to share the same occurrence. This is the reason why for the STEP-OWL mapping we need to support the more complex assembly structure and fortunately it is upward compatible with the simple one.

ARM-Express: First a specific subtype of Part_view_definition has to be used to define an assembly:

ENTITY Assembly_definition
  SUBTYPE OF (Part_view_definition);
WHERE
  WR1: 'assembly' IN types_of_product(SELF\Product_view_definition.defined_version.of_product);
END_ENTITY; 

Next we need instances of Definition_based_part_occurrence:

ENTITY Product_occurrence
  ABSTRACT SUPERTYPE OF ((ONEOF (Definition_based_product_occurrence,
                                 Specification_based_product_occurrence) AND
                          ONEOF (Product_occurrence_with_quantity, Single_instance)))
  SUBTYPE OF (Product_view_definition);
INVERSE
  occurrence_contexts : SET [1:?] OF View_definition_relationship FOR related_view;
END_ENTITY;

ENTITY Definition_based_product_occurrence
  ABSTRACT SUPERTYPE
  SUBTYPE OF (Product_occurrence);
  derived_from : Product_view_definition;
WHERE
  WR1: SELF\Product_view_definition.defined_version = derived_from.defined_version;
END_ENTITY;

ENTITY Part_occurrence
  ABSTRACT SUPERTYPE
  SUBTYPE OF (Product_occurrence);
  SELF\Product_view_definition.defined_version : Part_version;
END_ENTITY; 

ENTITY Definition_based_part_occurrence
  SUBTYPE OF (Definition_based_product_occurrence, Part_occurrence);
  SELF\Definition_based_product_occurrence.derived_from : Part_view_definition;
END_ENTITY;

And finally the Definition_based_part_occurrence are related to the Assembly_definition with a Next_assembly_usage that is also an Assembled_part_association. Here the relevant sub-supertype tree:

ENTITY View_definition_relationship;
  id : OPTIONAL STRING;
  relation_type : OPTIONAL STRING;
  description : OPTIONAL STRING;
  relating_view : Product_view_definition;
  related_view : Product_view_definition;
END_ENTITY;

ENTITY View_definition_usage
  SUBTYPE OF (View_definition_relationship);
END_ENTITY; 

ENTITY Assembly_component_relationship
  ABSTRACT SUPERTYPE OF (ONEOF (Next_assembly_usage, Promissory_usage,
                                Component_upper_level_identification))
  SUBTYPE OF (View_definition_usage);
  quantity : OPTIONAL Value_with_unit;
  location_indicator : OPTIONAL STRING;
WHERE
  WR1: NOT(EXISTS(quantity)) OR ((NOT ('NUMBER' IN TYPEOF(quantity.value_component))) XOR
           (quantity.value_component > 0));
END_ENTITY;
ENTITY Next_assembly_usage
  SUBTYPE OF (Assembly_component_relationship);
END_ENTITY; 
ENTITY Part_occurrence_definition_relationship
  SUBTYPE OF (View_definition_relationship);
  SELF\View_definition_relationship.relating_view : Part_view_definition;
  SELF\View_definition_relationship.related_view : Part_occurrence;
DERIVE
  SELF\View_definition_relationship.id : STRING :=
    SELF\View_definition_relationship.related_view\Product_view_definition.id;
WHERE
  WR1: NOT (('ASSEMBLY_STRUCTURE_ARM.ASSEMBLY_COMPONENT_RELATIONSHIP' IN
            TYPEOF(SELF)) AND (EXISTS(SELF\Assembly_component_relationship.quantity)));
END_ENTITY; 

ENTITY Assembled_part_association
  SUBTYPE OF (Part_occurrence_definition_relationship, Assembly_component_relationship);
  SELF\View_definition_relationship.relating_view : Assembly_definition;
END_ENTITY;

MIM/IR-Express:

ENTITY product_definition_relationship;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  relating_product_definition : product_definition;
  related_product_definition : product_definition;
END_ENTITY;

ENTITY product_definition_usage
  SUPERTYPE OF (ONEOF (make_from_usage_option, assembly_component_usage))
  SUBTYPE OF (product_definition_relationship);
UNIQUE
  UR1 : id, relating_product_definition, related_product_definition;
WHERE
  WR1: acyclic_product_definition_relationship(SELF, 
      [SELF\product_definition_relationship.related_product_definition],
        'PRODUCT_STRUCTURE_SCHEMA.PRODUCT_DEFINITION_USAGE');
END_ENTITY;

ENTITY assembly_component_usage
  SUPERTYPE OF (ONEOF (next_assembly_usage_occurrence, specified_higher_usage_occurrence,
                       promissory_usage_occurrence))
  SUBTYPE OF (product_definition_usage);
  reference_designator : OPTIONAL identifier;
END_ENTITY;

ENTITY next_assembly_usage_occurrence
  SUBTYPE OF (assembly_component_usage);
END_ENTITY; 

ARM-MIM mapping: For the purpose of the technical evaluation we restrict assembly structures for the so called S3 mapping as defined in AP214 and omit the more complex and powerful S7 mapping. In this case the mapping simplifies to:

The complex of Assembly_definition and Next_assembly_usage and also the Definition_based_part_occurrence maps to a single next_assembly_usage_occurrence.

Mapping of Assembly_definition:

product_definition <- product_definition_context_association.definition 
product_definition_context_association 
{product_definition_context_association.role -> product_definition_context_role 
product_definition_context_role.name = 'part definition type'} 
product_definition_context_association.frame_of_reference -> product_definition_context 
product_definition_context <= application_context_element 
application_context_element.name = 'assembly definition' 

ARM-OWL mapping: The ARM entity Assembly_definition maps to a corresponding OWL class Assembly_definition:

<Class_of_class_of_physical_object rdf:ID="Assembly_definition">
  <rdfs:subClassOf rdf:resource="#Part_view_definition"/>
</Class_of_class_of_physical_object>

The ARM entity Definition_based_part_occurrence maps to an OWL class Part_occurrence with the additional restriction that members of it must have a subClassOf relationship to some part_version individual.

<Class_of_class_of_physical_object rdf:ID="Part_occurence">
  <rdfs:subClassOf rdf:resource="#Class_of_physical_object"/>
  <rdfs:subClassOf>
    <owl:Restriction>
      <owl:onProperty rdf:resource="&rdfs;subClassOf"/>
      <owl:allValuesFrom rdf:resource="#Part_version"/>
    </owl:Restriction>
  </rdfs:subClassOf> 
</Class_of_class_of_physical_object>


Example:

-- Here the Part_view_definition (ARM) #312 is turned into an Assembly_definition
#304=PRODUCT_DEFINITION_CONTEXT('assembly definition',#301,);
#305=PRODUCT_DEFINITION_CONTEXT_ROLE('part definition type',$);
#311=PRODUCT_DEFINITION_FORMATION('1',$,#310);
#312=PRODUCT_DEFINITION('1',$,#311,#303);
#313=PRODUCT_DEFINITION_CONTEXT_ASSOCIATION(#312,#304,#305); 
...
-- and now #322 is brought into #312 as a component of the assembly by #400
#321=PRODUCT_DEFINITION_FORMATION('1',$,#320);
#322=PRODUCT_DEFINITION('1',$,#321,#303);
#400=NEXT_ASSEMBLY_USAGE_OCCURRENCE('SI0001',,$,#312,#322,$);
<step:Part_occurence rdf:about="#_400">
  <rdfs:subClassOf rdf:resource="#_321"/>
  <step:id rdf:datatype="&xsd;string">SI0001</step:id>
</step:Part_occurence>

<step:Next_assembly_usage_occurrence rdf:about="#_400x">
  <rdfs:subClassOf>
    <owl:Restriction>
      <owl:onProperty rdf:resource="&step;nextAssemblyUsageOccurrenceDefinition" />
      <owl:hasValue rdf:resource="#_400" />
    </owl:Restriction>
  </rdfs:subClassOf>
</step:Next_assembly_usage_occurrence>

<step:Part_view_definition rdf:about="_312">
  <rdfs:subClassOf rdf:resource="#_400x"/>
</step:Part_view_definition>

Alternatively to avoid #_400x we better write:

<step:Part_occurence rdf:about="#_400">
  <rdfs:subClassOf rdf:resource="#_321"/>
  <step:id rdf:datatype="&xsd;string">SI0001</step:id>
</step:Part_occurence>

<step:Part_view_definition rdf:about="_312">
  <rdfs:subClassOf>
    <owl:Restriction>
      <owl:onProperty rdf:resource="&step;nextAssemblyUsageOccurrenceDefinition" />
      <owl:hasValue rdf:resource="#_400" />
    </owl:Restriction>
  </rdfs:subClassOf>
</step:Part_view_definition>

[edit] 7.12 Physically realized product

ARM-Express:

ENTITY Product_as_individual
  SUBTYPE OF (Product);
END_ENTITY; 

ENTITY Product_as_individual_version
  ABSTRACT SUPERTYPE OF (ONEOF (Product_as_planned, Product_as_realized))
  SUBTYPE OF (Product_version);
  SELF\Product_version.of_product : Product_as_individual;
END_ENTITY;

ENTITY Product_as_planned
  SUBTYPE OF (Product_as_individual_version);
END_ENTITY;

ENTITY Product_as_realized
  SUBTYPE OF (Product_as_individual_version);
END_ENTITY;

ENTITY Product_as_individual_view
  SUBTYPE OF (Product_view_definition);
  SELF\Product_view_definition.defined_version : Product_as_individual_version;
END_ENTITY; 

ENTITY Product_as_individual_view_realization;
  product_design : Part_view_definition;
  individual_product : Product_as_individual_view;
END_ENTITY;

ENTITY Physical_assembly_relationship;
  SUBTYPE OF (ASSEMBLY_component_relationship);
  ELF\View_definition_relationship.relating_view : Product_as_individual_view;
  ELF\View_definition_relationship.related_view : Product_as_individual_view;
END_ENTITY;

MIM/IR-Express: On the MIM/IR level we use the same entities as we used for Part and Part_version.

ARM-MIM mapping: The mapping of product_as_individual:

product_as_individual
product_as_individual <= product
{product <- product_related_product_category.products[i]
product_related_product_category <= product_category 
product_category.name='physically realized product'}

ARM-OWL mapping:

  • Product_as_individual maps to an OWL individual of type Product_as_individual.
  • Product_as_realized maps to an OWL individual of type Product_as_realized.
    • The relation Product_as_realized.of_product -> Product_as_individual maps to an OWl ObjectProperty temporal_part.
  • Product_as_individual_view is not individually represented in OWL.
  • Product_as_individual_view_realization maps to an OWL rdf:type statement. Instead of the Product_as_individual_view the referenced Product_as_realized is to be used.
  • Physical_assembly_relationship maps to an OWl ObjectProperty physical_assembly_relationship.
 <Class_of_physical_object rdf:ID="Product_as_individual">
   <rdfs:subClassOf rdf:resource="#Physical_object"/>
 </Class_of_physical_object>

 <Class_of_physical_object rdf:ID="Product_as_individual_version">
   <rdfs:subClassOf rdf:resource="#Product_as_individual"/>
   <owl:unionOf rdf:parseType="Collection">
     <owl:Class rdf:about="#Product_as_planned" />
     <owl:Class rdf:about="#Product_as_realized" />
   </owl:unionOf>
 </Class_of_physical_object>
  
 <Class_of_physical_object rdf:ID="Product_as_planned">
   <rdfs:subClassOf rdf:resource="#Product_as_individual"/>
 </Class_of_physical_object>
 
 <Class_of_physical_object rdf:ID="Product_as_realized">
   <rdfs:subClassOf rdf:resource="#Product_as_individual"/>
   <owl:disjointWith rdf:resource="#Product_as_planned"/>
 </Class_of_physical_object>


Example:

/* Here the original state of my car as it was delivered with the original engine */
#710=PRODUCT('ABX123456789','my car',$,(#302));
#711=PRODUCT_DEFINITION_FORMATION('as-delivered',$,#710);
#712=PRODUCT_DEFINITION('1',$,#711,#701);
#713=PRODUCT_DEFINITION_RELATIONSHIP(' ','physical realization',$,#312,#712);
#714=ASSEMBLY_COMPONENT_USAGE(' ','physical occurrence usage',$,#712,#782);
#715=PRODUCT_DEFINITION_OCCURRENCE_RELATIONSHIP(' ',$,#402,#714);

/* The state after my car got a new engine. Now it no longer fits with the original state */
#721=PRODUCT_DEFINITION_FORMATION('after engine replacement',$,#710);
#722=PRODUCT_DEFINITION('1',$,#721,#701);
#724=ASSEMBLY_COMPONENT_USAGE(' ','physical occurrence usage',$,#722,#792);
#725=PRODUCT_DEFINITION_OCCURRENCE_RELATIONSHIP(' ',$,#402,#724);

#780=PRODUCT('STU4567890123',' ',$,(#302));
#781=PRODUCT_DEFINITION_FORMATION('1',$,#780);
#782=PRODUCT_DEFINITION('1',$,#781,#701);
#783=PRODUCT_DEFINITION_RELATIONSHIP(' ','physical realization',$,#322,#782);

#790=PRODUCT('XYZ987654321 ',' ',$,(#302));
#791=PRODUCT_DEFINITION_FORMATION('1',$,#790);
#792=PRODUCT_DEFINITION('1',$,#791,#701);
#793=PRODUCT_DEFINITION_RELATIONSHIP(' ','physical realization',$,#324,#792);
<step:Product_as_individual rdf:about="#_710">
  <step:id rdf:datatype="&xsd;string">ABX123456789</step:id>
</step:Product_as_individual>
<step:Product_as_realized rdf:about="#_711">
  <step:temporal_part rdf:about="#_710"/>
  <step:id rdf:datatype="&xsd;string">as-delivered</step:id>
  <step:physical_assembly_relationship rdf:about="#_781"/>
  <rdf:type rdf:about="#_312"/>
</step:Product_as_realized>
<step:Product_as_realized rdf:about="#_721">
  <step:temporal_part rdf:about="#_710"/>
  <step:id rdf:datatype="&xsd;string">after engine replacement</step:id>
  <step:physical_assembly_relationship rdf:about="#_791"/>
</step:Product_as_realized>

<step:Product_as_individual rdf:about="#_780">
  <step:id rdf:datatype="&xsd;string">STU4567890123</step:id>
</step:Product_as_individual>
<step:Product_as_realized rdf:about="#_781">
  <step:temporal_part rdf:about="#_780"/>
  <step:id rdf:datatype="&xsd;string">1</step:id>
  <rdf:type rdf:about="#_322"/>
</step:Product_as_realized>
 
<step:Product_as_individual rdf:about="#_790">
  <step:id rdf:datatype="&xsd;string">XYZ987654321</step:id>
</step:Product_as_individual>
<step:Product_as_realized rdf:about="#_791">
  <step:temporal_part rdf:about="#_790"/>
  <step:id rdf:datatype="&xsd;string">1</step:id>
  <rdf:type rdf:about="#_342"/>
</step:Product_as_realized>

[edit] 7.13 Properties for Physically Realized Products

The STEP data model to be used here is identical to the one introduced above in clause Independent and assigned properties. Also the mapping to OWL is quite similar with the exception that Product_as_individual_view is not visible in OWL and product_as_realized is becoming a direct individual of the generated property class. So no restriction class for Assigned_property is needed.

Example:

/* Property "mass when empty" */
#821=GENERAL_PROPERTY_ASSOCIATION(' ',$,#520,#822);
#822=PROPERTY_DEFINITION('mass when empty',$,#722);
#823=PROPERTY_DEFINITION_REPRESENTATION(#822,#825);
#824=REPRESENTATION_CONTEXT(' ',' ');
#825=REPRESENTATION(' ',(#826),#824);
#826=(MASS_MEASURE_WITH_UNIT()MEASURE_REPRESENTATION_ITEM()
      MEASURE_WITH_UNIT(MASS_MEASURE(868),#501)REPRESENTATION_ITEM(' '));
<iso_31:Mass rdf:about="#_826">
  <iso_1000:kilogram_scale>
    <iso:Real>
      <value rdf:datatype="&xsd;double">868</value>
    </iso:Real>
  </iso_1000:kilogram_scale>
</iso_31:Mass>
<rdf:Thing rdf:about="#_721">
  <_520 rdf:resource="#_826"/>
</step:Part_view_definition>

[edit] 7.14 Person & Organization

In this are the ARM and MIM/IR is almost identical with a 1:1 mapping. Because of this we address the MIM/IR level here only. MIM/IR Express:

ENTITY person;
  id : identifier;
  last_name : OPTIONAL label;
  first_name : OPTIONAL label;
  middle_names : OPTIONAL LIST [1:?] OF label;
  prefix_titles : OPTIONAL LIST [1:?] OF label;
  suffix_titles : OPTIONAL LIST [1:?] OF label;
WHERE
  WR1: EXISTS(last_name) OR EXISTS(first_name);
END_ENTITY;

ENTITY organization;
  id : OPTIONAL identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY person_and_organization_role;
  name : label;
DERIVE
  description : text := get_description_value (SELF);
WHERE
  WR1: SIZEOF (USEDIN (SELF, 'BASIC_ATTRIBUTE_SCHEMA.' + 'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
END_ENTITY;

ENTITY person_and_organization;
  the_person : person;
  the_organization : organization;
DERIVE
  name : label := get_name_value (SELF);
  description : text := get_description_value(SELF);
WHERE
  WR1: SIZEOF (USEDIN (SELF, 'BASIC_ATTRIBUTE_SCHEMA.' + 'NAME_ATTRIBUTE.NAMED_ITEM')) <= 1;
  WR2: SIZEOF (USEDIN (SELF, 'BASIC_ATTRIBUTE_SCHEMA.' + 'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
END_ENTITY; 

ENTITY person_and_organization_assignment;
  ABSTRACT SUPERTYPE;
  assigned_person_and_organization : person_and_organization;
  role : person_and_organization_role;
END_ENTITY;

ENTITY applied_person_and_organization_assignment
  SUBTYPE OF (person_and_organization_assignment);
  items : SET [1:?] OF person_and_organization_item;
END_ENTITY;

TYPE person_and_organization_item = EXTENSIBLE SELECT (
  -- in some extensions we find
  product,
  product_definition_formation);
END_TYPE;

AIM-OWL mapping: Both, Person and Organization are considered as sub-classes of physical objects.

<Class_of_physical_object rdf:ID="Person">
  <rdfs:subClassOf rdf:resource="#Physical_object"/>
</Class_of_physical_object>
<Class_of_physical_object rdf:ID="Organization">
  <rdfs:subClassOf rdf:resource="#Physical_object"/>
</Class_of_physical_object>

<owl:DatatypeProperty rdf:ID="last_name">
  <rdfs:subPropertyOf rdf:resource="#label"/>
  <rdfs:domain rdf:resource="#Person"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID="first_name">
  <rdfs:subPropertyOf rdf:resource="#label"/>
  <rdfs:domain rdf:resource="#Person"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID="middle_name">
  <rdfs:subPropertyOf rdf:resource="#label"/>
  <rdfs:domain rdf:resource="#Person"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID="prefix_title">
  <rdfs:subPropertyOf rdf:resource="#label"/>
  <rdfs:domain rdf:resource="#Person"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID="suffix_title">
  <rdfs:subPropertyOf rdf:resource="#label"/>
  <rdfs:domain rdf:resource="#Person"/>
</owl:DatatypeProperty>

Entity Person_and_organization is mapped one-to-one:

<Class_of_physical_object rdf:ID="Person_and_organization">
  <rdfs:subClassOf rdf:resource="#Physical_object"/>
</Class_of_physical_object>
<owl:ObjectProperty rdf:ID="the_person">
  <rdfs:domain rdf:resource="#Person_and_organization"/>
  <rdfs:range rdf:resource="#Person"/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:ID="the_organization">
  <rdfs:domain rdf:resource="#Person_and_organization"/>
  <rdfs:range rdf:resource="#Organization"/>
</owl:ObjectProperty>

Entity Applied_person_and_organization_assignment in the role of id_owner is mapped into a ObjectProperty step:id_owner_assignment:

<owl:ObjectProperty rdf:ID="id_owner_assignment">
  <rdfs:range rdf:resource="#Person_and_organization"/>
</owl:ObjectProperty>

Example:

#100=ORGANIZATION('VW','Volkswagen','company');
#101=PERSON('A0001','Doe','John',(),(),());
#102=PERSON_AND_ORGANIZATION(#101,#100);
#103=NAME_ATTRIBUTE('technical director',#102);
#104=APPLIED_ORGANIZATION_ASSIGNMENT(#100,#105,(#310,#320));
#105=ORGANIZATION_ROLE('id owner');
<step:Organization rdf:about="#_100"> 
  <step:id rdf:datatype="&xsd;string">A0001</step:id>
  <step:name rdf:datatype="&xsd;string">Volkswagen</step:name>
  <step:description rdf:datatype="&xsd;string">Volkswagen</step:name>
</step:Organization>
<step:Person rdf:about="#_101">
  <step:id rdf:datatype="&xsd;string">A0001</step:id>
  <step:last_name rdf:datatype="&xsd;string">Doe</step:last_name>
  <step:first_name rdf:datatype="&xsd;string">John</step:first_name>
</step:Person>
<step:Person_and_organization rdf:about="#_102"> 
  <step:the_organization rdf:resource="#_100"/> 
  <step:the_person rdf:resource="#_101"/> 
</step:Person_and_organization>
<step:Part rdf:about="#_310"> 
  <step:id_owner_assignment rdf:resource="#_102"/>
</step:Part>
<step:Part rdf:about="#_320"> 
  <step:id_owner_assignment rdf:resource="#_102"/>
</step:Part>


[edit] 8 Use case scenario for production and maintenance

This particular use case scenario should show how a STEP-DB can be accessed via OWL for the purpose of adding production and maintenance information. The idea is that some design data is already in the STEP-DB, coming from CAx and PDM systems. Now we show the following actions:

  • Production
    • From a factory site the STEP-DB is queried for design information
    • Factory is manufacturing products, assign serial numbers and write them back into the STEP-DB
  • Maintenance
    • For products under maintenance query the STEP-DB for records of the product according to their serial numbers
    • Manufacture spare parts if not on stock and write the data into the STEP-DB
    • Replace broken parts with spare parts and write the changed configuration information back into the STEP-DB
    • Do measurements of the product and write the result into the STEP-DB

We refer here to the STEP example provided at STEP data model extract and reference example. Because of the much decreased complexity assume that we are talking here on toy cars instead of real cars. We assume that instances #100 till #612 and except #323 to #325 for the 2nd version of the engine, comprising all the design information of the product, coming from some CAD or PDM system and this information is stored in a STEP-DB. Clients can now access this DB via OWL+SPARQL.

[edit] 8.1 Creating of products

The factory gets the order to produce "A0001". With this string it queries the STEP-DB for available design information. If will find :

  • #310 for the part and all its design information

Based on this information the car is manufactured and the following data is written back into the STEP-DB:

  • #710 to #713 for the car
  • #780 to #783 for the engine
  • #714 and #715 for the fact that the engine is assembled into the car.

[edit] 8.1.1 Querying for product information

To know the details what to do it queries the STEP-DB what this information

  • SPARQL query:
PREFIX xsd:
  <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs:
  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf:
  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl:
  <http://www.w3.org/2002/07/owl#>
PREFIX step:
  <http://www.s-ten.net/d3_1_basic_step_ontology.owl#>
PREFIX :
  <jsdai:///S-TEN_D31_example-1.p21#>
CONSTRUCT {

  ?part ?part·pred ?part·obj.
  ?pu ?pu·pred ?pu·obj.
  ?pus ?pus·pred ?pus·obj.
  ?puss ?puss·pred ?puss·obj.
  ?pusse ?pusse·pred ?pusse·obj.
  ?pussv ?pussv·pred ?pussv·obj.
  ?pussvs ?pussvs·pred ?pussvs·obj.
  ?pussvss ?pussvss·pred ?pussvss·obj.
  ?pup ?pup·pred ?pup·obj.
    }
WHERE { GRAPH <http://www.s-ten.net/S-TEN_D31_example-1.owl> {

  ?part a step:Part;
        step:id ?part·id.
  FILTER ( ?part·id = "A0001" )
  ?part ?part·pred ?part·obj.
  ?pu ?pu·ref ?part.
  OPTIONAL {
    ?pu rdfs:subClassOf ?pus.
    ?pus ?pus·pred ?pus·obj.
    OPTIONAL {
      ?pus rdfs:subClassOf ?puss.
      ?puss ?puss·pred ?puss·obj.
      OPTIONAL {
        ?puss owl:onProperty step:nextAssemblyUsageOccurrenceDefinition;
              owl:hasValue ?pussv.
        ?pussv ?pussv·pred ?pussv·obj.
        OPTIONAL {
           ?pussv rdfs:subClassOf ?pussvs.
           ?pussvs ?pussvs·pred ?pussvs·obj.
          OPTIONAL {
             ?pussvs rdfs:subClassOf ?pussvss.
             ?pussvss ?pussvss·pred ?pussvss·obj.
          }
        }
      }
      OPTIONAL {
        ?puss owl:equivalentClass ?pusse.
        ?pusse ?pusse·pred ?pusse·obj.
      }
    }
  }
  OPTIONAL {
    ?pup rdfs:subClassOf ?pu.
    ?pup ?pup·pred ?pup·obj.
  }
  ?pu ?pu·pred ?pu·obj.
} }

As a response the DB delivers all the available version and design information available. This includes the main part A0001 and the assembly component A0002 in their most recent / actual version.

  • OWL data of the DB response:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
  <!ENTITY step "http://www.s-ten.net/d3_1_basic_step_ontology.owl#">
  <!ENTITY dataset "jsdai:///S-TEN_D31_example-1.p21#">
]>

<rdf:RDF
    xmlns="&dataset;"
    xmlns:step="&step;"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:xsd="&xsd;"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:owl="http://www.w3.org/2002/07/owl#">
  <step:Part rdf:ID="_310">
    <step:id rdf:datatype="&xsd;string">A0001</step:id>
    <step:name rdf:datatype="&xsd;string">VW Beetle – P_101</step:name>
  </step:Part>
  <step:Part_view_definition rdf:ID="_312">
    <step:id rdf:datatype="&xsd;string">1</step:id>
    <rdfs:subClassOf>
      <owl:Restriction>
        <owl:onProperty rdf:resource="&step;nextAssemblyUsageOccurrenceDefinition"/>
        <owl:hasValue rdf:resource="#_400"/>
      </owl:Restriction>
    </rdfs:subClassOf>
  </step:Part_view_definition>
  <step:Part_view_definition rdf:ID="_314">
    <rdfs:subClassOf rdf:resource="#_522"/>
    <rdfs:subClassOf rdf:resource="#_512"/>
    <step:id rdf:datatype="&xsd;string">2</step:id>
  </step:Part_view_definition>
  <step:Part_version rdf:ID="_311">
    <rdfs:subClassOf rdf:resource="#_310"/>
    <step:id rdf:datatype="&xsd;string">1</step:id>
    <rdfs:subClassOf rdf:resource="#_312"/>
    <rdfs:subClassOf rdf:resource="#_314"/>
  </step:Part_version>
  <step:Part rdf:ID="_320">
    <step:id rdf:datatype="&xsd;string">A0002</step:id>
    <step:name rdf:datatype="&xsd;string">Engine-4/50KW-BX</step:name>
  </step:Part>
  <step:Part_view_definition rdf:ID="_322">
    <step:id rdf:datatype="&xsd;string">1</step:id>
  </step:Part_view_definition>
  <step:Part_version rdf:ID="_321">
    <step:id rdf:datatype="&xsd;string">1</step:id>
    <rdfs:subClassOf rdf:resource="#_322"/>
    <rdfs:subClassOf rdf:resource="#_320"/>
  </step:Part_version>
  <step:Part_occurrence rdf:ID="_400">
    <step:name rdf:datatype="&xsd;string"> </step:name>
    <rdfs:subClassOf rdf:resource="#_321/>
    <step:id rdf:datatype="&xsd;string">SI0001</step:id>
  </step:Part_occurrence>
  <step:Property_definition rdf:ID="_522">
    <owl:equivalentClass>
      <owl:Restriction>
        <owl:hasValue rdf:resource="#_526"/>
        <owl:onProperty rdf:resource="#_520"/>
      </owl:Restriction>
    </owl:equivalentClass>
  </step:Property_definition>
  <step:Property_definition rdf:ID="_512">
    <owl:equivalentClass>
      <owl:Restriction>
        <owl:onProperty rdf:resource="#_510"/>
        <owl:hasValue rdf:resource="#_516"/>
      </owl:Restriction>
    </owl:equivalentClass>
  </step:Property_definition>
</rdf:RDF>

[edit] 8.1.2 Producing individuals

Now physical individuals of A0001 and A0002 are created, they get assigned SN and this data is written back into the DB via OWL

  • OWL for the new created objects ABX123456789 and STU4567890123. All new objects have blank nodes only, but they refer to the data it got before.
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
  <!ENTITY dataset "jsdai:///S-TEN_D31_example-1.p21#">
]>

<rdf:RDF
    xmlns="&dataset;"
    xmlns:step="http://www.s-ten.net/d3_1_basic_step_ontology.owl#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:xsd="&xsd;"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xml:base="jsdai:///S-TEN_D31_example-1.p21">

  <!-- ABX123456789 -->
  <step:Product_as_individual rdf:nodeID="ABX123456789">
    <step:name rdf:datatype="&xsd;string">my car</step:name>
    <step:id rdf:datatype="&xsd;string">ABX123456789</step:id>
  </step:Product_as_individual>
  <step:Product_as_realized rdf:nodeID="ABX123456789_realized">
    <step:temporal_part rdf:nodeID="ABX123456789"/>
    <step:physical_assembly_relationship>
    </step:physical_assembly_relationship>
    <step:id rdf:datatype="&xsd;string">as-delivered</step:id>
    <rdf:type rdf:resource="#_312"/>
  </step:Product_as_realized>
  <step:Part_view_definition rdf:about="#_312"/>

  <!-- STU4567890123 -->
  <step:Product_as_individual rdf:nodeID="STU4567890123">
    <step:id rdf:datatype="&xsd;string">STU4567890123</step:id>
    <step:name rdf:datatype="&xsd;string"> </step:name>
  </step:Product_as_individual>
  <step:Product_as_realized rdf:nodeID="STU4567890123_realized">
    <step:temporal_part rdf:nodeID="STU4567890123"/>
    <rdf:type rdf:resource="#_322"/>
    <step:id rdf:datatype="&xsd;string">1</step:id>
  </step:Product_as_realized>
  <step:Part_view_definition rdf:about="#_322"/>
</rdf:RDF>

[edit] 8.2 Maintenance

Some time later the engine of the car breaks and needs to be replaced by a new one.

[edit] 8.2.1 Obtaining information about the car and the engine

The maintenance team first search the DB for the serial number of the car and its broken Engine

  • Query for the Product as individual ABX123456789:
PREFIX xsd:
  <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs:
  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf:
  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl:
  <http://www.w3.org/2002/07/owl#>
PREFIX step:
  <http://www.s-ten.net/d3_1_basic_step_ontology.owl#>
PREFIX :
  <jsdai:///S-TEN_D31_example-1.p21#>
CONSTRUCT {

  ?pai ?pai·pred ?pai·obj.
  ?par ?par·pred ?par·obj.
    }
WHERE { GRAPH <http://www.s-ten.net/S-TEN_D31_example-1.owl> {

  ?pai a step:Product_as_individual;
       step:id ?pai·id.
  FILTER ( ?pai·id = "ABX123456789" )
  ?pai ?pai·pred ?pai·obj.
  OPTIONAL {
    ?par step:temporal_part ?pai.
    ?par ?par·pred ?par·obj.
  }
} }
  • Query result for "ABX123456789":
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
  <!ENTITY dataset "jsdai:///S-TEN_D31_example-1.p21#">
]>

<rdf:RDF
    xmlns="&dataset;"
    xmlns:step="http://www.s-ten.net/d3_1_basic_step_ontology.owl#"
    xmlns:iso31="http://www.s-ten.net/iso31.owl#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:xsd="&xsd;"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:iso1000="http://www.s-ten.net/iso1000.owl#">
  <step:Product_as_individual rdf:ID="_710">
    <step:id rdf:datatype="&xsd;string">ABX123456789</step:id>
    <step:name rdf:datatype="&xsd;string">my car</step:name>
  </step:Product_as_individual>
  <step:Product_as_realized rdf:ID="_711">
    <step:physical_assembly_relationship rdf:resource="#_781"/>
    <rdf:type rdf:resource="&dataset;_312"/>
    <step:id rdf:datatype="&xsd;string">as-delivered</step:id>
    <step:temporal_part rdf:resource="#_710"/>
  </step:Product_as_realized>
</rdf:RDF>
  • Query for the Product as individual STU4567890123:
PREFIX xsd:
  <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs:
  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf:
  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX step:
  <http://www.s-ten.net/d3_1_basic_step_ontology.owl#>
PREFIX :
  <jsdai:///S-TEN_D31_example-1.p21#>
CONSTRUCT {

  ?pai ?pai·pred ?pai·obj.
  ?par ?par·pred ?par·obj.
  ?pvd ?pvd·pred ?pvd·obj.
  ?pv ?pv·pred ?pv·obj.
  ?p ?p·pred ?p·obj.
    }
WHERE { GRAPH <http://www.s-ten.net/S-TEN_D31_example-1.owl> {

  ?pai a step:Product_as_individual;
       step:id ?pai·id.
  FILTER ( ?pai·id = "STU4567890123" )
  ?pai ?pai·pred ?pai·obj.
  OPTIONAL {
    ?par step:temporal_part ?pai.
    ?par ?par·pred ?par·obj.
    OPTIONAL {
      ?par a ?pvd.
      ?pvd ?pvd·pred ?pvd·obj.
      ?pv rdfs:subClassOf ?pvd.
      ?pv ?pv·pred ?pv·obj.
      ?pv rdfs:subClassOf ?p.
      ?p a step:Part.
      ?p ?p·pred ?p·obj.
    }
  }
} }
  • Query result for "STU4567890123":
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
  <!ENTITY dataset "jsdai:///S-TEN_D31_example-1.p21#">
]>

<rdf:RDF
    xmlns=""
    xmlns:step="http://www.s-ten.net/d3_1_basic_step_ontology.owl#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:xsd="&xsd;"
  <step:Product_as_individual rdf:ID="_780">
    <step:id rdf:datatype="&xsd;string">STU4567890123</step:id>
    <step:name rdf:datatype="&xsd;string"> </step:name>
  </step:Product_as_individual>
  <step:Product_as_realized rdf:ID="_781">
    <rdf:type rdf:resource="&dataset;#_322"/>
    <step:id rdf:datatype="&xsd;string">1</step:id>
    <step:temporal_part rdf:resource="#_780"/>
  </step:Product_as_realized>
  <step:Part_view_definition rdf:ID="_322">
    <step:id rdf:datatype="&xsd;string">1</step:id>
  </step:Part_view_definition>
  <step:Part_version rdf:ID="_321">
    <rdfs:subClassOf rdf:resource="#_322"/>
    <rdfs:subClassOf rdf:resource="#_320"/>
    <step:id rdf:datatype="&xsd;string">1</step:id>
  </step:Part_version>
  <step:Part rdf:ID="_320">
    <step:id rdf:datatype="&xsd;string">A0002</step:id>
    <step:name rdf:datatype="&xsd;string">Engine-4/50KW-BX</step:name>
  </step:Part>
</rdf:RDF>

[edit] 8.2.2 Design of a new version for the engine

Meanwhile someone has developed a new design version "v2" for Part "A0002". This data is written into the STEP-DB:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
  <!ENTITY dataset "jsdai:///S-TEN_D31_example-1.p21#">
  <!ENTITY maintenance "http://www.s-ten.net/maintenance/S-TEN_D31_example-1.p21#">
]>

<rdf:RDF
    xmlns="&dataset;"
    xmlns:step="http://www.s-ten.net/d3_1_basic_step_ontology.owl#"
    xmlns:maintenance="&maintenance;"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:xsd="&xsd;"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xml:base="jsdai:///S-TEN_D31_example-1.p21">
 <step:Part_view_definition rdf:about="&maintenance;NEW_ENGINE_pvd">
   <step:id rdf:datatype="&xsd;string">1</step:id>
 </step:Part_view_definition>
 <step:Part_version rdf:about="&maintenance;NEW_ENGINE_pv">
   <rdfs:subClassOf rdf:resource="#_320"/>
   <rdfs:subClassOf rdf:resource="&maintenance;NEW_ENGINE_pvd"/>
   <step:Part_version_successor rdf:resource="#_321"/>
   <step:id rdf:datatype="&xsd;string">v2</step:id>
 </step:Part_version>
 <step:Part rdf:about="#_320"/>
</rdf:RDF>

[edit] 8.2.3 Replacement of engine

Next the new engine is produced and installed in the car

  • OWL for the production and replacement
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
  <!ENTITY dataset "jsdai:///S-TEN_D31_example-1.p21#">
  <!ENTITY maintenance "http://www.s-ten.net/maintenance/S-TEN_D31_example-1.p21#">
]>

<rdf:RDF
    xmlns="&dataset;"
    xmlns:step="http://www.s-ten.net/d3_1_basic_step_ontology.owl#"
    xmlns:maintenance="&maintenance;"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:xsd="&xsd;"
    xml:base="jsdai:///S-TEN_D31_example-1.p21">
  <step:Product_as_individual rdf:about="#_710"/>
  <step:Product_as_realized rdf:about="&maintenance;REPAIRED_CAR_par">
    <step:physical_assembly_relationship rdf:resource="&maintenance;NEW_ENGINE_par"/>
    <step:id rdf:datatype="&xsd;string">after engine replacement</step:id>
    <step:temporal_part rdf:resource="#_710"/>
  </step:Product_as_realized>
  <step:Product_as_realized rdf:about="&maintenance;NEW_ENGINE_par">
    <rdf:type rdf:resource="&maintenance;NEW_ENGINE_pvd"/>
    <step:temporal_part rdf:resource="&maintenance;NEW_ENGINE_pai"/>
    <step:id rdf:datatype="&xsd;string">1</step:id>
  </step:Product_as_realized>
  <step:Product_as_individual rdf:about="&maintenance;NEW_ENGINE_pai">
    <step:id rdf:datatype="&xsd;string">XYZ987654321</step:id>
    <step:name rdf:datatype="&xsd;string"></step:name>
  </step:Product_as_individual>
</rdf:RDF>

[edit] 8.2.4 Measurement

The repaired car goes to a scale to measure the actual weight. The new weight is written back to the STEP

  • OWL data about the actual weight:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
  <!ENTITY owl "http://www.w3.org/2002/07/owl#">
  <!ENTITY iso31 "http://www.s-ten.net/iso31.owl#">
  <!ENTITY dataset "jsdai:///S-TEN_D31_example-1.p21#">
  <!ENTITY maintenance "http://www.s-ten.net/maintenance/S-TEN_D31_example-1.p21#">
]>

<rdf:RDF
    xmlns="&dataset;"
    xmlns:step="http://www.s-ten.net/d3_1_basic_step_ontology.owl#"
    xmlns:maintenance="&maintenance;"
    xmlns:iso31="&iso31;"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:xsd="&xsd;"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:owl="&owl;"
    xmlns:iso1000="http://www.s-ten.net/iso1000.owl#">
  <step:Physical_property_of_product_as_individual rdf:about="&maintenance;MASS_WHEN_EMPTY">
    <rdf:type rdf:resource="&owl;FunctionalProperty"/>
    <step:name rdf:datatype="&xsd;string">mass when empty</step:name>
    <step:id rdf:datatype="&xsd;string"></step:id>
    <rdfs:range rdf:resource="&iso31;Mass"/>
  </step:Physical_property_of_product_as_individual>
  <iso31:Mass rdf:about="&maintenance;REPAIRED_CAR_mass">
    <iso1000:kilogram_scale>
      <iso1000:Real>
        <iso1000:value rdf:datatype="&xsd;double">868.0</iso1000:value>
      </iso1000:Real>
    </iso1000:kilogram_scale>
  </iso31:Mass>
  <step:Product_as_realized rdf:about="&maintenance;REPAIRED_CAR_par">
    <maintenance:MASS_WHEN_EMPTY rdf:resource="&maintenance;REPAIRED_CAR_mass"/>
  </step:Product_as_realized>
</rdf:RDF>


[edit] 9 Analysis to extend JSDAI for semantic web services using SPARQL

For the production and maintenance use case scenario we need a semantic web server supporting STEP data. One way for its implementation is to link the current JSDAI technology with available OWL technology. JSDAI can store application data either locally or remotely in a relational DB such as MySQL or Oracle. For extended access functionality on relational databases the so called SDAI-XML query was developed as part of the European funded IDA-STEP project, see D08-2-v3.pdf.

For the semantic web however the SPARQL query language, an upcoming W3C standard available at http://www.w3.org/TR/rdf-sparql-query/, is one of the hot candidates to be widely used for semantic web services.

The annex investigates how STEP-Technology and Semantic Web technology could be combined to set up an OWL-STEP services, using SPARQL as the front end and JSDAI as backend.

[edit] 9.1 Feature comparison of SDAI-XML Query versus SPARQL:

SDAI-XML query SPARQL
SDAI-XML query is based on path traversing from query source to query result. SPARQL is based graph matching and solutions
SDAI-XML query presents results as EEntity instance aggregate in JSDAI or as list of result items SPARQL supports the following result forms: selecting variables, constructing output graph, and asking "yes or no" questions
SDAI-XML query realizes mapping possibilities using query libraries SPARQL realizes mapping by allowing to construct arbitrary RDF graphs

[edit] 9.2 Testing JSDAI and Jena/SPARQL interoperability and performance

Software versions used for the test:

  • Jena 2.4
  • MySQL 4.1
  • JSDAI 4.1

Jena SPARQL support was tested following these steps:

  • STEP data was imported into RDF database
  • A simple STEP to RDF converter was prepared for this purpose. Entities and their attribute values are converted one-to-one into RDF triples.
  • Example P21 files were imported int RDF database containing approx. 60000, 500000, 1500000, 2500000 instances.
  • Each P21 file was imported into its named graph
  • Sample queries were executed
  • List design files in database:
SELECT ?g
WHERE { GRAPH ?g { } }
ORDER BY ?g

Result output:

---------------------------------------
| g                                   |
=======================================
| <jsdai://LAUFLI1pre_41.p21#default> |
| <jsdai://design2.210#default>       |
| <jsdai://design5.210#default>       |
| <jsdai://design6.210#default>       |
---------------------------------------
Query time: 419 milliseconds
  • Select parts, their versions and associated PCAa by design files:
PREFIX rdf:
  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd:
  <http://www.w3.org/2001/XMLSchema#>
PREFIX assembly_module_design_xim:
  <http://jsdai.net/express/assembly_module_design_xim#>
PREFIX part_and_version_identification_xim:
  <http://jsdai.net/express/part_and_version_identification_xim#>
PREFIX physical_unit_design_view_xim:
  <http://jsdai.net/express/physical_unit_design_view_xim#>
PREFIX product_definition_schema:
  <http://jsdai.net/express/product_definition_schema#>
PREFIX shape_property_assignment_xim:
  <http://jsdai.net/express/shape_property_assignment_xim#>
PREFIX :
  <jsdai://meta#>
SELECT ?g ?pt ?pid ?pv ?pvid ?pca ?p ?o
WHERE {
  GRAPH ?g {
    ?pt a part_and_version_identification_xim:part ;
          product_definition_schema:product.id ?pid .
    ?pv product_definition_schema:product_definition_formation.of_product ?pt ;
        product_definition_schema:product_definition_formation.id ?pvid .
    ?pca product_definition_schema:product_definition.formation ?pv ;
         a assembly_module_design_xim:pca ;
         ?p ?o
    FILTER ( ?p != rdf:type )
  }
}
ORDER BY ?g ?pt ?pv

Result output:

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| g                                   | pt                              | pid                          | pv                              | pvid            | pca                             | p                                                               | o                               |
==================================================================================================================================================================================================================================================================================================
| <jsdai://LAUFLI1pre_41.p21#default> | <jsdai://LAUFLI1pre_41.p21#_38> | "LAUFLI1pre_pca"^^xsd:string | <jsdai://LAUFLI1pre_41.p21#_39> | "1"^^xsd:string | <jsdai://LAUFLI1pre_41.p21#_44> | physical_unit_design_view_xim:part_design_view.usage_view       | <jsdai://LAUFLI1pre_41.p21#_40> |
| <jsdai://LAUFLI1pre_41.p21#default> | <jsdai://LAUFLI1pre_41.p21#_38> | "LAUFLI1pre_pca"^^xsd:string | <jsdai://LAUFLI1pre_41.p21#_39> | "1"^^xsd:string | <jsdai://LAUFLI1pre_41.p21#_44> | product_definition_schema:product_definition.formation          | <jsdai://LAUFLI1pre_41.p21#_39> |
| <jsdai://LAUFLI1pre_41.p21#default> | <jsdai://LAUFLI1pre_41.p21#_38> | "LAUFLI1pre_pca"^^xsd:string | <jsdai://LAUFLI1pre_41.p21#_39> | "1"^^xsd:string | <jsdai://LAUFLI1pre_41.p21#_44> | product_definition_schema:product_definition.frame_of_reference | <jsdai://LAUFLI1pre_41.p21#_4>  |
| <jsdai://LAUFLI1pre_41.p21#default> | <jsdai://LAUFLI1pre_41.p21#_38> | "LAUFLI1pre_pca"^^xsd:string | <jsdai://LAUFLI1pre_41.p21#_39> | "1"^^xsd:string | <jsdai://LAUFLI1pre_41.p21#_44> | product_definition_schema:product_definition.id                 | "Unknown"^^xsd:string           |
| <jsdai://LAUFLI1pre_41.p21#default> | <jsdai://LAUFLI1pre_41.p21#_38> | "LAUFLI1pre_pca"^^xsd:string | <jsdai://LAUFLI1pre_41.p21#_39> | "1"^^xsd:string | <jsdai://LAUFLI1pre_41.p21#_44> | shape_property_assignment_xim:item_shape.id_x                   | "1"^^xsd:string                 |
| <jsdai://design2.210#default>       | <jsdai://design2.210#_7>        | "design2 (PCA)"^^xsd:string  | <jsdai://design2.210#_8>        | "1"^^xsd:string | <jsdai://design2.210#_11>       | physical_unit_design_view_xim:part_design_view.usage_view       | <jsdai://design2.210#_6>        |
| <jsdai://design2.210#default>       | <jsdai://design2.210#_7>        | "design2 (PCA)"^^xsd:string  | <jsdai://design2.210#_8>        | "1"^^xsd:string | <jsdai://design2.210#_11>       | product_definition_schema:product_definition.formation          | <jsdai://design2.210#_8>        |
| <jsdai://design2.210#default>       | <jsdai://design2.210#_7>        | "design2 (PCA)"^^xsd:string  | <jsdai://design2.210#_8>        | "1"^^xsd:string | <jsdai://design2.210#_11>       | product_definition_schema:product_definition.frame_of_reference | <jsdai://design2.210#_4>        |
| <jsdai://design2.210#default>       | <jsdai://design2.210#_7>        | "design2 (PCA)"^^xsd:string  | <jsdai://design2.210#_8>        | "1"^^xsd:string | <jsdai://design2.210#_11>       | product_definition_schema:product_definition.id                 | "1"^^xsd:string                 |
| <jsdai://design2.210#default>       | <jsdai://design2.210#_7>        | "design2 (PCA)"^^xsd:string  | <jsdai://design2.210#_8>        | "1"^^xsd:string | <jsdai://design2.210#_11>       | shape_property_assignment_xim:item_shape.id_x                   | "1"^^xsd:string                 |
| <jsdai://design5.210#default>       | <jsdai://design5.210#_7>        | "design5 (PCA)"^^xsd:string  | <jsdai://design5.210#_8>        | "1"^^xsd:string | <jsdai://design5.210#_11>       | physical_unit_design_view_xim:part_design_view.usage_view       | <jsdai://design5.210#_6>        |
| <jsdai://design5.210#default>       | <jsdai://design5.210#_7>        | "design5 (PCA)"^^xsd:string  | <jsdai://design5.210#_8>        | "1"^^xsd:string | <jsdai://design5.210#_11>       | product_definition_schema:product_definition.formation          | <jsdai://design5.210#_8>        |
| <jsdai://design5.210#default>       | <jsdai://design5.210#_7>        | "design5 (PCA)"^^xsd:string  | <jsdai://design5.210#_8>        | "1"^^xsd:string | <jsdai://design5.210#_11>       | product_definition_schema:product_definition.frame_of_reference | <jsdai://design5.210#_4>        |
| <jsdai://design5.210#default>       | <jsdai://design5.210#_7>        | "design5 (PCA)"^^xsd:string  | <jsdai://design5.210#_8>        | "1"^^xsd:string | <jsdai://design5.210#_11>       | product_definition_schema:product_definition.id                 | "1"^^xsd:string                 |
| <jsdai://design5.210#default>       | <jsdai://design5.210#_7>        | "design5 (PCA)"^^xsd:string  | <jsdai://design5.210#_8>        | "1"^^xsd:string | <jsdai://design5.210#_11>       | shape_property_assignment_xim:item_shape.id_x                   | "1"^^xsd:string                 |
| <jsdai://design6.210#default>       | <jsdai://design6.210#_7>        | "design6 (PCA)"^^xsd:string  | <jsdai://design6.210#_8>        | "1"^^xsd:string | <jsdai://design6.210#_11>       | physical_unit_design_view_xim:part_design_view.usage_view       | <jsdai://design6.210#_6>        |
| <jsdai://design6.210#default>       | <jsdai://design6.210#_7>        | "design6 (PCA)"^^xsd:string  | <jsdai://design6.210#_8>        | "1"^^xsd:string | <jsdai://design6.210#_11>       | product_definition_schema:product_definition.formation          | <jsdai://design6.210#_8>        |
| <jsdai://design6.210#default>       | <jsdai://design6.210#_7>        | "design6 (PCA)"^^xsd:string  | <jsdai://design6.210#_8>        | "1"^^xsd:string | <jsdai://design6.210#_11>       | product_definition_schema:product_definition.frame_of_reference | <jsdai://design6.210#_4>        |
| <jsdai://design6.210#default>       | <jsdai://design6.210#_7>        | "design6 (PCA)"^^xsd:string  | <jsdai://design6.210#_8>        | "1"^^xsd:string | <jsdai://design6.210#_11>       | product_definition_schema:product_definition.id                 | "1"^^xsd:string                 |
| <jsdai://design6.210#default>       | <jsdai://design6.210#_7>        | "design6 (PCA)"^^xsd:string  | <jsdai://design6.210#_8>        | "1"^^xsd:string | <jsdai://design6.210#_11>       | shape_property_assignment_xim:item_shape.id_x                   | "1"^^xsd:string                 |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Query time: 569 milliseconds
  • Mapping to a new data structure:
PREFIX rdf:
  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd:
  <http://www.w3.org/2001/XMLSchema#>
PREFIX assembly_module_design_xim:
  <http://jsdai.net/express/assembly_module_design_xim#>
PREFIX part_and_version_identification_xim:
  <http://jsdai.net/express/part_and_version_identification_xim#>
PREFIX physical_unit_design_view_xim:
  <http://jsdai.net/express/physical_unit_design_view_xim#>
PREFIX product_definition_schema:
  <http://jsdai.net/express/product_definition_schema#>
PREFIX shape_property_assignment_xim:
  <http://jsdai.net/express/shape_property_assignment_xim#>
PREFIX :
  <jsdai://meta#>
CONSTRUCT { ?g rdf:type :Design;
               :part ?pt.
            ?pt a :Part;
                :partId ?pid;
                :partVersion ?pv.
            ?pv a :PartVersion;
                :partVersionId ?pvid;
                :pca ?pca.
            ?pca a :Pca;
                 ?p ?o }
WHERE {
  GRAPH ?g {
    ?pt a part_and_version_identification_xim:part ;
          product_definition_schema:product.id ?pid .
    ?pv product_definition_schema:product_definition_formation.of_product ?pt ;
        product_definition_schema:product_definition_formation.id ?pvid .
    ?pca product_definition_schema:product_definition.formation ?pv ;
         a assembly_module_design_xim:pca ;
         ?p ?o
    FILTER ( ?p != rdf:type )
  }
}

Result output:

<rdf:RDF
    xmlns:shape_property_assignment_xim="http://jsdai.net/express/shape_property_assignment_xim#"
    xmlns:physical_unit_design_view_xim="http://jsdai.net/express/physical_unit_design_view_xim#"
    xmlns="jsdai://meta#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:product_definition_schema="http://jsdai.net/express/product_definition_schema#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:part_and_version_identification_xim="http://jsdai.net/express/part_and_version_identification_xim#"
    xmlns:assembly_module_design_xim="http://jsdai.net/express/assembly_module_design_xim#">
  <Part rdf:about="jsdai://LAUFLI1pre_41.p21#_38">
    <partVersion>
      <PartVersion rdf:about="jsdai://LAUFLI1pre_41.p21#_39">
        <pca>
          <Pca rdf:about="jsdai://LAUFLI1pre_41.p21#_44">
            <physical_unit_design_view_xim:part_design_view.usage_view rdf:resource="jsdai://LAUFLI1pre_41.p21#_40"/>
            <product_definition_schema:product_definition.id rdf:datatype=
            "http://www.w3.org/2001/XMLSchema#string">Unknown</product_definition_schema:product_definition.id>
            <product_definition_schema:product_definition.frame_of_reference rdf:resource="jsdai://LAUFLI1pre_41.p21#_4"/>
            <shape_property_assignment_xim:item_shape.id_x rdf:datatype=
            "http://www.w3.org/2001/XMLSchema#string">1</shape_property_assignment_xim:item_shape.id_x>
            <product_definition_schema:product_definition.formation rdf:resource="jsdai://LAUFLI1pre_41.p21#_39"/>
          </Pca>
        </pca>
        <partVersionId rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >1</partVersionId>
      </PartVersion>
    </partVersion>
    <partId rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >LAUFLI1pre_pca</partId>
  </Part>
  <Pca rdf:about="jsdai://design2.210#_11">
    <product_definition_schema:product_definition.id rdf:datatype=
    "http://www.w3.org/2001/XMLSchema#string">1</product_definition_schema:product_definition.id>
    <product_definition_schema:product_definition.frame_of_reference rdf:resource="jsdai://design2.210#_4"/>
    <product_definition_schema:product_definition.formation>
      <PartVersion rdf:about="jsdai://design2.210#_8">
        <partVersionId rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >1</partVersionId>
        <pca rdf:resource="jsdai://design2.210#_11"/>
      </PartVersion>
    </product_definition_schema:product_definition.formation>
    <shape_property_assignment_xim:item_shape.id_x rdf:datatype=
    "http://www.w3.org/2001/XMLSchema#string">1</shape_property_assignment_xim:item_shape.id_x>
    <physical_unit_design_view_xim:part_design_view.usage_view rdf:resource="jsdai://design2.210#_6"/>
  </Pca>
  <Part rdf:about="jsdai://design2.210#_7">
    <partId rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >design2 (PCA)</partId>
    <partVersion rdf:resource="jsdai://design2.210#_8"/>
  </Part>
  <Part rdf:about="jsdai://design6.210#_7">
    <partId rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >design6 (PCA)</partId>
    <partVersion>
      <PartVersion rdf:about="jsdai://design6.210#_8">
        <partVersionId rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >1</partVersionId>
        <pca>
          <Pca rdf:about="jsdai://design6.210#_11">
            <product_definition_schema:product_definition.id rdf:datatype=
            "http://www.w3.org/2001/XMLSchema#string">1</product_definition_schema:product_definition.id>
            <product_definition_schema:product_definition.formation rdf:resource="jsdai://design6.210#_8"/>
            <product_definition_schema:product_definition.frame_of_reference rdf:resource="jsdai://design6.210#_4"/>
            <physical_unit_design_view_xim:part_design_view.usage_view rdf:resource="jsdai://design6.210#_6"/>
            <shape_property_assignment_xim:item_shape.id_x rdf:datatype=
            "http://www.w3.org/2001/XMLSchema#string">1</shape_property_assignment_xim:item_shape.id_x>
          </Pca>
        </pca>
      </PartVersion>
    </partVersion>
  </Part>
  <PartVersion rdf:about="jsdai://design5.210#_8">
    <pca>
      <Pca rdf:about="jsdai://design5.210#_11">
        <product_definition_schema:product_definition.frame_of_reference rdf:resource="jsdai://design5.210#_4"/>
        <product_definition_schema:product_definition.id rdf:datatype=
        "http://www.w3.org/2001/XMLSchema#string">1</product_definition_schema:product_definition.id>
        <product_definition_schema:product_definition.formation rdf:resource="jsdai://design5.210#_8"/>
        <physical_unit_design_view_xim:part_design_view.usage_view rdf:resource="jsdai://design5.210#_6"/>
        <shape_property_assignment_xim:item_shape.id_x rdf:datatype=
        "http://www.w3.org/2001/XMLSchema#string">1</shape_property_assignment_xim:item_shape.id_x>
      </Pca>
    </pca>
    <partVersionId rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >1</partVersionId>
  </PartVersion>
  <Design rdf:about="jsdai://LAUFLI1pre_41.p21#default">
    <part rdf:resource="jsdai://LAUFLI1pre_41.p21#_38"/>
  </Design>
  <Design rdf:about="jsdai://design5.210#default">
    <part>
      <Part rdf:about="jsdai://design5.210#_7">
        <partId rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >design5 (PCA)</partId>
        <partVersion rdf:resource="jsdai://design5.210#_8"/>
      </Part>
    </part>
  </Design>
  <Design rdf:about="jsdai://design2.210#default">
    <part rdf:resource="jsdai://design2.210#_7"/>
  </Design>
  <Design rdf:about="jsdai://design6.210#default">
    <part rdf:resource="jsdai://design6.210#_7"/>
  </Design>
</rdf:RDF>
Query time: 820 milliseconds

This test shows that JSDAI and Jena can work together efficiently, and that even bigger amounts of data can be transfered between these systems.

[edit] 9.3 Options for combining Jena/SPARQL with JSDAI-DB

There are several possibilities on how JSDAI-DB and Jena frameworks could contribute each other:

  • Add JSDAI-DB as another Jena SQL database engine
    Advantages:
    • It cleanly integrates into Jena framework
    Disadvantages:
    • It may not be efficient
    • It may not be possible to implement
  • Add another Jena Model implementation which works on JSDAI-DB
    Advantages:
    • It should work efficiently with current Jena framework
    Disadvantages:
    • It will not be a part of Jena but kind of an extension which could prevent further integration with add-ons like http://www.joseki.org/
    • It requires tight cooperation with Jena internals which means that it will be expensive to implement this and prone to fail working in future Jena versions
  • Have two synchronized databases JSDAI-DB and Jena RDB
    Advantages:
    • It is pretty straightforward to implement on JSDAI-DB bridge level
    • It is relatively cheap to implement
    • JSDAI and Jena will work native with their databases
    Disadvantages:
    • Slowdown in whole operations but this could be relaxed by asynchronous coupling of JSDAI-DB and Jena RDB
    • Doubles
  • Add another client backend implementation to JSDAI Runtime which works with Jena RDB Models directly
    Advantages:
    • This could lead to future JSDAI extension to work with only data that is on interest at the moment without loading it completely into memory which would not only reduce memory usage but possibly increase operating speed
    Disadvantages:
    • Could be relatively expensive to implement
  • Change JSDAI to become compatibility layer between JSDAI applications and Jena framework
    Advantages:
    • JSDAI applications will work almost directly with Jena and RDF integrating directly into SemanticWeb
    • This may or may not lead to speed increase (see the opposite point in disadvantage list)
    Disadvantages:
    • This may or may not lead to speed decrease
    • It will be expensive to implement this because it would require changing of many of JSDAI internals
    • It may not be possbile to have this working efficiently


[edit] 10 Realised software architecture

To prove and test STEP-OWL mapping some prototype software was developed.

[edit] 10.1 Architectural considerations

The goal of developing applications was to have software prototypes that would be easily manageable and focused to accomplish above defined tasks. Therefore several standalone simple command line applications were developed. Each application can be launched independently. Also to promote simplicity each application is a separate Java class and there is no code sharing between applications.

[edit] 10.2 Developed applications

The following applications were designed for technology validation phase:

  • P21ToJenaDbModel: JSDAI Application to convert from XIM to RDF triples using Jena-Database
  • RdfP21Merger: JSDAI application to convert STEP-RDF triples into STEP file
  • SparqlQuery: SPARQL query execution application

[edit] 10.2.1 P21ToJenaDbModel

JSDAI Application to convert from XIM to RDF triples using Jena-Database

[edit] 10.2.1.1 Description

This applications reads in STEP file and writes its content to Jena database as a named model. Each SdaiModel in STEP file is written to RDF model named using this pattern: jsdai:///name_of_file_provided_in_command_line#sdai_model_name. For instance the name reference example RDF model is jsdai:///S-TEN_D31_example-1.p21#default. The conversion from STEP to RDF is as much straightforward as possible using some simple rules. See Annex 5 for example on how reference example XIM dataset converted to RDF triples looks.

[edit] 10.2.1.2 Invocation

   java jsdai.tools.owl.P21ToJenaDbModel p21-file(s)
  • p21-file(s) is one or more files that should be loaded to Jena database

[edit] 10.2.1.3 Dependencies and configuration

This application requires JSDAI Runtime, Jena framework and relational database supported by Jena, eg. MySQL 4.1.x. JSDAI Runtime and Jena framework related jar files have to be provided by constructing appropriate Java class path. Connection to database parameters are specified using Java system properties on command line, eg. -Djena.db.url=jdbc:mysql://localhost/jenatest -Djena.db.driver=com.mysql.jdbc.Driver -Djena.db.user=jena -Djena.db.password=sercet. JSDAI Runtime configuration is loaded from jsdai.properties file. The directory where JSDAI configuration file is located can be specified by Java system property adding this option to the command line: -Djsdai.properties=/path/to/jsdai/properties. Refer to JSDAI documentation for further details.

[edit] 10.2.2 RdfP21Merger

JSDAI application to convert STEP-RDF triples into STEP file

[edit] 10.2.2.1 Description

This application reads STEP-RDF model provided in command line and applies the data to either existing STEP file or creates a new STEP file. Application functions either in data merge or data creation mode. This depends on command line parameters provided. The results of merging/creation are exported to STEP file.

Data merge mode tries to apply STEP-RDF data to existing entity instances in STEP population. If the matching instance is located then values for the attributes that correspond provided RDF triples are updated. Matching is done in the following way. First instance with # number that corresponds URI of the RDF subject node is searched and checking if the instance is compatible with RDF type is performed. In case of success this instance is used. Otherwise if RDF subject node is a blank node then the instance with attribute values that match properties of RDF node is searched. If this search fails or if RDF subject node in not a blank node the new instance is created. If URI is available then the matching between URI and # number is recorded in the map structure. This map is persisted between runs of application so that if the instance is later referred from another instance by the same URI the instance with the same # number would be reused. Attribute values are set for the new instance from provided RDF triples.

For data creation mode the searching is done only for blank RDF subject nodes for matching instances that were just created from previous RDF subject nodes using above described algorithm. Otherwise data creation mode is identical to data merge mode.

[edit] 10.2.2.2 Invocation

   java jsdai.tools.owl.RdfP21Merger rdf-model-file in-p21-file
   java jsdai.tools.owl.RdfP21Merger rdf-model-file express-schema out-p21-file
  • rdf-model-file is RDF model file for input RDF triples
  • in-p21-file is input STEP file with initial STEP population. The resulting STEP file after data merge is written to STEP file named in-p21-file.out.p21 . Data merge mode is initiated by specifying two command line parameters
  • express-schema is EXPRESS schema name for new P21 file to be created, eg. IDA_STEP_SCHEMA_XIM
  • out-p21-file is output STEP file to store newly created population. Specifying three parameters initiates data creation mode.

[edit] 10.2.2.3 Dependencies and configuration

This application requires JSDAI Runtime. JSDAI Runtime related jar files have to be provided by constructing appropriate Java class path. The directory where JSDAI configuration file is located can be specified by Java system property adding this option to the command line: -Djsdai.properties=/path/to/jsdai/properties. Refer to JSDAI documentation for further details.

[edit] 10.2.3 SparqlQuery

SPARQL query execution application

[edit] 10.2.3.1 Description

This application constructs and executes SPARQL CONSTRUCT query on Jena database. The output of model is printed to the output and can be written to a new RDF model if this is specified in configuration file. The configuration file xml file with sections that contain information for SPARQL query PREFIX, CONSTRUCT and SELECT clause. The query is constructed by joining pieces of the text for these sections from configuration file and constructing the query to be executed afterwards. The resulting SPARQL query is printed to the output as well.

[edit] 10.2.3.2 Invocation

   java jsdai.tools.owl.SparqlQuery sparql-xml-file
  • rdf-model-file is SPARQL query XML configuration file

[edit] 10.2.3.3 Dependencies and configuration

This application requires JSDAI Runtime, Jena framework and relational database supported by Jena, eg. MySQL 4.1.x. JSDAI Runtime and Jena framework related jar files have to be provided by constructing appropriate Java class path. Connection to database parameters are specified using Java system properties on command line, eg. -Djena.db.url=jdbc:mysql://localhost/jenatest -Djena.db.driver=com.mysql.jdbc.Driver -Djena.db.user=jena -Djena.db.password=sercet. JSDAI Runtime configuration is loaded from jsdai.properties file. The directory where JSDAI configuration file is located can be specified by Java system property adding this option to the command line: -Djsdai.properties=/path/to/jsdai/properties. Refer to JSDAI documentation for further details.


[edit] 11 Annexes

[edit] 11.1 ISO 1000 ontology

<?xml version="1.0"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY xsd  "http://www.w3.org/2001/XMLSchema#">
  <!ENTITY owl  "http://www.w3.org/2002/07/owl#">
  <!ENTITY iso1000 "http://www.s-ten.net/iso1000.owl#">
]>

<rdf:RDF
    xmlns:xsd  ="http://www.w3.org/2001/XMLSchema#"
    xmlns:rdf  ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs ="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:owl  ="http://www.w3.org/2002/07/owl#"  
    xmlns      ="&iso1000;" 
    xmlns:iso1000 ="&iso1000;"
    xml:base   ="http://www.s-ten.net/iso1000.owl"
>
    
  <owl:Ontology rdf:about=""/> 

  <owl:Class rdf:about="#Real">
  </owl:Class>
  
  <owl:DatatypeProperty rdf:about="#value">
    <rdf:type rdf:resource="&owl;InverseFunctionalProperty" />
    <rdfs:domain rdf:resource="#Real"/>
  </owl:DatatypeProperty>

  <owl:DatatypeProperty rdf:about="#physical_quantitv_scale">
  </owl:DatatypeProperty>

  <owl:DatatypeProperty rdf:about="#linear_scale">
  </owl:DatatypeProperty>
  
  <owl:ObjectProperty rdf:about="#volt_scale">
    <rdf:type rdf:resource="#Physical_quantity_scale" />
    <rdf:type rdf:resource="#Linear_function" />
    <rdfs:range rdf:resource="#Real"/>   
  </owl:ObjectProperty>

  <owl:FunctionalProperty rdf:about="#metre_scale">
    <rdfs:label xml:lang="en">metre</rdfs:label>
    <rdfs:comment>defined in ISO 1000:1992</rdfs:comment>
  </owl:FunctionalProperty>
  <owl:FunctionalProperty rdf:about="#kilogram_scale">
    <rdfs:label xml:lang="en">kilogram</rdfs:label>
    <rdfs:comment>defined in ISO 1000:1992</rdfs:comment>
  </owl:FunctionalProperty>
  <owl:FunctionalProperty rdf:about="#second_scale">
    <rdfs:label xml:lang="en">second</rdfs:label>
    <rdfs:comment>defined in ISO 1000:1992</rdfs:comment>
  </owl:FunctionalProperty>
  <owl:FunctionalProperty rdf:about="#ampere_scale">
    <rdfs:label xml:lang="en">ampere</rdfs:label>
    <rdfs:comment>defined in ISO 1000:1992</rdfs:comment>
  </owl:FunctionalProperty>
  <owl:FunctionalProperty rdf:about="#kelvin_scale">
    <rdfs:label xml:lang="en">kelvin</rdfs:label>
    <rdfs:comment>defined in ISO 1000:1992</rdfs:comment>
  </owl:FunctionalProperty>
  <owl:FunctionalProperty rdf:about="#mole_scale">
    <rdfs:label xml:lang="en">mole</rdfs:label>
    <rdfs:comment>defined in ISO 1000:1992</rdfs:comment>
  </owl:FunctionalProperty>
  <owl:FunctionalProperty rdf:about="#candela_scale">
    <rdfs:label xml:lang="en">candela</rdfs:label>
    <rdfs:comment>defined in ISO 1000:1992</rdfs:comment>
  </owl:FunctionalProperty>

</rdf:RDF>

[edit] 11.2 ISO 31 ontology

<?xml version="1.0"?>

 <!DOCTYPE rdf:RDF [
   <!ENTITY xsd  "http://www.w3.org/2001/XMLSchema#">
   <!ENTITY owl  "http://www.w3.org/2002/07/owl#">
   <!ENTITY iso31 "http://www.s-ten.net/iso31.owl#">
   <!ENTITY iso1000 "http://www.s-ten.net/iso1000.owl#">
 ]>

 <rdf:RDF
    xmlns      ="&iso31;" 
    xmlns:iso31 ="&iso31;"
    xmlns:iso1000 ="&iso1000;"
    xmlns:owl  ="http://www.w3.org/2002/07/owl#"  
    xmlns:rdf  ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs ="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:xsd  ="http://www.w3.org/2001/XMLSchema#"
    xml:base   ="http://www.s-ten.net/iso31.owl"
  >

  <owl:Ontology rdf:about=""> 
    <owl:imports> 
      <owl:Ontology rdf:about="&iso1000;"/> 
    </owl:imports> 
  </owl:Ontology>

  <owl:Class rdf:ID="Physical_quantity_type">
   <rdfs:subClassOf rdf:resource="&owl;Class"/>
  </owl:Class> 

      <!-- ISO 31-1:1992 Space and time-->
      <Physical_quantity_type rdf:about="#Physical_quantity_type_angle">
        <rdfs:label xml:lang="en">angle</rdfs:label>
        <rdfs:label xml:lang="en">plane angle</rdfs:label>
        <rdfs:comment>defined in ISO 31:1:1992</rdfs:comment>
      </Physical_quantity_type>
      <Physical_quantity_type rdf:about="#Physical_quantity_type_solid_angle">
        <rdfs:label xml:lang="en">solid angle</rdfs:label>
        <rdfs:comment>defined in ISO 31:1:1992</rdfs:comment>
      </Physical_quantity_type>
      <Physical_quantity_type rdf:about="#Length">
        <rdfs:label xml:lang="en">length</rdfs:label>
        <rdfs:comment>defined in ISO 31:1:1992</rdfs:comment>
      </Physical_quantity_type>

      <Physical_quantity_type rdf:about="#Mass">
        <rdfs:label xml:lang="en">mass</rdfs:label>
        <rdfs:comment>defined in ISO 31:xxx:1992</rdfs:comment>
      </Physical_quantity_type>

      <Physical_quantity_type rdf:about="#Physical_quantity_type_curvature">
        <rdfs:label xml:lang="en">curvature</rdfs:label>
        <rdfs:comment>defined in ISO 31:1:1992</rdfs:comment>
      </Physical_quantity_type>
      <Physical_quantity_type rdf:about="#Physical_quantity_type_area">
        <rdfs:label xml:lang="en">area</rdfs:label>
        <rdfs:comment>defined in ISO 31:1:1992</rdfs:comment>
      </Physical_quantity_type>
      <Physical_quantity_type rdf:about="#Physical_quantity_type_volume">
        <rdfs:label xml:lang="en">volume</rdfs:label>
        <rdfs:comment>defined in ISO 31:1:1992</rdfs:comment>
      </Physical_quantity_type>
      <Physical_quantity_type rdf:about="#Physical_quantity_type_time">
        <rdfs:label xml:lang="en">time</rdfs:label>
        <rdfs:label xml:lang="en">time interval</rdfs:label>
        <rdfs:label xml:lang="en">duration</rdfs:label>
        <rdfs:comment>defined in ISO 31:1:1992</rdfs:comment>
      </Physical_quantity_type>
      <Physical_quantity_type rdf:about="#Physical_quantity_type_angular_velocity">
        <rdfs:label xml:lang="en">angular_velocity</rdfs:label>
        <rdfs:comment>defined in ISO 31:1:1992</rdfs:comment>
      </Physical_quantity_type>
      <Physical_quantity_type rdf:about="#Physical_quantity_type_angular_acceleration">
        <rdfs:label xml:lang="en">angular_acceleration</rdfs:label>
        <rdfs:comment>defined in ISO 31:1:1992</rdfs:comment>
      </Physical_quantity_type>
      <Physical_quantity_type rdf:about="#Physical_quantity_type_velocity">
        <rdfs:label xml:lang="en">velocity</rdfs:label>
        <rdfs:comment>defined in ISO 31:1:1992</rdfs:comment>
      </Physical_quantity_type>
      <Physical_quantity_type rdf:about="#Physical_quantity_type_acceleration">
        <rdfs:label xml:lang="en">acceleration</rdfs:label>
        <rdfs:label xml:lang="de">Beschleunigung</rdfs:label>
        <rdfs:comment>defined in ISO 31:1:1992</rdfs:comment>
      </Physical_quantity_type>

 </rdf:RDF>

[edit] 11.3 JSDAI Application to convert from XIM to RDF triples using Jena-Database

/**
 * $Id$
 * Created: 2006.12.06 11:53:27
 *
 * Copyright (c) LKSoftWare GmbH, 2006. All Rights Reserved.
 */
package jsdai.tools.owl;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
import java.sql.SQLException;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

import com.hp.hpl.jena.db.IDBConnection;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.ModelMaker;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.vocabulary.RDF;

import jsdai.dictionary.AEntity_or_view_definition;
import jsdai.dictionary.EDefined_type;
import jsdai.dictionary.EEntity_definition;
import jsdai.dictionary.EExplicit_attribute;
import jsdai.lang.AEntity;
import jsdai.lang.ASdaiModel;
import jsdai.lang.Aggregate;
import jsdai.lang.CEntity;
import jsdai.lang.EEntity;
import jsdai.lang.JsdaiLangAccessor;
import jsdai.lang.SdaiException;
import jsdai.lang.SdaiIterator;
import jsdai.lang.SdaiModel;
import jsdai.lang.SdaiRepository;
import jsdai.lang.SdaiSession;

/**
 * @author vaidas
 * @version $Revision$
 *
 */
public class P21ToJenaDbModel extends JsdaiLangAccessor {
//	jena.db.url=jdbc:mysql://main.lksoft.lt/jenatest?useUnicode=yes&characterEncoding=utf8
//	jena.db.user=...
//	jena.db.password=...
//	jena.db.type=MySQL ????
//	jena.db.driver=com.mysql.jdbc.Driver
//	public static final String M_DBDRIVER_CLASS = "com.mysql.jdbc.Driver";
	public static final String EXPRESS_BASE = "http://jsdai.net/express/";

	private final StringBuffer nameBase;
	private final int nameBaseLen;
	private final StringBuffer expressBase;
	private final int expressBaseLen;
	private final SdaiRepository repository;
	private final ModelMaker modelMaker;
	private long startTime;
	private Statement[] collectedStatements;
	private int collectedStatementCount;

	public P21ToJenaDbModel(String nameBase, SdaiRepository repository, ModelMaker modelMaker) {
		this.nameBase = new StringBuffer(nameBase);
		nameBaseLen = this.nameBase.length();
		expressBase = new StringBuffer(EXPRESS_BASE);
		expressBaseLen = expressBase.length();
		this.repository = repository;
		this.modelMaker = modelMaker;
		collectedStatements = new Statement[4 * 1024];
		collectedStatementCount = 0;
	}

	/**
	 * @param args
	 * @throws SdaiException 
	 * @throws ClassNotFoundException 
	 * @throws IOException 
	 * @throws SQLException 
	 */
	public static void main(String[] args)
	throws SdaiException, ClassNotFoundException, IOException, SQLException {
		boolean showHelp = args.length < 1;
		for (int i = 0; i < args.length; i++) {
			if(!new File(args[i]).canRead()) {
				showHelp = true;
				break;
			}
		}
		if(showHelp) {
			System.out.println("Usage: ");
			System.out.println("    java jsdai.tools.owl.P21ToJenaDbModel p21-file(s)");
			return;
		}
		SdaiSession session = SdaiSession.openSession();
		session.startTransactionReadWriteAccess();

		// load the the driver class
		Class.forName(ModelFactory.guessDBDriver());

		IDBConnection connection = ModelFactory.createSimpleRDBConnection();
//		connection.cleanDB();
		if(!connection.isFormatOK()) {
			connection.getDriver().setIsTransactionDb(true);
		}
		connection.getDriver().setDoDuplicateCheck(false);
		ModelMaker modelMaker =
			ModelFactory.createModelRDBMaker(connection, ModelFactory.Minimal);

		for (int i = 0; i < args.length; i++) {
			String fileName = args[i];
			SdaiRepository repository = session.importClearTextEncoding("", fileName, null);
	
			P21ToJenaDbModel p21ToJenaDbModel =
				new P21ToJenaDbModel("jsdai:///" +
						new File(fileName).getName()/*.getAbsoluteFile().toURL().toString()*/,
						repository, modelMaker);
			p21ToJenaDbModel.process();
			repository.deleteRepository();
		}
	}

	private void process() throws SdaiException, SQLException {
		startTime = System.currentTimeMillis();
		nameBase.setLength(nameBaseLen);
		nameBase.append('#');
		ASdaiModel models = repository.getModels();
		for(SdaiIterator i = models.createIterator(); i.next(); ) {
			SdaiModel model = models.getCurrentMember(i);
			nameBase.setLength(nameBaseLen + 1);
			nameBase.append(model.getName());
			String rdfModelName = nameBase.toString();
			if(modelMaker.hasModel(rdfModelName)) {
				modelMaker.removeModel(rdfModelName);
			}
			Model rdfModel = modelMaker.createModel(rdfModelName);
			System.out.println("Starting " + rdfModelName);
			rdfModel.begin();
			process(model, rdfModel);
			rdfModel.commit();
			rdfModel.close();
			System.out.println("Finished " + rdfModelName + " in " +
					(System.currentTimeMillis() - startTime) + "msec");
		}
	}

	private void process(SdaiModel sdaiModel, Model rdfModel) throws SdaiException, SQLException {
		int instCount = 0;
		AEntity instances = sdaiModel.getInstances();
		Set allTypes = new HashSet();
		EDefined_type[] selectTypes = new EDefined_type[5];
		for(SdaiIterator i = instances.createIterator(); i.next(); ) {
			EEntity instance = instances.getCurrentMemberEntity(i);
			EEntity_definition entDef = instance.getInstanceType();
			Resource instResource = createInstResource(instance, rdfModel);

			// Add a statement about instance type
			if(entDef.getComplex(null)) {
				AEntity_or_view_definition instTypes = entDef.getGeneric_supertypes(null);
				for(SdaiIterator j = instTypes.createIterator(); j.next(); ) {
					EEntity_definition instType =
						(EEntity_definition) instTypes.getCurrentMemberEntity(j);
					collectSupertypes(instType, allTypes);
				}
			} else {
				collectSupertypes(entDef, allTypes);
			}
			for (Iterator j = allTypes.iterator(); j.hasNext();) {
				EEntity_definition instType = (EEntity_definition) j.next();
				expressBase.setLength(expressBaseLen);
				expressBase.append(
						instType.findEntityInstanceSdaiModel().getDefinedSchema().getName(null).toLowerCase())
						.append('#')
						.append(instType.getName(null));
				addStatement(rdfModel,
						rdfModel.createStatement(instResource, RDF.type,
								rdfModel.createResource(expressBase.toString())));
			}
			allTypes.clear();

			EExplicit_attribute[] attributes = getEntityExplicitAttributes(entDef);
			Field[] attrFields = getEntityAttributeFields(entDef);
			for (int j = 0; j < attributes.length; j++) {
				if(attrFields[j] != null) {
					EExplicit_attribute attribute = attributes[j];
					selectTypes[0] = null;
					if(((CEntity) instance).testAttributeFast(attribute,
							selectTypes) > 0) {
						process(instResource, attribute,
								instance.get_object(attribute), selectTypes, rdfModel);
					}
				}
			}
			instCount++;
			if((instCount % 10000) == 0) {
				System.out.println("Wrote " + instCount + " instances in " +
						(System.currentTimeMillis() - startTime) + "msec");
			}
		}
		if(rdfModel != null) {
			addStatement(rdfModel, null);
			System.out.println("Wrote " + instCount + " instances in " +
					(System.currentTimeMillis() - startTime) + "msec");
		}
	}

	private void process(Resource instResource, EExplicit_attribute attribute, Object value,
			EDefined_type[] selectTypes, Model rdfModel) throws SdaiException {
		if(value instanceof EEntity) {
			Property attrProperty = createAttrProperty(attribute, null, rdfModel);
			Resource valueResource = createInstResource((EEntity) value, rdfModel);
			addStatement(rdfModel,
					rdfModel.createStatement(instResource, attrProperty, valueResource));
//			instResource.addProperty(attrProperty, valueResource);
		} else if(value instanceof Aggregate) {
			Aggregate aggregate = (Aggregate) value;
			for(SdaiIterator i = aggregate.createIterator(); i.next(); ) {
				Object aggValue = aggregate.getCurrentMemberObject(i);
				process(instResource, attribute, aggValue, null, rdfModel);
			}
		} else {
			Property attrProperty = createAttrProperty(attribute, selectTypes, rdfModel);
			addStatement(rdfModel,
					rdfModel.createStatement(instResource, attrProperty,
							rdfModel.createTypedLiteral(value)));
//			instResource.addProperty(attrProperty, rdfModel.createTypedLiteral(value));
		}
	}

	private static void collectSupertypes(EEntity_definition instType,
			Set allTypes) throws SdaiException {
		allTypes.add(instType);
		AEntity_or_view_definition instTypes = instType.getGeneric_supertypes(null);
		for(SdaiIterator j = instTypes.createIterator(); j.next(); ) {
			EEntity_definition superType =
				(EEntity_definition) instTypes.getCurrentMemberEntity(j);
			collectSupertypes(superType, allTypes);
		}
	}

	private Resource createInstResource(EEntity instance, Model rdfModel) {
		nameBase.setLength(nameBaseLen + 1);
		nameBase.append('_');
		nameBase.append(getInstanceIdentifier(instance));
		return rdfModel.createResource(nameBase.toString());
	}

	private Property createAttrProperty(EExplicit_attribute attribute,
			EDefined_type[] selectTypes, Model rdfModel) throws SdaiException {
		expressBase.setLength(expressBaseLen);
		expressBase.append(
				attribute.findEntityInstanceSdaiModel().getDefinedSchema().getName(
						null).toLowerCase())
				.append('#')
				.append(attribute.getParent_entity(null).getName(null))
				.append('.')
				.append(attribute.getName(null));
		if(selectTypes != null) {
			for (int i = 0; i < selectTypes.length ; i++) {
				EDefined_type selectType = selectTypes[i];
				if(selectType == null) {
					break;
				}
				expressBase.append('-').append(selectType.getName(null));
			}
		}
		return rdfModel.createProperty(expressBase.toString());
	}

	private void addStatement(Model rdfModel, Statement statement) {
		if(collectedStatementCount == collectedStatements.length) {
			rdfModel.add(collectedStatements);
			collectedStatementCount = 0;
		}
		if(statement != null) {
			collectedStatements[collectedStatementCount++] =
				statement;
		} else if(collectedStatementCount != 0) {
			Statement[] actualStatemens = new Statement[collectedStatementCount];
			System.arraycopy(collectedStatements, 0, actualStatemens, 0,
					collectedStatementCount);
			rdfModel.add(actualStatemens);
			collectedStatementCount = 0;
		}
	}

}

[edit] 11.4 STEP-derived Ontology used for the technical validation

<?xml version="1.0"?>

 <!DOCTYPE rdf:RDF [
   <!ENTITY iso31   "http://www.s-ten.net/iso31.owl#">
   <!ENTITY iso1000 "http://www.s-ten.net/iso1000.owl#">
   <!ENTITY owl     "http://www.w3.org/2002/07/owl#">
   <!ENTITY step    "http://www.s-ten.net/d3_1_basic_step_ontology.owl#">
   <!ENTITY xsd     "http://www.w3.org/2001/XMLSchema#">
   <!ENTITY rdfs    "http://www.w3.org/2000/01/rdf-schema#">
 ]>

 <rdf:RDF
    xmlns      ="&step;" 
    xmlns:step ="&step;"
    xmlns:iso31 ="&iso31;"
    xmlns:iso1000 ="&iso1000;"
    xmlns:owl  ="http://www.w3.org/2002/07/owl#"
    xmlns:rdf  ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs ="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:xsd  ="http://www.w3.org/2001/XMLSchema#"
    xml:base   ="http://www.s-ten.net/d3_1_basic_step_ontology.owl"
  >

  <owl:Ontology rdf:about=""> 
    <owl:imports> 
      <owl:Ontology rdf:about="&iso31;"/> 
    </owl:imports> 
  </owl:Ontology>

<!-- basic types from the support_resource_schema in ISO 10303-41 -->

<owl:DatatypeProperty rdf:ID="label">
  <rdfs:range rdf:resource="&xsd;string"/>
  <rdfs:comment>XA label is an alphanumeric string that represents the human-interpretable name of something and shall have a natural-language meaning.</rdfs:comment>
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="text">
  <rdfs:range rdf:resource="&xsd;string"/>
  <rdfs:comment>A text is an alphanumeric string intended to be read and understood by a human being. It is for information purposes only.</rdfs:comment>
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="identifier">
  <rdfs:range rdf:resource="&xsd;string"/>
  <rdfs:comment>An identifier is a string suitable for identifying some product data.</rdfs:comment>
</owl:DatatypeProperty>


<!-- typical string attributes used in many STEP Express schemas-->

 <owl:DatatypeProperty rdf:ID="id">
   <rdfs:subPropertyOf rdf:resource="#identifier"/>
 </owl:DatatypeProperty>

 <owl:DatatypeProperty rdf:ID="version_id">
   <rdfs:subPropertyOf rdf:resource="#identifier"/>
 </owl:DatatypeProperty>

 <owl:DatatypeProperty rdf:ID="name">
   <rdfs:subPropertyOf rdf:resource="#label"/>
 </owl:DatatypeProperty>

 <owl:DatatypeProperty rdf:ID="role">
   <rdfs:subPropertyOf rdf:resource="#label"/>
 </owl:DatatypeProperty>

 <owl:DatatypeProperty rdf:ID="description">
   <rdfs:subPropertyOf rdf:resource="#text"/>
 </owl:DatatypeProperty>

<!-- Definition of meta levels --> 

<owl:Class rdf:about="#Physical_object">
  <rdfs:subClassOf rdf:resource="&owl;Class"/>
</owl:Class>

<owl:Class rdf:about="#Class_of_physical_object">
 <owl:equivalentClass>
  <owl:Restriction>
   <owl:onProperty rdf:resource="&rdfs;subClassOf"/>
   <owl:hasValue rdf:resource="#Physical_object"/>
  </owl:Restriction>
 </owl:equivalentClass>
</owl:Class>

<owl:Class rdf:about="#Class_of_class_of_physical_object">
 <owl:equivalentClass>
  <owl:Restriction>
   <owl:onProperty rdf:resource="&rdfs;subClassOf"/>
   <owl:hasValue rdf:resource="#Class_of_physical_object"/>
  </owl:Restriction>
 </owl:equivalentClass>
</owl:Class>

 <!-- individuals of type Class_of_class_of_physical_object -->

  <Class_of_class_of_physical_object rdf:ID="Product_class">
    <rdfs:subClassOf rdf:resource="#Class_of_physical_object"/>
  </Class_of_class_of_physical_object>
  <owl:DatatypeProperty rdf:ID="market">
    <rdfs:subPropertyOf rdf:resource="#name"/>
    <rdfs:domain rdf:resource='#Product_class'/>
    <rdfs:range rdf:resource="&xsd;string"/>
  </owl:DatatypeProperty>

  <Class_of_class_of_physical_object rdf:ID="Product_specification">
    <rdfs:subClassOf rdf:resource="#Class_of_physical_object"/>
    <rdfs:subClassOf>
     <owl:Restriction>
      <owl:onProperty rdf:resource="&rdfs;subClassOf"/>
      <owl:allValuesFrom rdf:resource="#Product_class"/>
     </owl:Restriction>
    </rdfs:subClassOf>
    <owl:disjointWith rdf:resource="#Product_class"/>
  </Class_of_class_of_physical_object>
 
  <Class_of_class_of_physical_object rdf:ID="Part">
    <rdfs:subClassOf rdf:resource="#Class_of_physical_object"/>
    <owl:disjointWith rdf:resource="#Product_class"/>
    <owl:disjointWith rdf:resource="#Product_specification"/>
  </Class_of_class_of_physical_object>

  <Class_of_class_of_physical_object rdf:ID="Part_version">
    <rdfs:subClassOf rdf:resource="#Class_of_physical_object"/>
    <rdfs:subClassOf>
     <owl:Restriction>
      <owl:onProperty rdf:resource="&rdfs;subClassOf"/>
      <owl:allValuesFrom rdf:resource="#Part"/>
     </owl:Restriction>
    </rdfs:subClassOf>
    <owl:disjointWith rdf:resource="#Product_class"/>
    <owl:disjointWith rdf:resource="#Product_specification"/>
    <owl:disjointWith rdf:resource="#Part"/>
  </Class_of_class_of_physical_object>
  <owl:ObjectProperty rdf:ID='part_version_predecessor'>
    <rdf:type rdf:resource="&owl;TransitiveProperty" />
    <rdfs:domain rdf:resource='#Part_version'/>
    <rdfs:range rdf:resource='#Part_version'/>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:ID='part_version_successor'>
    <owl:inverseOf rdf:resource='#part_version_predecessor'/>
    <rdfs:domain rdf:resource='#Part_version'/>
    <rdfs:range rdf:resource='#Part_version'/>
  </owl:ObjectProperty>

  <Class_of_class_of_physical_object rdf:ID="Part_view_definition">
    <rdfs:subClassOf rdf:resource="#Class_of_physical_object"/>
    <owl:disjointWith rdf:resource="#Product_class"/>
    <owl:disjointWith rdf:resource="#Product_specification"/>
    <owl:disjointWith rdf:resource="#Part"/>
    <owl:disjointWith rdf:resource="#Part_version"/>
  </Class_of_class_of_physical_object>

  <Class_of_class_of_physical_object rdf:ID="Part_occurence">
    <rdfs:subClassOf rdf:resource="#Class_of_physical_object"/>
    <rdfs:subClassOf>
      <owl:Restriction>
        <owl:onProperty rdf:resource="&rdfs;subClassOf"/>
        <owl:allValuesFrom rdf:resource="#Part_version"/>
      </owl:Restriction>
    </rdfs:subClassOf> 
    <owl:disjointWith rdf:resource="#Product_class"/>
    <owl:disjointWith rdf:resource="#Product_specification"/>
    <owl:disjointWith rdf:resource="#Part"/>
    <owl:disjointWith rdf:resource="#Part_version"/>
    <owl:disjointWith rdf:resource="#Part_view_definition"/>
  </Class_of_class_of_physical_object>


 <!-- individuals of type Class_of_physical_object -->

  <Class_of_physical_object rdf:ID="Product_as_individual">
    <rdfs:subClassOf rdf:resource="#Physical_object"/>
  </Class_of_physical_object>

<owl:Class rdf:about="#ClassOf_Product_as_individual">
 <owl:equivalentClass>
  <owl:Restriction>
   <owl:onProperty rdf:resource="&rdfs;subClassOf"/>
   <owl:hasValue rdf:resource="#Product_as_individual"/>
  </owl:Restriction>
 </owl:equivalentClass>
</owl:Class>

  <Class_of_physical_object rdf:ID="Product_as_individual_version">
    <owl:unionOf rdf:parseType="Collection">
      <owl:Class rdf:about="#Product_as_planned" />
      <owl:Class rdf:about="#Product_as_realized" />
    </owl:unionOf>
  </Class_of_physical_object>

  <Class_of_physical_object rdf:ID="Product_as_planned">
    <rdfs:subClassOf rdf:resource="#Product_as_individual"/>
  </Class_of_physical_object>

  <Class_of_physical_object rdf:ID="Product_as_realized">
    <rdfs:subClassOf rdf:resource="#Product_as_individual"/>
    <owl:disjointWith rdf:resource="#Product_as_planned"/>
  </Class_of_physical_object>

  <owl:ObjectProperty rdf:ID='temporal_part'>
    <rdfs:domain rdf:resource='#Product_as_individual_version'/>
    <rdfs:range rdf:resource='#Product_as_individual'/>
  </owl:ObjectProperty>

  <owl:ObjectProperty rdf:ID='physical_assembly_relationship'>
    <rdfs:domain rdf:resource='#Product_as_individual_version'/>
    <rdfs:range rdf:resource='#Product_as_individual_version'/>
  </owl:ObjectProperty>

  <owl:Class rdf:about="#Physical_property_of_product_as_individual">
   <owl:equivalentClass>
    <owl:Class>
     <owl:intersectionOf rdf:parseType="Collection">
      <owl:Restriction>
       <owl:onProperty rdf:resource="&rdfs;domain"/>
       <owl:allValuesFrom>
        <owl:Restriction>
         <owl:onProperty rdf:resource="&rdfs;subClassOf"/>
         <owl:hasValue rdf:resource="&step;Product_as_individual"/>
        </owl:Restriction>
       </owl:allValuesFrom>
      </owl:Restriction>
      <owl:Restriction>
       <owl:onProperty rdf:resource="&rdfs;range"/>
       <owl:allValuesFrom rdf:resource="&iso31;Physical_quantity_type"/>
      </owl:Restriction>
     </owl:intersectionOf>
    </owl:Class>
   </owl:equivalentClass>
  </owl:Class> 

  <Class_of_physical_object rdf:ID="Person">
    <rdfs:subClassOf rdf:resource="#Physical_object"/>
  </Class_of_physical_object>
  <Class_of_physical_object rdf:ID="Organization">
    <rdfs:subClassOf rdf:resource="#Physical_object"/>
  </Class_of_physical_object>

  <owl:DatatypeProperty rdf:ID="last_name">
    <rdfs:subPropertyOf rdf:resource="#label"/>
    <rdfs:domain rdf:resource="#Person"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:ID="first_name">
    <rdfs:subPropertyOf rdf:resource="#label"/>
    <rdfs:domain rdf:resource="#Person"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:ID="middle_name">
    <rdfs:subPropertyOf rdf:resource="#label"/>
    <rdfs:domain rdf:resource="#Person"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:ID="prefix_title">
    <rdfs:subPropertyOf rdf:resource="#label"/>
    <rdfs:domain rdf:resource="#Person"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:ID="suffix_title">
    <rdfs:subPropertyOf rdf:resource="#label"/>
    <rdfs:domain rdf:resource="#Person"/>
  </owl:DatatypeProperty>

  <Class_of_physical_object rdf:ID="Person_and_organization">
    <rdfs:subClassOf rdf:resource="#Physical_object"/>
  </Class_of_physical_object>
  <owl:ObjectProperty rdf:ID="the_person">
    <rdfs:domain rdf:resource="#Person_and_organization"/>
    <rdfs:range rdf:resource="#Person"/>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:ID="the_organization">
    <rdfs:domain rdf:resource="#Person_and_organization"/>
    <rdfs:range rdf:resource="#Organization"/>
  </owl:ObjectProperty>

  <owl:ObjectProperty rdf:ID="id_owner_assignment">
    <rdfs:range rdf:resource="#Person_and_organization"/>
  </owl:ObjectProperty>

<!-- others -->

  <owl:Class rdf:ID="Property">
  </owl:Class>

  <owl:Class rdf:ID="PropertyValue">
  </owl:Class>

  <owl:ObjectProperty rdf:ID='propertyRepresentation'>
    <rdfs:domain rdf:resource='#PropertyValue'/>
    <!--rdfs:range rdf:resource='#Part_version'/-->
  </owl:ObjectProperty>

  <owl:Class rdf:ID='Next_assembly_usage_occurrence'>
  </owl:Class>

  <owl:ObjectProperty rdf:ID='nextAssemblyUsageOccurrenceDefinition'>
    <rdfs:domain rdf:resource='#Next_assembly_usage_occurrence'/>
    <rdfs:range rdf:resource='#Part_occurence'/>
  </owl:ObjectProperty>

 </rdf:RDF>

[edit] 11.5 STEP-RDF triples for example STEP file

<?xml version="1.0"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY xsd  "http://www.w3.org/2001/XMLSchema#">
  <!ENTITY owl  "http://www.w3.org/2002/07/owl#">
]>
<rdf:RDF
    xmlns="jsdai:///S-TEN_D31_example-1.p21#"
    xmlns:iso31="http://www.s-ten.net/iso31.owl#"
    xmlns:item_definition_structure_xim="http://jsdai.net/express/item_definition_structure_xim#"
    xmlns:classification_schema="http://jsdai.net/express/classification_schema#"
    xmlns:product_as_individual_xim="http://jsdai.net/express/product_as_individual_xim#"
    xmlns:person_organization_schema="http://jsdai.net/express/person_organization_schema#"
    xmlns:iso1000="http://www.s-ten.net/iso1000.owl#"
    xmlns:product_structure_schema="http://jsdai.net/express/product_structure_schema#"
    xmlns:property_assignment_xim="http://jsdai.net/express/property_assignment_xim#"
    xmlns:product_definition_schema="http://jsdai.net/express/product_definition_schema#"
    xmlns:xsd="&xsd;"
    xmlns:generic_product_occurrence_xim="http://jsdai.net/express/generic_product_occurrence_xim#"
    xmlns:product_class_mim="http://jsdai.net/express/product_class_mim#"
    xmlns:measure_schema="http://jsdai.net/express/measure_schema#"
    xmlns:step="http://www.s-ten.net/d3_1_basic_step_ontology.owl#"
    xmlns:product_concept_schema="http://jsdai.net/express/product_concept_schema#"
    xmlns:configuration_management_schema="http://jsdai.net/express/configuration_management_schema#"
    xmlns:product_as_individual_assembly_xim="http://jsdai.net/express/product_as_individual_assembly_xim#"
    xmlns:product_view_definition_xim="http://jsdai.net/express/product_view_definition_xim#"
    xmlns:class_xim="http://jsdai.net/express/class_xim#"
    xmlns:owl="&owl;"
    xmlns:group_schema="http://jsdai.net/express/group_schema#"
    xmlns:person_organization_assignment_mim="http://jsdai.net/express/person_organization_assignment_mim#"
    xmlns:pre_defined_product_data_management_specializations_xim="http://jsdai.net/express/pre_defined_product_data_management_specializations_xim#"
    xmlns:application_context_schema="http://jsdai.net/express/application_context_schema#"
    xmlns:classification_with_attributes_mim="http://jsdai.net/express/classification_with_attributes_mim#"
    xmlns:product_class_xim="http://jsdai.net/express/product_class_xim#"
    xmlns:classification_assignment_mim="http://jsdai.net/express/classification_assignment_mim#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:part_occurrence_xim="http://jsdai.net/express/part_occurrence_xim#"
    xmlns:part_and_version_identification_xim="http://jsdai.net/express/part_and_version_identification_xim#"
    xmlns:part_view_definition_xim="http://jsdai.net/express/part_view_definition_xim#"
    xmlns:product_identification_xim="http://jsdai.net/express/product_identification_xim#"
    xmlns:management_resources_schema="http://jsdai.net/express/management_resources_schema#"
    xmlns:product_property_definition_schema="http://jsdai.net/express/product_property_definition_schema#">
  <product_definition_schema:product_definition_relationship rdf:ID="_400">
    <product_definition_schema:product_definition_relationship.relating_product_definition>
      <item_definition_structure_xim:assembly_definition_armx rdf:ID="_312">
        <product_definition_schema:product_definition.id rdf:datatype=
        "&xsd;string">1</product_definition_schema:product_definition.id>
        <product_definition_schema:product_definition.formation>
          <product_definition_schema:product_definition_formation rdf:ID="_311">
            <product_definition_schema:product_definition_formation.id
             rdf:datatype="&xsd;string"
            >1</product_definition_schema:product_definition_formation.id>
            <product_definition_schema:product_definition_formation.of_product>
              <product_identification_xim:product_armx rdf:ID="_310">
                <product_definition_schema:product.name rdf:datatype=
                "&xsd;string">VW Beetle – P_101</product_definition_schema:product.name>
                <rdf:type rdf:resource="http://jsdai.net/express/part_and_version_identification_xim#part"/>
                <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product"/>
                <product_definition_schema:product.id rdf:datatype=
                "&xsd;string">A0001</product_definition_schema:product.id>
              </product_identification_xim:product_armx>
            </product_definition_schema:product_definition_formation.of_product>
            <rdf:type rdf:resource="http://jsdai.net/express/part_and_version_identification_xim#part_version"/>
          </product_definition_schema:product_definition_formation>
        </product_definition_schema:product_definition.formation>
        <product_definition_schema:product_definition.frame_of_reference>
          <application_context_schema:application_context_element rdf:ID="_303">
            <application_context_schema:application_context_element.name
             rdf:datatype="&xsd;string"
            >part definition</application_context_schema:application_context_element.name>
            <rdf:type rdf:resource="http://jsdai.net/express/application_context_schema#product_definition_context"/>
            <application_context_schema:product_definition_context.life_cycle_stage
             rdf:datatype="&xsd;string"
            >design</application_context_schema:product_definition_context.life_cycle_stage>
            <application_context_schema:application_context_element.frame_of_reference>
              <application_context_schema:application_context rdf:ID="_301">
                <application_context_schema:application_context.application
                 rdf:datatype="&xsd;string"
                >mechanical design</application_context_schema:application_context.application>
              </application_context_schema:application_context>
            </application_context_schema:application_context_element.frame_of_reference>
          </application_context_schema:application_context_element>
        </product_definition_schema:product_definition.frame_of_reference>
        <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product_definition"/>
        <rdf:type rdf:resource="http://jsdai.net/express/product_view_definition_xim#product_view_definition"/>
        <rdf:type rdf:resource="http://jsdai.net/express/part_view_definition_xim#part_view_definition"/>
      </item_definition_structure_xim:assembly_definition_armx>
    </product_definition_schema:product_definition_relationship.relating_product_definition>
    <rdf:type rdf:resource="http://jsdai.net/express/product_structure_schema#assembly_component_usage"/>
    <rdf:type rdf:resource="http://jsdai.net/express/product_structure_schema#next_assembly_usage_occurrence"/>
    <product_definition_schema:product_definition_relationship.id
     rdf:datatype="&xsd;string">SI0001</product_definition_schema:product_definition_relationship.id>
    <rdf:type rdf:resource="http://jsdai.net/express/product_structure_schema#product_definition_usage"/>
    <product_definition_schema:product_definition_relationship.name
     rdf:datatype="&xsd;string"> </product_definition_schema:product_definition_relationship.name>
    <product_definition_schema:product_definition_relationship.related_product_definition>
      <product_definition_schema:product_definition rdf:ID="_402">
        <rdf:type rdf:resource="http://jsdai.net/express/part_occurrence_xim#definition_based_part_occurrence"/>
        <rdf:type rdf:resource="http://jsdai.net/express/part_occurrence_xim#part_occurrence"/>
        <generic_product_occurrence_xim:definition_based_product_occurrence.derived_from>
          <product_definition_schema:product_definition rdf:ID="_322">
            <product_definition_schema:product_definition.id rdf:datatype=
            "&xsd;string">1</product_definition_schema:product_definition.id>
            <rdf:type rdf:resource="http://jsdai.net/express/part_view_definition_xim#part_view_definition"/>
            <rdf:type rdf:resource="http://jsdai.net/express/product_view_definition_xim#product_view_definition"/>
            <product_definition_schema:product_definition.frame_of_reference rdf:resource="#_303"/>
            <product_definition_schema:product_definition.formation>
              <part_and_version_identification_xim:part_version rdf:ID="_321">
                <product_definition_schema:product_definition_formation.of_product>
                  <part_and_version_identification_xim:part rdf:ID="_320">
                    <rdf:type rdf:resource="http://jsdai.net/express/product_identification_xim#product_armx"/>
                    <product_definition_schema:product.name rdf:datatype=
                    "&xsd;string"
                    >Engine-4/50KW-BX</product_definition_schema:product.name>
                    <product_definition_schema:product.id rdf:datatype=
                    "&xsd;string"
                    >A0002</product_definition_schema:product.id>
                    <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product"/>
                  </part_and_version_identification_xim:part>
                </product_definition_schema:product_definition_formation.of_product>
                <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product_definition_formation"/>
                <product_definition_schema:product_definition_formation.id
                 rdf:datatype="&xsd;string"
                >1</product_definition_schema:product_definition_formation.id>
              </part_and_version_identification_xim:part_version>
            </product_definition_schema:product_definition.formation>
          </product_definition_schema:product_definition>
        </generic_product_occurrence_xim:definition_based_product_occurrence.derived_from>
        <rdf:type rdf:resource="http://jsdai.net/express/generic_product_occurrence_xim#product_occurrence"/>
        <product_definition_schema:product_definition.id rdf:datatype=
        "&xsd;string">SI0001</product_definition_schema:product_definition.id>
        <rdf:type rdf:resource="http://jsdai.net/express/generic_product_occurrence_xim#definition_based_product_occurrence"/>
        <rdf:type rdf:resource="http://jsdai.net/express/product_view_definition_xim#product_view_definition"/>
      </product_definition_schema:product_definition>
    </product_definition_schema:product_definition_relationship.related_product_definition>
  </product_definition_schema:product_definition_relationship>
  <product_property_definition_schema:property_definition rdf:ID="_512">
    <product_property_definition_schema:property_definition.definition>
      <product_definition_schema:product_definition rdf:ID="_314">
        <rdf:type rdf:resource="http://jsdai.net/express/part_view_definition_xim#part_view_definition"/>
        <product_definition_schema:product_definition.formation rdf:resource="#_311"/>
        <product_definition_schema:product_definition.id rdf:datatype=
        "&xsd;string">2</product_definition_schema:product_definition.id>
        <product_definition_schema:product_definition.frame_of_reference rdf:resource="#_303"/>
        <rdf:type rdf:resource="http://jsdai.net/express/product_view_definition_xim#product_view_definition"/>
      </product_definition_schema:product_definition>
    </product_property_definition_schema:property_definition.definition>
    <property_assignment_xim:applied_independent_property.base_independent_property>
      <product_property_definition_schema:general_property rdf:ID="_510">
        <product_property_definition_schema:general_property.id
         rdf:datatype="&xsd;string"
        ></product_property_definition_schema:general_property.id>
        <product_property_definition_schema:general_property.name
         rdf:datatype="&xsd;string"
        >Overall length</product_property_definition_schema:general_property.name>
      </product_property_definition_schema:general_property>
    </property_assignment_xim:applied_independent_property.base_independent_property>
    <property_assignment_xim:assigned_property.representation>
      <measure_schema:length_measure_with_unit rdf:ID="_516">
        <measure_schema:measure_with_unit.unit_component>
          <measure_schema:named_unit rdf:ID="_500">
            <measure_schema:si_unit.name rdf:datatype="&xsd;int"
            >1</measure_schema:si_unit.name>
            <rdf:type rdf:resource="http://jsdai.net/express/measure_schema#si_unit"/>
            <rdf:type rdf:resource="http://jsdai.net/express/measure_schema#length_unit"/>
          </measure_schema:named_unit>
        </measure_schema:measure_with_unit.unit_component>
        <rdf:type rdf:resource="http://jsdai.net/express/measure_schema#measure_with_unit"/>
        <measure_schema:measure_with_unit.value_component-length_measure
         rdf:datatype="&xsd;double"
        >4.5</measure_schema:measure_with_unit.value_component-length_measure>
      </measure_schema:length_measure_with_unit>
    </property_assignment_xim:assigned_property.representation>
    <rdf:type rdf:resource="http://jsdai.net/express/property_assignment_xim#applied_independent_property"/>
    <rdf:type rdf:resource="http://jsdai.net/express/property_assignment_xim#assigned_property"/>
  </product_property_definition_schema:property_definition>
  <product_structure_schema:product_definition_occurrence_relationship rdf:ID="_725">
    <product_structure_schema:product_definition_occurrence_relationship.name
     rdf:datatype="&xsd;string">physical realization</product_structure_schema:product_definition_occurrence_relationship.name>
    <product_structure_schema:product_definition_occurrence_relationship.occurrence rdf:resource="#_402"/>
    <product_structure_schema:product_definition_occurrence_relationship.occurrence_usage>
      <product_structure_schema:product_definition_usage rdf:ID="_724">
        <product_definition_schema:product_definition_relationship.relating_product_definition>
          <product_as_individual_xim:product_as_individual_view rdf:ID="_722">
            <product_definition_schema:product_definition.frame_of_reference>
              <application_context_schema:product_definition_context rdf:ID="_701">
                <application_context_schema:application_context_element.name
                 rdf:datatype="&xsd;string"
                >physical occurrence</application_context_schema:application_context_element.name>
                <application_context_schema:application_context_element.frame_of_reference rdf:resource="#_301"/>
                <rdf:type rdf:resource="http://jsdai.net/express/application_context_schema#application_context_element"/>
                <application_context_schema:product_definition_context.life_cycle_stage
                 rdf:datatype="&xsd;string"
                > </application_context_schema:product_definition_context.life_cycle_stage>
              </application_context_schema:product_definition_context>
            </product_definition_schema:product_definition.frame_of_reference>
            <product_definition_schema:product_definition.formation>
              <product_definition_schema:product_definition_formation rdf:ID="_721">
                <product_definition_schema:product_definition_formation.of_product>
                  <product_identification_xim:product_armx rdf:ID="_710">
                    <product_definition_schema:product.name rdf:datatype=
                    "&xsd;string"
                    >my car</product_definition_schema:product.name>
                    <product_definition_schema:product.id rdf:datatype=
                    "&xsd;string"
                    >ABX123456789</product_definition_schema:product.id>
                    <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product"/>
                    <rdf:type rdf:resource="http://jsdai.net/express/product_as_individual_xim#product_as_individual"/>
                  </product_identification_xim:product_armx>
                </product_definition_schema:product_definition_formation.of_product>
                <product_definition_schema:product_definition_formation.id
                 rdf:datatype="&xsd;string"
                >after engine replacement</product_definition_schema:product_definition_formation.id>
                <rdf:type rdf:resource="http://jsdai.net/express/product_as_individual_xim#product_as_individual_version"/>
                <rdf:type rdf:resource="http://jsdai.net/express/product_as_individual_xim#product_as_realized"/>
              </product_definition_schema:product_definition_formation>
            </product_definition_schema:product_definition.formation>
            <product_definition_schema:product_definition.id rdf:datatype=
            "&xsd;string">1</product_definition_schema:product_definition.id>
            <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product_definition"/>
            <rdf:type rdf:resource="http://jsdai.net/express/product_view_definition_xim#product_view_definition"/>
          </product_as_individual_xim:product_as_individual_view>
        </product_definition_schema:product_definition_relationship.relating_product_definition>
        <product_structure_schema:assembly_component_usage.reference_designator
         rdf:datatype="&xsd;string"
        > </product_structure_schema:assembly_component_usage.reference_designator>
        <product_as_individual_assembly_xim:physical_assembly_relationship.is_realization_of rdf:resource="#_402"/>
        <rdf:type rdf:resource="http://jsdai.net/express/product_as_individual_assembly_xim#physical_assembly_relationship"/>
        <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product_definition_relationship"/>
        <rdf:type rdf:resource="http://jsdai.net/express/product_structure_schema#assembly_component_usage"/>
        <product_definition_schema:product_definition_relationship.related_product_definition>
          <product_definition_schema:product_definition rdf:ID="_792">
            <rdf:type rdf:resource="http://jsdai.net/express/product_as_individual_xim#product_as_individual_view"/>
            <rdf:type rdf:resource="http://jsdai.net/express/product_view_definition_xim#product_view_definition"/>
            <product_definition_schema:product_definition.id rdf:datatype=
            "&xsd;string">1</product_definition_schema:product_definition.id>
            <product_definition_schema:product_definition.formation>
              <product_as_individual_xim:product_as_individual_version rdf:ID="_791">
                <rdf:type rdf:resource="http://jsdai.net/express/product_as_individual_xim#product_as_realized"/>
                <product_definition_schema:product_definition_formation.of_product>
                  <product_definition_schema:product rdf:ID="_790">
                    <product_definition_schema:product.name rdf:datatype=
                    "&xsd;string"
                    > </product_definition_schema:product.name>
                    <product_definition_schema:product.id rdf:datatype=
                    "&xsd;string"
                    >XYZ987654321 </product_definition_schema:product.id>
                    <rdf:type rdf:resource="http://jsdai.net/express/product_identification_xim#product_armx"/>
                    <rdf:type rdf:resource="http://jsdai.net/express/product_as_individual_xim#product_as_individual"/>
                  </product_definition_schema:product>
                </product_definition_schema:product_definition_formation.of_product>
                <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product_definition_formation"/>
                <product_definition_schema:product_definition_formation.id
                 rdf:datatype="&xsd;string"
                >1</product_definition_schema:product_definition_formation.id>
              </product_as_individual_xim:product_as_individual_version>
            </product_definition_schema:product_definition.formation>
            <product_definition_schema:product_definition.frame_of_reference rdf:resource="#_701"/>
          </product_definition_schema:product_definition>
        </product_definition_schema:product_definition_relationship.related_product_definition>
      </product_structure_schema:product_definition_usage>
    </product_structure_schema:product_definition_occurrence_relationship.occurrence_usage>
  </product_structure_schema:product_definition_occurrence_relationship>
  <person_organization_schema:person rdf:ID="_101">
    <person_organization_schema:person.id rdf:datatype="&xsd;string"
    >A0001</person_organization_schema:person.id>
    <person_organization_schema:person.first_name rdf:datatype=
    "&xsd;string">John</person_organization_schema:person.first_name>
    <person_organization_schema:person.last_name rdf:datatype=
    "&xsd;string">Doe</person_organization_schema:person.last_name>
  </person_organization_schema:person>
  <application_context_schema:application_context rdf:ID="_200">
    <application_context_schema:application_context.application
     rdf:datatype="&xsd;string"> </application_context_schema:application_context.application>
  </application_context_schema:application_context>
  <classification_with_attributes_mim:class_system rdf:ID="_600">
    <group_schema:group.name rdf:datatype="&xsd;string"
    >Rental Car System</group_schema:group.name>
    <group_schema:group.description rdf:datatype="&xsd;string"
    > </group_schema:group.description>
    <rdf:type rdf:resource="http://jsdai.net/express/group_schema#group"/>
  </classification_with_attributes_mim:class_system>
  <product_property_definition_schema:property_definition rdf:ID="_822">
    <rdf:type rdf:resource="http://jsdai.net/express/property_assignment_xim#assigned_property"/>
    <rdf:type rdf:resource="http://jsdai.net/express/property_assignment_xim#applied_independent_property"/>
    <property_assignment_xim:applied_independent_property.base_independent_property>
      <product_property_definition_schema:general_property rdf:ID="_520">
        <product_property_definition_schema:general_property.id
         rdf:datatype="&xsd;string"
        ></product_property_definition_schema:general_property.id>
        <product_property_definition_schema:general_property.name
         rdf:datatype="&xsd;string"
        >mass when empty</product_property_definition_schema:general_property.name>
      </product_property_definition_schema:general_property>
    </property_assignment_xim:applied_independent_property.base_independent_property>
    <product_property_definition_schema:property_definition.definition rdf:resource="#_722"/>
    <property_assignment_xim:assigned_property.representation>
      <measure_schema:measure_with_unit rdf:ID="_826">
        <measure_schema:measure_with_unit.value_component-mass_measure
         rdf:datatype="&xsd;double"
        >868.0</measure_schema:measure_with_unit.value_component-mass_measure>
        <rdf:type rdf:resource="http://jsdai.net/express/measure_schema#mass_measure_with_unit"/>
        <measure_schema:measure_with_unit.unit_component>
          <measure_schema:named_unit rdf:ID="_501">
            <rdf:type rdf:resource="http://jsdai.net/express/measure_schema#si_unit"/>
            <measure_schema:si_unit.name rdf:datatype="&xsd;int"
            >2</measure_schema:si_unit.name>
            <rdf:type rdf:resource="http://jsdai.net/express/measure_schema#mass_unit"/>
            <measure_schema:si_unit.prefix rdf:datatype="&xsd;int"
            >6</measure_schema:si_unit.prefix>
          </measure_schema:named_unit>
        </measure_schema:measure_with_unit.unit_component>
      </measure_schema:measure_with_unit>
    </property_assignment_xim:assigned_property.representation>
  </product_property_definition_schema:property_definition>
  <person_organization_schema:person_and_organization rdf:ID="_102">
    <person_organization_schema:person_and_organization.the_person rdf:resource="#_101"/>
    <person_organization_schema:person_and_organization.the_organization>
      <person_organization_schema:organization rdf:ID="_100">
        <person_organization_schema:organization.id rdf:datatype=
        "&xsd;string">VW</person_organization_schema:organization.id>
        <person_organization_schema:organization.description rdf:datatype=
        "&xsd;string">company</person_organization_schema:organization.description>
        <person_organization_schema:organization.name rdf:datatype=
        "&xsd;string">Volkswagen</person_organization_schema:organization.name>
      </person_organization_schema:organization>
    </person_organization_schema:person_and_organization.the_organization>
  </person_organization_schema:person_and_organization>
  <product_as_individual_xim:product_as_individual rdf:ID="_780">
    <product_definition_schema:product.id rdf:datatype="&xsd;string"
    >STU4567890123</product_definition_schema:product.id>
    <product_definition_schema:product.name rdf:datatype="&xsd;string"
    > </product_definition_schema:product.name>
    <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product"/>
    <rdf:type rdf:resource="http://jsdai.net/express/product_identification_xim#product_armx"/>
  </product_as_individual_xim:product_as_individual>
  <product_as_individual_xim:product_as_realized rdf:ID="_711">
    <product_definition_schema:product_definition_formation.id
     rdf:datatype="&xsd;string">as-delivered</product_definition_schema:product_definition_formation.id>
    <rdf:type rdf:resource="http://jsdai.net/express/product_as_individual_xim#product_as_individual_version"/>
    <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product_definition_formation"/>
    <product_definition_schema:product_definition_formation.of_product rdf:resource="#_710"/>
  </product_as_individual_xim:product_as_realized>
  <application_context_schema:application_context_element rdf:ID="_404">
    <application_context_schema:application_context_element.frame_of_reference rdf:resource="#_301"/>
    <application_context_schema:product_definition_context.life_cycle_stage
     rdf:datatype="&xsd;string"> </application_context_schema:product_definition_context.life_cycle_stage>
    <rdf:type rdf:resource="http://jsdai.net/express/application_context_schema#product_definition_context"/>
    <application_context_schema:application_context_element.name
     rdf:datatype="&xsd;string">part occurrence</application_context_schema:application_context_element.name>
  </application_context_schema:application_context_element>
  <classification_assignment_mim:applied_classification_assignment rdf:ID="_612">
    <classification_assignment_mim:applied_classification_assignment.items rdf:resource="#_310"/>
    <management_resources_schema:classification_assignment.assigned_class>
      <group_schema:group rdf:ID="_610">
        <group_schema:group.name rdf:datatype="&xsd;string"
        >Bighorn car rental – B_101</group_schema:group.name>
        <rdf:type rdf:resource="http://jsdai.net/express/classification_schema#class"/>
        <rdf:type rdf:resource="http://jsdai.net/express/class_xim#class_armx"/>
        <group_schema:group.description rdf:datatype="&xsd;string"
        >compact, 2 door, 4 person, 2 luggage items</group_schema:group.description>
        <class_xim:class_armx.id_x rdf:datatype="&xsd;string"
        >Bighorn car rental</class_xim:class_armx.id_x>
      </group_schema:group>
    </management_resources_schema:classification_assignment.assigned_class>
    <rdf:type rdf:resource="http://jsdai.net/express/management_resources_schema#classification_assignment"/>
    <management_resources_schema:classification_assignment.role>
      <management_resources_schema:classification_role rdf:ID="_611">
        <management_resources_schema:classification_role.name
         rdf:datatype="&xsd;string"
        > </management_resources_schema:classification_role.name>
      </management_resources_schema:classification_role>
    </management_resources_schema:classification_assignment.role>
  </classification_assignment_mim:applied_classification_assignment>
  <product_as_individual_xim:product_as_individual_view rdf:ID="_782">
    <product_definition_schema:product_definition.frame_of_reference rdf:resource="#_701"/>
    <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product_definition"/>
    <product_definition_schema:product_definition.formation>
      <product_as_individual_xim:product_as_individual_version rdf:ID="_781">
        <product_definition_schema:product_definition_formation.id
         rdf:datatype="&xsd;string"
        >1</product_definition_schema:product_definition_formation.id>
        <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product_definition_formation"/>
        <rdf:type rdf:resource="http://jsdai.net/express/product_as_individual_xim#product_as_realized"/>
        <product_definition_schema:product_definition_formation.of_product rdf:resource="#_780"/>
      </product_as_individual_xim:product_as_individual_version>
    </product_definition_schema:product_definition.formation>
    <product_definition_schema:product_definition.id rdf:datatype=
    "&xsd;string">1</product_definition_schema:product_definition.id>
    <rdf:type rdf:resource="http://jsdai.net/express/product_view_definition_xim#product_view_definition"/>
  </product_as_individual_xim:product_as_individual_view>
  <product_definition_schema:product_related_product_category rdf:ID="_308">
    <product_definition_schema:product_category.name rdf:datatype=
    "&xsd;string">part</product_definition_schema:product_category.name>
    <product_definition_schema:product_related_product_category.products rdf:resource="#_320"/>
    <product_definition_schema:product_related_product_category.products rdf:resource="#_310"/>
    <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product_category"/>
  </product_definition_schema:product_related_product_category>
  <part_view_definition_xim:part_view_definition rdf:ID="_324">
    <product_definition_schema:product_definition.frame_of_reference rdf:resource="#_303"/>
    <product_definition_schema:product_definition.formation>
      <product_definition_schema:product_definition_formation rdf:ID="_323">
        <product_definition_schema:product_definition_formation.of_product rdf:resource="#_320"/>
        <rdf:type rdf:resource="http://jsdai.net/express/part_and_version_identification_xim#part_version"/>
        <product_definition_schema:product_definition_formation.id
         rdf:datatype="&xsd;string"
        >v2</product_definition_schema:product_definition_formation.id>
      </product_definition_schema:product_definition_formation>
    </product_definition_schema:product_definition.formation>
    <rdf:type rdf:resource="http://jsdai.net/express/product_view_definition_xim#product_view_definition"/>
    <product_definition_schema:product_definition.id rdf:datatype=
    "&xsd;string">1</product_definition_schema:product_definition.id>
    <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product_definition"/>
  </part_view_definition_xim:part_view_definition>
  <product_definition_schema:product_definition_formation_relationship rdf:ID="_325">
    <product_definition_schema:product_definition_formation_relationship.related_product_definition_formation rdf:resource="#_323"/>
    <product_definition_schema:product_definition_formation_relationship.name
     rdf:datatype="&xsd;string">sequence</product_definition_schema:product_definition_formation_relationship.name>
    <product_definition_schema:product_definition_formation_relationship.id
     rdf:datatype="&xsd;string"> </product_definition_schema:product_definition_formation_relationship.id>
    <product_definition_schema:product_definition_formation_relationship.relating_product_definition_formation rdf:resource="#_321"/>
  </product_definition_schema:product_definition_formation_relationship>
  <product_as_individual_assembly_xim:product_as_individual_view_realization__pdr rdf:ID="_793">
    <product_definition_schema:product_definition_relationship.related_product_definition rdf:resource="#_792"/>
    <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product_definition_relationship"/>
    <product_definition_schema:product_definition_relationship.relating_product_definition rdf:resource="#_324"/>
  </product_as_individual_assembly_xim:product_as_individual_view_realization__pdr>
  <measure_schema:mass_measure_with_unit rdf:ID="_526">
    <measure_schema:measure_with_unit.unit_component rdf:resource="#_501"/>
    <measure_schema:measure_with_unit.value_component-mass_measure
     rdf:datatype="&xsd;double">750.0</measure_schema:measure_with_unit.value_component-mass_measure>
    <rdf:type rdf:resource="http://jsdai.net/express/measure_schema#measure_with_unit"/>
  </measure_schema:mass_measure_with_unit>
  <configuration_management_schema:configuration_design rdf:ID="_230">
    <configuration_management_schema:configuration_design.design rdf:resource="#_311"/>
    <configuration_management_schema:configuration_design.configuration>
      <configuration_management_schema:configuration_item rdf:ID="_220">
        <configuration_management_schema:configuration_item.name
         rdf:datatype="&xsd;string"
        >VW Beetle – S_101</configuration_management_schema:configuration_item.name>
        <configuration_management_schema:configuration_item.description
         rdf:datatype="&xsd;string"
        >1200cc, sunroof, red paint, leather seats</configuration_management_schema:configuration_item.description>
        <configuration_management_schema:configuration_item.id
         rdf:datatype="&xsd;string"
        >pi1</configuration_management_schema:configuration_item.id>
        <configuration_management_schema:configuration_item.item_concept>
          <product_property_definition_schema:characterized_object rdf:ID="_203">
            <product_concept_schema:product_concept.name rdf:datatype=
            "&xsd;string">VW Beetle CD</product_concept_schema:product_concept.name>
            <product_concept_schema:product_concept.id rdf:datatype=
            "&xsd;string">pc2</product_concept_schema:product_concept.id>
            <rdf:type rdf:resource="http://jsdai.net/express/product_class_xim#product_class_armx"/>
            <product_property_definition_schema:characterized_object.name
             rdf:datatype="&xsd;string"
            ></product_property_definition_schema:characterized_object.name>
            <product_concept_schema:product_concept.market_context>
              <application_context_schema:application_context_element rdf:ID="_201">
                <application_context_schema:application_context_element.frame_of_reference rdf:resource="#_200"/>
                <application_context_schema:product_concept_context.market_segment_type
                 rdf:datatype="&xsd;string"
                > </application_context_schema:product_concept_context.market_segment_type>
                <rdf:type rdf:resource="http://jsdai.net/express/application_context_schema#product_concept_context"/>
                <application_context_schema:application_context_element.name
                 rdf:datatype="&xsd;string"
                >German car market</application_context_schema:application_context_element.name>
              </application_context_schema:application_context_element>
            </product_concept_schema:product_concept.market_context>
            <rdf:type rdf:resource="http://jsdai.net/express/product_concept_schema#product_concept"/>
            <product_concept_schema:product_concept.description
             rdf:datatype="&xsd;string"
            > </product_concept_schema:product_concept.description>
            <rdf:type rdf:resource="http://jsdai.net/express/product_class_mim#product_class"/>
          </product_property_definition_schema:characterized_object>
        </configuration_management_schema:configuration_item.item_concept>
      </configuration_management_schema:configuration_item>
    </configuration_management_schema:configuration_design.configuration>
  </configuration_management_schema:configuration_design>
  <property_assignment_xim:assigned_property rdf:ID="_522">
    <rdf:type rdf:resource="http://jsdai.net/express/product_property_definition_schema#property_definition"/>
    <rdf:type rdf:resource="http://jsdai.net/express/property_assignment_xim#applied_independent_property"/>
    <property_assignment_xim:assigned_property.representation rdf:resource="#_526"/>
    <property_assignment_xim:applied_independent_property.base_independent_property rdf:resource="#_520"/>
    <product_property_definition_schema:property_definition.definition rdf:resource="#_314"/>
  </property_assignment_xim:assigned_property>
  <product_definition_schema:product_related_product_category rdf:ID="_702">
    <product_definition_schema:product_related_product_category.products rdf:resource="#_780"/>
    <product_definition_schema:product_related_product_category.products rdf:resource="#_710"/>
    <product_definition_schema:product_category.name rdf:datatype=
    "&xsd;string">physically realized product</product_definition_schema:product_category.name>
    <product_definition_schema:product_related_product_category.products rdf:resource="#_790"/>
    <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product_category"/>
  </product_definition_schema:product_related_product_category>
  <product_definition_schema:product_definition rdf:ID="_712">
    <product_definition_schema:product_definition.frame_of_reference rdf:resource="#_701"/>
    <product_definition_schema:product_definition.id rdf:datatype=
    "&xsd;string">1</product_definition_schema:product_definition.id>
    <rdf:type rdf:resource="http://jsdai.net/express/product_as_individual_xim#product_as_individual_view"/>
    <rdf:type rdf:resource="http://jsdai.net/express/product_view_definition_xim#product_view_definition"/>
    <product_definition_schema:product_definition.formation rdf:resource="#_711"/>
  </product_definition_schema:product_definition>
  <person_organization_schema:organization_role rdf:ID="_105">
    <person_organization_schema:organization_role.name rdf:datatype=
    "&xsd;string">id owner</person_organization_schema:organization_role.name>
  </person_organization_schema:organization_role>
  <product_class_xim:product_class_relationship__hierarchy rdf:ID="_204">
    <product_concept_schema:product_concept_relationship.related_product_concept rdf:resource="#_203"/>
    <product_concept_schema:product_concept_relationship.description
     rdf:datatype="&xsd;string"> </product_concept_schema:product_concept_relationship.description>
    <rdf:type rdf:resource="http://jsdai.net/express/product_concept_schema#product_concept_relationship"/>
    <product_concept_schema:product_concept_relationship.relating_product_concept>
      <product_class_mim:product_class rdf:ID="_202">
        <product_property_definition_schema:characterized_object.name
         rdf:datatype="&xsd;string"
        ></product_property_definition_schema:characterized_object.name>
        <product_concept_schema:product_concept.name rdf:datatype=
        "&xsd;string">VW Beetle</product_concept_schema:product_concept.name>
        <rdf:type rdf:resource="http://jsdai.net/express/product_concept_schema#product_concept"/>
        <rdf:type rdf:resource="http://jsdai.net/express/product_class_xim#product_class_armx"/>
        <rdf:type rdf:resource="http://jsdai.net/express/product_property_definition_schema#characterized_object"/>
        <product_concept_schema:product_concept.market_context rdf:resource="#_201"/>
        <product_concept_schema:product_concept.description rdf:datatype=
        "&xsd;string"> </product_concept_schema:product_concept.description>
        <product_concept_schema:product_concept.id rdf:datatype=
        "&xsd;string">pc1</product_concept_schema:product_concept.id>
      </product_class_mim:product_class>
    </product_concept_schema:product_concept_relationship.relating_product_concept>
    <rdf:type rdf:resource="http://jsdai.net/express/product_class_xim#product_class_relationship"/>
  </product_class_xim:product_class_relationship__hierarchy>
  <product_definition_schema:product_definition_relationship rdf:ID="_714">
    <product_definition_schema:product_definition_relationship.relating_product_definition rdf:resource="#_712"/>
    <rdf:type rdf:resource="http://jsdai.net/express/product_as_individual_assembly_xim#physical_assembly_relationship"/>
    <product_as_individual_assembly_xim:physical_assembly_relationship.is_realization_of rdf:resource="#_402"/>
    <product_definition_schema:product_definition_relationship.related_product_definition rdf:resource="#_782"/>
    <product_structure_schema:assembly_component_usage.reference_designator
     rdf:datatype="&xsd;string"> </product_structure_schema:assembly_component_usage.reference_designator>
    <rdf:type rdf:resource="http://jsdai.net/express/product_structure_schema#product_definition_usage"/>
    <rdf:type rdf:resource="http://jsdai.net/express/product_structure_schema#assembly_component_usage"/>
  </product_definition_schema:product_definition_relationship>
  <product_definition_schema:product_definition_relationship rdf:ID="_783">
    <product_definition_schema:product_definition_relationship.relating_product_definition rdf:resource="#_322"/>
    <product_definition_schema:product_definition_relationship.related_product_definition rdf:resource="#_782"/>
    <rdf:type rdf:resource="http://jsdai.net/express/product_as_individual_assembly_xim#product_as_individual_view_realization__pdr"/>
  </product_definition_schema:product_definition_relationship>
  <classification_assignment_mim:applied_classification_assignment rdf:ID="_602">
    <management_resources_schema:classification_assignment.role>
      <management_resources_schema:classification_role rdf:ID="_601">
        <management_resources_schema:classification_role.name
         rdf:datatype="&xsd;string"
        >class system membership</management_resources_schema:classification_role.name>
      </management_resources_schema:classification_role>
    </management_resources_schema:classification_assignment.role>
    <classification_assignment_mim:applied_classification_assignment.items rdf:resource="#_610"/>
    <management_resources_schema:classification_assignment.assigned_class rdf:resource="#_600"/>
    <rdf:type rdf:resource="http://jsdai.net/express/management_resources_schema#classification_assignment"/>
  </classification_assignment_mim:applied_classification_assignment>
  <application_context_schema:application_protocol_definition rdf:ID="_300">
    <application_context_schema:application_protocol_definition.application rdf:resource="#_301"/>
    <application_context_schema:application_protocol_definition.application_protocol_year
     rdf:datatype="&xsd;int">2007</application_context_schema:application_protocol_definition.application_protocol_year>
    <application_context_schema:application_protocol_definition.status
     rdf:datatype="&xsd;string"> </application_context_schema:application_protocol_definition.status>
    <application_context_schema:application_protocol_definition.application_interpreted_model_schema_name
     rdf:datatype="&xsd;string">automotive_design</application_context_schema:application_protocol_definition.application_interpreted_model_schema_name>
  </application_context_schema:application_protocol_definition>
  <product_structure_schema:product_definition_occurrence_relationship rdf:ID="_715">
    <product_structure_schema:product_definition_occurrence_relationship.occurrence_usage rdf:resource="#_714"/>
    <product_structure_schema:product_definition_occurrence_relationship.name
     rdf:datatype="&xsd;string">physical realization</product_structure_schema:product_definition_occurrence_relationship.name>
    <product_structure_schema:product_definition_occurrence_relationship.occurrence rdf:resource="#_402"/>
  </product_structure_schema:product_definition_occurrence_relationship>
  <product_definition_schema:product_definition_relationship rdf:ID="_713">
    <product_definition_schema:product_definition_relationship.related_product_definition rdf:resource="#_712"/>
    <rdf:type rdf:resource="http://jsdai.net/express/product_as_individual_assembly_xim#product_as_individual_view_realization__pdr"/>
    <product_definition_schema:product_definition_relationship.relating_product_definition rdf:resource="#_312"/>
  </product_definition_schema:product_definition_relationship>
  <product_definition_schema:product_related_product_category rdf:ID="_309">
    <product_definition_schema:product_category.name rdf:datatype=
    "&xsd;string">assembly</product_definition_schema:product_category.name>
    <product_definition_schema:product_related_product_category.products rdf:resource="#_310"/>
    <rdf:type rdf:resource="http://jsdai.net/express/product_definition_schema#product_category"/>
  </product_definition_schema:product_related_product_category>
  <person_organization_assignment_mim:applied_organization_assignment rdf:ID="_104">
    <management_resources_schema:organization_assignment.assigned_organization rdf:resource="#_100"/>
    <rdf:type rdf:resource="http://jsdai.net/express/pre_defined_product_data_management_specializations_xim#applied_organization_assignment__id_owner"/>
    <rdf:type rdf:resource="http://jsdai.net/express/management_resources_schema#organization_assignment"/>
    <person_organization_assignment_mim:applied_organization_assignment.items rdf:resource="#_320"/>
    <rdf:type rdf:resource="http://jsdai.net/express/pre_defined_product_data_management_specializations_xim#pre_defined_organization_or_person_in_organization_assignment__aoa"/>
    <person_organization_assignment_mim:applied_organization_assignment.items rdf:resource="#_310"/>
  </person_organization_assignment_mim:applied_organization_assignment>
</rdf:RDF>

[edit] 11.6 SPARQL code to convert STEP-RDF to STEP-OWL data

PREFIX basic_attribute_schema:
  <http://jsdai.net/express/basic_attribute_schema#>
PREFIX pre_defined_product_data_management_specializations_xim:
  <http://jsdai.net/express/pre_defined_product_data_management_specializations_xim#>
PREFIX product_as_individual_xim:
  <http://jsdai.net/express/product_as_individual_xim#>
PREFIX property_assignment_xim:
  <http://jsdai.net/express/property_assignment_xim#>
PREFIX xsd:
  <http://www.w3.org/2001/XMLSchema#>
PREFIX iso1000:
  <http://www.s-ten.net/iso1000.owl#>
PREFIX product_property_definition_schema:
  <http://jsdai.net/express/product_property_definition_schema#>
PREFIX rdfs:
  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX product_concept_schema:
  <http://jsdai.net/express/product_concept_schema#>
PREFIX owl:
  <http://www.w3.org/2002/07/owl#>
PREFIX management_resources_schema:
  <http://jsdai.net/express/management_resources_schema#>
PREFIX product_property_representation_schema:
  <http://jsdai.net/express/product_property_representation_schema#>
PREFIX part_view_definition_xim:
  <http://jsdai.net/express/part_view_definition_xim#>
PREFIX rdf:
  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX generic_product_occurrence_xim:
  <http://jsdai.net/express/generic_product_occurrence_xim#>
PREFIX iso31:
  <http://www.s-ten.net/iso31.owl#>
PREFIX configuration_management_schema:
  <http://jsdai.net/express/configuration_management_schema#>
PREFIX product_definition_schema:
  <http://jsdai.net/express/product_definition_schema#>
PREFIX product_class_mim:
  <http://jsdai.net/express/product_class_mim#>
PREFIX apf:
  <java:com.hp.hpl.jena.query.pfunction.library.>
PREFIX application_context_schema:
  <http://jsdai.net/express/application_context_schema#>
PREFIX part_and_version_identification_xim:
  <http://jsdai.net/express/part_and_version_identification_xim#>
PREFIX person_organization_schema:
  <http://jsdai.net/express/person_organization_schema#>
PREFIX representation_schema:
  <http://jsdai.net/express/representation_schema#>
PREFIX product_as_individual_assembly_xim:
  <http://jsdai.net/express/product_as_individual_assembly_xim#>
PREFIX measure_schema:
  <http://jsdai.net/express/measure_schema#>
PREFIX person_organization_assignment_mim:
  <http://jsdai.net/express/person_organization_assignment_mim#>
PREFIX step:
  <http://www.s-ten.net/d3_1_basic_step_ontology.owl#>
PREFIX :
  <jsdai:///S-TEN_D31_example-1.p21#>
PREFIX product_structure_schema:
  <http://jsdai.net/express/product_structure_schema#>
CONSTRUCT {

  ?part a step:Part;
        step:id ?part·id;
        step:name ?part·name;
        step:description ?part·description.

  ?pv a step:Part_version;
      rdfs:subClassOf ?pv·part;
      rdfs:subClassOf ?pv·ps;
      step:id ?pv·id;
      step:description ?pv·description.

  ?pvr·pv step:part_version_successor ?pvr·sc.
#Construct Part_view_definition
  ?pvd a step:Part_view_definition;
       step:id ?pvd·id;
       step:description ?pvd·description.
  ?pvd·pv rdfs:subClassOf ?pvd.
#Construct Product_class
  ?pc a step:Product_class;
      rdfs:subClassOf ?pc·rpc;
      step:id ?pc·id;
      step:name ?pc·name;
      step:description ?pc·description;
      step:market ?pc·market.
#Construct Product_specification
  ?ps a step:Product_specification;
      rdfs:subClassOf ?ps·ic;
      step:id ?ps·id;
      step:name ?ps·name;
      step:description ?ps·description;
      step:purpose ?ps·purpose.
#Construct Part_occurrence
  ?po a step:Part_occurrence;
      rdfs:subClassOf ?po·pv;
      step:id ?po·id;
      step:name ?po·name;
      step:description ?po·description.
  ?po·rpd a step:Part_view_definition;
      rdfs:subClassOf
        [ a ?po·rpd·restriction;
          ?po·rpd·onproperty step:nextAssemblyUsageOccurrenceDefinition;
          owl:hasValue ?po·rpd·po ].
#Constrict Properties and units
  ?gp a owl:FunctionalProperty;
      rdfs:range ?gp·range;
      a step:Physical_property_of_product_as_individual;
      step:id ?gp·id;
      step:name ?gp·name;
      step:description ?gp·description.
  ?pd a step:Property_definition;
      owl:equivalentClass
        [ a ?pd·restriction;
          owl:onProperty ?gp;
          owl:hasValue ?mwu ].
  ?pd·pvd rdfs:subClassOf ?pd.
  ?mwu a ?gp·range;
         ?mwu·u·scale
           [ a ?mwu·v·real;
             iso1000:value ?mwu·v ].

  ?pai a step:Product_as_individual;
       step:id ?pai·id;
       step:name ?pai·name;
       step:description ?pai·description.
  ?par a step:Product_as_realized;
       a ?par·pvd;
       step:id ?par·id;
       step:temporal_part ?pai;
       step:physical_assembly_relationship ?par·r.

  #Constrict Properties for Product_as_realized
  ?gpi a owl:FunctionalProperty;
      rdfs:range ?mwui·t;
      a step:Physical_property_of_product_as_individual;
      step:id ?gpi·id;
      step:name ?gpi·name;
      step:description ?gpi·description.
  ?par ?gpi ?mwui.
  ?mwui a ?mwui·t;
        ?mwui·u·scale
           [ a ?mwui·v·real;
             iso1000:value ?mwui·v ].
#Constrict Person and Organization
  ?per a step:Person;
       step:id ?per·id;
       step:last_name ?per·last_name;
       step:first_name ?per·first_name;
       step:middle_name ?per·middle_name;
       step:prefix_title ?per·prefix_title;
       step:suffix_title ?per·suffix_title.
  ?org a step:Organization;
       step:name ?org·name;
       step:id ?org·id;
       step:description ?org·description.
  ?pao a step:Person_and_organization;
       step:the_person ?pao·p;
       step:the_organization ?pao·o.
  ?aoa·i step:id_owner_assignment ?aoa·pao.
}
WHERE { GRAPH :default {
{

  ?part a part_and_version_identification_xim:part;
        product_definition_schema:product.id ?part·id
  OPTIONAL { ?part product_definition_schema:product.name ?part·name }
  OPTIONAL { ?part product_definition_schema:product.description ?part·description }

  ?pv a part_and_version_identification_xim:part_version;
      product_definition_schema:product_definition_formation.of_product ?pv·part
  OPTIONAL { ?pv product_definition_schema:product_definition_formation.id ?pv·id }
  OPTIONAL { ?pv product_definition_schema:product_definition_formation.description ?pv·description }
  OPTIONAL { ?pv·cd a configuration_management_schema:configuration_design;
               configuration_management_schema:configuration_design.design ?pv;
               configuration_management_schema:configuration_design.configuration ?pv·ps.
             [ a basic_attribute_schema:name_attribute;
               basic_attribute_schema:name_attribute.named_item ?pv·cd;
               basic_attribute_schema:name_attribute.attribute_value ?pv·cd·av ]
             FILTER ( ?pv·cd·av = "product design" )
  }

  ?pvr a product_definition_schema:product_definition_formation_relationship;
       product_definition_schema:product_definition_formation_relationship.related_product_definition_formation ?pvr·pv;
       product_definition_schema:product_definition_formation_relationship.relating_product_definition_formation ?pvr·sc;
       product_definition_schema:product_definition_formation_relationship.name ?pvr·name
  FILTER ( ?pvr·name = "sequence" )
#Where Part_view_definition
  ?pvd a part_view_definition_xim:part_view_definition;
       product_definition_schema:product_definition.formation ?pvd·pv;
       product_definition_schema:product_definition.id ?pvd·id
  OPTIONAL { ?pvd product_definition_schema:product_definition.description ?pvd·description }
#Where Product_class
  ?pc a product_class_mim:product_class;
      product_concept_schema:product_concept.id ?pc·id;
      product_concept_schema:product_concept.name ?pc·name;
      product_concept_schema:product_concept.market_context ?pc·pcc
  OPTIONAL { ?pc product_concept_schema:product_concept.description ?pc·description }
  ?pc·pcc application_context_schema:application_context_element.name ?pc·market.
  OPTIONAL {
    ?pc·pcr a product_concept_schema:product_concept_relationship;
            product_concept_schema:product_concept_relationship.related_product_concept ?pc;
            product_concept_schema:product_concept_relationship.relating_product_concept ?pc·rpc;
            product_concept_schema:product_concept_relationship.name ?pc·rpc_name.
    FILTER ( ?pc·rpc_name = "hierarchy" )
  }
#Where Product_specification
  ?ps a configuration_management_schema:configuration_item;
      configuration_management_schema:configuration_item.id ?ps·id;
      configuration_management_schema:configuration_item.name ?ps·name;
      configuration_management_schema:configuration_item.item_concept ?ps·ic
  OPTIONAL { ?ps configuration_management_schema:configuration_item.description ?ps·description }
  OPTIONAL { ?ps configuration_management_schema:configuration_item.purpose ?ps·purpose }
#Where Part_occurrence
  ?po a product_structure_schema:next_assembly_usage_occurrence;
      product_definition_schema:product_definition_relationship.id ?po·id;
      product_definition_schema:product_definition_relationship.name ?po·name.
  OPTIONAL { ?po product_definition_schema:product_definition_relationship.description ?po·description }
  { ?po product_definition_schema:product_definition_relationship.related_product_definition ?po·dbpo.
    ?po·dbpo generic_product_occurrence_xim:definition_based_product_occurrence.derived_from ?po·pvd
  } UNION {
    ?po product_definition_schema:product_definition_relationship.related_product_definition ?po·pvd
  }
  ?po·pvd a part_view_definition_xim:part_view_definition;
          product_definition_schema:product_definition.formation ?po·pv.

} UNION {

  ?po·rpd·po a product_structure_schema:next_assembly_usage_occurrence;
             product_definition_schema:product_definition_relationship.relating_product_definition ?po·rpd.
  ?po·rpd·restriction apf:assign owl:Restriction.
  ?po·rpd·onproperty apf:assign owl:onProperty.

} UNION {
#Where Properties and units
  ?gp a product_property_definition_schema:general_property;
      product_property_definition_schema:general_property.id ?gp·id;
      product_property_definition_schema:general_property.name ?gp·name
  OPTIONAL { ?gp product_property_definition_schema:general_property.description ?gp·description }
  OPTIONAL {
    
      ?pd a product_property_definition_schema:property_definition;
          property_assignment_xim:applied_independent_property.base_independent_property ?gp;
          product_property_definition_schema:property_definition.definition ?pd·pvd.
      ?pd·pvd a part_view_definition_xim:part_view_definition.
    ?pd·restriction apf:assign owl:Restriction.
    OPTIONAL {
      
        ?pd property_assignment_xim:assigned_property.representation ?mwu.
      ?mwu a ?mwu·type;
           measure_schema:measure_with_unit.unit_component ?mwu·u.
      ?mwu·v·real apf:assign iso1000:Real.
      ?mwu·u measure_schema:si_unit.name ?mwu·u·name
      OPTIONAL { ?mwu·u measure_schema:si_unit.prefix ?mwu·u·prefix }
      {
        ?gp·range apf:assign iso31:Length.
        ?mwu measure_schema:measure_with_unit.value_component-length_measure ?mwu·v;
        FILTER ( ?mwu·type = measure_schema:length_measure_with_unit )
      } UNION {
        ?gp·range apf:assign iso31:Mass.
        ?mwu measure_schema:measure_with_unit.value_component-mass_measure ?mwu·v;
        FILTER ( ?mwu·type = measure_schema:mass_measure_with_unit )
      }
      {
        ?mwu·u·scale apf:assign iso1000:meter_scale
        FILTER ( !bound(?mwu·u·prefix) && ?mwu·u·name = 1 )
      } UNION {
        ?mwu·u·scale apf:assign iso1000:kilogram_scale
        FILTER ( ?mwu·u·prefix = 6 && ?mwu·u·name = 2 )
      }
    }
  }

} UNION {

  ?pai a product_as_individual_xim:product_as_individual;
       product_definition_schema:product.id ?pai·id
  OPTIONAL { ?pai product_definition_schema:product.name ?pai·name }
  OPTIONAL { ?pai product_definition_schema:product.description ?pai·description }
  OPTIONAL {
    ?par a product_as_individual_xim:product_as_realized;
         product_definition_schema:product_definition_formation.of_product ?pai;
         product_definition_schema:product_definition_formation.id ?par·id.
    OPTIONAL {
      ?paiv a product_as_individual_xim:product_as_individual_view;
            product_definition_schema:product_definition.formation ?par.
      OPTIONAL {
        [] product_definition_schema:product_definition_relationship.relating_product_definition ?paiv;
           product_definition_schema:product_definition_relationship.related_product_definition
                [ a product_as_individual_xim:product_as_individual_view;
                  product_definition_schema:product_definition.formation ?par·r ].
      }
      OPTIONAL {
        {
          [] a product_as_individual_assembly_xim:product_as_individual_view_realization__cd;
             product_definition_schema:product_definition_relationship.related_product_definition ?paiv;
             product_definition_schema:product_definition_relationship.relating_product_definition ?par·pvd.
        } UNION {
          [] a product_as_individual_assembly_xim:product_as_individual_view_realization__pdr;
             product_definition_schema:product_definition_relationship.related_product_definition ?paiv;
             product_definition_schema:product_definition_relationship.relating_product_definition ?par·pvd.
        }
      }
      OPTIONAL {
      #Where Properties for Product_as_realized
        ?gpi a product_property_definition_schema:general_property;
             product_property_definition_schema:general_property.id ?gpi·id;
             product_property_definition_schema:general_property.name ?gpi·name
        OPTIONAL { ?gpi product_property_definition_schema:general_property.description ?gpi·description }
        ?pdi a product_property_definition_schema:property_definition;
             property_assignment_xim:applied_independent_property.base_independent_property ?gpi;
             product_property_definition_schema:property_definition.definition ?paiv;
             property_assignment_xim:assigned_property.representation ?mwui.
        ?mwui a ?mwui·type;
              measure_schema:measure_with_unit.unit_component ?mwui·u.
        ?mwui·v·real apf:assign iso1000:Real.
        ?mwui·u measure_schema:si_unit.name ?mwui·u·name
        OPTIONAL { ?mwui·u measure_schema:si_unit.prefix ?mwui·u·prefix }
        {
          ?mwui·t apf:assign iso31:Length.
          ?mwui measure_schema:measure_with_unit.value_component-length_measure ?mwui·v;
          FILTER ( ?mwui·type = measure_schema:length_measure_with_unit )
        } UNION {
          ?mwui·t apf:assign iso31:Mass.
          ?mwui measure_schema:measure_with_unit.value_component-mass_measure ?mwui·v;
          FILTER ( ?mwui·type = measure_schema:mass_measure_with_unit )
        }
        {
          ?mwui·u·scale apf:assign iso1000:meter_scale
          FILTER ( !bound(?mwui·u·prefix) && ?mwui·u·name = 1 )
        } UNION {
          ?mwui·u·scale apf:assign iso1000:kilogram_scale
          FILTER ( ?mwui·u·prefix = 6 && ?mwui·u·name = 2 )
        }
      }
    }
  }

} UNION {
#Where Person
  ?per a person_organization_schema:person;
       person_organization_schema:person.id ?per·id.
  OPTIONAL { ?per person_organization_schema:person.last_name ?per·last_name }
  OPTIONAL { ?per person_organization_schema:person.first_name ?per·first_name }
  OPTIONAL { ?per person_organization_schema:person.middle_names ?per·middle_name }
  OPTIONAL { ?per person_organization_schema:person.prefix_titles ?per·prefix_title }
  OPTIONAL { ?per person_organization_schema:person.suffix_titles ?per·suffix_title }

} UNION {
#Where Organization
  ?org a person_organization_schema:organization;
       person_organization_schema:organization.name ?org·name.
  OPTIONAL { ?org person_organization_schema:organization.id ?org·id }
  OPTIONAL { ?org person_organization_schema:organization.description ?org·description }

} UNION {

  ?pao a person_organization_schema:person_and_organization;
       person_organization_schema:person_and_organization.the_person ?pao·p;
       person_organization_schema:person_and_organization.the_organization ?pao·o.

} UNION {

  ?aoa a pre_defined_product_data_management_specializations_xim:applied_organization_assignment__id_owner;
       management_resources_schema:organization_assignment.assigned_organization ?aoa·o;
       person_organization_assignment_mim:applied_organization_assignment.items ?aoa·i.
  ?aoa·pao person_organization_schema:person_and_organization.the_organization ?aoa·o.
}
} }

[edit] 11.7 Resulting STEP-OWL dataset

<?xml version="1.0"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY xsd  "http://www.w3.org/2001/XMLSchema#">
  <!ENTITY owl  "http://www.w3.org/2002/07/owl#">
  <!ENTITY step "http://www.s-ten.net/d3_1_basic_step_ontology.owl#">
]>
<rdf:RDF
    xmlns="jsdai:///S-TEN_D31_example-1.p21#"
    xmlns:iso31="http://www.s-ten.net/iso31.owl#"
    xmlns:iso1000="http://www.s-ten.net/iso1000.owl#"
    xmlns:xsd="&xsd;"
    xmlns:step="&step;"
    xmlns:owl="&owl;"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <step:Part rdf:ID="_320">
    <step:name rdf:datatype="&xsd;string"
    >Engine-4/50KW-BX</step:name>
    <step:id rdf:datatype="&xsd;string"
    >A0002</step:id>
    <step:id_owner_assignment>
      <step:Person_and_organization rdf:ID="_102">
        <step:the_organization>
          <step:Organization rdf:ID="_100">
            <step:name rdf:datatype="&xsd;string"
            >Volkswagen</step:name>
            <step:id rdf:datatype="&xsd;string"
            >VW</step:id>
            <step:description rdf:datatype="&xsd;string"
            >company</step:description>
          </step:Organization>
        </step:the_organization>
        <step:the_person>
          <step:Person rdf:ID="_101">
            <step:first_name rdf:datatype="&xsd;string"
            >John</step:first_name>
            <step:id rdf:datatype="&xsd;string"
            >A0001</step:id>
            <step:last_name rdf:datatype="&xsd;string"
            >Doe</step:last_name>
          </step:Person>
        </step:the_person>
      </step:Person_and_organization>
    </step:id_owner_assignment>
  </step:Part>
  <step:Part_occurrence rdf:ID="_400">
    <step:id rdf:datatype="&xsd;string"
    >SI0001</step:id>
    <step:name rdf:datatype="&xsd;string"
    > </step:name>
    <rdfs:subClassOf>
      <step:Part_version rdf:ID="_321">
        <step:id rdf:datatype="&xsd;string"
        >1</step:id>
        <rdfs:subClassOf rdf:resource="#_320"/>
        <rdfs:subClassOf>
          <step:Part_view_definition rdf:ID="_322">
            <step:id rdf:datatype="&xsd;string"
            >1</step:id>
          </step:Part_view_definition>
        </rdfs:subClassOf>
      </step:Part_version>
    </rdfs:subClassOf>
  </step:Part_occurrence>
  <step:Product_as_realized rdf:ID="_791">
    <step:temporal_part>
      <step:Product_as_individual rdf:ID="_790">
        <step:id rdf:datatype="&xsd;string"
        >XYZ987654321 </step:id>
        <step:name rdf:datatype="&xsd;string"
        > </step:name>
      </step:Product_as_individual>
    </step:temporal_part>
    <rdf:type>
      <step:Part_view_definition rdf:ID="_324">
        <step:id rdf:datatype="&xsd;string"
        >1</step:id>
      </step:Part_view_definition>
    </rdf:type>
    <step:id rdf:datatype="&xsd;string"
    >1</step:id>
  </step:Product_as_realized>
  <step:Property_definition rdf:ID="_522">
    <owl:equivalentClass>
      <owl:Restriction>
        <owl:onProperty>
          <step:Physical_property_of_product_as_individual rdf:ID="_520">
            <step:id rdf:datatype="&xsd;string"
            ></step:id>
            <rdfs:range rdf:resource="http://www.s-ten.net/iso31.owl#Mass"/>
            <step:name rdf:datatype="&xsd;string"
            >mass when empty</step:name>
            <rdf:type rdf:resource="&owl;FunctionalProperty"/>
          </step:Physical_property_of_product_as_individual>
        </owl:onProperty>
        <owl:hasValue>
          <iso31:Mass rdf:ID="_526">
            <iso1000:kilogram_scale>
              <iso1000:Real>
                <iso1000:value rdf:datatype="&xsd;double"
                >750.0</iso1000:value>
              </iso1000:Real>
            </iso1000:kilogram_scale>
          </iso31:Mass>
        </owl:hasValue>
      </owl:Restriction>
    </owl:equivalentClass>
  </step:Property_definition>
  <step:Part rdf:ID="_310">
    <step:id_owner_assignment rdf:resource="#_102"/>
    <step:name rdf:datatype="&xsd;string"
    >VW Beetle – P_101</step:name>
    <step:id rdf:datatype="&xsd;string"
    >A0001</step:id>
  </step:Part>
  <step:Product_as_realized rdf:ID="_721">
    <step:physical_assembly_relationship rdf:resource="#_791"/>
    <_520>
      <iso31:Mass rdf:ID="_826">
        <iso1000:kilogram_scale>
          <iso1000:Real>
            <iso1000:value rdf:datatype="&xsd;double"
            >868.0</iso1000:value>
          </iso1000:Real>
        </iso1000:kilogram_scale>
      </iso31:Mass>
    </_520>
    <step:temporal_part>
      <step:Product_as_individual rdf:ID="_710">
        <step:name rdf:datatype="&xsd;string"
        >my car</step:name>
        <step:id rdf:datatype="&xsd;string"
        >ABX123456789</step:id>
      </step:Product_as_individual>
    </step:temporal_part>
    <step:id rdf:datatype="&xsd;string"
    >after engine replacement</step:id>
  </step:Product_as_realized>
  <step:Property_definition rdf:ID="_512">
    <owl:equivalentClass>
      <owl:Restriction>
        <owl:hasValue>
          <iso31:Length rdf:ID="_516">
            <iso1000:metre_scale>
              <iso1000:Real>
                <iso1000:value rdf:datatype="&xsd;double"
                >4.5</iso1000:value>
              </iso1000:Real>
            </iso1000:metre_scale>
          </iso31:Length>
        </owl:hasValue>
        <owl:onProperty>
          <step:Physical_property_of_product_as_individual rdf:ID="_510">
            <rdf:type rdf:resource="&owl;FunctionalProperty"/>
            <step:id rdf:datatype="&xsd;string"
            ></step:id>
            <step:name rdf:datatype="&xsd;string"
            >Overall length</step:name>
            <rdfs:range rdf:resource="http://www.s-ten.net/iso31.owl#Length"/>
          </step:Physical_property_of_product_as_individual>
        </owl:onProperty>
      </owl:Restriction>
    </owl:equivalentClass>
  </step:Property_definition>
  <step:Part_view_definition rdf:ID="_312">
    <step:id rdf:datatype="&xsd;string"
    >1</step:id>
    <rdfs:subClassOf>
      <owl:Restriction>
        <owl:onProperty rdf:resource="&step;nextAssemblyUsageOccurrenceDefinition"/>
        <owl:hasValue rdf:resource="#_400"/>
      </owl:Restriction>
    </rdfs:subClassOf>
  </step:Part_view_definition>
  <step:Product_class rdf:ID="_203">
    <step:name rdf:datatype="&xsd;string"
    >VW Beetle CD</step:name>
    <step:market rdf:datatype="&xsd;string"
    >German car market</step:market>
    <step:description rdf:datatype="&xsd;string"
    > </step:description>
    <step:id rdf:datatype="&xsd;string"
    >pc2</step:id>
  </step:Product_class>
  <step:Product_as_individual rdf:ID="_780">
    <step:id rdf:datatype="&xsd;string"
    >STU4567890123</step:id>
    <step:name rdf:datatype="&xsd;string"
    > </step:name>
  </step:Product_as_individual>
  <step:Product_class rdf:ID="_202">
    <step:description rdf:datatype="&xsd;string"
    > </step:description>
    <step:market rdf:datatype="&xsd;string"
    >German car market</step:market>
    <step:name rdf:datatype="&xsd;string"
    >VW Beetle</step:name>
    <step:id rdf:datatype="&xsd;string"
    >pc1</step:id>
  </step:Product_class>
  <_322 rdf:ID="_781">
    <step:id rdf:datatype="&xsd;string"
    >1</step:id>
    <rdf:type rdf:resource="&step;Product_as_realized"/>
    <step:temporal_part rdf:resource="#_780"/>
  </_322>
  <step:Product_as_realized rdf:ID="_711">
    <step:id rdf:datatype="&xsd;string"
    >as-delivered</step:id>
    <step:physical_assembly_relationship rdf:resource="#_781"/>
    <rdf:type rdf:resource="#_312"/>
    <step:temporal_part rdf:resource="#_710"/>
  </step:Product_as_realized>
  <step:Part_version rdf:ID="_323">
    <rdfs:subClassOf rdf:resource="#_324"/>
    <rdfs:subClassOf rdf:resource="#_320"/>
    <step:id rdf:datatype="&xsd;string"
    >v2</step:id>
    <step:part_version_successor rdf:resource="#_321"/>
  </step:Part_version>
  <step:Part_view_definition rdf:ID="_314">
    <step:id rdf:datatype="&xsd;string"
    >2</step:id>
    <rdfs:subClassOf rdf:resource="#_512"/>
    <rdfs:subClassOf rdf:resource="#_522"/>
  </step:Part_view_definition>
  <step:Product_specification rdf:ID="_220">
    <step:name rdf:datatype="&xsd;string"
    >VW Beetle – S_101</step:name>
    <step:description rdf:datatype="&xsd;string"
    >1200cc, sunroof, red paint, leather seats</step:description>
    <rdfs:subClassOf rdf:resource="#_203"/>
    <step:id rdf:datatype="&xsd;string"
    >pi1</step:id>
  </step:Product_specification>
  <step:Part_version rdf:ID="_311">
    <rdfs:subClassOf rdf:resource="#_314"/>
    <rdfs:subClassOf rdf:resource="#_310"/>
    <rdfs:subClassOf rdf:resource="#_312"/>
    <step:id rdf:datatype="&xsd;string"
    >1</step:id>
  </step:Part_version>
</rdf:RDF>

[edit] 11.8 SPARQL code to convert STEP-OWL data to STEP-RDF

PREFIX basic_attribute_schema:
  <http://jsdai.net/express/basic_attribute_schema#>
PREFIX pre_defined_product_data_management_specializations_xim:
  <http://jsdai.net/express/pre_defined_product_data_management_specializations_xim#>
PREFIX product_as_individual_xim:
  <http://jsdai.net/express/product_as_individual_xim#>
PREFIX property_assignment_xim:
  <http://jsdai.net/express/property_assignment_xim#>
PREFIX xsd:
  <http://www.w3.org/2001/XMLSchema#>
PREFIX iso1000:
  <http://www.s-ten.net/iso1000.owl#>
PREFIX product_property_definition_schema:
  <http://jsdai.net/express/product_property_definition_schema#>
PREFIX rdfs:
  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX product_concept_schema:
  <http://jsdai.net/express/product_concept_schema#>
PREFIX owl:
  <http://www.w3.org/2002/07/owl#>
PREFIX management_resources_schema:
  <http://jsdai.net/express/management_resources_schema#>
PREFIX product_property_representation_schema:
  <http://jsdai.net/express/product_property_representation_schema#>
PREFIX part_view_definition_xim:
  <http://jsdai.net/express/part_view_definition_xim#>
PREFIX rdf:
  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX generic_product_occurrence_xim:
  <http://jsdai.net/express/generic_product_occurrence_xim#>
PREFIX iso31:
  <http://www.s-ten.net/iso31.owl#>
PREFIX configuration_management_schema:
  <http://jsdai.net/express/configuration_management_schema#>
PREFIX product_definition_schema:
  <http://jsdai.net/express/product_definition_schema#>
PREFIX apf:
  <java:com.hp.hpl.jena.query.pfunction.library.>
PREFIX product_class_mim:
  <http://jsdai.net/express/product_class_mim#>
PREFIX application_context_schema:
  <http://jsdai.net/express/application_context_schema#>
PREFIX part_and_version_identification_xim:
  <http://jsdai.net/express/part_and_version_identification_xim#>
PREFIX person_organization_schema:
  <http://jsdai.net/express/person_organization_schema#>
PREFIX representation_schema:
  <http://jsdai.net/express/representation_schema#>
PREFIX product_as_individual_assembly_xim:
  <http://jsdai.net/express/product_as_individual_assembly_xim#>
PREFIX measure_schema:
  <http://jsdai.net/express/measure_schema#>
PREFIX qualified_measure_schema:
  <http://jsdai.net/express/qualified_measure_schema#>
PREFIX person_organization_assignment_mim:
  <http://jsdai.net/express/person_organization_assignment_mim#>
PREFIX step:
  <http://www.s-ten.net/d3_1_basic_step_ontology.owl#>
PREFIX :
  <jsdai:///S-TEN_D31_example-1.p21#>
PREFIX product_structure_schema:
  <http://jsdai.net/express/product_structure_schema#>
CONSTRUCT {

  ?part a part_and_version_identification_xim:part;
        product_definition_schema:product.id ?part·id;
        product_definition_schema:product.name ?part·name;
        product_definition_schema:product.description ?part·description.

  ?pv a part_and_version_identification_xim:part_version;
      product_definition_schema:product_definition_formation.of_product ?pv·part;
      product_definition_schema:product_definition_formation.id ?pv·id;
      product_definition_schema:product_definition_formation.description ?pv·description.
  [] a ?pv·cd·na·a;
     basic_attribute_schema:name_attribute.attribute_value ?pv·cd·av;
     ?pv·cd·na·ni
       [ a ?pv·cd·a;
         configuration_management_schema:configuration_design.design ?pv·cd;
         configuration_management_schema:configuration_design.configuration ?pv·cd·ps ].

  [] a ?pvr·a;
       product_definition_schema:product_definition_formation_relationship.related_product_definition_formation ?pvr·pv;
       product_definition_schema:product_definition_formation_relationship.relating_product_definition_formation ?pvr·sc;
       product_definition_schema:product_definition_formation_relationship.name ?pvr·name.

  ?pvd a part_view_definition_xim:part_view_definition;
       product_definition_schema:product_definition.formation ?pvd·pv;
       product_definition_schema:product_definition.id ?pvd·id;
       product_definition_schema:product_definition.description ?pvd·description.
#Construct product_class
  ?pc a product_class_mim:product_class;
      product_concept_schema:product_concept.id ?pc·id;
      product_concept_schema:product_concept.name ?pc·name;
      product_concept_schema:product_concept.description ?pc·description.
  ?pc·pcc product_concept_schema:product_concept.market_context
          [ a ?pc·pcc·a;
              application_context_schema:application_context_element.name ?pc·pcc·market ].
  [] a ?pc·pcr·a;
     product_concept_schema:product_concept_relationship.related_product_concept ?pc·pcr;
     product_concept_schema:product_concept_relationship.relating_product_concept ?pc·rpc;
     product_concept_schema:product_concept_relationship.name ?pc·pcr·name.
#Construct configuration_item
  ?ps a configuration_management_schema:configuration_item;
      configuration_management_schema:configuration_item.id ?ps·id;
      configuration_management_schema:configuration_item.name ?ps·name;
      configuration_management_schema:configuration_item.item_concept ?ps·pc;
      configuration_management_schema:configuration_item.description ?ps·description;
      configuration_management_schema:configuration_item.purpose ?ps·purpose.
#Construct next_assembly_usage_occurrence
  ?po a product_structure_schema:next_assembly_usage_occurrence;
      product_definition_schema:product_definition_relationship.id ?po·id;
      product_definition_schema:product_definition_relationship.name ?po·name;
      product_definition_schema:product_definition_relationship.description ?po·description;
      product_definition_schema:product_definition_relationship.related_product_definition ?po·pvd.
  ?po·rpd·po product_definition_schema:product_definition_relationship.relating_product_definition ?po·rpd.
#Constrict Properties and units
  ?gp a product_property_definition_schema:general_property;
      product_property_definition_schema:general_property.id ?gp·id;
      product_property_definition_schema:general_property.name ?gp·name;
      product_property_definition_schema:general_property.description ?gp·description.
  
  ?pd a property_assignment_xim:applied_independent_property;
  
      property_assignment_xim:applied_independent_property.base_independent_property ?gp;
      product_property_definition_schema:property_definition.definition ?pd·pvd;
      property_assignment_xim:assigned_property.representation ?mwu.
  
  ?mwu a ?mwu·type1, ?mwu·type2;
       ?mwu·vc ?mwu·v;
       ?mwu·uc
         [ a ?mwu·u·type1, ?mwu·u·type2;
           measure_schema:si_unit.name ?mwu·u·name;
           measure_schema:si_unit.prefix ?mwu·u·prefix ];
       representation_schema:representation_item.name ?mwu·name.

  ?pai a product_as_individual_xim:product_as_individual;
       product_definition_schema:product.id ?pai·id;
       product_definition_schema:product.name ?pai·name;
       product_definition_schema:product.description ?pai·description.
  ?par a product_as_individual_xim:product_as_realized;
       product_definition_schema:product_definition_formation.of_product ?pai;
       product_definition_schema:product_definition_formation.id ?par·id.

  _:paiv a ?paiv·a;
        product_definition_schema:product_definition.formation ?par.
  [] a ?phar·a;
     ?phar·relating _:paiv;
     ?phar·related
          [ a ?paiv·ar;
            product_definition_schema:product_definition.formation ?par·r ].
  [] a ?paivr·a;
     ?paivr·related _:paiv;
     product_definition_schema:product_definition_relationship.relating_product_definition ?par·pvd.

  #Constrict Properties for Product_as_realized
  ?gpi a product_property_definition_schema:general_property;
       product_property_definition_schema:general_property.id ?gpi·id;
       product_property_definition_schema:general_property.name ?gpi·name;
       product_property_definition_schema:general_property.description ?gpi·description.
  [] a ?paivd·a;
     property_assignment_xim:applied_independent_property.base_independent_property ?gpi;
     ?paivd·d _:paiv;
     property_assignment_xim:assigned_property.representation ?mwui.
  ?mwui a ?mwui·type1, ?mwui·type2;
        ?mwui·vc ?mwui·v;
        ?mwui·uc
          [ a ?mwui·u·type1, ?mwui·u·type2;
            measure_schema:si_unit.name ?mwui·u·name;
            measure_schema:si_unit.prefix ?mwui·u·prefix ];
        representation_schema:representation_item.name ?mwui·name.
#Constrict Person and Organization
  ?per a person_organization_schema:person;
       person_organization_schema:person.id ?per·id;
       person_organization_schema:person.last_name ?per·last_name;
       person_organization_schema:person.first_name ?per·first_name;
       person_organization_schema:person.middle_names ?per·middle_name;
       person_organization_schema:person.prefix_titles ?per·prefix_title;
       person_organization_schema:person.suffix_titles ?per·suffix_title.
  ?org a person_organization_schema:organization;
       person_organization_schema:organization.name ?org·name;
       person_organization_schema:organization.id ?org·id;
       person_organization_schema:organization.description ?org·description.
  ?pao a person_organization_schema:person_and_organization;
       person_organization_schema:person_and_organization.the_person ?pao·p;
       person_organization_schema:person_and_organization.the_organization ?pao·o.
  [] a ?aoa·a;
     management_resources_schema:organization_assignment.assigned_organization ?aoa·o;
     person_organization_assignment_mim:applied_organization_assignment.items ?aoa·i.
  ?aoa·pao person_organization_schema:person_and_organization.the_organization ?aoa·o.
}
WHERE { GRAPH <http://www.s-ten.net/S-TEN_D31_example-1.owl> {
{
#Where configuration_item
  ?ps a step:Product_specification;
      rdfs:subClassOf ?ps·pc;
      step:id ?ps·id;
      step:name ?ps·name.
  ?ps·pc a step:Product_class.
  OPTIONAL { ?ps step:description ?ps·description }
  OPTIONAL { ?ps step:purpose ?ps·purpose }

} UNION {

  ?part a step:Part;
        step:id ?part·id
  OPTIONAL { ?part step:name ?part·name }
  OPTIONAL { ?part step:description ?part·description }

} UNION {

  ?pv a step:Part_version;
      rdfs:subClassOf ?pv·part.
  OPTIONAL { ?pv step:id ?pv·id }
  OPTIONAL { ?pv step:description ?pv·description }
  ?pv·part a step:Part.

} UNION {

  ?pv·cd a step:Part_version;
         rdfs:subClassOf ?pv·cd·ps.
  ?pv·cd·ps a step:Product_specification.
  ?pv·cd·a apf:assign configuration_management_schema:configuration_design.
  ?pv·cd·na·a apf:assign basic_attribute_schema:name_attribute.
  ?pv·cd·na·ni apf:assign basic_attribute_schema:name_attribute.named_item.
  ?pv·cd·av apf:assign "product design"^^xsd:string.

} UNION {

  ?pvr·pv step:part_version_successor ?pvr·sc.
  ?pvr·a apf:assign product_definition_schema:product_definition_formation_relationship.
  ?pvr·name apf:assign "sequence"^^xsd:string.

} UNION {

  ?pvd a step:Part_view_definition;
         step:id ?pvd·id.
  OPTIONAL { ?pvd step:description ?pvd·description }
  ?pvd·pv a step:Part_version;
          rdfs:subClassOf ?pvd.
  

} UNION {
#Where product_class
  ?pc a step:Product_class;
        step:id ?pc·id;
        step:name ?pc·name;
        step:description ?pc·description.

} UNION {

  ?pc·pcc a step:Product_class;
          step:market ?pc·pcc·market.
  ?pc·pcc·a apf:assign application_context_schema:product_concept_context.

} UNION {

  ?pc·pcr a step:Product_class;
          rdfs:subClassOf ?pc·rpc.
  ?pc·pcr·a apf:assign product_concept_schema:product_concept_relationship.
  ?pc·pcr·name apf:assign "hierarchy"^^xsd:string.

} UNION {
#Where next_assembly_usage_occurrence
  ?po a step:Part_occurrence;
      rdfs:subClassOf ?po·pv;
      step:id ?po·id;
      step:name ?po·name.
  OPTIONAL { ?po step:description ?po·description }
  ?po·pv a step:Part_version;
         rdfs:subClassOf ?po·pvd.
  ?po·pvd a step:Part_view_definition.
  ?po·rpd a step:Part_view_definition;
      rdfs:subClassOf
        [ a owl:Restriction;
          owl:onProperty step:nextAssemblyUsageOccurrenceDefinition;
          owl:hasValue ?po·rpd·po ].

} UNION {
#Where Properties and units
  ?gp a step:Physical_property_of_product_as_individual;
      step:id ?gp·id;
      step:name ?gp·name
  OPTIONAL { ?gp step:description ?gp·description }
  OPTIONAL { ?gp a owl:FunctionalProperty;
                 rdfs:range ?gp·range }
  OPTIONAL {
    ?pd a step:Property_definition;
        owl:equivalentClass
          [ a owl:Restriction;
            owl:onProperty ?gp;
            owl:hasValue ?mwu ].
    ?pd·pvd a step:Part_view_definition;
            rdfs:subClassOf ?pd.
    
    OPTIONAL {
      ?mwu a ?gp·range;
             ?mwu·u·scale
               [ a iso1000:Real;
                 iso1000:value ?mwu·v ].
      
      {
        ?mwu·type1 apf:assign measure_schema:length_measure_with_unit.
        ?mwu·type2 apf:assign qualified_measure_schema:measure_representation_item.
        ?mwu·vc apf:assign measure_schema:measure_with_unit.value_component-length_measure.
        ?mwu·name apf:assign ""^^xsd:string.
        FILTER ( ?gp·range = iso31:Length )
      } UNION {
        ?mwu·type1 apf:assign measure_schema:mass_measure_with_unit.
        ?mwu·type2 apf:assign qualified_measure_schema:measure_representation_item.
        ?mwu·vc apf:assign measure_schema:measure_with_unit.value_component-mass_measure.
        ?mwu·name apf:assign ""^^xsd:string.
        FILTER ( ?gp·range = iso31:Mass )
      }
      {
        ?mwu·u·name apf:assign "1"^^xsd:int .
        ?mwu·u·type1 apf:assign measure_schema:length_unit.
        ?mwu·u·type2 apf:assign measure_schema:si_unit.
        ?mwu·uc apf:assign measure_schema:measure_with_unit.unit_component .
        FILTER ( ?mwu·u·scale = iso1000:meter_scale )
      } UNION {
        ?mwu·u·name apf:assign "2"^^xsd:int .
        ?mwu·u·prefix apf:assign "6"^^xsd:int .
        ?mwu·u·type1 apf:assign measure_schema:mass_unit.
        ?mwu·u·type2 apf:assign measure_schema:si_unit.
        ?mwu·uc apf:assign measure_schema:measure_with_unit.unit_component .
        FILTER ( ?mwu·u·scale = iso1000:kilogram_scale )
      }
    }
  }

} UNION {

  ?pai a step:Product_as_individual.
  OPTIONAL { ?pai step:id ?pai·id }
  OPTIONAL { ?pai step:name ?pai·name }
  OPTIONAL { ?pai step:description ?pai·description }
  OPTIONAL {
    ?par a step:Product_as_realized;
         step:temporal_part ?pai.
    OPTIONAL { ?par step:id ?par·id }
    ?paiv·a apf:assign product_as_individual_xim:product_as_individual_view.
    OPTIONAL {
      ?par step:physical_assembly_relationship ?par·r.
      ?phar·a apf:assign product_as_individual_assembly_xim:physical_assembly_relationship.
      ?phar·relating apf:assign
        product_definition_schema:product_definition_relationship.relating_product_definition.
      ?phar·related apf:assign
        product_definition_schema:product_definition_relationship.related_product_definition.
      ?paiv·ar apf:assign product_as_individual_xim:product_as_individual_view.
    }
    OPTIONAL {
      ?par a ?par·pvd.
      ?par·pvd a step:Part_view_definition.
      ?paivr·a apf:assign
        product_as_individual_assembly_xim:product_as_individual_view_realization__pdr.
      ?paivr·related apf:assign
        product_definition_schema:product_definition_relationship.related_product_definition.
    }
    OPTIONAL {
    #Where Properties for Product_as_realized
      ?par ?gpi ?mwui.

      ?gpi a step:Physical_property_of_product_as_individual;
           step:id ?gpi·id;
           step:name ?gpi·name
      OPTIONAL { ?gpi step:description ?gpi·description }
      OPTIONAL { ?gpi a owl:FunctionalProperty;
                      rdfs:range ?mwui·t }

      ?mwui a ?mwui·t;
            ?mwui·u·scale
               [ a ?mwui·v·real;
                 iso1000:value ?mwui·v ].
      {
        ?mwui·type1 apf:assign measure_schema:length_measure_with_unit.
        ?mwui·type2 apf:assign qualified_measure_schema:measure_representation_item.
        ?mwui·vc apf:assign measure_schema:measure_with_unit.value_component-length_measure.
        ?mwui·name apf:assign ""^^xsd:string.
        FILTER ( ?mwui·t = iso31:Length )
      } UNION {
        ?mwui·type1 apf:assign measure_schema:mass_measure_with_unit.
        ?mwui·type2 apf:assign qualified_measure_schema:measure_representation_item.
        ?mwui·vc apf:assign measure_schema:measure_with_unit.value_component-mass_measure.
        ?mwui·name apf:assign ""^^xsd:string.
        FILTER ( ?mwui·t = iso31:Mass )
      }
      {
        ?mwui·u·name apf:assign "1"^^xsd:int .
        ?mwui·u·type1 apf:assign measure_schema:length_unit.
        ?mwui·u·type2 apf:assign measure_schema:si_unit.
        ?mwui·uc apf:assign measure_schema:measure_with_unit.unit_component .
        FILTER ( ?mwui·u·scale = iso1000:meter_scale )
      } UNION {
        ?mwui·u·name apf:assign "2"^^xsd:int .
        ?mwui·u·prefix apf:assign "6"^^xsd:int .
        ?mwui·u·type1 apf:assign measure_schema:mass_unit.
        ?mwui·u·type2 apf:assign measure_schema:si_unit.
        ?mwui·uc apf:assign measure_schema:measure_with_unit.unit_component .
        FILTER ( ?mwui·u·scale = iso1000:kilogram_scale )
      }

      ?paivd·a apf:assign property_assignment_xim:applied_independent_property.
      ?paivd·d apf:assign product_property_definition_schema:property_definition.definition.
    }
  }

} UNION {
#Where Person
  ?per a step:Person;
       step:id ?per·id.
  OPTIONAL { ?per step:last_name ?per·last_name }
  OPTIONAL { ?per step:first_name ?per·first_name }
  OPTIONAL { ?per step:middle_name ?per·middle_name }
  OPTIONAL { ?per step:prefix_title ?per·prefix_title }
  OPTIONAL { ?per step:suffix_title ?per·suffix_title }

} UNION {
#Where Organization
  ?org a step:Organization;
       step:name ?org·name.
  OPTIONAL { ?org step:id ?org·id }
  OPTIONAL { ?org step:description ?org·description }

} UNION {

  ?pao a step:Person_and_organization;
       step:the_person ?pao·p;
       step:the_organization ?pao·o.

} UNION {

  ?aoa·i step:id_owner_assignment ?aoa·pao.
  ?aoa·pao a step:Person_and_organization;
           step:the_organization ?aoa·o.
  ?aoa·a apf:assign
    pre_defined_product_data_management_specializations_xim:applied_organization_assignment__id_owner.
}
} }

[edit] 11.9 JSDAI application to convert STEP-RDF triples into STEP file

/**
 * $Id$
 * Created: 2007.01.18 17:31:52
 *
 * Copyright (c) LKSoftWare GmbH, 2007. All Rights Reserved.
 */
package jsdai.tools.owl;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.StringTokenizer;

import jsdai.dictionary.EAggregation_type;
import jsdai.dictionary.EArray_type;
import jsdai.dictionary.EAttribute;
import jsdai.dictionary.EBag_type;
import jsdai.dictionary.EDefined_type;
import jsdai.dictionary.EEntity_definition;
import jsdai.dictionary.EExplicit_attribute;
import jsdai.dictionary.EList_type;
import jsdai.dictionary.ESchema_definition;
import jsdai.dictionary.ESet_type;
import jsdai.lang.AEntity;
import jsdai.lang.Aggregate;
import jsdai.lang.EEntity;
import jsdai.lang.SdaiException;
import jsdai.lang.SdaiIterator;
import jsdai.lang.SdaiModel;
import jsdai.lang.SdaiRepository;
import jsdai.lang.SdaiSession;

import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.ModelMaker;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.ResIterator;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator;
import com.hp.hpl.jena.vocabulary.RDF;

/**
 * @author vaidas
 * @version $Revision$
 *
 */
public class RdfP21Merger {

	private static final String EXPRESS_URI_PREFIX = "http://jsdai.net/express/";
	private static final Object MISSING_MATCH = new Object();

	private Map matchedResources = new HashMap();

	/**
	 * @param args
	 * @throws ClassNotFoundException 
	 * @throws SdaiException 
	 * @throws IOException 
	 */
	public static void main(String[] args) throws ClassNotFoundException, SdaiException, IOException {
		SdaiSession session = SdaiSession.openSession();

		boolean showHelp = true;
		Class schemaClass = null;
		String exportFileName = null;
		if(args.length == 2) {
			showHelp = !new File(args[0]).canRead() || !new File(args[1]).canRead();
			exportFileName = args[1] + ".out.p21";
		} else if(args.length == 3) {
			StringBuffer schNameBuf = new StringBuffer();
			schNameBuf.append("jsdai.S");
			String schPar = args[1];
			int schParLen = schPar.length();
			for (int i = 0; i < schParLen; i++) {
				char ch = schPar.charAt(i);
				if(i == 0) {
					schNameBuf.append(Character.toUpperCase(ch));
				} else {
					schNameBuf.append(Character.toLowerCase(ch));
				}
			}
			schNameBuf.append(".S");
			for (int i = 0; i < schParLen; i++) {
				schNameBuf.append(schNameBuf.charAt(i + 7));
			}
			try {
				schemaClass = Class.forName(schNameBuf.toString());
				File outParent;
				showHelp = !new File(args[0]).canRead()
					|| (outParent = new File(args[2]).getAbsoluteFile().getParentFile()) == null
					|| !outParent.isDirectory();
				exportFileName = args[2];
			} catch (ClassNotFoundException e) {
			}
		}
		if(showHelp) {
			System.out.println("Usage: ");
			System.out.println("    java jsdai.tools.owl.RdfP21Merger rdf-model-file in-p21-file");
			System.out.println("    java jsdai.tools.owl.RdfP21Merger rdf-model-file express-schema out-p21-file");
			return;
		}
		// load the the driver class
		Class.forName(ModelFactory.guessDBDriver());
		session.startTransactionReadWriteAccess();
		
		SdaiRepository repository;
		if(schemaClass != null) {
			repository = session.createRepository("", null);
			repository.openRepository();
			SdaiModel defModel = repository.createSdaiModel("default", schemaClass);
			defModel.startReadWriteAccess();
		} else {
			repository = session.importClearTextEncoding("", args[1], null);
		}
		ModelMaker modelMaker = ModelFactory.createMemModelMaker();
		BufferedInputStream rdfIn = new BufferedInputStream(new FileInputStream(args[0]));
		Model rdfModel = modelMaker.createModel(args[0]).read(rdfIn, "", "N3");
		rdfIn.close();
		RdfP21Merger rdfP21Merger = new RdfP21Merger();
		rdfP21Merger.loadRefTable(rdfModel, repository);
		rdfP21Merger.merge(rdfModel, repository);
		rdfP21Merger.storeRefTable();
		repository.exportClearTextEncoding(exportFileName);
	}

	private void merge(Model rdfModel, SdaiRepository repository) throws SdaiException {
		String modelBaseUri = rdfModel.getNsPrefixURI("");
		for(ResIterator i = rdfModel.listSubjects(); i.hasNext(); ) {
			Resource resource = i.nextResource();
			EEntity instance = provideInstance(resource, repository, modelBaseUri);
			if(instance != null) {
				mergeAttributes(resource, instance, modelBaseUri);
			}
		}
	}

	private void loadRefTable(Model rdfModel,
			SdaiRepository repository) throws SdaiException, IOException {
		if(new File("rdfP21Merger.properties").canRead()) {
			InputStream in =
				new BufferedInputStream(new FileInputStream("rdfP21Merger.properties"));
			Properties refTable = new Properties();
			refTable.load(in);
			in.close();
			for (Iterator i = refTable.entrySet().iterator(); i.hasNext();) {
				Map.Entry refEntry = (Map.Entry) i.next();
				try {
					EEntity instance = repository.getSessionIdentifier((String) refEntry.getValue());
					Resource resource =
						rdfModel.getResource((String) refEntry.getKey());
					matchedResources.put(resource, instance);
				} catch (SdaiException e) {
					if(e.getErrorId() != SdaiException.EI_NEXS) {
						throw e;
					}
				}
			}
		}

	}

	private void storeRefTable() throws SdaiException, IOException {
		Properties refTable = new Properties();
		for (Iterator i = matchedResources.entrySet().iterator(); i.hasNext();) {
			Map.Entry mResEntry = (Map.Entry) i.next();
			Resource resource = (Resource) mResEntry.getKey();
			Object instance = mResEntry.getValue();
			if(!resource.isAnon() && instance != MISSING_MATCH) {
				refTable.setProperty(resource.getURI(), ((EEntity) instance).getPersistentLabel());
			}
		}
		OutputStream out =
			new BufferedOutputStream(new FileOutputStream("rdfP21Merger.properties"));
		refTable.store(out, "refTable");
		out.close();
	}

	private void mergeAttributes(Resource resource, EEntity instance,
			final String modelBaseUri) throws SdaiException {
		SdaiRepository repository = instance.findEntityInstanceSdaiModel().getRepository();
		EDefined_type[] selectTypes = new EDefined_type[5];
		ESchema_definition schDef =
			instance.findEntityInstanceSdaiModel().getUnderlyingSchema();
		Set allAttribs = new HashSet();
		for(StmtIterator i = resource.listProperties(); i.hasNext(); ) {
			Statement propStmt = i.nextStatement();
			Property propStmtPred = propStmt.getPredicate();
			if(propStmtPred.getNameSpace().startsWith(EXPRESS_URI_PREFIX)) {
				String propStmtPredName = propStmtPred.getLocalName();
				if(propStmtPredName.indexOf('.') > 0) {
					EAttribute attribute =
						instance.getAttributeDefinition(
								makeAttributeName(propStmtPredName, schDef, selectTypes));
					if(attribute instanceof EExplicit_attribute) {
						EEntity domain = ((EExplicit_attribute) attribute).getDomain(null);
						EAggregation_type aggType = findAggInDomain(domain);
						if(aggType != null && !allAttribs.contains(attribute)) {
							instance.unsetAttributeValue(attribute);
						}
						RDFNode propObject = propStmt.getObject();
						if(propObject.isLiteral()) {
							Literal litValue = (Literal) propObject.as(Literal.class);
							if(aggType != null) {
								addAggMember(instance, attribute, aggType,
										litValue.getValue(), selectTypes);
							} else {
								instance.set(attribute, litValue.getValue(), selectTypes);
							}
						} else if(propObject.isResource()) {
							Resource resValue = (Resource) propObject.as(Resource.class);
							EEntity refInstance = provideInstance(resValue, repository, modelBaseUri);
							if(refInstance != null) {
								if(aggType != null) {
									addAggMember(instance, attribute, aggType,
											refInstance, selectTypes);
								} else {
									instance.set(attribute, refInstance, null);
								}
							}
						}
						allAttribs.add(attribute);
					}
				}
			}
		}
	}

	private static EAggregation_type findAggInDomain(EEntity domain) throws SdaiException {
		if(domain instanceof EDefined_type) {
			return findAggInDomain(((EDefined_type) domain).getDomain(null));
		} else if(domain instanceof EAggregation_type) {
			return (EAggregation_type) domain;
		} else {
			// FIXME: Nested aggregates and aggregates in selects are not supported
			return null;
		}
	}

	private static void addAggMember(EEntity instance, EAttribute attribute,
			EAggregation_type aggType, Object value, EDefined_type[] selectTypes) throws SdaiException {
		Aggregate aggregate =
			instance.testAttribute(attribute, selectTypes) > 0 ?
					(Aggregate)instance.get_object(attribute) :
						instance.createAggregate(attribute, selectTypes);
		if(aggType instanceof EBag_type) {
			aggregate.addUnordered(value, null);
		} else if(aggType instanceof ESet_type) {
			aggregate.addUnordered(value, null);
		} else if(aggType instanceof EList_type) {
			aggregate.addByIndex(aggregate.getMemberCount() + 1, value, null);
		} else if(aggType instanceof EArray_type) {
			// FIXME: ARRAY support is not really implemented
			aggregate.setByIndex(1, value, null);
		}
	}

	private EEntity provideInstance(Resource resource, SdaiRepository repository,
			String modelBaseUri) throws SdaiException {
		boolean found = false;
		EEntity instance = null;
		if(!resource.isAnon()) {
			String resLocName = resource.getLocalName();
			if(resource.getNameSpace().equals(modelBaseUri) && resLocName.startsWith("_")) {
				try {
					String instanceLbl = resLocName.substring(1);
					Long.parseLong(instanceLbl);
					instance = repository.getSessionIdentifier("#" + instanceLbl);
				} catch (NumberFormatException ex) {
					instance = null;
				} catch (SdaiException e) {
					if(e.getErrorId() != SdaiException.EI_NEXS) {
						throw e;
					} else {
						instance = null;
					}
				}
				if(instance != null) {
					if(resource.listProperties().hasNext()) {
						for(StmtIterator j = resource.listProperties(RDF.type); j.hasNext(); ) {
							Node typeNode = j.nextStatement().getObject().asNode();
							if(typeNode.getNameSpace().startsWith(EXPRESS_URI_PREFIX)) {
								String typeLocName = typeNode.getLocalName();
								EEntity_definition instType =
									instance.findEntityInstanceSdaiModel().getEntityDefinition(typeLocName);
								if(instance.isKindOf(instType)) {
									found = true;
									break;
								}
							}
						}
					} else {
						found = true;
					}
				}
			}
		}
		if(!found) {
			instance = lookupOrCreateInstance(resource, repository, modelBaseUri);
		}
		return instance;
	}

	private boolean matchInstance(Resource resource, Object expected, SdaiRepository repository,
			String modelBaseUri) throws SdaiException {
		boolean found = false;
		EEntity instance = null;
		if(!resource.isAnon()) {
			String resLocName = resource.getLocalName();
			if(resource.getNameSpace().equals(modelBaseUri) && resLocName.startsWith("_")) {
				try {
					String instanceLbl = resLocName.substring(1);
					Long.parseLong(instanceLbl);
					instance = repository.getSessionIdentifier("#" + instanceLbl);
				} catch (NumberFormatException ex) {
					instance = null;
				} catch (SdaiException e) {
					if(e.getErrorId() != SdaiException.EI_NEXS) {
						throw e;
					} else {
						instance = null;
					}
				}
				if(instance != null) {
					for(StmtIterator j = resource.listProperties(RDF.type); j.hasNext(); ) {
						Node typeNode = j.nextStatement().getObject().asNode();
						if(typeNode.getNameSpace().startsWith(EXPRESS_URI_PREFIX)) {
							String typeLocName = typeNode.getLocalName();
							EEntity_definition instType =
								instance.findEntityInstanceSdaiModel().getEntityDefinition(typeLocName);
							if(instance.isKindOf(instType)) {
								found = true;
								break;
							}
						}
					}
					return found && testValueEuality(instance, expected);
				}
			}
		}
		instance = lookupOrCreateInstance(resource, repository, modelBaseUri);
		return instance != null && testValueEuality(instance, expected);
	}

	private EEntity lookupOrCreateInstance(Resource resource,
			SdaiRepository repository, String modelBaseUri) throws SdaiException {
		try {
			//Find cached instance
			Object matchedInstance = matchedResources.get(resource);
			if(matchedInstance != null) {
				return matchedInstance != MISSING_MATCH ? (EEntity)matchedInstance : null; 
			}

			SdaiModel model = repository.getModels().getByIndex(1);

			// Find instance types from resource 
			List instTypes = new ArrayList();
			for(StmtIterator i = resource.listProperties(RDF.type); i.hasNext(); ) {
				Node typeNode = i.nextStatement().getObject().asNode();
				if(typeNode.getNameSpace().startsWith(EXPRESS_URI_PREFIX)) {
					String typeLocName = typeNode.getLocalName();
					EEntity_definition instType = model.getEntityDefinition(typeLocName);
					boolean addType = true;
					for (Iterator j = instTypes.iterator(); j.hasNext();) {
						EEntity_definition othInstType = (EEntity_definition) j.next();
						if(othInstType.isSubtypeOf(instType)) {
							addType = false;
							break;
						} else if(instType.isSubtypeOf(othInstType)) {
							j.remove();
						}
					}
					if(addType) {
						instTypes.add(instType);
					}
				}
			}
			if(!instTypes.isEmpty()) {
				if(resource.isAnon()) {
					// Iterate over instances 
					AEntity instances =
						repository.getModels().getInstances(
								(EEntity_definition) instTypes.get(0));
					EDefined_type[] selectTypes = new EDefined_type[5];
					ESchema_definition schDef = model.getUnderlyingSchema();
					INSTANCES: for(SdaiIterator i = instances.createIterator(); i.next(); ) {
						EEntity instance = instances.getCurrentMemberEntity(i);

						// Filter out instances of other types
						for (Iterator j = instTypes.iterator(); j.hasNext();) {
							EEntity_definition anInstType = (EEntity_definition) j.next();
							if(!instance.isKindOf(anInstType)) {
								continue INSTANCES;
							}
						}

						// Match attribute values
						for(StmtIterator j = resource.listProperties(); j.hasNext(); ) {
							Statement propStmt = j.nextStatement();
							Property propStmtPred = propStmt.getPredicate();
							if(propStmtPred.getNameSpace().startsWith(EXPRESS_URI_PREFIX)) {
								String propStmtPredName = propStmtPred.getLocalName();
								if(propStmtPredName.indexOf('.') > 0) {
									EAttribute attribute =
										instance.getAttributeDefinition(
												makeAttributeName(propStmtPredName, schDef, selectTypes));
									RDFNode propObject = propStmt.getObject();
									if(propObject.isLiteral()) {
										Literal litValue = (Literal) propObject.as(Literal.class);
										if(instance.testAttribute(attribute, selectTypes) <= 0
												|| !testValueEuality(litValue.getValue(),
														instance.get_object(attribute))) {
											continue INSTANCES;
										}
									} else if(propObject.isResource()) {
										Resource resValue = (Resource) propObject.as(Resource.class);
										Object value =
											instance.testAttribute(attribute, selectTypes) > 0 ?
													instance.get_object(attribute) : null;
													if(!matchInstance(resValue, value, repository, modelBaseUri)) {
														continue INSTANCES;
													}
									}
								}
							}
						}

						matchedResources.put(resource, instance);
						return instance;
					}
				}

				// Make instance type name
				Collections.sort(instTypes, new Comparator() {

					public int compare(Object o1, Object o2) {
						try {
							return ((EEntity_definition) o1).getName(null).compareTo(
									((EEntity_definition) o2).getName(null));
						} catch (SdaiException e) {
							throw new RuntimeException(e);
						}
					}

				});
				//Instance was not found create a new one
				StringBuffer instTypeNameBuf = new StringBuffer();
				for(Iterator i = instTypes.iterator(); i.hasNext(); ) {
					instTypeNameBuf.append(
							((EEntity_definition) i.next()).getName(null)).append('+');
				}
				instTypeNameBuf.setLength(instTypeNameBuf.length() - 1);
				EEntity_definition finalInstType =
					model.getEntityDefinition(instTypeNameBuf.toString());
				EEntity instance = model.createEntityInstance(finalInstType);
				matchedResources.put(resource, instance);
				return instance;
			} else {
				matchedResources.put(resource, MISSING_MATCH);
				return null;
			}
		} catch (RuntimeException e) {
			Throwable cause = e.getCause();
			if(cause instanceof SdaiException) {
				throw (SdaiException)cause;
			} else {
				throw e;
			}
		}
	}

	private static String makeAttributeName(String propStmtPredName,
			ESchema_definition schDef, EDefined_type[] selectTypes) throws SdaiException {
		String attrName = propStmtPredName;
		int stIdx = -1;
		for(StringTokenizer j = new StringTokenizer(propStmtPredName,
				"-"); j.hasMoreTokens(); ) {
			String namePortion = j.nextToken();
			if(stIdx < 0) {
				attrName = namePortion;
				stIdx = 0;
			} else {
				selectTypes[stIdx++] = schDef.getDefinedType(namePortion);
			}
		}
		if(stIdx < selectTypes.length) {
			selectTypes[stIdx >= 0 ? stIdx : 0] = null;
		}
		return attrName;
	}

	private static boolean testValueEuality(Object value,
			Object expected) throws SdaiException {
		if(expected instanceof Aggregate) {
			Aggregate aggregate = (Aggregate) expected;
			for(SdaiIterator i = aggregate.createIterator(); i.next(); ) {
				Object aggExpected = aggregate.testCurrentMember(i) > 0 ?
						aggregate.getCurrentMemberObject(i) : null;
				if(aggExpected != null) {
					if(aggExpected.equals(value)) {
						return true;
					}
				} else if(value == null) {
					return true;
				}
			}
			return false;
		} else {
			return expected != null ? expected.equals(value) : value == null;
		}
	}
}

[edit] 11.10 SPARQL query execution application

/**
 * $Id$
 * Created: 2006.12.11 17:08:51
 *
 * Copyright (c) LKSoftWare GmbH, 2006. All Rights Reserved.
 */
package jsdai.tools.owl;

import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.StringTokenizer;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;

import com.hp.hpl.jena.db.IDBConnection;
import com.hp.hpl.jena.query.DataSource;
import com.hp.hpl.jena.query.DatasetFactory;
import com.hp.hpl.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory;
import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.query.ResultSetFormatter;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.ModelMaker;
import com.hp.hpl.jena.util.iterator.ExtendedIterator;

/**
 * @author vaidas
 * @version $Revision$
 *
 */
public class SparqlQuery {

	private final ModelMaker modelMaker;
	private DataSource dataSource;
	private String queryString;
	private String outGraphName;

	public SparqlQuery(ModelMaker modelMaker) {
		this.modelMaker = modelMaker;
		dataSource = null;
		queryString = null;
		outGraphName = null;
	}

	/**
	 * @param args
	 * @throws ClassNotFoundException 
	 * @throws SQLException 
	 * @throws IOException 
	 * @throws SAXException 
	 * @throws ParserConfigurationException 
	 */
	public static void main(String[] args)
	throws ClassNotFoundException, SQLException, ParserConfigurationException, SAXException, IOException {
		if(args.length != 1 || !new File(args[0]).canRead()) {
			System.out.println("Usage: ");
			System.out.println("    java jsdai.tools.owl.SparqlQuery sparql-xml-file");
			return;
		}
		// load the the driver class
		Class.forName(ModelFactory.guessDBDriver());

		IDBConnection connection = ModelFactory.createSimpleRDBConnection();
		connection.getDriver().setDoDuplicateCheck(false);
		ModelMaker modelMaker =
			ModelFactory.createModelRDBMaker(connection, ModelFactory.Minimal);
		SparqlQuery sparqlQuery = new SparqlQuery(modelMaker);
		sparqlQuery.addDatasets();
		sparqlQuery.constructQuery(args[0]);
		sparqlQuery.executeQuery();
	}

	private void constructQuery(String queryFilePath)
	throws ParserConfigurationException, SAXException, IOException {
		DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
		docBuilderFactory.setIgnoringComments(true);
		DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
		Element config = docBuilder.parse(queryFilePath).getDocumentElement();
		Map prefixMap = new HashMap();
		StringBuffer qConstruct = new StringBuffer();
		Collection whereCollection = new ArrayList();
		Collection whereAlternativeCollection = new ArrayList();
		for(Node cn = config.getFirstChild(); cn != null; cn = cn.getNextSibling()) {
			if(cn.getNodeType() != Node.ELEMENT_NODE) {
				continue;
			}
			Element confElem = (Element) cn;
			String confElemName = confElem.getNodeName();
			if(confElemName.equals("global")) {
				for(Node gn = confElem.getFirstChild(); gn != null; gn = gn.getNextSibling()) {
					if(gn.getNodeType() != Node.ELEMENT_NODE) {
						continue;
					}
					Element gpElem = (Element) gn;
					if(gpElem.getNodeName().equals("prefix")) {
						prefixMap.put(gpElem.getAttribute("name"), getNodeTextChildren(gpElem));
					}
				}
			} else if(confElemName.equals("mapping")) {
				for(Node mn = confElem.getFirstChild(); mn != null; mn = mn.getNextSibling()) {
					if(mn.getNodeType() != Node.ELEMENT_NODE) {
						continue;
					}
					Element mapElem = (Element) mn;
					String mapElemName = mapElem.getNodeName();
					if(mapElemName.equals("prefix")) {
						prefixMap.put(mapElem.getAttribute("name"), getNodeTextChildren(mapElem));
					} else if(mapElemName.equals("construct")) {
						qConstruct.append(getNodeTextChildren(mapElem));
					} else if(mapElemName.equals("where")) {
						whereCollection.add(getNodeTextChildren(mapElem));
					} else if(mapElemName.equals("where-alternative")) {
						whereAlternativeCollection.add(getNodeTextChildren(mapElem));
					}
				}
			}
		}
		StringBuffer queryBuf = new StringBuffer();
		addPrefixes(queryBuf, prefixMap);
		queryBuf.append("CONSTRUCT {\n").append(qConstruct).append("}\n");
		queryBuf.append("WHERE {");
		String graph = config.getAttribute("graph");
		if(graph.length() > 0) {
			queryBuf.append(" GRAPH ").append(graph).append(" {\n");
		} else {
			queryBuf.append("\n");
			graph = null;
		}
		if(!whereAlternativeCollection.isEmpty()) {
			queryBuf.append("{\n");
		}
		for (Iterator i = whereCollection.iterator(); i.hasNext();) {
			String where = (String) i.next();
			queryBuf.append(where);
		}
		for (Iterator i = whereAlternativeCollection.iterator(); i.hasNext();) {
			String whereAlternative = (String) i.next();
			queryBuf.append("\n} UNION {\n").append(whereAlternative);
		}
		if(!whereAlternativeCollection.isEmpty()) {
			queryBuf.append("}\n");
		}
		if(graph != null) {
			queryBuf.append("} ");
		}
		queryBuf.append("}");
		queryString = queryBuf.toString();
		outGraphName = config.getAttribute("out-graph-name");
		if(outGraphName.length() == 0) {
			outGraphName = null;
		}
	}

	private static String getNodeTextChildren(Node node) {
		String textStr = null;
		StringBuffer textBuff = null;
		for(Node cn = node.getFirstChild(); cn != null; cn = cn.getNextSibling()) {
			if(cn.getNodeType() != Node.TEXT_NODE) {
				continue;
			}
			if(textStr == null) {
				textStr = cn.getNodeValue();
			} else {
				if(textBuff == null) {
					textBuff = new StringBuffer(textStr);
				}
				textBuff.append(cn.getNodeValue());
			}
		}
		return textBuff != null ? textBuff.toString() :
			(textStr != null ? textStr : "");
	}

	private static void addPrefixes(StringBuffer query, Map prefixMap) {
		for (Iterator i = prefixMap.entrySet().iterator(); i.hasNext();) {
			Map.Entry prefixEntry = (Map.Entry) i.next();
			query.append("PREFIX ").append(prefixEntry.getKey()).append(":\n");
			query.append("  <").append(prefixEntry.getValue()).append(">\n");
		}
	}

	private void addDatasets() {
		dataSource = DatasetFactory.create(modelMaker.createDefaultModel());
		for(ExtendedIterator i = modelMaker.listModels(); i.hasNext(); ) {
			String modelName = (String) i.next();
			Model model = modelMaker.getModel(modelName);
			dataSource.addNamedModel(modelName, model);
		}
	}

	private void executeQuery() {
		printQutQuery("# ", System.out);
		long startTime = System.currentTimeMillis();
		Query query = QueryFactory.create(queryString);
		QueryExecution queryExec = QueryExecutionFactory.create(query, dataSource);
		try {
			if(query.isConstructType()) {
				Model constructModel = queryExec.execConstruct();
				constructModel.write(System.out,
						/*"N3"*/"RDF/XML-ABBREV", query.getPrefix("")/**/);
				if(outGraphName != null) {
					if(modelMaker.hasModel(outGraphName)) {
						modelMaker.removeModel(outGraphName);
					}
					Model outModel = modelMaker.createModel(outGraphName);
					outModel.begin();
					outModel.add(constructModel);
					outModel.commit();
				}
			} else if(query.isSelectType()) {
				ResultSet results = queryExec.execSelect();
				ResultSetFormatter.out(System.out, results, query);
			}
		} finally {
			queryExec.close();
		}
		System.out.println("Query time: " + (System.currentTimeMillis() - startTime) + " milliseconds");
	}

	private void printQutQuery(String linePrefix, PrintStream out) {
		StringTokenizer queryStrTokenizer = new StringTokenizer(queryString, "\r\n", true);
		char prevEolCh = 0;
		boolean doPrefix = true;
		while(queryStrTokenizer.hasMoreTokens()) {
			if(doPrefix) {
				out.print(linePrefix);
				doPrefix = false;
			}
			String line = queryStrTokenizer.nextToken();
			char ch;
			if(line.length() == 1 &&
					((ch = line.charAt(0)) == '\n' || ch == '\r')) {
				if(prevEolCh == 0 || prevEolCh == ch) {
					out.println();
					doPrefix = true;
				}
				prevEolCh = ch;
			} else {
				out.print(line);
				prevEolCh = 0;
			}
		}
		if(prevEolCh == 0) {
			out.println();
		}
	}


}

[edit] 11.11 Example XSLT coversion from STEP to OWL

This annex describes an alternative approach to convert from a STEP-File to OWL using XSLT. The approach is demonstrated for the ARM entities Part, Part_version and Part_view_definition.

The conversion requires the following steps:

  • use of JSDAI to import a STEP file according ISO 10303-21 "Clear text encoding of the exchange structure"
  • use of JSDAI to export an equivalent STEP XML file encoded as ISO 10303-28 "XML representation of EXPRESS schemas and data"
  • use XSLT to convert the STEP XML file into a OWL/RDF file

[edit] 11.11.1 Example File in ISO 10303-28 encoding

<?xml version="1.0" encoding="UTF-8"?>
<ex:iso_10303_28 version="2.0" xmlns:ex="urn:iso10303-28:ex" xmlns:xsi="http://www.w3.org/2001/XMLSchema">
  <ex:iso_10303_28_header>
    <ex:document_name>Example for S-TEN project, D3.1 - Technological validation</ex:document_name>
    <ex:time_stamp>2007-01-04T18:10:41</ex:time_stamp>
    <ex:author>Lothar Klein</ex:author>
    <ex:originating_organization>LKSoft</ex:originating_organization>
    <ex:authorization>Lothar Klein</ex:authorization>
    <ex:originating_system>IDA-STEP v1.4.3 build20051027-1703</ex:originating_system>
    <ex:preprocessor_version> </ex:preprocessor_version>
  </ex:iso_10303_28_header>
  <ex:express id="schema1" schema_name="AUTOMOTIVE_DESIGN" schemaLocation="URI:www.lksoft.com/Schema/AUTOMOTIVE_DESIGN.xml" xsi:nil="true"/>
  <ex:uos id="m0" express="schema1">
    <Application_context id="e200">
      <Application> </Application>
    </Application_context>
    <Application_context id="e301">
      <Application>mechanical design</Application>
    </Application_context>
    <Application_protocol_definition id="e300">
      <Application ref="e301" xsi:nil="true"/>
      <Application_protocol_year>2007</Application_protocol_year>
      <Application_interpreted_model_schema_name>automotive_design</Application_interpreted_model_schema_name>
      <Status> </Status>
    </Application_protocol_definition>
    <Applied_classification_assignment id="e602">
      <Items>
        <Class ref="e610" xsi:nil="true"/>
      </Items>
      <Role ref="e601" xsi:nil="true"/>
      <Assigned_class ref="e600" xsi:nil="true"/>
    </Applied_classification_assignment>
    <Applied_classification_assignment id="e612">
      <Items>
        <Product ref="e310" xsi:nil="true"/>
      </Items>
      <Role ref="e611" xsi:nil="true"/>
      <Assigned_class ref="e610" xsi:nil="true"/>
    </Applied_classification_assignment>
    <Applied_organization_assignment id="e104">
      <Items>
        <Product ref="e310" xsi:nil="true"/>
        <Product ref="e320" xsi:nil="true"/>
      </Items>
      <Role ref="e105" xsi:nil="true"/>
      <Assigned_organization ref="e100" xsi:nil="true"/>
    </Applied_organization_assignment>
    <Assembly_component_usage id="e714">
      <Reference_designator> </Reference_designator>
      <Related_product_definition ref="e782" xsi:nil="true"/>
      <Relating_product_definition ref="e712" xsi:nil="true"/>
      <Name>physical occurrence usage</Name>
      <Id> </Id>
    </Assembly_component_usage>
    <Assembly_component_usage id="e724">
      <Reference_designator> </Reference_designator>
      <Related_product_definition ref="e792" xsi:nil="true"/>
      <Relating_product_definition ref="e722" xsi:nil="true"/>
      <Name>physical occurrence usage</Name>
      <Id> </Id>
    </Assembly_component_usage>
    <Class id="e610">
      <Description>compact, 2 door, 4 person, 2 luggage items</Description>
      <Name>Bighorn car rental – B_101</Name>
    </Class>
    <Classification_role id="e601">
      <Name>class system membership</Name>
    </Classification_role>
    <Classification_role id="e611">
      <Name> </Name>
    </Classification_role>
    <Class_system id="e600">
      <Description> </Description>
      <Name>Rental Car System</Name>
    </Class_system>
    <Configuration_design id="e230">
      <Design ref="e311" xsi:nil="true"/>
      <Configuration ref="e220" xsi:nil="true"/>
    </Configuration_design>
    <Configuration_item id="e220">
      <Item_concept ref="e203" xsi:nil="true"/>
      <Description>1200cc, sunroof, red paint, leather seats</Description>
      <Name>VW Beetle – S_101</Name>
      <Id>pi1</Id>
    </Configuration_item>
    <General_property id="e510">
      <Name>Overall length</Name>
      <Id/>
    </General_property>
    <General_property id="e520">
      <Name>mass when empty</Name>
      <Id/>
    </General_property>
    <General_property_association id="e511">
      <Derived_definition ref="e512" xsi:nil="true"/>
      <Base_definition ref="e510" xsi:nil="true"/>
      <Name> </Name>
    </General_property_association>
    <General_property_association id="e521">
      <Derived_definition ref="e522" xsi:nil="true"/>
      <Base_definition ref="e520" xsi:nil="true"/>
      <Name> </Name>
    </General_property_association>
    <General_property_association id="e821">
      <Derived_definition ref="e822" xsi:nil="true"/>
      <Base_definition ref="e520" xsi:nil="true"/>
      <Name> </Name>
    </General_property_association>
    <Id_attribute id="e613">
      <Identified_item ref="e610" xsi:nil="true"/>
      <Attribute_value>Bighorn car rental</Attribute_value>
    </Id_attribute>
    <Length_measure_with_unit-Measure_representation_item id="e516">
      <Name> </Name>
      <Unit_component ref="e500" xsi:nil="true"/>
      <Value_component>
        <Length_measure>4.5</Length_measure>
      </Value_component>
    </Length_measure_with_unit-Measure_representation_item>
    <Length_unit-Si_unit id="e500">
      <Name>metre</Name>
    </Length_unit-Si_unit>
    <Mass_measure_with_unit-Measure_representation_item id="e526">
      <Name> </Name>
      <Unit_component ref="e501" xsi:nil="true"/>
      <Value_component>
        <Mass_measure>750</Mass_measure>
      </Value_component>
    </Mass_measure_with_unit-Measure_representation_item>
    <Mass_measure_with_unit-Measure_representation_item id="e826">
      <Name> </Name>
      <Unit_component ref="e501" xsi:nil="true"/>
      <Value_component>
        <Mass_measure>868</Mass_measure>
      </Value_component>
    </Mass_measure_with_unit-Measure_representation_item>
    <Mass_unit-Si_unit id="e501">
      <Name>gram</Name>
      <Prefix>kilo</Prefix>
    </Mass_unit-Si_unit>
    <Name_attribute id="e103">
      <Named_item ref="e102" xsi:nil="true"/>
      <Attribute_value>technical director</Attribute_value>
    </Name_attribute>
    <Name_attribute id="e231">
      <Named_item ref="e230" xsi:nil="true"/>
      <Attribute_value>product design</Attribute_value>
    </Name_attribute>
    <Next_assembly_usage_occurrence id="e400">
      <Related_product_definition ref="e322" xsi:nil="true"/>
      <Relating_product_definition ref="e312" xsi:nil="true"/>
      <Name> </Name>
      <Id>SI0001</Id>
    </Next_assembly_usage_occurrence>
    <Organization id="e100">
      <Description>company</Description>
      <Name>Volkswagen</Name>
      <Id>VW</Id>
    </Organization>
    <Organization_role id="e105">
      <Name>id owner</Name>
    </Organization_role>
    <Person id="e101">
      <First_name>John</First_name>
      <Last_name>Doe</Last_name>
      <Id>A0001</Id>
    </Person>
    <Person_and_organization id="e102">
      <The_organization ref="e100" xsi:nil="true"/>
      <The_person ref="e101" xsi:nil="true"/>
    </Person_and_organization>
    <Product id="e310">
      <Frame_of_reference>
        <Product_context ref="e302" xsi:nil="true"/>
      </Frame_of_reference>
      <Name>VW Beetle – P_101</Name>
      <Id>A0001</Id>
    </Product>
    <Product id="e320">
      <Frame_of_reference>
        <Product_context ref="e302" xsi:nil="true"/>
      </Frame_of_reference>
      <Name>Engine-4/50KW-BX</Name>
      <Id>A0002</Id>
    </Product>
    <Product id="e710">
      <Frame_of_reference>
        <Product_context ref="e302" xsi:nil="true"/>
      </Frame_of_reference>
      <Name>my car</Name>
      <Id>ABX123456789</Id>
    </Product>
    <Product id="e780">
      <Frame_of_reference>
        <Product_context ref="e302" xsi:nil="true"/>
      </Frame_of_reference>
      <Name> </Name>
      <Id>STU4567890123</Id>
    </Product>
    <Product id="e790">
      <Frame_of_reference>
        <Product_context ref="e302" xsi:nil="true"/>
      </Frame_of_reference>
      <Name> </Name>
      <Id>XYZ987654321 </Id>
    </Product>
    <Product_class id="e202">
      <Characterized_object.Name/>
      <Market_context ref="e201" xsi:nil="true"/>
      <Product_concept.Description> </Product_concept.Description>
      <Product_concept.Name>VW Beetle</Product_concept.Name>
      <Id>pc1</Id>
    </Product_class>
    <Product_class id="e203">
      <Characterized_object.Name/>
      <Market_context ref="e201" xsi:nil="true"/>
      <Product_concept.Description> </Product_concept.Description>
      <Product_concept.Name>VW Beetle CD</Product_concept.Name>
      <Id>pc2</Id>
    </Product_class>
    <Product_concept_context id="e201">
      <Market_segment_type> </Market_segment_type>
      <Frame_of_reference ref="e200" xsi:nil="true"/>
      <Name>German car market</Name>
    </Product_concept_context>
    <Product_concept_relationship id="e204">
      <Related_product_concept ref="e203" xsi:nil="true"/>
      <Relating_product_concept ref="e202" xsi:nil="true"/>
      <Description> </Description>
      <Name>hierarchy</Name>
    </Product_concept_relationship>
    <Product_context id="e302">
      <Discipline_type> </Discipline_type>
      <Frame_of_reference ref="e301" xsi:nil="true"/>
      <Name> </Name>
    </Product_context>
    <Product_definition id="e312">
      <Frame_of_reference ref="e303" xsi:nil="true"/>
      <Formation ref="e311" xsi:nil="true"/>
      <Id>1</Id>
    </Product_definition>
    <Product_definition id="e314">
      <Frame_of_reference ref="e303" xsi:nil="true"/>
      <Formation ref="e311" xsi:nil="true"/>
      <Id>2</Id>
    </Product_definition>
    <Product_definition id="e322">
      <Frame_of_reference ref="e303" xsi:nil="true"/>
      <Formation ref="e321" xsi:nil="true"/>
      <Id>1</Id>
    </Product_definition>
    <Product_definition id="e324">
      <Frame_of_reference ref="e303" xsi:nil="true"/>
      <Formation ref="e323" xsi:nil="true"/>
      <Id>1</Id>
    </Product_definition>
    <Product_definition id="e402">
      <Frame_of_reference ref="e404" xsi:nil="true"/>
      <Formation ref="e321" xsi:nil="true"/>
      <Id>SI0001</Id>
    </Product_definition>
    <Product_definition id="e712">
      <Frame_of_reference ref="e701" xsi:nil="true"/>
      <Formation ref="e711" xsi:nil="true"/>
      <Id>1</Id>
    </Product_definition>
    <Product_definition id="e722">
      <Frame_of_reference ref="e701" xsi:nil="true"/>
      <Formation ref="e721" xsi:nil="true"/>
      <Id>1</Id>
    </Product_definition>
    <Product_definition id="e782">
      <Frame_of_reference ref="e701" xsi:nil="true"/>
      <Formation ref="e781" xsi:nil="true"/>
      <Id>1</Id>
    </Product_definition>
    <Product_definition id="e792">
      <Frame_of_reference ref="e701" xsi:nil="true"/>
      <Formation ref="e791" xsi:nil="true"/>
      <Id>1</Id>
    </Product_definition>
    <Product_definition_context id="e303">
      <Life_cycle_stage>design</Life_cycle_stage>
      <Frame_of_reference ref="e301" xsi:nil="true"/>
      <Name>part definition</Name>
    </Product_definition_context>
    <Product_definition_context id="e304">
      <Life_cycle_stage> </Life_cycle_stage>
      <Frame_of_reference ref="e301" xsi:nil="true"/>
      <Name>assembly definition</Name>
    </Product_definition_context>
    <Product_definition_context id="e404">
      <Life_cycle_stage> </Life_cycle_stage>
      <Frame_of_reference ref="e301" xsi:nil="true"/>
      <Name>part occurrence</Name>
    </Product_definition_context>
    <Product_definition_context id="e701">
      <Life_cycle_stage> </Life_cycle_stage>
      <Frame_of_reference ref="e301" xsi:nil="true"/>
      <Name>physical occurrence</Name>
    </Product_definition_context>
    <Product_definition_context_association id="e313">
      <Role ref="e305" xsi:nil="true"/>
      <Frame_of_reference ref="e304" xsi:nil="true"/>
      <Definition ref="e312" xsi:nil="true"/>
    </Product_definition_context_association>
    <Product_definition_context_role id="e305">
      <Name>part definition type</Name>
    </Product_definition_context_role>
    <Product_definition_formation id="e311">
      <Of_product ref="e310" xsi:nil="true"/>
      <Id>1</Id>
    </Product_definition_formation>
    <Product_definition_formation id="e321">
      <Of_product ref="e320" xsi:nil="true"/>
      <Id>1</Id>
    </Product_definition_formation>
    <Product_definition_formation id="e323">
      <Of_product ref="e320" xsi:nil="true"/>
      <Id>v2</Id>
    </Product_definition_formation>
    <Product_definition_formation id="e711">
      <Of_product ref="e710" xsi:nil="true"/>
      <Id>as-delivered</Id>
    </Product_definition_formation>
    <Product_definition_formation id="e721">
      <Of_product ref="e710" xsi:nil="true"/>
      <Id>after engine replacement</Id>
    </Product_definition_formation>
    <Product_definition_formation id="e781">
      <Of_product ref="e780" xsi:nil="true"/>
      <Id>1</Id>
    </Product_definition_formation>
    <Product_definition_formation id="e791">
      <Of_product ref="e790" xsi:nil="true"/>
      <Id>1</Id>
    </Product_definition_formation>
    <Product_definition_formation_relationship id="e325">
      <Related_product_definition_formation ref="e323" xsi:nil="true"/>
      <Relating_product_definition_formation ref="e321" xsi:nil="true"/>
      <Name>sequence</Name>
      <Id> </Id>
    </Product_definition_formation_relationship>
    <Product_definition_occurrence_relationship id="e401">
      <Occurrence_usage ref="e400" xsi:nil="true"/>
      <Occurrence ref="e402" xsi:nil="true"/>
      <Name> </Name>
    </Product_definition_occurrence_relationship>
    <Product_definition_occurrence_relationship id="e715">
      <Occurrence_usage ref="e714" xsi:nil="true"/>
      <Occurrence ref="e402" xsi:nil="true"/>
      <Name>physical realization</Name>
    </Product_definition_occurrence_relationship>
    <Product_definition_occurrence_relationship id="e725">
      <Occurrence_usage ref="e724" xsi:nil="true"/>
      <Occurrence ref="e402" xsi:nil="true"/>
      <Name>physical realization</Name>
    </Product_definition_occurrence_relationship>
    <Product_definition_relationship id="e713">
      <Related_product_definition ref="e712" xsi:nil="true"/>
      <Relating_product_definition ref="e312" xsi:nil="true"/>
      <Name>physical realization</Name>
      <Id> </Id>
    </Product_definition_relationship>
    <Product_definition_relationship id="e783">
      <Related_product_definition ref="e782" xsi:nil="true"/>
      <Relating_product_definition ref="e322" xsi:nil="true"/>
      <Name>physical realization</Name>
      <Id> </Id>
    </Product_definition_relationship>
    <Product_definition_relationship id="e793">
      <Related_product_definition ref="e792" xsi:nil="true"/>
      <Relating_product_definition ref="e324" xsi:nil="true"/>
      <Name>physical realization</Name>
      <Id> </Id>
    </Product_definition_relationship>
    <Product_definition_usage id="e403">
      <Related_product_definition ref="e402" xsi:nil="true"/>
      <Relating_product_definition ref="e322" xsi:nil="true"/>
      <Name>definition usage</Name>
      <Id> </Id>
    </Product_definition_usage>
    <Product_related_product_category id="e308">
      <Products>
        <Product ref="e310" xsi:nil="true"/>
        <Product ref="e320" xsi:nil="true"/>
      </Products>
      <Name>part</Name>
    </Product_related_product_category>
    <Product_related_product_category id="e309">
      <Products>
        <Product ref="e310" xsi:nil="true"/>
      </Products>
      <Name>assembly</Name>
    </Product_related_product_category>
    <Product_related_product_category id="e702">
      <Products>
        <Product ref="e710" xsi:nil="true"/>
        <Product ref="e780" xsi:nil="true"/>
        <Product ref="e790" xsi:nil="true"/>
      </Products>
      <Name>physically realized product</Name>
    </Product_related_product_category>
    <Property_definition id="e512">
      <Definition ref="e314" xsi:nil="true"/>
      <Name>Overall length</Name>
    </Property_definition>
    <Property_definition id="e522">
      <Definition ref="e314" xsi:nil="true"/>
      <Name>mass when empty</Name>
    </Property_definition>
    <Property_definition id="e822">
      <Definition ref="e722" xsi:nil="true"/>
      <Name>mass when empty</Name>
    </Property_definition>
    <Property_definition_representation id="e513">
      <Used_representation ref="e515" xsi:nil="true"/>
      <Definition ref="e512" xsi:nil="true"/>
    </Property_definition_representation>
    <Property_definition_representation id="e523">
      <Used_representation ref="e525" xsi:nil="true"/>
      <Definition ref="e522" xsi:nil="true"/>
    </Property_definition_representation>
    <Property_definition_representation id="e823">
      <Used_representation ref="e825" xsi:nil="true"/>
      <Definition ref="e822" xsi:nil="true"/>
    </Property_definition_representation>
    <Representation id="e515">
      <Context_of_items ref="e514" xsi:nil="true"/>
      <Items>
        <Length_measure_with_unit-Measure_representation_item ref="e516" xsi:nil="true"/>
      </Items>
      <Name> </Name>
    </Representation>
    <Representation id="e525">
      <Context_of_items ref="e524" xsi:nil="true"/>
      <Items>
        <Mass_measure_with_unit-Measure_representation_item ref="e526" xsi:nil="true"/>
      </Items>
      <Name> </Name>
    </Representation>
    <Representation id="e825">
      <Context_of_items ref="e824" xsi:nil="true"/>
      <Items>
        <Mass_measure_with_unit-Measure_representation_item ref="e826" xsi:nil="true"/>
      </Items>
      <Name> </Name>
    </Representation>
    <Representation_context id="e514">
      <Context_type> </Context_type>
      <Context_identifier> </Context_identifier>
    </Representation_context>
    <Representation_context id="e524">
      <Context_type> </Context_type>
      <Context_identifier> </Context_identifier>
    </Representation_context>
    <Representation_context id="e824">
      <Context_type> </Context_type>
      <Context_identifier> </Context_identifier>
    </Representation_context>
  </ex:uos>
</ex:iso_10303_28>

[edit] 11.11.2 Stylesheet which converts p28 file into OWL for Part, Part_version and Part_view_definition

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY xsd  "http://www.w3.org/2001/XMLSchema#">
  <!ENTITY owl  "http://www.w3.org/2002/07/owl#">
  <!ENTITY step "http://www.s-ten.net/d3_1_basic_step_ontology.owl#">
]>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xalan="http://xml.apache.org/xslt"
                xmlns:ex="urn:iso10303-28:ex"
			    xmlns:xsd="&xsd;"
			    xmlns:step="&step;"
			    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
			    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
			    extension-element-prefixes="xsl xalan ex"
                version="1.0">

  <xsl:output method="xml" indent="yes" xalan:indent-amount="2"/>
  
  <xsl:template match="/ex:iso_10303_28">
    <rdf:RDF>
      <xsl:apply-templates/>
    </rdf:RDF>
  </xsl:template>

  <xsl:key name="Part.constraints"
  	match="/ex:iso_10303_28/ex:uos/Product_related_product_category[Name = 'part' or Name = 'tool' or Name = 'raw material']"
  	use="Products/Product/@ref"/>

  <xsl:template match="/ex:iso_10303_28/ex:uos/Product[count(key('Part.constraints', @id)) > 0]">
  	<step:Part rdf:ID="{@id}">
        <xsl:apply-templates mode="Part"/>
  	</step:Part>
  </xsl:template>

  <xsl:template match="Id" mode="Part">
	<step:id rdf:datatype="&xsd;string">
	  <xsl:value-of select="."/>
	</step:id>
  </xsl:template>

  <xsl:template match="Name" mode="Part">
	<step:name rdf:datatype="&xsd;string">
	  <xsl:value-of select="."/>
	</step:name>
  </xsl:template>

  <xsl:template match="Description" mode="Part">
	<step:description rdf:datatype="&xsd;string">
	  <xsl:value-of select="."/>
	</step:description>
  </xsl:template>

  <xsl:template match="text()|@*" mode="Part"/>

  <xsl:key name="Part_version.constraints"
  	match="/ex:iso_10303_28/ex:uos/Product[count(key('Part.constraints', @id)) > 0]"
  	use="@id"/>
  	
  <xsl:template match="/ex:iso_10303_28/ex:uos/Product_definition_formation[count(key('Part_version.constraints', Of_product/@ref)) > 0]"><!-- count(key('Part_version.constraints', Of_product/@ref)) > 0 -->
    <xsl:variable name="part_version_id" select="@id"/>
  	<step:Part_version rdf:ID="{@id}">
        <xsl:apply-templates mode="Part_version"/>
        <xsl:for-each select="/ex:iso_10303_28/ex:uos/Product_definition[count(key('Part_view_definition.constraints', Frame_of_reference/@ref)) > 0 and Formation/@ref = $part_version_id]">
        	<rdfs:subClassOf rdf:resource="#{@id}"/>
        </xsl:for-each>
  	</step:Part_version>
  </xsl:template>

  <xsl:template match="Of_product" mode="Part_version">
	<rdfs:subClassOf rdf:resource="#{@ref}"/>
  </xsl:template>

  <xsl:template match="Id" mode="Part_version">
	<step:id rdf:datatype="&xsd;string">
	  <xsl:value-of select="."/>
	</step:id>
  </xsl:template>

  <xsl:template match="Description" mode="Part_version">
	<step:description rdf:datatype="&xsd;string">
	  <xsl:value-of select="."/>
	</step:description>
  </xsl:template>

  <xsl:template match="text()|@*" mode="Part_version"/>

  <xsl:key name="Part_view_definition.constraints"
  	match="/ex:iso_10303_28/ex:uos/Product_definition_context[Name = 'part definition']"
  	use="@id"/>

  <xsl:template match="/ex:iso_10303_28/ex:uos/Product_definition[count(key('Part_view_definition.constraints', Frame_of_reference/@ref)) > 0]">
  	<step:Part_view_definition rdf:ID="{@id}">
        <xsl:apply-templates mode="Part_view_definition"/>
  	</step:Part_view_definition>
  </xsl:template>

  <xsl:template match="Id" mode="Part_view_definition">
	<step:id rdf:datatype="&xsd;string">
	  <xsl:value-of select="."/>
	</step:id>
  </xsl:template>

  <xsl:template match="text()|@*" mode="Part_view_definition"/>

  <xsl:template match="text()|@*"/>

</xsl:stylesheet>

[edit] 11.11.3 Resulting OWL/RDF-XML output after XSL transformation

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:step="http://www.s-ten.net/d3_1_basic_step_ontology.owl#">
  <step:Part rdf:ID="e310">
    <step:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">VW Beetle – P_101</step:name>
    <step:id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">A0001</step:id>
  </step:Part>
  <step:Part rdf:ID="e320">
    <step:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Engine-4/50KW-BX</step:name>
    <step:id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">A0002</step:id>
  </step:Part>
  <step:Part_view_definition rdf:ID="e312">
    <step:id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">1</step:id>
  </step:Part_view_definition>
  <step:Part_view_definition rdf:ID="e314">
    <step:id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">2</step:id>
  </step:Part_view_definition>
  <step:Part_view_definition rdf:ID="e322">
    <step:id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">1</step:id>
  </step:Part_view_definition>
  <step:Part_view_definition rdf:ID="e324">
    <step:id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">1</step:id>
  </step:Part_view_definition>
  <step:Part_version rdf:ID="e311">
    <rdfs:subClassOf rdf:resource="#e310"/>
    <step:id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">1</step:id>
    <rdfs:subClassOf rdf:resource="#e312"/>
    <rdfs:subClassOf rdf:resource="#e314"/>
  </step:Part_version>
  <step:Part_version rdf:ID="e321">
    <rdfs:subClassOf rdf:resource="#e320"/>
    <step:id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">1</step:id>
    <rdfs:subClassOf rdf:resource="#e322"/>
  </step:Part_version>
  <step:Part_version rdf:ID="e323">
    <rdfs:subClassOf rdf:resource="#e320"/>
    <step:id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">v2</step:id>
    <rdfs:subClassOf rdf:resource="#e324"/>
  </step:Part_version>
</rdf:RDF>