任意のノードから開始して、タイプとして「contentpage」を持つノードに到達するまでトラバーサーを実行します(すべてのノードにはタイププロパティがあります)。
私は次のトラバーサーでそれを試しました
{
"order":"depth first",
"uniqueness" : "node global",
"relationships":[
{"type":"CONTAINS","direction":"in"},
{"type":"HAS","direction":"in"}
],
"prune evaluator":{"language":"javascript","body":"position.endNode().getProperty('type')!='contentpage';"},
"max depth":10000000
}
しかし、私が得るのはHTTPエラー500だけです。何かアイデアはありますか?
編集:これがスタックトレースです(巨大だったので少しトリミングしました)
Problem accessing /db/data/node/782350/traverse/node. Reason:
javax.script.ScriptException: sun.org.mozilla.javascript.WrappedException: Wrapped org.neo4j.graphdb.NotFoundException: type property not found for NodeImpl#782348. (<Unknown Source>#1) in <Unknown Source> at line number 1
Caused by:
org.neo4j.server.rest.domain.EvaluationException: javax.script.ScriptException: sun.org.mozilla.javascript.WrappedException: Wrapped org.neo4j.graphdb.NotFoundException: type property not found for NodeImpl#782348. (<Unknown Source>#1) in <Unknown Source> at line number 1
at org.neo4j.server.rest.domain.EvaluatorFactory$CompiledScriptExecutor.eval(EvaluatorFactory.java:183)
at org.neo4j.server.rest.domain.EvaluatorFactory$ScriptedPruneEvaluator.pruneAfter(EvaluatorFactory.java:241)
at org.neo4j.kernel.impl.traversal.TraversalDescriptionImpl$WrappedPruneEvaluator.evaluate(TraversalDescriptionImpl.java:239)
at org.neo4j.kernel.impl.traversal.MultiEvaluator.evaluate(MultiEvaluator.java:41)
at org.neo4j.kernel.impl.traversal.TraversalBranchImpl.initialize(TraversalBranchImpl.java:93)
at org.neo4j.kernel.impl.traversal.TraversalBranchImpl.next(TraversalBranchImpl.java:112)
at org.neo4j.kernel.impl.traversal.StartNodeTraversalBranch.next(StartNodeTraversalBranch.java:50)
at org.neo4j.kernel.PreorderDepthFirstSelector.next(PreorderDepthFirstSelector.java:48)
at org.neo4j.kernel.impl.traversal.TraverserImpl$TraverserIterator.fetchNextOrNull(TraverserImpl.java:127)
at org.neo4j.kernel.impl.traversal.TraverserImpl$TraverserIterator.fetchNextOrNull(TraverserImpl.java:94)
at org.neo4j.helpers.collection.PrefetchingIterator.hasNext(PrefetchingIterator.java:55)
at org.neo4j.server.rest.web.DatabaseActions.traverse(DatabaseActions.java:922)
at org.neo4j.server.rest.web.RestfulGraphDatabase.traverse(RestfulGraphDatabase.java:641)
at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)