@rdfx/builder 0.0.42 → 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 -68
- package/dist/builder.js +4 -3
- package/dist/sh.d.ts +34 -39
- package/dist/sh.js +5 -5
- 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,46 +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" | "in_" | "node" | "nodeKind" | "xone" | "maxCount" | "minCount"
|
|
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
|
|
119
|
-
readonly xone?: readonly (NamedNode<string> | import("./shapes.js").sh_Shape | (keyof NamespaceT & string))[] | undefined;
|
|
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;
|
|
120
120
|
}, "$identifier" | "path"> & {
|
|
121
|
-
readonly $identifier?: BlankNode | NamedNode<string> | (keyof
|
|
122
|
-
readonly path?: import("@rdfx/resource").PropertyPath | (keyof
|
|
123
|
-
}> | readonly (import("./shapes.js").sh_PropertyShape | (keyof
|
|
124
|
-
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;
|
|
125
125
|
readonly shaclmateName?: string;
|
|
126
|
-
readonly xone?: readonly (NamedNode<string> | import("./shapes.js").sh_Shape | (keyof
|
|
126
|
+
readonly xone?: readonly (NamedNode<string> | import("./shapes.js").sh_Shape | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
127
127
|
}) | undefined) => import("./shapes.js").sh_NodeShape;
|
|
128
|
-
PropertyShape: ($identifier: BlankNode | NamedNode<string> | (keyof
|
|
129
|
-
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;
|
|
130
131
|
readonly and?: readonly (NamedNode | import("./shapes.js").sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | import("./shapes.js").sh_Shape)[]>;
|
|
131
|
-
readonly class_?: string |
|
|
132
|
+
readonly class_?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
132
133
|
readonly comment?: string | import("purify-ts").Maybe<string>;
|
|
133
|
-
readonly datatype?: string |
|
|
134
|
+
readonly datatype?: NamedNode<string> | import("purify-ts").Maybe<NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
134
135
|
readonly deactivated?: boolean | import("purify-ts").Maybe<boolean>;
|
|
135
136
|
readonly defaultValue?: (NamedNode | import("@rdfjs/types").Literal) | import("purify-ts").Maybe<NamedNode | import("@rdfjs/types").Literal>;
|
|
136
137
|
readonly description?: string | import("purify-ts").Maybe<string>;
|
|
137
|
-
readonly disjoint?: string |
|
|
138
|
+
readonly disjoint?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
138
139
|
readonly display?: boolean;
|
|
139
|
-
readonly equals?: string |
|
|
140
|
+
readonly equals?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
140
141
|
readonly flags?: string | import("purify-ts").Maybe<string>;
|
|
141
142
|
readonly groups?: (NamedNode | import("./shapes.js").sh_PropertyGroup) | readonly (NamedNode | import("./shapes.js").sh_PropertyGroup)[];
|
|
142
143
|
readonly hasValues?: (NamedNode | import("@rdfjs/types").Literal) | readonly (NamedNode | import("@rdfjs/types").Literal)[];
|
|
@@ -145,8 +146,8 @@ export declare function builder<NamespaceT extends NamespaceBuilder = NamespaceB
|
|
|
145
146
|
readonly isDefinedBy?: (NamedNode | import("./shapes.js").owl_Ontology) | import("purify-ts").Maybe<NamedNode | import("./shapes.js").owl_Ontology>;
|
|
146
147
|
readonly label?: string | import("purify-ts").Maybe<string>;
|
|
147
148
|
readonly languageIn?: readonly string[] | import("purify-ts").Maybe<readonly string[]>;
|
|
148
|
-
readonly lessThan?: string |
|
|
149
|
-
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;
|
|
150
151
|
readonly maxCount?: bigint | import("purify-ts").Maybe<bigint>;
|
|
151
152
|
readonly maxExclusive?: bigint | boolean | number | string | Date | import("@rdfjs/types").Literal | import("purify-ts").Maybe<import("@rdfjs/types").Literal>;
|
|
152
153
|
readonly maxInclusive?: bigint | boolean | number | string | Date | import("@rdfjs/types").Literal | import("purify-ts").Maybe<import("@rdfjs/types").Literal>;
|
|
@@ -167,37 +168,36 @@ export declare function builder<NamespaceT extends NamespaceBuilder = NamespaceB
|
|
|
167
168
|
readonly pattern?: string | import("purify-ts").Maybe<string>;
|
|
168
169
|
readonly qualifiedMaxCount?: bigint | import("purify-ts").Maybe<bigint>;
|
|
169
170
|
readonly qualifiedMinCount?: bigint | import("purify-ts").Maybe<bigint>;
|
|
170
|
-
readonly qualifiedValueShape?: BlankNode | NamedNode
|
|
171
|
+
readonly qualifiedValueShape?: BlankNode | NamedNode<string> | import("purify-ts").Maybe<BlankNode | NamedNode<string>> | (keyof DefaultNamespaceT & string) | undefined;
|
|
171
172
|
readonly qualifiedValueShapesDisjoint?: boolean | import("purify-ts").Maybe<boolean>;
|
|
172
|
-
readonly resolve?: BlankNode | NamedNode
|
|
173
|
-
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>;
|
|
174
175
|
readonly shaclmateName?: string | import("purify-ts").Maybe<string>;
|
|
175
|
-
readonly targetClasses?: string |
|
|
176
|
+
readonly targetClasses?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
176
177
|
readonly targetNodes?: (NamedNode | import("@rdfjs/types").Literal) | readonly (NamedNode | import("@rdfjs/types").Literal)[];
|
|
177
|
-
readonly targetObjectsOf?: string |
|
|
178
|
-
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;
|
|
179
180
|
readonly uniqueLang?: boolean | import("purify-ts").Maybe<boolean>;
|
|
180
181
|
readonly xone?: readonly (NamedNode | import("./shapes.js").sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | import("./shapes.js").sh_Shape)[]>;
|
|
181
|
-
}, "$identifier" | "in_" | "node" | "nodeKind" | "xone" | "maxCount" | "minCount"
|
|
182
|
+
}, "$identifier" | "path" | "in_" | "node" | "nodeKind" | "xone" | "maxCount" | "minCount"> & {
|
|
182
183
|
readonly cardinality?: "optional" | "required" | "set";
|
|
183
|
-
readonly class?: NamedNode<string> | (keyof NamespaceT & string) | readonly (NamedNode<string> | (keyof NamespaceT & string))[] | undefined;
|
|
184
184
|
readonly in_?: import("./shapes.js").skos_ConceptScheme | readonly (string | number | bigint | boolean | import("@rdfjs/types").Literal | Date | NamedNode<string>)[];
|
|
185
|
-
readonly node?: NamedNode<string> | (keyof
|
|
185
|
+
readonly node?: NamedNode<string> | (keyof DefaultNamespaceT & string) | undefined;
|
|
186
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");
|
|
187
|
-
readonly path?: import("@rdfx/resource").PropertyPath | (keyof
|
|
188
|
-
readonly
|
|
189
|
-
readonly xone?: readonly (NamedNode<string> | import("./shapes.js").sh_Shape | (keyof NamespaceT & string))[] | undefined;
|
|
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;
|
|
190
189
|
}) | undefined) => ReturnType<typeof import("./shapes.js").sh_PropertyShape.createUnsafe>;
|
|
191
190
|
};
|
|
192
191
|
skos: {
|
|
193
192
|
namespace: NamespaceBuilder<keyof typeof import("@tpluscode/rdf-ns-builders").skos>;
|
|
194
|
-
Concept: ($identifier: NamedNode<string> | (keyof
|
|
195
|
-
ConceptScheme: <ConceptsRecordT extends { [K in keyof ConceptsRecordT]: Omit<import("./skos.js").ConvertibleConceptParameters<Extract<keyof ConceptsRecordT, string
|
|
196
|
-
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;
|
|
197
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;
|
|
198
|
-
readonly notation?: boolean | import("
|
|
199
|
-
}; }>($identifier: NamedNode<string> | (keyof
|
|
200
|
-
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);
|
|
201
201
|
readonly altLabel?: string | import("@rdfjs/types").Literal | readonly (string | import("@rdfjs/types").Literal)[];
|
|
202
202
|
readonly concepts?: (NamedNode | import("./shapes.js").skos_Concept) | readonly (NamedNode | import("./shapes.js").skos_Concept)[];
|
|
203
203
|
readonly definition?: string | import("@rdfjs/types").Literal | readonly (string | import("@rdfjs/types").Literal)[];
|
|
@@ -205,7 +205,7 @@ export declare function builder<NamespaceT extends NamespaceBuilder = NamespaceB
|
|
|
205
205
|
readonly notation?: bigint | boolean | number | string | Date | import("@rdfjs/types").Literal | readonly (bigint | boolean | number | string | Date | import("@rdfjs/types").Literal)[];
|
|
206
206
|
readonly prefLabel?: string | import("@rdfjs/types").Literal | readonly (string | import("@rdfjs/types").Literal)[];
|
|
207
207
|
readonly topConcepts?: (NamedNode | import("./shapes.js").skos_Concept) | readonly (NamedNode | import("./shapes.js").skos_Concept)[];
|
|
208
|
-
readonly type?: string |
|
|
208
|
+
readonly type?: NamedNode<string> | (keyof DefaultNamespaceT & string) | readonly (NamedNode<string> | (keyof DefaultNamespaceT & string))[] | undefined;
|
|
209
209
|
}, "$identifier" | "concepts" | "topConcepts" | "termType"> & {
|
|
210
210
|
readonly concepts?: ConceptsRecordT | undefined;
|
|
211
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
|
@@ -8,24 +8,25 @@ import { sh_NodeShape, sh_PropertyShape, type sh_Shape, type skos_ConceptScheme
|
|
|
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 $
|
|
18
|
+
readonly $defaultNamespace?: DefaultNamespaceT | undefined;
|
|
19
|
+
readonly $identifier?: BlankNode | NamedNode<string> | (() => sh_PropertyShape.Identifier) | (keyof DefaultNamespaceT & string) | undefined;
|
|
19
20
|
readonly and?: readonly (NamedNode | sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | sh_Shape)[]>;
|
|
20
|
-
readonly class_?: string |
|
|
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>;
|
|
@@ -56,53 +57,47 @@ export declare function sh<NamespaceT extends NamespaceBuilder>({ namespace, toI
|
|
|
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
70
|
readonly xone?: readonly (NamedNode | sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | sh_Shape)[]>;
|
|
70
|
-
}, "$identifier" | "in_" | "node" | "nodeKind" | "xone" | "maxCount" | "minCount"
|
|
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
|
|
78
|
-
readonly xone?: readonly (NamedNode | (keyof NamespaceT & string) | sh_Shape)[];
|
|
76
|
+
readonly path?: (keyof DefaultNamespaceT & string) | PropertyPath;
|
|
77
|
+
readonly xone?: readonly (NamedNode | (keyof DefaultNamespaceT & string) | sh_Shape)[];
|
|
79
78
|
}, "$identifier" | "path"> & {
|
|
80
|
-
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"> & {
|
|
81
80
|
readonly cardinality?: "optional" | "required" | "set";
|
|
82
|
-
readonly class?: NamedNode | (keyof NamespaceT & string) | readonly (NamedNode | (keyof NamespaceT & string))[];
|
|
83
81
|
readonly in_?: skos_ConceptScheme | ConvertibleInArray;
|
|
84
|
-
readonly node?: NamedNode | (keyof
|
|
82
|
+
readonly node?: NamedNode | (keyof DefaultNamespaceT & string);
|
|
85
83
|
readonly nodeKind?: NodeKindIri | NodeKindString;
|
|
86
|
-
readonly path?: (keyof
|
|
87
|
-
readonly
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
readonly type?: IriLike<NamespaceT> | readonly IriLike<NamespaceT>[];
|
|
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>[];
|
|
93
90
|
readonly shaclmateName?: string;
|
|
94
|
-
readonly xone?: readonly (NamedNode | (keyof
|
|
91
|
+
readonly xone?: readonly (NamedNode | (keyof DefaultNamespaceT & string) | sh_Shape)[];
|
|
95
92
|
}) => sh_NodeShape;
|
|
96
|
-
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"> & {
|
|
97
94
|
readonly cardinality?: "optional" | "required" | "set";
|
|
98
|
-
readonly class?: NamedNode | (keyof NamespaceT & string) | readonly (NamedNode | (keyof NamespaceT & string))[];
|
|
99
95
|
readonly in_?: skos_ConceptScheme | ConvertibleInArray;
|
|
100
|
-
readonly node?: NamedNode | (keyof
|
|
96
|
+
readonly node?: NamedNode | (keyof DefaultNamespaceT & string);
|
|
101
97
|
readonly nodeKind?: NodeKindIri | NodeKindString;
|
|
102
|
-
readonly path?: (keyof
|
|
103
|
-
readonly
|
|
104
|
-
|
|
105
|
-
}) => 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>>;
|
|
106
101
|
};
|
|
107
102
|
export {};
|
|
108
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,6 @@ export function sh({ namespace, toIdentifier, toIri, toIriArray, }) {
|
|
|
80
80
|
? convertNodeKind(nodeKindParameter)
|
|
81
81
|
: undefined,
|
|
82
82
|
path,
|
|
83
|
-
resolve: resolveParameter ? toIri(resolveParameter) : undefined,
|
|
84
83
|
xone: xoneParameter
|
|
85
84
|
? xoneParameter.map((xoneMember) => typeof xoneMember === "string" ? toIri(xoneMember) : xoneMember)
|
|
86
85
|
: undefined,
|
|
@@ -121,7 +120,7 @@ export function sh({ namespace, toIdentifier, toIri, toIriArray, }) {
|
|
|
121
120
|
name = key;
|
|
122
121
|
}
|
|
123
122
|
if (!path) {
|
|
124
|
-
path =
|
|
123
|
+
path = defaultNamespace(key);
|
|
125
124
|
}
|
|
126
125
|
return PropertyShape(identifierTerm, {
|
|
127
126
|
...otherPropertyParameters,
|
|
@@ -148,6 +147,7 @@ export function sh({ namespace, toIdentifier, toIri, toIriArray, }) {
|
|
|
148
147
|
}
|
|
149
148
|
return sh_NodeShape.createUnsafe({
|
|
150
149
|
...otherParameters,
|
|
150
|
+
$defaultNamespace: defaultNamespace,
|
|
151
151
|
$identifier: nodeShapeIdentifier,
|
|
152
152
|
in_: convertIn(inParameter),
|
|
153
153
|
nodeKind: convertNodeKind(nodeKindParameter),
|