@shaclmate/shacl-ast 4.0.20 → 4.0.22
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/AbstractShapesGraph.js +5 -2
- package/dist/generated.d.ts +16 -4
- package/dist/generated.js +20 -5
- package/package.json +4 -4
|
@@ -71,7 +71,7 @@ export class AbstractShapesGraph {
|
|
|
71
71
|
*/
|
|
72
72
|
toDataset() {
|
|
73
73
|
const dataset = datasetFactory.dataset();
|
|
74
|
-
const resourceSet = new ResourceSet(dataset);
|
|
74
|
+
const resourceSet = new ResourceSet({ dataFactory, dataset });
|
|
75
75
|
for (const nodeShape of this.nodeShapes) {
|
|
76
76
|
this.typeFunctions.NodeShape.$toRdfResource(nodeShape, { resourceSet });
|
|
77
77
|
}
|
|
@@ -185,7 +185,10 @@ export class AbstractShapesGraph {
|
|
|
185
185
|
else {
|
|
186
186
|
curieDataset = dataset;
|
|
187
187
|
}
|
|
188
|
-
const curieResourceSet = new ResourceSet(
|
|
188
|
+
const curieResourceSet = new ResourceSet({
|
|
189
|
+
dataFactory,
|
|
190
|
+
dataset: curieDataset,
|
|
191
|
+
});
|
|
189
192
|
return Either.encase(() => {
|
|
190
193
|
function readGraph() {
|
|
191
194
|
const graphs = new TermSet();
|
package/dist/generated.d.ts
CHANGED
|
@@ -80,13 +80,13 @@ export type $ToRdfResourceFunction<T> = (value: T, options?: {
|
|
|
80
80
|
ignoreRdfType?: boolean;
|
|
81
81
|
resourceSet?: ResourceSet;
|
|
82
82
|
}) => Resource;
|
|
83
|
-
export type $ToRdfResourceValuesFunction<
|
|
83
|
+
export type $ToRdfResourceValuesFunction<ValueT, ReturnT extends BlankNode | Literal | NamedNode = BlankNode | Literal | NamedNode> = (value: ValueT, options: {
|
|
84
84
|
graph?: Exclude<Quad_Graph, Variable>;
|
|
85
85
|
ignoreRdfType?: boolean;
|
|
86
86
|
propertyPath: $PropertyPath;
|
|
87
87
|
resource: Resource;
|
|
88
88
|
resourceSet: ResourceSet;
|
|
89
|
-
}) =>
|
|
89
|
+
}) => ReturnT[];
|
|
90
90
|
export interface PropertyShape {
|
|
91
91
|
readonly $identifier: PropertyShape.$Identifier;
|
|
92
92
|
readonly $type: "PropertyShape";
|
|
@@ -2198,7 +2198,13 @@ export declare namespace Shape {
|
|
|
2198
2198
|
};
|
|
2199
2199
|
};
|
|
2200
2200
|
const $toRdfResource: $ToRdfResourceFunction<Shape>;
|
|
2201
|
-
const $toRdfResourceValues:
|
|
2201
|
+
const $toRdfResourceValues: (value: Shape, _options: {
|
|
2202
|
+
graph?: Exclude<Quad_Graph, Variable>;
|
|
2203
|
+
ignoreRdfType?: boolean;
|
|
2204
|
+
propertyPath: $PropertyPath;
|
|
2205
|
+
resource: Resource;
|
|
2206
|
+
resourceSet: ResourceSet;
|
|
2207
|
+
}) => (BlankNode | NamedNode)[];
|
|
2202
2208
|
function isShape(object: $Object): object is Shape;
|
|
2203
2209
|
}
|
|
2204
2210
|
export type $Object = NodeShape | Ontology | PropertyGroup | PropertyShape;
|
|
@@ -3018,7 +3024,13 @@ export declare namespace $Object {
|
|
|
3018
3024
|
};
|
|
3019
3025
|
};
|
|
3020
3026
|
const $toRdfResource: $ToRdfResourceFunction<$Object>;
|
|
3021
|
-
const $toRdfResourceValues: $
|
|
3027
|
+
const $toRdfResourceValues: (value: $Object, _options: {
|
|
3028
|
+
graph?: Exclude<Quad_Graph, Variable>;
|
|
3029
|
+
ignoreRdfType?: boolean;
|
|
3030
|
+
propertyPath: $PropertyPath;
|
|
3031
|
+
resource: Resource;
|
|
3032
|
+
resourceSet: ResourceSet;
|
|
3033
|
+
}) => (BlankNode | NamedNode)[];
|
|
3022
3034
|
}
|
|
3023
3035
|
export interface $ObjectSet {
|
|
3024
3036
|
nodeShape(identifier: NodeShape.$Identifier, options?: {
|
package/dist/generated.js
CHANGED
|
@@ -1960,7 +1960,10 @@ export var PropertyShape;
|
|
|
1960
1960
|
};
|
|
1961
1961
|
function $toRdfResource(_propertyShape, options) {
|
|
1962
1962
|
const resourceSet = options?.resourceSet ??
|
|
1963
|
-
new ResourceSet(
|
|
1963
|
+
new ResourceSet({
|
|
1964
|
+
dataFactory: dataFactory,
|
|
1965
|
+
dataset: datasetFactory.dataset(),
|
|
1966
|
+
});
|
|
1964
1967
|
const resource = resourceSet.resource(_propertyShape.$identifier);
|
|
1965
1968
|
if (!options?.ignoreRdfType) {
|
|
1966
1969
|
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"), options?.graph);
|
|
@@ -2330,7 +2333,10 @@ export var PropertyGroup;
|
|
|
2330
2333
|
};
|
|
2331
2334
|
function $toRdfResource(_propertyGroup, options) {
|
|
2332
2335
|
const resourceSet = options?.resourceSet ??
|
|
2333
|
-
new ResourceSet(
|
|
2336
|
+
new ResourceSet({
|
|
2337
|
+
dataFactory: dataFactory,
|
|
2338
|
+
dataset: datasetFactory.dataset(),
|
|
2339
|
+
});
|
|
2334
2340
|
const resource = resourceSet.resource(_propertyGroup.$identifier);
|
|
2335
2341
|
if (!options?.ignoreRdfType) {
|
|
2336
2342
|
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"), options?.graph);
|
|
@@ -2528,7 +2534,10 @@ export var Ontology;
|
|
|
2528
2534
|
};
|
|
2529
2535
|
function $toRdfResource(_ontology, options) {
|
|
2530
2536
|
const resourceSet = options?.resourceSet ??
|
|
2531
|
-
new ResourceSet(
|
|
2537
|
+
new ResourceSet({
|
|
2538
|
+
dataFactory: dataFactory,
|
|
2539
|
+
dataset: datasetFactory.dataset(),
|
|
2540
|
+
});
|
|
2532
2541
|
const resource = resourceSet.resource(_ontology.$identifier);
|
|
2533
2542
|
if (!options?.ignoreRdfType) {
|
|
2534
2543
|
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"), options?.graph);
|
|
@@ -4165,7 +4174,10 @@ export var NodeShape;
|
|
|
4165
4174
|
};
|
|
4166
4175
|
function $toRdfResource(_nodeShape, options) {
|
|
4167
4176
|
const resourceSet = options?.resourceSet ??
|
|
4168
|
-
new ResourceSet(
|
|
4177
|
+
new ResourceSet({
|
|
4178
|
+
dataFactory: dataFactory,
|
|
4179
|
+
dataset: datasetFactory.dataset(),
|
|
4180
|
+
});
|
|
4169
4181
|
const resource = resourceSet.resource(_nodeShape.$identifier);
|
|
4170
4182
|
if (!options?.ignoreRdfType) {
|
|
4171
4183
|
resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"), options?.graph);
|
|
@@ -4874,7 +4886,10 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4874
4886
|
return this.#dataset();
|
|
4875
4887
|
}
|
|
4876
4888
|
$resourceSet() {
|
|
4877
|
-
return new ResourceSet(
|
|
4889
|
+
return new ResourceSet({
|
|
4890
|
+
dataFactory: dataFactory,
|
|
4891
|
+
dataset: this.$dataset(),
|
|
4892
|
+
});
|
|
4878
4893
|
}
|
|
4879
4894
|
async nodeShape(identifier, options) {
|
|
4880
4895
|
return this.nodeShapeSync(identifier, options);
|
package/package.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"@rdfjs/term-map": "~2.0.2",
|
|
5
5
|
"@rdfjs/term-set": "~2.0.3",
|
|
6
6
|
"@rdfjs/types": "~2.0.1",
|
|
7
|
-
"@rdfx/data-factory": "0.0.
|
|
8
|
-
"@rdfx/resource": "0.0.
|
|
9
|
-
"@rdfx/string": "0.0.
|
|
7
|
+
"@rdfx/data-factory": "0.0.12",
|
|
8
|
+
"@rdfx/resource": "0.0.12",
|
|
9
|
+
"@rdfx/string": "0.0.12",
|
|
10
10
|
"@tpluscode/rdf-ns-builders": "~4.3.0",
|
|
11
11
|
"@types/rdfjs__dataset": "~2.0.7",
|
|
12
12
|
"@types/rdfjs__term-map": "~2.0.10",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
},
|
|
45
45
|
"type": "module",
|
|
46
46
|
"types": "./dist/index.d.ts",
|
|
47
|
-
"version": "4.0.
|
|
47
|
+
"version": "4.0.22"
|
|
48
48
|
}
|