def all_morphisms(self):
results, meta = db.cypher_query(
f"MATCH (X:QuiverNode)-[r:MAPS_TO]->(:QuiverNode)"
f"MATCH (f:QuiverArrow) "
f"WHERE X.uid='{self.uid}' AND f.uid=r.uid "
f"RETURN f")
return [QuiverArrow.inflate(row[0]) for row in results]
def delete(self):
# Delete all the outgoing morphisms first:
db.cypher_query(f"MATCH (X:QuiverNode)-[r:MAPS_TO]->(:QuiverNode)"
f"MATCH (f:QuiverArrow) "
f"WHERE X.uid='{self.uid}' AND f.uid=r.uid DELETE f")
# TODO: see if we need to also delete r here ("DELETE r,f"), or whether the following automatically deletes it:
super().delete()
That's how you do it: a multi-match statement.