Creating Object Relationships Using the User Label
If the Excel file contains columns with a reference to other objects in the iModel, then use the "relationshipsColMap" property to define the iModel relationship.
The mapping of relationships is done by values in columns.
The "source" of the relationship will be created from the object identified by the user's label in the source column and the class in the "target" property. The "target" of the relationship is the object that is created from the current row.
If the source object does not exist in the iModel, the relationship will not be created.
Data
Tag number | Description | Class | Unit | Plant Area | System |
---|---|---|---|---|---|
P20 | Plant Area | ||||
P20.H1 | System | P20 | |||
P20.H1.T3 | Unit1 | P20.H1 | |||
P20.H1.T3-V105 | Globe valve (general) | Globe valve (general) | P20.H1.T3 | ||
P20.H1.T3-V108 | Globe valve (general) | Globe valve (general) | P20.H1.T3 | ||
P20.H1.T3-V118 | Globe valve (general) | Globe valve (general) | P20.H1.T3 | ||
P20.H1.T3-V125 | Globe valve (general) | Globe valve (general) | P20.H1.T3 | ||
P20.H1.T3-V128 | Globe valve (general) | Globe valve (general) | P20.H1.T3 |
Configuration
{ "id": 4, "name": "mapping 4", "importType": "smartExcel", "classKey": "Class", "relationshipsColMap": [ { "source": "Plant Area", "relationship": "PLANT_AREA_HAS_NAMED_ITEM", "target": "PLANT_AREA" }, { "source": "System", "relationship": "SYSTEM_HAS_NAMED_ITEM", "target": "SYSTEM" }, { "source": "Unit", "relationship": "UNIT_HAS_NAMED_ITEM", "target": "UNIT" } ], "data": [ { "sourceClass": "Plant Area", "targetClass": "PLANT_AREA" }, { "sourceClass": "System", "targetClass": "SYSTEM" }, { "sourceClass": "Pump, general", "targetClass": "PUMP" } ], }