(*
 * $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 surface_conditions(Surface_conditions_arm, Surface_conditions_mim);*)

uof_mapping Surface_conditions(Surface_conditions);

entity_mapping Contact_ratio(Contact_ratio, contact_ratio_representation);

attribute_mapping ratio_value(ratio_value, $PATH, measure_representation_item);

	 contact_ratio_representation <=
representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'ratio value'}
(measure_representation_item)
(compound_representation_item =>
value_range)

end_attribute_mapping;

attribute_mapping measuring_gauge(measuring_gauge, $PATH, Part_view_definition);

	 contact_ratio_representation <=
representation <-
property_definition_representation.used_representation
property_definition_representation
{property_definition_representation.name = 'contact ratio reference'}
property_definition_representation.definition -> represented_definition
represented_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.frame_of_reference ->
product_definition_context
product_definition_context <= application_context_element
application_context_element.name = 'part definition'}

end_attribute_mapping;

end_entity_mapping;

entity_mapping Hardness(Hardness, hardness_representation);

attribute_mapping measuring_method(measuring_method, descriptive_representation_item.description);

hardness_representation <=
representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'measuring method'}
descriptive_representation_item
descriptive_representation_item.description
{(descriptive_representation_item.description)
(descriptive_representation_item.description = 'brinell')
(descriptive_representation_item.description = 'rockwell')
(descriptive_representation_item.description = 'vickers')}

end_attribute_mapping;

attribute_mapping environment_condition(environment_condition, data_environment);

hardness_representation <=
representation <-
property_definition_representation.used_representation
property_definition_representation =>
material_property_representation
material_property_representation.dependent_environment ->
data_environment

end_attribute_mapping;

attribute_mapping description(description, representation.description);

hardness_representation <=
representation
representation.description

end_attribute_mapping;

attribute_mapping measuring_position(measuring_position, descriptive_representation_item.description);

hardness_representation <=
representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'measuring position'}
descriptive_representation_item
descriptive_representation_item.description

end_attribute_mapping;

attribute_mapping hardness_value(hardness_value, $PATH, measure_representation_item);

	 hardness_representation <=
representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'hardness'}
(measure_representation_item)
(compound_representation_item =>
value_range)

end_attribute_mapping;

attribute_mapping depth(depth, $PATH, measure_representation_item);

	 hardness_representation <=
representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'depth'}
(measure_representation_item)
(compound_representation_item =>
value_range)

end_attribute_mapping;

end_entity_mapping;

entity_mapping Surface_condition(Surface_condition, representation);

mapping_constraints;

representation <-
property_definition_representation.used_representation
property_definition_representation
property_definition_representation.definition ->
represented_definition
represented_definition = property_definition
property_definition
{(property_definition.name = 'contact ratio')
(property_definition.name = 'treatment result')
(property_definition.name = 'visual appearance')
(property_definition.name = 'tactile appearance')
(property_definition.name = 'surface texture')
(property_definition.name = 'hardness')} 
derived_property_select = property_definition
derived_property_select <-
general_property_association.derived_definition
general_property_association
general_property_association.base_definition ->
general_property
{general_property.name = 'surface condition'}

end_mapping_constraints;

attribute_mapping value_determination(value_determination, type_qualifier.name);

representation
representation.items[i] ->
representation_item =>
qualified_representation_item
qualified_representation_item.qualifiers[i] ->
value_qualifier
value_qualifier = type_qualifier
type_qualifier
type_qualifier.name
{(type_qualifier.name)
(type_qualifier.name = 'required')
(type_qualifier.name = 'designed')
(type_qualifier.name = 'calculated')
(type_qualifier.name = 'measured')
(type_qualifier.name = 'estimated')} 

end_attribute_mapping;

end_entity_mapping;

entity_mapping Surface_condition_association(Surface_condition_association, property_definition_representation);

attribute_mapping describing_surface_condition(describing_surface_condition, $PATH, Surface_condition);

property_definition_representation.used_representation -> representation

end_attribute_mapping;

attribute_mapping described_element(described_element, $PATH, Item_shape);

property_definition_representation
property_definition_representation.definition ->
represented_definition
represented_definition = property_definition
property_definition.definition ->
characterized_definition
characterized_definition = shape_definition
shape_definition
shape_definition = product_definition_shape
product_definition_shape

end_attribute_mapping;

attribute_mapping described_element(described_element, $PATH, Shape_element);

property_definition_representation
property_definition_representation.definition ->
represented_definition
represented_definition = property_definition
property_definition.definition ->
characterized_definition
characterized_definition = shape_definition
shape_definition
shape_definition = shape_aspect
shape_aspect

end_attribute_mapping;

end_entity_mapping;

entity_mapping Surface_texture(Surface_texture, surface_texture_representation);

attribute_mapping measuring_method(measuring_method, descriptive_representation_item.description);

surface_texture_representation <=
representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'measuring method'}
descriptive_representation_item
descriptive_representation_item.description
{(descriptive_representation_item.description)
(descriptive_representation_item.description = 'ISO 4287')
(descriptive_representation_item.description = 'ISO 12085')
(descriptive_representation_item.description = 'ISO 13565')}

end_attribute_mapping;

