Querying on predicate by UID

Hi @mrjn,

Actually what I’m trying to do in general is build a richer schema on top of dgraph. The schema will have classes, properties (object is a literal), and relations (object is a uid). The schema will be modified by an admin through an application front-end, and each class (and property and relation) will have a UID in dgraph. Users, through normal activity, will then be creating and modifying entities, all of which have a class. In this case, the class “Person” is identified by UID <0xd59531fa5ba5372b>. I am building an API on top of Dgraph that modifies and accesses all of these entities in a simplified way, and the API endpoint “/entity/get/listByClass” will take in the UID of a class and return all entities with that class.

Rather than returning all of the entities with the same class as that person, I would like to return all entities with the class with UID <0xd59531fa5ba5372b>. Similar to your answer, but as the input I have available the class UID, not the person UID. I have defined a predicate called “Class” using the dgraph schema syntax, so I was hoping I could use that “Class” predicate I have defined to directly find all entities that exist in a triple: “[Entity] [Class] [UID from API]”

Does this help answer your question? Please let me know if I can clarify further. And as always, thanks for all of your help and what you guys are doing at Dgraph.