@ulb-darmstadt/shacl-form 1.7.0 → 1.7.2

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.
@@ -1 +1,10 @@
1
1
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
2
+
3
+ /**
4
+ * martinez v0.7.4
5
+ * Martinez polygon clipping algorithm, does boolean operation on polygons (multipolygons, polygons with holes etc): intersection, union, difference, xor
6
+ *
7
+ * @author Alex Milevski <info@w8r.name>
8
+ * @license MIT
9
+ * @preserve
10
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulb-darmstadt/shacl-form",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "SHACL form generator",
5
5
  "main": "dist/form-default.js",
6
6
  "module": "dist/form-default.js",
@@ -33,31 +33,31 @@
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/jsonld": "^1.5.15",
36
- "@types/leaflet": "^1.9.12",
36
+ "@types/leaflet": "^1.9.18",
37
37
  "@types/leaflet-editable": "^1.2.6",
38
38
  "@types/leaflet.fullscreen": "^3.0.2",
39
- "@types/mapbox__mapbox-gl-draw": "^1.4.6",
40
- "@types/n3": "^1.21.0",
39
+ "@types/mapbox__mapbox-gl-draw": "^1.4.9",
40
+ "@types/n3": "^1.26.0",
41
41
  "@types/uuid": "^10.0.0",
42
42
  "raw-loader": "^4.0.2",
43
43
  "rimraf": "^6.0.1",
44
- "ts-loader": "^9.5.1",
45
- "typescript": "^5.6.2",
46
- "webpack": ">=5.94.0",
47
- "webpack-cli": "^5.1.4",
48
- "webpack-dev-server": "^5.1.0"
44
+ "ts-loader": "^9.5.2",
45
+ "typescript": "^5.8.3",
46
+ "webpack": ">=5.99.9",
47
+ "webpack-cli": "^6.0.1",
48
+ "webpack-dev-server": "^5.2.2"
49
49
  },
50
50
  "dependencies": {
51
- "@mapbox/mapbox-gl-draw": "^1.4.3",
52
- "bootstrap": "^5.3.3",
53
- "jsonld": "^8.3.2",
51
+ "@mapbox/mapbox-gl-draw": "^1.5.0",
52
+ "bootstrap": "^5.3.6",
53
+ "jsonld": "^8.3.3",
54
54
  "leaflet": "^1.9.4",
55
- "leaflet-editable": "^1.3.0",
56
- "leaflet.fullscreen": "^3.0.2",
57
- "mapbox-gl": "^3.3.0",
58
- "mdui": "^2.1.2",
59
- "n3": "^1.21.1",
60
- "shacl-engine": "^1.0.1",
61
- "uuid": "^10.0.0"
55
+ "leaflet-editable": "^1.3.1",
56
+ "leaflet.fullscreen": "^4.0.0",
57
+ "mapbox-gl": "^3.12.0",
58
+ "mdui": "^2.1.4",
59
+ "n3": "^1.26.0",
60
+ "shacl-engine": "^1.0.2",
61
+ "uuid": "^11.1.0"
62
62
  }
63
63
  }
package/src/form.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { ShaclNode } from './node'
2
2
  import { Config } from './config'
3
3
  import { ClassInstanceProvider, Plugin, listPlugins, registerPlugin } from './plugin'
4
- import { Store, NamedNode, DataFactory } from 'n3'
5
- import { DCTERMS_PREDICATE_CONFORMS_TO, RDF_PREDICATE_TYPE, SHACL_OBJECT_NODE_SHAPE, SHACL_PREDICATE_TARGET_CLASS } from './constants'
4
+ import { Store, NamedNode, DataFactory, Quad } from 'n3'
5
+ import { DCTERMS_PREDICATE_CONFORMS_TO, PREFIX_SHACL, RDF_PREDICATE_TYPE, SHACL_OBJECT_NODE_SHAPE, SHACL_PREDICATE_TARGET_CLASS } from './constants'
6
6
  import { Editor, Theme } from './theme'
7
7
  import { serialize } from './serialize'
8
8
  import { Validator } from 'shacl-engine'
@@ -156,6 +156,10 @@ export class ShaclForm extends HTMLElement {
156
156
 
157
157
  this.config.shapesGraph.deleteGraph('')
158
158
  this.shape?.toRDF(this.config.shapesGraph)
159
+ if (this.shape) {
160
+ // add node target for validation. this is required in case of missing sh:targetClass in root shape
161
+ this.config.shapesGraph.add(new Quad(this.shape.shaclSubject, DataFactory.namedNode(PREFIX_SHACL + 'targetNode'), this.shape.nodeId, undefined))
162
+ }
159
163
  try {
160
164
  const dataset = this.config.shapesGraph
161
165
  const report = await new Validator(dataset, { details: true, factory: DataFactory }).validate({ dataset })
package/src/loader.ts CHANGED
@@ -70,6 +70,7 @@ export class Loader {
70
70
  await new Promise((resolve, reject) => {
71
71
  p.parse(text, (error: Error, quad: Quad, prefixes: Prefixes) => {
72
72
  if (error) {
73
+ console.warn('failed parsing graph', graph, error.message)
73
74
  return reject(error)
74
75
  }
75
76
  if (quad) {