rdflib 2.2.31 → 2.2.32-2b635b59
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 +69 -36
- 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 +1 -2
- package/esm/statement.js +7 -11
- package/esm/store.js +39 -32
- package/esm/types.js +18 -1
- package/esm/update-manager.js +28 -16
- 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 +93 -37
- 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 +1 -2
- 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 +1 -1
- package/lib/update-manager.js +34 -17
- 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 +19 -19
- package/src/fetcher.ts +18 -1
- package/src/jsonldparser.js +2 -4
- package/src/store.ts +18 -1
- package/src/update-manager.ts +20 -11
package/src/update-manager.ts
CHANGED
|
@@ -87,14 +87,16 @@ export default class UpdateManager {
|
|
|
87
87
|
* the user logs in, then that data misrepresents what would happen
|
|
88
88
|
* if the user tried again.
|
|
89
89
|
*/
|
|
90
|
-
flagAuthorizationMetadata () {
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
flagAuthorizationMetadata (kb?: IndexedFormula) {
|
|
91
|
+
if (!kb) {
|
|
92
|
+
kb = this.store
|
|
93
|
+
}
|
|
94
|
+
const meta = kb.fetcher?.appNode
|
|
93
95
|
const requests = kb.statementsMatching(undefined, this.ns.link('requestedURI'), undefined, meta).map(st => st.subject)
|
|
94
96
|
for (const request of requests) {
|
|
95
97
|
const response = kb.any(request, this.ns.link('response'), null, meta) as Quad_Subject
|
|
96
98
|
if (response !== undefined) { // ts
|
|
97
|
-
|
|
99
|
+
kb.add(response, this.ns.link('outOfDate'), true as any, meta) // @@ Boolean is fine - fix types
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
102
|
}
|
|
@@ -111,11 +113,18 @@ flagAuthorizationMetadata () {
|
|
|
111
113
|
* LOCALFILE or false if known, undefined if not known.
|
|
112
114
|
*/
|
|
113
115
|
async checkEditable (uri: string | NamedNode, kb?: IndexedFormula): Promise<string | boolean | undefined> {
|
|
114
|
-
|
|
116
|
+
if (!uri) {
|
|
117
|
+
return false // Eg subject is bnode, no known doc to write to
|
|
118
|
+
}
|
|
119
|
+
if (!kb) {
|
|
120
|
+
kb = this.store
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const initial = this.editable(uri, kb)
|
|
115
124
|
if (initial !== undefined) {
|
|
116
125
|
return initial
|
|
117
126
|
}
|
|
118
|
-
await
|
|
127
|
+
await kb.fetcher?.load(uri)
|
|
119
128
|
const final = this.editable(uri, kb)
|
|
120
129
|
// console.log(`Loaded ${uri} just to check editable, result: ${final}.`)
|
|
121
130
|
return final
|
|
@@ -141,17 +150,17 @@ flagAuthorizationMetadata () {
|
|
|
141
150
|
uri = termValue(uri)
|
|
142
151
|
|
|
143
152
|
if ( !this.isHttpUri(uri as string) ) {
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
153
|
+
if (kb.holds(
|
|
154
|
+
kb.rdfFactory.namedNode(uri),
|
|
155
|
+
kb.rdfFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'),
|
|
156
|
+
kb.rdfFactory.namedNode('http://www.w3.org/2007/ont/link#MachineEditableDocument'))) {
|
|
148
157
|
return 'LOCALFILE'
|
|
149
158
|
}
|
|
150
159
|
}
|
|
151
160
|
|
|
152
161
|
var request
|
|
153
162
|
var definitive = false
|
|
154
|
-
const meta =
|
|
163
|
+
const meta = kb.fetcher?.appNode
|
|
155
164
|
// const kb = s
|
|
156
165
|
|
|
157
166
|
// @ts-ignore passes a string to kb.each, which expects a term. Should this work?
|