(*
   $Id$
   ISO TC184/SC4/WG12 N4173 - ISO/TS 10303-1742 Shape composition - EXPRESS ARM
   Supersedes ISO TC184/SC4/WG12 N3597
*)

SCHEMA Shape_composition_arm; 

  	USE FROM Shape_property_assignment_arm;	-- ISO/TS 10303-1032

  ENTITY Composite_group_shape_element
    SUBTYPE OF (Composite_shape_element);
  END_ENTITY;

  ENTITY Composite_shape_element
    ABSTRACT SUPERTYPE OF (ONEOF (Composite_group_shape_element,
 Composite_unit_shape_element))
    SUBTYPE OF (Shape_element);
    INVERSE
      composing_relationships : SET[2:?] OF shape_element_composing_relationship FOR relating;
  END_ENTITY;

  ENTITY Composite_unit_shape_element
    SUBTYPE OF (Composite_shape_element);
  END_ENTITY;

  ENTITY Shape_element_boundary_relationship
    SUBTYPE OF (Shape_element_relationship);
    WHERE
      WR1 : NOT EXISTS (SELF\Shape_element_relationship.relation_type);
  END_ENTITY;

  ENTITY Shape_element_composing_relationship
    SUBTYPE OF (Shape_element_constituent_relationship);
      SELF\Shape_element_relationship.relating : Composite_shape_element;
  END_ENTITY;

  ENTITY Shape_element_constituent_relationship
    SUPERTYPE OF (Shape_element_composing_relationship)
    SUBTYPE OF (Shape_element_relationship);
    UNIQUE
      UR1 : related, relating;
    WHERE
      WR1 : SELF\Shape_element_relationship.related <> SELF\Shape_element_relationship.relating;
      WR2 : NOT EXISTS (SELF\Shape_element_relationship.relation_type);
  END_ENTITY;

  ENTITY Shape_element_locating_relationship
		SUBTYPE OF (Shape_element_constituent_relationship);
      SELF\Shape_element_relationship.relating RENAMED locating_shape_element	: Shape_element;
      SELF\Shape_element_relationship.related RENAMED located_shape_element		: Shape_element;
    UNIQUE
      UR1 : located_shape_element, locating_shape_element;
  END_ENTITY;

END_SCHEMA;
