Skip to content

Commit

Permalink
Correct format for keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisChen2023 committed Nov 1, 2023
1 parent 5e83687 commit 5aa61f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Keywords

Keywords in nGQL are words with particular meanings, such as `CREATE` and `TAG` in the `CREATE TAG` statement. Keywords that require special processing to be used as identifiers are referred to as `reserved keywords`, while the part of keywords that can be used directly as identifiers are called `non-reserved keywords`."
Keywords in nGQL are words with particular meanings, such as `CREATE` and `TAG` in the `CREATE TAG` statement. Keywords that require special processing to be used as identifiers are referred to as `reserved keywords`, while the part of keywords that can be used directly as identifiers are called `non-reserved keywords`.

It is not recommended to use keywords to identify schemas. If you must use keywords as identifiers, pay attention to the following restrictions:

- To use reserved keywords or special characters as identifiers, you must enclose them with backticks (\`), such as \`AND\`. Otherwise, a syntax error is thrown.

- To use non-reserved keywords as identifiers:

- If the identifier contains any uppercase letter, you must enclose them with backticks (\`), such as \`Comment\`. Otherwise, the execution succeeds but the system automatically converts the identifier to all lowercase.
- If the identifier contains all lowercase letters, you do not need to enclose them with backticks (\`).
- If the identifier contains any uppercase letter, you must enclose them with backticks (\`), such as \`Comment\`. Otherwise, the execution succeeds but the system automatically converts the identifier to all lowercase.
- If the identifier contains all lowercase letters, you do not need to enclose them with backticks (\`).

!!! Note

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

不建议在创建 Schema 时使用关键字。如果必须使用关键字,请注意一下规则:

- 使用保留关键字或特殊字符作为标识符时,必须用反引号(\`)包围,例如 \`AND\`否则会创建失败
- 使用保留关键字或特殊字符作为标识符时,必须用反引号(\`)包围,例如 \`AND\`否则,会返回语义错误,创建失败

- 使用非保留关键字作为标识符时:

- 若其包含大写字母,必须用反引号(\`)包围,例如 \`Comment\`。否则,虽然能创建成功,系统会自动将标识符转化为全小写字母,也即 \`comment\`
- 若其为全小写字母,可以不使用反引号(\`)包围。
- 若其包含大写字母,必须用反引号(\`)包围,例如 \`Comment\`。否则,虽然能创建成功,系统会自动将标识符转化为全小写字母,也即 \`comment\`
- 若其为全小写字母,可以不使用反引号(\`)包围。


```ngql
Expand Down

0 comments on commit 5aa61f4

Please sign in to comment.