@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulb-darmstadt/shacl-form",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "SHACL form generator",
5
5
  "main": "dist/form-default.js",
6
6
  "module": "dist/form-default.js",
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
- ttlParser.parse(input, (error: Error, quad: Quad, prefixes: Prefixes) => {
125
- if (error) {
126
- console.warn('failed parsing graph', graph, error.message)
127
- return reject(error)
128
- }
129
- if (quad) {
130
- addQuad(quad)
131
- return
132
- }
133
- if (prefixes) {
134
- this.config.registerPrefixes(prefixes)
135
- }
136
- resolve(null)
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 {