@ulb-darmstadt/shacl-form 1.6.1 → 1.6.3

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/README.md CHANGED
@@ -78,13 +78,11 @@ data-show-node-ids | When this attribute is set, shacl node shapes will have the
78
78
  ```typescript
79
79
  toRDF(graph?: Store): Store
80
80
  ```
81
-
82
81
  Adds the form values as RDF triples to the given graph. If no graph object is provided, creates a new [N3 Store](https://github.com/rdfjs/N3.js#storing).
83
82
 
84
83
  ```typescript
85
84
  serialize(format?: string, graph?: Store): string
86
85
  ```
87
-
88
86
  Serializes the given RDF graph to the given format. If no graph object is provided, this function calls toRDF() (see above) to construct the form data graph. <a name="formats"></a>Supported formats: `text/turtle` (default), `application/ld+json`, `application/n-triples`, `application/n-quads`, `application/trig`.
89
87
 
90
88
  ```typescript
@@ -101,11 +99,17 @@ Register a [plugin](./src/plugin.ts) to customize editing/viewing certain proper
101
99
  setTheme(theme: Theme)
102
100
  ```
103
101
  Set a design theme to use for rendering. See section [Theming](#Theming).
102
+
104
103
  ```typescript
105
104
  setClassInstanceProvider((className: string) => Promise<string>)
106
105
  ```
107
106
  Sets a callback function that is invoked when a SHACL property has an `sh:class` definition to retrieve class instances. See [below](#classInstanceProvider) for more information.
108
107
 
108
+ ```typescript
109
+ setSharedShapesGraph(graph: Store)
110
+ ```
111
+ Set an externally managed shapes graph to use. This improves performance When using multiple instances of `shacl-form` on the same page. Note that the shape triples need to be stored in the graph with ID `shapes` to be recognized.
112
+
109
113
  ## Features
110
114
 
111
115
  ### Validation
@@ -123,7 +127,7 @@ In edit mode, `<shacl-form>` validates the constructed data graph using the libr
123
127
  ### Providing additional data to the shapes graph
124
128
 
125
129
  Apart from setting the element attributes `data-shapes` or `data-shapes-url`, there are two ways of adding RDF data to the shapes graph:
126
- 1. While parsing the triples of the shapes graph, any encountered `owl:imports` predicate that has a valid HTTP URL value will tried to be fetched with the HTTP Accept header set to all of the [supported](#formats) MIME types. A successful response will be parsed and added to the shapes graph. The [example shapes graph](https://ulb-darmstadt.github.io/shacl-form/#example) contains the following triples:
130
+ 1. While parsing the triples of the shapes graph, any encountered `owl:imports` predicate that has a valid HTTP URL value will be tried to fetch with the HTTP Accept header set to all of the [supported](#formats) MIME types. A successful response will be parsed and added to the shapes graph. The [example shapes graph](https://ulb-darmstadt.github.io/shacl-form/#example) contains the following triples:
127
131
  ```
128
132
  example:Attribution
129
133
  owl:imports <https://w3id.org/nfdi4ing/metadata4ing/> ;
@@ -256,7 +260,7 @@ Apart from grouped properties, all properties having an `sh:node` predicate and
256
260
 
257
261
  Theme | Import statement
258
262
  --- | ---
259
- [Default]((./src/themes/default.ts)) (slightly customized default browser styles) | `import '@ulb-darmstadt/shacl-form/form-default.js'`
263
+ [Default](./src/themes/default.ts) (slightly customized default browser styles) | `import '@ulb-darmstadt/shacl-form/form-default.js'`
260
264
  [Bootstrap](./src/themes/bootstrap.ts) [alpha status] | `import '@ulb-darmstadt/shacl-form/form-bootstrap.js'`
261
265
  [Material Design](./src/themes/material.ts) [alpha status] | `import '@ulb-darmstadt/shacl-form/form-material.js'`
262
266
 
package/dist/exports.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { Theme, InputListEntry, Editor } from './theme';
2
- export { Loader } from './loader';
2
+ export { Loader, setSharedShapesGraph } from './loader';
3
3
  export { Config } from './config';
4
4
  export { Plugin, registerPlugin } from './plugin';
5
5
  export { ShaclPropertyTemplate } from './property-template';