Utilities for importing, exporting, and migrating semantic data between
xeokit's legacy MetaModel format and the modern DataModel.
This module helps you move between xeokit's older MetaModel format and the
newer DataModel, which represents semantic information as an
entity–relationship graph with property sets.
You can:
Load legacy MetaModel data directly into a DataModel, or
Convert MetaModel data into DataModelParams first, then load it explicitly, or
Export a DataModel back out as legacy MetaModelParams
Overview
xeokit's legacy MetaModel format represents a simple hierarchy of entities
with attached property sets. While still supported for compatibility, it has
been superseded by the DataModel, which offers a richer and more flexible
semantic representation.
This module provides utilities to bridge the two formats.
Key components
convertMetaModel
Converts a MetaModelParams object into a DataModelParams object.
MetaModelLoader
Loads a MetaModelParams object directly into an existing DataModel.
MetaModelExporter
Exports a DataModel back out as legacy MetaModelParams JSON.
convertDataModel
Converts a DataModelParams object into a MetaModelParams object.
DataModel
The modern semantic data model used by xeokit, based on entity–relationship graphs.
DataModelParams
The JSON format used to populate a DataModel.
MetaModelParams
The legacy JSON format describing a hierarchy of entities with property sets.
Shape
%%{init:{"theme":"dark"}}%%
classDiagram
direction TB
class MetaModelLoader {
+format : "MetaModel"
+load(params, options?) Promise~void~
}
class convertMetaModel {
<<function>>
+(metaModelParams) DataModelParams
}
class ModelLoader {
<<formats>>
}
ModelLoader <|-- MetaModelLoader
convertMetaModel ..> MetaModelLoader : upgrades to v3
%%{init:{"theme":"default"}}%%
classDiagram
direction TB
class MetaModelLoader {
+format : "MetaModel"
+load(params, options?) Promise~void~
}
class convertMetaModel {
<<function>>
+(metaModelParams) DataModelParams
}
class ModelLoader {
<<formats>>
}
ModelLoader <|-- MetaModelLoader
convertMetaModel ..> MetaModelLoader : upgrades to v3
classDiagram
direction TB
class MetaModelLoader {
+format : "MetaModel"
+load(params, options?) Promise~void~
}
class convertMetaModel {
<<function>>
+(metaModelParams) DataModelParams
}
class ModelLoader {
<<formats>>
}
ModelLoader <|-- MetaModelLoader
convertMetaModel ..> MetaModelLoader : upgrades to v3
Features
Legacy V2 MetaModel — preserves the older xeokit-sdk V2
metadata format for backward compatibility with existing
xeokit-convert outputs.
xeokit Legacy MetaModel Utilities
Utilities for importing, exporting, and migrating semantic data between xeokit's legacy MetaModel format and the modern DataModel.
This module helps you move between xeokit's older
MetaModelformat and the newerDataModel, which represents semantic information as an entity–relationship graph with property sets.You can:
DataModel, orDataModelParamsfirst, then load it explicitly, orDataModelback out as legacyMetaModelParamsOverview
xeokit's legacy
MetaModelformat represents a simple hierarchy of entities with attached property sets. While still supported for compatibility, it has been superseded by theDataModel, which offers a richer and more flexible semantic representation.This module provides utilities to bridge the two formats.
Key components
MetaModelParamsobject into aDataModelParamsobject.MetaModelParamsobject directly into an existingDataModel.DataModelback out as legacyMetaModelParamsJSON.DataModelParamsobject into aMetaModelParamsobject.DataModel.Shape
Features
xeokit-convertoutputs.Installation
Install the xeokit SDK using npm:
Usage
The following examples show two common migration workflows.
Option 1: Load MetaModel data directly into a DataModel
Use MetaModelLoader when you want to load legacy MetaModel data straight into a
DataModelwithout creating intermediate parameters.Step 1: Create a DataModel
Step 2: Load the MetaModelParams
Option 2: Convert MetaModel data before loading
Use convertMetaModel when you want access to
DataModelParams—for example, to inspect, modify, or store the converted data before loading it.Step 1: Create a DataModel
Step 2: Convert MetaModelParams to DataModelParams