-
Notifications
You must be signed in to change notification settings - Fork 241
Open
Labels
featureDescribes a new featureDescribes a new feature
Description
Feature description
It woulde be nice to add a constraint definition for cases where a node could have one or the other relationship (similar to the OR operator), but not both.
For example, consider the following (dummy) case: a Person can only have one type of pet, either a Dog or a Cat.
class Dog(StructuredNode):
name= StringProperty(required=True)
class Cat(StructuredNode):
name= StringProperty(required=True)
class Person(StructuredNode):
name= StringProperty(required=True)
cat= RelationshipTo('Cat', 'HAS_PET', cardinality=ZeroOrMore)
dog= RelationshipTo('Dog', 'HAS_PET', cardinality=ZeroOrMore)
This is, of course, a simplified example to illustrate the required constraint, without the need for creating an Animal superclass.
Metadata
Metadata
Assignees
Labels
featureDescribes a new featureDescribes a new feature