Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Syntax 

EXPRESS_EXTENSION_SCHEMA   ExtensionSchemaName FOR IFC2X3;

    ENTITY_EXTENSION extToIfcxx1 FOR  ifcxx1;
       (* Attribute name must be unique within the extended entity (ifcxx1), may be same as
          attribute names in super type Entity. When so, this extended attribute must be
          accessed by name using "full qualified attribute name".
          The attribute domains can be any domain in the actual schema or domain (instance type)
          defined in the current extension schema
       *)
       extendedExplicitAttr1 : STRING;           -- any simple data type can be used, not defined types
       extendedExplicitAttr2 : GENERIC_ENTITY;   --sdaiINSTANCE of any type. can be used as link to instance in any other model.
       extendedExplicitAttr3 : SET OF GENERIC_ENTITY;
    INVERSE
       ALL_CROSS_MODEL_REFERENCES_TO_ME : SET OF GENERIC_ENTITY;  -- reserved name, keeps all references from other models
       extendedInverseAttr : SET OF GENERIC_ENTITY FOR (entityx.explicitAttr1, entityx.explicitAttr2, ...entityz.explicitAttr5);
    END_ENTITY_EXTENSION;

    ENTITY_EXTENSION extToifcxx2 FOR SUBTYPES ifcxx2;
       (* same as ENTITY_EXTENSION except that all extensions will be valid for all subtypes of the extended entity, i.e., all subtypes of ifcxx2 *)
       extendedExplicitAttr1 : STRING;           -- any simple data type can be used, not defined types
       extendedExplicitAttr2 : GENERIC_ENTITY;   --sdaiINSTANCE of any type. can be used as link to instance in any other model.
       extendedExplicitAttr3 : SET OF GENERIC_ENTITY;
    INVERSE
       ALL_CROSS_MODEL_REFERENCES_TO_ME : SET OF GENERIC_ENTITY;  -- reserved name, keeps all references from other models
       extendedInverseAttr : SET OF GENERIC_ENTITY FOR (entityx.explicitAttr1, entityx.explicitAttr2, ...entityz.explicitAttr5);
    END_ENTITY_EXTENSION;
     
    ENTITY_EXTENSION  name; -- no FOR clause means it is a "new" entity
        explicitAttr1 : INTEGER;
        explicitAttr2 : GENERIC_ENTITY;
        -- ........
     INVERSE
        -- .......
        ALL_CROSS_MODEL_REFERENCES_TO_ME : SET OF GENERIC_ENTITY;  -- reserved name, keeps all references from other models
    END_ENTITY_EXTENSION;

    ENTITY_EXTENSION name SUBTYPE OF (FOR entity1, entity2, ... entityN);  -- subtype of any entity in main schema (FOR xxx) or "extended entity" in schema
        explicitAttr1 : INTEGER;
        explicitAttr2 : GENERIC_ENTITY;
        -- ........
     INVERSE
        -- .......
        ALL_CROSS_MODEL_REFERENCES_TO_ME : SET OF GENERIC_ENTITY;  -- reserved name, keeps all references from other models
    END_ENTITY_EXTENSION;
	

END_EXPRESS_EXTENSION_SCHEMA;

 

Historical:

 History
ExtensionSchema 0.1
EXPRESS_EXTENSION_SCHEMA   ExtensionSchemaName FOR IFC2X3;

    EXTEND_ENTITY   ifcxx1;
       (* Attribute name must be unique within the extended entity (ifcxx1), may be same as
          attribute names in super type Entity. When so, this extended attribute must be
          accessed by name using "full qualified attribute name".
          The attribute domains can be any domain in the actual schema or domain (instance type)
          defined in the current extension schema
       *)
       extendedExplicitAttr1 : STRING;           -- any simple data type can be used, not defined types
       extendedExplicitAttr2 : GENERIC_ENTITY;   --sdaiINSTANCE of any type. can be used as link to instance in any other model.
       extendedExplicitAttr3 : SET OF GENERIC_ENTITY;
    INVERSE
       ALL_CROSS_MODEL_REFERENCES_TO_ME : SET OF GENERIC_ENTITY;  -- reserved name, keeps all references from other models
       extendedInverseAttr : SET OF GENERIC_ENTITY FOR (entityx.explicitAttr1, entityx.explicitAttr2, ...entityz.explicitAttr5);
    END_EXTEND_ENTITY;

    EXTEND_ENTITY_AND_SUBTYPES   ifcxx2;
       (* same as EXTEND_ENTITY except that all extensions will be valid for all subtypes of the extended entity, i.e., all subtypes of ifcxx2 *)
       extendedExplicitAttr1 : STRING;           -- any simple data type can be used, not defined types
       extendedExplicitAttr2 : GENERIC_ENTITY;   --sdaiINSTANCE of any type. can be used as link to instance in any other model.
       extendedExplicitAttr3 : SET OF GENERIC_ENTITY;
    INVERSE
       ALL_CROSS_MODEL_REFERENCES_TO_ME : SET OF GENERIC_ENTITY;  -- reserved name, keeps all references from other models
       extendedInverseAttr : SET OF GENERIC_ENTITY FOR (entityx.explicitAttr1, entityx.explicitAttr2, ...entityz.explicitAttr5);
    END_EXTEND_ENTITY;
     
    NEW_EXTENSION_ENTITY name;
        explicitAttr1 : INTEGER;
        explicitAttr2 : GENERIC_ENTITY;
        ........
     INVERSE
        .......
        ALL_CROSS_MODEL_REFERENCES_TO_ME : SET OF GENERIC_ENTITY;  -- reserved name, keeps all references from other models
    END_NEW_EXSENSION_ENTITY;

     NEW_NEW_EXTENSION_ENTITY name SUBTYPE OF (entity1, entity2, ... entityN);  -- subtype of any entity or "extended entity" in schema
        explicitAttr1 : INTEGER;
        explicitAttr2 : GENERIC_ENTITY;
        ........
     INVERSE
        .......
        ALL_CROSS_MODEL_REFERENCES_TO_ME : SET OF GENERIC_ENTITY;  -- reserved name, keeps all references from other models
    END_NEW_EXTENSION_ENTITY;

