Mattias Persson schrieb am 30.03.2010 um 16:06:49 (+0200):

> a JSON document describing the traverser, like:
> 
>   { "order": "depth first",
>     "uniquness": "node",
>     "return evaluator":
>        { "language": "javascript",
>          "body": "function shouldReturn( pos ) {...}" },
>     "prune evaluator":
>        { "language": "javascript",
>          "body": "function...." },
>     "relationships": [
>        { "direction": "outgoing",
>          "type": "KNOWS" },
>        { "type": "LOVES" }
>     ],
>     "max depth": 4 }

> Looking at the "prune evaluator" and "return evaluator" it'd be nice
> to define them in some language, f.ex javascript, ruby or python or
> whatever. We're initially thinking of using javax.script.* stuff
> (ScriptEngine) for that, it'd probably be enough, at least to get
> things going.

XSLT, which builds on XPath, works by having the processor traverse the
tree and the user define templates featuring a match pattern. For every
node, the processor dispatches to the best matching template, from where
you can control further processing.

Now those match patterns are a subset of XPath, and rightly so: If the
user were given the full power of XPath, it would easily get horribly
expensive to determine the best matching template for a given node.

Likewise in a graph traversal, wouldn't it be reasonable to only allow
something with restricted expressive and imperative power, like the
match patterns in XSLT?

-- 
Michael Ludwig
_______________________________________________
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to