(*
   $Id$
   ISO TC184/SC4/WG12 N4715 - ISO/CD-TS 10303-1654 Characteristic - EXPRESS MIM
   Supersedes ISO TC184/SC4/WG12 N3910
*)
SCHEMA Characteristic_mim;
    USE FROM Basic_data_representation_mim;  -- ISO/CD-TS 10303-1773
	USE FROM Document_assignment_mim;	-- ISO/TS 10303-1122
	USE FROM Extended_measure_representation_mim;	-- ISO/TS 10303-1106
	USE FROM External_library_mim; -- ISO/CD-TS 10303-1778
	USE FROM Value_with_unit_extension_mim;	-- ISO/TS 10303-1753

USE FROM group_schema(group);

  TYPE c_document_reference_item = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON document_reference_item WITH 
     (representation);
  END_TYPE;

  ENTITY characteristic_data_table_header
    SUBTYPE OF (general_property);
  END_ENTITY;

  ENTITY characteristic_data_table_header_link
    SUBTYPE OF (general_property, general_property_relationship);
  END_ENTITY;    

  ENTITY characteristic_type
    SUBTYPE OF (group);
  END_ENTITY;

  ENTITY range_characteristic
    SUBTYPE OF (representation, descriptive_representation_item);
    WHERE
      WR1: NOT(SELF\representation.name IN ['tolerance', 'minimum tolerance', 'maximum tolerance', 
        'nominal tolerance', 'plus minus tolerance', 'symmetrical tolerance', 'statistical tolerance']);
  END_ENTITY;

  ENTITY row_representation_item
    SUBTYPE OF(compound_representation_item);
      SELF\compound_representation_item.item_element : list_representation_item;
  END_ENTITY;

  ENTITY table_representation_item
    SUBTYPE OF (compound_representation_item);
    WHERE
      WR1: SIZEOF(QUERY(itet <* SELF\compound_representation_item.item_element |
        NOT('CHARACTERISTIC_MIM.ROW_REPRESENTATION_ITEM' IN TYPEOF(itet))
            )) = 0;
  END_ENTITY; 

  SUBTYPE_CONSTRAINT c_compound_representation_item_subtypes FOR compound_representation_item; 
	(ONEOF (row_representation_item,
	  table_representation_item));
  END_SUBTYPE_CONSTRAINT;

END_SCHEMA;

