(*
 * $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 specification_document(Specification_document_arm, Specification_document_mim);*)


entity_mapping Design_specification(Design_specification, specification_definition);

mapping_constraints;
specification_definition <=
product_definition
{product_definition.name = 'design specification'}

end_mapping_constraints;

end_entity_mapping;

entity_mapping Fabrication_technology_specification(Fabrication_technology_specification, specification_definition);

mapping_constraints;
specification_definition <=
product_definition
{product_definition.name = 'fabrication technology specification'}

end_mapping_constraints;

end_entity_mapping;

entity_mapping Interface_specification_document_definition(Interface_specification_document_definition, specification_definition);

mapping_constraints;
specification_definition <=
product_definition
{product_definition.name = 'interface specification'}

end_mapping_constraints;

end_entity_mapping;

entity_mapping Language_reference_manual(Language_reference_manual, specification_definition);

mapping_constraints;
specification_definition <=
product_definition
{product_definition.name = 'language reference manual'}

end_mapping_constraints;

end_entity_mapping;

entity_mapping Material_specification(Material_specification, specification_definition);

mapping_constraints;
specification_definition <=
product_definition
{product_definition.name = 'material specification'}

end_mapping_constraints;

end_entity_mapping;

entity_mapping Partial_document_with_structured_text_representation_assignment_armx(Partial_document_with_structured_text_representation_assignment_armx, partial_document_with_structured_text_representation_assignment);

mapping_constraints;
partial_document_with_structured_text_representation_assignment <=
[applied_document_usage_constraint_assignment <=
document_usage_constraint_assignment]
[characterized_object]
     
end_mapping_constraints;

attribute_mapping structured_portion(structured_portion, $PATH, string_representation_item_select);
partial_document_with_structured_text_representation_assignment <=
characterized_object
characterized_definition = characterized_object
characterized_definition <-
property_definition.definition
property_definition
represented_definition = property_definition
represented_definition <-
item_identified_representation_usage.definition
item_identified_representation_usage
item_identified_representation_usage.identified_item ->
representation_item
end_attribute_mapping;

attribute_mapping structured_portion(structured_portion, $PATH, descriptive_representation_item);
partial_document_with_structured_text_representation_assignment <=
characterized_object
characterized_definition = characterized_object
characterized_definition <-
property_definition.definition
property_definition
represented_definition = property_definition
represented_definition <-
item_identified_representation_usage.definition
item_identified_representation_usage
item_identified_representation_usage.identified_item ->
representation_item
representation_item =>
descriptive_representation_item
end_attribute_mapping;

attribute_mapping structured_portion(structured_portion, $PATH, Included_text_block_armx);
partial_document_with_structured_text_representation_assignment <=
characterized_object
characterized_definition = characterized_object
characterized_definition <-
property_definition.definition
property_definition
represented_definition = property_definition
represented_definition <-
item_identified_representation_usage.definition
item_identified_representation_usage
item_identified_representation_usage.identified_item ->
representation_item
representation_item =>
mapped_item =>
included_text_block
end_attribute_mapping;

end_entity_mapping;

entity_mapping Process_specification(Process_specification, specification_definition);

mapping_constraints;
specification_definition <=
product_definition
{product_definition.name = 'process specification'}

end_mapping_constraints;

end_entity_mapping;

entity_mapping Document_assignment(Document_assignment, applied_document_reference)
extended;

attribute_mapping is_assigned_to(is_assigned_to, , Product);
						document_reference_item *> sd_document_reference_item
						sd_document_reference_item = product
end_attribute_mapping;

attribute_mapping is_assigned_to(is_assigned_to, , configuration_item);
						document_reference_item *> sd_document_reference_item
						sd_document_reference_item = configuration_item
end_attribute_mapping;
(* Redundant - already available in another module
attribute_mapping is_assigned_to(is_assigned_to, , Product_view_definition);
						document_reference_item *> sd_document_reference_item
						sd_document_reference_item = product_definition
end_attribute_mapping;
*)
attribute_mapping is_assigned_to(is_assigned_to, , product_definition_formation);
						document_reference_item *> sd_document_reference_item
						sd_document_reference_item = product_definition_formation
end_attribute_mapping;

end_entity_mapping;


entity_mapping Specification_allocation(Specification_allocation, applied_document_reference);

mapping_constraints;
applied_document_reference <=
document_reference

end_mapping_constraints;
(*
attribute_mapping identifier_in_target_context(identifier_in_target_context, $PATH);
applied_document_reference <=
document_reference
{[document_reference.source = 'predefined purpose']
[document_reference.role ->
object_role
object_role.name = 'identifier in target context']}
document_reference.role ->
object_role
object_role.description

end_attribute_mapping;

attribute_mapping purpose(purpose, $PATH);
applied_document_reference <=
document_reference
document_reference.role ->
object_role
{object_role.name = 'purpose'}
object_role.description
end_attribute_mapping;

attribute_mapping target_product_object(target_product_object, $PATH, specification_product_object_select);
applied_document_reference
applied_document_reference.items[i] ->
document_reference_item

end_attribute_mapping;
*)
attribute_mapping allocated_specification(allocated_specification, $PATH, Specification_definition_armx);
applied_document_reference <=
document_reference
document_reference.assigned_document ->
document <-
{document.kind -> document_type
document_type.product_data_type = 'configuration controlled document definition'}
document_product_association.relating_document
document_product_association
{document_product_association => document_product_equivalence}
document_product_association.related_product ->
product_or_formation_or_definition
product_or_formation_or_definition = product_definition
product_definition =>
specification_definition
end_attribute_mapping;

end_entity_mapping;

entity_mapping Specification_definition_armx(Specification_definition_armx, specification_definition);

mapping_constraints;
specification_definition <=
product_definition

end_mapping_constraints;

end_entity_mapping;

entity_mapping Surface_finish_specification(Surface_finish_specification, specification_definition);

mapping_constraints;
specification_definition <=
product_definition
{product_definition.name = 'surface finish specification'}

end_mapping_constraints;

end_entity_mapping;

entity_mapping Test_specification(Test_specification, specification_definition);

mapping_constraints;
specification_definition <=
product_definition
{product_definition.name = 'test specification'}

end_mapping_constraints;

end_entity_mapping;
(*end_schema_mapping;*)
