Search code examples
vaticle-typeqlvaticle-typedb

Finding All Resources In Grakn


I have created the following simple schema:

insert
name sub resource datatype string;
id sub resource datatype string;
person sub entity has name has id;

and data:

insert
$x isa person has name "Bob" has id bob;

How can I get all the resources I have attached to an entity? Do I have to iterate over all of them?


Solution

  • You can get all the resources by querying the root resource like so:

    match $x has resource $y;