You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Avi Levi <av...@gmail.com> on 2016/12/28 12:15:42 UTC

searching for entities with tags by name

Hi

According to the documentation, searching for entities that are
associated to tags is done using the search/dsl api:

http://<atlas­server­host:port>/ api/atlas/
discovery/search/dsl?query= %60tag-name%60

in the documentation the response contains one instance in the
results, but when I execute the api call, I get two instances in the
results, one of them
is the actual entity that I've tagged, and the other one is an object
of type Taxonomy.

can anyone explain this behavior ?

thanks

Re: searching for entities with tags by name

Posted by David Radley <da...@uk.ibm.com>.
Hi Avi,
If you have a term that has available_as_tag set then I would expect the 
taxonomy object to be tagged as internally the taxonomy object is an 
entity. You have tagged an entity as well. I suspect this search is 
returning both of these entities. I think this is a bit confusing - I 
suggest raising a Jira to make the API cleaner to not return glossary 
entities in this case,    all the best, David. 

 
 



From:   Avi Levi <av...@gmail.com>
To:     dev@atlas.incubator.apache.org
Date:   28/12/2016 12:16
Subject:        searching for entities with tags by name



Hi

According to the documentation, searching for entities that are
associated to tags is done using the search/dsl api:

http://<atlas­server­host:port>/ api/atlas/
discovery/search/dsl?query= %60tag-name%60

in the documentation the response contains one instance in the
results, but when I execute the api call, I get two instances in the
results, one of them
is the actual entity that I've tagged, and the other one is an object
of type Taxonomy.

can anyone explain this behavior ?

thanks




Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Re: searching for entities with tags by name

Posted by Hemanth Yamijala <hy...@hortonworks.com>.
Hi,

I suspect the tag you searched for is a business term under a taxonomy, and not a regular tag. If yes, this behavior can be explained.

It is a by-product of how business terms are implemented today. AFAIK, they are implemented as traits. For regular traits (or tags), new instances are created whenever they are associated with an entity. However, terms are 'singleton' traits, i.e only one instance is created and this is looked up and associated with entities whenever the term association happens. The singleton instance is attached to the 'Taxonomy' instance by the Business Taxonomy implementation as a way of easily looking it up when required for association.

The side effect of this, is that when we search for a business term - because it is a tag, the search API gets both objects (the actual association and the implicit Taxonomy object association) in the results.

You must not see this behavior for regular tags.

Thanks
Hemanth
________________________________________
From: Avi Levi <av...@gmail.com>
Sent: Wednesday, December 28, 2016 5:45 PM
To: dev@atlas.incubator.apache.org
Subject: searching for entities with tags by name

Hi

According to the documentation, searching for entities that are
associated to tags is done using the search/dsl api:

http://<atlas­server­host:port>/ api/atlas/
discovery/search/dsl?query= %60tag-name%60

in the documentation the response contains one instance in the
results, but when I execute the api call, I get two instances in the
results, one of them
is the actual entity that I've tagged, and the other one is an object
of type Taxonomy.

can anyone explain this behavior ?

thanks