Marko Rodriguez schrieb am 30.03.2010 um 16:37:31 (-0600): > > outE/outV # confusing way of saying (in XPath) "self::node()" > > inE/inV # ditto > > .I suppose----but once you get to an edge, you need to specify where > you want to go next (the tail or the head of the edge).. ?
Well, edges are binary, so there's one way in and one way out. In the model that seems to be underlying the Gremlin language, you can traverse edges in the direction (if applicable) and also against it. (Well, why not? You can drive into a one-way-street the wrong way even though you aren't supposed to.) Anyway, the point is that the node you're sitting on at the moment is not the one you want to reach by following an edge. So saying inE/inV is like saying: See that edge? Follow it, but don't actually do it - turn back just before reaching the destination. Which doesn't make sense. At least, not to me. Which is why I would simply not allow it. And that would simplify the language. > The outE/V convention would mean you have to know that you did outE > the prior step to infer you mean the head of the edge at the next > step... no? If you follow an edge, you follow it. And following it is an atomic operation. There is no such thing is going out on the edge, testing the water, and then going back home. You follow edges, and you rest at nodes, and only at nodes. At least in my imagination :-) I would actually further simply the language (and at the same time bring it back on the tracks laid out by XPath). Our insight being that a step is always from node via edge to node, I'd simply and lazily adopt the wise decision made by the designers of XPath of introducing axes and adapt that to the graph model. Which means that a step *always* involves an axis, just as in XPath; the difference is that you would define edges as axes: $ctx/o(knows)::*...@name='Michael'] # knows some Michael $ctx/i(knows)::gi...@name='Ioana'] # known by Ioana $ctx/io(knows)::g...@name='Ingo'] # knows Ingo or known by Ingo In XPath, axes don't have a type. But property graph edges do, so the language must provide these. So the axes (which could really just be i, o, and io) may accept an edge type. The :: delimits the axis from the node test and the predicates. Nodes might have a type, just as elements in XML. So you could say "*" to match any vertex node, or say "girl" to match girl nodes :-) True, you need a data model first, that defines some model of a graph, just as XDM defines a model of an XML document as an ordered tree. But thinking about what kind of query you want to be able to express might also guide you in defining the data model. But of course, such a realignment to XPath would both restrict what you can assert about the edge (only direction and type), and would leave the path your implementation has taken. So, your referring to XPath, which I know and hold in high esteem, has got me thinking. All in all I'm not sure how well XPath maps to a reasonable graph model you might come up with, but it's an interesting topic to think about. Best, -- Michael Ludwig _______________________________________________ Neo mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

