(*
 * $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 assembly_physical_interface_requirement(Assembly_physical_interface_requirement_arm, Assembly_physical_interface_requirement_mim);*)


entity_mapping Constraint_occurrence(Constraint_occurrence, 
				(/SUBTYPE(Termination_constraint)/)
			)
extended;

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, , Protocol_physical_layer_definition_armx);
(
							document_reference_item *> apir_document_reference_item
							apir_document_reference_item = protocol_physical_layer_definition
						)(
							document_reference_item *> apir_document_reference_item
							apir_document_reference_item = protocol_physical_layer_definition
						)
end_attribute_mapping;

end_entity_mapping;

entity_mapping Interface_requirement_occurrence(Interface_requirement_occurrence, predefined_requirement_view_definition);

mapping_constraints;
predefined_requirement_view_definition <=
product_definition
{product_definition
product_definition.description = 'interface requirement'}

end_mapping_constraints;

attribute_mapping reference_protocol(reference_protocol, $PATH, Protocol_physical_layer_definition_armx);
predefined_requirement_view_definition <=
product_definition <-
product_definition_relationship.related_product_definition
{product_definition_relationship
product_definition_relationship.name = 'reference protocol'}
product_definition_relationship.relating_product_definition ->
product_definition =>
protocol_physical_layer_definition

end_attribute_mapping;

attribute_mapping interface_to_next_higher_assembly(interface_to_next_higher_assembly, $PATH, Next_higher_assembly_interface_requirement);
predefined_requirement_view_definition <=
product_definition <-
product_definition_relationship.related_product_definition
{product_definition_relationship
product_definition_relationship.name = 'interface to next higher assembly'}
product_definition_relationship.relating_product_definition ->
product_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 <=
application_context_element
application_context_element.name = 'design requirement'}
product_definition <-
product_definition_relationship.relating_product_definition
product_definition_relationship
{product_definition_relationship
product_definition_relationship.name = 'higher assembly interface'}
product_definition_relationship.related_product_definition ->
product_definition <-
product_definition_relationship.related_product_definition
product_definition_relationship =>
product_definition_usage =>
assembly_component_usage =>
specified_higher_usage_occurrence

end_attribute_mapping;

end_entity_mapping;

entity_mapping Mating_connector_usage(Mating_connector_usage, product_definition_with_associated_documents);

mapping_constraints;
product_definition_with_associated_documents <=
product_definition
{product_definition
product_definition.description = 'mating connector'}

end_mapping_constraints;

attribute_mapping reference_designation(reference_designation, product_definition.id);
product_definition_with_associated_documents <=
product_definition
product_definition.id

end_attribute_mapping;

attribute_mapping definition(definition, $PATH, Product_view_definition);
product_definition_with_associated_documents <=
product_definition <-
product_definition_relationship.related_product_definition
product_definition_relationship
{product_definition_relationship
product_definition_relationship.name = 'instantiated part'}
product_definition_relationship.relating_product_definition ->
product_definition

end_attribute_mapping;

end_entity_mapping;

entity_mapping Mating_connector_placement_relationship(Mating_connector_placement_relationship, shape_representation);

mapping_constraints;
{shape_representation <=
representation
representation.name = 'mating connector placement'}

end_mapping_constraints;

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

end_attribute_mapping;

attribute_mapping placed_connector(placed_connector, $PATH, Mating_connector_usage);
shape_representation <=
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.description = 'mating connector'}
product_definition =>
product_definition_with_associated_documents

end_attribute_mapping;

attribute_mapping interface_context(interface_context, $PATH, Next_higher_assembly_interface_requirement);
shape_representation <=
representation <-
representation_map.mapped_representation
representation_map <-
mapped_item.mapping_source
mapped_item <=
representation_item <-
representation.items[i]
{[representation
representation.name = 'volume shape']
[representation =>
shape_representation]}
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_relationship
{product_definition_relationship
product_definition_relationship.relating_product_definition ->
product_definition
product_definition.description = 'mating connector'}
product_definition_relationship =>
product_definition_usage =>
assembly_component_usage =>
specified_higher_usage_occurrence

end_attribute_mapping;

end_entity_mapping;

