rdflib 2.2.33-3a88bbc3 → 2.2.33-3e2aa53b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/fetcher.js CHANGED
@@ -1716,7 +1716,12 @@ var Fetcher = /*#__PURE__*/function () {
1716
1716
 
1717
1717
  // Before we parse new data clear old but only on 200
1718
1718
  if (options.clearPreviousData) {
1719
- kb.removeDocument(options.resource);
1719
+ // kb.removeDocument(options.resource)
1720
+ // only remove content, keep metatdata
1721
+ var sts = kb.statementsMatching(undefined, undefined, undefined, options.resource).slice(); // Take a copy as this is the actual index
1722
+ for (var i = 0; i < sts.length; i++) {
1723
+ kb.removeStatement(sts[i]);
1724
+ }
1720
1725
  }
1721
1726
  var isImage = contentType.includes('image/') || contentType.includes('application/pdf');
1722
1727
  if (contentType && isImage) {
package/lib/fetcher.js CHANGED
@@ -1722,7 +1722,12 @@ var Fetcher = /*#__PURE__*/function () {
1722
1722
 
1723
1723
  // Before we parse new data clear old but only on 200
1724
1724
  if (options.clearPreviousData) {
1725
- kb.removeDocument(options.resource);
1725
+ // kb.removeDocument(options.resource)
1726
+ // only remove content, keep metatdata
1727
+ var sts = kb.statementsMatching(undefined, undefined, undefined, options.resource).slice(); // Take a copy as this is the actual index
1728
+ for (var i = 0; i < sts.length; i++) {
1729
+ kb.removeStatement(sts[i]);
1730
+ }
1726
1731
  }
1727
1732
  var isImage = contentType.includes('image/') || contentType.includes('application/pdf');
1728
1733
  if (contentType && isImage) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rdflib",
3
3
  "description": "an RDF library for node.js. Suitable for client and server side.",
4
- "version": "2.2.33-3a88bbc3",
4
+ "version": "2.2.33-3e2aa53b",
5
5
  "private": false,
6
6
  "browserslist": [
7
7
  "> 0.5%"
package/src/fetcher.ts CHANGED
@@ -2004,7 +2004,12 @@ export default class Fetcher implements CallbackifyInterface {
2004
2004
 
2005
2005
  // Before we parse new data clear old but only on 200
2006
2006
  if (options.clearPreviousData) {
2007
- kb.removeDocument(options.resource)
2007
+ // kb.removeDocument(options.resource)
2008
+ // only remove content, keep metatdata
2009
+ const sts = kb.statementsMatching(undefined, undefined, undefined, options.resource).slice() // Take a copy as this is the actual index
2010
+ for (let i = 0; i < sts.length; i++) {
2011
+ kb.removeStatement(sts[i])
2012
+ }
2008
2013
  }
2009
2014
 
2010
2015
  let isImage = contentType.includes('image/') ||