Attribute-Value pairs for Predicates

Hi all,
I am new to Dgraph and here is my doubt related to the expressiveness of GraphQL+ -

Let’s say there are two nodes in the graph with uid1 and uid2 and there is an edge (predicate) friend from node with uid1 to node with uid2. Can we attach a key-value pair {'type':<'best'/'good'/'acquaintance'>} to friend predicate.
In short, can we store Attribute-value pairs for predicates in Dgraph and do a filter query based on the attribute(s) of the predicates?
Thank you!

Hi,

I’m new to Dgraph too, but I think that you can use Facets for this purpose.
More information can be found here: https://docs.dgraph.io/query-language/#facets-edge-attributes

1 Like

@aniketshirke You can use facets to assign attribute value pairs for predicates and filter based on them.
https://docs.dgraph.io/query-language/#filtering-on-facets

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.