I'm trying to create a graph where multiple node types can have the same type of relationship between them. I have 5 node types; Group (spelled out below), Alias, Software, Technique & Tool. They're all basically set up the same way with the same properties, I'm just leaving them out for readability.
created = DateTimeFormatProperty(default_now=True, format="%Y-%m-%dT%H:%M:%S.%fZ")
description = StringProperty()
ID = StringProperty(index=True)
modified = DateTimeFormatProperty(default_now=True, format="%Y-%m-%dT%H:%M:%S.%fZ")
name = StringProperty(unique_index=True, required=True)
TYPE = StringProperty(index=True, default='review')
version = IntegerProperty(default=5)
#relationships
uses = RelationshipTo('Alias', 'USES')
I'm looking to do something like below where I include a list of all of the possible node types:
uses = RelationshipTo(['Alias', 'Software', 'Technique', 'Tool'], 'USES')
alias = RelationshipTo(['Software', 'Technique', 'Tool'], 'ALIAS')
revoked_by = RelationshipTo(['Alias', 'Software', 'Technique', 'Tool'], 'REVOKED-BY')
Rather than having to spell out each different relationship type for each node:
use_salias = RelationshipTo('Alias', 'USES')
uses_tool = RelationshipTo('Tool', 'USES')
uses_technique = RelationshipTo('Technique', 'USES')
uses_software = RelationshipTo('Software', 'USES')
alias_software = RelationshipTo('Software', 'Alias')
alias_tool = RelationshipTo('Tool', 'Alias')
alias_technique = RelationshipTo('Technique', 'Alias')
rb_alias = RelationshipTo('Alias', 'REVOKED-BY')
rb_tool = RelationshipTo('Tool', 'REVOKED-BY')
rb_technique = RelationshipTo('Technique', 'REVOKED-BY')
rb_software = RelationshipTo('Software', 'REVOKED-BY')