I've got a Neo4J database where a node can have multiple labels.
As a toy example, imagine these nodes:
CREATE (a:Parent {name: "Foo"}), (b:Child1:Parent {name: "Bar"}), (c:Child2:Parent {name:"Baz"}), (d:Blue:Child1:Parent {name:"Boz"}), (e:Orange:Child1:Parent {name:"Qwe"}), (f:Blue:Child2:Parent {name:"Asd"}), (g:Orange:Child2:Parent {name: "Zxc"})
In neomodel I can define the following classes:
class Parent(StructuredNode):
name = StringProperty()
class Child1(Parent):
pass
class Child2(Parent):
pass
Using this I can do things like:
Child1.nodes.filter(name="Bar")
and get a result
But if I do Child1.nodes.allI()
I get the following error:
neomodel.exceptions.NodeClassNotDefined: Node with labels Parent,Blue,Child1 does not resolve to any of the known objects
Parent --> <class '__main__.Parent'>
Parent,Child1 --> <class '__main__.Child1'>
Parent,Child2 --> <class '__main__.Child2'>
How do I create a class that can handle the fact that the Blue
label can apply to nodes with several different labels?