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

Nagaraj Janardhana commented on ATLAS-2928:
-------------------------------------------

[~madhan.neethiraj] There are couple of interesting scenarios where 
Relationship-attribute names overlaps with entity attribute names.
 # By setting the relationship attribute it is also available as an entity 
attribute (atleast for end1). Hence the value is available both as a property 
and relationship. Hence there is no need to set/maintain values 2 times, 
instead the system takes care of maintaining it.
 # In the underlying graph store there is only one relationship between the 2 
entites and things are simpler, instead of 2 if which would be the case if 
attribute names (relationship and entity) are different.

The one caveat i see is the behavior is different for end2, in case 
relationship attribute name and entity attribute name being same then entity 
attribute is always null. 

Not sure if the existing beahvior is intentional but it is interesting as it 
might be useful to have relationship attribute map to an entity attribute as 
well in cases.

> Namespace entity relationship-attribute names to avoid conflict with entity 
> attributes
> --------------------------------------------------------------------------------------
>
>                 Key: ATLAS-2928
>                 URL: https://issues.apache.org/jira/browse/ATLAS-2928
>             Project: Atlas
>          Issue Type: Bug
>          Components:  atlas-core
>    Affects Versions: 1.0.0, 1.1.0
>            Reporter: Madhan Neethiraj
>            Priority: Critical
>             Fix For: 2.0.0, 1.2.0
>
>
> Apache Atlas 1.0 introduced relationships as first-class types. A 
> relationship effectively 'injects' an attribute on the entities at each end. 
> For example, assignment of a glossary term to an entity is captured by 
> relationship AtlasGlossarySemanticAssignment (in 
> 0000-Area0/0011-glossary_model.json). This relationship adds following 
> attributes:
> - Referceable.meanings: set<AtlasGlossaryTerm>
> - AtlasGlossaryTerm.assignedEntities: set<Referenceable>
> This works fine as long as the entity-types involved in the relationship, or 
> their sub-types don't have an attribute with the same name as the attribute 
> injected by the relationships. Once such instance was reported by [~bolke], 
> about relationship attribute DataSet.schema introduced by 
> avro_schema_associatedEntities - which conflicts with spark_table.schema, 
> since spark_table type is a sub-type of DataSet.
> Such name conflicts can be avoided by prefixing relationship-attribute names 
> with a prefix like "r:".



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

Reply via email to