@rdfx/builder 0.0.41 → 0.0.42

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/builder.d.ts CHANGED
@@ -108,7 +108,7 @@ export declare function builder<NamespaceT extends NamespaceBuilder = NamespaceB
108
108
  readonly targetSubjectsOf?: string | NamedNode | readonly (string | NamedNode)[];
109
109
  readonly uniqueLang?: boolean | import("purify-ts").Maybe<boolean>;
110
110
  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" | "maxCount" | "minCount" | "path" | "resolve" | "classes"> & {
111
+ }, "$identifier" | "in_" | "node" | "nodeKind" | "xone" | "maxCount" | "minCount" | "path" | "resolve" | "classes"> & {
112
112
  readonly cardinality?: "optional" | "required" | "set";
113
113
  readonly class?: NamedNode<string> | (keyof NamespaceT & string) | readonly (NamedNode<string> | (keyof NamespaceT & string))[] | undefined;
114
114
  readonly in_?: import("./shapes.js").skos_ConceptScheme | readonly (string | number | bigint | boolean | import("@rdfjs/types").Literal | Date | NamedNode<string>)[];
@@ -116,13 +116,14 @@ export declare function builder<NamespaceT extends NamespaceBuilder = NamespaceB
116
116
  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
117
  readonly path?: import("@rdfx/resource").PropertyPath | (keyof NamespaceT & string) | undefined;
118
118
  readonly resolve?: NamedNode<string> | (keyof NamespaceT & string) | undefined;
119
+ readonly xone?: readonly (NamedNode<string> | import("./shapes.js").sh_Shape | (keyof NamespaceT & string))[] | undefined;
119
120
  }, "$identifier" | "path"> & {
120
121
  readonly $identifier?: BlankNode | NamedNode<string> | (keyof NamespaceT & string) | undefined;
121
122
  readonly path?: import("@rdfx/resource").PropertyPath | (keyof NamespaceT & string) | undefined;
122
123
  }> | readonly (import("./shapes.js").sh_PropertyShape | (keyof NamespaceT & string) | NamedNode<string>)[] | undefined;
123
124
  readonly type?: IriLike<NamespaceT> | readonly IriLike<NamespaceT>[] | undefined;
124
125
  readonly shaclmateName?: string;
125
- readonly xone?: readonly (NamedNode<string> | (keyof NamespaceT & string))[] | undefined;
126
+ readonly xone?: readonly (NamedNode<string> | import("./shapes.js").sh_Shape | (keyof NamespaceT & string))[] | undefined;
126
127
  }) | undefined) => import("./shapes.js").sh_NodeShape;
127
128
  PropertyShape: ($identifier: BlankNode | NamedNode<string> | (keyof NamespaceT & string) | undefined, parameters?: (Omit<{
128
129
  readonly $identifier?: (() => import("./shapes.js").sh_PropertyShape.Identifier) | BlankNode | NamedNode | string;
@@ -177,7 +178,7 @@ export declare function builder<NamespaceT extends NamespaceBuilder = NamespaceB
177
178
  readonly targetSubjectsOf?: string | NamedNode | readonly (string | NamedNode)[];
178
179
  readonly uniqueLang?: boolean | import("purify-ts").Maybe<boolean>;
179
180
  readonly xone?: readonly (NamedNode | import("./shapes.js").sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | import("./shapes.js").sh_Shape)[]>;
180
- }, "$identifier" | "in_" | "node" | "nodeKind" | "maxCount" | "minCount" | "path" | "resolve" | "classes"> & {
181
+ }, "$identifier" | "in_" | "node" | "nodeKind" | "xone" | "maxCount" | "minCount" | "path" | "resolve" | "classes"> & {
181
182
  readonly cardinality?: "optional" | "required" | "set";
182
183
  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>)[];
@@ -185,6 +186,7 @@ export declare function builder<NamespaceT extends NamespaceBuilder = NamespaceB
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
187
  readonly path?: import("@rdfx/resource").PropertyPath | (keyof NamespaceT & string) | undefined;
187
188
  readonly resolve?: NamedNode<string> | (keyof NamespaceT & string) | undefined;
189
+ readonly xone?: readonly (NamedNode<string> | import("./shapes.js").sh_Shape | (keyof NamespaceT & string))[] | undefined;
188
190
  }) | undefined) => ReturnType<typeof import("./shapes.js").sh_PropertyShape.createUnsafe>;
