cayleygraph / cayley

An open-source graph database
https://cayley.io
Apache License 2.0
14.8k stars 1.25k forks source link

Failed to remove quad #945

Closed PaulB2Code closed 3 years ago

PaulB2Code commented 3 years ago

We face an issue to remove a quad

printInfo(methodName, id, infos)

store, err := cayley.NewGraph("bolt", dbFile, nil)
if err != nil {
    printError(methodName, "NewGraph", err)
    return "", err
}
defer store.Close()

p := cayley.StartPath(store, quad.IRI(id)).Out(quad.IRI(infos.Field))
err = p.Iterate(nil).EachValue(nil, func(value quad.Value) {

    printInfo(methodName, value)

    t := cayley.NewTransaction()
    t.RemoveQuad(quad.Make(quad.IRI(id), quad.IRI(infos.Field), value, nil))
    err := store.ApplyTransaction(t)
    if err != nil {
        printError(methodName, "applyTrans removeQuad", err)
    }
})

2020/11/26 18:17:27 [INFO] - func : updateREPLACE :: [c4d5fe15-7b0a-4f14-af73-002eb853df50 { quantity 1}] 2020/11/26 18:17:27 [INFO] - func : updateREPLACE :: ["10"^^] 2020/11/26 18:17:27 xxxx[ERROR]xxxx - func : updateREPLACE :: [applyTrans removeQuad delete -- -> "10"^^: quad does not exist]

If we had a new one we arrive to remove it.

Do you have a clue ?

PaulB2Code commented 3 years ago

We had to dumb manually. the database to solved the issue.

We copy all the lines.