@shaclmate/compiler 4.0.13 → 4.0.15

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.
Files changed (55) hide show
  1. package/dist/Compiler.d.ts +4 -1
  2. package/dist/Compiler.js +3 -1
  3. package/dist/ShapesGraphToAstTransformer.d.ts +10 -2
  4. package/dist/ShapesGraphToAstTransformer.js +74 -3
  5. package/dist/_ShapesGraphToAstTransformer/ShapeStack.js +6 -5
  6. package/dist/_ShapesGraphToAstTransformer/nodeShapeIdentifierMintingStrategy.d.ts +3 -2
  7. package/dist/_ShapesGraphToAstTransformer/nodeShapeIdentifierMintingStrategy.js +17 -13
  8. package/dist/_ShapesGraphToAstTransformer/nodeShapeTsFeatures.js +2 -1
  9. package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +6 -6
  10. package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.d.ts +2 -1
  11. package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +37 -30
  12. package/dist/_ShapesGraphToAstTransformer/shapeOntology.d.ts +5 -0
  13. package/dist/_ShapesGraphToAstTransformer/shapeOntology.js +25 -0
  14. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +23 -16
  15. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +10 -6
  16. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +22 -22
  17. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +127 -118
  18. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +10 -8
  19. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +3 -3
  20. package/dist/ast/ObjectType.d.ts +3 -3
  21. package/dist/enums/IdentifierMintingStrategy.d.ts +4 -0
  22. package/dist/enums/IdentifierMintingStrategy.js +17 -1
  23. package/dist/enums/TsObjectDeclarationType.d.ts +4 -0
  24. package/dist/enums/TsObjectDeclarationType.js +15 -1
  25. package/dist/enums/Visibility.d.ts +6 -0
  26. package/dist/enums/Visibility.js +18 -0
  27. package/dist/generators/ts/AbstractCollectionType.js +1 -7
  28. package/dist/generators/ts/AbstractTermType.d.ts +1 -0
  29. package/dist/generators/ts/AbstractTermType.js +6 -0
  30. package/dist/generators/ts/AbstractUnionType.d.ts +31 -9
  31. package/dist/generators/ts/AbstractUnionType.js +252 -126
  32. package/dist/generators/ts/SetType.d.ts +1 -0
  33. package/dist/generators/ts/SetType.js +12 -0
  34. package/dist/generators/ts/_NamedObjectType/AbstractProperty.d.ts +3 -3
  35. package/dist/input/ShapesGraph.d.ts +39 -22
  36. package/dist/input/ShapesGraph.js +56 -60
  37. package/dist/input/generated.d.ts +389 -191
  38. package/dist/input/generated.js +2501 -829
  39. package/dist/input/index.d.ts +1 -5
  40. package/dist/input/index.js +1 -5
  41. package/package.json +2 -2
  42. package/dist/enums/PropertyVisibility.d.ts +0 -2
  43. package/dist/enums/PropertyVisibility.js +0 -2
  44. package/dist/input/NodeShape.d.ts +0 -49
  45. package/dist/input/NodeShape.js +0 -154
  46. package/dist/input/Ontology.d.ts +0 -13
  47. package/dist/input/Ontology.js +0 -40
  48. package/dist/input/PropertyShape.d.ts +0 -20
  49. package/dist/input/PropertyShape.js +0 -78
  50. package/dist/input/Shape.d.ts +0 -4
  51. package/dist/input/Shape.js +0 -2
  52. package/dist/input/ancestorClassIris.d.ts +0 -4
  53. package/dist/input/ancestorClassIris.js +0 -24
  54. package/dist/input/descendantClassIris.d.ts +0 -4
  55. package/dist/input/descendantClassIris.js +0 -27
@@ -1,7 +1,3 @@
1
- export { PropertyGroup } from "@shaclmate/shacl-ast";
2
- export * from "./NodeShape.js";
3
- export * from "./Ontology.js";
4
- export * from "./PropertyShape.js";
5
- export * from "./Shape.js";
1
+ export { NodeShape, Ontology, PropertyGroup, PropertyShape, Shape, } from "./generated.js";
6
2
  export * from "./ShapesGraph.js";
