Atlas Type Definition Models#

Type Definitions#

A type definition enables you to create custom types.

  • To create a custom asset type, use the EntityTypeDef

  • To create a custom classification, use the ClassificationTypeDef

  • To create a custom business metadata definition use StructType and TypeCategory.

biz_def = AtlasStructDef(
   name="operations",
   category=TypeCategory.BUSINESSMETADATA,
   attributeDefs=[
      AtlasAttributeDef(name="expenseCode",options={"maxStrLength": "500","applicableEntityTypes":"[\"DataSet\"]"}),
      AtlasAttributeDef(name="criticality",options={"maxStrLength": "500", "applicableEntityTypes":"[\"DataSet\"]"})
   ]
)
  • To upload a type definition use the AtlasClient or PurviewClient upload_typedefs.

# Upload an entity definition
client.upload_typedefs(entityDefs=[entity_def])
# Upload a business metadata definition
client.upload_typedefs(businessMetadataDefs=[biz_def])
# Upload a classification definition
client.upload_typedefs(classificationDefs=[classif_def])
# etc.

EntityTypeDef(name[, superTypes])

An implementation of AtlasEntityDef

ClassificationTypeDef(name[, entityTypes, …])

An implementation of AtlasClassificationDef

RelationshipTypeDef(name, endDef1, endDef2, …)

An implementation of AtlasRelationshipDef.

Cardinality(value)

An implementation of an Atlas Cardinality used in relationshipDefs.

AtlasStructDef(name, category, **kwargs)

An implemention of AtlasStructDef.

TypeCategory(value)

An implementation of an Atlas TypeCategory used in relationshipDefs.

BaseTypeDef(name, category, **kwargs)

An implementation of AtlasBaseTypeDef.

AtlasAttributeDef(name, **kwargs)

An implementation of AtlasAttributeDef.

Atlas Relationship Definitions#

These are utility classes when dealing with defining relationships.

AtlasRelationshipAttributeDef(name, …)

An implementation of AtlasRelationshipAttributeDef.

AtlasRelationshipEndDef(name, typeName[, …])

An implementation of AtlasRelationshipEndDef.

ParentEndDef(name, typeName, **kwargs)

A helper for creating a Parent end def (e.g.

ChildEndDef(name, typeName, **kwargs)

A helper for creating a Child end def (e.g.