(*
 * $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 scheme(Scheme_arm, Scheme_mim);*)

uof_mapping Scheme(Scheme);

entity_mapping Scheme(Scheme, action_method);

mapping_constraints;
action_method
		{action_method.purpose='scheme'}
	
end_mapping_constraints;

end_entity_mapping;

entity_mapping Scheme_entry(Scheme_entry, action_method);

mapping_constraints;
action_method
		{action_method.purpose='scheme entry'}
	
end_mapping_constraints;

attribute_mapping scheme(scheme, $PATH, Scheme_version);
action_method <-
		   action_method_relationship.related_method
action_method_relationship
{action_method_relationship.description='scheme entry in scheme version'}
action_method_relationship.relating_method ->
action_method
{action_method.purpose='scheme'}
	   
end_attribute_mapping;

end_entity_mapping;

entity_mapping Scheme_relationship(Scheme_relationship, action_method_relationship);

mapping_constraints;

end_mapping_constraints;

attribute_mapping related_scheme(related_scheme, action_method_relationship.related_method, Scheme);
action_method_relationship
		   action_method_relationship.related_method ->
		   action_method
		   {action_method.purpose='scheme'}
	   
end_attribute_mapping;

attribute_mapping relating_scheme(relating_scheme, action_method_relationship.related_method, Scheme);
action_method_relationship
		   action_method_relationship.related_method ->
		   action_method
		   {action_method.purpose='scheme'}
	   
end_attribute_mapping;

end_entity_mapping;

entity_mapping Scheme_entry_relationship(Scheme_entry_relationship, action_method_relationship);

mapping_constraints;

end_mapping_constraints;

attribute_mapping related_entry(related_entry, action_method_relationship.related_method, Scheme_entry);
action_method_relationship
		   action_method_relationship.related_method ->
		   action_method
		   {action_method.purpose='scheme entry'}
	   
end_attribute_mapping;

attribute_mapping relating_entry(relating_entry, action_method_relationship.relating_method, Scheme_entry);
action_method_relationship
	      action_method_relationship.relating_method ->
		   action_method
		   {action_method.purpose='scheme entry'}
      
end_attribute_mapping;

end_entity_mapping;

entity_mapping Scheme_entry_relationship__exclusiveness(Scheme_entry_relationship__exclusiveness, action_method_relationship);

mapping_constraints;
	action_method_relationship
	{action_method_relationship.name = 'exclusiveness'}
end_mapping_constraints;
		
end_entity_mapping;		

entity_mapping Scheme_entry_relationship__precedence(Scheme_entry_relationship__precedence, action_method_relationship);

mapping_constraints;
	action_method_relationship
	{action_method_relationship.name = 'precedence'}
end_mapping_constraints;
		
end_entity_mapping;		

entity_mapping Scheme_entry_relationship__sequence(Scheme_entry_relationship__sequence, action_method_relationship);

mapping_constraints;
	action_method_relationship
	{action_method_relationship.name = 'sequence'}
end_mapping_constraints;
		
end_entity_mapping;		

entity_mapping Scheme_entry_relationship__simultaneity(Scheme_entry_relationship__simultaneity, action_method_relationship);

mapping_constraints;
	action_method_relationship
	{action_method_relationship.name = 'simultaneity'}
end_mapping_constraints;
		
end_entity_mapping;		

entity_mapping Scheme_entry_relationship__other(Scheme_entry_relationship__other, action_method_relationship);

mapping_constraints;
	action_method_relationship
	{action_method_relationship.name = 'other'}
end_mapping_constraints;
		
end_entity_mapping;		

entity_mapping Scheme_entry_relationship__decomposition(Scheme_entry_relationship__decomposition, action_method_relationship);

mapping_constraints;
	action_method_relationship
	{action_method_relationship.name = 'decomposition'}
end_mapping_constraints;
		
end_entity_mapping;		

end_uof_mapping;


entity_mapping Scheme_version(Scheme_version, action_method);

mapping_constraints;
action_method
		{action_method.purpose='scheme version'}
	
end_mapping_constraints;

attribute_mapping of_scheme(of_scheme, $PATH, Scheme);
action_method <-
		   action_method_relationship.related_method
action_method_relationship
{action_method_relationship.description='scheme version of scheme'}
action_method_relationship.relating_method ->
action_method
{action_method.purpose='scheme'}
	   
end_attribute_mapping;

end_entity_mapping;

entity_mapping Scheme_entry_assignment(Scheme_entry_assignment, applied_action_method_assignment);

mapping_constraints;
applied_action_method_assignment <=
		action_method_assignment
		[action_method_assignment.assigned_action_method ->
		action_method
		{action_method.purpose='scheme entry'}]
	
end_mapping_constraints;

