Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to define metadata for types without replicating the information across all type instances #330

Open
shreyas1599 opened this issue Apr 10, 2024 · 0 comments

Comments

@shreyas1599
Copy link

Problem to Solve

Support for the ability to store metadata on types. I could do this by creating attributes on the type and then storing the information on the attributes. But since the metadata would be the same across all instances, the information is duplicated and the implementation doesn't make sense. I want to associate the metadata with the type itself.

An example use case for metadata is how I'd like the type (entity/attribute) represented on a User Interface.

For example, I have an entity Entity and which has attributes attribute-name-one, attribute-name-two. And on the UI, where ever Entity is used, I want it to have a displayName of Entity Display Name. Similarly for the attributes attribute-name-one, attribute-name-two. Now I could either scatter this information across the UI, or the more logical way would be to associate it as a metadata on the type itself. Another example on the UI would be that I want to store tooltip information for every type and where ever the types are used in the User Interface I'd like the tooltip information to show up. These are two examples from a User Interface standpoint alone. There are other uses cases too that I have (which I don't want to list here as I'd have to give a lot more context).

Current Workaround

A workaround to create a separate entity type called metadata, one each for attribute, relation, entity and store all the metadata-related information on this special entity - Inspired from advice on the TypeDB Forum.

Proposed Solution

Allow ability to define metadata datapoints on the type itself. Roughly something like below:

define
my-entity sub entity,
owns attribute-one,
metadata data-point-one,
metadata data-point-two;

attribute-one sub attribute,
metadata data-point-three;

and data-point-one, data-point-two, data-point-three are instantiated only once per type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant