(*
 * $Id$
 *
 * JSDAI(TM), a way to implement STEP, ISO 10303
 * Copyright (C) 1997-2008, LKSoftWare GmbH, Germany
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License
 * version 3 as published by the Free Software Foundation (AGPL v3).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * JSDAI is a registered trademark of LKSoftWare GmbH, Germany
 * This software is also available under commercial licenses.
 * See also http://www.jsdai.net/
 *)

(*schema_mapping device_marking(Device_marking_arm, Device_marking_mim);*)


entity_mapping Configuration_controlled_message(Configuration_controlled_message, descriptive_representation_item);

mapping_constraints;

end_mapping_constraints;

attribute_mapping message_content(message_content, descriptive_representation_item.description);

end_attribute_mapping;

attribute_mapping message_type_specification(message_type_specification, representation_item.name);
descriptive_representation_item <=
representation_item
representation_item.name
{(representation_item.name = 'approval date')
 (representation_item.name = 'manufacturer code')
(representation_item.name = 'part number')
(representation_item.name = 'revision identifier')}

end_attribute_mapping;

attribute_mapping message_source(message_source, $PATH, Approval);

					descriptive_representation_item <=
					representation_item <-
					representation.items[i]
					representation
					approval_item = representation
					approval_item <-
					applied_approval_assignment.items[i]
					applied_approval_assignment <=
					approval_assignment
					approval_assignment.assigned_approval ->
					approval
				
end_attribute_mapping;

attribute_mapping message_source(message_source, $PATH, product_definition_formation);

					descriptive_representation_item <=
					representation_item <-
					representation.items[i]
					representation <-
					property_definition_representation.used_representation
					property_definition_representation
					property_definition_representation.definition ->
					property_definition
					property_definition.definition ->
					characterized_definition
					characterized_definition = characterized_product_definition
					characterized_product_definition
					characterized_product_definition = product_definition
					product_definition
					product_definition.formation ->
					product_definition_formation
				
end_attribute_mapping;

attribute_mapping message_source(message_source, $PATH, Organization);

					descriptive_representation_item <=
					representation_item <-
					representation.items[i]
					representation
					organization_item = representation
					organization_item <-
					applied_organization_assignment.items[i]
					applied_organization_assignment <=
					organization_assignment
					organization_assignment.assigned_organization ->
					organization
				
end_attribute_mapping;

attribute_mapping message_source(message_source, $PATH, message_source_select);
descriptive_representation_item <=
					representation_item <-
					representation.items[i]
					representation
				
end_attribute_mapping;

end_entity_mapping;

entity_mapping Document_assignment(Document_assignment, (applied_document_reference)(* alternative moved to Partial_document... (applied_document_usage_constraint_assignment) *))
extended;

attribute_mapping is_assigned_to(is_assigned_to, , Marking);
(
						document_reference_item *> device_marking_document_reference_item
						device_marking_document_reference_item = representation
					)(
						document_reference_item *> device_marking_document_reference_item
						device_marking_document_reference_item = representation
					)
end_attribute_mapping;

end_entity_mapping;

entity_mapping Marking(Marking, representation);

mapping_constraints;
{[representation
representation.name = 'marking']
[representation <-
property_definition_representation.used_representation
property_definition_representation
property_definition_representation.definition ->
property_definition
property_definition.definition ->
characterized_definition
characterized_definition = shape_definition
shape_definition
shape_definition = shape_aspect
shape_aspect]}

end_mapping_constraints;

attribute_mapping placement(placement, $PATH, axis2_placement);
representation
representation.items[i] ->
{representation_item
representation_item.name = 'marking location'}
representation_item =>
geometric_representation_item =>
placement

end_attribute_mapping;

attribute_mapping marked_message(marked_message, $PATH, Text_representation_item);
representation
representation.items[i]->
representation_item =>
{representation_item 
representation_item.name = 'text'}
descriptive_representation_item

end_attribute_mapping;

attribute_mapping marked_message(marked_message, $PATH, Configuration_controlled_message);
representation
				representation.items[i]->
				representation_item =>
				descriptive_representation_item
				
end_attribute_mapping;

attribute_mapping marked_device_shape(marked_device_shape, $PATH, marking_shape_select);
representation <-
representation_relationship.rep_1
{representation_relationship
representation_relationship.name = 'marked device shape'}
representation_relationship.rep_2 ->
representation

end_attribute_mapping;

attribute_mapping marked_device_shape(marked_device_shape, $PATH, Part_template_3d_shape_model);
representation <-
representation_relationship.rep_1
{representation_relationship
representation_relationship.name = 'marked device shape'}
representation_relationship.rep_2 ->
representation => shape_representation

end_attribute_mapping;

attribute_mapping marked_device_shape(marked_device_shape, $PATH, Physical_unit_3d_shape_model);
representation <-
representation_relationship.rep_1
{representation_relationship
representation_relationship.name = 'marked device shape'}
representation_relationship.rep_2 ->
representation => shape_representation

end_attribute_mapping;

attribute_mapping marked_device_shape(marked_device_shape, $PATH, Part_template_non_planar_2d_shape_model);
representation <-
representation_relationship.rep_1
{representation_relationship
representation_relationship.name = 'marked device shape'}
representation_relationship.rep_2 ->
representation => shape_representation => 
manifold_surface_shape_representation

end_attribute_mapping;

attribute_mapping marked_device_shape(marked_device_shape, $PATH, Part_template_planar_shape_model);
representation <-
representation_relationship.rep_1
{representation_relationship
representation_relationship.name = 'marked device shape'}
representation_relationship.rep_2 ->
representation => shape_representation

end_attribute_mapping;

attribute_mapping marked_device_shape(marked_device_shape, $PATH, Physical_unit_planar_shape_model);
representation <-
representation_relationship.rep_1
{representation_relationship
representation_relationship.name = 'marked device shape'}
representation_relationship.rep_2 ->
representation => shape_representation

end_attribute_mapping;

attribute_mapping message_representation(message_representation, $PATH, Shape_representation);
representation <-
representation_relationship.rep_1
{representation_relationship
representation_relationship.name = 'message representation'}
representation_relationship.rep_2 ->
representation =>
shape_representation

end_attribute_mapping;

attribute_mapping message_representation_text(message_representation_text, $PATH, Text_literal_with_extent);
representation <-
representation_relationship.rep_1
{representation_relationship
representation_relationship.name = 'message representation'}
representation_relationship.rep_2 ->
representation
{representation.description = 'text representation'}
representation.items[i] ->
{representation_item
representation_item.name = 'marking text'}
representation_item =>
geometric_representation_item =>
text_literal =>
text_literal_with_extent

end_attribute_mapping;

end_entity_mapping;
(*
entity_mapping Material_identification(Material_identification, material_designation)
extended;

attribute_mapping items(items, $PATH, Marking);
 characterized_definition = shape_definition
				shape_definition
				shape_definition = shape_aspect
				
end_attribute_mapping;

end_entity_mapping;
*)
(*end_schema_mapping;*)
