Skip to content

Commit

Permalink
Merge pull request #638 from linkeddata/fix/issue#637
Browse files Browse the repository at this point in the history
only remove document content
  • Loading branch information
bourgeoa authored Mar 23, 2024
2 parents 2e8d292 + ee32c0f commit 2d89176
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,12 @@ export default class Fetcher implements CallbackifyInterface {

// Before we parse new data clear old but only on 200
if (options.clearPreviousData) {
kb.removeDocument(options.resource)
// kb.removeDocument(options.resource)
// only remove content, keep metatdata
const sts = kb.statementsMatching(undefined, undefined, undefined, options.resource).slice() // Take a copy as this is the actual index
for (let i = 0; i < sts.length; i++) {
kb.removeStatement(sts[i])
}
}

let isImage = contentType.includes('image/') ||
Expand Down

0 comments on commit 2d89176

Please sign in to comment.