@shaclmate/compiler 4.0.23 → 4.0.25

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 (117) hide show
  1. package/dist/Compiler.d.ts +1 -1
  2. package/dist/ShapesGraphToAstTransformer.d.ts +1 -1
  3. package/dist/ShapesGraphToAstTransformer.js +16 -16
  4. package/dist/_ShapesGraphToAstTransformer/nodeShapeTsFeatures.d.ts +1 -1
  5. package/dist/_ShapesGraphToAstTransformer/nodeShapeTsFeatures.js +5 -2
  6. package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +6 -5
  7. package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +1 -1
  8. package/dist/_ShapesGraphToAstTransformer/shapeOntology.js +4 -3
  9. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +11 -17
  10. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +3 -3
  11. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +6 -11
  12. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +21 -40
  13. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +1 -1
  14. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +3 -3
  15. package/dist/ast/AbstractCompoundType.d.ts +1 -1
  16. package/dist/ast/AbstractLazyObjectType.d.ts +0 -2
  17. package/dist/ast/ListType.d.ts +1 -8
  18. package/dist/ast/ListType.js +1 -6
  19. package/dist/ast/ObjectType.d.ts +3 -30
  20. package/dist/ast/ObjectType.js +2 -26
  21. package/dist/generators/ts/AbstractContainerType.d.ts +0 -1
  22. package/dist/generators/ts/AbstractContainerType.js +0 -1
  23. package/dist/generators/ts/AbstractLazyObjectType.d.ts +0 -1
  24. package/dist/generators/ts/AbstractLazyObjectType.js +2 -2
  25. package/dist/generators/ts/AbstractNamedUnionType.d.ts +1 -2
  26. package/dist/generators/ts/AbstractNamedUnionType.js +16 -19
  27. package/dist/generators/ts/AbstractTermType.d.ts +0 -1
  28. package/dist/generators/ts/AbstractTermType.js +0 -1
  29. package/dist/generators/ts/AbstractType.d.ts +0 -4
  30. package/dist/generators/ts/AbstractUnionType.d.ts +1 -10
  31. package/dist/generators/ts/AbstractUnionType.js +27 -40
  32. package/dist/generators/ts/LazyObjectOptionType.js +3 -2
  33. package/dist/generators/ts/LazyObjectSetType.js +2 -1
  34. package/dist/generators/ts/LazyObjectType.js +2 -1
  35. package/dist/generators/ts/ListType.d.ts +1 -5
  36. package/dist/generators/ts/ListType.js +8 -27
  37. package/dist/generators/ts/NamedObjectType.d.ts +2 -21
  38. package/dist/generators/ts/NamedObjectType.js +33 -132
  39. package/dist/generators/ts/NamedObjectUnionType.js +14 -25
  40. package/dist/generators/ts/TypeFactory.js +11 -67
  41. package/dist/generators/ts/ZodGenerator.js +2 -2
  42. package/dist/generators/ts/_NamedObjectType/AbstractProperty.d.ts +11 -17
  43. package/dist/generators/ts/_NamedObjectType/AbstractProperty.js +7 -6
  44. package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.d.ts +1 -4
  45. package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.js +19 -34
  46. package/dist/generators/ts/_NamedObjectType/IdentifierProperty.d.ts +5 -15
  47. package/dist/generators/ts/_NamedObjectType/IdentifierProperty.js +31 -212
  48. package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.js +2 -2
  49. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.d.ts +5 -0
  50. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js +25 -0
  51. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js +4 -4
  52. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.js +1 -1
  53. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js +2 -2
  54. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js +2 -2
  55. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +1 -8
  56. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js +5 -13
  57. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +1 -4
  58. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.d.ts +4 -0
  59. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js +49 -0
  60. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.js +1 -1
  61. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js +0 -3
  62. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js +1 -1
  63. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js +2 -2
  64. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js +2 -2
  65. package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.js +2 -2
  66. package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.js +2 -2
  67. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +2 -2
  68. package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +1 -2
  69. package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js +2 -2
  70. package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts +2 -2
  71. package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +2 -2
  72. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.d.ts +5 -0
  73. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js +41 -0
  74. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.d.ts +5 -0
  75. package/dist/generators/ts/_NamedObjectType/{NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js → NamedObjectType_toRdfResourceFunctionDeclaration.js} +8 -27
  76. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.d.ts +4 -0
  77. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js +40 -0
  78. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +1 -1
  79. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js +1 -1
  80. package/dist/generators/ts/_NamedObjectType/Property.d.ts +1 -2
  81. package/dist/generators/ts/_NamedObjectType/ShaclProperty.d.ts +1 -3
  82. package/dist/generators/ts/_NamedObjectType/ShaclProperty.js +8 -39
  83. package/dist/generators/ts/_snippets/snippets_LazyObject.js +2 -2
  84. package/dist/generators/ts/_snippets/snippets_LazyObjectOption.js +2 -2
  85. package/dist/generators/ts/_snippets/snippets_LazyObjectSet.js +2 -2
  86. package/dist/generators/ts/imports.d.ts +0 -2
  87. package/dist/generators/ts/imports.js +0 -2
  88. package/dist/generators/ts/objectSetDeclarations.js +1 -3
  89. package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +4 -6
  90. package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +2 -2
  91. package/dist/input/ShapesGraph.d.ts +1 -1
  92. package/dist/input/generated.d.ts +10 -181
  93. package/dist/input/generated.js +116 -392
  94. package/package.json +2 -4
  95. package/dist/_ShapesGraphToAstTransformer/nodeShapeIdentifierMintingStrategy.d.ts +0 -6
  96. package/dist/_ShapesGraphToAstTransformer/nodeShapeIdentifierMintingStrategy.js +0 -32
  97. package/dist/enums/IdentifierMintingStrategy.d.ts +0 -9
  98. package/dist/enums/IdentifierMintingStrategy.js +0 -18
  99. package/dist/enums/TsObjectDeclarationType.d.ts +0 -9
  100. package/dist/enums/TsObjectDeclarationType.js +0 -16
  101. package/dist/enums/Visibility.d.ts +0 -6
  102. package/dist/enums/Visibility.js +0 -18
  103. package/dist/generators/ts/_NamedObjectType/IdentifierPrefixProperty.d.ts +0 -33
  104. package/dist/generators/ts/_NamedObjectType/IdentifierPrefixProperty.js +0 -92
  105. package/dist/generators/ts/_NamedObjectType/NamedObjectType_classDeclaration.d.ts +0 -4
  106. package/dist/generators/ts/_NamedObjectType/NamedObjectType_classDeclaration.js +0 -62
  107. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.d.ts +0 -5
  108. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.js +0 -51
  109. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.d.ts +0 -4
  110. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.js +0 -73
  111. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.d.ts +0 -5
  112. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.js +0 -59
  113. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.d.ts +0 -5
  114. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionOrMethodDeclaration.d.ts +0 -4
  115. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionOrMethodDeclaration.js +0 -62
  116. /package/dist/{enums → generators/ts}/TsFeature.d.ts +0 -0
  117. /package/dist/{enums → generators/ts}/TsFeature.js +0 -0
