Kieran
Kieran

Reputation: 45

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?

Upvotes: 1

Views: 122

Answers (1)

Filipe Teixeira
Filipe Teixeira

Reputation: 3565

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

match $x has resource $y;

Upvotes: 2

Related Questions