@shaclmate/compiler 4.0.96 → 4.0.97

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 (23) hide show
  1. package/dist/_ShapesGraphToAstTransformer/synthesizePartialAstStructType.d.ts +6 -0
  2. package/dist/_ShapesGraphToAstTransformer/synthesizePartialAstStructType.js +38 -0
  3. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.js +114 -145
  4. package/dist/_ShapesGraphToAstTransformer/transformShapeNodeConstraintToAstType.d.ts +7 -0
  5. package/dist/_ShapesGraphToAstTransformer/transformShapeNodeConstraintToAstType.js +13 -0
  6. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstStructType.d.ts +1 -1
  7. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstStructType.js +0 -52
  8. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +2 -0
  9. package/dist/ast/StructCompoundType.d.ts +3 -2
  10. package/dist/ast/StructCompoundType.js +29 -46
  11. package/dist/ast/StructDiscriminatedUnionType.d.ts +5 -1
  12. package/dist/ast/StructIntersectionType.d.ts +4 -1
  13. package/dist/generators/ts/ObjectDiscriminatedUnionType.d.ts +7 -4
  14. package/dist/generators/ts/ObjectDiscriminatedUnionType.js +18 -2
  15. package/dist/generators/ts/ObjectIntersectionType.d.ts +7 -4
  16. package/dist/generators/ts/RdfjsDatasetObjectSetType.js +21 -10
  17. package/dist/generators/ts/TypeFactory.js +19 -33
  18. package/dist/input/input.shaclmate.d.ts +2474 -2124
  19. package/dist/input/input.shaclmate.js +558 -1292
  20. package/dist/input/input.shaclmate.ttl +9 -5
  21. package/package.json +6 -4
  22. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_schemaExpression.d.ts +0 -4
  23. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_schemaExpression.js +0 -37
@@ -6,8 +6,8 @@
6
6
  @prefix shaclmate: <http://purl.org/shaclmate/ontology#> .
7
7
  @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
8
8
 
9
- shaclmate:NodeShape
10
- sh:property shaclmate:NodeShape-discriminantValue, shaclmate:NodeShape-extern, shaclmate:NodeShape-fromRdfType, shaclmate:NodeShape-rdfType, shaclmate:NodeShape-toRdfTypes, shaclmate:NodeShape-tsImports, shaclmate:Shape-ignore, shaclmate:Shape-mutable, shaclmate:Shape-shaclmateName .
9
+ shaclmate:BaseShape
10
+ sh:property shaclmate:Shape-ignore, shaclmate:Shape-mutable, shaclmate:Shape-shaclmateName .
11
11
 
12
12
  shaclmate:NodeShape-discriminantValue
13
13
  a sh:PropertyShape ;
@@ -57,6 +57,7 @@ shaclmate:NodeShape-rdfType
57
57
 
58
58
  shaclmate:NodeShape-toRdfTypes
59
59
  a sh:PropertyShape ;
60
+ sh:name "toRdfTypes" ;
60
61
  sh:nodeKind sh:IRI ;
61
62
  sh:path shaclmate:toRdfType .
62
63
 
@@ -66,6 +67,9 @@ shaclmate:NodeShape-tsImports
66
67
  sh:name "tsImports" ;
67
68
  sh:path shaclmate:tsImport .
68
69
 
70
+ shaclmate:NodeShapeSpecificProperties
71
+ sh:property shaclmate:NodeShape-discriminantValue, shaclmate:NodeShape-extern, shaclmate:NodeShape-fromRdfType, shaclmate:NodeShape-rdfType, shaclmate:NodeShape-toRdfTypes, shaclmate:NodeShape-tsImports .
72
+
69
73
  shaclmate:Operation
70
74
  a rdfs:Class, sh:NodeShape ;
71
75
  rdfs:comment "Service operation" ;
@@ -267,9 +271,6 @@ shaclmate:OperationResultHttpBindingContentType
267
271
  sh:in ("application/json"
268
272
  ) .
269
273
 
270
- shaclmate:PropertyShape
271
- sh:property shaclmate:PropertyShape-display, shaclmate:PropertyShape-resolve, shaclmate:Shape-ignore, shaclmate:Shape-mutable, shaclmate:Shape-shaclmateName .
272
-
273
274
  shaclmate:PropertyShape-display
274
275
  a sh:PropertyShape ;
275
276
  rdfs:comment "Whether to include this property in a toString()-type display, defaults to false" ;
@@ -285,6 +286,9 @@ shaclmate:PropertyShape-resolve
285
286
  sh:nodeKind sh:BlankNodeOrIRI ;
