@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.
@@ -1,23 +1,23 @@
1
1
  import type { NamedNode } from "@rdfjs/types";
2
- import { NodeShape as ShaclCoreNodeShape } from "@shaclmate/shacl-ast";
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 ShaclCoreNodeShape<any, Ontology, PropertyGroup, PropertyShape, Shape> {
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 generatedShaclmateNodeShape;
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, generatedShaclmateNodeShape, isClass, isList, parentClassIris, shapesGraph, }: {
18
+ constructor({ ancestorClassIris, childClassIris, descendantClassIris, generatedNodeShape, isClass, isList, parentClassIris, shapesGraph, }: {
19
19
  ancestorClassIris: readonly NamedNode[];
20
- generatedShaclmateNodeShape: generated.ShaclmateNodeShape;
20
+ generatedNodeShape: generated.NodeShape;
21
21
  childClassIris: readonly NamedNode[];
22
22
  descendantClassIris: readonly NamedNode[];
23
23
  isClass: boolean;
@@ -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 ShaclCoreNodeShape } from "@shaclmate/shacl-ast";
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 ShaclCoreNodeShape {
12
+ export class NodeShape extends ShaclAstNodeShape {
13
13
  ancestorClassIris;
14
14
  childClassIris;
15
15
  descendantClassIris;
16
- generatedShaclmateNodeShape;
16
+ generatedNodeShape;
17
17
  parentClassIris;
18
18
  isClass;
19
19
  isList;
20
20
  kind = "NodeShape";
21
- constructor({ ancestorClassIris, childClassIris, descendantClassIris, generatedShaclmateNodeShape, isClass, isList, parentClassIris, shapesGraph, }) {
22
- super(generatedShaclmateNodeShape, shapesGraph);
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.generatedShaclmateNodeShape = generatedShaclmateNodeShape;
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.generatedShaclmateNodeShape.abstract;
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.generatedShaclmateNodeShape.discriminantValue;
56
+ return this.generatedNodeShape.discriminantValue;
57
57
  }
58
58
  get export() {
59
- return this.generatedShaclmateNodeShape.export_;
59
+ return this.generatedNodeShape.export_;
60
60
  }
61
61
  get extern() {
62
- return this.generatedShaclmateNodeShape.extern;
62
+ return this.generatedNodeShape.extern;
63
63
  }
64
64
  get fromRdfType() {
65
- return this.generatedShaclmateNodeShape.fromRdfType;
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.generatedShaclmateNodeShape.identifierMintingStrategy.map((iri) => {
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.generatedShaclmateNodeShape.mutable;
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.generatedShaclmateNodeShape.rdfType;
97
+ return this.generatedNodeShape.rdfType;
98
98
  }
99
99
  get shaclmateName() {
100
- return this.generatedShaclmateNodeShape.name;
100
+ return this.generatedNodeShape.name;
101
101
  }
102
102
  get toRdfTypes() {
103
- return this.generatedShaclmateNodeShape.toRdfTypes;
103
+ return this.generatedNodeShape.toRdfTypes;
104
104
  }
105
105
  get tsFeatureExcludes() {
106
- return this.generatedShaclmateNodeShape.tsFeatureExcludes;
106
+ return this.generatedNodeShape.tsFeatureExcludes;
107
107
  }
108
108
  get tsFeatureIncludes() {
109
- return this.generatedShaclmateNodeShape.tsFeatureIncludes;
109
+ return this.generatedNodeShape.tsFeatureIncludes;
110
110
  }
111
111
  get tsImports() {
112
- return this.generatedShaclmateNodeShape.tsImports;
112
+ return this.generatedNodeShape.tsImports;
113
113
  }
114
114
  get tsObjectDeclarationType() {
115
- return this.generatedShaclmateNodeShape.tsObjectDeclarationType.map((iri) => {
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";
@@ -1,10 +1,10 @@
1
- import { Ontology as OwlOntology } from "@shaclmate/shacl-ast";
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 OwlOntology {
6
- private readonly generatedShaclmateOntology;
7
- constructor(generatedShaclmateOntology: generated.ShaclmateOntology);
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[];
@@ -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 OwlOntology } from "@shaclmate/shacl-ast";
7
+ import { Ontology as ShaclAstOntology } from "@shaclmate/shacl-ast";
8
8
  import { Memoize } from "typescript-memoize";
9
- export class Ontology extends OwlOntology {
10
- generatedShaclmateOntology;
11
- constructor(generatedShaclmateOntology) {
12
- super(generatedShaclmateOntology);
13
- this.generatedShaclmateOntology = generatedShaclmateOntology;
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.generatedShaclmateOntology.tsFeatureExcludes;
16
+ return this._generatedOntology.tsFeatureExcludes;
17
17
  }
18
18
  get tsFeatureIncludes() {
19
- return this.generatedShaclmateOntology.tsFeatureIncludes;
19
+ return this._generatedOntology.tsFeatureIncludes;
20
20
  }
21
21
  get tsImports() {
22
- return this.generatedShaclmateOntology.tsImports;
22
+ return this._generatedOntology.tsImports;
23
23
  }
24
24
  get tsObjectDeclarationType() {
25
- return this.generatedShaclmateOntology.tsObjectDeclarationType.map((iri) => {
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 ShaclCorePropertyShape } from "@shaclmate/shacl-ast";
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 ShaclCorePropertyShape<NodeShape, Ontology, PropertyGroup, any, Shape> {
8
- private readonly generatedShaclmatePropertyShape;
7
+ export declare class PropertyShape extends ShaclAstPropertyShape<NodeShape, Ontology, PropertyGroup, any, Shape> {
8
+ private readonly _generatedPropertyShape;
9
9
  readonly kind = "PropertyShape";
10
- constructor(generatedShaclmatePropertyShape: generated.ShaclmatePropertyShape, shapesGraph: ShapesGraph);
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 ShaclCorePropertyShape } from "@shaclmate/shacl-ast";
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 ShaclCorePropertyShape {
11
- generatedShaclmatePropertyShape;
10
+ export class PropertyShape extends ShaclAstPropertyShape {
11
+ _generatedPropertyShape;
12
12
  kind = "PropertyShape";
13
- constructor(generatedShaclmatePropertyShape, shapesGraph) {
14
- super({ ...generatedShaclmatePropertyShape, uniqueLang: Maybe.empty() }, shapesGraph);
15
- this.generatedShaclmatePropertyShape = generatedShaclmatePropertyShape;
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.generatedShaclmatePropertyShape.mutable;
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.generatedShaclmatePropertyShape.resolve.extract();
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.generatedShaclmatePropertyShape.name;
41
+ return this._generatedPropertyShape.name;
42
42
  }
43
43
  get visibility() {
44
- return this.generatedShaclmatePropertyShape.visibility
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.ShaclmateNodeShape.$fromRdf(resource, {
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
- generatedShaclmateNodeShape: generatedShape,
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.ShaclmateOntology.$fromRdf(resource, {
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.ShaclCorePropertyGroup.$fromRdf(resource, {
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.ShaclmatePropertyShape.$fromRdf(resource, {
53
+ return generated.PropertyShape.$fromRdf(resource, {
54
54
  ignoreRdfType: true,
55
55
  preferredLanguages: this.preferredLanguages,
56
56
  }).map((generatedShape) => new PropertyShape(generatedShape, shapesGraph));