@@ -47,35 +47,22 @@ export class ShaclProperty extends AbstractProperty {
47
47
  }
48
48
  get declaration() {
49
49
  const lhs = [];
50
- if (this.namedObjectType.declarationType === "class" &&
51
- this.visibility !== "public") {
52
- lhs.push(code `${this.visibility}`);
53
- }
54
50
  if (!this.mutable) {
55
51
  lhs.push(code `readonly`);
56
52
  }
57
53
  lhs.push(code `${this.name}`);
58
- return Maybe.of(code `${this.comment
54
+ return code `${this.comment
59
55
  .alt(this.description)
60
56
  .alt(this.label)
61
57
  .map(tsComment)
62
- .orDefault("")}${joinCode(lhs, { on: " " })}: ${this.type.name};`);
63
- }
64
- get equalsFunction() {
65
- return Maybe.of(this.type.equalsFunction);
58
+ .orDefault("")}${joinCode(lhs, { on: " " })}: ${this.type.name};`;
66
59
  }
67
60
  get filterProperty() {
68
- if (this.visibility !== "public") {
69
- return Maybe.empty();
70
- }
71
61
  return Maybe.of({
72
62
  name: this.name,
73
63
  type: this.type.filterType,
74
64
  });
75
65
  }
76
- get getAccessorDeclaration() {
77
- return Maybe.empty();
78
- }
79
66
  get graphqlField() {
80
67
  const args = this.type.graphqlArgs;
81
68
  const argsVariable = args.isJust() ? code `args` : code `_args`;
@@ -92,7 +79,7 @@ export class ShaclProperty extends AbstractProperty {
92
79
  context: "property",
93
80
  });
94
81
  const meta = {
95
- id: this.name,
82
+ // id: `${this.namedObjectType.name}-${this.name}`, // id's must be unique
96
83
  };
97
84
  this.comment.alt(this.description).ifJust((description) => {
98
85
  meta["description"] = description;
@@ -130,28 +117,13 @@ export class ShaclProperty extends AbstractProperty {
130
117
  constructorStatements({ variables, }) {
131
118
  const typeConversions = this.type.conversions;
132
119
  if (typeConversions.length === 1) {
133
- switch (this.namedObjectType.declarationType) {
134
- case "class":
135
- return [code `this.${this.name} = ${variables.parameter};`];
136
- case "interface":
137
- return [code `const ${this.name} = ${variables.parameter};`];
138
- }
139
- }
140
- let lhs;
141
- const statements = [];
142
- switch (this.namedObjectType.declarationType) {
143
- case "class":
144
- lhs = `this.${this.name}`;
145
- break;
146
- case "interface":
147
- lhs = `${this.name}`;
148
- statements.push(code `let ${this.name}: ${this.type.name};`);
149
- break;
120
+ return [code `const ${this.name} = ${variables.parameter};`];
150
121
  }
122
+ const statements = [code `let ${this.name}: ${this.type.name};`];
151
123
  statements.push(joinCode(typeConversions
152
- .map((conversion) => code `if (${conversion.sourceTypeCheckExpression(variables.parameter)}) { ${lhs} = ${conversion.conversionExpression(variables.parameter)}; }`)
124
+ .map((conversion) => code `if (${conversion.sourceTypeCheckExpression(variables.parameter)}) { ${this.name} = ${conversion.conversionExpression(variables.parameter)}; }`)
153
125
  // We shouldn't need this else, since the parameter now has the never type, but have to add it to appease the TypeScript compiler
154
- .concat(code `{ ${lhs} = (${variables.parameter}) satisfies never; }`), { on: " else " }));
126
+ .concat(code `{ ${this.name} = (${variables.parameter}) satisfies never; }`), { on: " else " }));
155
127
  return statements;
156
128
  }
157
129
  fromJsonStatements({ variables, }) {
@@ -171,7 +143,7 @@ export class ShaclProperty extends AbstractProperty {
171
143
  variables: {
172
144
  ...variables,
173
145
  ignoreRdfType: true,
174
- propertyPath: code `${this.namedObjectType.staticModuleName}.${syntheticNamePrefix}schema.properties.${this.name}.path`,
146
+ propertyPath: code `${this.namedObjectType.name}.${syntheticNamePrefix}schema.properties.${this.name}.path`,
175
147
  resourceValues: code `resourceValues`,
176
148
  },
177
149
  })})`,
@@ -264,9 +236,6 @@ __decorate([
264
236
  __decorate([
265
237
  Memoize()
266
238
  ], ShaclProperty.prototype, "declaration", null);
267
- __decorate([
268
- Memoize()
269
- ], ShaclProperty.prototype, "equalsFunction", null);
270
239
  __decorate([
271
240
  Memoize()
272
241
  ], ShaclProperty.prototype, "filterProperty", null);
@@ -5,7 +5,7 @@ export const snippets_LazyObject = conditionalOutput(`${syntheticNamePrefix}Lazy
5
5
  /**
6
6
  * Type of lazy properties that return a single required object. This is a class instead of an interface so it can be instanceof'd elsewhere.
7
7
  */