attribute_mapping measuring_direction(measuring_direction, $PATH, Measurement_path);

surface_texture_representation <=
representation <- representation_relationship.rep_1
representation_relationship
representation_relationship.rep_2 -> representation
{representation.name = 'measuring direction'}

end_attribute_mapping;

end_entity_mapping;

entity_mapping Surface_texture_parameter__measure_representation_item(Surface_texture_parameter__measure_representation_item, measure_representation_item);

mapping_constraints;

measure_representation_item <=
representation_item

end_mapping_constraints;
(* SEDS written against this attribute mapping
attribute_mapping parameter_index(parameter_index, representation_item.name
);

end_attribute_mapping;
*)
attribute_mapping parameter_name(parameter_name, representation_item.name
);

end_attribute_mapping;

attribute_mapping parameter_value(parameter_value, $IDENTICAL_MAPPING, measure_representation_item);

end_attribute_mapping;

attribute_mapping described_texture(described_texture, $PATH, Surface_texture);

	 representation_item <- representation.items[i]
representation =>
surface_texture_representation
	 
end_attribute_mapping;

end_entity_mapping;

entity_mapping Surface_texture_parameter__value_range(Surface_texture_parameter__value_range, value_range);

mapping_constraints;

value_range <= 
compound_representation_item <=
representation_item

end_mapping_constraints;
(* SEDS written against this attribute mapping
attribute_mapping parameter_index(parameter_index, representation_item.name
);

end_attribute_mapping;
*)
attribute_mapping parameter_name(parameter_name, representation_item.name
);

end_attribute_mapping;

attribute_mapping parameter_value(parameter_value, $IDENTICAL_MAPPING, measure_representation_item);

end_attribute_mapping;

attribute_mapping described_texture(described_texture, $PATH, Surface_texture);

	 representation_item <- representation.items[i]
representation =>
surface_texture_representation
	 
end_attribute_mapping;

end_entity_mapping;

entity_mapping Tactile_appearance(Tactile_appearance, tactile_appearance_representation
);

attribute_mapping id(id, id_attribute.attribute_value);

tactile_appearance_representation <=
representation = id_attribute_select
id_attribute_select <- id_attribute.identified_item
id_attribute.attribute_value

end_attribute_mapping;

attribute_mapping name(name, representation.name);
tactile_appearance_representation <= representation
representation.name

end_attribute_mapping;

attribute_mapping description(description, representation.description);
tactile_appearance_representation <= representation
representation.description

end_attribute_mapping;

attribute_mapping depth(depth, $PATH, measure_representation_item);

	 tactile_appearance_representation <=
representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'depth'}
(measure_representation_item)
(compound_representation_item =>
value_range)

end_attribute_mapping;

end_entity_mapping;

entity_mapping Treatment_result(Treatment_result, representation
);

attribute_mapping id(id, id_attribute.attribute_value);

representation = id_attribute_select
id_attribute_select <- id_attribute.identified_item
id_attribute.attribute_value

end_attribute_mapping;

attribute_mapping name(name, representation.description);

end_attribute_mapping;

attribute_mapping description_x(description_x, descriptive_representation_item.description);

representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'result'}
descriptive_representation_item
descriptive_representation_item.description

end_attribute_mapping;

attribute_mapping purpose(purpose, descriptive_representation_item.description);

representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'purpose'}
descriptive_representation_item
descriptive_representation_item.description

end_attribute_mapping;

end_entity_mapping;

entity_mapping Visual_appearance(Visual_appearance, visual_appearance_representation);

attribute_mapping colour_id(colour_id, descriptive_representation_item.description
);

visual_appearance_representation <=
representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'colour id'}
descriptive_representation_item
descriptive_representation_item.description

end_attribute_mapping;

attribute_mapping lustre(lustre, descriptive_representation_item.description
);

visual_appearance_representation <=
representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'lustre'}
descriptive_representation_item
descriptive_representation_item.description

end_attribute_mapping;

attribute_mapping transparency(transparency, descriptive_representation_item.description
);

visual_appearance_representation <=
representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'transparency'}
descriptive_representation_item
descriptive_representation_item.description

end_attribute_mapping;

attribute_mapping id(id, id_attribute.attribute_value);

visual_appearance_representation <=
representation = id_attribute_select
id_attribute_select <- id_attribute.identified_item
id_attribute.attribute_value

end_attribute_mapping;

attribute_mapping name(name, representation.name);
visual_appearance_representation <=
representation
representation.name

end_attribute_mapping;

attribute_mapping pattern(pattern, descriptive_representation_item.description
);

visual_appearance_representation <=
representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'pattern'}
descriptive_representation_item
descriptive_representation_item.description

end_attribute_mapping;

attribute_mapping colour_name(colour_name, descriptive_representation_item.description
);

visual_appearance_representation <=
representation
representation.items[i] ->
representation_item =>
{representation_item.name = 'colour name'}
descriptive_representation_item
descriptive_representation_item.description

end_attribute_mapping;

end_entity_mapping;
end_uof_mapping;


entity_mapping Coating_layer(Coating_layer, shape_aspect);

mapping_constraints;

{shape_aspect.name = 'coating layer'}

end_mapping_constraints;

end_entity_mapping;
(*end_schema_mapping;*)
