diff --git a/docs-2.0-en/3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md b/docs-2.0-en/3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md index 790f0877559..65515487ef5 100644 --- a/docs-2.0-en/3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md +++ b/docs-2.0-en/3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md @@ -2,11 +2,14 @@ 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 recommend to use keywords in schema. If you must use keywords in schema: +It is not recommended to use keywords to identify schemas. If you must use keywords as identifiers, pay attention to the following restrictions: -- Non-reserved keywords can be used as identifiers without quotes if they are all in lowercase. However, if a non-reserved keyword contains any uppercase letters when used as an identifier, it must be enclosed in backticks (\`), for example, \`Comment\`. +- 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 special characters or reserved keywords as identifiers, quote them with backticks such as `AND`. +- 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 (\`). !!! Note @@ -61,13 +64,14 @@ EDGE EDGES EXISTS EXPLAIN +FALSE FETCH FIND FIXED_STRING FLOAT FLUSH -FORMAT FROM +GEOGRAPHY GET GO GRANT @@ -85,7 +89,8 @@ INT64 INT8 INTERSECT IS -LIMIT +JOIN +LEFT LIST LOOKUP MAP @@ -93,16 +98,14 @@ MATCH MINUS NO NOT -NOT_IN NULL OF -OFFSET ON OR ORDER OVER OVERWRITE -PROFILE +PATH PROP REBUILD RECOVER @@ -123,7 +126,9 @@ TAGS TIME TIMESTAMP TO +TRUE UNION +UNWIND UPDATE UPSERT UPTO @@ -142,13 +147,18 @@ YIELD ```ngql ACCOUNT ADMIN +AGENT ALL +ALLSHORTESTPATHS +ANALYZER ANY ATOMIC_EDGE AUTO +BASIC BIDIRECT BOTH CHARSET +CLEAR CLIENTS COLLATE COLLATION @@ -158,16 +168,19 @@ CONTAINS DATA DBA DEFAULT +DIVIDE +DRAINER +DRAINERS ELASTICSEARCH ELSE END ENDS -ENDS_WITH -FALSE +ES_QUERY FORCE +FORMAT FULLTEXT -FUZZY GOD +GRANTS GRAPH GROUP GROUPS @@ -175,45 +188,52 @@ GUEST HDFS HOST HOSTS +HTTP +HTTPS INTO -IS_EMPTY -IS_NOT_EMPTY -IS_NOT_NULL -IS_NULL +IP JOB JOBS KILL LEADER +LIMIT +LINESTRING LISTENER +LOCAL +MERGE META +NEW NOLOOP NONE -NOT_CONTAINS -NOT_ENDS_WITH -NOT_STARTS_WITH +OFFSET OPTIONAL OUT PART PARTITION_NUM PARTS PASSWORD -PATH PLAN -PREFIX +POINT +POLYGON +PROFILE QUERIES QUERY +READ REDUCE -REGEXP +RENAME REPLICA_FACTOR RESET ROLE ROLES +S2_MAX_CELLS +S2_MAX_LEVEL SAMPLE SEARCH SERVICE SESSION SESSIONS SHORTEST +SHORTESTPATH SIGN SINGLE SKIP @@ -222,26 +242,26 @@ SNAPSHOTS SPACE SPACES STARTS -STARTS_WITH STATS STATUS STORAGE SUBGRAPH +SYNC TEXT TEXT_SEARCH THEN TOP -TRUE TTL_COL TTL_DURATION -UNWIND USER USERS UUID VALUE VALUES +VARIABLES VID_TYPE -WILDCARD +WHITELIST +WRITE ZONE ZONES ``` diff --git a/docs-2.0-zh/3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md b/docs-2.0-zh/3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md index dd0663ad256..7b90b85b383 100644 --- a/docs-2.0-zh/3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md +++ b/docs-2.0-zh/3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md @@ -5,11 +5,12 @@ 不建议在创建 Schema 时使用关键字。如果必须使用关键字,请注意一下规则: -- 关键字不区分大小写。 +- 使用保留关键字或特殊字符作为标识符时,必须用反引号(\`)包围,例如 \`AND\`。否则会创建失败。 -- 当非保留关键字均为小写字母时,如果将其作为标识符时可以不使用引号;当非保留关键字包含大写字母时并将其作为标识符时,需要用反引号(\`)包围,例如 \`Comment\`。 +- 使用非保留关键字作为标识符时: -- 保留关键字或特殊字符作为标识符时,需要用反引号(\`)包围,例如 \`AND\`。 + - 若其包含大写字母,必须用反引号(\`)包围,例如 \`Comment\`。否则,虽然能创建成功,系统会自动将标识符转化为全小写字母,也即 \`comment\`。 + - 若其为全小写字母,可以不使用反引号(\`)包围。 ```ngql @@ -63,13 +64,14 @@ EDGE EDGES EXISTS EXPLAIN +FALSE FETCH FIND FIXED_STRING FLOAT FLUSH -FORMAT FROM +GEOGRAPHY GET GO GRANT @@ -87,7 +89,8 @@ INT64 INT8 INTERSECT IS -LIMIT +JOIN +LEFT LIST LOOKUP MAP @@ -95,16 +98,14 @@ MATCH MINUS NO NOT -NOT_IN NULL OF -OFFSET ON OR ORDER OVER OVERWRITE -PROFILE +PATH PROP REBUILD RECOVER @@ -125,7 +126,9 @@ TAGS TIME TIMESTAMP TO +TRUE UNION +UNWIND UPDATE UPSERT UPTO @@ -147,13 +150,18 @@ YIELD ```ngql ACCOUNT ADMIN +AGENT ALL +ALLSHORTESTPATHS +ANALYZER ANY ATOMIC_EDGE AUTO +BASIC BIDIRECT BOTH CHARSET +CLEAR CLIENTS COLLATE COLLATION @@ -163,16 +171,19 @@ CONTAINS DATA DBA DEFAULT +DIVIDE +DRAINER +DRAINERS ELASTICSEARCH ELSE END ENDS -ENDS_WITH -FALSE +ES_QUERY FORCE +FORMAT FULLTEXT -FUZZY GOD +GRANTS GRAPH GROUP GROUPS @@ -180,45 +191,52 @@ GUEST HDFS HOST HOSTS +HTTP +HTTPS INTO -IS_EMPTY -IS_NOT_EMPTY -IS_NOT_NULL -IS_NULL +IP JOB JOBS KILL LEADER +LIMIT +LINESTRING LISTENER +LOCAL +MERGE META +NEW NOLOOP NONE -NOT_CONTAINS -NOT_ENDS_WITH -NOT_STARTS_WITH +OFFSET OPTIONAL OUT PART PARTITION_NUM PARTS PASSWORD -PATH PLAN -PREFIX +POINT +POLYGON +PROFILE QUERIES QUERY +READ REDUCE -REGEXP +RENAME REPLICA_FACTOR RESET ROLE ROLES +S2_MAX_CELLS +S2_MAX_LEVEL SAMPLE SEARCH SERVICE SESSION SESSIONS SHORTEST +SHORTESTPATH SIGN SINGLE SKIP @@ -227,26 +245,26 @@ SNAPSHOTS SPACE SPACES STARTS -STARTS_WITH STATS STATUS STORAGE SUBGRAPH +SYNC TEXT TEXT_SEARCH THEN TOP -TRUE TTL_COL TTL_DURATION -UNWIND USER USERS UUID VALUE VALUES +VARIABLES VID_TYPE -WILDCARD +WHITELIST +WRITE ZONE ZONES ```