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 glossary
To create a glossary:
- Java
- Python
- Kotlin
- Raw REST API
Create a glossary
Glossary glossary = Glossary
.creator("Example Glossary") // (1)
.assetIcon(AtlanIcon.BOOK_OPEN_TEXT) // (2)
.build(); // (3)
AssetMutationResponse response = glossary.save(client); // (4)
- A name for the new glossary.
- You can chain any other enrichment onto the creator, such as an icon for the glossary in this example.
- You then build the object (in-memory).
- And finally you can save the glossary back to Atlan (and the result of that save is returned). Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
Create a glossary
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import AtlasGlossary
from pyatlan.model.enums import AtlanIcon
client = AtlanClient()
glossary = AtlasGlossary.creator(
name="Example Glossary" # (1)
)
glossary.asset_icon = AtlanIcon.BOOK_OPEN_TEXT.value # (2)
response = client.asset.save(glossary) # (3)
- A name for the new glossary.
- You can chain any other enrichment onto the creator, such as an icon for the glossary in this example.
- You then build the object (in-memory).
- And finally you can save the glossary back to Atlan (and the result of that save is returned).
Create a glossary
val glossary = Glossary
.creator("Example Glossary") // (1)
.assetIcon(AtlanIcon.BOOK_OPEN_TEXT) // (2)
.build() // (3)
val response = glossary.save(client) // (4)
- A name for the new glossary.
- You can chain any other enrichment onto the creator, such as an icon for the glossary in this example.
- You then build the object (in-memory).
- And finally you can save the glossary back to Atlan (and the result of that save is returned). Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
POST /api/meta/entity/bulk
{
"entities": [ // (1)
}
]
}
- All assets must be wrapped in an
entitiesarray. - You must provide the exact type name for the asset (case-sensitive). For a glossary, this is
AtlasGlossary. - You must provide the exact name of the asset (case-sensitive).
- You must provide a
qualifiedNameof the asset (case-sensitive). In the case of glossaries, this will actually be replaced in the back-end with a generatedqualifiedName, but you must provide some value when creating the object. - You can also provide other enrichment, such as an icon for the glossary in this example.
Create category
To create a category:
- Java
- Python
- Kotlin
- Raw REST API
Create a category
GlossaryCategory category = GlossaryCategory
.creator("Example Category", // (1)
"b4113341-251b-4adc-81fb-2420501c30e6") // (2)
.build(); // (3)
AssetMutationResponse response = category.save(client); // (4)
- You must provide a name for the new category.
- You must provide the ID of the glossary in which the category should be created (GUID or qualifiedName).
- You then build the object (in-memory).
- And finally you can save the category back to Atlan (and the result of that save is returned). Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
Create a category
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import AtlasGlossaryCategory
client = AtlanClient()
category = AtlasGlossaryCategory.creator(
name="Example Category", # (1)
glossary_guid="b4113341-251b-4adc-81fb-2420501c30e6" # (2)
)
response = client.asset.save(category) # (3)
- You must provide a name for the new category.
- You must provide the ID of the glossary (GUID) in which the category should be created.
- And finally you can save the category back to Atlan (and the result of that save is returned).
Create a category
val category = GlossaryCategory
.creator("Example Category", // (1)
"b4113341-251b-4adc-81fb-2420501c30e6") // (2)
.build() // (3)
val response = category.save(client) // (4)
- You must provide a name for the new category.
- You must provide the ID of the glossary in which the category should be created (GUID or qualifiedName).
- You then build the object (in-memory).
- And finally you can save the category back to Atlan (and the result of that save is returned). Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
POST /api/meta/entity/bulk
{
"entities": [ // (1)
}
}
]
}
- All assets must be wrapped in an
entitiesarray. - You must provide the exact type name for the asset (case-sensitive). For a category, this is
AtlasGlossaryCategory. - You must provide the exact name of the asset (case-sensitive).
- You must provide a
qualifiedNameof the asset (case-sensitive). In the case of categories, this will actually be replaced in the back-end with a generatedqualifiedName, but you must provide some value when creating the object. - You must also specify the parent glossary in which the category should be created. This must be placed in an
anchorproperty, which itself has an embeddedtypeName(ofAtlasGlossary) and the GUID of the glossary.
Create term
To create a term:
- Java
- Python
- Kotlin
- Raw REST API
Create a term
GlossaryTerm term = GlossaryTerm
.creator("Example Term", // (1)
"b4113341-251b-4adc-81fb-2420501c30e6") // (2)
.build(); // (3)
AssetMutationResponse response = term.save(client); // (4)
- You must provide a name for the new term.
- You must provide the ID of the glossary in which the term should be created (GUID or qualifiedName).
- You then build the object (in-memory).
- And finally you can save the term back to Atlan (and the result of that save is returned). Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
Create a term
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import AtlasGlossaryTerm
client = AtlanClient()
term = AtlasGlossaryTerm.creator(
name="Example Term", # (1)
glossary_guid="b4113341-251b-4adc-81fb-2420501c30e6" # (2)
)
response = client.asset.save(term) # (3)
- You must provide a name for the new term.
- You must provide the ID of the glossary (GUID) in which the term should be created.
- And finally you can save the term back to Atlan (and the result of that save is returned).
Create a term
val term = GlossaryTerm
.creator("Example Term", // (1)
"b4113341-251b-4adc-81fb-2420501c30e6") // (2)
.build() // (3)
val response = term.save(client) // (4)
- You must provide a name for the new term.
- You must provide the ID of the glossary in which the term should be created (GUID or qualifiedName).
- You then build the object (in-memory).
- And finally you can save the term back to Atlan (and the result of that save is returned). Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
POST /api/meta/entity/bulk
{
"entities": [ // (1)
}
}
]
}
- All assets must be wrapped in an
entitiesarray. - You must provide the exact type name for the asset (case-sensitive). For a term, this is
AtlasGlossaryTerm. - You must provide the exact name of the asset (case-sensitive).
- You must provide a
qualifiedNameof the asset (case-sensitive). In the case of terms, this will actually be replaced in the back-end with a generatedqualifiedName, but you must provide some value when creating the object. - You must also specify the parent glossary in which the term should be created. This must be placed in an
anchorproperty, which itself has an embeddedtypeName(ofAtlasGlossary) and the GUID of the glossary.