@shaclmate/compiler 4.0.7 → 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/input/NodeShape.d.ts +5 -5
- package/dist/input/NodeShape.js +20 -20
- package/dist/input/Ontology.d.ts +4 -4
- package/dist/input/Ontology.js +10 -10
- package/dist/input/PropertyShape.d.ts +4 -4
- package/dist/input/PropertyShape.js +10 -10
- package/dist/input/ShapesGraph.js +5 -5
- package/dist/input/generated.d.ts +708 -2008
- package/dist/input/generated.js +2504 -2156
- package/package.json +2 -2
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import type { NamedNode } from "@rdfjs/types";
|
|
2
|
-
import { NodeShape as
|
|
2
|
+
import { NodeShape as ShaclAstNodeShape } from "@shaclmate/shacl-ast";
|
|
3
3
|
import { Either, type Maybe } from "purify-ts";
|
|
4
4
|
import type { IdentifierMintingStrategy } from "../enums/IdentifierMintingStrategy.js";
|
|
5
5
|
import type { TsObjectDeclarationType } from "../enums/TsObjectDeclarationType.js";
|
|
6
6
|
import type * as generated from "./generated.js";
|
|
7
7
|
import type { Ontology, PropertyGroup, PropertyShape, ShapesGraph } from "./index.js";
|
|
8
8
|
import type { Shape } from "./Shape.js";
|
|
9
|
-
export declare class NodeShape extends
|
|
9
|
+
export declare class NodeShape extends ShaclAstNodeShape<any, Ontology, PropertyGroup, PropertyShape, Shape> {
|
|
10
10
|
private readonly ancestorClassIris;
|
|
11
11
|
private readonly childClassIris;
|
|
12
12
|
private readonly descendantClassIris;
|
|
13
|
-
private readonly
|
|
13
|
+
private readonly generatedNodeShape;
|
|
14
14
|
private readonly parentClassIris;
|
|
15
15
|
readonly isClass: boolean;
|
|
16
16
|
readonly isList: boolean;
|
|
17
17
|
readonly kind = "NodeShape";
|
|
18
|
-
constructor({ ancestorClassIris, childClassIris, descendantClassIris,
|
|
18
|
+
constructor({ ancestorClassIris, childClassIris, descendantClassIris, generatedNodeShape, isClass, isList, parentClassIris, shapesGraph, }: {
|
|
19
19
|
ancestorClassIris: readonly NamedNode[];
|
|
20
|
-
|
|
20
|
+
generatedNodeShape: generated.NodeShape;
|
|
21
21
|
childClassIris: readonly NamedNode[];
|
|
22
22
|
descendantClassIris: readonly NamedNode[];
|
|
23
23
|
isClass: boolean;
|
package/dist/input/NodeShape.js
CHANGED
|
@@ -4,22 +4,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { NodeShape as
|
|
7
|
+
import { NodeShape as ShaclAstNodeShape } from "@shaclmate/shacl-ast";
|
|
8
8
|
import { rdf } from "@tpluscode/rdf-ns-builders";
|
|
9
9
|
import { Either, List } from "purify-ts";
|
|
10
10
|
import { invariant } from "ts-invariant";
|
|
11
11
|
import { Memoize } from "typescript-memoize";
|
|
12
|
-
export class NodeShape extends
|
|
12
|
+
export class NodeShape extends ShaclAstNodeShape {
|
|
13
13
|
ancestorClassIris;
|
|
14
14
|
childClassIris;
|
|
15
15
|
descendantClassIris;
|
|
16
|
-
|
|
16
|
+
generatedNodeShape;
|
|
17
17
|
parentClassIris;
|
|
18
18
|
isClass;
|
|
19
19
|
isList;
|
|
20
20
|
kind = "NodeShape";
|
|
21
|
-
constructor({ ancestorClassIris, childClassIris, descendantClassIris,
|
|
22
|
-
super(
|
|
21
|
+
constructor({ ancestorClassIris, childClassIris, descendantClassIris, generatedNodeShape, isClass, isList, parentClassIris, shapesGraph, }) {
|
|
22
|
+
super(generatedNodeShape, shapesGraph);
|
|
23
23
|
if (ancestorClassIris.length > 0 ||
|
|
24
24
|
childClassIris.length > 0 ||
|
|
25
25
|
descendantClassIris.length > 0 ||
|
|
@@ -30,13 +30,13 @@ export class NodeShape extends ShaclCoreNodeShape {
|
|
|
30
30
|
this.ancestorClassIris = ancestorClassIris;
|
|
31
31
|
this.childClassIris = childClassIris;
|
|
32
32
|
this.descendantClassIris = descendantClassIris;
|
|
33
|
-
this.
|
|
33
|
+
this.generatedNodeShape = generatedNodeShape;
|
|
34
34
|
this.isClass = isClass;
|
|
35
35
|
this.isList = isList;
|
|
36
36
|
this.parentClassIris = parentClassIris;
|
|
37
37
|
}
|
|
38
38
|
get abstract() {
|
|
39
|
-
return this.
|
|
39
|
+
return this.generatedNodeShape.abstract;
|
|
40
40
|
}
|
|
41
41
|
get ancestorNodeShapes() {
|
|
42
42
|
return Either.sequence(this.ancestorClassIris
|
|
@@ -53,22 +53,22 @@ export class NodeShape extends ShaclCoreNodeShape {
|
|
|
53
53
|
return Either.sequence(this.descendantClassIris.flatMap((classIri) => this.shapesGraph.nodeShapeByIdentifier(classIri)));
|
|
54
54
|
}
|
|
55
55
|
get discriminantValue() {
|
|
56
|
-
return this.
|
|
56
|
+
return this.generatedNodeShape.discriminantValue;
|
|
57
57
|
}
|
|
58
58
|
get export() {
|
|
59
|
-
return this.
|
|
59
|
+
return this.generatedNodeShape.export_;
|
|
60
60
|
}
|
|
61
61
|
get extern() {
|
|
62
|
-
return this.
|
|
62
|
+
return this.generatedNodeShape.extern;
|
|
63
63
|
}
|
|
64
64
|
get fromRdfType() {
|
|
65
|
-
return this.
|
|
65
|
+
return this.generatedNodeShape.fromRdfType;
|
|
66
66
|
}
|
|
67
67
|
get identifierIn() {
|
|
68
68
|
return this.constraints.in_.filter((value) => value.termType === "NamedNode");
|
|
69
69
|
}
|
|
70
70
|
get identifierMintingStrategy() {
|
|
71
|
-
return this.
|
|
71
|
+
return this.generatedNodeShape.identifierMintingStrategy.map((iri) => {
|
|
72
72
|
switch (iri.value) {
|
|
73
73
|
case "http://purl.org/shaclmate/ontology#_IdentifierMintingStrategy_BlankNode":
|
|
74
74
|
return "blankNode";
|
|
@@ -86,7 +86,7 @@ export class NodeShape extends ShaclCoreNodeShape {
|
|
|
86
86
|
return List.head(this.labels);
|
|
87
87
|
}
|
|
88
88
|
get mutable() {
|
|
89
|
-
return this.
|
|
89
|
+
return this.generatedNodeShape.mutable;
|
|
90
90
|
}
|
|
91
91
|
get parentNodeShapes() {
|
|
92
92
|
return Either.sequence(this.parentClassIris
|
|
@@ -94,25 +94,25 @@ export class NodeShape extends ShaclCoreNodeShape {
|
|
|
94
94
|
.map((classIri) => this.shapesGraph.nodeShapeByIdentifier(classIri)));
|
|
95
95
|
}
|
|
96
96
|
get rdfType() {
|
|
97
|
-
return this.
|
|
97
|
+
return this.generatedNodeShape.rdfType;
|
|
98
98
|
}
|
|
99
99
|
get shaclmateName() {
|
|
100
|
-
return this.
|
|
100
|
+
return this.generatedNodeShape.name;
|
|
101
101
|
}
|
|
102
102
|
get toRdfTypes() {
|
|
103
|
-
return this.
|
|
103
|
+
return this.generatedNodeShape.toRdfTypes;
|
|
104
104
|
}
|
|
105
105
|
get tsFeatureExcludes() {
|
|
106
|
-
return this.
|
|
106
|
+
return this.generatedNodeShape.tsFeatureExcludes;
|
|
107
107
|
}
|
|
108
108
|
get tsFeatureIncludes() {
|
|
109
|
-
return this.
|
|
109
|
+
return this.generatedNodeShape.tsFeatureIncludes;
|
|
110
110
|
}
|
|
111
111
|
get tsImports() {
|
|
112
|
-
return this.
|
|
112
|
+
return this.generatedNodeShape.tsImports;
|
|
113
113
|
}
|
|
114
114
|
get tsObjectDeclarationType() {
|
|
115
|
-
return this.
|
|
115
|
+
return this.generatedNodeShape.tsObjectDeclarationType.map((iri) => {
|
|
116
116
|
switch (iri.value) {
|
|
117
117
|
case "http://purl.org/shaclmate/ontology#_TsObjectDeclarationType_Class":
|
|
118
118
|
return "class";
|
package/dist/input/Ontology.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Ontology as
|
|
1
|
+
import { Ontology as ShaclAstOntology } from "@shaclmate/shacl-ast";
|
|
2
2
|
import type { Maybe } from "purify-ts";
|
|
3
3
|
import type { TsObjectDeclarationType } from "../enums/TsObjectDeclarationType.js";
|
|
4
4
|
import type * as generated from "./generated.js";
|
|
5
|
-
export declare class Ontology extends
|
|
6
|
-
private readonly
|
|
7
|
-
constructor(
|
|
5
|
+
export declare class Ontology extends ShaclAstOntology {
|
|
6
|
+
private readonly _generatedOntology;
|
|
7
|
+
constructor(_generatedOntology: generated.Ontology);
|
|
8
8
|
get tsFeatureExcludes(): readonly import("@rdfjs/types").NamedNode<"http://purl.org/shaclmate/ontology#_TsFeatures_All" | "http://purl.org/shaclmate/ontology#_TsFeature_Create" | "http://purl.org/shaclmate/ontology#_TsFeatures_Default" | "http://purl.org/shaclmate/ontology#_TsFeature_Equals" | "http://purl.org/shaclmate/ontology#_TsFeature_Graphql" | "http://purl.org/shaclmate/ontology#_TsFeature_Hash" | "http://purl.org/shaclmate/ontology#_TsFeature_Json" | "http://purl.org/shaclmate/ontology#_TsFeatures_None" | "http://purl.org/shaclmate/ontology#_TsFeature_Rdf" | "http://purl.org/shaclmate/ontology#_TsFeature_Sparql">[];
|
|
9
9
|
get tsFeatureIncludes(): readonly import("@rdfjs/types").NamedNode<"http://purl.org/shaclmate/ontology#_TsFeatures_All" | "http://purl.org/shaclmate/ontology#_TsFeature_Create" | "http://purl.org/shaclmate/ontology#_TsFeatures_Default" | "http://purl.org/shaclmate/ontology#_TsFeature_Equals" | "http://purl.org/shaclmate/ontology#_TsFeature_Graphql" | "http://purl.org/shaclmate/ontology#_TsFeature_Hash" | "http://purl.org/shaclmate/ontology#_TsFeature_Json" | "http://purl.org/shaclmate/ontology#_TsFeatures_None" | "http://purl.org/shaclmate/ontology#_TsFeature_Rdf" | "http://purl.org/shaclmate/ontology#_TsFeature_Sparql">[];
|
|
10
10
|
get tsImports(): readonly string[];
|
package/dist/input/Ontology.js
CHANGED
|
@@ -4,25 +4,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { Ontology as
|
|
7
|
+
import { Ontology as ShaclAstOntology } from "@shaclmate/shacl-ast";
|
|
8
8
|
import { Memoize } from "typescript-memoize";
|
|
9
|
-
export class Ontology extends
|
|
10
|
-
|
|
11
|
-
constructor(
|
|
12
|
-
super(
|
|
13
|
-
this.
|
|
9
|
+
export class Ontology extends ShaclAstOntology {
|
|
10
|
+
_generatedOntology;
|
|
11
|
+
constructor(_generatedOntology) {
|
|
12
|
+
super(_generatedOntology);
|
|
13
|
+
this._generatedOntology = _generatedOntology;
|
|
14
14
|
}
|
|
15
15
|
get tsFeatureExcludes() {
|
|
16
|
-
return this.
|
|
16
|
+
return this._generatedOntology.tsFeatureExcludes;
|
|
17
17
|
}
|
|
18
18
|
get tsFeatureIncludes() {
|
|
19
|
-
return this.
|
|
19
|
+
return this._generatedOntology.tsFeatureIncludes;
|
|
20
20
|
}
|
|
21
21
|
get tsImports() {
|
|
22
|
-
return this.
|
|
22
|
+
return this._generatedOntology.tsImports;
|
|
23
23
|
}
|
|
24
24
|
get tsObjectDeclarationType() {
|
|
25
|
-
return this.
|
|
25
|
+
return this._generatedOntology.tsObjectDeclarationType.map((iri) => {
|
|
26
26
|
switch (iri.value) {
|
|
27
27
|
case "http://purl.org/shaclmate/ontology#_TsObjectDeclarationType_Class":
|
|
28
28
|
return "class";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { PropertyShape as
|
|
1
|
+
import { PropertyShape as ShaclAstPropertyShape } from "@shaclmate/shacl-ast";
|
|
2
2
|
import { Either, Maybe } from "purify-ts";
|
|
3
3
|
import type { PropertyVisibility } from "../enums/PropertyVisibility.js";
|
|
4
4
|
import type * as generated from "./generated.js";
|
|
5
5
|
import type { NodeShape, Ontology, PropertyGroup, ShapesGraph } from "./index.js";
|
|
6
6
|
import type { Shape } from "./Shape.js";
|
|
7
|
-
export declare class PropertyShape extends
|
|
8
|
-
private readonly
|
|
7
|
+
export declare class PropertyShape extends ShaclAstPropertyShape<NodeShape, Ontology, PropertyGroup, any, Shape> {
|
|
8
|
+
private readonly _generatedPropertyShape;
|
|
9
9
|
readonly kind = "PropertyShape";
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(_generatedPropertyShape: generated.PropertyShape, shapesGraph: ShapesGraph);
|
|
11
11
|
get comment(): Maybe<string>;
|
|
12
12
|
get description(): Maybe<string>;
|
|
13
13
|
get label(): Maybe<string>;
|
|
@@ -4,15 +4,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { PropertyShape as
|
|
7
|
+
import { PropertyShape as ShaclAstPropertyShape } from "@shaclmate/shacl-ast";
|
|
8
8
|
import { Either, List, Maybe } from "purify-ts";
|
|
9
9
|
import { Memoize } from "typescript-memoize";
|
|
10
|
-
export class PropertyShape extends
|
|
11
|
-
|
|
10
|
+
export class PropertyShape extends ShaclAstPropertyShape {
|
|
11
|
+
_generatedPropertyShape;
|
|
12
12
|
kind = "PropertyShape";
|
|
13
|
-
constructor(
|
|
14
|
-
super({ ...
|
|
15
|
-
this.
|
|
13
|
+
constructor(_generatedPropertyShape, shapesGraph) {
|
|
14
|
+
super({ ..._generatedPropertyShape, uniqueLang: Maybe.empty() }, shapesGraph);
|
|
15
|
+
this._generatedPropertyShape = _generatedPropertyShape;
|
|
16
16
|
}
|
|
17
17
|
get comment() {
|
|
18
18
|
return List.head(this.comments);
|
|
@@ -24,13 +24,13 @@ export class PropertyShape extends ShaclCorePropertyShape {
|
|
|
24
24
|
return List.head(this.labels);
|
|
25
25
|
}
|
|
26
26
|
get mutable() {
|
|
27
|
-
return this.
|
|
27
|
+
return this._generatedPropertyShape.mutable;
|
|
28
28
|
}
|
|
29
29
|
get name() {
|
|
30
30
|
return List.head(this.names);
|
|
31
31
|
}
|
|
32
32
|
get resolve() {
|
|
33
|
-
const identifier = this.
|
|
33
|
+
const identifier = this._generatedPropertyShape.resolve.extract();
|
|
34
34
|
return identifier
|
|
35
35
|
? this.shapesGraph
|
|
36
36
|
.nodeShapeByIdentifier(identifier)
|
|
@@ -38,10 +38,10 @@ export class PropertyShape extends ShaclCorePropertyShape {
|
|
|
38
38
|
: Either.of(Maybe.empty());
|
|
39
39
|
}
|
|
40
40
|
get shaclmateName() {
|
|
41
|
-
return this.
|
|
41
|
+
return this._generatedPropertyShape.name;
|
|
42
42
|
}
|
|
43
43
|
get visibility() {
|
|
44
|
-
return this.
|
|
44
|
+
return this._generatedPropertyShape.visibility
|
|
45
45
|
.map((iri) => {
|
|
46
46
|
switch (iri.value) {
|
|
47
47
|
case "http://purl.org/shaclmate/ontology#_Visibility_Private":
|
|
@@ -8,7 +8,7 @@ export var ShapesGraph;
|
|
|
8
8
|
(function (ShapesGraph) {
|
|
9
9
|
class Factory extends _ShapesGraph.Factory {
|
|
10
10
|
createNodeShape({ resource, shapesGraph, }) {
|
|
11
|
-
return generated.
|
|
11
|
+
return generated.NodeShape.$fromRdf(resource, {
|
|
12
12
|
ignoreRdfType: true,
|
|
13
13
|
preferredLanguages: this.preferredLanguages,
|
|
14
14
|
}).map((generatedShape) => {
|
|
@@ -29,7 +29,7 @@ export var ShapesGraph;
|
|
|
29
29
|
ancestorClassIris: ancestorClassIris_,
|
|
30
30
|
childClassIris: descendantClassIris(resource, 1),
|
|
31
31
|
descendantClassIris: descendantClassIris_,
|
|
32
|
-
|
|
32
|
+
generatedNodeShape: generatedShape,
|
|
33
33
|
isClass,
|
|
34
34
|
isList,
|
|
35
35
|
parentClassIris: ancestorClassIris(resource, 1),
|
|
@@ -38,19 +38,19 @@ export var ShapesGraph;
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
createOntology({ resource, }) {
|
|
41
|
-
return generated.
|
|
41
|
+
return generated.Ontology.$fromRdf(resource, {
|
|
42
42
|
ignoreRdfType: true,
|
|
43
43
|
preferredLanguages: this.preferredLanguages,
|
|
44
44
|
}).map((generatedOntology) => new Ontology(generatedOntology));
|
|
45
45
|
}
|
|
46
46
|
createPropertyGroup({ resource, }) {
|
|
47
|
-
return generated.
|
|
47
|
+
return generated.PropertyGroup.$fromRdf(resource, {
|
|
48
48
|
ignoreRdfType: true,
|
|
49
49
|
preferredLanguages: this.preferredLanguages,
|
|
50
50
|
}).map((generatedPropertyGroup) => new PropertyGroup(generatedPropertyGroup));
|
|
51
51
|
}
|
|
52
52
|
createPropertyShape({ resource, shapesGraph, }) {
|
|
53
|
-
return generated.
|
|
53
|
+
return generated.PropertyShape.$fromRdf(resource, {
|
|
54
54
|
ignoreRdfType: true,
|
|
55
55
|
preferredLanguages: this.preferredLanguages,
|
|
56
56
|
}).map((generatedShape) => new PropertyShape(generatedShape, shapesGraph));
|