Render your model¶
Full example (expand for details)
In addition to defining the various entities and relationships outlined at the beginning of this page, we have created this inheritance structure:
classDiagram
direction LR
Catalog <|-- Custom
Catalog <|-- SQL
SQL <|-- Table
SQL <|-- Column
Custom <|-- CustomDataset
Custom <|-- CustomTable
Table <|-- CustomTable
Custom <|-- CustomField
Column <|-- CustomField
class Catalog{
string name
string qualifiedName
string description
}
class SQL{
string tableName
string tableQualifiedName
}
class Custom{
string customSourceId
string customDatasetName
string customDatasetQualifiedName
}
<<abstract>> Catalog
<<abstract>> SQL
<<abstract>> Custom
class CustomTable{
struct[] customRatings
}
class CustomField{
enum customTemperature
}
Following is the complete model file for the running example, without any comments, in case you want to try it yourself as a sort of "hello world" example:
MyCustomModel.pkl | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
|
Render through pkl
¶
Once your model is defined, you can then "render" it into the files Atlan needs using the pkl
CLI:
pkl eval MyCustomModel.pkl -m tmp
This will generate multiple JSON files representing the custom model, in the folder structure required by Atlan, ready to be submitted in a PR.
Output produced¶
Rendering the model will create two subdirectories under the output directory you specify (the location you specify for -m
):
├── models/ # (1)
│ ├── {{Namespace}}.json # (2)
│ └── {{Namespace}}/
│ ├── {{AssetType}}.json # (3)
│ ├── ...
│ └── {{Namespace}}_relationships.json # (4)
│
└── frontend/ # (5)
└── {{Namespace}}/
└── src/
├── api/
│ └── schemas/ # (6)
│ ├── {{Namespace}}.json
│ └── {{Namespace}}/
│ ├── {{AssetType}}.json
│ ├── ...
│ └── {{Namespace}}_relationships.json
│
├── assets/
│ └── images/
│ └── icons/ # (7)
│
├── components/
│ └── common/
│ ├── icon/ # (8)
│ └── widgets/ # (9)
│
├── composables/
│ └── discovery/ # (10)
│
├── constant/ # (11)
│
└── locales/ # (12)
- The
models
subdirectory will contain JSON files needed by Atlas for the underlying metamodel. - A single file containing details of the abstract supertype, all enumerations and all structs.
- Multiple JSON files, one per custom asset type.
- A single JSON file containing all relationships.
- The
frontend
subdirectory will contain various JSON, TypeScript, Vue, and placeholder image files. - The same JSON files as output to the
models
subdirectory. - Empty placeholder files indicating the image files for icons you must copy over separately.
- Code snippets you need to insert into an existing TypeScript file.
- Code snippets you need to insert into an existing Vue file.
- Code snippets you need to insert into an existing TypeScript file for parent-child navigation through de-normalized qualifiedName attributes to work.
- Mixture of code snippets and full TypeScript code files you need to copy over.
- Internationalization snippets you need to insert into an existing JSON file.
Running example (expand for details)
For our running example, this would produce:
├── models/
│ ├── Custom.json # (1)!
│ └── Custom/
│ ├── CustomDataset.json
│ ├── CustomTable.json
│ ├── CustomField.json
│ └── Custom_relationships.json
│
└── frontend/
└── Custom/
└── src/
├── api/
│ └── schemas/
│ ├── Custom.json
│ └── Custom/
│ ├── CustomDataset.json
│ ├── CustomTable.json
│ ├── CustomField.json
│ └── Custom_relationships.json
│
├── assets/
│ └── images/
│ └── icons/
│ ├── database-gray.svg-PLACEHOLDER
│ ├── database.svg-PLACEHOLDER
│ ├── table-gray.svg-PLACEHOLDER
│ ├── table.svg-PLACEHOLDER
│ ├── column-gray.svg-PLACEHOLDER
│ └── column.svg-PLACEHOLDER
│
├── components/
│ └── common/
│ ├── icon/
│ │ └── column.svg-PLACEHOLDER
│ └── widgets/
│ └── summary/
│ └── types/
│ └── parentAssetInline.vue-snippet
│
├── composables/
│ └── discovery/
│ └── useBody.ts-snippet
│
├── constant/
│ ├── projection.ts-snippet
│ └── source/
│ ├── index.ts-snippet
│ └── custom/
│ ├── index.ts
│ ├── methods.ts
│ ├── common/
│ │ ├── index.ts
│ │ ├── assetTypes.ts
│ │ ├── getAssetTypes.ts
│ │ └── hierarchyFilters.ts
│ └── attributes/
│ ├── customDataset.ts
│ ├── customTable.ts
│ └── customField.ts
│
└── locales/
└── en.json-snippet
- This file will contain all the attributes defined in the supertype, as well as the enumeration and struct.