Is there a way to add properties to a Glossary Ter...
# advice-data-governance
b
Is there a way to add properties to a Glossary Term via the UI or only via yaml file?
1
a
No, unfortunately you can only add properties through ingestion- either a yaml file or properties on the source
b
thankyou1
a
Hi @astonishing-answer-96712, Is there a future plan to add this feature i.e. adding properties via UI ? Would you recommend to customize the UI to add a buttton "ADD" and utilize graphql apis to insert them to entities ?
a
g
The original question here is not specific as to whether it should be custom properties, or any additional attributes added to the PDL files as new aspects. We intended to use custom properties at first (and contribute this back, because we believe that it's of general interest as suggested by the feature request mentioned above). However, after trying to get some guidance from the project team (see the thread here), we're not so sure about usefullness of this approach with the limitations outlined by Chris Collins there. My attempt to sort out the discovered obstacles for the original approach using the suggested follow-up in the advice-metadata-modelling channel hasn't attracted too much attention so far - see here. Going the other route of new aspects and adding support for them in the UI requires a lot of manual work (as discussed here) at the moment with the current status of PDL support and is far from anything general and/or useful for contributing back. A more general solution would be possible for sure (generation of GraphQL artifacts, Java classes and React code from the PDL files similarly to the existing great support for adoption of PDL defined structures in the REST API layer and ingestion), but it's a rather huge amount of work touching many parts of DataHub and implementing it would take too long for our needs.
a
Hi @gentle-portugal-21014, I’m sorry this has been giving you trouble. Just so I understand- you want the feature developed in a specific way, but it’s too far-reaching to be a feasible community contribution from your side? Is there any way you could capture this into a separate feature request so we’re aware these are two different features?
g
Hi @astonishing-answer-96712, no need to be sorry, it's open-source after all. 🙂 To make our use-case clear: • We need to be able to add/edit additional attributes from UI. • These attributes are not only strings, but also other types (boolean, enum). • Allowing users to edit these other types as strings would be possible from technical point of view, but in reality unusable, because we'd immediately get various unexpected values due to typos, users not remembering the expected values, etc. Potential solutions: 1. Use CustomProperties (existing feature available in the back-end) and add support for editing them in the UI (available in the front-end for e.g. DataSets with some limitations, but not at all for GlossaryTerms). To make this usable (see the third bulletpoint above), we'd need to be able to define a list of expected attributes (as of now, any attribute name is allowed for a new Custom Property) and their data types. I asked where to place such a list, but the received response suggested that this approach might not be supported within the project team and my attempt to discuss this further didn't lead anywhere so far. 2. Define new attributes using one or more new Aspects. Although this solution is documented as being feasible as an extension / "plugin" without messing with the product sources, this "extension" is only supported in the back-end at the moment (i.e. it allows using new attributes in ingestion and in the REST API), but not in the UI, and making the new attributes available in the UI requires very extensive modifications of the product sources, plus the changes need to be performed specifically for each and every individual attribute. Considering that some of these files which need to be modified contain comments like "Maps Pegasus {@link RecordTemplate} objects to objects conforming to the GQL schema. To be replaced by auto-generated mappers implementations", I assume that the current limitation of this solution is actually well known and intended to be removed later. Obviously, I can create a feature request so that this intention isn't forgotten. Is my description clear now?
e
Hey @gentle-portugal-21014 I’m wondering if we should set up a call to discuss this, since your use case is quite comprehensive and there’s a lot here
Would you be open to that?
g
Hi @echoing-airport-49548, sure, thanks, discussing it directly would be useful. We just need to pick a reasonable timeslot because you're probably 9 hours off my timezone if I understand it correctly (and my schedule outside of regular office hours is quite full before Christmas which complicates it little bit). As far as I'm concerned, we could have the call tomorrow at something like 22:30 CET (13:30 PST), or Thursday after 22:00 CET (13:00 PST). I'm afraid that a morning timeslot your time wouldn't be feasible for me before Christmas (but it would be an option for me e.g. on December the 27th or 28th).
e
I could do 13:30 PST Wednesday!
I’ll be on vacation starting Thursday until the New Year so that’s probably the best time
g
Alright, thanks. 🙂 I don't know which communication platform you prefer - shall I setup something in MS Teams and provide the link here, or would you setup something in your preferred platform and give me the link?
e
We can do a Zoom call, I can send you a calendar invite if you can DM me your email
g
You should have the DM now. :-)
@echoing-airport-49548 Looking forward to our call. 🙂 In the meantime, I'll describe another issue we came across while working on this so that you could possibly have a look at this description in advance: We need to add the new aspect and a value of an included attribute during creation of a new glossary term. We have tried to look on the datahub-web-react code and it seems that we should enhance current data type CreateGlossaryEntityInput in class glossaryTerm.graphql (datahub-web-react/src/graphql): mutation createGlossaryTerm($input: CreateGlossaryEntityInput!) { createGlossaryTerm(input: $input) } However, we have not found definition of this CreateGlossaryEntityInput type - it exists just in two classes: 1. CreateGlossaryEntityInput (com.linkedin.datahub.graphql.generated) 2. combined.graphql (docs-website/graphql) which are both generated. So our question is - is the data type CreateGlossaryEntityInput the right one to focus on and how to enhance its elements? Second part is regarding the backend - GMS. While we were unlucky with modification of CreateGlossaryEntityInput on the frontend, we tried adding the new aspect in class CreateGlossaryTermResolver (com.linkedin.datahub.graphql.resolvers.glossary): We have modified the class but it seems that the proposal can accommodate just one aspect at the time and adding more aspects destroys the original glossary term info information (like term name etc.).
Copy code
final MetadataChangeProposal proposal = new MetadataChangeProposal(); 
          proposal.setEntityKeyAspect(GenericRecordUtils.serializeAspect(key));
     proposal.setEntityType(Constants.GLOSSARY_TERM_ENTITY_NAME);
     proposal.setAspectName(Constants.GLOSSARY_TERM_INFO_ASPECT_NAME);
     proposal.setAspect(GenericRecordUtils.serializeAspect(mapGlossaryTermInfo(input)));
