Get the roles of the schema


#1

In the graql console to get the general elements of the schema (attributes, entities and relationships) the following statement can be used:

match $ x sub thing; get;

What statement can be used to get the roles associated with the relationships and entities that play those roles?


#2

That would be:

test> match $x plays sibling; get;
{$x type person sub entity;}

and

test> match $x relates sibling; get;
{$x type siblings sub relation;}

As a rule of thumb, you can query the schema by using the define statements and replacing what you’re looking for with a variable. For instance, match $x sub entity, has name; get;

At the moment, there is an exception to this rule and that’s using a variable in place of attribute type.