Перейти к основному содержанию

Structure of the element metadata bucket

Около 3 мин

Structure of the element metadata bucket

The bucket is stored as a byte array, packed by the LZMA algorithm.

After receiving and unpacking it contains text data in JSON markup.

The data is an array of objects with properties.

[
  {}, // Element 0
  {}, // Element 1
  ... // Element N
]

JSON schema of the metadata of a single element and a sample meta can be found in the developer's repository: https://github.com/tangl-services/tangl-dev/tree/main/bucket-schemas

For ease of presentation, the structure of metadata in the article will be presented in the YAML markup.

The metadata of an individual element are basically represented as a set of mandatory and optional keys that make up the blocks.

# Block of general element properties
Id: <string || number>
Guid: <uuid>
ElementGuid: <uuid>
Name: <string>
Type: <string>
Category: <string>
IsRef: <bool>
Meta: # Metadata start block
  Element: # Element metadata block
    Pars: {} # Block of internal properties
    Link: {} # Block of internal properties
    Boundings: {} # Block of dimensional properties
    Level: {} # Level property block
    Materials: {} # Materials properties block
    Layers: {} # Layers properties block

General element properties block

An object that stores item properties for quick classification and identification.

  • Guid - unique element identifier, generated by the exporter in the process of export.
  • Id - a unique number of the element, assigned in the native software. For example, for IFC files it is the element EntityLabel/ExpressId, for Revit files it is the identifier of the element in the Revit file.
  • ElementGuid - is a unique identifier of an element in the original file. For example, for Revit files - part of the UniqueId value, with no ElementId added and for IFC files - GlobalId.
  • Category - The first level of element grouping. For example, the class for IFC or the category for Revit to which the item belongs.
  • Type - The second level of element grouping. For example, the type for the Revit to which the item belongs.
  • Name - The name of the item. It depends on the source software that was used for the export.
  • IsRef - Is the element a reference to the properties of another element and it doesn't have its own shell in the model (virtual element).

Metadata start block

An object that stores metadata. Potentially can store not only the metadata of the element itself, but also the metadata of additional resources associated with it.

Element metadata block

Element: # element metadata block
    File: <string>.
    ... # additional element keys
    Pars: {} # Block of internal properties
    Link: {} # Block of external link accessory
    Boundings: {} # Dimension Block
    Level: {} # Block of level properties
    Materials: {} # Block of material properties
    Layers: {} # Layer properties block

The object that stores the element's metadata. It contains both mandatory and optional keys.

Obligatory keys

  • File - the name of the original file from which the item came.
  • Pars - object that contains internal properties and property groups of the element. Some property names and values are standardized within the original software, while others are created by users.

Additional keys

The composition of the additional keys depends on the element type and the original software.

  • Id - the unique number of the element, assigned in the native software. For example, for IFC files it is the element string tag, for Revit files it is the identifier of the element in a Revit file.
  • ElementGuid - is a unique identifier of an element in the original file. For example, for Revit files, part of the UniqueId value, with no ElementId added.
  • Class - IFC class the element belongs to (for IFC files).
  • Category - the category the item belongs to (for Revit files).
  • Name - The name of the item. It depends on the original software that was used for the export.
  • Description - the short text that describes the item.
  • Tag - internal identifier of the model source application (for IFC files).
  • ObjectType - defines specific type information (for IFC files).
  • ProfileName - profile name (for IFC files).
  • PredefinedType - enumeration, PredefinedType of the IFC syntax (for IFC files).

Material properties block

Materials:
  0:
    Material: <string>
    Volume: <number>
    Area: <number>
    ... # keys for custom material properties
    Layers: {} # Layer properties block

An object with numbered keys, in which each key represents a material, its mandatory and user parameters.

Layer properties block

Layers:
  0:
    Function: <string>
    Material: <string>
    Width: <number>
    Volume: <number>
    Area: <number>

An object with numbered keys, in which each key represents a layer, and its parameters. The object is present only in elements that have layers.

Dimension properties block

Boundings:
  Bottom: <number>
Top: <number>

An object that contains the upper and lower boundaries of an element. The object is present only for elements that have a visual representation in the model.

Block of level properties

Level:
  Name: <string>
  Elevation: <number>

Object, contains information about the level at which the item is located. The representation depends on the source file. The object is present only for elements that have a level membership.

Block of affiliation to an external reference

Link:
  IsLinkElement: <bool>

Object, contains information about the affiliation to an external link in case the original software uses a summary file.

Block of internal element properties

Pars:
  ... # Keys of internal element properties

An object that contains internal parameters of an element. The values of internal parameters can point to other metadata of other elements in the metadata array in the baket.

For example:

Pars:
  Room:
    RefIdx: 23 # Room property refers to element metadata number 23 
  • RefIdx - reference to the metadata block in the same bucket. The value is an index in the array of objects of the current bucket.