Contains a model's semantic data, as an entity-relationship graph.

This data model is:

For detailed usage, refer to @xeokit/sdk/model/data.

Properties

author?: string

The model author, if available.

createdAt?: string

The date the model was created, if available.

creatingApplication?: string

The application that created the model, if available.

data: Data

The Data that contains this DataModel.

destroyed: boolean

Indicates whether this DataModel has been destroyed.

id: string

Unique ID of this DataModel.

DataModels are stored against this ID in Data.models.

name?: string

The model name, if available.

objects: { [key: string]: DataObject }

The DataObjects in this DataModel, mapped to DataObject.id.

DataObjects have globally-unique IDs and will also be stored in Data.objects.

objectsByType: { [key: string]: { [key: string]: DataObject } }

The DataObjects in this DataModel, mapped to DataObject.type, sub-mapped to DataObject.id.

projectId?: string | number

The project ID, if available.

propertySets: { [key: string]: PropertySet }

ThePropertySets in this DataModel, mapped to PropertySet.id.

PropertySets have globally-unique IDs and will also be stored in Data.propertySets.

relationships: Relationship[]

The Relationships in this DataModel.

  • The Relationships can be between DataObjects in different DataModels, but always within the same Data.
revisionId?: string | number

The revision ID, if available.

rootObjects: { [key: string]: DataObject }

The root DataObjects in this DataModel, mapped to DataObject.id.

  • This is the set of DataObjects in this DataModel that are not the related participant in any Relationships, where they have no incoming Relationships and their DataObject.relating property is empty.
schema?: string

The data format / schema this DataModel conforms to (e.g. "IFC4", "AP214", "MyApp/v1").

Set once at construction time via DataModelParams.schema and immutable thereafter. Whether schema homogeneity is enforced depends on this value:

  • Defined — the DataModel runs in enforced mode. Every DataObject, PropertySet, and Relationship added must either match this value or omit its own schema field (in which case it inherits this one). DataModel.createObject, DataModel.createPropertySet and DataModel.createRelationship reject components with a mismatching schema, including reused components that already belong to another DataModel with a different schema, and reject relationships whose endpoints carry a different schema.

  • Undefined — the DataModel runs in free mode. No schema checks are performed; components may carry any (or no) schema tag, freely mix, and freely interrelate. The caller's per-component schema value is preserved as-is.

Set the schema when you care about homogeneity (e.g. a strict IFC4 model). Leave it undefined when you want a heterogeneous bag of components — for example, federated data assembled from several sources before classification.

Statistics on this DataModel.

typeCounts: { [key: string]: number }

The count of each type of DataObject in this DataModel, mapped to DataObject.type.

Methods