@shaclmate/shacl-ast 4.0.6 → 4.0.8
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/NodeShape.d.ts +3 -3
- package/dist/NodeShape.js +9 -9
- package/dist/Ontology.d.ts +1 -1
- package/dist/PropertyGroup.d.ts +1 -1
- package/dist/PropertyShape.d.ts +2 -2
- package/dist/PropertyShape.js +11 -11
- package/dist/Shape.d.ts +4 -4
- package/dist/Shape.js +28 -28
- package/dist/ShapesGraph.js +4 -4
- package/dist/generated.d.ts +399 -602
- package/dist/generated.js +2049 -1062
- package/package.json +1 -1
package/dist/NodeShape.d.ts
CHANGED
|
@@ -5,13 +5,13 @@ import { Shape } from "./Shape.js";
|
|
|
5
5
|
import type { ShapesGraph } from "./ShapesGraph.js";
|
|
6
6
|
export declare class NodeShape<NodeShapeT extends ShapeT, OntologyT extends OntologyLike, PropertyGroupT, PropertyShapeT extends ShapeT, ShapeT> extends Shape<NodeShapeT, OntologyT, PropertyGroupT, PropertyShapeT, ShapeT> {
|
|
7
7
|
readonly constraints: NodeShape.Constraints<NodeShapeT, OntologyT, PropertyGroupT, PropertyShapeT, ShapeT>;
|
|
8
|
-
constructor(
|
|
8
|
+
constructor(generatedNodeShape: Omit<generated.NodeShape, "$type">, shapesGraph: ShapesGraph<NodeShapeT, OntologyT, PropertyGroupT, PropertyShapeT, ShapeT>);
|
|
9
9
|
toString(): string;
|
|
10
10
|
}
|
|
11
11
|
export declare namespace NodeShape {
|
|
12
12
|
class Constraints<NodeShapeT extends ShapeT, OntologyT extends OntologyLike, PropertyGroupT, PropertyShapeT extends ShapeT, ShapeT> extends Shape.Constraints<NodeShapeT, OntologyT, PropertyGroupT, PropertyShapeT, ShapeT> {
|
|
13
|
-
private readonly
|
|
14
|
-
constructor(
|
|
13
|
+
private readonly generatedNodeShape;
|
|
14
|
+
constructor(generatedNodeShape: Omit<generated.NodeShape, "$type">, shapesGraph: ShapesGraph<NodeShapeT, OntologyT, PropertyGroupT, PropertyShapeT, ShapeT>);
|
|
15
15
|
get closed(): Maybe<boolean>;
|
|
16
16
|
get properties(): Either<Error, readonly PropertyShapeT[]>;
|
|
17
17
|
}
|
package/dist/NodeShape.js
CHANGED
|
@@ -10,9 +10,9 @@ import { Memoize } from "typescript-memoize";
|
|
|
10
10
|
import { Shape } from "./Shape.js";
|
|
11
11
|
export class NodeShape extends Shape {
|
|
12
12
|
constraints;
|
|
13
|
-
constructor(
|
|
14
|
-
super(
|
|
15
|
-
this.constraints = new NodeShape.Constraints(
|
|
13
|
+
constructor(generatedNodeShape, shapesGraph) {
|
|
14
|
+
super(generatedNodeShape, shapesGraph);
|
|
15
|
+
this.constraints = new NodeShape.Constraints(generatedNodeShape, shapesGraph);
|
|
16
16
|
}
|
|
17
17
|
toString() {
|
|
18
18
|
return `NodeShape(identifier=${Resource.Identifier.toString(this.identifier)})`;
|
|
@@ -23,16 +23,16 @@ __decorate([
|
|
|
23
23
|
], NodeShape.prototype, "toString", null);
|
|
24
24
|
(function (NodeShape) {
|
|
25
25
|
class Constraints extends Shape.Constraints {
|
|
26
|
-
|
|
27
|
-
constructor(
|
|
28
|
-
super(
|
|
29
|
-
this.
|
|
26
|
+
generatedNodeShape;
|
|
27
|
+
constructor(generatedNodeShape, shapesGraph) {
|
|
28
|
+
super(generatedNodeShape, shapesGraph);
|
|
29
|
+
this.generatedNodeShape = generatedNodeShape;
|
|
30
30
|
}
|
|
31
31
|
get closed() {
|
|
32
|
-
return this.
|
|
32
|
+
return this.generatedNodeShape.closed;
|
|
33
33
|
}
|
|
34
34
|
get properties() {
|
|
35
|
-
return Either.sequence(this.
|
|
35
|
+
return Either.sequence(this.generatedNodeShape.properties.map((identifier) => this.shapesGraph.propertyShapeByIdentifier(identifier)));
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
__decorate([
|
package/dist/Ontology.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type * as generated from "./generated.js";
|
|
|
3
3
|
import type { OntologyLike } from "./OntologyLike.js";
|
|
4
4
|
export declare class Ontology implements OntologyLike {
|
|
5
5
|
private readonly generatedOntology;
|
|
6
|
-
constructor(generatedOntology: Omit<generated.
|
|
6
|
+
constructor(generatedOntology: Omit<generated.Ontology, "$type">);
|
|
7
7
|
get identifier(): BlankNode | NamedNode;
|
|
8
8
|
toString(): string;
|
|
9
9
|
}
|
package/dist/PropertyGroup.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { BlankNode, NamedNode } from "@rdfjs/types";
|
|
|
2
2
|
import type * as generated from "./generated.js";
|
|
3
3
|
export declare class PropertyGroup {
|
|
4
4
|
private readonly delegate;
|
|
5
|
-
constructor(delegate: generated.
|
|
5
|
+
constructor(delegate: generated.PropertyGroup);
|
|
6
6
|
get comments(): readonly string[];
|
|
7
7
|
get identifier(): BlankNode | NamedNode;
|
|
8
8
|
get labels(): readonly string[];
|
package/dist/PropertyShape.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ import type { OntologyLike } from "./OntologyLike.js";
|
|
|
6
6
|
import { Shape } from "./Shape.js";
|
|
7
7
|
import type { ShapesGraph } from "./ShapesGraph.js";
|
|
8
8
|
export declare class PropertyShape<NodeShapeT extends ShapeT, OntologyT extends OntologyLike, PropertyGroupT, PropertyShapeT extends ShapeT, ShapeT> extends Shape<NodeShapeT, OntologyT, PropertyGroupT, PropertyShapeT, ShapeT> {
|
|
9
|
-
private readonly
|
|
9
|
+
private readonly generatedPropertyShape;
|
|
10
10
|
readonly constraints: Shape.Constraints<NodeShapeT, OntologyT, PropertyGroupT, PropertyShapeT, ShapeT>;
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(generatedPropertyShape: Omit<generated.PropertyShape, "$type">, shapesGraph: ShapesGraph<NodeShapeT, OntologyT, PropertyGroupT, PropertyShapeT, ShapeT>);
|
|
12
12
|
get defaultValue(): Maybe<Literal | NamedNode>;
|
|
13
13
|
get descriptions(): readonly string[];
|
|
14
14
|
get groups(): Either<Error, readonly PropertyGroupT[]>;
|
package/dist/PropertyShape.js
CHANGED
|
@@ -9,30 +9,30 @@ import { PropertyPath, Resource } from "rdfjs-resource";
|
|
|
9
9
|
import { Memoize } from "typescript-memoize";
|
|
10
10
|
import { Shape } from "./Shape.js";
|
|
11
11
|
export class PropertyShape extends Shape {
|
|
12
|
-
|
|
12
|
+
generatedPropertyShape;
|
|
13
13
|
constraints;
|
|
14
|
-
constructor(
|
|
15
|
-
super(
|
|
16
|
-
this.
|
|
17
|
-
this.constraints = new Shape.Constraints(
|
|
14
|
+
constructor(generatedPropertyShape, shapesGraph) {
|
|
15
|
+
super(generatedPropertyShape, shapesGraph);
|
|
16
|
+
this.generatedPropertyShape = generatedPropertyShape;
|
|
17
|
+
this.constraints = new Shape.Constraints(generatedPropertyShape, shapesGraph);
|
|
18
18
|
}
|
|
19
19
|
get defaultValue() {
|
|
20
|
-
return this.
|
|
20
|
+
return this.generatedPropertyShape.defaultValue;
|
|
21
21
|
}
|
|
22
22
|
get descriptions() {
|
|
23
|
-
return this.
|
|
23
|
+
return this.generatedPropertyShape.descriptions;
|
|
24
24
|
}
|
|
25
25
|
get groups() {
|
|
26
|
-
return Either.sequence(this.
|
|
26
|
+
return Either.sequence(this.generatedPropertyShape.groups.map((identifier) => this.shapesGraph.propertyGroupByIdentifier(identifier)));
|
|
27
27
|
}
|
|
28
28
|
get names() {
|
|
29
|
-
return this.
|
|
29
|
+
return this.generatedPropertyShape.names;
|
|
30
30
|
}
|
|
31
31
|
get order() {
|
|
32
|
-
return this.
|
|
32
|
+
return this.generatedPropertyShape.order;
|
|
33
33
|
}
|
|
34
34
|
get path() {
|
|
35
|
-
return this.
|
|
35
|
+
return this.generatedPropertyShape.path;
|
|
36
36
|
}
|
|
37
37
|
toString() {
|
|
38
38
|
return `PropertyShape(${[
|
package/dist/Shape.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ import type { NodeKind } from "./NodeKind.js";
|
|
|
5
5
|
import type { OntologyLike } from "./OntologyLike.js";
|
|
6
6
|
import type { ShapesGraph } from "./ShapesGraph.js";
|
|
7
7
|
export declare abstract class Shape<NodeShapeT extends ShapeT, OntologyT extends OntologyLike, PropertyGroupT, PropertyShapeT extends ShapeT, ShapeT> {
|
|
8
|
-
private readonly
|
|
8
|
+
private readonly generatedShape;
|
|
9
9
|
protected readonly shapesGraph: ShapesGraph<NodeShapeT, OntologyT, PropertyGroupT, PropertyShapeT, ShapeT>;
|
|
10
10
|
abstract readonly constraints: Shape.Constraints<NodeShapeT, OntologyT, PropertyGroupT, PropertyShapeT, ShapeT>;
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(generatedShape: Omit<generated.Shape, "$type">, shapesGraph: ShapesGraph<NodeShapeT, OntologyT, PropertyGroupT, PropertyShapeT, ShapeT>);
|
|
12
12
|
get comments(): readonly string[];
|
|
13
13
|
get identifier(): BlankNode | NamedNode;
|
|
14
14
|
get isDefinedBy(): Either<Error, Maybe<OntologyT>>;
|
|
@@ -16,9 +16,9 @@ export declare abstract class Shape<NodeShapeT extends ShapeT, OntologyT extends
|
|
|
16
16
|
}
|
|
17
17
|
export declare namespace Shape {
|
|
18
18
|
class Constraints<NodeShapeT extends ShapeT, OntologyT extends OntologyLike, PropertyGroupT, PropertyShapeT extends ShapeT, ShapeT> {
|
|
19
|
-
private readonly
|
|
19
|
+
private readonly generatedShape;
|
|
20
20
|
protected readonly shapesGraph: ShapesGraph<NodeShapeT, OntologyT, PropertyGroupT, PropertyShapeT, ShapeT>;
|
|
21
|
-
constructor(
|
|
21
|
+
constructor(generatedShape: Omit<generated.Shape, "$type">, shapesGraph: ShapesGraph<NodeShapeT, OntologyT, PropertyGroupT, PropertyShapeT, ShapeT>);
|
|
22
22
|
get and(): Either<Error, readonly ShapeT[]>;
|
|
23
23
|
get classes(): readonly NamedNode[];
|
|
24
24
|
get datatype(): Maybe<NamedNode>;
|
package/dist/Shape.js
CHANGED
|
@@ -7,23 +7,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { Either, Maybe } from "purify-ts";
|
|
8
8
|
import { Memoize } from "typescript-memoize";
|
|
9
9
|
export class Shape {
|
|
10
|
-
|
|
10
|
+
generatedShape;
|
|
11
11
|
shapesGraph;
|
|
12
|
-
constructor(
|
|
13
|
-
this.
|
|
12
|
+
constructor(generatedShape, shapesGraph) {
|
|
13
|
+
this.generatedShape = generatedShape;
|
|
14
14
|
this.shapesGraph = shapesGraph;
|
|
15
15
|
}
|
|
16
16
|
get comments() {
|
|
17
|
-
return this.
|
|
17
|
+
return this.generatedShape.comments;
|
|
18
18
|
}
|
|
19
19
|
get identifier() {
|
|
20
|
-
return this.
|
|
20
|
+
return this.generatedShape.$identifier;
|
|
21
21
|
}
|
|
22
22
|
get isDefinedBy() {
|
|
23
|
-
if (this.
|
|
23
|
+
if (this.generatedShape.isDefinedBy.isJust()) {
|
|
24
24
|
// If there's an rdfs:isDefinedBy statement on the shape then don't fall back to anything else
|
|
25
25
|
return this.shapesGraph
|
|
26
|
-
.ontologyByIdentifier(this.
|
|
26
|
+
.ontologyByIdentifier(this.generatedShape.isDefinedBy.unsafeCoerce())
|
|
27
27
|
.map(Maybe.of);
|
|
28
28
|
}
|
|
29
29
|
// No rdfs:isDefinedBy statement on the shape
|
|
@@ -43,7 +43,7 @@ export class Shape {
|
|
|
43
43
|
return Either.of(Maybe.empty());
|
|
44
44
|
}
|
|
45
45
|
get labels() {
|
|
46
|
-
return this.
|
|
46
|
+
return this.generatedShape.labels;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
__decorate([
|
|
@@ -51,50 +51,50 @@ __decorate([
|
|
|
51
51
|
], Shape.prototype, "isDefinedBy", null);
|
|
52
52
|
(function (Shape) {
|
|
53
53
|
class Constraints {
|
|
54
|
-
|
|
54
|
+
generatedShape;
|
|
55
55
|
shapesGraph;
|
|
56
|
-
constructor(
|
|
57
|
-
this.
|
|
56
|
+
constructor(generatedShape, shapesGraph) {
|
|
57
|
+
this.generatedShape = generatedShape;
|
|
58
58
|
this.shapesGraph = shapesGraph;
|
|
59
59
|
}
|
|
60
60
|
get and() {
|
|
61
|
-
return this.shapeListTakingConstraint(this.
|
|
61
|
+
return this.shapeListTakingConstraint(this.generatedShape.and);
|
|
62
62
|
}
|
|
63
63
|
get classes() {
|
|
64
|
-
return this.
|
|
64
|
+
return this.generatedShape.classes;
|
|
65
65
|
}
|
|
66
66
|
get datatype() {
|
|
67
|
-
return this.
|
|
67
|
+
return this.generatedShape.datatype;
|
|
68
68
|
}
|
|
69
69
|
get hasValues() {
|
|
70
|
-
return this.
|
|
70
|
+
return this.generatedShape.hasValues;
|
|
71
71
|
}
|
|
72
72
|
get in_() {
|
|
73
|
-
return this.
|
|
73
|
+
return this.generatedShape.in_.orDefault([]);
|
|
74
74
|
}
|
|
75
75
|
get languageIn() {
|
|
76
|
-
return this.
|
|
76
|
+
return this.generatedShape.languageIn.orDefault([]);
|
|
77
77
|
}
|
|
78
78
|
get maxCount() {
|
|
79
|
-
return this.
|
|
79
|
+
return this.generatedShape.maxCount;
|
|
80
80
|
}
|
|
81
81
|
get maxExclusive() {
|
|
82
|
-
return this.
|
|
82
|
+
return this.generatedShape.maxExclusive;
|
|
83
83
|
}
|
|
84
84
|
get maxInclusive() {
|
|
85
|
-
return this.
|
|
85
|
+
return this.generatedShape.maxInclusive;
|
|
86
86
|
}
|
|
87
87
|
get minCount() {
|
|
88
|
-
return this.
|
|
88
|
+
return this.generatedShape.minCount;
|
|
89
89
|
}
|
|
90
90
|
get minExclusive() {
|
|
91
|
-
return this.
|
|
91
|
+
return this.generatedShape.minExclusive;
|
|
92
92
|
}
|
|
93
93
|
get minInclusive() {
|
|
94
|
-
return this.
|
|
94
|
+
return this.generatedShape.minInclusive;
|
|
95
95
|
}
|
|
96
96
|
get nodeKinds() {
|
|
97
|
-
return this.
|
|
97
|
+
return this.generatedShape.nodeKind
|
|
98
98
|
.map((iri) => {
|
|
99
99
|
const nodeKinds = new Set();
|
|
100
100
|
switch (iri.value) {
|
|
@@ -125,16 +125,16 @@ __decorate([
|
|
|
125
125
|
.orDefault(new Set([]));
|
|
126
126
|
}
|
|
127
127
|
get nodes() {
|
|
128
|
-
return Either.sequence(this.
|
|
128
|
+
return Either.sequence(this.generatedShape.nodes.map((identifier) => this.shapesGraph.nodeShapeByIdentifier(identifier)));
|
|
129
129
|
}
|
|
130
130
|
get not() {
|
|
131
|
-
return Either.sequence(this.
|
|
131
|
+
return Either.sequence(this.generatedShape.not.map((identifier) => this.shapesGraph.shapeByIdentifier(identifier)));
|
|
132
132
|
}
|
|
133
133
|
get or() {
|
|
134
|
-
return this.shapeListTakingConstraint(this.
|
|
134
|
+
return this.shapeListTakingConstraint(this.generatedShape.or);
|
|
135
135
|
}
|
|
136
136
|
get xone() {
|
|
137
|
-
return this.shapeListTakingConstraint(this.
|
|
137
|
+
return this.shapeListTakingConstraint(this.generatedShape.xone);
|
|
138
138
|
}
|
|
139
139
|
shapeListTakingConstraint(identifiers) {
|
|
140
140
|
return Either.sequence(identifiers.flatMap((identifiers) => identifiers.map((identifier) => this.shapesGraph.shapeByIdentifier(identifier))));
|
package/dist/ShapesGraph.js
CHANGED
|
@@ -279,25 +279,25 @@ __decorate([
|
|
|
279
279
|
ShapesGraph.Factory = Factory;
|
|
280
280
|
class DefaultFactory extends Factory {
|
|
281
281
|
createNodeShape({ resource, shapesGraph, }) {
|
|
282
|
-
return generated.
|
|
282
|
+
return generated.NodeShape.$fromRdf(resource, {
|
|
283
283
|
ignoreRdfType: true,
|
|
284
284
|
preferredLanguages: this.preferredLanguages,
|
|
285
285
|
}).map((generatedShape) => new NodeShape(generatedShape, shapesGraph));
|
|
286
286
|
}
|
|
287
287
|
createOntology({ resource, }) {
|
|
288
|
-
return generated.
|
|
288
|
+
return generated.Ontology.$fromRdf(resource, {
|
|
289
289
|
ignoreRdfType: true,
|
|
290
290
|
preferredLanguages: this.preferredLanguages,
|
|
291
291
|
}).map((generatedOntology) => new Ontology(generatedOntology));
|
|
292
292
|
}
|
|
293
293
|
createPropertyGroup({ resource, }) {
|
|
294
|
-
return generated.
|
|
294
|
+
return generated.PropertyGroup.$fromRdf(resource, {
|
|
295
295
|
ignoreRdfType: true,
|
|
296
296
|
preferredLanguages: this.preferredLanguages,
|
|
297
297
|
}).map((propertyGroup) => new PropertyGroup(propertyGroup));
|
|
298
298
|
}
|
|
299
299
|
createPropertyShape({ resource, shapesGraph, }) {
|
|
300
|
-
return generated.
|
|
300
|
+
return generated.PropertyShape.$fromRdf(resource, {
|
|
301
301
|
ignoreRdfType: true,
|
|
302
302
|
preferredLanguages: this.preferredLanguages,
|
|
303
303
|
}).map((generatedShape) => new PropertyShape(generatedShape, shapesGraph));
|