@ulb-darmstadt/shacl-form 1.1.2 → 1.1.4
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 +24 -12
- package/dist/config.d.ts +16 -21
- package/dist/constants.d.ts +1 -0
- package/dist/constraints.d.ts +1 -3
- package/dist/editors.d.ts +19 -0
- package/dist/form.d.ts +2 -3
- package/dist/group.d.ts +1 -3
- package/dist/index-with-plugins.js +1 -1
- package/dist/index-with-plugins.js.map +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.js +1 -1
- package/dist/loader.d.ts +5 -3
- package/dist/node.d.ts +2 -4
- package/dist/plugin.d.ts +4 -3
- package/dist/plugins/fixed-list.d.ts +6 -5
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/mapbox.d.ts +6 -4
- package/dist/{property-spec.d.ts → property-template.d.ts} +6 -6
- package/dist/property.d.ts +5 -8
- package/dist/util.d.ts +3 -1
- package/package.json +2 -1
- package/dist/inputs.d.ts +0 -56
- package/dist/theme.d.ts +0 -9
package/dist/loader.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Store, Parser, NamedNode } from 'n3';
|
|
2
|
-
import {
|
|
2
|
+
import { Config } from './config';
|
|
3
3
|
export declare class Loader {
|
|
4
4
|
private abortController;
|
|
5
|
-
private
|
|
6
|
-
|
|
5
|
+
private config;
|
|
6
|
+
private loadedOwlImports;
|
|
7
|
+
private loadedClasses;
|
|
8
|
+
constructor(config: Config);
|
|
7
9
|
loadGraphs(): Promise<void>;
|
|
8
10
|
importRDF(input: string | Promise<string>, store: Store, graph?: NamedNode, parser?: Parser): Promise<void>;
|
|
9
11
|
fetchRDF(url: string): Promise<string>;
|
package/dist/node.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { BlankNode, NamedNode, Store } from 'n3';
|
|
2
|
-
import { ShaclPropertyInstance } from './property';
|
|
3
2
|
import { Config } from './config';
|
|
4
3
|
export declare class ShaclNode extends HTMLElement {
|
|
5
4
|
shaclSubject: NamedNode;
|
|
6
|
-
|
|
5
|
+
nodeId: NamedNode | BlankNode;
|
|
7
6
|
targetClass: NamedNode | undefined;
|
|
8
|
-
parent: ShaclNode | ShaclPropertyInstance | undefined;
|
|
9
7
|
config: Config;
|
|
10
|
-
constructor(shaclSubject: NamedNode, config: Config,
|
|
8
|
+
constructor(shaclSubject: NamedNode, config: Config, valueSubject: NamedNode | BlankNode | undefined, label?: string);
|
|
11
9
|
toRDF(graph: Store, subject?: NamedNode | BlankNode): (NamedNode | BlankNode);
|
|
12
10
|
}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ShaclPropertyTemplate } from './property-template';
|
|
2
|
+
import { Term } from '@rdfjs/types';
|
|
3
3
|
export type Plugins = {
|
|
4
4
|
[predicate: string]: Plugin;
|
|
5
5
|
};
|
|
6
6
|
export declare abstract class Plugin {
|
|
7
7
|
predicate: string;
|
|
8
8
|
constructor(predicate: string);
|
|
9
|
-
abstract createInstance(
|
|
9
|
+
abstract createInstance(template: ShaclPropertyTemplate, value?: Term): HTMLElement;
|
|
10
10
|
}
|
|
11
|
+
export type ClassInstanceProvider = (clazz: string) => Promise<string>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Plugin } from '../plugin';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Term } from '@rdfjs/types';
|
|
3
|
+
import { ShaclPropertyTemplate } from '../property-template';
|
|
4
|
+
import { InputListEntry } from '../editors';
|
|
4
5
|
export declare class FixedListPlugin extends Plugin {
|
|
5
|
-
entries: InputListEntry[]
|
|
6
|
-
constructor(predicate: string, entries: InputListEntry[]
|
|
7
|
-
createInstance(
|
|
6
|
+
entries: InputListEntry[];
|
|
7
|
+
constructor(predicate: string, entries: InputListEntry[]);
|
|
8
|
+
createInstance(template: ShaclPropertyTemplate, value?: Term): HTMLElement;
|
|
8
9
|
}
|
package/dist/plugins/index.d.ts
CHANGED
package/dist/plugins/mapbox.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Term } from '@rdfjs/types';
|
|
2
2
|
import { Plugin } from '../plugin';
|
|
3
|
-
import {
|
|
3
|
+
import { ShaclPropertyTemplate } from '../property-template';
|
|
4
|
+
import mapboxgl from 'mapbox-gl';
|
|
5
|
+
import 'mapbox-gl/dist/mapbox-gl.css';
|
|
4
6
|
export declare class MapBoxPlugin extends Plugin {
|
|
5
|
-
apiKey: string;
|
|
6
7
|
constructor(predicate: string, apiKey: string);
|
|
7
|
-
createInstance(
|
|
8
|
+
createInstance(template: ShaclPropertyTemplate, value?: Term): HTMLElement;
|
|
9
|
+
setMarker(instance: HTMLElement, pos: mapboxgl.LngLat | undefined): void;
|
|
8
10
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Literal, NamedNode, Quad } from 'n3';
|
|
1
|
+
import { Literal, NamedNode, BlankNode, Quad } from 'n3';
|
|
2
2
|
import { Term } from '@rdfjs/types';
|
|
3
3
|
import { Config } from './config';
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class ShaclPropertyTemplate {
|
|
5
5
|
label: string;
|
|
6
|
+
nodeId: NamedNode | BlankNode;
|
|
6
7
|
name: Literal | undefined;
|
|
7
8
|
description: Literal | undefined;
|
|
8
|
-
classInstances: Term[] | undefined;
|
|
9
9
|
path: string | undefined;
|
|
10
10
|
node: NamedNode | undefined;
|
|
11
11
|
class: NamedNode | undefined;
|
|
@@ -28,7 +28,7 @@ export declare class ShaclPropertySpec {
|
|
|
28
28
|
datatype: NamedNode | undefined;
|
|
29
29
|
hasValue: Term | undefined;
|
|
30
30
|
config: Config;
|
|
31
|
-
constructor(quads: Quad[], config: Config);
|
|
32
|
-
merge(quads: Quad[]):
|
|
33
|
-
clone():
|
|
31
|
+
constructor(quads: Quad[], nodeId: NamedNode | BlankNode, config: Config);
|
|
32
|
+
merge(quads: Quad[]): ShaclPropertyTemplate;
|
|
33
|
+
clone(): ShaclPropertyTemplate;
|
|
34
34
|
}
|
package/dist/property.d.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { BlankNode, NamedNode, Store } from 'n3';
|
|
2
2
|
import { Term } from '@rdfjs/types';
|
|
3
3
|
import { Config } from './config';
|
|
4
|
-
import {
|
|
4
|
+
import { ShaclPropertyTemplate } from './property-template';
|
|
5
5
|
export declare class ShaclProperty extends HTMLElement {
|
|
6
|
-
|
|
6
|
+
template: ShaclPropertyTemplate;
|
|
7
7
|
addButton: HTMLElement;
|
|
8
|
-
constructor(shaclSubject: BlankNode | NamedNode, config: Config, valueSubject?: NamedNode | BlankNode);
|
|
9
|
-
|
|
8
|
+
constructor(shaclSubject: BlankNode | NamedNode, config: Config, nodeId: NamedNode | BlankNode, valueSubject?: NamedNode | BlankNode);
|
|
9
|
+
addPropertyInstance(value?: Term): HTMLElement;
|
|
10
10
|
updateControls(): void;
|
|
11
11
|
toRDF(graph: Store, subject: NamedNode | BlankNode): void;
|
|
12
12
|
}
|
|
13
|
-
export declare
|
|
14
|
-
spec: ShaclPropertySpec;
|
|
15
|
-
constructor(spec: ShaclPropertySpec, value?: Term, forceRemovable?: boolean);
|
|
16
|
-
}
|
|
13
|
+
export declare function createPropertyInstance(template: ShaclPropertyTemplate, value?: Term, forceRemovable?: boolean): HTMLElement;
|
package/dist/util.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Prefixes, Quad, Store } from 'n3';
|
|
2
2
|
import { Term } from '@rdfjs/types';
|
|
3
|
-
import { InputListEntry } from './
|
|
3
|
+
import { InputListEntry } from './editors';
|
|
4
|
+
import { Config } from './config';
|
|
4
5
|
export declare function findObjectValueByPredicate(quads: Quad[], predicate: string, prefix?: string, language?: string | null): string;
|
|
5
6
|
export declare function findObjectByPredicate(quads: Quad[], predicate: string, prefix?: string, language?: string | null): Term | undefined;
|
|
6
7
|
export declare function focusFirstInputElement(context: HTMLElement): void;
|
|
7
8
|
export declare function findLabel(quads: Quad[], language?: string | null): string;
|
|
8
9
|
export declare function createInputListEntries(subjects: Term[], shapesGraph: Store, language?: string | null): InputListEntry[];
|
|
9
10
|
export declare function removePrefixes(id: string, prefixes: Prefixes): string;
|
|
11
|
+
export declare function findInstancesOf(clazz: Term, config: Config): InputListEntry[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ulb-darmstadt/shacl-form",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "SHACL form generator",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"webpack-dev-server": "^4.15.1"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
+
"mapbox-gl": "^2.15.0",
|
|
47
48
|
"n3": "^1.17.0",
|
|
48
49
|
"rdf-validate-shacl": "^0.4.5",
|
|
49
50
|
"uuid": "^9.0.0"
|
package/dist/inputs.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { NamedNode, Literal } from 'n3';
|
|
2
|
-
import { Term } from '@rdfjs/types';
|
|
3
|
-
import { ShaclPropertySpec } from './property-spec';
|
|
4
|
-
export type Editor = HTMLElement & {
|
|
5
|
-
value: string;
|
|
6
|
-
};
|
|
7
|
-
export declare abstract class InputBase extends HTMLElement {
|
|
8
|
-
static idCtr: number;
|
|
9
|
-
property: ShaclPropertySpec;
|
|
10
|
-
editor: Editor;
|
|
11
|
-
required: boolean;
|
|
12
|
-
constructor(property: ShaclPropertySpec);
|
|
13
|
-
setValue(value: Term): void;
|
|
14
|
-
abstract createEditor(): Editor;
|
|
15
|
-
abstract toRDFObject(): Literal | NamedNode | undefined;
|
|
16
|
-
}
|
|
17
|
-
export declare class InputDate extends InputBase {
|
|
18
|
-
createEditor(): Editor;
|
|
19
|
-
setValue(value: Term): void;
|
|
20
|
-
toRDFObject(): Literal | undefined;
|
|
21
|
-
}
|
|
22
|
-
export declare class InputText extends InputBase {
|
|
23
|
-
constructor(property: ShaclPropertySpec);
|
|
24
|
-
createEditor(): Editor;
|
|
25
|
-
toRDFObject(): Literal | NamedNode | undefined;
|
|
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
|
-
}
|
|
41
|
-
export declare class InputNumber extends InputBase {
|
|
42
|
-
constructor(property: ShaclPropertySpec);
|
|
43
|
-
createEditor(): Editor;
|
|
44
|
-
toRDFObject(): Literal | undefined;
|
|
45
|
-
}
|
|
46
|
-
export type InputListEntry = {
|
|
47
|
-
value: Term;
|
|
48
|
-
label?: string;
|
|
49
|
-
};
|
|
50
|
-
export declare class InputList extends InputBase {
|
|
51
|
-
constructor(property: ShaclPropertySpec, listEntries?: InputListEntry[]);
|
|
52
|
-
setListEntries(list: InputListEntry[]): void;
|
|
53
|
-
createEditor(): Editor;
|
|
54
|
-
toRDFObject(): Literal | NamedNode | undefined;
|
|
55
|
-
}
|
|
56
|
-
export declare function inputFactory(property: ShaclPropertySpec): InputBase;
|
package/dist/theme.d.ts
DELETED