Closed bangsun closed 4 years ago
in addtion , the CypherOpProcessor already config as below:
- { className: org.opencypher.gremlin.server.op.cypher.CypherOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }}
After survery, it may caused by explain can't use when connect as
gremlin> :remote connect opencypher.gremlin conf/remote-objects.yaml translate gremlin+cfog_server_extensions
gremlin> :> explain match(n) return substring(n.value,0,2) limit 1;
org.opencypher.gremlin.translation.exception.SyntaxException: Custom functions and predicates are not supported on target implementation: cypherSubstring. Consider installing Extensions to Gremlin to enable full support for Cypher functionality: https://github.com/opencypher/cypher-for-gremlin/tree/master/tinkerpop/cypher-gremlin-extensions
when using below it works:
gremlin> :remote connect opencypher.gremlin conf/remote-objects.yaml
gremlin> :> explain match(n) return substring(n.value,0,2) limit 1;
==>[translation:g.V().project('substring(n.value,0,2)').by(__.project(' GENERATED1', ' GENERATED2', ' GENERATED3').by(__.choose(neq(' cypher.null'), __.choose(__.values('value'), __.values('value'), __.constant(' cypher.null')))).by(__.constant(0)).by(__.constant(2)).select(values).map(cypherSubstring())).limit(1),options:[EXPLAIN]]
Hello @bangsun,
According to description it looks like plugin versions in console and server does not match.
Please clarify which version of console plugin are you using? (ls ext/cypher-gremlin-console-plugin/lib/cypher-gremlin-console-plugin-*.jar
from console root directory)
@dwitry
ls ext/cypher-gremlin-console-plugin/lib/cypher-gremlin-console-plugin-*.jar
ext/cypher-gremlin-console-plugin/lib/cypher-gremlin-console-plugin-1.0.3.jar
I've test a successful result,with following key conf point:
1.staticImports: ['org.opencypher.gremlin.traversal.CustomPredicates.*','org.opencypher.gremlin.traversal.CustomFunctions.*'],
2.org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math,org.opencypher.gremlin.traversal.CustomFunctions,org.opencypher.gremlin.traversal.CustomPredicate], methodImports: [java.lang.Math#*,org.opencypher.gremlin.traversal.CustomFunctions#*,org.opencypher.gremlin.traversal.CustomPredicate#*]},
3.- { className: org.opencypher.gremlin.server.op.cypher.CypherOpProcessor }
but the second point may miss in the docs.
Hello @bangsun,
thank you very much for pointing out gap in the documentation. I've updated it (#333)
In v0.9.12 cypher-gremlin-extensions works well,I can use toInteger function well, but when upgrade to v1.0.3(janusgraph 0.4.0) and config according to docs, it fails. Steps:
and the gremlin-server.yaml:
when check the class above ,I found the 'process' not exist,so the right classpath is
org.opencypher.gremlin.traversal.CustomPredicates.*,org.opencypher.gremlin.traversal.CustomFunctions.*
? but failed again when correct that way. so I wonder anything wrong or miss conf?