Skip to content

07 Custom Load Order

hkuich edited this page Nov 22, 2021 · 1 revision

The following is the default order of migrating data using TypeDB Loader:

  1. separate / independent attributes ("attributes": {...})
  2. entities ("entities": {...})
  3. relations ("relations": {}...)
  4. attributes to be appended to existing entities or relations ("appendAttribute": {}...)
  5. attributes to be appended to existing entities or insert entity with attributes ("appendAttributeOrInsertThing": {}...)

This sequence covers most use cases. Difficulties may arise for nested relations and appending attributes, because they require other things to be already present in the database. To customize the order of loading, you can add the following to your "globalConfig":

{
  "globalConfig": {
    ...
    "orderedBeforeGenerators": [
      "person-1"
    ],
    "orderedAfterGenerators": [
      "person-2",
      "person-3"
    ],
    ...
  },
  ...
}

"orderedBeforeGenerators" are loaded in the specified order BEFORE the default loading order.

"orderedAfterGenerators" are loaded in the specified order AFTER the default loading order.