Hello Patrik,
> Hi gang!
>
> What I see in the above example is an artificial relation COCITE,
> derived from the pattern WROTE, CITES, WROTE^-1. It is this relation we
> would like to traverse, correct?
> In that case, instead of traversing the graph normally by calling
> Node.getRelationships(), could we ask the user to supply an object with
> a corresponding method getRelationships(node,direction) ? This method
> would in that case traverse the pattern (WROTE, CITES, WROTE^-1) and
> return the result as a number of fake/artificial relationships. The
> important questions I can think of:
>
> 1. Is this a good sollution? Are there cases it cannot handle?
> (This was after all a simple example)
There are things that the simple model above and the model cited below can
not support.
Rodriguez, M.A., “Grammar-Based Random Walkers in Semantic Networks”,
Knowledge-Based Systems, in press, ISSN: 0950-7051, Elsevier,
doi:10.1016/j.knosys.2008.03.030, LA-UR-06-7791, March 2008.
http://www.soe.ucsc.edu/~okram/papers/random-grammar.pdf
walker = traverser
grammar = program for the walker to execute (e.g. WROTE, CITES, WROTE^-1)
While you can design grammars for moving through a multi-relational
network in complex ways, the limitation is that it is not Turing complete
and thus, there will ultimately be a computation that can not be done that
the developer will want to do. It is the opinion of myself that the
Traverser framework of Neo should be an interface only and it is up to the
developer to make the functional mapping from current vertex to next
vertex. E.g. --- sometimes you may want to teleport to some non-adjacent
vertex, sometimes if two traverses are at the same vertex they should
influence each other in some way, sometimes the path of one traverser
should determine the path of another, sometimes a traverser should have a
probabilistic choice, sometimes the traverser should have a decaying
energy value, etc. There are algorithms out there (and near to general
user needs) that the current Neo Traverser model can not efficiently
solve.
However, it is nice to have a package that developers can use without
having to implement graph algorithms themselves. The technique I would use
for this would be to develop a grammar parser and a grammar executor,
where more primitives can be added to the grammar to support more complex
computations into the future--or can be user defined to support the
computations they need. In short, every traverser (i.e. a walker) is
imbued with a program (i.e. a grammar) that tells it how to behave in the
graph and what result to return...
Take care,
Marko.
_______________________________________________
Neo mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user