In my Grakn schema, I am inserting this:
device sub entity,
has type,
plays active-device;
However, when I try to insert this, I get this error:
graql.lang.exception.GraqlException: syntax error at line 72:
has type,
^
no viable alternative at input 'type'
syntax error at line 72:
has type,
^
mismatched input 'type' expecting {'match', 'define', 'undefine', 'insert', 'compute'}
at graql.lang.exception.GraqlException.create(GraqlException.java:54)
at graql.lang.parser.Parser.parseQuery(Parser.java:114)
at graql.lang.parser.Parser.parseQueryListEOF(Parser.java:127)
at graql.lang.Graql.parseList(Graql.java:64)
at grakn.console.ConsoleSession.executeQuery(ConsoleSession.java:206)
at grakn.console.ConsoleSession.load(ConsoleSession.java:132)
at grakn.console.GraknConsole.run(GraknConsole.java:103)
at grakn.console.GraknConsole.main(GraknConsole.java:139)
I don't think I have any syntax errors, why is this throwing an error?
type
is a reserved keyword in Grakn. Whenperson
is defined, and you callmatch $x type person; get;
, a single result is returned: the concept type with labelperson
.Try naming your attribute
device-type
instead.