[ https://issues.apache.org/jira/browse/ATLAS-1344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15764844#comment-15764844 ]
David Radley edited comment on ATLAS-1344 at 12/20/16 7:19 PM: --------------------------------------------------------------- Hi Madhan, Thank you very much for drawing this to my attention. It seems to me that - iscomposite or foreign key could not be used for a containment hierarchy as the child needs to be optional and iscomposite is not. - I will look into whether using the new class it might be possible to model non composite parent child hierarchies. all the best, David. was (Author: davidrad): Hi Madhan, thank you so much for drawing this to my attention. Some comments/questions: 1) So there are 2 pieces of code that deal with entity attributes, AttributeDefinition and org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef. AtlasAttributeDef Is the idea to change the implementation of AttributeDefinition to call org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef. AtlasAttributeDef? Or to change the callers of AttributeDefinitions to use the new class. I am not sure how the apache-atlas typesystem and the atlas-intg project content sit together as they seem to duplicate functionality. 2) On the renames from "isComposite" and "reverseAttributeName" with "foreignKey" and "mappedFromRef". It seems to me that iscomposite would be a property of the attribute on the parent - referring to the child. If this could not be null I can see why you called it foreign key as they cannot be null - so we cannot model optional multiple children. Also currently the child object must be created along with the parent object. But for parent child, containment hierarchies we need the child to be optional and not created when the parent is. So we need to police updates, adds and deletes. I suspect the current code creates and deletes the iscomposite children with the parent, which is fine for hive tables and columns, but not for our parent child hierarchies. Does this make sense? 3) I have manually implemented the parent child hierarchy in the 1186 - it is not obvious that I can re-use this to model my parent child hierarchy. Have I understood correctly? I have not investigated the code in depth - so could have missed something. all the best, David. > Allow types to be created that support parent child hierarchies. > ---------------------------------------------------------------- > > Key: ATLAS-1344 > URL: https://issues.apache.org/jira/browse/ATLAS-1344 > Project: Atlas > Issue Type: Improvement > Reporter: David Radley > Assignee: David Radley > > enhance the Type system to allow entities to be created in parent child > hierarchies. > I notice that AttributeDefinition currently only support COLLECTION, SET , > OPTIONAL and REQUIRED. There is no collection with a lower bound of 0- which > would be required for a parent child type relationship. > Also it seems to me that it would be ideal to create an attribute with the > guid of the parent / child and then derive the other one from the edge. I may > have misunderstood but reverseAttributeName seems to use the name of the > attribute not the guid. > I suggest that iscomposite true and false is supported. > When we have this in place, we could use this mechanism for Glossary > Categories > > -- This message was sent by Atlassian JIRA (v6.3.4#6332)