(*
 * $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 alternative_solution(Alternative_solution_arm, Alternative_solution_mim);*)

uof_mapping Alternative_solution(Alternative_solution);

entity_mapping Alternative_solution(Alternative_solution, product_definition_formation);

mapping_constraints;

 product_definition_formation 
{product_definition_formation.of_product -> product
product <- product_related_product_category.products[i]
product_related_product_category <= product_category
product_category.name = 'alternative solution'}
{product_definition_formation <- product_definition.formation 
product_definition
product_definition.frame_of_reference -> product_definition_context
product_definition_context <= application_context_element
application_context_element.name = 'alternative definition'}

end_mapping_constraints;

attribute_mapping id(id, product.id);

product_definition_formation
product_definition_formation.of_product -> product 
product.id

end_attribute_mapping;

attribute_mapping version_id(version_id, product_definition_formation.id);

end_attribute_mapping;

attribute_mapping base_element(base_element, $PATH, Alternative_solution);

product_definition_formation <- product_definition.formation 
product_definition <- product_definition_relationship.related_product_definition
product_definition_relationship
{product_definition_relationship.name = 'solution alternative definition'} 
product_definition_relationship.relating_product_definition -> product_definition 
{product_definition.frame_of_reference -> product_definition_context 
product_definition_context <= application_context_element
application_context_element.name = 'alternative definition'}
product_definition.formation -> product_definition_formation 

end_attribute_mapping;

attribute_mapping base_element(base_element, $PATH, Functional_element_definition);

product_definition_formation <- product_definition.formation 
product_definition <- product_definition_relationship.related_product_definition
product_definition_relationship
{product_definition_relationship.name = 'solution alternative definition'} 
product_definition_relationship.relating_product_definition -> product_definition 
{product_definition.frame_of_reference -> product_definition_context 
product_definition_context <= application_context_element
application_context_element.name = 'functional definition'}
product_definition.formation -> product_definition_formation 

end_attribute_mapping;

attribute_mapping base_element(base_element, $PATH, Physical_element_definition);

product_definition_formation <- product_definition.formation 
product_definition <- product_definition_relationship.related_product_definition
product_definition_relationship
{product_definition_relationship.name = 'solution alternative definition'} 
product_definition_relationship.relating_product_definition -> product_definition 
{product_definition.frame_of_reference -> product_definition_context 
product_definition_context <= application_context_element
application_context_element.name = 'conceptual definition'}
product_definition.formation -> product_definition_formation 

end_attribute_mapping;

end_entity_mapping;

entity_mapping Solution_element(Solution_element, product_definition_usage);

mapping_constraints;

product_definition_usage <= product_definition_relationship
product_definition_relationship.name
{product_definition_relationship.name = 'realization'}

end_mapping_constraints;

attribute_mapping resolved_requirement(resolved_requirement, $PATH, Alternative_solution);

product_definition_usage <= 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 = 'alternative definition'}

end_attribute_mapping;

attribute_mapping resolved_requirement(resolved_requirement, $PATH, Functional_element_definition);

product_definition_usage <= 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 = 'functional definition'}

end_attribute_mapping;

attribute_mapping resolved_requirement(resolved_requirement, $PATH, Physical_element_definition);

product_definition_usage <= 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 = 'conceptual definition'}

end_attribute_mapping;

attribute_mapping element(element, $PATH, Definition_based_part_occurrence);

product_definition_usage <= product_definition_relationship
product_definition_relationship.related_product_definition -> product_definition
{product_definition.frame_of_reference -> product_definition_context
product_definition_context <= application_context_element 
application_context_element.name = 'part occurrence'}
product_definition <- product_definition_relationship.related_product_definition
product_definition_relationship
{product_definition_relationship.name = 'definition usage'}

end_attribute_mapping;

attribute_mapping element(element, $PATH, Specification_based_part_occurrence);

product_definition_usage <= product_definition_relationship
product_definition_relationship.related_product_definition -> product_definition
{product_definition.frame_of_reference -> product_definition_context
product_definition_context <= application_context_element 
application_context_element.name = 'part occurrence'}
product_definition.formation -> product_definition_formation
{product_definition_formation.of_product -> product
product <- product_related_product_category.products[i]
product_related_product_category <= product_category
product_category.name = 'part'}
{product_definition_formation = configuration_design_item
configuration_design_item <- configuration_design.design
{configuration_design.name = 'product design'}
configuration_design.configuration -> configuration_item
(configuration_item => product_identification)
(configuration_item => product_identification
product_identification => product_specification)}

end_attribute_mapping;

attribute_mapping description(description, product_definition_relationship.description);

product_definition_usage <= product_definition_relationship
product_definition_relationship.description
end_attribute_mapping;

end_entity_mapping;

entity_mapping Supplier_solution(Supplier_solution, product_definition_formation);

mapping_constraints;
(
product_definition_formation <- product_definition.formation 
product_definition
{product_definition.frame_of_reference -> product_definition_context
product_definition_context <= application_context_element
application_context_element.name = 'alternative definition'}
{product_definition.name = 'supplier'}
)(
product_definition_formation <- product_definition.formation 
product_definition
{product_definition.frame_of_reference -> product_definition_context
product_definition_context <= application_context_element
application_context_element.name = 'alternative definition'}
{product_definition.name = 'technical supplier'}
)
end_mapping_constraints;

attribute_mapping supplier(supplier, $PATH, Organization);

product_definition_formation 
organization_item_solution = product_definition_formation
organization_item_solution <* organization_item
organization_item <- applied_organization_assignment.items[i]
applied_organization_assignment <= organization_assignment
{organization_assignment.role -> organization_role
organization_role.name = 'supplier'}
organization_assignment.assigned_organization -> organization

end_attribute_mapping;

attribute_mapping probability_rate(probability_rate, measure_representation_item);

product_definition_formation <- product_definition.formation 
characterized_product_definition = product_definition
characterized_definition = characterized_product_definition
characterized_definition <- property_definition.definition
property_definition
represented_definition = property_definition
represented_definition <- property_definition_representation.definition
property_definition_representation
property_definition_representation.used_representation -> representation
{representation.name = 'supplier probability'}
representation.items[i] -> representation_item
{representation_item.name = 'probability rate'}
representation_item => measure_representation_item
{measure_representation_item <= measure_with_unit
measure_with_unit => ratio_measure_with_unit}

end_attribute_mapping;

end_entity_mapping;

entity_mapping Technical_solution(Technical_solution, product_definition_formation);

mapping_constraints;
(
product_definition_formation <- product_definition.formation 
product_definition
{product_definition.frame_of_reference -> product_definition_context
product_definition_context <= application_context_element
application_context_element.name = 'alternative definition'}
{product_definition.name = 'technical'}
)(
product_definition_formation <- product_definition.formation 
product_definition
{product_definition.frame_of_reference -> product_definition_context
product_definition_context <= application_context_element
application_context_element.name = 'alternative definition'}
{product_definition.name = 'technical supplier'}
)
end_mapping_constraints;

attribute_mapping description(description, product_definition_formation.description);

end_attribute_mapping;

end_entity_mapping;
end_uof_mapping;

(*end_schema_mapping;*)
