Created 07-23-2016 03:10 PM
Hi all,
I want to create the hierarchy of tags in atlas?
Is it possible in apache altas?
If possible then how can we implement it?
Below example will explain you the things,which i am looking for?
consider, there are 4 tags(medical,personal,drugs,PII)
Medical-parent tag
Personal-person_name,person_id
Drugs-drugs_name,drugs_code
PII-ssn
In front of every tag i have given the names of column of hive table, and those are assigned to each tag respectively.
Now i want to assign PII,drugs,personal tag to one and only medical tag as parent of all.
One last question,
What is attribute column, when we create a tag by using atlas ui?
And how to use that or what is it's concern with tag?
Please provide me link for above question
Created 07-26-2016 07:37 PM
You can let tags (traits) inherit from other tags just like class types can inherit from other class types (class types are what entities are based on). So you would define The Medical tag:
{ "enumTypes": [], "structTypes": [], "traitTypes": [ { "superTypes": [], "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType", "typeName": "Medical", "typeDescription": "", "attributeDefinitions": [] } ], "classTypes": [] } }
Then define the child tags with Medical as the SuperType:
{ "enumTypes": [], "structTypes": [], "traitTypes": [ { "superTypes": ["Medical"], "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType", "typeName": "Person", "typeDescription": "", "attributeDefinitions": [] }, { "superTypes": ["Medical"], "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType", "typeName": "Drugs", "typeDescription": "", "attributeDefinitions": [] }, { "superTypes": ["Medical"], "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType", "typeName": "PII", "typeDescription": "", "attributeDefinitions": [] } ], "classTypes": [] } }
Now when you assign PII, Drugs, or Person tag to an entity like field, it will also inherit the Medical tag and it's associated attributes. To answer your second question, tag attributes can be defined during assignment time to define some value related to the tag. Let's say you wanted to not only apply the Drug tag but also define the drug name for that patient. You could add a DrugName attribute to the Drug traitType (UI or API). When you go to assign the Drug tag to a patient in the UI, you will also be able to define the attributes that are defined as part of the tag. So in this case, you would assign the Drug tag and then click define attribute and enter the value "Asprin" or something like that.
Created 07-26-2016 07:37 PM
You can let tags (traits) inherit from other tags just like class types can inherit from other class types (class types are what entities are based on). So you would define The Medical tag:
{ "enumTypes": [], "structTypes": [], "traitTypes": [ { "superTypes": [], "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType", "typeName": "Medical", "typeDescription": "", "attributeDefinitions": [] } ], "classTypes": [] } }
Then define the child tags with Medical as the SuperType:
{ "enumTypes": [], "structTypes": [], "traitTypes": [ { "superTypes": ["Medical"], "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType", "typeName": "Person", "typeDescription": "", "attributeDefinitions": [] }, { "superTypes": ["Medical"], "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType", "typeName": "Drugs", "typeDescription": "", "attributeDefinitions": [] }, { "superTypes": ["Medical"], "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType", "typeName": "PII", "typeDescription": "", "attributeDefinitions": [] } ], "classTypes": [] } }
Now when you assign PII, Drugs, or Person tag to an entity like field, it will also inherit the Medical tag and it's associated attributes. To answer your second question, tag attributes can be defined during assignment time to define some value related to the tag. Let's say you wanted to not only apply the Drug tag but also define the drug name for that patient. You could add a DrugName attribute to the Drug traitType (UI or API). When you go to assign the Drug tag to a patient in the UI, you will also be able to define the attributes that are defined as part of the tag. So in this case, you would assign the Drug tag and then click define attribute and enter the value "Asprin" or something like that.
Created 07-29-2016 04:30 AM
Thank you Vadim,
I was expecting same thing,to have parent and child relation between tags.
Could you send me the link which explains about tag attribute and tag hierarchical concepts.
Created 07-29-2016 05:46 PM
The best official explanation is not very detailed.
http://atlas.incubator.apache.org/TypeSystem.html
It's basically just:
### Traits is similar to scala - traits more like decorators (?) - traits get applied to instances - not classes - this satisfies the classification mechanism (ish) - can have a class instance have any number of traits - e.g. security clearance - any Person class could have it; so we add it as a mixin to the Person class - security clearance trait has a level attribute - traits are labels - each label can have its own attribute - reason for doing this is: - modeled security clearance trait - want to prescribe it to other things, too - can now search for anything that has security clearance level = 1, for instance
### On Instances: - class, trait, struct all have bags of attributes - can get name of type associated with attribute - can get or set the attribute in that bag for each instance
If this answers your question, would you mind accepting the answer? Also, I provided answers to many of the other questions you asked over the last couple of weeks. Could you check the answers and accept if they were helpful or let me know what else I can clarify? I want to make sure I answered your questions. Thanks in advance.