Skip to content

Creating glossary objects

You can create objects in glossaries in the same way as all other objects in the SDK. Each object provides a method that takes the minimal set of required fields to create that asset.

Create a glossary

1.4.0 1.0.0

To create a glossary:

Create a glossary
1
2
3
4
5
Glossary glossary = Glossary
    .creator("Example Glossary") // (1)
    .assetIcon(AtlanIcon.BOOK_OPEN_TEXT) // (2)
    .build(); // (3)
AssetMutationResponse response = glossary.save(); // (4)
  1. A name for the new glossary.
  2. You can chain any other enrichment onto the creator, such as an icon for the glossary in this example.
  3. You then build the object (in-memory).
  4. And finally you can save the glossary back to Atlan (and the result of that save is returned).
Create a glossary
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import AtlasGlossary
from pyatlan.model.enums import AtlanIcon

client = AtlanClient()
glossary = AtlasGlossary.create(
    name="Example Glossary"  # (1)
)
glossary.asset_icon = AtlanIcon.BOOK_OPEN_TEXT.value  # (2)
response = client.asset.save(glossary)  # (3)
  1. A name for the new glossary.
  2. You can chain any other enrichment onto the creator, such as an icon for the glossary in this example.
  3. You then build the object (in-memory).
  4. And finally you can save the glossary back to Atlan (and the result of that save is returned).
Create a glossary
1
2
3
4
5
val glossary = Glossary
    .creator("Example Glossary") // (1)
    .assetIcon(AtlanIcon.BOOK_OPEN_TEXT) // (2)
    .build() // (3)
val response = glossary.save() // (4)
  1. A name for the new glossary.
  2. You can chain any other enrichment onto the creator, such as an icon for the glossary in this example.
  3. You then build the object (in-memory).
  4. And finally you can save the glossary back to Atlan (and the result of that save is returned).
POST /api/meta/entity/bulk
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "entities": [ // (1)
    {
      "typeName": "AtlasGlossary", // (2)
      "attributes": {
        "name": "Example Glossary", // (3)
        "qualifiedName": "Example Glossary", // (4)
        "assetIcon": "PhBookOpenText" // (5)
      }
    }
  ]
}
  1. All assets must be wrapped in an entities array.
  2. You must provide the exact type name for the asset (case-sensitive). For a glossary, this is AtlasGlossary.
  3. You must provide the exact name of the asset (case-sensitive).
  4. You must provide a qualifiedName of the asset (case-sensitive). In the case of glossaries, this will actually be replaced in the back-end with a generated qualifiedName, but you must provide some value when creating the object.
  5. You can also provide other enrichment, such as an icon for the glossary in this example.

Create a category

1.4.0 1.0.0

To create a category:

Create a category
1
2
3
4
5
GlossaryCategory category = GlossaryCategory
    .creator("Example Category", // (1)
        "b4113341-251b-4adc-81fb-2420501c30e6") // (2)
    .build(); // (3)
AssetMutationResponse response = category.save(); // (4)
  1. You must provide a name for the new category.
  2. You must provide the ID of the glossary in which the category should be created (GUID or qualifiedName).
  3. You then build the object (in-memory).
  4. And finally you can save the category back to Atlan (and the result of that save is returned).
Create a category
1
2
3
4
5
6
7
8
9
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import AtlasGlossaryCategory

client = AtlanClient()
category = AtlasGlossaryCategory.create(
    name="Example Category",  # (1)
    glossary_guid="b4113341-251b-4adc-81fb-2420501c30e6"  # (2)
)
response = client.asset.save(category)  # (3)
  1. You must provide a name for the new category.
  2. You must provide the ID of the glossary (GUID) in which the category should be created.
  3. And finally you can save the category back to Atlan (and the result of that save is returned).
Create a category
1
2
3
4
5
val category = GlossaryCategory
    .creator("Example Category", // (1)
        "b4113341-251b-4adc-81fb-2420501c30e6") // (2)
    .build() // (3)
