@shaclmate/compiler 4.0.13 → 4.0.14

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 (40) hide show
  1. package/dist/ShapesGraphToAstTransformer.js +2 -2
  2. package/dist/_ShapesGraphToAstTransformer/ShapeStack.js +6 -5
  3. package/dist/_ShapesGraphToAstTransformer/nodeShapeIdentifierMintingStrategy.d.ts +3 -2
  4. package/dist/_ShapesGraphToAstTransformer/nodeShapeIdentifierMintingStrategy.js +8 -5
  5. package/dist/_ShapesGraphToAstTransformer/nodeShapeTsFeatures.js +2 -1
  6. package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +6 -6
  7. package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.d.ts +2 -1
  8. package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +23 -17
  9. package/dist/_ShapesGraphToAstTransformer/shapeOntology.d.ts +5 -0
  10. package/dist/_ShapesGraphToAstTransformer/shapeOntology.js +25 -0
  11. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +23 -16
  12. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +6 -6
  13. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +15 -15
  14. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +122 -118
  15. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +10 -8
  16. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +3 -3
  17. package/dist/ast/ObjectType.d.ts +3 -3
  18. package/dist/enums/IdentifierMintingStrategy.d.ts +4 -0
  19. package/dist/enums/IdentifierMintingStrategy.js +17 -1
  20. package/dist/enums/TsObjectDeclarationType.d.ts +4 -0
  21. package/dist/enums/TsObjectDeclarationType.js +15 -1
  22. package/dist/enums/Visibility.d.ts +6 -0
  23. package/dist/enums/Visibility.js +18 -0
  24. package/dist/generators/ts/_NamedObjectType/AbstractProperty.d.ts +3 -3
  25. package/dist/input/NodeShape.d.ts +8 -46
  26. package/dist/input/NodeShape.js +1 -153
  27. package/dist/input/Shape.d.ts +2 -2
  28. package/dist/input/ShapesGraph.d.ts +10 -10
  29. package/dist/input/ShapesGraph.js +11 -13
  30. package/dist/input/generated.d.ts +185 -152
  31. package/dist/input/generated.js +316 -249
  32. package/dist/input/index.d.ts +1 -3
  33. package/dist/input/index.js +1 -3
  34. package/package.json +2 -2
  35. package/dist/enums/PropertyVisibility.d.ts +0 -2
  36. package/dist/enums/PropertyVisibility.js +0 -2
  37. package/dist/input/Ontology.d.ts +0 -13
  38. package/dist/input/Ontology.js +0 -40
  39. package/dist/input/PropertyShape.d.ts +0 -20
  40. package/dist/input/PropertyShape.js +0 -78
@@ -1,7 +1,5 @@
1
- export { PropertyGroup } from "@shaclmate/shacl-ast";
1
+ export { Ontology, PropertyGroup, PropertyShape, } from "./generated.js";
2
2
  export * from "./NodeShape.js";
3
- export * from "./Ontology.js";
4
- export * from "./PropertyShape.js";
5
3
  export * from "./Shape.js";
6
4
  export * from "./ShapesGraph.js";
7
5
  //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,5 @@
1
- export { PropertyGroup } from "@shaclmate/shacl-ast";
1
+ export { Ontology, PropertyGroup, PropertyShape, } from "./generated.js";
2
2
  export * from "./NodeShape.js";
3
- export * from "./Ontology.js";
4
- export * from "./PropertyShape.js";
5
3
  export * from "./Shape.js";
6
4
  export * from "./ShapesGraph.js";
7
5
  //# 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.14",
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.14"
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,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