8
- export class ${syntheticNamePrefix}LazyObject<ObjectIdentifierT extends ${imports.BlankNode} | ${imports.NamedNode}, PartialObjectT extends { ${syntheticNamePrefix}identifier: ObjectIdentifierT }, ResolvedObjectT extends { ${syntheticNamePrefix}identifier: ObjectIdentifierT }> {
8
+ export class ${syntheticNamePrefix}LazyObject<ObjectIdentifierT extends ${imports.BlankNode} | ${imports.NamedNode}, PartialObjectT extends { ${syntheticNamePrefix}identifier: () => ObjectIdentifierT }, ResolvedObjectT extends { ${syntheticNamePrefix}identifier: () => ObjectIdentifierT }> {
9
9
  readonly partial: PartialObjectT;
10
10
  private readonly resolver: (identifier: ObjectIdentifierT, options?: { preferredLanguages?: readonly string[] }) => Promise<${imports.Either}<Error, ResolvedObjectT>>;
11
11
 
@@ -18,7 +18,7 @@ export class ${syntheticNamePrefix}LazyObject<ObjectIdentifierT extends ${import
18
18
  }
19
19
 
20
20
  resolve(options?: { preferredLanguages?: readonly string[] }): Promise<${imports.Either}<Error, ResolvedObjectT>> {
21
- return this.resolver(this.partial.${syntheticNamePrefix}identifier, options);
21
+ return this.resolver(this.partial.${syntheticNamePrefix}identifier(), options);
22
22
  }
23
23
  }`);
24
24
  //# sourceMappingURL=snippets_LazyObject.js.map
@@ -5,7 +5,7 @@ export const snippets_LazyObjectOption = conditionalOutput(`${syntheticNamePrefi
5
5
  /**
6
6
  * Type of lazy properties that return a single optional object. This is a class instead of an interface so it can be instanceof'd elsewhere.
7
7
  */
8
- export class ${syntheticNamePrefix}LazyObjectOption<ObjectIdentifierT extends ${imports.BlankNode} | ${imports.NamedNode}, PartialObjectT extends { ${syntheticNamePrefix}identifier: ObjectIdentifierT }, ResolvedObjectT extends { ${syntheticNamePrefix}identifier: ObjectIdentifierT }> {
8
+ export class ${syntheticNamePrefix}LazyObjectOption<ObjectIdentifierT extends ${imports.BlankNode} | ${imports.NamedNode}, PartialObjectT extends { ${syntheticNamePrefix}identifier: () => ObjectIdentifierT }, ResolvedObjectT extends { ${syntheticNamePrefix}identifier: () => ObjectIdentifierT }> {
9
9
  readonly partial: ${imports.Maybe}<PartialObjectT>;
10
10
  private readonly resolver: (identifier: ObjectIdentifierT, options?: { preferredLanguages?: readonly string[] }) => Promise<${imports.Either}<Error, ResolvedObjectT>>;
11
11
 
@@ -21,7 +21,7 @@ export class ${syntheticNamePrefix}LazyObjectOption<ObjectIdentifierT extends ${
21
21
  if (this.partial.isNothing()) {
22
22
  return ${imports.Right}(${imports.Maybe}.empty());
23
23
  }
24
- return (await this.resolver(this.partial.unsafeCoerce().${syntheticNamePrefix}identifier, options)).map(${imports.Maybe}.of);
24
+ return (await this.resolver(this.partial.unsafeCoerce().${syntheticNamePrefix}identifier(), options)).map(${imports.Maybe}.of);
25
25
  }
26
26
  }`);
27
27
  //# sourceMappingURL=snippets_LazyObjectOption.js.map
@@ -5,7 +5,7 @@ export const snippets_LazyObjectSet = conditionalOutput(`${syntheticNamePrefix}L
5
5
  /**
6
6
  * Type of lazy properties that return a set of objects. This is a class instead of an interface so it can be instanceof'd elsewhere.
7
7
  */
8
- export class ${syntheticNamePrefix}LazyObjectSet<ObjectIdentifierT extends ${imports.BlankNode} | ${imports.NamedNode}, PartialObjectT extends { ${syntheticNamePrefix}identifier: ObjectIdentifierT }, ResolvedObjectT extends { ${syntheticNamePrefix}identifier: ObjectIdentifierT }> {
8
+ export class ${syntheticNamePrefix}LazyObjectSet<ObjectIdentifierT extends ${imports.BlankNode} | ${imports.NamedNode}, PartialObjectT extends { ${syntheticNamePrefix}identifier: () => ObjectIdentifierT }, ResolvedObjectT extends { ${syntheticNamePrefix}identifier: () => ObjectIdentifierT }> {
9
9
  readonly partials: readonly PartialObjectT[];
10
10
  private readonly resolver: (identifiers: readonly ObjectIdentifierT[], options?: { preferredLanguages?: readonly string[] }) => Promise<${imports.Either}<Error, readonly ResolvedObjectT[]>>;
11
11
 
@@ -36,7 +36,7 @@ export class ${syntheticNamePrefix}LazyObjectSet<ObjectIdentifierT extends ${imp
36
36
  offset = 0;
37
37
  }
38
38
 
39
- return await this.resolver(this.partials.slice(offset, offset + limit).map(partial => partial.${syntheticNamePrefix}identifier), { preferredLanguages: options?.preferredLanguages });
39
+ return await this.resolver(this.partials.slice(offset, offset + limit).map(partial => partial.${syntheticNamePrefix}identifier()), { preferredLanguages: options?.preferredLanguages });
40
40
  }
41
41
  }`);
42
42
  //# sourceMappingURL=snippets_LazyObjectSet.js.map
@@ -33,9 +33,7 @@ export declare const imports: {
33
33
  readonly Resource: import("ts-poet/build/Import.js").Import;
34
34
  readonly ResourceSet: import("ts-poet/build/Import.js").Import;
35
35
  readonly Right: import("ts-poet/build/Import.js").Import;
36
- readonly sha256: import("ts-poet/build/Import.js").Import;
37
36
  readonly sparqljs: import("ts-poet/build/Import.js").Import;
38
- readonly uuid: import("ts-poet/build/Import.js").Import;
39
37
  readonly Variable: import("ts-poet/build/Import.js").Import;
40
38
  readonly z: import("ts-poet/build/Import.js").Import;
41
39
  };
@@ -34,9 +34,7 @@ export const imports = {
34
34
  Resource: imp("Resource@@rdfx/resource"),
35
35
  ResourceSet: imp("ResourceSet@@rdfx/resource"),
36
36
  Right: imp("Right@purify-ts"),
37
- sha256: imp("sha256@js-sha256"),
38
37
  sparqljs: imp("sparqljs*sparqljs"),
39
- uuid: imp("uuid*uuid"),
40
38
  Variable: imp("Variable@@rdfjs/types"),
41
39
  z: imp("z@zod"),
42
40
  };
@@ -2,9 +2,7 @@ import { objectSetInterfaceDeclaration } from "./objectSetInterfaceDeclaration.j
2
2
  import { rdfjsDatasetObjectSetClassDeclaration } from "./rdfjsDatasetObjectSetClassDeclaration.js";
3
3
  import { sparqlObjectSetClassDeclaration } from "./sparqlObjectSetClassDeclaration.js";
4
4
  export function objectSetDeclarations({ namedObjectUnionTypes, ...parameters }) {
5
- const namedObjectTypes = parameters.namedObjectTypes.filter((namedObjectType) => !namedObjectType.abstract &&
6
- !namedObjectType.extern &&
7
- !namedObjectType.synthetic);
5
+ const namedObjectTypes = parameters.namedObjectTypes.filter((namedObjectType) => !namedObjectType.extern && !namedObjectType.synthetic);
8
6
  let namedObjectTypesWithRdfFeatureCount = 0;
9
7
  let namedObjectTypesWithSparqlFeatureCount = 0;
10
8
  for (const namedObjectType of namedObjectTypes) {
@@ -15,7 +15,7 @@ export function rdfjsDatasetObjectSetClassDeclaration({ namedObjectTypes, namedO
15
15
  query: `query?: ${syntheticNamePrefix}ObjectSet.Query<ObjectFilterT, ObjectIdentifierT>`,
16
16
  };
17
17
  const typeParameters = {
18
- ObjectT: code `ObjectT extends { readonly $identifier: ObjectIdentifierT }`,
18
+ ObjectT: code `ObjectT extends { readonly $identifier: () => ObjectIdentifierT }`,
19
19
  ObjectFilterT: code `ObjectFilterT`,
20
20
  ObjectIdentifierT: code `ObjectIdentifierT extends ${imports.BlankNode} | ${imports.NamedNode}`,
21
21
  };
@@ -79,7 +79,7 @@ async ${methodSignatures.objectIdentifiers.name}(${methodSignatures.objectIdenti
79
79
  // objectIdentifiersSync
80
80
  code `\
81
81
  ${methodSignatures.objectIdentifiers.name}Sync(${methodSignatures.objectIdentifiers.parameters}): ${imports.Either}<Error, readonly ${namedObjectType.identifierTypeAlias}[]> {
82
- return this.${methodSignatures.objects.name}Sync(query).map(objects => objects.map(object => object.${syntheticNamePrefix}identifier));
82
+ return this.${methodSignatures.objects.name}Sync(query).map(objects => objects.map(object => object.${syntheticNamePrefix}identifier()));
83
83
  }`,
84
84
  // objects
85
85
  code `\
@@ -92,7 +92,7 @@ async ${methodSignatures.objects.name}(${methodSignatures.objects.parameters}):
92
92
  const fromRdfTypes = namedObjectType.fromRdfTypeVariable
93
93
  .toList()
94
94
  .concat(namedObjectType.descendantFromRdfTypeVariables);
95
- return code `{ ${syntheticNamePrefix}filter: ${filterFunction}, ${syntheticNamePrefix}fromRdfResource: ${namedObjectType.staticModuleName}.${syntheticNamePrefix}fromRdfResource, ${syntheticNamePrefix}fromRdfTypes: ${fromRdfTypes.length > 0 ? code `[${joinCode(fromRdfTypes, { on: ", " })}]` : "[]"} }`;
95
+ return code `{ ${syntheticNamePrefix}filter: ${filterFunction}, ${syntheticNamePrefix}fromRdfResource: ${namedObjectType.name}.${syntheticNamePrefix}fromRdfResource, ${syntheticNamePrefix}fromRdfTypes: ${fromRdfTypes.length > 0 ? code `[${joinCode(fromRdfTypes, { on: ", " })}]` : "[]"} }`;
96
96
  };
97
97
  switch (namedObjectType.kind) {
98
98
  case "NamedObjectType": {
@@ -105,9 +105,7 @@ ${methodSignatures.objects.name}Sync(${methodSignatures.objects.parameters}): ${
105
105
  return delegatingMethods.concat(code `\
106
106
  ${methodSignatures.objects.name}Sync(${methodSignatures.objects.parameters}): ${imports.Either}<Error, readonly ${namedObjectType.name}[]> {
107
107
  return this.${syntheticNamePrefix}objectUnionsSync<${namedObjectType.name}, ${namedObjectType.filterType}, ${namedObjectType.identifierTypeAlias}>([
108
- ${joinCode(namedObjectType.members
109
- .filter((member) => !member.type.abstract)
110
- .map((member) => runtimeObjectType(namedObjectType.filterFunction, member.type)), { on: ", " })}
108
+ ${joinCode(namedObjectType.members.map((member) => runtimeObjectType(namedObjectType.filterFunction, member.type)), { on: ", " })}
111
109
  ], query);
112
110
  }`);
113
111
  default:
@@ -15,7 +15,7 @@ export function sparqlObjectSetClassDeclaration({ namedObjectTypes, namedObjectU
15
15
  selectObjectTypeType: code `namedObjectType: { ${syntheticNamePrefix}focusSparqlWherePatterns: ${snippets.FocusSparqlWherePatternsFunction}<ObjectFilterT> }`,
16
16
  };
17
17
  const typeParameters = {
18
- ObjectT: code `ObjectT extends { readonly $identifier: ObjectIdentifierT }`,
18
+ ObjectT: code `ObjectT extends { readonly $identifier: () => ObjectIdentifierT }`,
19
19
  ObjectFilterT: code `ObjectFilterT`,
20
20
  ObjectIdentifierT: code `ObjectIdentifierT extends ${imports.BlankNode} | ${imports.NamedNode}`,
21
21
  };
@@ -40,7 +40,7 @@ ${joinCode([...namedObjectTypes, ...namedObjectUnionTypes].flatMap((namedObjectT
40
40
  namedObjectType,
41
41
  queryT: `${syntheticNamePrefix}SparqlObjectSet.Query`,
42
42
  });
43
- const runtimeObjectType = namedObjectType.staticModuleName;
43
+ const runtimeObjectType = namedObjectType.name;
44
44
  return [
45
45
  code `\
46
46
  async ${methodSignatures.object.name}(${methodSignatures.object.parameters}): ${methodSignatures.object.returnType} {
@@ -2,8 +2,8 @@ import { AbstractShapesGraph } from "@shaclmate/shacl-ast";
2
2
  import type { Either } from "purify-ts";
3
3
  import type { Logger } from "ts-log";
4
4
  import type { Ast } from "../ast/Ast.js";
5
- import type { TsFeature } from "../enums/TsFeature.js";
6
5
  import type { Generator } from "../generators/Generator.js";
6
+ import type { TsFeature } from "../generators/ts/TsFeature.js";
7
7
  import * as generated from "./generated.js";
8
8
  export declare class ShapesGraph extends AbstractShapesGraph<generated.NodeShape, generated.Ontology, generated.PropertyGroup, generated.PropertyShape> {
9
9
  protected readonly typeFunctions: {