@ulb-darmstadt/shacl-form 1.3.3 → 1.3.5

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
@@ -23,10 +23,11 @@ HTML5 web component for editing/viewing [RDF](https://www.w3.org/RDF/) data that
23
23
  -->
24
24
  <shacl-form data-shapes="
25
25
  @prefix sh: <http://www.w3.org/ns/shacl#> .
26
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
26
27
  @prefix ex: <http://example.org#> .
27
28
 
28
29
  ex:ExampleShape
29
- a sh:NodeShape ;
30
+ a sh:NodeShape, rdfs:Class ;
30
31
  sh:property [
31
32
  sh:name 'my value' ;
32
33
  sh:path ex:exampleValue ;
@@ -71,10 +72,16 @@ data-submit-button | [Ignored when `data-view` attribute is set] Whether to add
71
72
  ### Element functions
72
73
 
73
74
  ```typescript
74
- serialize(format?: string): string
75
+ toRDF(graph?: Store): Store
75
76
  ```
76
77
 
77
- Serializes the form data to RDF triples. <a name="formats"></a>Supported formats: `text/turtle` (default), `application/ld+json`, `application/n-triples`, `application/n-quads`, `application/trig`.
78
+ 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).
79
+
80
+ ```typescript
81
+ serialize(format?: string, graph?: Store): string
82
+ ```
83
+
84
+ 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`.
78
85
 
79
86
  ```typescript
80
87
  validate(ignoreEmptyValues: boolean): Promise<boolean>