(*
 * $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 property_assignment(Property_assignment_arm, Property_assignment_mim);*)

uof_mapping Property_assignment(Property_assignment);

(* GL change - add explicitly requirement that this mapping is satisfied only if specific subtype mapping is satisfied *)
entity_mapping Assigned_property(Assigned_property, 
(/SUBTYPE(Applied_independent_property)/)
(* (/SUBTYPE(Assigned_document_property)/) *) (* Alternative not supported for now *)
(/SUBTYPE(Operational_requirement_occurrence_relationship_armx)/)
);

attribute_mapping name(name, property_definition.name);
end_attribute_mapping;

(* XIM specific add-on *)
attribute_mapping representation(representation, $PATH, measure_with_unit);
property_definition
represented_definition = property_definition
represented_definition <-
property_definition_representation.definition
property_definition_representation 
property_definition_representation
property_definition_representation.used_representation ->
representation
(* GL eliminate some questionable options *)
!{representation =>
range_characteristic}
representation.items[i] ->
representation_item
representation_item =>
measure_representation_item <=
measure_with_unit

end_attribute_mapping;


attribute_mapping representation(representation, $PATH);
property_definition
represented_definition = property_definition
represented_definition <-
property_definition_representation.definition
property_definition_representation 
property_definition_representation
property_definition_representation.used_representation ->
representation
representation.items[i] ->
representation_item
{representation_item =>
descriptive_representation_item}
representation_item.name

end_attribute_mapping;


attribute_mapping description(description, property_definition.description);
end_attribute_mapping;

attribute_mapping described_element(described_element, $PATH, property_assignment_select);
property_definition
property_definition.definition ->
characterized_definition
end_attribute_mapping;

attribute_mapping id_x(id_x, id_attribute.attribute_value);

			property_definition = id_attribute_select
			id_attribute_select <- id_attribute.identified_item
			id_attribute.attribute_value
			
end_attribute_mapping;

end_entity_mapping;

entity_mapping Applied_independent_property(Applied_independent_property, property_definition);

mapping_constraints;
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_property);
property_definition
property_definition = derived_property_select
derived_property_select <- 
general_property_association.derived_definition
(* GL added in order to distinguish it from classification_attribute *)
{general_property_association.name != 'attribute definition'}
general_property_association.base_definition -> general_property

end_attribute_mapping;

end_entity_mapping;
(* Removed
entity_mapping Property_representation(Property_representation, property_definition_representation);

attribute_mapping property(property, $PATH, Assigned_property);
property_definition_representation 
				 property_definition_representation.definition -> represented_definition
represented_definition = property_definition

end_attribute_mapping;

end_entity_mapping;
*)
end_uof_mapping;

(*end_schema_mapping;*)