286
287
  sh:path shaclmate:resolve .
287
288
 
289
+ shaclmate:PropertyShapeSpecificProperties
290
+ sh:property shaclmate:PropertyShape-display, shaclmate:PropertyShape-resolve .
291
+
288
292
  shaclmate:Service
289
293
  a rdfs:Class, sh:NodeShape ;
290
294
  rdfs:comment "Service with operations" ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "@shaclmate/shacl-ast": "4.0.96",
3
+ "@shaclmate/shacl-ast": "4.0.97",
4
4
  "@rdfjs/types": "~2.0.1",
5
5
  "@rdfx/collection": "0.0.59",
6
6
  "@rdfx/curie": "0.0.59",
@@ -46,8 +46,12 @@
46
46
  "dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js",
47
47
  "dist/_ShapesGraphToAstTransformer/shapeOntology.d.ts",
48
48
  "dist/_ShapesGraphToAstTransformer/shapeOntology.js",
49
+ "dist/_ShapesGraphToAstTransformer/synthesizePartialAstStructType.d.ts",
50
+ "dist/_ShapesGraphToAstTransformer/synthesizePartialAstStructType.js",
49
51
  "dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.d.ts",
50
52
  "dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.js",
53
+ "dist/_ShapesGraphToAstTransformer/transformShapeNodeConstraintToAstType.d.ts",
54
+ "dist/_ShapesGraphToAstTransformer/transformShapeNodeConstraintToAstType.js",
51
55
  "dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.d.ts",
52
56
  "dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js",
53
57
  "dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts",
@@ -330,8 +334,6 @@
330
334
  "dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_fromRdfResourceFunction.js",
331
335
  "dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_graphqlTypeExpression.d.ts",
332
336
  "dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_graphqlTypeExpression.js",
333
- "dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_schemaExpression.d.ts",
334
- "dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_schemaExpression.js",
335
337
  "dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_toRdfResourceFunction.d.ts",
336
338
  "dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_toRdfResourceFunction.js",
337
339
  "dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_typeGuardFunction.d.ts",
@@ -972,5 +974,5 @@
972
974
  },
973
975
  "type": "module",
974
976
  "types": "./dist/index.d.ts",
975
- "version": "4.0.96"
977
+ "version": "4.0.97"
976
978
  }
@@ -1,4 +0,0 @@
1
- import type { ObjectDiscriminatedUnionType } from "../ObjectDiscriminatedUnionType.js";
2
- import { type Code } from "../ts-poet-wrapper.js";
3
- export declare function ObjectDiscriminatedUnionType_schemaExpression(this: ObjectDiscriminatedUnionType): Code;
4
- //# sourceMappingURL=ObjectDiscriminatedUnionType_schemaExpression.d.ts.map
@@ -1,37 +0,0 @@
1
- import { PropertyPath } from "@rdfx/resource";
2
- import { code, joinCode } from "../ts-poet-wrapper.js";
3
- export function ObjectDiscriminatedUnionType_schemaExpression() {
4
- const commonPropertiesByName = {};
5
- this.members.forEach((member, memberI) => {
6
- for (const memberTypeProperty of member.type.properties) {
7
- if (memberTypeProperty.kind !== "Shacl") {
8
- continue;
9
- }
10
- let commonProperty = commonPropertiesByName[memberTypeProperty.name];
11
- if (commonProperty) {
12
- if (PropertyPath.equals(commonProperty.property.path, memberTypeProperty.path)) {
13
- commonProperty.memberTypesWithProperty[memberI] = true;
14
- }
15
- }
16
- else {
17
- commonPropertiesByName[memberTypeProperty.name] = commonProperty = {
18
- memberTypesWithProperty: new Array(this.members.length).fill(false),
19
- property: memberTypeProperty,
20
- };
21
- commonProperty.memberTypesWithProperty[memberI] = true;
22
- }
23
- }
24
- });
25
- const propertiesObject = [];
26
- for (const name of Object.keys(commonPropertiesByName).toSorted()) {
27
- const { memberTypesWithProperty, property } = commonPropertiesByName[name];
28
- if (!memberTypesWithProperty.every((value) => value)) {
29
- continue;
30
- }
31
- property.schema.ifJust((propertySchema) => {
32
- propertiesObject.push(code `${property.name}: ${propertySchema}`);
33
- });
34
- }
35
- return code `{ ${joinCode(this.schemaInitializers.concat(code `properties: { ${joinCode(propertiesObject, { on: ", " })} }`), { on: ", " })} } as const;`;
36
- }
37
- //# sourceMappingURL=ObjectDiscriminatedUnionType_schemaExpression.js.map