val response = category.save() // (4)
  1. You must provide a name for the new category.
  2. You must provide the ID of the glossary in which the category should be created (GUID or qualifiedName).
  3. You then build the object (in-memory).
  4. And finally you can save the category back to Atlan (and the result of that save is returned).
POST /api/meta/entity/bulk
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
  "entities": [ // (1)
    {
      "typeName": "AtlasGlossaryCategory", // (2)
      "attributes": {
        "name": "Example Category", // (3)
        "qualifiedName": "Example Category", // (4)
        "anchor": { // (5)
          "typeName": "AtlasGlossary",
          "guid": "b4113341-251b-4adc-81fb-2420501c30e6"
        }
      }
    }
  ]
}
  1. All assets must be wrapped in an entities array.
  2. You must provide the exact type name for the asset (case-sensitive). For a category, this is AtlasGlossaryCategory.
  3. You must provide the exact name of the asset (case-sensitive).
  4. You must provide a qualifiedName of the asset (case-sensitive). In the case of categories, this will actually be replaced in the back-end with a generated qualifiedName, but you must provide some value when creating the object.
  5. You must also specify the parent glossary in which the category should be created. This must be placed in an anchor property, which itself has an embedded typeName (of AtlasGlossary) and the GUID of the glossary.

Create a term

1.4.0 1.0.0

To create a term:

Create a term
1
2
3
4
5
GlossaryTerm term = GlossaryTerm
    .creator("Example Term", // (1)
        "b4113341-251b-4adc-81fb-2420501c30e6") // (2)
    .build(); // (3)
AssetMutationResponse response = term.save(); // (4)
  1. You must provide a name for the new term.
  2. You must provide the ID of the glossary in which the term should be created (GUID or qualifiedName).
  3. You then build the object (in-memory).
  4. And finally you can save the term back to Atlan (and the result of that save is returned).
Create a term
1
2
3
4
5
6
7
8
9
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import AtlasGlossaryTerm

client = AtlanClient()
term = AtlasGlossaryTerm.create(
    name="Example Term",  # (1)
    glossary_guid="b4113341-251b-4adc-81fb-2420501c30e6"  # (2)
)
response = client.asset.save(term)  # (3)
  1. You must provide a name for the new term.
  2. You must provide the ID of the glossary (GUID) in which the term should be created.
  3. And finally you can save the term back to Atlan (and the result of that save is returned).
Create a term
1
2
3
4
5
val term = GlossaryTerm
    .creator("Example Term", // (1)
        "b4113341-251b-4adc-81fb-2420501c30e6") // (2)
    .build() // (3)
val response = term.save() // (4)
  1. You must provide a name for the new term.
  2. You must provide the ID of the glossary in which the term should be created (GUID or qualifiedName).
  3. You then build the object (in-memory).
  4. And finally you can save the term back to Atlan (and the result of that save is returned).
POST /api/meta/entity/bulk
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
  "entities": [ // (1)
    {
      "typeName": "AtlasGlossaryTerm", // (2)
      "attributes": {
        "name": "Example Term", // (3)
        "qualifiedName": "Example Term", // (4)
        "anchor": { // (5)
          "typeName": "AtlasGlossary",
          "guid": "b4113341-251b-4adc-81fb-2420501c30e6"
        }
      }
    }
  ]
}
  1. All assets must be wrapped in an entities array.
  2. You must provide the exact type name for the asset (case-sensitive). For a term, this is AtlasGlossaryTerm.
  3. You must provide the exact name of the asset (case-sensitive).
  4. You must provide a qualifiedName of the asset (case-sensitive). In the case of terms, this will actually be replaced in the back-end with a generated qualifiedName, but you must provide some value when creating the object.
  5. You must also specify the parent glossary in which the term should be created. This must be placed in an anchor property, which itself has an embedded typeName (of AtlasGlossary) and the GUID of the glossary.