[
https://issues.apache.org/jira/browse/ATLAS-3546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16989445#comment-16989445
]
charles shen commented on ATLAS-3546:
-------------------------------------
Thanks [~madhan]!
For the first scenario, the case is that we couldn't guarantee the creation
order so we would like to "create if not exist" for rdbms_db when creating
rdbms_table, so we always include the full properties of rdbms_db as referred
entities when crating each rdbms_table. I will take a look whether
[ATLAS-3405|https://issues.apache.org/jira/browse/ATLAS-3405] is a good
candidate to resolve this case. Thanks for the information.
For the second scenario, I use two concrete examples below to explain in detail:
# XML schema
One xs:schema can contain several xs:element and one xs:element can
contain a xs:sequence where a xs:sequence can contain several xs:element. Below
is a simple graph to express this relationship.
!xml.jpg!
It's natural that when XML schema is deleted, all the XML elements under it
should be deleted, when the XML element is deleted, all the XML elements under
it should be deleted as well. To have this cascade deleting capability, I have
to define composition relationship between xs:schema and xs:element and between
xs:sequence and xs:element. But one specific xs:element should have one and
only parent xs:schema or xs:sequence, but from the ATLAS composition
relationship constraint, I have to provide both xs:schema and xs:sequence which
is not valid.
2. Json Schema
One Json document can contain several Json properties while one Json property
can contain several Json properties. See below graph:
!json.jpg!
It's natural that when one Json property is deleted, all the Json properties
under it should be deleted. To have this capability, I have to define
composition relationship between jsonProperty and jsonProperty. Then it always
requires the mandatory attribute where it's the same type and then falls into
infinite loop.
> isOptional for composition relationship category?
> -------------------------------------------------
>
> Key: ATLAS-3546
> URL: https://issues.apache.org/jira/browse/ATLAS-3546
> Project: Atlas
> Issue Type: Improvement
> Components: atlas-core
> Affects Versions: 2.0.0
> Reporter: charles shen
> Priority: Major
> Attachments: json.jpg, xml.jpg, xml.jpg
>
>
> I noticed since
> [ATLAS-3051|https://issues.apache.org/jira/browse/ATLAS-3051], the
> relationship attribute must be specified in the end def which is not
> container and relationship category is composition.
> I understand it's to prohibit orphan children but is it too strong? Reason
> below:
> # I have to provide all the entities along the relationship path in the
> payload when creating a child, eg, for RDBMS, I have to provide
> rdbms_instance, rdbms_db, rdbms_table, rdbms_column where I just want to
> create a single rdbms_column, it brings performance overhead to check
> existence of rdbms_instance, rdbms_db, etc...,
> # I have defined a composition relationship type where each end is the same
> entity type, it couldn't be created successfully anymore since it always
> requires the mandatory attribute where it's the same type and then falls into
> infinite loop.
> Three possible fixes:
> # Remove the isOptional constraint, since ownedRef/inverseRef doesn't have
> such constraint.
> # Add isOptional to relationship type end def.
> # Add option in Rest to ignore the isOptional constraint for relationship
> type.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)