added line:
proposal.setAspectName("glossaryTermTacr");
added line:
proposal.setAspect(GenericRecordUtils.serializeAspect(mapGlossaryTermTacr(input)));
added method:
Copy code
private GlossaryTermTacr mapGlossaryTermTacr(final CreateGlossaryEntityInput input) {
  final GlossaryTermTacr result = new GlossaryTermTacr();
  result.setJeEntita(false);
 
  return result;
 }
When we tried to add more than one apect, it ended with this exception: datahub-gms | 094044.228 [ForkJoinPool.commonPool-worker-11] ERROR c.l.d.g.e.DataHubDataFetcherExceptionHandler:21 - Failed to execute DataFetcher datahub-gms | java.util.concurrent.CompletionException: java.lang.RuntimeException: Failed to create GlossaryTerm with id: null, name: blabla datahub-gms | at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314) datahub-gms | at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319) datahub-gms | at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1702) datahub-gms | at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692) datahub-gms | at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) datahub-gms | at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) datahub-gms | at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) datahub-gms | at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) datahub-gms | at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) datahub-gms | Caused by: java.lang.RuntimeException: Failed to create GlossaryTerm with id: null, name: blabla datahub-gms | at com.linkedin.datahub.graphql.resolvers.glossary.CreateGlossaryTermResolver.lambda$get$0(CreateGlossaryTermResolver.java:86) datahub-gms | at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) datahub-gms | ... 6 common frames omitted datahub-gms | Caused by: org.apache.kafka.common.errors.SerializationException: Error serializing Avro message datahub-gms | Caused by: java.net.UnknownHostException: schema-registry So we would like to understand better how to store the new aspects during creation of a new glossary term and also how to make them editable in frontend to enable updating values of the aspects attributes...