@ulb-darmstadt/shacl-form 1.3.0 → 1.3.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.
- package/README.md +7 -3
- package/dist/form-bootstrap.js +1 -1
- package/dist/form-default.js +1 -1
- package/dist/form-material.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
npm i @ulb-darmstadt/shacl-form
|
|
5
5
|
```
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
HTML5 web component for editing/viewing [RDF](https://www.w3.org/RDF/) data that conform to [SHACL shapes](https://www.w3.org/TR/shacl/).
|
|
8
8
|
|
|
9
9
|
## [See demo here](https://ulb-darmstadt.github.io/shacl-form/)
|
|
10
10
|
|
|
@@ -101,6 +101,10 @@ Class hierarchies can be built using `rdfs:subClassOf` or `skos:broader`.
|
|
|
101
101
|
|
|
102
102
|
## Features
|
|
103
103
|
|
|
104
|
+
### Validation
|
|
105
|
+
|
|
106
|
+
In edit mode, `<shacl-form>` validates the constructed data graph using the library [rdf-validate-shacl](https://github.com/zazuko/rdf-validate-shacl) and displays validation results as icons next to the respective form fields.
|
|
107
|
+
|
|
104
108
|
### Data graph binding
|
|
105
109
|
|
|
106
110
|
`<shacl-form>` requires only a shapes graph as input via the attribute `data-shapes` (or `data-shapes-url`) to generate an empty form and create new RDF data from the form input fields. Using the attributes `data-values` (or `data-values-url`) and `data-value-subject`, you can also bind an existing data graph to the form. The given data graph is then used to fill the form input fields.
|
|
@@ -124,8 +128,8 @@ Apart from setting the element attributes `data-shapes` or `data-shapes-url`, th
|
|
|
124
128
|
```
|
|
125
129
|
In this case, the URL references an ontology which among other things defines instances of class `prov:Role` that are then used to populate the "Role" dropdown in the form.
|
|
126
130
|
|
|
127
|
-
2. The `<shacl-form>` element has a function `setClassInstanceProvider((className: string) => Promise<string>)` that registers a callback function which is
|
|
128
|
-
an `sh:class` predicate. The expected return value
|
|
131
|
+
2. The `<shacl-form>` element has a function `setClassInstanceProvider((className: string) => Promise<string>)` that registers a callback function which is invoked when a SHACL property has
|
|
132
|
+
an `sh:class` predicate. The expected return value is a (promise of a) string (e.g. in format `text/turtle`) that contains RDF class instance definitions of the given class. Instances can be defined e.g. like:
|
|
129
133
|
- `example:Instance a example:Class`
|
|
130
134
|
- `example:Instance a owl:NamedIndividual; skos:broader example:Class`
|
|
131
135
|
|