Skip to main content

Categorize terms

Terms in a glossary can also be organized in one (or many) categories.

Remember the glossary is the container, not the category

Remember that the glossary is what contains the term, not the category. Therefore a term must have a glossary, but isn't required to have a category. Also, a term can (optionally) be organized in many categories, but can only exist in one glossary.

Category must exist before creating or updating the term

Remember: each category must already exist before you create or update a term that refers to the category.

During term creation

To categorize a term during its creation:

Categorize during creation
GlossaryTerm term = GlossaryTerm.creator(
"Example Term", // (1)
glossary) // (2)
.category(GlossaryCategory.refByGuid("dc4c0a08-a902-402b-bf24-cf935aecc343")) // (3)
.category(GlossaryCategory.refByQualifiedName(anotherCategoryQN)) // (4)
.build(); // (5)
AssetMutationResponse response = term.save(client); // (6)
  1. A name for the new term.
  2. The glossary in which to create the term.
  3. You can then add any number of categories using the category() builder method. In this example the term will be categorized in a category with a GUID of dc4c0a08-a902-402b-bf24-cf935aecc343...
  4. ...in this example the term will also be categorized in a category with a qualifiedName given by the anotherCategoryQN variable.
  5. You need to build the object you've just defined.
  6. You then only need to save()1 the object to create it in Atlan. Because this operation will persist the asset in Atlan, you must provide it an AtlanClient through which to connect to the tenant.

Updating existing term

To create a child category, the steps are very similar but you add in the reference to the parent category:

Update an existing term
GlossaryTerm term = GlossaryTerm.updater(
"gsNccqJraDZqM6WyGP3ea@FzCMyPR2LxkPFgr8eNGrq", // (1)
"Example Term", // (2)
"b4113341-251b-4adc-81fb-2420501c30e6") // (3)
.category(GlossaryCategory.refByGuid("dc4c0a08-a902-402b-bf24-cf935aecc343")) // (4)
.category(GlossaryCategory.refByQualifiedName(anotherCategoryQN)) // (5)
.build(); // (6)
AssetMutationResponse response = child.save(client); // (7)
  1. The qualifiedName of the existing term.
  2. The name of the existing term.
  3. The GUID of the glossary in which the term exists.
  4. You can then add any number of categories using the category() builder method. In this example the term will be categorized in a category with a GUID of dc4c0a08-a902-402b-bf24-cf935aecc343...
  5. ...in this example the term will also be categorized in a category with a qualifiedName given by the anotherCategoryQN variable.
  6. You need to build the object you've just defined.
  7. You then only need to save()1 the object to update it in Atlan. Because this operation will persist the asset in Atlan, you must provide it an AtlanClient through which to connect to the tenant.

Footnotes

  1. Why no distinction between create and update? This has to do with how Atlan detects changes—see the Importance of identifiers for a more detailed explanation. 2 3 4 5 6

Was this page helpful?