Reltio Connect

 View Only
  • 1.  How do you return a branch of the hierarchy in an API call?

    Founding Member
    Posted 05-03-2021 16:00
    How do you return a branch of the hierarchy in an API call? For example, if a branch has 5 levels, I'd like to pass the lower level URI and get back the entire tree level 1, level 2, level 3, level 4, level 5 just like you see it provided in the UI hierarchy facet. Example see below A33275 reports to A13264 reports to C20182. I'd like to get that in 1 trees API call. Similarly, is it possible to filter HOPS and TREE calls?

    ------------------------------
    Sandro Palleschi
    Manager - Enterprise Data Services at Empire Life
    Empire Life
    ------------------------------


  • 2.  RE: How do you return a branch of the hierarchy in an API call?

    Reltio Employee
    Posted 05-04-2021 08:04
    Hi Sandro,

    You may use _tree API to fetch the entire hierarchy tree for a given graphType. The API requires initial EntityID as an input,  and in the response you'll get entity's parent, the parent's children, the parent's parent and so on...

    You can specify which attributes should be returned and also filter on the activeness_date (equivalent to effective date) in the UI.

    See below the sample API request

    GET {{tenantURL}}/entities/01cmZvB/_tree?graphTypeURIs=configuration/graphTypes/CompanyHierarchy&select=uri&activeness_date=1620109462460​


    Please let me know if you need any other information about this API.



    ------------------------------
    Thanks,
    Snehil Kamal
    Solution Architect
    Reltio
    Bangalore
    ------------------------------



  • 3.  RE: How do you return a branch of the hierarchy in an API call?

    Founding Member
    Posted 05-05-2021 08:42
    Thank you @Snehil Kamal.  I've done that but I was hoping I could filter this, somehow, to just get the parent(s) of a given branch instead of all the children at each level.

    i.e. We have a commissionable hierarchy.  Advisor 1 reports to Advisor 2 reports to Advisor 3 reports to Advisor 4.  4 level hierarchy.
    My use case is parents only.  Advisor 1's parent i.e. Advisor 2; followed by Advisor 2's parent i.e. Advisor 3, followed by Advisor 3's parent i.e. Advisor 4.

    Any advice there?​

    ------------------------------
    Sandro Palleschi
    Manager - Enterprise Data Services at Empire Life
    Empire Life
    ------------------------------



  • 4.  RE: How do you return a branch of the hierarchy in an API call?

    Reltio Employee
    Posted 05-05-2021 09:29
    Hi Sandro,

    You may try using _parents API to fetch only the parents of a given node. This is equivalent to Hierarchy Path view in the UI

    Sample API request below:

    GET {{tenantURL}}/entities/1tVcgTVn/_parents?graphTypeURIs=configuration/graphTypes/CompanyHierarchy&select=uri​


    And below is the sample response. The entities block lists all the parents in the upward hierarchy

    {
        "parentPaths": [
            [
                {
                    "entityUri": "entities/1tVcgTVn"
                },
                {
                    "entityUri": "entities/1FKqwAbJ",
                    "relationsUris": [
                        "relations/z4H6Ots"
                    ]
                },
                {
                    "entityUri": "entities/1hZTMzyY",
                    "relationsUris": [
                        "relations/cma7XM1",
                        "relations/1MiGvFJG"
                    ],
                    "hasSelfRelation": true
                }
            ]
        ],
        "entities": {
            "entities/1hZTMzyY": {
                "uri": "entities/1hZTMzyY",
                "type": "configuration/entityTypes/HCO"
            },
            "entities/1FKqwAbJ": {
                "uri": "entities/1FKqwAbJ",
                "type": "configuration/entityTypes/HCO"
            },
            "entities/1tVcgTVn": {
                "uri": "entities/1tVcgTVn",
                "type": "configuration/entityTypes/HCO"
            }
        },
        "relations": {
            "relations/z4H6Ots": {
                "uri": "relations/z4H6Ots",
                "type": "configuration/relationTypes/Subsidiary",
                "direction": "directed"
            },
            "relations/cma7XM1": {
                "uri": "relations/cma7XM1",
                "type": "configuration/relationTypes/Subsidiary",
                "direction": "directed"
            },
            "relations/1MiGvFJG": {
                "uri": "relations/1MiGvFJG",
                "type": "configuration/relationTypes/Subsidiary",
                "direction": "directed"
            }
        }
    }


    I hope this would be suitable for your usecase.



    ------------------------------
    Thanks,
    Snehil Kamal
    Solution Architect
    Reltio
    Bangalore
    ------------------------------



  • 5.  RE: How do you return a branch of the hierarchy in an API call?

    Founding Member
    Posted 05-07-2021 08:51
      |   view attached
    Thanks for you feedback Snehil.  Here is what I'm really trying to do and avoid all the extra information that is coming from the _tree call.
    Check the attachment:

    As you'll see I want to start with the URI for
    A30525.  I want to return it's children (you would think it would be parent but it seems backwards when you look at the Hierarchy View)
    Direct children are A10116 and D71040.

    I don't want parent of parents and children of children because it's massive and returns over 20,000 lines. 
    I just want to return what you see in the hierarchy view (along with the details of each entity)
    D71040  A10116   A30525

    In addition I may want to return the top of the hierarchy (or bottom in this case) i.e. D71040.


    ------------------------------
    Sandro Palleschi
    Manager - Enterprise Data Services at Empire Life
    Empire Life
    ------------------------------

    Attachment(s)

    pdf
    Hierarchy Example (1).pdf   7 KB 1 version