You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Randheer K <ra...@thoughtworks.com> on 2023/04/18 03:56:42 UTC

Apache Atlas many to many relationship between entities

Hi,
I'm trying to create many to many relationships between two entities, but
I'm getting the below error errorMessage': 'Relationship end is invalid.

> *Expected application but is NULL *

this is the relationship def that I created
{ "name": "subscribe", "typeName": "subscribe", "description": "Client
provided by the application", "category": "RELATIONSHIP", "typeVersion":
"1.0", "relationshipCategory": "ASSOCIATION", "propagateTags": "NONE",
"endDef1": { "name": "application", "type": "client", "cardinality": "SET",
"isContainer": false, "isLegacyAttribute": false }, "endDef2": { "name":
"client", "type": "application", "cardinality": "SET", "isContainer":
false, "isLegacyAttribute": false } }
and this is the json object that i used to create entity,
{ "entity": { "typeName": "service", "attributes": attributes,
"relationshipAttributes": { "application": {"typeName": "application",
"uniqueAttributes": {"id": application_id}} } } }

If anyone has experience with many to many relationships in apache atlas,
please let me know what Im doing wrong.

Thanks

Re: Apache Atlas many to many relationship between entities

Posted by Madhan Neethiraj <ma...@apache.org>.
Randheer,

Looking at the definition of relationship 'subscribe', it requires following types of entities at its ends:
- end1: client
- end2: application

However, the entity you are trying to create (of type 'service'), requires relationship definition with following ends:
- end1: service
- end2: application

Either the relationship definition, or type of entity you are createing needs update to be in sync.

Hope this helps.

Madhan




On 4/17/23, 9:08 PM, "Randheer K" <randheer.k@thoughtworks.com <ma...@thoughtworks.com>> wrote:


Hi,
I'm trying to create many to many relationships between two entities, but
I'm getting the below error errorMessage': 'Relationship end is invalid.


> *Expected application but is NULL *


this is the relationship def that I created
{ "name": "subscribe", "typeName": "subscribe", "description": "Client
provided by the application", "category": "RELATIONSHIP", "typeVersion":
"1.0", "relationshipCategory": "ASSOCIATION", "propagateTags": "NONE",
"endDef1": { "name": "application", "type": "client", "cardinality": "SET",
"isContainer": false, "isLegacyAttribute": false }, "endDef2": { "name":
"client", "type": "application", "cardinality": "SET", "isContainer":
false, "isLegacyAttribute": false } }
and this is the json object that i used to create entity,
{ "entity": { "typeName": "service", "attributes": attributes,
"relationshipAttributes": { "application": {"typeName": "application",
"uniqueAttributes": {"id": application_id}} } } }


If anyone has experience with many to many relationships in apache atlas,
please let me know what Im doing wrong.


Thanks





Re: Apache Atlas many to many relationship between entities

Posted by Madhan Neethiraj <ma...@apache.org>.
Randheer,

Looking at the definition of relationship 'subscribe', it requires following types of entities at its ends:
- end1: client
- end2: application

However, the entity you are trying to create (of type 'service'), requires relationship definition with following ends:
- end1: service
- end2: application

Either the relationship definition, or type of entity you are createing needs update to be in sync.

Hope this helps.

Madhan




On 4/17/23, 9:08 PM, "Randheer K" <randheer.k@thoughtworks.com <ma...@thoughtworks.com>> wrote:


Hi,
I'm trying to create many to many relationships between two entities, but
I'm getting the below error errorMessage': 'Relationship end is invalid.


> *Expected application but is NULL *


this is the relationship def that I created
{ "name": "subscribe", "typeName": "subscribe", "description": "Client
provided by the application", "category": "RELATIONSHIP", "typeVersion":
"1.0", "relationshipCategory": "ASSOCIATION", "propagateTags": "NONE",
"endDef1": { "name": "application", "type": "client", "cardinality": "SET",
"isContainer": false, "isLegacyAttribute": false }, "endDef2": { "name":
"client", "type": "application", "cardinality": "SET", "isContainer":
false, "isLegacyAttribute": false } }
and this is the json object that i used to create entity,
{ "entity": { "typeName": "service", "attributes": attributes,
"relationshipAttributes": { "application": {"typeName": "application",
"uniqueAttributes": {"id": application_id}} } } }


If anyone has experience with many to many relationships in apache atlas,
please let me know what Im doing wrong.


Thanks