T
TypeDB3mo ago
kenho811

< Escape keyword? >

< Escape keyword? >
4 Replies
kenho811
kenho811OP3mo ago
So I have an attribute called role . I suppose that it is a keyword. When I run
define
attribute role value string;
define
attribute role value string;
I got this error
## Running>
define
attribute role value string;


## Timestamp> 2025-07-01T13:04:34.552Z

## Result> Error

[TQL0] [TQL03] TypeQL Error: There is a syntax error
parsing error: expected identifier
Near 2:10:
define
--> attribute role value string;
^
Caused: Error in usage of TypeQL.
[TSV7] Query parsing failed.
[HSR16] Transaction error.
## Running>
define
attribute role value string;


## Timestamp> 2025-07-01T13:04:34.552Z

## Result> Error

[TQL0] [TQL03] TypeQL Error: There is a syntax error
parsing error: expected identifier
Near 2:10:
define
--> attribute role value string;
^
Caused: Error in usage of TypeQL.
[TSV7] Query parsing failed.
[HSR16] Transaction error.
Is there a way to use a keyword as an attribute's/entity/relation's identifier? I tried adding double quotes, single quotes, backticks, but it still does not work
No description
Joshua
Joshua3mo ago
we tend to use underscore role_
kenho811
kenho811OP3mo ago
thanks. let me try
Joshua
Joshua3mo ago
it's not as neat, since it actually changes the name, but yeah there's no way to "escape" a type

Did you find this page helpful?