gremlin 셸과 비교하여 rexster가 사용자 정의 Gremlin 쿼리를 처리하는 방식이 불일치하는 원인을 확인하려고합니다.사용자 정의 gremlin 단계는 gremlin에서 작동하지만 렉스 스터에서는 작동하지 않습니다.
내가 사용하고 있습니다 :
- rexster - 서버 2.6.0;
- gremlin-groovy-2.5.0;
- orientdb-community-1.7.9;
간단한 계층 구조 트리를 나타내는 그래프의 방향을 지정하기 위해로드했습니다. 각 노드에는 부모를 가리키는 'parent'라는 가장자리가 있습니다. 그것은 DAG입니다.
나는 정의는 다음과 같이 (그 init-scripts를 통해 rexster에로드) 그렘린의 user-defined step :
Gremlin.defineStep('children',
[Vertex, Pipe],
{int depth -> _().out('parent').loop(1)
{it.loops < depth}
{it.object != null}
})
이러한 명령과 함께 rexster 개집에서 명령 줄 놈아 도구를 사용하여, 내가 얻을 다음 그것은 완벽하게 작동, 그것을, 나는 gremlin.sh을 불 경우
gremlin> g.V('type', 'LSNetwork')
==>v[#9:6312]
gremlin> g.V('type', 'LSNetwork').out('parent').out('parent').name
==>Leaf 0
==>Leaf 1
==>Leaf 2
==>Leaf 3
gremlin> g.V('type', 'LSNetwork').children(2)
==>javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: com.tinkerpop.gremlin.groovy.GremlinGroovyPipeline.children() is applicable for argument types: (java.lang.Integer) values: [2]
그러나, 내 그래프에 연결하는 단계를 정의 및 실행 : 오류 (전체 오류 메시지를보고 오른쪽으로 스크롤)
,gremlin> Gremlin.defineStep('children', [Vertex, Pipe], {int depth -> _().out('parent').loop(1){it.loops < depth}{it.object != null}})
==>null
gremlin> sg=new OrientGraph('remote:localhost/scratch')
==>orientgraph[remote:localhost/scratch]
gremlin> sg.V('type','LSNetwork').children(3).name
==>Spine 0
==>Spine 1
==>Leaf 0
==>Leaf 1
==>Leaf 2
==>Leaf 3
(주의 : 이름은 정확하고 내가 예상 한 것입니다.)
왜 내 gremlin 스크립트는 gremlin 콘솔에서 작동하지만 전구/rexster를 통해 작동하지 않습니까?
미리 감사 드리며 도움이 될만한 자료, 통찰력 또는 적절한 문서에 대한 조언을 보내 주시면 감사하겠습니다. 문서에 정의 된 codeveloper
단계의 버전을 사용하는 경우
이것은 주로 문제의 원인 일 수 있습니다. 그러나 init.groovy 스크립트를 성공적으로로드 할 수 없었습니다. 기본 구성 문제가 의심됩니다. 대화를 옮겼습니다 (https://groups.google.com/forum/#!topic/gremlin-users/M6AtxpXicvk). – phonybone