Skip to end of metadata
Go to start of metadata

Apache Atlas has a type system that can be used to build out specific structures for storing different types of metadata entities and the relationships between them. These metadata types are defined either using JSON files that are loaded into Atlas or through calls to the Types API.

Within the type system are 5 major elements that are defined in the JSON model files.

   Element Description

Example

enumDefs: defines ordered list of values for defining the valid values of an attribute.  The example on the left defines an enum called file_action that has 8 values (numbered 0-7) with values of NONE, EXECUTE, WRITE, WRITE_EXECUTE, READ, READ_EXECUTE, READ_WRITE, ALL.  The enum can be used as a type in other definitions:

                {

                    "name": "group",

                    "typeName": "file_action",

                    "cardinality": "SINGLE",

                    "isIndexable": true,

                    "isOptional": false,

                    "isUnique": false

                },

        {

            "name": "file_action",

            "typeVersion": "1.0",

            "elementDefs": [

                {

                    "ordinal": 0,

                    "value": "NONE"

                },

                {

                    "ordinal": 1,

                    "value": "EXECUTE"

                },

                {

                    "ordinal": 2,

                    "value": "WRITE"

                },

                {

                    "ordinal": 3,

                    "value": "WRITE_EXECUTE"

                },

                {

                    "ordinal": 4,

                    "value": "READ"

                },

                {

                    "ordinal": 5,

                    "value": "READ_EXECUTE"

                },

                {

                    "ordinal": 6,

                    "value": "READ_WRITE"

                },

                {

                    "ordinal": 7,

                    "value": "ALL"

                }

            ]

        }

structDefs: defines a complex structure that can be used as an attribute type in other definitions.   In the example to the right, a struct called hive_order is defined which has 2 attributes: order (an integer) and col (a string).  The struct can be used as a type in other definitions: for example:

                {

                    "name": "sortCols",

                    "typeName": "array<hive_order>",

                    "cardinality": "SINGLE",

                    "isIndexable": false,

                    "isOptional": true,

                    "isUnique": false

                },

   Structs are stored as their own vertex in the graph, linked to their entity.

        {

            "name": "hive_order",

            "typeVersion": "1.0",

            "attributeDefs": [

                {

                    "name": "order",

                    "typeName": "int",

                    "cardinality": "SINGLE",

                    "isIndexable": false,

                    "isOptional": false,

                    "isUnique": false

                },

                {

                    "name": "col",

                    "typeName": "string",

                    "cardinality": "SINGLE",

                    "isIndexable": false,

                    "isOptional": false,

                    "isUnique": false

                }

            ]

        },

classificationDefs: defines a classification that can be assigned to a metadata entity and then used for governance.

<none currently available>

entityDefs: defines the structure for a top-level metadata entity.  In the example on the right, there is an entity definition for a process.  It is a subtype of Referenceable and Asset and adds attributes called inputs (an array of entities called DataSet) and outputs (another array of type DataSet).

      {
            "name": "Process",
            "superTypes": ["Referenceable",
                           "Asset"],
            "typeVersion": "1.0",
            "attributeDefs": [
                {
                    "name": "inputs",
                    "typeName": "array<DataSet>",
                    "cardinality": "SINGLE",
                    "isIndexable": false,
                    "isOptional": true,
                    "isUnique": false
                },
                {
                    "name": "outputs",
                    "typeName": "array<DataSet>",
                    "cardinality": "SINGLE",
                    "isIndexable": false,
                    "isOptional": true,
                    "isUnique": false
                }
            ]
        }
relationshipDef: defines a relationship between two entities. 

 


Prebuilt Models

The Atlas build includes some pre-built types that are located in addons/model.  This directory includes a number of JSON files.  These JSON files are loaded in numerical order.   Once the files in addons/model are added then the files in addons/model/patches are loaded, again in numerical order.

 

 

Note: ATLAS-1768 - Create common types for Open Metadata In Progress seeks to add a set of metadata types that will support a comprehensive open metadata and governance capability based on Apache Atlas.  For more information see Building out the Open Metadata Typesystem.


 

 

 

 

 

  • No labels