Hello Team, 1. I want to know, how to associate di...
# ingestion
r
Hello Team, 1. I want to know, how to associate different glossary terms to different datasets ??. Currently i was able to achieve it on the UI by manually assigning them. But i would like to know is there any other automated option/emitter's or API's for achieving that. Please can anyone help me or provide me an example if available for reference. Thank you.
m
Hi @rough-eye-60206, seems like we missed your message earlier. I'll have to take a look and get back to you on this.
r
Sure. Thank you @miniature-tiger-96062
b
I happen to be watching a nice video demo of this at the moment:

https://www.youtube.com/watch?v=3joZINi3ti4

m
Hi @rough-eye-60206, The graphql api would be the way to go to associate a term to a dataset. A general introduction to how to call graphql APIs can be found here - https://datahubproject.io/docs/api/graphql/getting-started For associating a term to dataset you can use the follwing mutation and input -
Copy code
mutation addTerm($input: TermAssociationInput!) {
  addTerm(input: $input)
}

{
    "input": {
        "termUrn": "urn:li:glossaryTerm:AccountBalance",
        "resourceUrn": "urn:li:dataset:(urn:li:dataPlatform:hive,SampleHiveDataset,PROD)"
    }
}
Also, just to keep in mind, if you run into permissio issues, you may want to grand yourself a policy to update metadata for datasets. This can be done from the policies tab, of datahub.
r
Thank you for the quick response@miniature-tiger-96062. That would be helpful. Sure, i have already gone through the policies documentation. I will make sure of it.