Schema: basic_attribute_schema

Source : ISO 10303-41



SCHEMA basic_attribute_schema;

REFERENCE FROM support_resource_schema   -- ISO 10303-41
  (identifier,
   label,
   text);


TYPE description_attribute_select = EXTENSIBLE GENERIC_ENTITY SELECT;
END_TYPE;

TYPE generic_attribute_list_select = EXTENSIBLE GENERIC_ENTITY SELECT;
END_TYPE;

TYPE generic_attribute_select = EXTENSIBLE GENERIC_ENTITY SELECT;
END_TYPE;

TYPE id_attribute_select = EXTENSIBLE GENERIC_ENTITY SELECT;
END_TYPE;

TYPE name_attribute_select = EXTENSIBLE GENERIC_ENTITY SELECT;
END_TYPE;

TYPE role_select = EXTENSIBLE GENERIC_ENTITY SELECT;
END_TYPE;

ENTITY aggregate_id_attribute;
  attribute_value : identifier;
  identified_item : SET[1:?] OF id_attribute_select;
END_ENTITY;

ENTITY description_attribute;
  attribute_value : text;
  described_item : description_attribute_select;
END_ENTITY;

ENTITY generic_attribute;
  attribute_name : label;
  attribute_value : text;
END_ENTITY;

ENTITY generic_attribute_assignment;
  attribute : generic_attribute;
  item_with_attribute : generic_attribute_select;
END_ENTITY;

ENTITY generic_attribute_list_assignment;
  attribute_name : label;
  attributes : LIST[1:?] OF generic_attribute;
  item_with_attribute : generic_attribute_list_select;
END_ENTITY;

ENTITY id_attribute;
  attribute_value : identifier;
  identified_item : id_attribute_select;
END_ENTITY;

ENTITY name_attribute;
  attribute_value : label;
  named_item : name_attribute_select;
END_ENTITY;

ENTITY object_role;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY role_association;
  role : object_role;
  item_with_role : role_select;
END_ENTITY;

FUNCTION get_aggregate_id_value
 (obj : id_attribute_select) : identifier;
LOCAL
      aggregate_id_bag : BAG OF aggregate_id_attribute := (USEDIN(obj, 'BASIC_ATTRIBUTE_SCHEMA.' + 'AGGREGATE_ID_ATTRIBUTE.' + 'IDENTIFIED_ITEM'));
    END_LOCAL;

    IF SIZEOF(aggregate_id_bag) = 1 THEN
      RETURN (aggregate_id_bag[1].attribute_value);
    ELSE
      RETURN (?);
    END_IF;
END_FUNCTION;

FUNCTION get_description_value
 (obj : description_attribute_select) : text;
LOCAL
      description_bag : BAG OF description_attribute := (USEDIN(obj, 'BASIC_ATTRIBUTE_SCHEMA.' + 'DESCRIPTION_ATTRIBUTE.' + 'DESCRIBED_ITEM'));
    END_LOCAL;

    IF SIZEOF(description_bag) = 1 THEN
      RETURN (description_bag[1].attribute_value);
    ELSE
      RETURN (?);
    END_IF;
END_FUNCTION;

FUNCTION get_id_value
 (obj : id_attribute_select) : identifier;
LOCAL
      id_bag : BAG OF id_attribute := (USEDIN(obj, 'BASIC_ATTRIBUTE_SCHEMA.' + 'ID_ATTRIBUTE.' + 'IDENTIFIED_ITEM'));
    END_LOCAL;

    IF SIZEOF(id_bag) = 1 THEN
      RETURN (id_bag[1].attribute_value);
    ELSE
      RETURN (?);
    END_IF;
END_FUNCTION;

FUNCTION get_name_value
 (obj : name_attribute_select) : label;
LOCAL
      name_bag : BAG OF name_attribute := (USEDIN(obj, 'BASIC_ATTRIBUTE_SCHEMA.' + 'NAME_ATTRIBUTE.' + 'NAMED_ITEM'));
    END_LOCAL;

    IF SIZEOF(name_bag) = 1 THEN
      RETURN (name_bag[1].attribute_value);
    ELSE
      RETURN (?);
    END_IF;
END_FUNCTION;

FUNCTION get_role
 (obj : role_select) : object_role;
LOCAL
      role_bag : BAG OF role_association := (USEDIN(obj, 'BASIC_ATTRIBUTE_SCHEMA.' + 'ROLE_ASSOCIATION.' + 'ITEM_WITH_ROLE'));
    END_LOCAL;

    IF SIZEOF(role_bag) = 1 THEN
      RETURN (role_bag[1].role);
    ELSE
      RETURN (?);
    END_IF;
END_FUNCTION;

END_SCHEMA;  -- basic_attribute_schema