189
191
  };
190
192
  skos: {
package/dist/sh.d.ts CHANGED
@@ -4,7 +4,7 @@ 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";
@@ -16,7 +16,7 @@ export declare function sh<NamespaceT extends NamespaceBuilder>({ namespace, toI
16
16
  readonly nodeKind?: NodeKindIri | NodeKindString;
17
17
  readonly properties?: Record<string, Omit<Omit<{
18
18
  readonly $identifier?: (() => sh_PropertyShape.Identifier) | BlankNode | NamedNode | string;
19
- readonly and?: readonly (NamedNode | import("./shapes.js").sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | import("./shapes.js").sh_Shape)[]>;
19
+ readonly and?: readonly (NamedNode | sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | sh_Shape)[]>;
20
20
  readonly class_?: string | NamedNode | readonly (string | NamedNode)[];
21
21
  readonly comment?: string | import("purify-ts").Maybe<string>;
22
22
  readonly datatype?: string | NamedNode | import("purify-ts").Maybe<NamedNode>;
@@ -50,7 +50,7 @@ export declare function sh<NamespaceT extends NamespaceBuilder>({ namespace, toI
50
50
  readonly node?: (NamedNode | sh_NodeShape) | import("purify-ts").Maybe<NamedNode | sh_NodeShape>;
51
51
  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
52
  readonly not?: (NamedNode | sh_NodeShape) | readonly (NamedNode | sh_NodeShape)[];
53
- readonly or?: readonly (NamedNode | import("./shapes.js").sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | import("./shapes.js").sh_Shape)[]>;
53
+ readonly or?: readonly (NamedNode | sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | sh_Shape)[]>;
54
54
  readonly order?: number | import("purify-ts").Maybe<number>;
55
55
  readonly path: import("./shapes.js").$PropertyPath;
56
56
  readonly pattern?: string | import("purify-ts").Maybe<string>;
@@ -66,8 +66,8 @@ export declare function sh<NamespaceT extends NamespaceBuilder>({ namespace, toI
66
66
  readonly targetObjectsOf?: string | NamedNode | readonly (string | NamedNode)[];
67
67
  readonly targetSubjectsOf?: string | NamedNode | readonly (string | NamedNode)[];
68
68
  readonly uniqueLang?: boolean | import("purify-ts").Maybe<boolean>;
69
- readonly xone?: readonly (NamedNode | import("./shapes.js").sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | import("./shapes.js").sh_Shape)[]>;
70
- }, "$identifier" | "in_" | "node" | "nodeKind" | "maxCount" | "minCount" | "path" | "resolve" | "classes"> & {
69
+ readonly xone?: readonly (NamedNode | sh_Shape)[] | import("purify-ts").Maybe<readonly (NamedNode | sh_Shape)[]>;
70
+ }, "$identifier" | "in_" | "node" | "nodeKind" | "xone" | "maxCount" | "minCount" | "path" | "resolve" | "classes"> & {
71
71
  readonly cardinality?: "optional" | "required" | "set";
72
72
  readonly class?: NamedNode | (keyof NamespaceT & string) | readonly (NamedNode | (keyof NamespaceT & string))[];
73
73
  readonly in_?: skos_ConceptScheme | ConvertibleInArray;
@@ -75,8 +75,9 @@ export declare function sh<NamespaceT extends NamespaceBuilder>({ namespace, toI
75
75
  readonly nodeKind?: NodeKindIri | NodeKindString;
76
76
  readonly path?: (keyof NamespaceT & string) | PropertyPath;
77
77
  readonly resolve?: NamedNode | (keyof NamespaceT & string);
78
+ readonly xone?: readonly (NamedNode | (keyof NamespaceT & string) | sh_Shape)[];
78
79
  }, "$identifier" | "path"> & {
79
- readonly $identifier?: Parameters<($identifier: Exclude<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe>[0]>["$identifier"], string | (() => sh_PropertyShape.Identifier)> | (keyof NamespaceT & string), parameters?: Omit<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe>[0]>, "$identifier" | "classes" | "in_" | "maxCount" | "minCount" | "node" | "nodeKind" | "path" | "resolve"> & {
80
+ readonly $identifier?: Parameters<($identifier: Exclude<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe>[0]>["$identifier"], string | (() => sh_PropertyShape.Identifier)> | (keyof NamespaceT & string), parameters?: Omit<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe>[0]>, "$identifier" | "classes" | "in_" | "maxCount" | "minCount" | "node" | "nodeKind" | "path" | "resolve" | "xone"> & {
80
81
  readonly cardinality?: "optional" | "required" | "set";
81
82
  readonly class?: NamedNode | (keyof NamespaceT & string) | readonly (NamedNode | (keyof NamespaceT & string))[];
82
83
  readonly in_?: skos_ConceptScheme | ConvertibleInArray;
@@ -84,14 +85,15 @@ export declare function sh<NamespaceT extends NamespaceBuilder>({ namespace, toI
84
85
  readonly nodeKind?: NodeKindIri | NodeKindString;
85
86
  readonly path?: (keyof NamespaceT & string) | PropertyPath;
86
87
  readonly resolve?: NamedNode | (keyof NamespaceT & string);
88
+ readonly xone?: readonly (NamedNode | (keyof NamespaceT & string) | sh_Shape)[];
87
89
  }) => ReturnType<typeof sh_PropertyShape.createUnsafe>>[0];
88
90
  readonly path?: (keyof NamespaceT & string) | PropertyPath;
89
91
  }> | readonly (sh_PropertyShape | (keyof NamespaceT & string) | NamedNode<string>)[];
90
92
  readonly type?: IriLike<NamespaceT> | readonly IriLike<NamespaceT>[];
91
93
  readonly shaclmateName?: string;
92
- readonly xone?: readonly (NamedNode | (keyof NamespaceT & string))[];
94
+ readonly xone?: readonly (NamedNode | (keyof NamespaceT & string) | sh_Shape)[];
93
95
  }) => sh_NodeShape;
94
- PropertyShape: ($identifier: Exclude<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe>[0]>["$identifier"], string | (() => sh_PropertyShape.Identifier)> | (keyof NamespaceT & string), parameters?: Omit<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe>[0]>, "$identifier" | "classes" | "in_" | "maxCount" | "minCount" | "node" | "nodeKind" | "path" | "resolve"> & {
96
+ PropertyShape: ($identifier: Exclude<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe>[0]>["$identifier"], string | (() => sh_PropertyShape.Identifier)> | (keyof NamespaceT & string), parameters?: Omit<NonNullable<Parameters<typeof sh_PropertyShape.createUnsafe>[0]>, "$identifier" | "classes" | "in_" | "maxCount" | "minCount" | "node" | "nodeKind" | "path" | "resolve" | "xone"> & {
95
97
  readonly cardinality?: "optional" | "required" | "set";
96
98
  readonly class?: NamedNode | (keyof NamespaceT & string) | readonly (NamedNode | (keyof NamespaceT & string))[];
97
99
  readonly in_?: skos_ConceptScheme | ConvertibleInArray;
@@ -99,6 +101,7 @@ export declare function sh<NamespaceT extends NamespaceBuilder>({ namespace, toI
99
101
  readonly nodeKind?: NodeKindIri | NodeKindString;
100
102
  readonly path?: (keyof NamespaceT & string) | PropertyPath;
101
103
  readonly resolve?: NamedNode | (keyof NamespaceT & string);
104
+ readonly xone?: readonly (NamedNode | (keyof NamespaceT & string) | sh_Shape)[];
102
105
  }) => ReturnType<typeof sh_PropertyShape.createUnsafe>;
103
106
  };
104
107
  export {};
package/dist/sh.js CHANGED
@@ -34,7 +34,7 @@ function convertNodeKind(nodeKind) {
34
34
  export function sh({ namespace, toIdentifier, toIri, toIriArray, }) {
35
35
  function PropertyShape($identifier, parameters) {
36
36
  // Order of default population matters here.
37
- const { cardinality: cardinalityParameter, class: classParameter, in_: inParameter, path: pathParameter, node: nodeParameter, nodeKind: nodeKindParameter, resolve: resolveParameter, ...otherParameters } = parameters ?? {};
37
+ const { cardinality: cardinalityParameter, class: classParameter, in_: inParameter, path: pathParameter, node: nodeParameter, nodeKind: nodeKindParameter, resolve: resolveParameter, xone: xoneParameter, ...otherParameters } = parameters ?? {};
38
38
  const $identifierTerm = toIdentifier($identifier);
39
39
  let path;
40
40
  switch (typeof pathParameter) {
@@ -81,6 +81,9 @@ export function sh({ namespace, toIdentifier, toIri, toIriArray, }) {
81
81
  : undefined,
82
82
  path,
83
83
  resolve: resolveParameter ? toIri(resolveParameter) : undefined,
84
+ xone: xoneParameter
85
+ ? xoneParameter.map((xoneMember) => typeof xoneMember === "string" ? toIri(xoneMember) : xoneMember)
86
+ : undefined,
84
87
  });
85
88
  }
86
89
  return {
@@ -151,7 +154,9 @@ export function sh({ namespace, toIdentifier, toIri, toIriArray, }) {
151
154
  properties,
152
155
  shaclmateName,
153
156
  type,
154
- xone: xoneParameter ? xoneParameter.map(toIri) : undefined,
157
+ xone: xoneParameter
158
+ ? xoneParameter.map((xoneMember) => typeof xoneMember === "string" ? toIri(xoneMember) : xoneMember)
159
+ : undefined,
155
160
  });
156
161
  },
157
162
  PropertyShape,
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "dependencies": {
3
- "@rdfx/data-factory": "0.0.41",
4
- "@rdfx/literal": "0.0.41",
5
- "@rdfx/resource": "0.0.41",
6
- "@rdfx/string": "0.0.41",
3
+ "@rdfx/data-factory": "0.0.42",
4
+ "@rdfx/literal": "0.0.42",
5
+ "@rdfx/resource": "0.0.42",
6
+ "@rdfx/string": "0.0.42",
7
7
  "@rdfjs/namespace": "~2.0.1",
8
8
  "@rdfjs/types": "~2.0.1",
9
9
  "@types/rdfjs__namespace": "~2.0.10",
@@ -11,9 +11,9 @@
11
11
  "purify-ts": "~2.1.4"
12
12
  },
13
13
  "devDependencies": {
14
- "@rdfx/collection": "0.0.41",
15
- "@rdfx/fs": "0.0.41",
16
- "@rdfx/testing": "0.0.41",
14
+ "@rdfx/collection": "0.0.42",
15
+ "@rdfx/fs": "0.0.42",
16
+ "@rdfx/testing": "0.0.42",
17
17
  "@shaclmate/compiler": "4.0.65",
18
18
  "@shaclmate/validator": "4.0.65",
19
19
  "@tpluscode/rdf-ns-builders": "~4.3.0",
@@ -42,5 +42,5 @@
42
42
  },
43
43
  "type": "module",
44
44
  "types": "./dist/index.d.ts",
45
- "version": "0.0.41"
45
+ "version": "0.0.42"
46
46
  }