@rdfx/builder 0.0.41 → 0.0.43
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/dist/BuilderBuilderParameters.d.ts +5 -5
- package/dist/IdentifierLike.d.ts +1 -1
- package/dist/IriLike.d.ts +1 -1
- package/dist/builder.d.ts +68 -66
- package/dist/builder.js +4 -3
- package/dist/sh.d.ts +38 -40
- package/dist/sh.js +11 -6
- package/dist/shapes.d.ts +198 -18355
- package/dist/shapes.js +1033 -1113
- package/dist/skos.d.ts +7 -7
- package/dist/skos.js +4 -2
- package/package.json +10 -10
|
@@ -2,10 +2,10 @@ import type { NamespaceBuilder } from "@rdfjs/namespace";
|
|
|
2
2
|
import type { BlankNode, NamedNode } from "@rdfjs/types";
|
|
3
3
|
import type { IdentifierLike } from "./IdentifierLike.js";
|
|
4
4
|
import type { IriLike } from "./IriLike.js";
|
|
5
|
-
export interface BuilderBuilderParameters<
|
|
6
|
-
|
|
7
|
-
toIdentifier: (identifier: IdentifierLike<
|
|
8
|
-
toIri: (iri: IriLike<
|
|
9
|
-
toIriArray: (iriArray: IriLike<
|
|
5
|
+
export interface BuilderBuilderParameters<DefaultNamespaceT extends NamespaceBuilder> {
|
|
6
|
+
defaultNamespace: DefaultNamespaceT;
|
|
7
|
+
toIdentifier: (identifier: IdentifierLike<DefaultNamespaceT>) => BlankNode | NamedNode;
|
|
8
|
+
toIri: (iri: IriLike<DefaultNamespaceT>) => NamedNode;
|
|
9
|
+
toIriArray: (iriArray: IriLike<DefaultNamespaceT> | readonly IriLike<DefaultNamespaceT>[]) => readonly NamedNode[];
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=BuilderBuilderParameters.d.ts.map
|
package/dist/IdentifierLike.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NamespaceBuilder } from "@rdfjs/namespace";
|
|
2
2
|
import type { BlankNode } from "@rdfjs/types";
|
|
3
3
|
import type { IriLike } from "./IriLike.js";
|
|
4
|
-
export type IdentifierLike<
|
|
4
|
+
export type IdentifierLike<DefaultNamespaceT extends NamespaceBuilder> = BlankNode | IriLike<DefaultNamespaceT> | undefined;
|
|
5
5
|
//# sourceMappingURL=IdentifierLike.d.ts.map
|
package/dist/IriLike.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { NamespaceBuilder } from "@rdfjs/namespace";
|
|
2
2
|
import type { NamedNode } from "@rdfjs/types";
|
|
3
|
-
export type IriLike<
|
|
3
|
+
export type IriLike<DefaultNamespaceT extends NamespaceBuilder> = (keyof DefaultNamespaceT & string) | NamedNode;
|
|
4
4
|
//# sourceMappingURL=IriLike.d.ts.map
|
package/dist/builder.d.ts
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import type { NamespaceBuilder } from "@rdfjs/namespace";
|
|
2
2
|
import type { BlankNode, NamedNode } from "@rdfjs/types";
|
|
3
3
|
import type { IriLike } from "./IriLike.js";
|
|
4
|
-
export declare function builder<
|
|
5
|
-
|
|
4
|
+
export declare function builder<DefaultNamespaceT extends NamespaceBuilder = NamespaceBuilder>(options?: {
|
|
5
|
+
defaultNamespace?: DefaultNamespaceT;
|
|
6
6
|
}): {
|
|
7
7
|
sh: {
|
|
8
8
|
namespace: NamespaceBuilder<keyof typeof import("@tpluscode/rdf-ns-builders").sh>;
|
|
9
|
-
NodeShape: ($identifier: BlankNode | NamedNode<string> | (keyof
|
|
10
|
-
readonly $
|
|
9
|
+
NodeShape: ($identifier: BlankNode | NamedNode<string> | (keyof DefaultNamespaceT & string) | Exclude<keyof DefaultNamespaceT & string, string | (() => import("./shapes.js").sh_NodeShape.Identifier)> | undefined, parameters?: (Omit<{
|
|
10
|
+
readonly $defaultNamespace?: DefaultNamespaceT | undefined;
|
|
11
|
+
readonly $identifier?: BlankNode | NamedNode<string> | (() => import("./shapes.js").sh_NodeShape.Identifier) | (keyof DefaultNamespaceT & string) | undefined;
|
|
11
12
|
readonly and?: readonly (NamedNode | import("./shapes.js").sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | import("./shapes.js").sh_Shape)[]>;
|
|
12
|
-
readonly class_?: string |
|
|
13
|
+
readonly class_?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
13
14
|
readonly closed?: boolean | import("purify-ts").Maybe<boolean>;
|
|
14
15
|
readonly comment?: string | import("purify-ts").Maybe<string>;
|
|
15
|
-
readonly datatype?: string |
|
|
16
|
+
readonly datatype?: NamedNode<string> | import("purify-ts").Maybe<NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
16
17
|
readonly deactivated?: boolean | import("purify-ts").Maybe<boolean>;
|
|
17
18
|
readonly discriminantValue?: string | import("purify-ts").Maybe<string>;
|
|
18
19
|
readonly extern?: boolean | import("purify-ts").Maybe<boolean>;
|
|
19
20
|
readonly flags?: string | import("purify-ts").Maybe<string>;
|
|
20
|
-
readonly fromRdfType?: string |
|
|
21
|
+
readonly fromRdfType?: NamedNode<string> | import("purify-ts").Maybe<NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
21
22
|
readonly hasValues?: (NamedNode | import("@rdfjs/types").Literal) | readonly (NamedNode | import("@rdfjs/types").Literal)[];
|
|
22
23
|
readonly ignore?: boolean;
|
|
23
|
-
readonly ignoredProperties?:
|
|
24
|
+
readonly ignoredProperties?: import("purify-ts").Maybe<readonly NamedNode<string>[]> | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
24
25
|
readonly in_?: readonly (NamedNode | import("@rdfjs/types").Literal)[] | import("purify-ts").Maybe<readonly (NamedNode | import("@rdfjs/types").Literal)[]>;
|
|
25
26
|
readonly isDefinedBy?: (NamedNode | import("./shapes.js").owl_Ontology) | import("purify-ts").Maybe<NamedNode | import("./shapes.js").owl_Ontology>;
|
|
26
27
|
readonly label?: string | import("purify-ts").Maybe<string>;
|
|
@@ -39,34 +40,35 @@ export declare function builder<NamespaceT extends NamespaceBuilder = NamespaceB
|
|
|
39
40
|
readonly or?: readonly (NamedNode | import("./shapes.js").sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | import("./shapes.js").sh_Shape)[]>;
|
|
40
41
|
readonly pattern?: string | import("purify-ts").Maybe<string>;
|
|
41
42
|
readonly properties?: (NamedNode | import("./shapes.js").sh_PropertyShape) | readonly (NamedNode | import("./shapes.js").sh_PropertyShape)[];
|
|
42
|
-
readonly rdfType?: string |
|
|
43
|
-
readonly severity?: ("
|
|
43
|
+
readonly rdfType?: NamedNode<string> | import("purify-ts").Maybe<NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
44
|
+
readonly severity?: import("./shapes.js").sh_Severity["value"] | import("./shapes.js").sh_Severity | import("purify-ts").Maybe<import("./shapes.js").sh_Severity>;
|
|
44
45
|
readonly shaclmateName?: string | import("purify-ts").Maybe<string>;
|
|
45
|
-
readonly subClassOf?: string |
|
|
46
|
-
readonly targetClasses?: string |
|
|
46
|
+
readonly subClassOf?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
47
|
+
readonly targetClasses?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
47
48
|
readonly targetNodes?: (NamedNode | import("@rdfjs/types").Literal) | readonly (NamedNode | import("@rdfjs/types").Literal)[];
|
|
48
|
-
readonly targetObjectsOf?: string |
|
|
49
|
-
readonly targetSubjectsOf?: string |
|
|
50
|
-
readonly toRdfTypes?: string |
|
|
49
|
+
readonly targetObjectsOf?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
50
|
+
readonly targetSubjectsOf?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
51
|
+
readonly toRdfTypes?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
51
52
|
readonly tsImports?: string | readonly string[];
|
|
52
|
-
readonly type?: string |
|
|
53
|
+
readonly type?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
53
54
|
readonly xone?: readonly (NamedNode | import("./shapes.js").sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | import("./shapes.js").sh_Shape)[]>;
|
|
54
|
-
}, "$identifier" | "
|
|
55
|
+
}, "$identifier" | "shaclmateName" | "in_" | "nodeKind" | "properties" | "type" | "xone"> & {
|
|
55
56
|
readonly in_?: import("./shapes.js").skos_ConceptScheme | readonly (string | number | bigint | boolean | import("@rdfjs/types").Literal | Date | NamedNode<string>)[];
|
|
56
57
|
readonly implicitClassTarget?: true;
|
|
57
58
|
readonly nodeKind?: ((NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#BlankNode">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#Literal">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#BlankNodeOrIRI">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#BlankNodeOrLiteral">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#IRI">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#IRIOrLiteral">)) | ("BlankNode" | "Literal" | "BlankNodeOrIRI" | "BlankNodeOrLiteral" | "IRI" | "IRIOrLiteral");
|
|
58
59
|
readonly properties?: Record<string, Omit<Omit<{
|
|
59
|
-
readonly $
|
|
60
|
+
readonly $defaultNamespace?: DefaultNamespaceT | undefined;
|
|
61
|
+
readonly $identifier?: BlankNode | NamedNode<string> | (() => import("./shapes.js").sh_PropertyShape.Identifier) | (keyof DefaultNamespaceT & string) | undefined;
|
|
60
62
|
readonly and?: readonly (NamedNode | import("./shapes.js").sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | import("./shapes.js").sh_Shape)[]>;
|
|
61
|
-
readonly class_?: string |
|
|
63
|
+
readonly class_?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
62
64
|
readonly comment?: string | import("purify-ts").Maybe<string>;
|
|
63
|
-
readonly datatype?: string |
|
|
65
|
+
readonly datatype?: NamedNode<string> | import("purify-ts").Maybe<NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
64
66
|
readonly deactivated?: boolean | import("purify-ts").Maybe<boolean>;
|
|
65
67
|
readonly defaultValue?: (NamedNode | import("@rdfjs/types").Literal) | import("purify-ts").Maybe<NamedNode | import("@rdfjs/types").Literal>;
|
|
66
68
|
readonly description?: string | import("purify-ts").Maybe<string>;
|
|
67
|
-
readonly disjoint?: string |
|
|
69
|
+
readonly disjoint?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
68
70
|
readonly display?: boolean;
|
|
69
|
-
readonly equals?: string |
|
|
71
|
+
readonly equals?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
70
72
|
readonly flags?: string | import("purify-ts").Maybe<string>;
|
|
71
73
|
readonly groups?: (NamedNode | import("./shapes.js").sh_PropertyGroup) | readonly (NamedNode | import("./shapes.js").sh_PropertyGroup)[];
|
|
72
74
|
readonly hasValues?: (NamedNode | import("@rdfjs/types").Literal) | readonly (NamedNode | import("@rdfjs/types").Literal)[];
|
|
@@ -75,8 +77,8 @@ export declare function builder<NamespaceT extends NamespaceBuilder = NamespaceB
|
|
|
75
77
|
readonly isDefinedBy?: (NamedNode | import("./shapes.js").owl_Ontology) | import("purify-ts").Maybe<NamedNode | import("./shapes.js").owl_Ontology>;
|
|
76
78
|
readonly label?: string | import("purify-ts").Maybe<string>;
|
|
77
79
|
readonly languageIn?: readonly string[] | import("purify-ts").Maybe<readonly string[]>;
|
|
78
|
-
readonly lessThan?: string |
|
|
79
|
-
readonly lessThanOrEquals?: string |
|
|
80
|
+
readonly lessThan?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
81
|
+
readonly lessThanOrEquals?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
80
82
|
readonly maxCount?: bigint | import("purify-ts").Maybe<bigint>;
|
|
81
83
|
readonly maxExclusive?: bigint | boolean | number | string | Date | import("@rdfjs/types").Literal | import("purify-ts").Maybe<import("@rdfjs/types").Literal>;
|
|
82
84
|
readonly maxInclusive?: bigint | boolean | number | string | Date | import("@rdfjs/types").Literal | import("purify-ts").Maybe<import("@rdfjs/types").Literal>;
|
|
@@ -97,45 +99,45 @@ export declare function builder<NamespaceT extends NamespaceBuilder = NamespaceB
|
|
|
97
99
|
readonly pattern?: string | import("purify-ts").Maybe<string>;
|
|
98
100
|
readonly qualifiedMaxCount?: bigint | import("purify-ts").Maybe<bigint>;
|
|
99
101
|
readonly qualifiedMinCount?: bigint | import("purify-ts").Maybe<bigint>;
|
|
100
|
-
readonly qualifiedValueShape?: BlankNode | NamedNode
|
|
102
|
+
readonly qualifiedValueShape?: BlankNode | NamedNode<string> | import("purify-ts").Maybe<BlankNode | NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
101
103
|
readonly qualifiedValueShapesDisjoint?: boolean | import("purify-ts").Maybe<boolean>;
|
|
102
|
-
readonly resolve?: BlankNode | NamedNode
|
|
103
|
-
readonly severity?: ("
|
|
104
|
+
readonly resolve?: BlankNode | NamedNode<string> | import("purify-ts").Maybe<BlankNode | NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
105
|
+
readonly severity?: import("./shapes.js").sh_Severity["value"] | import("./shapes.js").sh_Severity | import("purify-ts").Maybe<import("./shapes.js").sh_Severity>;
|
|
104
106
|
readonly shaclmateName?: string | import("purify-ts").Maybe<string>;
|
|
105
|
-
readonly targetClasses?: string |
|
|
107
|
+
readonly targetClasses?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
106
108
|
readonly targetNodes?: (NamedNode | import("@rdfjs/types").Literal) | readonly (NamedNode | import("@rdfjs/types").Literal)[];
|
|
107
|
-
readonly targetObjectsOf?: string |
|
|
108
|
-
readonly targetSubjectsOf?: string |
|
|
109
|
+
readonly targetObjectsOf?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
110
|
+
readonly targetSubjectsOf?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
109
111
|
readonly uniqueLang?: boolean | import("purify-ts").Maybe<boolean>;
|
|
110
112
|
readonly xone?: readonly (NamedNode | import("./shapes.js").sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | import("./shapes.js").sh_Shape)[]>;
|
|
111
|
-
}, "$identifier" | "
|
|
113
|
+
}, "$identifier" | "path" | "in_" | "node" | "nodeKind" | "xone" | "maxCount" | "minCount"> & {
|
|
112
114
|
readonly cardinality?: "optional" | "required" | "set";
|
|
113
|
-
readonly class?: NamedNode<string> | (keyof NamespaceT & string) | readonly (NamedNode<string> | (keyof NamespaceT & string))[] | undefined;
|
|
114
115
|
readonly in_?: import("./shapes.js").skos_ConceptScheme | readonly (string | number | bigint | boolean | import("@rdfjs/types").Literal | Date | NamedNode<string>)[];
|
|
115
|
-
readonly node?: NamedNode<string> | (keyof
|
|
116
|
+
readonly node?: NamedNode<string> | (keyof DefaultNamespaceT & string) | undefined;
|
|
116
117
|
readonly nodeKind?: ((NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#BlankNode">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#Literal">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#BlankNodeOrIRI">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#BlankNodeOrLiteral">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#IRI">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#IRIOrLiteral">)) | ("BlankNode" | "Literal" | "BlankNodeOrIRI" | "BlankNodeOrLiteral" | "IRI" | "IRIOrLiteral");
|
|
117
|
-
readonly path?: import("@rdfx/resource").PropertyPath | (keyof
|
|
118
|
-
readonly
|
|
118
|
+
readonly path?: import("@rdfx/resource").PropertyPath | (keyof DefaultNamespaceT & string) | undefined;
|
|
119
|
+
readonly xone?: readonly (NamedNode<string> | import("./shapes.js").sh_Shape | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
119
120
|
}, "$identifier" | "path"> & {
|
|
120
|
-
readonly $identifier?: BlankNode | NamedNode<string> | (keyof
|
|
121
|
-
readonly path?: import("@rdfx/resource").PropertyPath | (keyof
|
|
122
|
-
}> | readonly (import("./shapes.js").sh_PropertyShape | (keyof
|
|
123
|
-
readonly type?: IriLike<
|
|
121
|
+
readonly $identifier?: BlankNode | NamedNode<string> | (keyof DefaultNamespaceT & string) | Exclude<keyof DefaultNamespaceT & string, string | (() => import("./shapes.js").sh_PropertyShape.Identifier)> | undefined;
|
|
122
|
+
readonly path?: import("@rdfx/resource").PropertyPath | (keyof DefaultNamespaceT & string) | undefined;
|
|
123
|
+
}> | readonly (import("./shapes.js").sh_PropertyShape | (keyof DefaultNamespaceT & string) | NamedNode<string>)[] | undefined;
|
|
124
|
+
readonly type?: IriLike<DefaultNamespaceT> | readonly IriLike<DefaultNamespaceT>[] | undefined;
|
|
124
125
|
readonly shaclmateName?: string;
|
|
125
|
-
readonly xone?: readonly (NamedNode<string> | (keyof
|
|
126
|
+
readonly xone?: readonly (NamedNode<string> | import("./shapes.js").sh_Shape | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
126
127
|
}) | undefined) => import("./shapes.js").sh_NodeShape;
|
|
127
|
-
PropertyShape: ($identifier: BlankNode | NamedNode<string> | (keyof
|
|
128
|
-
readonly $
|
|
128
|
+
PropertyShape: ($identifier: BlankNode | NamedNode<string> | (keyof DefaultNamespaceT & string) | Exclude<keyof DefaultNamespaceT & string, string | (() => import("./shapes.js").sh_PropertyShape.Identifier)> | undefined, parameters?: (Omit<{
|
|
129
|
+
readonly $defaultNamespace?: DefaultNamespaceT | undefined;
|
|
130
|
+
readonly $identifier?: BlankNode | NamedNode<string> | (() => import("./shapes.js").sh_PropertyShape.Identifier) | (keyof DefaultNamespaceT & string) | undefined;
|
|
129
131
|
readonly and?: readonly (NamedNode | import("./shapes.js").sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | import("./shapes.js").sh_Shape)[]>;
|
|
130
|
-
readonly class_?: string |
|
|
132
|
+
readonly class_?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
131
133
|
readonly comment?: string | import("purify-ts").Maybe<string>;
|
|
132
|
-
readonly datatype?: string |
|
|
134
|
+
readonly datatype?: NamedNode<string> | import("purify-ts").Maybe<NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
133
135
|
readonly deactivated?: boolean | import("purify-ts").Maybe<boolean>;
|
|
134
136
|
readonly defaultValue?: (NamedNode | import("@rdfjs/types").Literal) | import("purify-ts").Maybe<NamedNode | import("@rdfjs/types").Literal>;
|
|
135
137
|
readonly description?: string | import("purify-ts").Maybe<string>;
|
|
136
|
-
readonly disjoint?: string |
|
|
138
|
+
readonly disjoint?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
137
139
|
readonly display?: boolean;
|
|
138
|
-
readonly equals?: string |
|
|
140
|
+
readonly equals?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
139
141
|
readonly flags?: string | import("purify-ts").Maybe<string>;
|
|
140
142
|
readonly groups?: (NamedNode | import("./shapes.js").sh_PropertyGroup) | readonly (NamedNode | import("./shapes.js").sh_PropertyGroup)[];
|
|
141
143
|
readonly hasValues?: (NamedNode | import("@rdfjs/types").Literal) | readonly (NamedNode | import("@rdfjs/types").Literal)[];
|
|
@@ -144,8 +146,8 @@ export declare function builder<NamespaceT extends NamespaceBuilder = NamespaceB
|
|
|
144
146
|
readonly isDefinedBy?: (NamedNode | import("./shapes.js").owl_Ontology) | import("purify-ts").Maybe<NamedNode | import("./shapes.js").owl_Ontology>;
|
|
145
147
|
readonly label?: string | import("purify-ts").Maybe<string>;
|
|
146
148
|
readonly languageIn?: readonly string[] | import("purify-ts").Maybe<readonly string[]>;
|
|
147
|
-
readonly lessThan?: string |
|
|
148
|
-
readonly lessThanOrEquals?: string |
|
|
149
|
+
readonly lessThan?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
150
|
+
readonly lessThanOrEquals?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
149
151
|
readonly maxCount?: bigint | import("purify-ts").Maybe<bigint>;
|
|
150
152
|
readonly maxExclusive?: bigint | boolean | number | string | Date | import("@rdfjs/types").Literal | import("purify-ts").Maybe<import("@rdfjs/types").Literal>;
|
|
151
153
|
readonly maxInclusive?: bigint | boolean | number | string | Date | import("@rdfjs/types").Literal | import("purify-ts").Maybe<import("@rdfjs/types").Literal>;
|
|
@@ -166,36 +168,36 @@ export declare function builder<NamespaceT extends NamespaceBuilder = NamespaceB
|
|
|
166
168
|
readonly pattern?: string | import("purify-ts").Maybe<string>;
|
|
167
169
|
readonly qualifiedMaxCount?: bigint | import("purify-ts").Maybe<bigint>;
|
|
168
170
|
readonly qualifiedMinCount?: bigint | import("purify-ts").Maybe<bigint>;
|
|
169
|
-
readonly qualifiedValueShape?: BlankNode | NamedNode
|
|
171
|
+
readonly qualifiedValueShape?: BlankNode | NamedNode<string> | import("purify-ts").Maybe<BlankNode | NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
170
172
|
readonly qualifiedValueShapesDisjoint?: boolean | import("purify-ts").Maybe<boolean>;
|
|
171
|
-
readonly resolve?: BlankNode | NamedNode
|
|
172
|
-
readonly severity?: ("
|
|
173
|
+
readonly resolve?: BlankNode | NamedNode<string> | import("purify-ts").Maybe<BlankNode | NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
174
|
+
readonly severity?: import("./shapes.js").sh_Severity["value"] | import("./shapes.js").sh_Severity | import("purify-ts").Maybe<import("./shapes.js").sh_Severity>;
|
|
173
175
|
readonly shaclmateName?: string | import("purify-ts").Maybe<string>;
|
|
174
|
-
readonly targetClasses?: string |
|
|
176
|
+
readonly targetClasses?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
175
177
|
readonly targetNodes?: (NamedNode | import("@rdfjs/types").Literal) | readonly (NamedNode | import("@rdfjs/types").Literal)[];
|
|
176
|
-
readonly targetObjectsOf?: string |
|
|
177
|
-
readonly targetSubjectsOf?: string |
|
|
178
|
+
readonly targetObjectsOf?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
179
|
+
readonly targetSubjectsOf?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
178
180
|
readonly uniqueLang?: boolean | import("purify-ts").Maybe<boolean>;
|
|
179
181
|
readonly xone?: readonly (NamedNode | import("./shapes.js").sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | import("./shapes.js").sh_Shape)[]>;
|
|
180
|
-
}, "$identifier" | "
|
|
182
|
+
}, "$identifier" | "path" | "in_" | "node" | "nodeKind" | "xone" | "maxCount" | "minCount"> & {
|
|
181
183
|
readonly cardinality?: "optional" | "required" | "set";
|
|
182
|
-
readonly class?: NamedNode<string> | (keyof NamespaceT & string) | readonly (NamedNode<string> | (keyof NamespaceT & string))[] | undefined;
|
|
183
184
|
readonly in_?: import("./shapes.js").skos_ConceptScheme | readonly (string | number | bigint | boolean | import("@rdfjs/types").Literal | Date | NamedNode<string>)[];
|
|
184
|
-
readonly node?: NamedNode<string> | (keyof
|
|
185
|
+
readonly node?: NamedNode<string> | (keyof DefaultNamespaceT & string) | undefined;
|
|
185
186
|
readonly nodeKind?: ((NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#BlankNode">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#Literal">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#BlankNodeOrIRI">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#BlankNodeOrLiteral">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#IRI">) | (NamedNode<string> & NamedNode<"http://www.w3.org/ns/shacl#IRIOrLiteral">)) | ("BlankNode" | "Literal" | "BlankNodeOrIRI" | "BlankNodeOrLiteral" | "IRI" | "IRIOrLiteral");
|
|
186
|
-
readonly path?: import("@rdfx/resource").PropertyPath | (keyof
|
|
187
|
-
readonly
|
|
187
|
+
readonly path?: import("@rdfx/resource").PropertyPath | (keyof DefaultNamespaceT & string) | undefined;
|
|
188
|
+
readonly xone?: readonly (NamedNode<string> | import("./shapes.js").sh_Shape | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
188
189
|
}) | undefined) => ReturnType<typeof import("./shapes.js").sh_PropertyShape.createUnsafe>;
|
|
189
190
|
};
|
|
190
191
|
skos: {
|
|
191
192
|
namespace: NamespaceBuilder<keyof typeof import("@tpluscode/rdf-ns-builders").skos>;
|
|
192
|
-
Concept: ($identifier: NamedNode<string> | (keyof
|
|
193
|
-
ConceptScheme: <ConceptsRecordT extends { [K in keyof ConceptsRecordT]: Omit<import("./skos.js").ConvertibleConceptParameters<Extract<keyof ConceptsRecordT, string
|
|
194
|
-
readonly $identifier?: NamedNode<string> | (keyof
|
|
193
|
+
Concept: ($identifier: NamedNode<string> | (keyof DefaultNamespaceT & string), parameters?: import("./skos.js").ConvertibleConceptParameters<keyof DefaultNamespaceT & string, DefaultNamespaceT> | undefined) => import("./shapes.js").skos_Concept;
|
|
194
|
+
ConceptScheme: <ConceptsRecordT extends { [K in keyof ConceptsRecordT]: Omit<import("./skos.js").ConvertibleConceptParameters<Extract<keyof ConceptsRecordT, string>, DefaultNamespaceT>, "broader" | "notation"> & {
|
|
195
|
+
readonly $identifier?: NamedNode<string> | (keyof DefaultNamespaceT & string) | undefined;
|
|
195
196
|
readonly broader?: (import("./shapes.js").skos_Concept | NamedNode<string> | Extract<keyof ConceptsRecordT, string> | readonly (import("./shapes.js").skos_Concept | NamedNode<string> | Extract<keyof ConceptsRecordT, string>)[]) | undefined;
|
|
196
|
-
readonly notation?: boolean | import("
|
|
197
|
-
}; }>($identifier: NamedNode<string> | (keyof
|
|
198
|
-
readonly $
|
|
197
|
+
readonly notation?: boolean | (string | number | bigint | boolean | import("@rdfjs/types").Literal | Date | readonly (string | number | bigint | boolean | import("@rdfjs/types").Literal | Date)[] | undefined);
|
|
198
|
+
}; }>($identifier: NamedNode<string> | (keyof DefaultNamespaceT & string), parameters?: (Omit<{
|
|
199
|
+
readonly $defaultNamespace?: DefaultNamespaceT | undefined;
|
|
200
|
+
readonly $identifier: NamedNode<string> | (() => import("./shapes.js").skos_ConceptScheme.Identifier) | (keyof DefaultNamespaceT & string);
|
|
199
201
|
readonly altLabel?: string | import("@rdfjs/types").Literal | readonly (string | import("@rdfjs/types").Literal)[];
|
|
200
202
|
readonly concepts?: (NamedNode | import("./shapes.js").skos_Concept) | readonly (NamedNode | import("./shapes.js").skos_Concept)[];
|
|
201
203
|
readonly definition?: string | import("@rdfjs/types").Literal | readonly (string | import("@rdfjs/types").Literal)[];
|
|
@@ -203,7 +205,7 @@ export declare function builder<NamespaceT extends NamespaceBuilder = NamespaceB
|
|
|
203
205
|
readonly notation?: bigint | boolean | number | string | Date | import("@rdfjs/types").Literal | readonly (bigint | boolean | number | string | Date | import("@rdfjs/types").Literal)[];
|
|
204
206
|
readonly prefLabel?: string | import("@rdfjs/types").Literal | readonly (string | import("@rdfjs/types").Literal)[];
|
|
205
207
|
readonly topConcepts?: (NamedNode | import("./shapes.js").skos_Concept) | readonly (NamedNode | import("./shapes.js").skos_Concept)[];
|
|
206
|
-
readonly type?: string |
|
|
208
|
+
readonly type?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
207
209
|
}, "$identifier" | "concepts" | "topConcepts" | "termType"> & {
|
|
208
210
|
readonly concepts?: ConceptsRecordT | undefined;
|
|
209
211
|
}) | undefined) => import("./shapes.js").skos_ConceptScheme;
|
package/dist/builder.js
CHANGED
|
@@ -3,19 +3,20 @@ import dataFactory from "@rdfx/data-factory";
|
|
|
3
3
|
import { sh } from "./sh.js";
|
|
4
4
|
import { skos } from "./skos.js";
|
|
5
5
|
export function builder(options) {
|
|
6
|
-
const
|
|
6
|
+
const defaultNamespace = (options?.defaultNamespace ??
|
|
7
|
+
namespace(""));
|
|
7
8
|
const toIri = (iri) => {
|
|
8
9
|
switch (typeof iri) {
|
|
9
10
|
case "object":
|
|
10
11
|
return iri;
|
|
11
12
|
case "string":
|
|
12
|
-
return
|
|
13
|
+
return defaultNamespace(iri);
|
|
13
14
|
default:
|
|
14
15
|
throw new RangeError(typeof iri);
|
|
15
16
|
}
|
|
16
17
|
};
|
|
17
18
|
const builderBuilderParameters = {
|
|
18
|
-
|
|
19
|
+
defaultNamespace,
|
|
19
20
|
toIdentifier: (identifier) => {
|
|
20
21
|
switch (typeof identifier) {
|
|
21
22
|
case "object":
|
package/dist/sh.d.ts
CHANGED
|
@@ -4,28 +4,29 @@ import type { PropertyPath } from "@rdfx/resource";
|
|
|
4
4
|
import { sh as _namespace } from "@tpluscode/rdf-ns-builders";
|
|
5
5
|
import type { BuilderBuilderParameters } from "./BuilderBuilderParameters.js";
|
|
6
6
|
import type { IriLike } from "./IriLike.js";
|
|
7
|
-
import { sh_NodeShape, sh_PropertyShape, type skos_ConceptScheme } from "./shapes.js";
|
|
7
|
+
import { sh_NodeShape, sh_PropertyShape, type sh_Shape, type skos_ConceptScheme } from "./shapes.js";
|
|
8
8
|
type ConvertibleInArray = readonly (bigint | boolean | Date | Literal | NamedNode | number | string)[];
|
|
9
9
|
type NodeKindIri = (typeof _namespace)["BlankNode"] | (typeof _namespace)["BlankNodeOrIRI"] | (typeof _namespace)["BlankNodeOrLiteral"] | (typeof _namespace)["IRI"] | (typeof _namespace)["IRIOrLiteral"] | (typeof _namespace)["Literal"];
|
|
10
10
|
type NodeKindString = "BlankNode" | "BlankNodeOrIRI" | "BlankNodeOrLiteral" | "IRI" | "IRIOrLiteral" | "Literal";
|
|
11
|
-
export declare function sh<
|
|
11
|
+
export declare function sh<DefaultNamespaceT extends NamespaceBuilder>({ defaultNamespace, toIdentifier, toIri, toIriArray, }: BuilderBuilderParameters<DefaultNamespaceT>): {
|
|
12
12
|
namespace: NamespaceBuilder<keyof typeof _namespace>;
|
|
13
|
-
NodeShape: ($identifier: Exclude<NonNullable<Parameters<typeof sh_NodeShape.createUnsafe
|
|
13
|
+
NodeShape: ($identifier: Exclude<NonNullable<Parameters<typeof sh_NodeShape.createUnsafe<DefaultNamespaceT>>[0]>["$identifier"], string | (() => sh_NodeShape.Identifier)> | (keyof DefaultNamespaceT & string), parameters?: Omit<NonNullable<Parameters<typeof sh_NodeShape.createUnsafe<DefaultNamespaceT>>[0]>, "$identifier" | "in_" | "nodeKind" | "properties" | "shaclmateName" | "type" | "xone"> & {
|
|
14
14
|
readonly in_?: skos_ConceptScheme | ConvertibleInArray;
|
|
15
15
|
readonly implicitClassTarget?: true;
|
|
16
16
|
readonly nodeKind?: NodeKindIri | NodeKindString;
|
|
17
17
|
readonly properties?: Record<string, Omit<Omit<{
|
|
18
|
-
readonly $
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
18
|
+
readonly $defaultNamespace?: DefaultNamespaceT | undefined;
|
|
19
|
+
readonly $identifier?: BlankNode | NamedNode<string> | (() => sh_PropertyShape.Identifier) | (keyof DefaultNamespaceT & string) | undefined;
|
|
20
|
+
readonly and?: readonly (NamedNode | sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | sh_Shape)[]>;
|
|
21
|
+
readonly class_?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
21
22
|
readonly comment?: string | import("purify-ts").Maybe<string>;
|
|
22
|
-
readonly datatype?: string |
|
|
23
|
+
readonly datatype?: NamedNode<string> | import("purify-ts").Maybe<NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
23
24
|
readonly deactivated?: boolean | import("purify-ts").Maybe<boolean>;
|
|
24
25
|
readonly defaultValue?: (NamedNode | Literal) | import("purify-ts").Maybe<NamedNode | Literal>;
|
|
25
26
|
readonly description?: string | import("purify-ts").Maybe<string>;
|
|
26
|
-
readonly disjoint?: string |
|
|
27
|
+
readonly disjoint?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
27
28
|
readonly display?: boolean;
|
|
28
|
-
readonly equals?: string |
|
|
29
|
+
readonly equals?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
29
30
|
readonly flags?: string | import("purify-ts").Maybe<string>;
|
|
30
31
|
readonly groups?: (NamedNode | import("./shapes.js").sh_PropertyGroup) | readonly (NamedNode | import("./shapes.js").sh_PropertyGroup)[];
|
|
31
32
|
readonly hasValues?: (NamedNode | Literal) | readonly (NamedNode | Literal)[];
|
|
@@ -34,8 +35,8 @@ export declare function sh<NamespaceT extends NamespaceBuilder>({ namespace, toI
|
|
|
34
35
|
readonly isDefinedBy?: (NamedNode | import("./shapes.js").owl_Ontology) | import("purify-ts").Maybe<NamedNode | import("./shapes.js").owl_Ontology>;
|
|
35
36
|
readonly label?: string | import("purify-ts").Maybe<string>;
|
|
36
37
|
readonly languageIn?: readonly string[] | import("purify-ts").Maybe<readonly string[]>;
|
|
37
|
-
readonly lessThan?: string |
|
|
38
|
-
readonly lessThanOrEquals?: string |
|
|
38
|
+
readonly lessThan?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
39
|
+
readonly lessThanOrEquals?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
39
40
|
readonly maxCount?: bigint | import("purify-ts").Maybe<bigint>;
|
|
40
41
|
readonly maxExclusive?: bigint | boolean | number | string | Date | Literal | import("purify-ts").Maybe<Literal>;
|
|
41
42
|
readonly maxInclusive?: bigint | boolean | number | string | Date | Literal | import("purify-ts").Maybe<Literal>;
|
|
@@ -50,56 +51,53 @@ export declare function sh<NamespaceT extends NamespaceBuilder>({ namespace, toI
|
|
|
50
51
|
readonly node?: (NamedNode | sh_NodeShape) | import("purify-ts").Maybe<NamedNode | sh_NodeShape>;
|
|
51
52
|
readonly nodeKind?: ("http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal") | NamedNode<"http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal"> | import("purify-ts").Maybe<NamedNode<"http://www.w3.org/ns/shacl#BlankNode" | "http://www.w3.org/ns/shacl#BlankNodeOrIRI" | "http://www.w3.org/ns/shacl#BlankNodeOrLiteral" | "http://www.w3.org/ns/shacl#IRI" | "http://www.w3.org/ns/shacl#IRIOrLiteral" | "http://www.w3.org/ns/shacl#Literal">>;
|
|
52
53
|
readonly not?: (NamedNode | sh_NodeShape) | readonly (NamedNode | sh_NodeShape)[];
|
|
53
|
-
readonly or?: readonly (NamedNode |
|
|
54
|
+
readonly or?: readonly (NamedNode | sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | sh_Shape)[]>;
|
|
54
55
|
readonly order?: number | import("purify-ts").Maybe<number>;
|
|
55
56
|
readonly path: import("./shapes.js").$PropertyPath;
|
|
56
57
|
readonly pattern?: string | import("purify-ts").Maybe<string>;
|
|
57
58
|
readonly qualifiedMaxCount?: bigint | import("purify-ts").Maybe<bigint>;
|
|
58
59
|
readonly qualifiedMinCount?: bigint | import("purify-ts").Maybe<bigint>;
|
|
59
|
-
readonly qualifiedValueShape?: BlankNode | NamedNode
|
|
60
|
+
readonly qualifiedValueShape?: BlankNode | NamedNode<string> | import("purify-ts").Maybe<BlankNode | NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
60
61
|
readonly qualifiedValueShapesDisjoint?: boolean | import("purify-ts").Maybe<boolean>;
|
|
61
|
-
readonly resolve?: BlankNode | NamedNode
|
|
62
|
-
readonly severity?: ("
|
|
62
|
+
readonly resolve?: BlankNode | NamedNode<string> | import("purify-ts").Maybe<BlankNode | NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
63
|
+
readonly severity?: import("./shapes.js").sh_Severity["value"] | import("./shapes.js").sh_Severity | import("purify-ts").Maybe<import("./shapes.js").sh_Severity>;
|
|
63
64
|
readonly shaclmateName?: string | import("purify-ts").Maybe<string>;
|
|
64
|
-
readonly targetClasses?: string |
|
|
65
|
+
readonly targetClasses?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
65
66
|
readonly targetNodes?: (NamedNode | Literal) | readonly (NamedNode | Literal)[];
|
|
66
|
-
readonly targetObjectsOf?: string |
|
|
67
|
-
readonly targetSubjectsOf?: string |
|
|
67
|
+
readonly targetObjectsOf?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
68
|
+
readonly targetSubjectsOf?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
68
69
|
readonly uniqueLang?: boolean | import("purify-ts").Maybe<boolean>;
|
|
69
|
-
readonly xone?: readonly (NamedNode |
|
|
70
|
-
}, "$identifier" | "
|
|
70
|
+
readonly xone?: readonly (NamedNode | sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | sh_Shape)[]>;
|
|
71
|
+
}, "$identifier" | "path" | "in_" | "node" | "nodeKind" | "xone" | "maxCount" | "minCount"> & {
|
|
71
72
|
readonly cardinality?: "optional" | "required" | "set";
|
|
72
|
-
readonly class?: NamedNode | (keyof NamespaceT & string) | readonly (NamedNode | (keyof NamespaceT & string))[];
|
|
73
73
|
readonly in_?: skos_ConceptScheme | ConvertibleInArray;
|
|
74
|
-
readonly node?: NamedNode | (keyof
|
|
74
|
+
readonly node?: NamedNode | (keyof DefaultNamespaceT & string);
|
|
75
75
|
readonly nodeKind?: NodeKindIri | NodeKindString;
|
|
76
|
-
readonly path?: (keyof
|
|
77
|
-
readonly
|
|
76
|
+
readonly path?: (keyof DefaultNamespaceT & string) | PropertyPath;
|
|
77
|
+
readonly xone?: readonly (NamedNode | (keyof DefaultNamespaceT & string) | sh_Shape)[];
|
|
78
78
|
}, "$identifier" | "path"> & {
|
|
79
|
-
readonly $identifier?: Parameters<($identifier: Exclude<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe
|
|
79
|
+
readonly $identifier?: Parameters<($identifier: Exclude<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe<DefaultNamespaceT>>[0]>["$identifier"], string | (() => sh_PropertyShape.Identifier)> | (keyof DefaultNamespaceT & string), parameters?: Omit<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe<DefaultNamespaceT>>[0]>, "$identifier" | "in_" | "maxCount" | "minCount" | "node" | "nodeKind" | "path" | "xone"> & {
|
|
80
80
|
readonly cardinality?: "optional" | "required" | "set";
|
|
81
|
-
readonly class?: NamedNode | (keyof NamespaceT & string) | readonly (NamedNode | (keyof NamespaceT & string))[];
|
|
82
81
|
readonly in_?: skos_ConceptScheme | ConvertibleInArray;
|
|
83
|
-
readonly node?: NamedNode | (keyof
|
|
82
|
+
readonly node?: NamedNode | (keyof DefaultNamespaceT & string);
|
|
84
83
|
readonly nodeKind?: NodeKindIri | NodeKindString;
|
|
85
|
-
readonly path?: (keyof
|
|
86
|
-
readonly
|
|
87
|
-
}) => ReturnType<typeof sh_PropertyShape.createUnsafe
|
|
88
|
-
readonly path?: (keyof
|
|
89
|
-
}> | readonly (sh_PropertyShape | (keyof
|
|
90
|
-
readonly type?: IriLike<
|
|
84
|
+
readonly path?: (keyof DefaultNamespaceT & string) | PropertyPath;
|
|
85
|
+
readonly xone?: readonly (NamedNode | (keyof DefaultNamespaceT & string) | sh_Shape)[];
|
|
86
|
+
}) => ReturnType<typeof sh_PropertyShape.createUnsafe<DefaultNamespaceT>>>[0];
|
|
87
|
+
readonly path?: (keyof DefaultNamespaceT & string) | PropertyPath;
|
|
88
|
+
}> | readonly (sh_PropertyShape | (keyof DefaultNamespaceT & string) | NamedNode<string>)[];
|
|
89
|
+
readonly type?: IriLike<DefaultNamespaceT> | readonly IriLike<DefaultNamespaceT>[];
|
|
91
90
|
readonly shaclmateName?: string;
|
|
92
|
-
readonly xone?: readonly (NamedNode | (keyof
|
|
91
|
+
readonly xone?: readonly (NamedNode | (keyof DefaultNamespaceT & string) | sh_Shape)[];
|
|
93
92
|
}) => sh_NodeShape;
|
|
94
|
-
PropertyShape: ($identifier: Exclude<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe
|
|
93
|
+
PropertyShape: ($identifier: Exclude<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe<DefaultNamespaceT>>[0]>["$identifier"], string | (() => sh_PropertyShape.Identifier)> | (keyof DefaultNamespaceT & string), parameters?: Omit<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe<DefaultNamespaceT>>[0]>, "$identifier" | "in_" | "maxCount" | "minCount" | "node" | "nodeKind" | "path" | "xone"> & {
|
|
95
94
|
readonly cardinality?: "optional" | "required" | "set";
|
|
96
|
-
readonly class?: NamedNode | (keyof NamespaceT & string) | readonly (NamedNode | (keyof NamespaceT & string))[];
|
|
97
95
|
readonly in_?: skos_ConceptScheme | ConvertibleInArray;
|
|
98
|
-
readonly node?: NamedNode | (keyof
|
|
96
|
+
readonly node?: NamedNode | (keyof DefaultNamespaceT & string);
|
|
99
97
|
readonly nodeKind?: NodeKindIri | NodeKindString;
|
|
100
|
-
readonly path?: (keyof
|
|
101
|
-
readonly
|
|
102
|
-
}) => ReturnType<typeof sh_PropertyShape.createUnsafe
|
|
98
|
+
readonly path?: (keyof DefaultNamespaceT & string) | PropertyPath;
|
|
99
|
+
readonly xone?: readonly (NamedNode | (keyof DefaultNamespaceT & string) | sh_Shape)[];
|
|
100
|
+
}) => ReturnType<typeof sh_PropertyShape.createUnsafe<DefaultNamespaceT>>;
|
|
103
101
|
};
|
|
104
102
|
export {};
|
|
105
103
|
//# sourceMappingURL=sh.d.ts.map
|
package/dist/sh.js
CHANGED
|
@@ -31,10 +31,10 @@ function convertNodeKind(nodeKind) {
|
|
|
31
31
|
}
|
|
32
32
|
return _namespace[nodeKind];
|
|
33
33
|
}
|
|
34
|
-
export function sh({
|
|
34
|
+
export function sh({ defaultNamespace, toIdentifier, toIri, toIriArray, }) {
|
|
35
35
|
function PropertyShape($identifier, parameters) {
|
|
36
36
|
// Order of default population matters here.
|
|
37
|
-
const { cardinality: cardinalityParameter,
|
|
37
|
+
const { cardinality: cardinalityParameter, in_: inParameter, path: pathParameter, node: nodeParameter, nodeKind: nodeKindParameter, xone: xoneParameter, ...otherParameters } = parameters ?? {};
|
|
38
38
|
const $identifierTerm = toIdentifier($identifier);
|
|
39
39
|
let path;
|
|
40
40
|
switch (typeof pathParameter) {
|
|
@@ -70,8 +70,8 @@ export function sh({ namespace, toIdentifier, toIri, toIriArray, }) {
|
|
|
70
70
|
}
|
|
71
71
|
return sh_PropertyShape.createUnsafe({
|
|
72
72
|
...otherParameters,
|
|
73
|
+
$defaultNamespace: defaultNamespace,
|
|
73
74
|
$identifier: $identifierTerm,
|
|
74
|
-
class_: classParameter ? toIriArray(classParameter) : undefined,
|
|
75
75
|
in_: convertIn(inParameter),
|
|
76
76
|
maxCount,
|
|
77
77
|
minCount,
|
|
@@ -80,7 +80,9 @@ export function sh({ namespace, toIdentifier, toIri, toIriArray, }) {
|
|
|
80
80
|
? convertNodeKind(nodeKindParameter)
|
|
81
81
|
: undefined,
|
|
82
82
|
path,
|
|
83
|
-
|
|
83
|
+
xone: xoneParameter
|
|
84
|
+
? xoneParameter.map((xoneMember) => typeof xoneMember === "string" ? toIri(xoneMember) : xoneMember)
|
|
85
|
+
: undefined,
|
|
84
86
|
});
|
|
85
87
|
}
|
|
86
88
|
return {
|
|
@@ -118,7 +120,7 @@ export function sh({ namespace, toIdentifier, toIri, toIriArray, }) {
|
|
|
118
120
|
name = key;
|
|
119
121
|
}
|
|
120
122
|
if (!path) {
|
|
121
|
-
path =
|
|
123
|
+
path = defaultNamespace(key);
|
|
122
124
|
}
|
|
123
125
|
return PropertyShape(identifierTerm, {
|
|
124
126
|
...otherPropertyParameters,
|
|
@@ -145,13 +147,16 @@ export function sh({ namespace, toIdentifier, toIri, toIriArray, }) {
|
|
|
145
147
|
}
|
|
146
148
|
return sh_NodeShape.createUnsafe({
|
|
147
149
|
...otherParameters,
|
|
150
|
+
$defaultNamespace: defaultNamespace,
|
|
148
151
|
$identifier: nodeShapeIdentifier,
|
|
149
152
|
in_: convertIn(inParameter),
|
|
150
153
|
nodeKind: convertNodeKind(nodeKindParameter),
|
|
151
154
|
properties,
|
|
152
155
|
shaclmateName,
|
|
153
156
|
type,
|
|
154
|
-
xone: xoneParameter
|
|
157
|
+
xone: xoneParameter
|
|
158
|
+
? xoneParameter.map((xoneMember) => typeof xoneMember === "string" ? toIri(xoneMember) : xoneMember)
|
|
159
|
+
: undefined,
|
|
155
160
|
});
|
|
156
161
|
},
|
|
157
162
|
PropertyShape,
|