You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by "Madhan Neethiraj (JIRA)" <ji...@apache.org> on 2018/11/13 03:59:00 UTC

[jira] [Commented] (ATLAS-2960) Custom attribute inside an Attibute Definition

    [ https://issues.apache.org/jira/browse/ATLAS-2960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16684698#comment-16684698 ] 

Madhan Neethiraj commented on ATLAS-2960:
-----------------------------------------

[~myselfmayur] - the attribute definition structure you listed is of earlier version. Starting with Atlas version 0.8, attribute definition is captured by [AtlasStructDef.AtlasAttributeDef|https://github.com/apache/atlas/blob/master/intg/src/main/java/org/apache/atlas/model/typedef/AtlasStructDef.java#L257]; 'options' field in AtlasAttributeDef can be used to store additional details - like the ones you listed. This field was added in ATLAS-1314.

Here is the V2 equivalent of your attribute definition given in the description above:

{noformat}
{
  "name":        "resourceSetID",
  "typeName":    "int",
  "isOptional":  false,
  "cardinality": "SINGLE",
  "isIndexable": true,
  "options":     {
    "source": "{ \"name\":\"hdfs\", \"originalName\":\"ID\" }"
  }
}
{noformat}


Hope this helps.


> Custom attribute inside an Attibute  Definition
> -----------------------------------------------
>
>                 Key: ATLAS-2960
>                 URL: https://issues.apache.org/jira/browse/ATLAS-2960
>             Project: Atlas
>          Issue Type: Wish
>          Components:  atlas-core
>            Reporter: Mayur Maheshwari
>            Priority: Major
>
> How we can add custom attributes while creating a Type using Rest API:
> {
>     "enumTypes": [],
>     "structTypes": [],
>     "traitTypes": [],
>     "classTypes": [{
>         "superTypes": ["Process"],
>         "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.ClassType",
>         "typeName": "ResearchPaperAccessDataset_Process",
>         "typeDescription": null,
>         "attributeDefinitions": [{
>             "name": "resourceSetID",
>             "dataTypeName": "int",
>             "multiplicity": "required",
>             "isComposite": false,
>             "isUnique": false,
>             "isIndexable": true,
>             "reverseAttributeName": null,
>             *"sources":[{*
>                 *"name":"hdfs",*
>                 *"originalName":"ID"*    
>                 *}*
>             *]*
>         },
>         {
>             "name": "researchPaperGroupName",
>             "dataTypeName": "string",
>             "multiplicity": "required",
>             "isComposite": false,
>             "isUnique": false,
>             "isIndexable": true,
>             "reverseAttributeName": null
>         }]
>     }]
> } 
>  
> Wanted to add '*sources*' marked in bold while creating a type.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)