attribute_mapping items(items, applied_action_method_assignment.items, scheme_entry_item_select);
applied_action_method_assignment
		   applied_action_method_assignment.items ->
		   action_method_items
	   
end_attribute_mapping;

attribute_mapping assigned_entry(assigned_entry, $PATH, Scheme_entry);
applied_action_method_assignment <=
		action_method_assignment
		action_method_assignment.assigned_action_method ->
		action_method
	
end_attribute_mapping;

end_entity_mapping;

entity_mapping Scheme_version_assignment(Scheme_version_assignment, applied_action_method_assignment);

mapping_constraints;
applied_action_method_assignment <=
		action_method_assignment
		[action_method_assignment.assigned_action_method ->
		action_method
		{action_method.purpose='scheme version'}]
	
end_mapping_constraints;

attribute_mapping items(items, applied_action_method_assignment.items, scheme_version_select);
applied_action_method_assignment
		   applied_action_method_assignment.items ->
		   action_method_items
	   
end_attribute_mapping;

attribute_mapping assigned_scheme_version(assigned_scheme_version, $PATH, Scheme_version);
applied_action_method_assignment <=
		action_method_assignment
		action_method_assignment.assigned_action_method ->
		action_method
	
end_attribute_mapping;

end_entity_mapping;

entity_mapping Scheme_version_relationship(Scheme_version_relationship, action_method_relationship);

mapping_constraints;

end_mapping_constraints;

attribute_mapping related_scheme_version(related_scheme_version, action_method_relationship.related_method, Scheme_version);
action_method_relationship
		   action_method_relationship.related_method ->
		   action_method
		   {action_method.purpose='scheme version'}
	   
end_attribute_mapping;

attribute_mapping relating_scheme_version(relating_scheme_version, action_method_relationship.relating_method, Scheme_version);
action_method_relationship
	      action_method_relationship.relating_method ->
		   action_method
		   {action_method.purpose='scheme version'}
      
end_attribute_mapping;

end_entity_mapping;

entity_mapping Scheme_subject_assignment(Scheme_subject_assignment, applied_action_method_assignment);

mapping_constraints;
applied_action_method_assignment <=
		action_method_assignment
		[action_method_assignment.role ->
		action_method_role
		{action_method_role.name='scheme subject assignment'}]
		[action_method_assignment.assigned_action_method ->
		action_method
		{action_method.purpose='scheme'}]
	
end_mapping_constraints;

attribute_mapping assigned_scheme(assigned_scheme, $PATH, Scheme);
applied_action_method_assignment <=
		   action_method_assignment
		   action_method_assignment.assigned_action_method ->
		   action_method
	   
end_attribute_mapping;

attribute_mapping items(items, applied_action_method_assignment.items, scheme_subject_select);
end_attribute_mapping;

end_entity_mapping;
(* Remove according email from Lothar
entity_mapping Sequencing_relationship(Sequencing_relationship, action_method_relationship);

mapping_constraints;
action_method_relationship 
		       { action_method_relationship.name = 'sequencing relationship'}
	       
end_mapping_constraints;

attribute_mapping time_lag(time_lag, $PATH, Time_interval);
applied_time_interval_assignment <=
		   time_interval_assignment
		   [ time_interval_assignment.role ->
		   time_interval_role
		   { time_interval_role.name = 'sequencing relationship interval' }]
		   [ time_interval_assignment.assigned_time_interval ]
	   
end_attribute_mapping;

attribute_mapping sequencing_type(sequencing_type, action_method_relationship.description);

end_attribute_mapping;

end_entity_mapping;
*)
(* AIM select is taken instead
entity_mapping Date_or_date_time_assignment(Date_or_date_time_assignment, ((date_assignment))((date_and_time_assignment)))
extended;

attribute_mapping items(items, $PATH, Scheme_entry);
 
		applied_date_and_time_assignment.items[i] -> date_and_time_item
		date_and_time_item *> scheme_date_and_time_item
	       	scheme_date_and_time_item = action_method
		
end_attribute_mapping;

end_entity_mapping;

entity_mapping Organization_or_person_in_organization_assignment(Organization_or_person_in_organization_assignment, ( 
			(applied_organization_assignment)
			)( 
			(applied_person_and_organization_assignment)
			))
extended;

attribute_mapping items(items, $PATH, Scheme);
 
		applied_person_and_organization_assignment.items[i] -> person_and_organization_item
		person_and_organization_item *> scheme_person_and_organization_item
		scheme_person_and_organization_item = action_method
		
end_attribute_mapping;

attribute_mapping items(items, $PATH, Scheme_entry);
 
		applied_person_and_organization_assignment.items[i] -> person_and_organization_item
		person_and_organization_item *> scheme_person_and_organization_item
		scheme_person_and_organization_item = action_method
		
end_attribute_mapping;

end_entity_mapping;
*)
(*end_schema_mapping;*)
