rdflib 2.2.34-beta → 2.2.34-beta3-e2aa46ee
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/dist/rdflib.min.js +1 -1
- package/dist/rdflib.min.js.map +1 -1
- package/esm/fetcher.js +1 -1
- package/esm/store.js +23 -11
- package/lib/fetcher.js +1 -1
- package/lib/store.d.ts +1 -1
- package/lib/store.js +23 -11
- package/package.json +1 -1
- package/src/fetcher.ts +1 -1
- package/src/store.ts +25 -10
package/esm/fetcher.js
CHANGED
|
@@ -703,7 +703,7 @@ var Fetcher = /*#__PURE__*/function () {
|
|
|
703
703
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
704
704
|
var request = _step.value;
|
|
705
705
|
var _response = kb.any(request, this.ns.link('response'), null, meta);
|
|
706
|
-
if (_response
|
|
706
|
+
if (_response != undefined) {
|
|
707
707
|
// ts
|
|
708
708
|
var quad = kb.statementsMatching(_response, this.ns.link('outOfDate'), true, meta);
|
|
709
709
|
kb.remove(quad);
|
package/esm/store.js
CHANGED
|
@@ -825,7 +825,7 @@ var IndexedFormula = /*#__PURE__*/function (_Formula) {
|
|
|
825
825
|
}
|
|
826
826
|
|
|
827
827
|
/**
|
|
828
|
-
* Removes all statements in a doc, along with the related metadata including request/response
|
|
828
|
+
* Removes all statements in a doc, along with the related metadata including request/response/status
|
|
829
829
|
* @param doc - The document / graph
|
|
830
830
|
*/
|
|
831
831
|
}, {
|
|
@@ -837,32 +837,44 @@ var IndexedFormula = /*#__PURE__*/function (_Formula) {
|
|
|
837
837
|
for (var i = 0; i < sts.length; i++) {
|
|
838
838
|
this.removeStatement(sts[i]);
|
|
839
839
|
}
|
|
840
|
+
this.removeMatches(doc, null, null);
|
|
840
841
|
return this;
|
|
841
842
|
}
|
|
842
843
|
}, {
|
|
843
844
|
key: "removeMetadata",
|
|
844
845
|
value: function removeMetadata(doc) {
|
|
845
846
|
var meta = this.sym('chrome://TheCurrentSession'); // or this.rdfFactory.namedNode('chrome://TheCurrentSession')
|
|
846
|
-
var linkNamespaceURI = 'http://www.w3.org/2007/ont/link#';
|
|
847
|
-
// remove
|
|
847
|
+
var linkNamespaceURI = 'http://www.w3.org/2007/ont/link#';
|
|
848
|
+
// remove status/response/request metadata
|
|
848
849
|
var requests = this.statementsMatching(undefined, this.sym("".concat(linkNamespaceURI, "requestedURI")), this.rdfFactory.literal(doc.value), meta).map(function (st) {
|
|
849
850
|
return st.subject;
|
|
850
851
|
});
|
|
851
852
|
for (var r = 0; r < requests.length; r++) {
|
|
852
853
|
var request = requests[r];
|
|
853
854
|
if (request != undefined) {
|
|
855
|
+
// removeMatches unresolved issue with collection https://github.com/linkeddata/rdflib.js/issues/631
|
|
856
|
+
var sts = void 0;
|
|
857
|
+
// status collection
|
|
858
|
+
var status = this.any(request, this.sym("".concat(linkNamespaceURI, "status")), null, meta);
|
|
859
|
+
if (status != undefined) {
|
|
860
|
+
sts = this.statementsMatching(status, this.sym("".concat(linkNamespaceURI, "status")), null, meta).slice();
|
|
861
|
+
for (var i = 0; i < sts.length; i++) {
|
|
862
|
+
this.removeStatement(sts[i]);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
// response items list
|
|
854
866
|
var response = this.any(request, this.sym("".concat(linkNamespaceURI, "response")), null, meta);
|
|
855
867
|
if (response != undefined) {
|
|
856
|
-
|
|
857
|
-
|
|
868
|
+
sts = this.statementsMatching(response, null, null, meta).slice();
|
|
869
|
+
for (var i = 0; i < sts.length; i++) {
|
|
870
|
+
this.removeStatement(sts[i]);
|
|
871
|
+
}
|
|
858
872
|
}
|
|
859
|
-
//
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
this.removeMatches(status, null, null, meta);
|
|
873
|
+
// request triples
|
|
874
|
+
sts = this.statementsMatching(request, null, null, meta).slice();
|
|
875
|
+
for (var i = 0; i < sts.length; i++) {
|
|
876
|
+
this.removeStatement(sts[i]);
|
|
864
877
|
}
|
|
865
|
-
this.removeMatches(request, null, null, meta);
|
|
866
878
|
}
|
|
867
879
|
}
|
|
868
880
|
this.removeMatches(this.sym(doc.value), null, null, meta); // content-type
|
package/lib/fetcher.js
CHANGED
|
@@ -709,7 +709,7 @@ var Fetcher = /*#__PURE__*/function () {
|
|
|
709
709
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
710
710
|
var request = _step.value;
|
|
711
711
|
var _response = kb.any(request, this.ns.link('response'), null, meta);
|
|
712
|
-
if (_response
|
|
712
|
+
if (_response != undefined) {
|
|
713
713
|
// ts
|
|
714
714
|
var quad = kb.statementsMatching(_response, this.ns.link('outOfDate'), true, meta);
|
|
715
715
|
kb.remove(quad);
|
package/lib/store.d.ts
CHANGED
|
@@ -233,7 +233,7 @@ export default class IndexedFormula extends Formula {
|
|
|
233
233
|
*/
|
|
234
234
|
remove(st: Quad | Quad[]): IndexedFormula;
|
|
235
235
|
/**
|
|
236
|
-
* Removes all statements in a doc, along with the related metadata including request/response
|
|
236
|
+
* Removes all statements in a doc, along with the related metadata including request/response/status
|
|
237
237
|
* @param doc - The document / graph
|
|
238
238
|
*/
|
|
239
239
|
removeDocument(doc: Quad_Graph): IndexedFormula;
|
package/lib/store.js
CHANGED
|
@@ -828,7 +828,7 @@ var IndexedFormula = /*#__PURE__*/function (_Formula) {
|
|
|
828
828
|
}
|
|
829
829
|
|
|
830
830
|
/**
|
|
831
|
-
* Removes all statements in a doc, along with the related metadata including request/response
|
|
831
|
+
* Removes all statements in a doc, along with the related metadata including request/response/status
|
|
832
832
|
* @param doc - The document / graph
|
|
833
833
|
*/
|
|
834
834
|
}, {
|
|
@@ -840,32 +840,44 @@ var IndexedFormula = /*#__PURE__*/function (_Formula) {
|
|
|
840
840
|
for (var i = 0; i < sts.length; i++) {
|
|
841
841
|
this.removeStatement(sts[i]);
|
|
842
842
|
}
|
|
843
|
+
this.removeMatches(doc, null, null);
|
|
843
844
|
return this;
|
|
844
845
|
}
|
|
845
846
|
}, {
|
|
846
847
|
key: "removeMetadata",
|
|
847
848
|
value: function removeMetadata(doc) {
|
|
848
849
|
var meta = this.sym('chrome://TheCurrentSession'); // or this.rdfFactory.namedNode('chrome://TheCurrentSession')
|
|
849
|
-
var linkNamespaceURI = 'http://www.w3.org/2007/ont/link#';
|
|
850
|
-
// remove
|
|
850
|
+
var linkNamespaceURI = 'http://www.w3.org/2007/ont/link#';
|
|
851
|
+
// remove status/response/request metadata
|
|
851
852
|
var requests = this.statementsMatching(undefined, this.sym("".concat(linkNamespaceURI, "requestedURI")), this.rdfFactory.literal(doc.value), meta).map(function (st) {
|
|
852
853
|
return st.subject;
|
|
853
854
|
});
|
|
854
855
|
for (var r = 0; r < requests.length; r++) {
|
|
855
856
|
var request = requests[r];
|
|
856
857
|
if (request != undefined) {
|
|
858
|
+
// removeMatches unresolved issue with collection https://github.com/linkeddata/rdflib.js/issues/631
|
|
859
|
+
var sts = void 0;
|
|
860
|
+
// status collection
|
|
861
|
+
var status = this.any(request, this.sym("".concat(linkNamespaceURI, "status")), null, meta);
|
|
862
|
+
if (status != undefined) {
|
|
863
|
+
sts = this.statementsMatching(status, this.sym("".concat(linkNamespaceURI, "status")), null, meta).slice();
|
|
864
|
+
for (var i = 0; i < sts.length; i++) {
|
|
865
|
+
this.removeStatement(sts[i]);
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
// response items list
|
|
857
869
|
var response = this.any(request, this.sym("".concat(linkNamespaceURI, "response")), null, meta);
|
|
858
870
|
if (response != undefined) {
|
|
859
|
-
|
|
860
|
-
|
|
871
|
+
sts = this.statementsMatching(response, null, null, meta).slice();
|
|
872
|
+
for (var i = 0; i < sts.length; i++) {
|
|
873
|
+
this.removeStatement(sts[i]);
|
|
874
|
+
}
|
|
861
875
|
}
|
|
862
|
-
//
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
this.removeMatches(status, null, null, meta);
|
|
876
|
+
// request triples
|
|
877
|
+
sts = this.statementsMatching(request, null, null, meta).slice();
|
|
878
|
+
for (var i = 0; i < sts.length; i++) {
|
|
879
|
+
this.removeStatement(sts[i]);
|
|
867
880
|
}
|
|
868
|
-
this.removeMatches(request, null, null, meta);
|
|
869
881
|
}
|
|
870
882
|
}
|
|
871
883
|
this.removeMatches(this.sym(doc.value), null, null, meta); // content-type
|
package/package.json
CHANGED
package/src/fetcher.ts
CHANGED
|
@@ -980,7 +980,7 @@ export default class Fetcher implements CallbackifyInterface {
|
|
|
980
980
|
const requests = kb.statementsMatching(undefined, this.ns.link('requestedURI'), kb.sym(docuri), meta).map(st => st.subject)
|
|
981
981
|
for (const request of requests) {
|
|
982
982
|
const response = kb.any(request, this.ns.link('response'), null, meta) as Quad_Subject
|
|
983
|
-
if (response
|
|
983
|
+
if (response != undefined) { // ts
|
|
984
984
|
const quad = kb.statementsMatching(response, this.ns.link('outOfDate'), true as any, meta)
|
|
985
985
|
kb.remove(quad)
|
|
986
986
|
options.force = true
|
package/src/store.ts
CHANGED
|
@@ -871,7 +871,7 @@ export default class IndexedFormula extends Formula { // IN future - allow pass
|
|
|
871
871
|
}
|
|
872
872
|
|
|
873
873
|
/**
|
|
874
|
-
* Removes all statements in a doc, along with the related metadata including request/response
|
|
874
|
+
* Removes all statements in a doc, along with the related metadata including request/response/status
|
|
875
875
|
* @param doc - The document / graph
|
|
876
876
|
*/
|
|
877
877
|
removeDocument(doc: Quad_Graph): IndexedFormula {
|
|
@@ -881,27 +881,42 @@ export default class IndexedFormula extends Formula { // IN future - allow pass
|
|
|
881
881
|
for (var i = 0; i < sts.length; i++) {
|
|
882
882
|
this.removeStatement(sts[i])
|
|
883
883
|
}
|
|
884
|
+
this.removeMatches(doc as Quad_Subject, null, null)
|
|
884
885
|
return this
|
|
885
886
|
}
|
|
886
887
|
|
|
887
888
|
removeMetadata(doc: Quad_Graph): IndexedFormula {
|
|
888
889
|
const meta = this.sym('chrome://TheCurrentSession') // or this.rdfFactory.namedNode('chrome://TheCurrentSession')
|
|
889
|
-
const linkNamespaceURI = 'http://www.w3.org/2007/ont/link#'
|
|
890
|
-
// remove
|
|
890
|
+
const linkNamespaceURI = 'http://www.w3.org/2007/ont/link#'
|
|
891
|
+
// remove status/response/request metadata
|
|
891
892
|
const requests = this.statementsMatching(undefined, this.sym(`${linkNamespaceURI}requestedURI`), this.rdfFactory.literal(doc.value), meta).map(st => st.subject)
|
|
892
893
|
for (var r = 0; r < requests.length; r++) {
|
|
893
894
|
const request = requests[r]
|
|
894
895
|
if (request != undefined) {
|
|
896
|
+
// removeMatches unresolved issue with collection https://github.com/linkeddata/rdflib.js/issues/631
|
|
897
|
+
let sts: Quad[]
|
|
898
|
+
// status collection
|
|
899
|
+
const status = this.any(request, this.sym(`${linkNamespaceURI}status`), null, meta) as Quad_Subject
|
|
900
|
+
if (status != undefined) {
|
|
901
|
+
sts = this.statementsMatching(status, this.sym(`${linkNamespaceURI}status`), null, meta).slice()
|
|
902
|
+
for (var i = 0; i < sts.length; i++) {
|
|
903
|
+
this.removeStatement(sts[i])
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
// response items list
|
|
895
907
|
const response = this.any(request, this.sym(`${linkNamespaceURI}response`), null, meta) as Quad_Subject
|
|
896
|
-
if (response != undefined) {
|
|
897
|
-
this.
|
|
908
|
+
if (response != undefined) {
|
|
909
|
+
sts = this.statementsMatching(response, null, null, meta).slice()
|
|
910
|
+
for (var i = 0; i < sts.length; i++) {
|
|
911
|
+
this.removeStatement(sts[i])
|
|
912
|
+
}
|
|
898
913
|
}
|
|
899
|
-
//
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
this.
|
|
914
|
+
// request triples
|
|
915
|
+
sts = this.statementsMatching(request, null, null, meta).slice()
|
|
916
|
+
for (var i = 0; i < sts.length; i++) {
|
|
917
|
+
this.removeStatement(sts[i])
|
|
903
918
|
}
|
|
904
|
-
|
|
919
|
+
|
|
905
920
|
}
|
|
906
921
|
}
|
|
907
922
|
this.removeMatches(this.sym(doc.value), null, null, meta) // content-type
|