Data Governance
Also available as:
PDF
loading table of contents...

Appendix

Important Atlas API Data Types

AtlasAttributeDef

The AtlasAttributeDef structure contains the details of an attribute that is contained in an Entity, Classification, or Struct. An AtlasAttributeDef has the following properties:

  • name – The attribute name.

  • typeName – The attribute type.

  • cardinality – Denotes whether the attribute is a single value, a list, or a set of values. Possible values are SINGLE, LIST, or SET.

  • isIndexable – Denotes whether the attribute can be indexed by Atlas metadata store.

  • isOptional – Whether or not it is necessary to pass a value for the attribute.

  • isUnique – Whether or not the attribute value is unique across the Atlas metadata store.

AtlasTypesDef

The AtlasTypesDef structure is used in the following APIs:

The AtlasTypesDef structure has the following attributes:

  • enumDefs – An array of types of metatype AtlasEnumDef. Will be empty if no Enums are being queried or defined.

  • structDefs – An array of types of metatype AtlasStructDef. Will be empty if no Structs are being queried or defined.

  • entityDefs – An array of types of metatype AtlasEntityDef. Will be empty if no Entities are being queried or defined.

  • classificationDefs – An array of types of metatype AtlasClassificationDef. Will be empty if no Classifications are being queried or defined.

  • For each of the AtlasStruct, AtlasEntity or AtlasClassification types defined, the following attributes are found:

    • name – The name of the specific AtlasStruct, AtlasEntity, or AtlasClassification being defined.

    • typeVersion – The version of the type.

    • superTypes – If the type being defined is a AtlasEntity or AtlasClassification, this will be an array of Strings, each for a super class of the AtlasEntity or AtlasClassification being defined.

    • attributeDefs – An array defining attributes that are part of the AtlasStruct, AtlasEntity or AtlasClassification being defined. Each attribute is an instance of AtlasAttributeDef.

AtlasEntity

The AtlasEntity structure is used in the following APIs:

The AtlasEntity structure has the following attributes:

  • typeName – The name of the type of which this entity is an instance.

  • guid – The system-specific identifier.

    • When being used to create an entity, this ID value for the entity MUST be a negative long number. For example, Atlas Java code uses "" + (-System.nanoTime()) as the value for this. An identifier specified like this has a special meaning in Atlas, that it is as yet unassigned in the data stores. Atlas then generates a GUID for this entity and stores it – which becomes the true identifier.

    • When being used to refer to an existing entity, this ID value is the system-generated GUID (in standard GUID format. For example: 139b47b2-b911-47d4-b43c-0493607b4b89.

  • attributes – A JSON map of the attribute names and values for the attributes defined in the type definition of the entity. This is obviously the most important part of the entity definition. To set or retrieve the attribute values of the entity, this map will need to be iterated. The encoding of the values in the map is according to the metatype of each attribute, as follows:

    • Basic Metatypes – Int, String, Boolean, etc. Encoding is corresponding string representation.

    • Enum Metatypes – TODO

    • Collection Metatypes – Arrays, Maps (TODO for Maps). Arrays are encoded as a JSON array, where each element is recursively encoded according to these rules.

    • Composite Metatypes – AtlasEntity, AtlasStruct, AtlasClassification (TODO for AtlasStruct /AtlasClassification). For Entities: If the system ID of the entity being referenced is known, only the guid attribute needs to be filled. If the system ID of the entity being referenced is not known, then the full encoding of the entity according to its AtlasEntity should be specified.

  • classifications – A Map of String to Classification instance definitions. Each entry has the key as the classification name and the value is an AtlasClassification.

ClassificationInstanceDefinition

The ClassificationInstanceDefinition is used in the following APIs:

The ClassificationInstanceDefinition has the following structure:

{
  "jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Struct",
  "typeName":name_of_Classification,
  "values":{
    “attribute_name”: “attribute_value”,
    ...
  }
}

The ClassificationInstanceDefinition structure has the following properties:

  • jsonClass – Points to the metatype org.apache.atlas.typesystem.json.InstanceSerialization$_Struct

  • typeName – Refers to the name of the Classification being added.

  • values – A map of key-value pairs. Key is attribute name defined when defining the Classification. Value is attribute value.