7
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,3 @@
1
- export { PropertyGroup } from "@shaclmate/shacl-ast";
2
- export * from "./NodeShape.js";
3
- export * from "./Ontology.js";
4
- export * from "./PropertyShape.js";
5
- export * from "./Shape.js";
1
+ export { NodeShape, Ontology, PropertyGroup, PropertyShape, Shape, } from "./generated.js";
6
2
  export * from "./ShapesGraph.js";
7
3
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "@shaclmate/shacl-ast": "4.0.13",
3
+ "@shaclmate/shacl-ast": "4.0.15",
4
4
  "@rdfjs/data-model": "~2.1.1",
5
5
  "@rdfjs/dataset": "~2.0.2",
6
6
  "@rdfjs/prefix-map": "~0.1.2",
@@ -78,5 +78,5 @@
78
78
  },
79
79
  "type": "module",
80
80
  "types": "./dist/index.d.ts",
81
- "version": "4.0.13"
81
+ "version": "4.0.15"
82
82
  }
@@ -1,2 +0,0 @@
1
- export type PropertyVisibility = "private" | "protected" | "public";
2
- //# sourceMappingURL=PropertyVisibility.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=PropertyVisibility.js.map
@@ -1,49 +0,0 @@
1
- import type { NamedNode } from "@rdfjs/types";
2
- import { NodeShape as ShaclAstNodeShape } from "@shaclmate/shacl-ast";
3
- import { Either, type Maybe } from "purify-ts";
4
- import type { IdentifierMintingStrategy } from "../enums/IdentifierMintingStrategy.js";
5
- import type { TsObjectDeclarationType } from "../enums/TsObjectDeclarationType.js";
6
- import type * as generated from "./generated.js";
7
- import type { Ontology, PropertyGroup, PropertyShape, ShapesGraph } from "./index.js";
8
- import type { Shape } from "./Shape.js";
9
- export declare class NodeShape extends ShaclAstNodeShape<any, Ontology, PropertyGroup, PropertyShape, Shape> {
10
- private readonly ancestorClassIris;
11
- private readonly childClassIris;
12
- private readonly descendantClassIris;
13
- private readonly generatedNodeShape;
14
- private readonly parentClassIris;
15
- readonly isClass: boolean;
16
- readonly isList: boolean;
17
- readonly kind = "NodeShape";
18
- constructor({ ancestorClassIris, childClassIris, descendantClassIris, generatedNodeShape, isClass, isList, parentClassIris, shapesGraph, }: {
19
- ancestorClassIris: readonly NamedNode[];
20
- generatedNodeShape: generated.NodeShape;
21
- childClassIris: readonly NamedNode[];
22
- descendantClassIris: readonly NamedNode[];
23
- isClass: boolean;
24
- isList: boolean;
25
- parentClassIris: readonly NamedNode[];
26
- shapesGraph: ShapesGraph;
27
- });
28
- get abstract(): Maybe<boolean>;
29
- get ancestorNodeShapes(): Either<Error, readonly NodeShape[]>;
30
- get childNodeShapes(): Either<Error, readonly NodeShape[]>;
31
- get comment(): Maybe<string>;
32
- get descendantNodeShapes(): Either<Error, readonly NodeShape[]>;
33
- get discriminantValue(): Maybe<string>;
34
- get extern(): Maybe<boolean>;
35
- get fromRdfType(): Maybe<NamedNode>;
36
- get identifierIn(): readonly NamedNode[];
37
- get identifierMintingStrategy(): Maybe<IdentifierMintingStrategy>;
38
- get label(): Maybe<string>;
39
- get mutable(): Maybe<boolean>;
40
- get parentNodeShapes(): Either<Error, readonly NodeShape[]>;
41
- get rdfType(): Maybe<NamedNode>;
42
- get shaclmateName(): Maybe<string>;
43
- get toRdfTypes(): readonly NamedNode[];
44
- get tsFeatureExcludes(): readonly 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">[];
45
- get tsFeatureIncludes(): readonly 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">[];
46
- get tsImports(): readonly string[];
47
- get tsObjectDeclarationType(): Maybe<TsObjectDeclarationType>;
48
- }
49
- //# sourceMappingURL=NodeShape.d.ts.map
@@ -1,154 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { NodeShape as ShaclAstNodeShape } from "@shaclmate/shacl-ast";
8
- import { rdf } from "@tpluscode/rdf-ns-builders";
9
- import { Either, List } from "purify-ts";
10
- import { invariant } from "ts-invariant";
11
- import { Memoize } from "typescript-memoize";
12
- export class NodeShape extends ShaclAstNodeShape {
13
- ancestorClassIris;
14
- childClassIris;
15
- descendantClassIris;
16
- generatedNodeShape;
17
- parentClassIris;
18
- isClass;
19
- isList;
20
- kind = "NodeShape";
21
- constructor({ ancestorClassIris, childClassIris, descendantClassIris, generatedNodeShape, isClass, isList, parentClassIris, shapesGraph, }) {
22
- super(generatedNodeShape, shapesGraph);
23
- if (ancestorClassIris.length > 0 ||
24
- childClassIris.length > 0 ||
25
- descendantClassIris.length > 0 ||
26
- isList ||
27
- parentClassIris.length > 0) {
28
- invariant(isClass);
29
- }
30
- this.ancestorClassIris = ancestorClassIris;
31
- this.childClassIris = childClassIris;
32
- this.descendantClassIris = descendantClassIris;
33
- this.generatedNodeShape = generatedNodeShape;
34
- this.isClass = isClass;
35
- this.isList = isList;
36
- this.parentClassIris = parentClassIris;
37
- }
38
- get abstract() {
39
- return this.generatedNodeShape.abstract;
40
- }
41
- get ancestorNodeShapes() {
42
- return Either.sequence(this.ancestorClassIris
43
- .filter((classIri) => !classIri.equals(rdf.List))
44
- .map((classIri) => this.shapesGraph.nodeShapeByIdentifier(classIri)));
45
- }
46
- get childNodeShapes() {
47
- return Either.sequence(this.childClassIris.flatMap((classIri) => this.shapesGraph.nodeShapeByIdentifier(classIri)));
48
- }
49
- get comment() {
50
- return List.head(this.comments);
51
- }
52
- get descendantNodeShapes() {
53
- return Either.sequence(this.descendantClassIris.flatMap((classIri) => this.shapesGraph.nodeShapeByIdentifier(classIri)));
54
- }
55
- get discriminantValue() {
56
- return this.generatedNodeShape.discriminantValue;
57
- }
58
- get extern() {
59
- return this.generatedNodeShape.extern;
60
- }
61
- get fromRdfType() {
62
- return this.generatedNodeShape.fromRdfType;
63
- }
64
- get identifierIn() {
65
- return this.constraints.in_.filter((value) => value.termType === "NamedNode");
66
- }
67
- get identifierMintingStrategy() {
68
- return this.generatedNodeShape.identifierMintingStrategy.map((iri) => {
69
- switch (iri.value) {
70
- case "http://purl.org/shaclmate/ontology#_IdentifierMintingStrategy_BlankNode":
71
- return "blankNode";
72
- case "http://purl.org/shaclmate/ontology#_IdentifierMintingStrategy_SHA256":
73
- return "sha256";
74
- case "http://purl.org/shaclmate/ontology#_IdentifierMintingStrategy_UUIDv4":
75
- return "uuidv4";
76
- default:
77
- iri.value;
78
- throw new RangeError(iri.value);
79
- }
80
- });
81
- }
82
- get label() {
83
- return List.head(this.labels);
84
- }
85
- get mutable() {
86
- return this.generatedNodeShape.mutable;
87
- }
88
- get parentNodeShapes() {
89
- return Either.sequence(this.parentClassIris
90
- .filter((classIri) => !classIri.equals(rdf.List))
91
- .map((classIri) => this.shapesGraph.nodeShapeByIdentifier(classIri)));
92
- }
93
- get rdfType() {
94
- return this.generatedNodeShape.rdfType;
95
- }
96
- get shaclmateName() {
97
- return this.generatedNodeShape.name;
98
- }
99
- get toRdfTypes() {
100
- return this.generatedNodeShape.toRdfTypes;
101
- }
102
- get tsFeatureExcludes() {
103
- return this.generatedNodeShape.tsFeatureExcludes;
104
- }
105
- get tsFeatureIncludes() {
106
- return this.generatedNodeShape.tsFeatureIncludes;
107
- }
108
- get tsImports() {
109
- return this.generatedNodeShape.tsImports;
110
- }
111
- get tsObjectDeclarationType() {
112
- return this.generatedNodeShape.tsObjectDeclarationType.map((iri) => {
113
- switch (iri.value) {
114
- case "http://purl.org/shaclmate/ontology#_TsObjectDeclarationType_Class":
115
- return "class";
116
- case "http://purl.org/shaclmate/ontology#_TsObjectDeclarationType_Interface":
117
- return "interface";
118
- default:
119
- throw new RangeError(iri.value);
120
- }
121
- });
122
- }
123
- }
124
- __decorate([
125
- Memoize()
126
- ], NodeShape.prototype, "ancestorNodeShapes", null);
127
- __decorate([
128
- Memoize()
129
- ], NodeShape.prototype, "childNodeShapes", null);
130
- __decorate([
131
- Memoize()
132
- ], NodeShape.prototype, "comment", null);
133
- __decorate([
134
- Memoize()
135
- ], NodeShape.prototype, "descendantNodeShapes", null);
136
- __decorate([
137
- Memoize()
138
- ], NodeShape.prototype, "identifierIn", null);
139
- __decorate([
140
- Memoize()
141
- ], NodeShape.prototype, "identifierMintingStrategy", null);
142
- __decorate([
143
- Memoize()
144
- ], NodeShape.prototype, "label", null);
145
- __decorate([
146
- Memoize()
147
- ], NodeShape.prototype, "parentNodeShapes", null);
148
- __decorate([
149
- Memoize()
150
- ], NodeShape.prototype, "rdfType", null);
151
- __decorate([
152
- Memoize()
153
- ], NodeShape.prototype, "tsObjectDeclarationType", null);
154
- //# sourceMappingURL=NodeShape.js.map
@@ -1,13 +0,0 @@
1
- import { Ontology as ShaclAstOntology } from "@shaclmate/shacl-ast";
2
- import type { Maybe } from "purify-ts";
3
- import type { TsObjectDeclarationType } from "../enums/TsObjectDeclarationType.js";
4
- import type * as generated from "./generated.js";
5
- export declare class Ontology extends ShaclAstOntology {
6
- private readonly _generatedOntology;
7
- constructor(_generatedOntology: generated.Ontology);
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
- 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
- get tsImports(): readonly string[];
11
- get tsObjectDeclarationType(): Maybe<TsObjectDeclarationType>;
12
- }
13
- //# sourceMappingURL=Ontology.d.ts.map
@@ -1,40 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { Ontology as ShaclAstOntology } from "@shaclmate/shacl-ast";
8
- import { Memoize } from "typescript-memoize";
9
- export class Ontology extends ShaclAstOntology {
10
- _generatedOntology;
11
- constructor(_generatedOntology) {
12
- super(_generatedOntology);
13
- this._generatedOntology = _generatedOntology;
14
- }
15
- get tsFeatureExcludes() {
16
- return this._generatedOntology.tsFeatureExcludes;
17
- }
18
- get tsFeatureIncludes() {
19
- return this._generatedOntology.tsFeatureIncludes;
20
- }
21
- get tsImports() {
22
- return this._generatedOntology.tsImports;
23
- }
24
- get tsObjectDeclarationType() {
25
- return this._generatedOntology.tsObjectDeclarationType.map((iri) => {
26
- switch (iri.value) {
27
- case "http://purl.org/shaclmate/ontology#_TsObjectDeclarationType_Class":
28
- return "class";
29
- case "http://purl.org/shaclmate/ontology#_TsObjectDeclarationType_Interface":
30
- return "interface";
31
- default:
32
- throw new RangeError(iri.value);
33
- }
34
- });
35
- }
36
- }
37
- __decorate([
38
- Memoize()
39
- ], Ontology.prototype, "tsObjectDeclarationType", null);
40
- //# sourceMappingURL=Ontology.js.map
@@ -1,20 +0,0 @@
1
- import { PropertyShape as ShaclAstPropertyShape } from "@shaclmate/shacl-ast";
2
- import { Either, Maybe } from "purify-ts";
3
- import type { PropertyVisibility } from "../enums/PropertyVisibility.js";
4
- import type * as generated from "./generated.js";
5
- import type { NodeShape, Ontology, PropertyGroup, ShapesGraph } from "./index.js";
6
- import type { Shape } from "./Shape.js";
7
- export declare class PropertyShape extends ShaclAstPropertyShape<NodeShape, Ontology, PropertyGroup, any, Shape> {
8
- private readonly _generatedPropertyShape;
9
- readonly kind = "PropertyShape";
10
- constructor(_generatedPropertyShape: generated.PropertyShape, shapesGraph: ShapesGraph);
11
- get comment(): Maybe<string>;
12
- get description(): Maybe<string>;
13
- get label(): Maybe<string>;
14
- get mutable(): Maybe<boolean>;
15
- get name(): Maybe<string>;
16
- get resolve(): Either<Error, Maybe<NodeShape>>;
17
- get shaclmateName(): Maybe<string>;
18
- get visibility(): PropertyVisibility;
19
- }
20
- //# sourceMappingURL=PropertyShape.d.ts.map
@@ -1,78 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { PropertyShape as ShaclAstPropertyShape } from "@shaclmate/shacl-ast";
8
- import { Either, List, Maybe } from "purify-ts";
9
- import { Memoize } from "typescript-memoize";
10
- export class PropertyShape extends ShaclAstPropertyShape {
11
- _generatedPropertyShape;
12
- kind = "PropertyShape";
13
- constructor(_generatedPropertyShape, shapesGraph) {
14
- super({ ..._generatedPropertyShape, uniqueLang: Maybe.empty() }, shapesGraph);
15
- this._generatedPropertyShape = _generatedPropertyShape;
16
- }
17
- get comment() {
18
- return List.head(this.comments);
19
- }
20
- get description() {
21
- return List.head(super.descriptions);
22
- }
23
- get label() {
24
- return List.head(this.labels);
25
- }
26
- get mutable() {
27
- return this._generatedPropertyShape.mutable;
28
- }
29
- get name() {
30
- return List.head(this.names);
31
- }
32
- get resolve() {
33
- const identifier = this._generatedPropertyShape.resolve.extract();
34
- return identifier
35
- ? this.shapesGraph
36
- .nodeShapeByIdentifier(identifier)
37
- .map((_) => Maybe.of(_))
38
- : Either.of(Maybe.empty());
39
- }
40
- get shaclmateName() {
41
- return this._generatedPropertyShape.name;
42
- }
43
- get visibility() {
44
- return this._generatedPropertyShape.visibility
45
- .map((iri) => {
46
- switch (iri.value) {
47
- case "http://purl.org/shaclmate/ontology#_Visibility_Private":
48
- return "private";
49
- case "http://purl.org/shaclmate/ontology#_Visibility_Protected":
50
- return "protected";
51
- case "http://purl.org/shaclmate/ontology#_Visibility_Public":
52
- return "public";
53
- default:
54
- throw new RangeError(iri.value);
55
- }
56
- })
57
- .orDefault("public");
58
- }
59
- }
60
- __decorate([
61
- Memoize()
62
- ], PropertyShape.prototype, "comment", null);
63
- __decorate([
64
- Memoize()
65
- ], PropertyShape.prototype, "description", null);
66
- __decorate([
67
- Memoize()
68
- ], PropertyShape.prototype, "label", null);
69
- __decorate([
70
- Memoize()
71
- ], PropertyShape.prototype, "name", null);
72
- __decorate([
73
- Memoize()
74
- ], PropertyShape.prototype, "resolve", null);
75
- __decorate([
76
- Memoize()
77
- ], PropertyShape.prototype, "visibility", null);
78
- //# sourceMappingURL=PropertyShape.js.map
@@ -1,4 +0,0 @@
1
- import type { NodeShape } from "./NodeShape.js";
2
- import type { PropertyShape } from "./PropertyShape.js";
3
- export type Shape = NodeShape | PropertyShape;
4
- //# sourceMappingURL=Shape.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Shape.js.map
@@ -1,4 +0,0 @@
1
- import type { NamedNode } from "@rdfjs/types";
2
- import type { Resource } from "rdfjs-resource";
3
- export declare function ancestorClassIris(classResource: Resource, maxDepth: number): readonly NamedNode[];
4
- //# sourceMappingURL=ancestorClassIris.d.ts.map
@@ -1,24 +0,0 @@
1
- import TermSet from "@rdfjs/term-set";
2
- import { rdfs } from "@tpluscode/rdf-ns-builders";
3
- export function ancestorClassIris(classResource, maxDepth) {
4
- const ancestorClassIris = new TermSet();
5
- function ancestorClassIrisRecursive(classResource, depth) {
6
- for (const parentClassValue of classResource.values(rdfs.subClassOf)) {
7
- parentClassValue.toResource().ifRight((parentClassResource) => {
8
- if (parentClassResource.identifier.termType !== "NamedNode") {
9
- return;
10
- }
11
- if (ancestorClassIris.has(parentClassResource.identifier)) {
12
- return;
13
- }
14
- ancestorClassIris.add(parentClassResource.identifier);
15
- if (depth < maxDepth) {
16
- ancestorClassIrisRecursive(parentClassResource, depth + 1);
17
- }
18
- });
19
- }
20
- }
21
- ancestorClassIrisRecursive(classResource, 1);
22
- return [...ancestorClassIris];
23
- }
24
- //# sourceMappingURL=ancestorClassIris.js.map
@@ -1,4 +0,0 @@
1
- import type { NamedNode } from "@rdfjs/types";
2
- import type { Resource } from "rdfjs-resource";
3
- export declare function descendantClassIris(classResource: Resource, maxDepth: number): readonly NamedNode[];
4
- //# sourceMappingURL=descendantClassIris.d.ts.map
@@ -1,27 +0,0 @@
1
- import TermSet from "@rdfjs/term-set";
2
- import { rdfs } from "@tpluscode/rdf-ns-builders";
3
- export function descendantClassIris(classResource, maxDepth) {
4
- const descendantClassIris = new TermSet();
5
- function descendantClassIrisRecursive(classResource, depth) {
6
- for (const childClassValue of classResource.values({
7
- path: rdfs.subClassOf,
8
- termType: "InversePath",
9
- })) {
10
- childClassValue.toResource().ifRight((childClassResource) => {
11
- if (childClassResource.identifier.termType !== "NamedNode") {
12
- return;
13
- }
14
- if (descendantClassIris.has(childClassResource.identifier)) {
15
- return;
16
- }
17
- descendantClassIris.add(childClassResource.identifier);
18
- if (depth < maxDepth) {
19
- descendantClassIrisRecursive(childClassResource, depth + 1);
20
- }
21
- });
22
- }
23
- }
24
- descendantClassIrisRecursive(classResource, 1);
25
- return [...descendantClassIris];
26
- }
27
- //# sourceMappingURL=descendantClassIris.js.map