entity_mapping Mating_connector_termination(Mating_connector_termination, shape_aspect);

mapping_constraints;
{shape_aspect
shape_aspect.description = 'mating connector termination'}

end_mapping_constraints;

attribute_mapping name(name, shape_aspect.name);

end_attribute_mapping;

attribute_mapping accessed_connector(accessed_connector, $PATH, Mating_connector_usage);
shape_aspect
shape_aspect.of_shape ->
product_definition_shape <=
property_definition
property_definition.definition ->
characterized_definition
characterized_definition = characterized_product_definition
characterized_product_definition
characterized_product_definition = product_definition
{product_definition
product_definition.description = 'mating connector'}
product_definition =>
product_definition_with_associated_documents

end_attribute_mapping;

attribute_mapping definition(definition, $PATH, mating_connector_definition_select);
shape_aspect <-
shape_aspect_relationship.related_shape_aspect
shape_aspect_relationship
{shape_aspect_relationship
shape_aspect_relationship.name = 'instantiated terminal'}
shape_aspect_relationship.relating_shape_aspect ->
shape_aspect

end_attribute_mapping;

attribute_mapping definition(definition, $PATH, Packaged_part_terminal_armx);
shape_aspect <-
shape_aspect_relationship.related_shape_aspect
shape_aspect_relationship
{shape_aspect_relationship
shape_aspect_relationship.name = 'instantiated terminal'}
shape_aspect_relationship.relating_shape_aspect ->
shape_aspect
shape_aspect => packaged_part_terminal

end_attribute_mapping;

attribute_mapping definition(definition, $PATH, Printed_part_template_terminal);
shape_aspect <-
shape_aspect_relationship.related_shape_aspect
shape_aspect_relationship
{shape_aspect_relationship
shape_aspect_relationship.name = 'instantiated terminal'}
shape_aspect_relationship.relating_shape_aspect ->
shape_aspect
shape_aspect => printed_part_template_terminal

end_attribute_mapping;

end_entity_mapping;

entity_mapping Next_higher_assembly_interface_requirement(Next_higher_assembly_interface_requirement, specified_higher_usage_occurrence);

mapping_constraints;

end_mapping_constraints;

attribute_mapping shape(shape, $PATH, three_dimensional_shape);
specified_higher_usage_occurrence <=
assembly_component_usage <=
product_definition_usage <=
product_definition_relationship
characterized_product_definition = product_definition_relationship
characterized_product_definition
characterized_definition = characterized_product_definition
characterized_definition <-
property_definition.definition
property_definition <-
property_definition_representation.definition
property_definition_representation
property_definition_representation.used_representation ->
{representation
representation.name = '3d bound volume shape'}
representation =>
shape_representation

end_attribute_mapping;

attribute_mapping shape(shape, $PATH, Advanced_brep_shape_representation);
specified_higher_usage_occurrence <=
				assembly_component_usage <=
				product_definition_usage <=
				product_definition_relationship
				characterized_product_definition = product_definition_relationship
				characterized_product_definition
				characterized_definition = characterized_product_definition
				characterized_definition <-
				property_definition.definition
				property_definition <-
				property_definition_representation.definition
				property_definition_representation
				property_definition_representation.used_representation ->
				{representation
				representation.name = '3d bound volume shape'}
				representation =>
				shape_representation => 
				advanced_brep_shape_representation
				
end_attribute_mapping;

attribute_mapping shape(shape, $PATH, curve_swept_solid_shape_representation);
specified_higher_usage_occurrence <=
				assembly_component_usage <=
				product_definition_usage <=
				product_definition_relationship
				characterized_product_definition = product_definition_relationship
				characterized_product_definition
				characterized_definition = characterized_product_definition
				characterized_definition <-
				property_definition.definition
				property_definition <-
				property_definition_representation.definition
				property_definition_representation
				property_definition_representation.used_representation ->
				{representation
				representation.name = '3d bound volume shape'}
				representation =>
				shape_representation => 
				curve_swept_solid_shape_representation
				
end_attribute_mapping;

