def node_add_record(header, content, record): check_in_record("Label", record) check_not_in_record("Id", record) check_not_in_content("node", "Label", record["Label"], content) record_add("Id", str(next_id(content)), record) content.append(record) check_no_stragglers(record, header)
def node_del_record(nheader, ncontent, eheader, econtent, label): record = get_record("Label", label, ncontent) check_in_record("Label", record) check_not_in_content("edge", "Source", label, econtent) check_not_in_content("edge", "Target", label, econtent) ncontent.remove(record)