END_EXPRESS_EXTENSION_SCHEMA;


Arnes adjusted proposal out of Hans Karsten initial spec:

  • Declarations should be like nouns not verbs
  • Avoid new keywords, there are too many already. Try reusing existing
  • Use "FOR" to explicit scope to EXPRESS scema
  • Entity extensions always have own name 
  • Use leading underscore for "EDM extension" ALL_CROSS_.....

 

 

ExtensionSchema 0.2
EXTENSION_SCHEMA   ExtensionSchemaName FOR IFC2X3;

    ENTITY_EXTENSION extToifcxx1 FOR ifcxx1 ;
       (* Attribute name must be unique within the extended entity (ifcxx1), may be same as
          attribute names in super type Entity. When so, this extended attribute must be
          accessed by name using "full qualified attribute name".
          The attribute domains can be any domain in the actual schema or domain (instance type)
          defined in the current extension schema
       *)
       extendedExplicitAttr1 : STRING;           -- any simple data type can be used, not defined types
       extendedExplicitAttr2 : GENERIC_ENTITY;   --sdaiINSTANCE of any type. can be used as link to instance in any other model.
       extendedExplicitAttr3 : SET OF GENERIC_ENTITY;
    INVERSE
       _ALL_CROSS_MODEL_REFERENCES_TO_ME : SET OF GENERIC_ENTITY;  -- reserved name, keeps all references from other models
       extendedInverseAttr : SET OF GENERIC_ENTITY FOR (entityx.explicitAttr1, entityx.explicitAttr2, ...entityz.explicitAttr5);
    END_ENTITY_EXTENSION;

    ENTITY_EXTENSION extToifcxx2 FOR SUBTYPE(S) ifcxx2;
       (* supplying SUBTYPES enables all extensions will be valid for all subtypes of the extended entity, i.e., all subtypes of ifcxx2 *)
       extendedExplicitAttr1 : STRING;           -- any simple data type can be used, not defined types
       extendedExplicitAttr2 : GENERIC_ENTITY;   --sdaiINSTANCE of any type. can be used as link to instance in any other model.
       extendedExplicitAttr3 : SET OF GENERIC_ENTITY;
    INVERSE
       _ALL_CROSS_MODEL_REFERENCES_TO_ME : SET OF GENERIC_ENTITY;  -- reserved name, keeps all references from other models
       extendedInverseAttr : SET OF GENERIC_ENTITY FOR (entityx.explicitAttr1, entityx.explicitAttr2, ...entityz.explicitAttr5);
    END_ENTITY_EXTENSION;
     
     ENTITY_EXTENSION name; -- lacking FOR part means a new entity
        explicitAttr1 : INTEGER;
        explicitAttr2 : GENERIC_ENTITY;
        ........
     INVERSE
        .......
        _ALL_CROSS_MODEL_REFERENCES_TO_ME : SET OF GENERIC_ENTITY;  -- reserved name, keeps all references from other models
    END_ENTITY_EXTENSION;


     ENTITY_EXTENSION name SUBTYPE OF (FOR entity1, extendedentity2, ... entityN);  -- subtype of any entity (FOR x) or "extended entity" in schema
        explicitAttr1 : INTEGER;
        explicitAttr2 : GENERIC_ENTITY;
        ........
     INVERSE
        .......
        _ALL_CROSS_MODEL_REFERENCES_TO_ME : SET OF GENERIC_ENTITY;  -- reserved name, keeps all references from other models
    END_ENTITY_EXTENSION;

END_EXTENSION_SCHEMA;


I think this approach also allows for using only "ENTITY" in stead of "ENTITY_EXTENSION", but that is maybe going too far? Or maybe not, ref RULE_SCHEMA.

 

 

 

  • No labels