Reltio Connect

 View Only
  • 1.  Identifying entities without incoming relations

    Posted 03-16-2022 16:39
    Is there a way using current APIs to identify entities without an incoming relation? 

    Our current model has the concept of an entity type that should have a parent.  That is, entities of that type should have a "parent" node with a relation from the parent to the child entity.  Although we enforce this during creation, there are cases where the child could end up without a parent, such as if a request failed, or the parent was later removed.  I'm wondering if there is a way to identify such orphaned nodes via current APIs.

    One approach might be to utilize an LCA that is triggered on delete of the parent, and check if that would leave an orphaned child.  But, that wouldn't address the identification of existing orphaned nodes prior to the deployment of the LCA.  Alternatively, I could envision a process to export the entities and relations and stitch them together to identify those entities without relations, but that would be a heavier process than I'd like to use now.

    Is anyone aware of a simpler approach using current APIs/capabilities?

    Thanks


  • 2.  RE: Identifying entities without incoming relations

    Reltio Employee
    Posted 03-17-2022 11:49
    @Paul Anderson, thanks for posting. I have reached out to @Prasad Satam to see if he can help answer this question. More to come soon​​


  • 3.  RE: Identifying entities without incoming relations

    Reltio Partner
    Posted 03-18-2022 09:51
    Paul,
    I can think of two approaches. Since you're familiar with the History view and the activities view of an entity, it is clear that any event or process that removed an entity's relation to its parent would be recorded and in theory you could query the history for these events, and then check the entities referenced in these events to see if they indeed are presently missing a relation to a parent. But I think its easier to do what I believe you described which is to export all current entities and relations, then examine each entity to see if it fails to be at the child end of a relation. That should work pretty well and I think you'll find it's not too tedious a program to create.


  • 4.  RE: Identifying entities without incoming relations

    Reltio Employee
    Posted 03-18-2022 12:12
    In general, I like Curt's answer.  Curt knows! :-)

    Another approach might be to create a reference attribute on the 'child' entity called 'parent' using the relationship to populate the value.  Then you would be able to query from the search screen for entities where the 'parent' value does not exist.  minValues/maxValues could be used to ensure that there is only one value.


  • 5.  RE: Identifying entities without incoming relations

    Reltio Partner
    Posted 03-18-2022 12:24
    Gino's idea is quite an innovative one. I like it. And it could be a low-level-of-effort approach. If the relation presently is not a reference, it should be simple to promote it to being a reference, possibly followed by a re-index to reveal through a query as Gino says, the orphans. Interesting.....


  • 6.  RE: Identifying entities without incoming relations

    Posted 03-25-2022 15:59
    Thank you for those suggestions.  Does anyone know if the Graph Search API could assist with this use case once it is available?


  • 7.  RE: Identifying entities without incoming relations

    Reltio Employee
    Posted 04-14-2022 02:23

    Hi Paul - I believe you are looking to build a query which reads like " Give me all the Contacts (in the database) for which no HasParent relationship exists" . The result set should return all the "Contact" type entities ( as example) which are orphan due to some reason.

    We have a plan to support these through graph search in future once it is available.



  • 8.  RE: Identifying entities without incoming relations

    Posted 04-14-2022 16:54
    Thank you, Abhradeep!  I was hoping that would work for this use case.  I guess we'll wait for the graph search API to become available so we can utilize it for this case.