Special characters and reserved fields
Special characters
When you run Gremlin queries in Graph Explore, if the string value of a pkey or skey field contains reserved characters such as ;, :, ", (, ), =, or +, you must URL-encode the field value in the query.
Example 1: Querying for an edge where the pkey value is 'ab;33'
Original query:
g("graphName").E("ab;33").hasLabel("tableName")The correct syntax is:
g("graphName").E("ab%3B33").hasLabel("tableName")
Example 2: Querying for a point where the pkey value is 'user1:user2'
Original query:
g("graphName").V("user1:user2").hasLabel("userName")The correct syntax is:
g("graphName").E("user1%3Auser2").hasLabel("userName")
Example 3: Batch query for points with the pkey values 'user1', 'user2', and 'user3'
Original query:
g("graphName").V("user1;user2;user3").hasLabel("userName"). Batch queries use a semicolon (;) to separate multiple keys.
Note: Do not URL-encode the query because the field values do not contain special characters.
Reserved character | URL-encoded value |
; | %3B |
: | %3A |
" | %22 |
( | %28 |
) | %29 |
= | %3D |
+ | %2B |
Reserved fields
For a label, do not use a function name from an expression as a field name.