AtlasRelationshipDef Data Type

AtlasRelationshipDef is a TypeDef that defines a relationship.

As with other typeDefs the AtlasRelationshipDef has a name. Once created the RelationshipDef has a guid. The name and the guid are the 2 ways that the RelationshipDef is identified.

RelationshipDefs have 2 ends, each of which specify cardinality, an EntityDef type name and name and optionally whether the end is a container.

RelationshipDefs can have AttributeDefs - though only primitive types are allowed.
RelationshipDefs have a relationshipCategory specifying the UML type of relationship required
RelationshipDefs also have a PropogateTag - indicating which way tags could flow over the relationships.

The way EntityDefs and RelationshipDefs are intended to be used is that EntityDefs will define AttributeDefs these AttributeDefs will not specify an EntityDef type name as their types.

RelationshipDefs introduce new attributes to the entity instances. For example

EntityDef A might have attributes attr1,attr2,attr3
EntityDef B might have attributes attr4,attr5,attr6
RelationshipDef AtoB might define 2 ends

   end1:  type A, name attr7
   end2:  type B, name attr8  

When an instance of EntityDef A is created, it will have attributes attr1,attr2,attr3,attr7
When an instance of EntityDef B is created, it will have attributes attr4,attr5,attr6,attr8

In this way relationshipDefs can be authored separately from entityDefs and can inject relationship attributes into the entity instances

Properties
name data type description
endDef1 AtlasRelationshipEndDef
endDef2 AtlasRelationshipEndDef
propagateTags PropagateTags
relationshipCategory RelationshipCategory
relationshipLabel string
Properties inherited from AtlasStructDef
attributeDefs array of AtlasAttributeDef
Properties inherited from AtlasBaseTypeDef
category TypeCategory
createTime number
createdBy string
dateFormatter DateFormat
description string
guid string
name string
options map of string
serviceType string
typeVersion string
updateTime number
updatedBy string
version number

Example

{
  "endDef1" : {
    "cardinality" : "SET",
    "description" : "...",
    "isContainer" : true,
    "isLegacyAttribute" : true,
    "name" : "...",
    "type" : "..."
  },
  "endDef2" : {
    "cardinality" : "SET",
    "description" : "...",
    "isContainer" : true,
    "isLegacyAttribute" : true,
    "name" : "...",
    "type" : "..."
  },
  "propagateTags" : "BOTH",
  "relationshipCategory" : "COMPOSITION",
  "relationshipLabel" : "...",
  "attributeDefs" : [ {
    "cardinality" : "SINGLE",
    "constraints" : [ {
      "params" : {
        "property1" : { },
        "property2" : { }
      },
      "type" : "..."
    }, {
      "params" : {
        "property1" : { },
        "property2" : { }
      },
      "type" : "..."
    } ],
    "defaultValue" : "...",
    "description" : "...",
    "displayName" : "...",
    "includeInNotification" : true,
    "indexType" : "DEFAULT",
    "isIndexable" : true,
    "isOptional" : true,
    "isUnique" : true,
    "name" : "...",
    "options" : {
      "property1" : "...",
      "property2" : "..."
    },
    "searchWeight" : 12345,
    "typeName" : "...",
    "valuesMaxCount" : 12345,
    "valuesMinCount" : 12345
  }, {
    "cardinality" : "SET",
    "constraints" : [ {
      "params" : {
        "property1" : { },
        "property2" : { }
      },
      "type" : "..."
    }, {
      "params" : {
        "property1" : { },
        "property2" : { }
      },
      "type" : "..."
    } ],
    "defaultValue" : "...",
    "description" : "...",
    "displayName" : "...",
    "includeInNotification" : true,
    "indexType" : "STRING",
    "isIndexable" : true,
    "isOptional" : true,
    "isUnique" : true,
    "name" : "...",
    "options" : {
      "property1" : "...",
      "property2" : "..."
    },
    "searchWeight" : 12345,
    "typeName" : "...",
    "valuesMaxCount" : 12345,
    "valuesMinCount" : 12345
  } ],
  "category" : "CLASSIFICATION",
  "createTime" : 12345,
  "createdBy" : "...",
  "dateFormatter" : {
    "availableLocales" : [ "...", "..." ],
    "calendar" : 12345,
    "dateInstance" : { },
    "dateTimeInstance" : { },
    "instance" : { },
    "lenient" : true,
    "numberFormat" : {
      "availableLocales" : [ "...", "..." ],
      "currency" : "...",
      "currencyInstance" : { },
      "groupingUsed" : true,
      "instance" : { },
      "integerInstance" : { },
      "maximumFractionDigits" : 12345,
      "maximumIntegerDigits" : 12345,
      "minimumFractionDigits" : 12345,
      "minimumIntegerDigits" : 12345,
      "numberInstance" : { },
      "parseIntegerOnly" : true,
      "percentInstance" : { },
      "roundingMode" : "HALF_EVEN"
    },
    "timeInstance" : { },
    "timeZone" : {
      "DSTSavings" : 12345,
      "ID" : "...",
      "availableIDs" : [ "...", "..." ],
      "default" : { },
      "displayName" : "...",
      "rawOffset" : 12345
    }
  },
  "description" : "...",
  "guid" : "...",
  "name" : "...",
  "options" : {
    "property1" : "...",
    "property2" : "..."
  },
  "serviceType" : "...",
  "typeVersion" : "...",
  "updateTime" : 12345,
  "updatedBy" : "...",
  "version" : 12345
}