rdflib 2.2.31 → 2.2.32-2f2a2f3c
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/670.rdflib.min.js +1 -0
- package/dist/730.rdflib.min.js +3 -0
- package/dist/730.rdflib.min.js.LICENSE.txt +58 -0
- package/dist/730.rdflib.min.js.map +1 -0
- package/dist/rdflib.min.js +1 -1
- package/dist/rdflib.min.js.LICENSE.txt +0 -59
- package/dist/rdflib.min.js.map +1 -1
- package/esm/blank-node.js +10 -6
- package/esm/collection.js +3 -4
- package/esm/factories/factory-types.js +10 -10
- package/esm/fetcher.js +64 -35
- package/esm/formula.js +10 -13
- package/esm/jsonldparser.js +4 -3
- package/esm/lists.js +2 -1
- package/esm/literal.js +6 -8
- package/esm/node-internal.js +5 -10
- package/esm/rdfxmlparser.js +3 -0
- package/esm/serializer.js +2 -3
- package/esm/statement.js +7 -11
- package/esm/store.js +39 -32
- package/esm/types.js +18 -1
- package/esm/update-manager.js +150 -83
- package/esm/utils.js +0 -1
- package/esm/variable.js +2 -4
- package/lib/blank-node.js +10 -6
- package/lib/collection.js +3 -4
- package/lib/factories/factory-types.js +10 -10
- package/lib/fetcher.js +88 -36
- package/lib/formula.js +10 -13
- package/lib/index.d.ts +1 -1
- package/lib/jsonldparser.js +9 -3
- package/lib/lists.js +15 -1
- package/lib/literal.js +6 -8
- package/lib/node-internal.js +5 -10
- package/lib/query.d.ts +1 -1
- package/lib/rdfxmlparser.js +3 -0
- package/lib/serializer.d.ts +1 -1
- package/lib/serializer.js +2 -3
- package/lib/sparql-to-query.d.ts +1 -1
- package/lib/statement.js +7 -11
- package/lib/store.d.ts +1 -1
- package/lib/store.js +55 -34
- package/lib/types.js +22 -0
- package/lib/update-manager.d.ts +25 -5
- package/lib/update-manager.js +154 -82
- package/lib/utils-js.d.ts +3 -3
- package/lib/variable.js +2 -4
- package/lib/xsd-internal.d.ts +1 -1
- package/package.json +20 -19
- package/src/fetcher.ts +13 -0
- package/src/jsonldparser.js +2 -4
- package/src/serializer.js +1 -1
- package/src/store.ts +18 -1
- package/src/update-manager.ts +243 -163
package/src/jsonldparser.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import jsonld from 'jsonld'
|
|
3
1
|
import { arrayToStatements } from './utils'
|
|
4
2
|
|
|
5
3
|
/**
|
|
@@ -70,8 +68,8 @@ export default function jsonldParser (str, kb, base, callback) {
|
|
|
70
68
|
? base.value
|
|
71
69
|
: base
|
|
72
70
|
|
|
73
|
-
return jsonld
|
|
74
|
-
.flatten(JSON.parse(str), null, { base: baseString })
|
|
71
|
+
return import('jsonld')
|
|
72
|
+
.then(jsonld => { return jsonld.flatten(JSON.parse(str), null, { base: baseString }) })
|
|
75
73
|
.then((flattened) => flattened.reduce((store, flatResource) => {
|
|
76
74
|
|
|
77
75
|
kb = processResource(kb, base, flatResource)
|
package/src/serializer.js
CHANGED
package/src/store.ts
CHANGED
|
@@ -871,10 +871,27 @@ export default class IndexedFormula extends Formula { // IN future - allow pass
|
|
|
871
871
|
}
|
|
872
872
|
|
|
873
873
|
/**
|
|
874
|
-
* Removes all statements in a doc
|
|
874
|
+
* Removes all statements in a doc, along with the related metadata including request/response
|
|
875
875
|
* @param doc - The document / graph
|
|
876
876
|
*/
|
|
877
877
|
removeDocument(doc: Quad_Graph): IndexedFormula {
|
|
878
|
+
const meta = this.sym('chrome://TheCurrentSession') // or this.rdfFactory.namedNode('chrome://TheCurrentSession')
|
|
879
|
+
const linkNamespaceURI = 'http://www.w3.org/2007/ont/link#' // alain
|
|
880
|
+
// remove request/response and metadata
|
|
881
|
+
const requests = this.statementsMatching(undefined, this.sym(`${linkNamespaceURI}requestedURI`), this.rdfFactory.literal(doc.value), meta).map(st => st.subject)
|
|
882
|
+
for (var r = 0; r < requests.length; r++) {
|
|
883
|
+
const request = requests[r]
|
|
884
|
+
if (request !== undefined) {
|
|
885
|
+
this.removeMatches(request, null, null, meta)
|
|
886
|
+
const response = this.any(request, this.sym(`${linkNamespaceURI}response`), null, meta) as Quad_Subject
|
|
887
|
+
if (response !== undefined) { // ts
|
|
888
|
+
this.removeMatches(response, null, null, meta)
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
this.removeMatches(this.sym(doc.value), null, null, meta) // content-type
|
|
893
|
+
|
|
894
|
+
// remove document
|
|
878
895
|
var sts: Quad[] = this.statementsMatching(undefined, undefined, undefined, doc).slice() // Take a copy as this is the actual index
|
|
879
896
|
for (var i = 0; i < sts.length; i++) {
|
|
880
897
|
this.removeStatement(sts[i])
|