(*
 * $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 generic_material_aspects(Generic_material_aspects_arm, Generic_material_aspects_mim);*)

entity_mapping Applied_independent_material_property(Applied_independent_material_property, material_property);

mapping_constraints;
material_property <=
property_definition = derived_property_select
			derived_property_select <- general_property_association.derived_definition
end_mapping_constraints;

attribute_mapping base_independent_property(base_independent_property, $PATH, general_material_property);
property_definition
property_definition = derived_property_select
derived_property_select <- 
general_property_association.derived_definition
general_property_association.base_definition -> general_property
general_property => general_material_property
end_attribute_mapping;

end_entity_mapping;


entity_mapping Material_property_armx(Material_property_armx, material_property);

mapping_constraints;
material_property <=
property_definition
end_mapping_constraints;

end_entity_mapping;


entity_mapping data_environment_armx(data_environment_armx, data_environment);

attribute_mapping environment_name(environment_name, data_environment.name);

end_attribute_mapping;

attribute_mapping description(description, data_environment.description);

end_attribute_mapping;

attribute_mapping environment_characterization(environment_characterization, $PATH, Independent_property_representation);

	 data_environment.elements -> property_definition_representation
	 {property_definition_representation.definition -> represented_definition 
represented_definition = general_property}

end_attribute_mapping;

attribute_mapping environment_characterization(environment_characterization, $PATH, Material_property_value_representation);

	 data_environment.elements -> property_definition_representation
	 property_definition_representation =>
	 material_property_representation

end_attribute_mapping;

end_entity_mapping;
(* Material_designation is used from AIM instead
entity_mapping Material_identification(Material_identification, material_designation);

attribute_mapping material_name(material_name, material_designation.name);

end_attribute_mapping;

attribute_mapping items(items, $PATH, material_item_select);

					material_designation.definitions[i] -> characterized_definition
				
end_attribute_mapping;

end_entity_mapping;
*)
entity_mapping Material_property_association(Material_property_association, material_designation_characterization);

attribute_mapping described_material(described_material, $PATH, material_designation);
material_designation_characterization.designation -> material_designation
end_attribute_mapping;

attribute_mapping associated_property_value(associated_property_value, $PATH, Material_property_value_representation);
material_designation_characterization.property -> characterized_material_property
characterized_material_property = material_property_representation
{material_property_representation <= property_definition_representation
property_definition_representation.used_representation -> representation}

end_attribute_mapping;

attribute_mapping definitional(definitional, material_designation_characterization.name);
material_designation_characterization.name
{(material_designation_characterization.name = 'non definitional')
(material_designation_characterization.name = 'definitional')
(* For our mapping compiler it is better to simply skip it *)
(* (material_designation_characterization.name = '') *)
}
end_attribute_mapping;

end_entity_mapping;

entity_mapping Material_property_value_representation(Material_property_value_representation, material_property_representation);

(* Add this mapping, because we don't want to have mapping for property_definition_representation (too many wrong hits) *)
attribute_mapping used_representation(used_representation, $PATH, representation);
material_property_representation <=
property_definition_representation
property_definition_representation.used_representation -> representation

end_attribute_mapping;


attribute_mapping environment_condition(environment_condition, $PATH, Data_environment_armx);
material_property_representation
material_property_representation.dependent_environment -> data_environment

end_attribute_mapping;

attribute_mapping property(property, ($PATH)($PATH), Material_property_armx);
material_property_representation <=
property_definition_representation
property_definition_representation.definition -> represented_definition
represented_definition = property_definition
property_definition
property_definition => material_property
end_attribute_mapping;

attribute_mapping property(property, ($PATH)($PATH), general_material_property);
material_property_representation <=
property_definition_representation
property_definition_representation.definition -> represented_definition
represented_definition = general_property
general_property => general_material_property

end_attribute_mapping;

end_entity_mapping;
(* general_material_property is used instead
entity_mapping Pdm_material_property(Pdm_material_property, general_material_property);

end_entity_mapping;
*)
(*end_schema_mapping;*)
