Hi Tom, I've wrestled a bit in this area, too, in the context of partitioning a metamodel subgraph. As you mention, the current state of affairs is that nodes can be subset members of an arbitrary number of named node subsets, but there is currently no way to (optionally) consider a "path-wise" containment semantic that would allow you to have subsets within subsets.
My "wish list" is for Neo4j to have good predictable behavior in handling the kind of use case that you describe, but in addition, support a "path/containment" semantic such as "period.delimited.labels" that would be interpreted as individual labels but with the added meaning of subset containment, e.g. (fido :Animal.Dog.Beagle). With something like this, we could do regex selections to mix and match stuff within various subset-nested collections of nodes, etc. I can imagine that this would be useful to others. But in my case, I know it would be helpful to organize and use a metamodel subgraph that has both structural and process partitions. -: Jim :- On Wednesday, December 3, 2014 8:21:12 AM UTC-6, Tom Zeppenfeldt wrote: > > I have a usecase in which certain actions should only be triggered for > specific nodetypes. a nodetype is defined by a *combination* of labels. > > The nodetypes for which an "action" should take place is given by a nested > collection of label combinations by something like [["a", > "b"],["a","d","e"]] . There has to be a exact match, so a node with only > label "a" or " b", or a node with :a:b:x should not match. > > Now the problem arises when I want to compare the labels(n) with this > collection, because ["a", "b"] is different from ["a", "b"] , and there > seems to be not a specific order in which labels are returned. > > The only way I got this working is this > > match (n) > WHERE > (ALL (l in labels(n) WHERE l in ['a','b']) AND LENGTH(labels(n))=2) > OR > (ALL (l in labels(n) WHERE l in ['a','d','e']) AND LENGTH(labels(n))=3) > return n.name > > > If there was a way to predict the order of the labels , i would do this > > > match (n) > WHERE > REDUCE(acc = '', p IN labels(n)| acc + p + ' ') IN ['a b ','a d e > '] > return n.name > > > Or is there another way? > > Best, > > Tom > -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.