attribute_mapping shape(shape, $PATH, Geometrically_bounded_surface_shape_representation);
specified_higher_usage_occurrence <=
				assembly_component_usage <=
				product_definition_usage <=
				product_definition_relationship
				characterized_product_definition = product_definition_relationship
				characterized_product_definition
				characterized_definition = characterized_product_definition
				characterized_definition <-
				property_definition.definition
				property_definition <-
				property_definition_representation.definition
				property_definition_representation
				property_definition_representation.used_representation ->
				{representation
				representation.name = '3d bound volume shape'}
				representation =>
				shape_representation =>
				geometrically_bounded_surface_shape_representation
				
end_attribute_mapping;

attribute_mapping version_of_next_higher_assembly(version_of_next_higher_assembly, $PATH, product_definition_formation);
specified_higher_usage_occurrence
specified_higher_usage_occurrence.upper_usage ->
assembly_component_usage <=
product_definition_usage <=
product_definition_relationship
product_definition_relationship.relating_product_definition ->
product_definition
product_definition.formation ->
product_definition_formation

end_attribute_mapping;

end_entity_mapping;

entity_mapping Protocol_requirement_allocation_to_part_terminal_armx(Protocol_requirement_allocation_to_part_terminal_armx, protocol_requirement_allocation_to_part_terminal);

mapping_constraints;
{protocol_requirement_allocation_to_part_terminal <=
requirement_assignment}

end_mapping_constraints;

attribute_mapping protocol_signal(protocol_signal, $PATH, Functional_unit_usage_view_terminal_definition);
protocol_requirement_allocation_to_part_terminal <=
requirement_assignment <=
group <-
group_assignment.assigned_group
{group_assignment.role -> object_role
object_role.name = 'protocol signal'}
group_assignment =>
applied_group_assignment
applied_group_assignment.items ->
groupable_item = shape_aspect
shape_aspect =>
functional_unit_terminal_definition

end_attribute_mapping;

attribute_mapping assigned_to(assigned_to, $PATH, Part_terminal);
protocol_requirement_allocation_to_part_terminal <=
requirement_assignment <-
requirement_assigned_object.assigned_group
requirement_assigned_object
requirement_assigned_object.items ->
requirement_assigned_item					
requirement_assigned_item = shape_aspect
shape_aspect

end_attribute_mapping;

attribute_mapping assigned_requirement_property(assigned_requirement_property, $PATH, Interface_requirement_occurrence);
					protocol_requirement_allocation_to_part_terminal <=
					requirement_assignment <-
					assigned_requirement.assigned_group
					assigned_requirement
					assigned_requirement.items ->
					product_definition =>
					predefined_requirement_view_definition
				
end_attribute_mapping;

end_entity_mapping;

entity_mapping Requirement_assignment_armx(Requirement_assignment_armx, requirement_assignment)
extended;

attribute_mapping assigned_to(assigned_to, , Mating_connector_termination);

					requirement_assigned_item *> apir_requirement_assigned_item
					apir_requirement_assigned_item = 
					shape_aspect 
				
end_attribute_mapping;

attribute_mapping assigned_to(assigned_to, , Termination_constraint);

					requirement_assigned_item *> apir_requirement_assigned_item
					apir_requirement_assigned_item = predefined_requirement_view_definition
				
end_attribute_mapping;

end_entity_mapping;

entity_mapping Termination_constraint(Termination_constraint, predefined_requirement_view_definition);

mapping_constraints;
predefined_requirement_view_definition <=
product_definition
{product_definition
product_definition.description = 'termination constraint'}

end_mapping_constraints;

attribute_mapping constrained_termination(constrained_termination, $PATH, Mating_connector_termination);
predefined_requirement_view_definition <=
product_definition
characterized_product_definition = product_definition
characterized_product_definition
characterized_definition = characterized_product_definition
characterized_definition <-
property_definition.definition
{property_definition.name = 'constrained termination'}
property_definition <-
property_definition_relationship.relating_property_definition
property_definition_relationship
{property_definition_relationship
property_definition_relationship.name = 'constrained termination member'}
property_definition_relationship.related_property_definition ->
property_definition
property_definition.definition ->
characterized_definition = shape_definition
shape_definition = shape_aspect
{shape_aspect
shape_aspect.description = 'mating connector termination'}

end_attribute_mapping;

end_entity_mapping;
(*end_schema_mapping;*)
