You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@atlas.apache.org by Frank Lu <fr...@gmail.com> on 2021/02/03 04:05:28 UTC

Hierarchical term with key-value

Hello, experts,

We are facing an issue that needs to organize our term in a hierarchical
way. Understood that we can organize them in glossary/category/term, but
our requirement asks for each level can be assigned to an entity, in
addition, we also need to include key-value pairs for each term.

I try to use multiple level classification to mimic the Glossary hierarchy.
However, is there a way to get a list of key-values? Use an example, say we
have level1 classification, its attribute level1_name has 10 different
values, for each level1_name value, we can have a level2 classification,
level2_name also might have 10 different values, and each may correspond to
a level3 classification. As of now, I don't see any way to get all possible
values for level1_name. Please advise.

Not sure my solution to this problem is on the right track, or we have
better way to solve this?

Thanks,
*Frank*

>
>

Re: Hierarchical term with key-value

Posted by Keval Bhatt <kb...@apache.org>.
Hi,

The term is always 1 level and category is nested. so when you make
getGlossary API call you will get all the terms and first level of a
category with respect to the glossary.

In order to create tree when user click on the category, we make get
category API
https://github.com/apache/atlas/blob/master/dashboardv3/public/js/views/glossary/GlossaryLayoutView.js#L232


On Thu, Feb 4, 2021 at 2:50 AM Frank Lu <fr...@gmail.com> wrote:

> Thanks, Kaval.
>
> Yes, indeed the classification way most likely will not work.
>
> I am going along with glossary/term approach.
>
> Additional question on how the glossary/category tree is built in the UI.
> As I looked over the glossary REST API call, all categories returned as an
> array no matter what level in the hierarchy. It seems atlas UI build tree
> while read from array? or any API I missed can help to build such tree?
>
> Thanks,
>
> Frank
>
>
> On Tue, Feb 2, 2021 at 10:45 PM Keval Bhatt <kb...@apache.org> wrote:
>
>> Short answer There is no way which will give you all the attributes
>> key-value in one API call.
>>
>> I think classification is not the correct way for your use case and how
>> you are using level2 classification as the value of level1 classification?
>>
>> Can you share the screenshot?
>>
>> I think what you can do to solve this problem.
>>
>> Create the hierarchy using glossary and term then you can search for the
>> entities which have associated terms and from that entity instance, you can
>> get the custom key-value. (user-defined property) or the classification key
>> value.
>>
>> Same for classification if you want to get all the attributes value then
>> you need to traverse all the entities and get what all information you want
>> and store it in your obj.
>>
>> One more thing you can do if you know the last classification
>> (sub-classification) then you will get all the parent attributes in it
>> because of propagation.
>>
>> I might be wrong but as per my understanding, I have provided the
>> solution.
>>
>> On Wed, Feb 3, 2021, 09:35 Frank Lu <fr...@gmail.com> wrote:
>>
>>> Hello, experts,
>>>
>>> We are facing an issue that needs to organize our term in a hierarchical
>>> way. Understood that we can organize them in glossary/category/term, but
>>> our requirement asks for each level can be assigned to an entity, in
>>> addition, we also need to include key-value pairs for each term.
>>>
>>> I try to use multiple level classification to mimic the Glossary
>>> hierarchy. However, is there a way to get a list of key-values? Use an
>>> example, say we have level1 classification, its attribute level1_name has
>>> 10 different values, for each level1_name value, we can have a level2
>>> classification, level2_name also might have 10 different values, and each
>>> may correspond to a level3 classification. As of now, I don't see any way
>>> to get all possible values for level1_name. Please advise.
>>>
>>> Not sure my solution to this problem is on the right track, or we have
>>> better way to solve this?
>>>
>>> Thanks,
>>> *Frank*
>>>
>>>>
>>>>

Re: Hierarchical term with key-value

Posted by Frank Lu <fr...@gmail.com>.
Thanks, Kaval.

Yes, indeed the classification way most likely will not work.

I am going along with glossary/term approach.

Additional question on how the glossary/category tree is built in the UI.
As I looked over the glossary REST API call, all categories returned as an
array no matter what level in the hierarchy. It seems atlas UI build tree
while read from array? or any API I missed can help to build such tree?

Thanks,

Frank


On Tue, Feb 2, 2021 at 10:45 PM Keval Bhatt <kb...@apache.org> wrote:

> Short answer There is no way which will give you all the attributes
> key-value in one API call.
>
> I think classification is not the correct way for your use case and how
> you are using level2 classification as the value of level1 classification?
>
> Can you share the screenshot?
>
> I think what you can do to solve this problem.
>
> Create the hierarchy using glossary and term then you can search for the
> entities which have associated terms and from that entity instance, you can
> get the custom key-value. (user-defined property) or the classification key
> value.
>
> Same for classification if you want to get all the attributes value then
> you need to traverse all the entities and get what all information you want
> and store it in your obj.
>
> One more thing you can do if you know the last classification
> (sub-classification) then you will get all the parent attributes in it
> because of propagation.
>
> I might be wrong but as per my understanding, I have provided the solution.
>
> On Wed, Feb 3, 2021, 09:35 Frank Lu <fr...@gmail.com> wrote:
>
>> Hello, experts,
>>
>> We are facing an issue that needs to organize our term in a hierarchical
>> way. Understood that we can organize them in glossary/category/term, but
>> our requirement asks for each level can be assigned to an entity, in
>> addition, we also need to include key-value pairs for each term.
>>
>> I try to use multiple level classification to mimic the Glossary
>> hierarchy. However, is there a way to get a list of key-values? Use an
>> example, say we have level1 classification, its attribute level1_name has
>> 10 different values, for each level1_name value, we can have a level2
>> classification, level2_name also might have 10 different values, and each
>> may correspond to a level3 classification. As of now, I don't see any way
>> to get all possible values for level1_name. Please advise.
>>
>> Not sure my solution to this problem is on the right track, or we have
>> better way to solve this?
>>
>> Thanks,
>> *Frank*
>>
>>>
>>>

Re: Hierarchical term with key-value

Posted by Keval Bhatt <kb...@apache.org>.
Short answer There is no way which will give you all the attributes
key-value in one API call.

I think classification is not the correct way for your use case and how you
are using level2 classification as the value of level1 classification?

Can you share the screenshot?

I think what you can do to solve this problem.

Create the hierarchy using glossary and term then you can search for the
entities which have associated terms and from that entity instance, you can
get the custom key-value. (user-defined property) or the classification key
value.

Same for classification if you want to get all the attributes value then
you need to traverse all the entities and get what all information you want
and store it in your obj.

One more thing you can do if you know the last classification
(sub-classification) then you will get all the parent attributes in it
because of propagation.

I might be wrong but as per my understanding, I have provided the solution.

On Wed, Feb 3, 2021, 09:35 Frank Lu <fr...@gmail.com> wrote:

> Hello, experts,
>
> We are facing an issue that needs to organize our term in a hierarchical
> way. Understood that we can organize them in glossary/category/term, but
> our requirement asks for each level can be assigned to an entity, in
> addition, we also need to include key-value pairs for each term.
>
> I try to use multiple level classification to mimic the Glossary
> hierarchy. However, is there a way to get a list of key-values? Use an
> example, say we have level1 classification, its attribute level1_name has
> 10 different values, for each level1_name value, we can have a level2
> classification, level2_name also might have 10 different values, and each
> may correspond to a level3 classification. As of now, I don't see any way
> to get all possible values for level1_name. Please advise.
>
> Not sure my solution to this problem is on the right track, or we have
> better way to solve this?
>
> Thanks,
> *Frank*
>
>>
>>