Skip to content

Commit

Permalink
Ignore deletes that do not match.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenVerborgh committed Feb 6, 2019
1 parent 2421d66 commit c24c038
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,18 @@ class IndexedFormula extends Formula { // IN future - allow pass array of statem
return sts[0]
}
})
if (bad.length) {
// console.log('Could not find to delete ' + bad.length + 'statements')
// console.log('despite ' + targetKB.statementsMatching(bad[0].subject, bad[0].predicate)[0])
return patchCallback('Could not find to delete: ' + bad.join('\n or '))
if (!bad.length) {
ds2.forEach(function (st) {
targetKB.remove(st)
})
}
ds2.map(function (st) {
targetKB.remove(st)
})
}
if (patch['insert']) {
// log.info("doPatch insert "+patch['insert'])
ds = patch['insert']
if (binding) ds = ds.substitute(binding)
ds = ds.statements
ds.map(function (st) {
ds.forEach(function (st) {
st.why = target
targetKB.add(st.subject, st.predicate, st.object, st.why)
})
Expand Down

0 comments on commit c24c038

Please sign in to comment.