func writeJSONToService(service annotations.Service, pathToJSONFile string, contentUUID string, assert *assert.Assertions) { f, err := os.Open(pathToJSONFile) assert.NoError(err) dec := json.NewDecoder(f) annotation, errr := service.DecodeJSON(dec) assert.NoError(errr) errrr := service.Write(contentUUID, annotation) assert.NoError(errrr) }
func deleteAllViaService(db neoutils.CypherRunner, assert *assert.Assertions, annotationsRW annotations.Service) { _, err := annotationsRW.Delete(contentUUID) assert.Nil(err) qs := []*neoism.CypherQuery{ { Statement: fmt.Sprintf("MATCH (c:Thing {uuid: '%v'})-[rel]-(o) DELETE c, rel ", contentUUID), }, { Statement: fmt.Sprintf("MATCH (c:Thing {uuid: '%v'}) DELETE c ", contentUUID), }, } err = db.CypherBatch(qs) assert.NoError(err) }