(*
 * $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 date_time(Date_time_arm, Date_time_mim);*)

uof_mapping Date_time(Date_time);

entity_mapping Calendar_date(Calendar_date, calendar_date);

mapping_constraints;

			 calendar_date <= date
			 
end_mapping_constraints;

attribute_mapping year_component(year_component, date.year_component);

end_attribute_mapping;

attribute_mapping day_component(day_component, calendar_date.day_component, day_in_month_number);

end_attribute_mapping;

attribute_mapping month_component(month_component, calendar_date.month_component, month_in_year_number);

end_attribute_mapping;

end_entity_mapping;

entity_mapping Date_time(Date_time, date_and_time
			);

attribute_mapping date_component(date_component, $PATH, Calendar_date);

		   date_and_time.date_component -> date => calendar_date
		 
end_attribute_mapping;

attribute_mapping time_component(time_component, $PATH, Local_time);

		   date_and_time.time_component -> local_time
		 
end_attribute_mapping;

end_entity_mapping;

entity_mapping Local_time(Local_time, local_time);

attribute_mapping hour_component(hour_component, local_time.hour_component);

end_attribute_mapping;

attribute_mapping minute_component(minute_component, local_time.minute_component, minute_in_hour);

end_attribute_mapping;

attribute_mapping second_component(second_component, local_time.second_component, second_in_minute);

end_attribute_mapping;

attribute_mapping zone(zone, $PATH, Time_offset);

		   local_time.zone -> coordinated_universal_time_offset
		 
end_attribute_mapping;

end_entity_mapping;

entity_mapping Time_offset(Time_offset, coordinated_universal_time_offset);

attribute_mapping hour_offset(hour_offset, coordinated_universal_time_offset.hour_offset);

end_attribute_mapping;

attribute_mapping minute_offset(minute_offset, coordinated_universal_time_offset.minute_offset);

end_attribute_mapping;

attribute_mapping sense(sense, coordinated_universal_time_offset.sense);

end_attribute_mapping;

end_entity_mapping;
end_uof_mapping;

(*end_schema_mapping;*)
