@ulb-darmstadt/shacl-form 1.9.0 → 1.9.1
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/form-bootstrap.js +8 -8
- package/dist/form-default.js +5 -5
- package/dist/form-material.js +35 -35
- package/package.json +1 -1
- package/src/loader.ts +19 -15
package/package.json
CHANGED
package/src/loader.ts
CHANGED
|
@@ -11,7 +11,6 @@ import { toRDF } from 'jsonld'
|
|
|
11
11
|
// that import the same resources
|
|
12
12
|
const loadedURLCache: Record<string, Promise<string>> = {}
|
|
13
13
|
const loadedClassesCache: Record<string, Promise<string>> = {}
|
|
14
|
-
const ttlParser = new Parser()
|
|
15
14
|
let sharedShapesGraph: Store | undefined
|
|
16
15
|
|
|
17
16
|
export class Loader {
|
|
@@ -121,20 +120,25 @@ export class Loader {
|
|
|
121
120
|
parser.write(input)
|
|
122
121
|
parser.end()
|
|
123
122
|
} else {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
123
|
+
try {
|
|
124
|
+
console.log('--- parsing', input, graph)
|
|
125
|
+
new Parser().parse(input, (error: Error, quad: Quad, prefixes: Prefixes) => {
|
|
126
|
+
if (error) {
|
|
127
|
+
console.warn('failed parsing graph', graph, error.message)
|
|
128
|
+
return reject(error)
|
|
129
|
+
}
|
|
130
|
+
if (quad) {
|
|
131
|
+
addQuad(quad)
|
|
132
|
+
return
|
|
133
|
+
}
|
|
134
|
+
if (prefixes) {
|
|
135
|
+
this.config.registerPrefixes(prefixes)
|
|
136
|
+
}
|
|
137
|
+
resolve(null)
|
|
138
|
+
})
|
|
139
|
+
} catch(e) {
|
|
140
|
+
reject(e)
|
|
141
|
+
}
|
|
138
142
|
}
|
|
139
143
|
})
|
|
140
144
|
try {
|