javeme commented on code in PR #1866:
URL:
https://github.com/apache/incubator-hugegraph/pull/1866#discussion_r867929918
##########
hugegraph-api/src/main/java/com/baidu/hugegraph/api/gremlin/CypherAPI.java:
##########
@@ -62,7 +62,7 @@ private Response queryByCypher(String graph,
"The cypher parameter can't be null or empty");
String gremlin = this.translateCpyher2Gremlin(graph, cypher);
- LOG.debug("translated gremlin is {}", gremlin);
+ LOG.info("translated gremlin is {}", gremlin);
Review Comment:
keep debug level
##########
hugegraph-api/src/main/java/com/baidu/hugegraph/api/gremlin/CypherAPI.java:
##########
@@ -79,9 +79,13 @@ private String translateCpyher2Gremlin(String graph, String
cypher) {
}
private String buildQueryableGremlin(String graph, String gremlin) {
+ // init g by graph name
Review Comment:
can use `aliases` to bind `g`:
https://hugegraph.apache.org/docs/clients/restful-api/gremlin/
##########
hugegraph-api/src/main/java/com/baidu/hugegraph/api/gremlin/CypherAPI.java:
##########
@@ -79,9 +79,13 @@ private String translateCpyher2Gremlin(String graph, String
cypher) {
}
private String buildQueryableGremlin(String graph, String gremlin) {
+ // init g by graph name
gremlin = "g = " + graph + ".traversal()\n" + gremlin;
- // hg not support single
+ // CREATE (a:person { name : "test", age: 20, city: "Hefei" }) return a
+ // translate to :
Review Comment:
xx would be translated to: xx, but hugegraph don't support
`.property(single, k, v)`, so we replace it to `.property(k, v)` here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]