For the contribution relationship, we want to add a property that will save the relationship when these contributions happen; let's call it contribution_date. This can also be achieved in neomodel using StructuredRel:
class ContributedTo(StructuredRel):
contribution_date = DateTimeField(required=True)
This class can be used to create the required relationship in the model class:
class User(StructuredNode):
# ... same as above
contributed_repositories = RelationshipTo("Repository", "CONTRIBUTED_TO", model=ContributedTo)
class Repository(StructuredNode):
# ... same as above
contributors = RelationshipFrom(User, "CONTRIBUTED_TO", model=ContributedTo
With a relationship model, we can filter patterns by relationship properties using the math method. For instance, the following query returns users contributing to the hogan repository after May 5, 2020, at 3 p.m.:
Repository.nodes.get().contributors.match...