@ulb-darmstadt/shacl-form 1.0.15 → 1.1.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/README.md +40 -33
- package/dist/config.d.ts +11 -7
- package/dist/constants.d.ts +8 -3
- package/dist/constraints.d.ts +7 -0
- package/dist/form.d.ts +4 -7
- package/dist/index-with-plugins.js +1 -1
- package/dist/index-with-plugins.js.LICENSE.txt +0 -4
- package/dist/index-with-plugins.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +0 -4
- package/dist/inputs.d.ts +32 -27
- package/dist/loader.d.ts +3 -3
- package/dist/node.d.ts +5 -5
- package/dist/plugin.d.ts +2 -2
- package/dist/plugins/fixed-list.d.ts +2 -2
- package/dist/plugins/mapbox.d.ts +2 -2
- package/dist/property-spec.d.ts +34 -0
- package/dist/property.d.ts +11 -12
- package/dist/serialize.d.ts +2 -0
- package/dist/util.d.ts +7 -3
- package/package.json +10 -11
package/dist/inputs.d.ts
CHANGED
|
@@ -1,51 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Term
|
|
3
|
-
import {
|
|
1
|
+
import { NamedNode, Literal } from 'n3';
|
|
2
|
+
import { Term } from '@rdfjs/types';
|
|
3
|
+
import { ShaclPropertySpec } from './property-spec';
|
|
4
4
|
export type Editor = HTMLElement & {
|
|
5
5
|
value: string;
|
|
6
6
|
};
|
|
7
7
|
export declare abstract class InputBase extends HTMLElement {
|
|
8
8
|
static idCtr: number;
|
|
9
|
-
|
|
9
|
+
property: ShaclPropertySpec;
|
|
10
10
|
editor: Editor;
|
|
11
11
|
required: boolean;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
minCount: string;
|
|
16
|
-
maxCount: string;
|
|
17
|
-
path: string;
|
|
18
|
-
pattern: string;
|
|
19
|
-
dataType: NamedNode | undefined;
|
|
20
|
-
nodeKind: NamedNode | null;
|
|
21
|
-
constructor(quads: Quad[], config: Config);
|
|
22
|
-
setValue(value: string): void;
|
|
23
|
-
abstract createEditor(quads: Quad[]): Editor;
|
|
12
|
+
constructor(property: ShaclPropertySpec);
|
|
13
|
+
setValue(value: Term): void;
|
|
14
|
+
abstract createEditor(): Editor;
|
|
24
15
|
abstract toRDFObject(): Literal | NamedNode | undefined;
|
|
25
16
|
}
|
|
26
17
|
export declare class InputDate extends InputBase {
|
|
27
|
-
createEditor(
|
|
28
|
-
setValue(value:
|
|
18
|
+
createEditor(): Editor;
|
|
19
|
+
setValue(value: Term): void;
|
|
29
20
|
toRDFObject(): Literal | undefined;
|
|
30
21
|
}
|
|
31
22
|
export declare class InputText extends InputBase {
|
|
32
|
-
constructor(
|
|
33
|
-
createEditor(
|
|
23
|
+
constructor(property: ShaclPropertySpec);
|
|
24
|
+
createEditor(): Editor;
|
|
34
25
|
toRDFObject(): Literal | NamedNode | undefined;
|
|
35
26
|
}
|
|
27
|
+
export declare class InputLangString extends InputText {
|
|
28
|
+
language: string | undefined;
|
|
29
|
+
langChooser: HTMLInputElement | HTMLSelectElement;
|
|
30
|
+
constructor(property: ShaclPropertySpec);
|
|
31
|
+
setValue(value: Term): void;
|
|
32
|
+
toRDFObject(): Literal | NamedNode | undefined;
|
|
33
|
+
createLangChooser(): HTMLInputElement | HTMLSelectElement;
|
|
34
|
+
}
|
|
35
|
+
export declare class InputBoolean extends InputBase {
|
|
36
|
+
constructor(property: ShaclPropertySpec);
|
|
37
|
+
createEditor(): Editor;
|
|
38
|
+
setValue(value: Term): void;
|
|
39
|
+
toRDFObject(): Literal | undefined;
|
|
40
|
+
}
|
|
36
41
|
export declare class InputNumber extends InputBase {
|
|
37
|
-
constructor(
|
|
38
|
-
createEditor(
|
|
42
|
+
constructor(property: ShaclPropertySpec);
|
|
43
|
+
createEditor(): Editor;
|
|
39
44
|
toRDFObject(): Literal | undefined;
|
|
40
45
|
}
|
|
41
|
-
export type InputListEntry =
|
|
42
|
-
value:
|
|
46
|
+
export type InputListEntry = {
|
|
47
|
+
value: Term;
|
|
43
48
|
label?: string;
|
|
44
49
|
};
|
|
45
50
|
export declare class InputList extends InputBase {
|
|
46
|
-
constructor(
|
|
51
|
+
constructor(property: ShaclPropertySpec, listEntries?: InputListEntry[]);
|
|
47
52
|
setListEntries(list: InputListEntry[]): void;
|
|
48
|
-
createEditor(
|
|
53
|
+
createEditor(): Editor;
|
|
49
54
|
toRDFObject(): Literal | NamedNode | undefined;
|
|
50
55
|
}
|
|
51
|
-
export declare function inputFactory(
|
|
56
|
+
export declare function inputFactory(property: ShaclPropertySpec): InputBase;
|
package/dist/loader.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export declare class Loader {
|
|
|
5
5
|
private form;
|
|
6
6
|
constructor(form: ShaclForm);
|
|
7
7
|
loadGraphs(): Promise<void>;
|
|
8
|
-
importRDF(input: string | Promise<string>, store: Store, graph?: NamedNode, parser?: Parser): Promise<
|
|
9
|
-
fetchRDF(url: string
|
|
10
|
-
toURL(id: string, prefixes: Prefixes): string | null;
|
|
8
|
+
importRDF(input: string | Promise<string>, store: Store, graph?: NamedNode, parser?: Parser): Promise<void>;
|
|
9
|
+
fetchRDF(url: string): Promise<string>;
|
|
10
|
+
toURL(id: string, prefixes: Prefixes | undefined): string | null;
|
|
11
11
|
isURL(input: string): boolean;
|
|
12
12
|
}
|
package/dist/node.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BlankNode, NamedNode, Store } from 'n3';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { ShaclPropertyInstance } from './property';
|
|
3
|
+
import { Config } from './config';
|
|
4
4
|
export declare class ShaclNode extends HTMLElement {
|
|
5
5
|
shaclSubject: NamedNode;
|
|
6
6
|
exportValueSubject: NamedNode | BlankNode;
|
|
7
7
|
targetClass: NamedNode | undefined;
|
|
8
|
-
parent: ShaclNode |
|
|
9
|
-
|
|
10
|
-
constructor(
|
|
8
|
+
parent: ShaclNode | ShaclPropertyInstance | undefined;
|
|
9
|
+
config: Config;
|
|
10
|
+
constructor(shaclSubject: NamedNode, config: Config, parent: ShaclNode | ShaclPropertyInstance | undefined, valueSubject: NamedNode | BlankNode | undefined);
|
|
11
11
|
toRDF(graph: Store, subject?: NamedNode | BlankNode): (NamedNode | BlankNode);
|
|
12
12
|
}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaclPropertySpec } from './property-spec';
|
|
2
2
|
import { InputBase } from './inputs';
|
|
3
3
|
export type Plugins = {
|
|
4
4
|
[predicate: string]: Plugin;
|
|
@@ -6,5 +6,5 @@ export type Plugins = {
|
|
|
6
6
|
export declare abstract class Plugin {
|
|
7
7
|
predicate: string;
|
|
8
8
|
constructor(predicate: string);
|
|
9
|
-
abstract createInstance(property:
|
|
9
|
+
abstract createInstance(property: ShaclPropertySpec, value?: string): InputBase;
|
|
10
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Plugin } from '../plugin';
|
|
2
|
-
import {
|
|
2
|
+
import { ShaclPropertySpec } from '../property-spec';
|
|
3
3
|
import { InputList, InputListEntry } from '../inputs';
|
|
4
4
|
export declare class FixedListPlugin extends Plugin {
|
|
5
5
|
entries: InputListEntry[] | Promise<InputListEntry[]>;
|
|
6
6
|
constructor(predicate: string, entries: InputListEntry[] | Promise<InputListEntry[]>);
|
|
7
|
-
createInstance(property:
|
|
7
|
+
createInstance(property: ShaclPropertySpec, value?: string): InputList;
|
|
8
8
|
}
|
package/dist/plugins/mapbox.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InputText } from '../inputs';
|
|
2
2
|
import { Plugin } from '../plugin';
|
|
3
|
-
import {
|
|
3
|
+
import { ShaclPropertySpec } from '../property-spec';
|
|
4
4
|
export declare class MapBoxPlugin extends Plugin {
|
|
5
5
|
apiKey: string;
|
|
6
6
|
constructor(predicate: string, apiKey: string);
|
|
7
|
-
createInstance(property:
|
|
7
|
+
createInstance(property: ShaclPropertySpec, value?: string): InputText;
|
|
8
8
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Literal, NamedNode, Quad } from 'n3';
|
|
2
|
+
import { Term } from '@rdfjs/types';
|
|
3
|
+
import { Config } from './config';
|
|
4
|
+
export declare class ShaclPropertySpec {
|
|
5
|
+
label: string;
|
|
6
|
+
name: Literal | undefined;
|
|
7
|
+
description: Literal | undefined;
|
|
8
|
+
classInstances: Term[] | undefined;
|
|
9
|
+
path: string | undefined;
|
|
10
|
+
node: NamedNode | undefined;
|
|
11
|
+
class: NamedNode | undefined;
|
|
12
|
+
minCount: number | undefined;
|
|
13
|
+
maxCount: number | undefined;
|
|
14
|
+
minLength: number | undefined;
|
|
15
|
+
maxLength: number | undefined;
|
|
16
|
+
minInclusive: number | undefined;
|
|
17
|
+
maxInclusive: number | undefined;
|
|
18
|
+
minExclusive: number | undefined;
|
|
19
|
+
maxExclusive: number | undefined;
|
|
20
|
+
singleLine: boolean | undefined;
|
|
21
|
+
defaultValue: Term | undefined;
|
|
22
|
+
pattern: string | undefined;
|
|
23
|
+
order: string | undefined;
|
|
24
|
+
nodeKind: NamedNode | undefined;
|
|
25
|
+
shaclIn: string | undefined;
|
|
26
|
+
shaclOr: Term[] | undefined;
|
|
27
|
+
languageIn: Term[] | undefined;
|
|
28
|
+
datatype: NamedNode | undefined;
|
|
29
|
+
hasValue: Term | undefined;
|
|
30
|
+
config: Config;
|
|
31
|
+
constructor(quads: Quad[], config: Config);
|
|
32
|
+
merge(quads: Quad[]): ShaclPropertySpec;
|
|
33
|
+
clone(): ShaclPropertySpec;
|
|
34
|
+
}
|
package/dist/property.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { BlankNode, NamedNode,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { BlankNode, NamedNode, Store } from 'n3';
|
|
2
|
+
import { Term } from '@rdfjs/types';
|
|
3
|
+
import { Config } from './config';
|
|
4
|
+
import { ShaclPropertySpec } from './property-spec';
|
|
4
5
|
export declare class ShaclProperty extends HTMLElement {
|
|
5
|
-
|
|
6
|
-
node: NamedNode | null;
|
|
7
|
-
classInstances: Array<InputListEntry> | null;
|
|
8
|
-
minCount: number;
|
|
9
|
-
maxCount: number;
|
|
10
|
-
quads: Quad[];
|
|
11
|
-
form: ShaclForm;
|
|
6
|
+
spec: ShaclPropertySpec;
|
|
12
7
|
addButton: HTMLElement;
|
|
13
|
-
constructor(
|
|
14
|
-
createPropertyInstance(value?:
|
|
8
|
+
constructor(shaclSubject: BlankNode | NamedNode, config: Config, valueSubject?: NamedNode | BlankNode);
|
|
9
|
+
createPropertyInstance(value?: Term): HTMLElement;
|
|
15
10
|
updateControls(): void;
|
|
16
11
|
toRDF(graph: Store, subject: NamedNode | BlankNode): void;
|
|
17
12
|
}
|
|
13
|
+
export declare class ShaclPropertyInstance extends HTMLElement {
|
|
14
|
+
spec: ShaclPropertySpec;
|
|
15
|
+
constructor(spec: ShaclPropertySpec, value?: Term, forceRemovable?: boolean);
|
|
16
|
+
}
|
package/dist/util.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { Quad,
|
|
1
|
+
import { Quad, Store } from 'n3';
|
|
2
|
+
import { Term } from '@rdfjs/types';
|
|
3
|
+
import { InputListEntry } from './inputs';
|
|
2
4
|
export declare function findObjectValueByPredicate(quads: Quad[], predicate: string, prefix?: string, language?: string | null): string;
|
|
3
|
-
export declare function findObjectByPredicate(quads: Quad[], predicate: string, prefix?: string, language?: string | null):
|
|
5
|
+
export declare function findObjectByPredicate(quads: Quad[], predicate: string, prefix?: string, language?: string | null): Term | undefined;
|
|
4
6
|
export declare function focusFirstInputElement(context: HTMLElement): void;
|
|
5
|
-
export declare function findLabel(quads: Quad[], language
|
|
7
|
+
export declare function findLabel(quads: Quad[], language?: string | null): string;
|
|
8
|
+
export declare function createInputListEntries(subjects: Term[], shapesGraph: Store, language?: string | null): InputListEntry[];
|
|
9
|
+
export declare function removeKnownPrefixes(id: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ulb-darmstadt/shacl-form",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "SHACL form generator",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -30,22 +30,21 @@
|
|
|
30
30
|
"serve": "webpack serve --mode development"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@types/n3": "^1.
|
|
33
|
+
"@types/n3": "^1.16.0",
|
|
34
34
|
"buffer": "^6.0.3",
|
|
35
|
-
"css-loader": "^6.
|
|
36
|
-
"rimraf": "^
|
|
35
|
+
"css-loader": "^6.8.1",
|
|
36
|
+
"rimraf": "^5.0.1",
|
|
37
37
|
"save": "^2.9.0",
|
|
38
38
|
"stream-browserify": "^3.0.0",
|
|
39
|
-
"style-loader": "^3.3.
|
|
40
|
-
"ts-loader": "^9.4.
|
|
41
|
-
"typescript": "^
|
|
42
|
-
"webpack": "^5.
|
|
43
|
-
"webpack-cli": "^
|
|
44
|
-
"webpack-dev-server": "^4.
|
|
39
|
+
"style-loader": "^3.3.3",
|
|
40
|
+
"ts-loader": "^9.4.4",
|
|
41
|
+
"typescript": "^5.1.6",
|
|
42
|
+
"webpack": "^5.88.2",
|
|
43
|
+
"webpack-cli": "^5.1.4",
|
|
44
|
+
"webpack-dev-server": "^4.15.1"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"n3": "^1.17.0",
|
|
48
|
-
"rdf-ext": "^2.2.0",
|
|
49
48
|
"rdf-validate-shacl": "^0.4.5",
|
|
50
49
|
"uuid": "^9.0.0"
|
|
51
50
|
}
|