@shaclmate/compiler 4.0.19 → 4.0.21
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.
- package/dist/Compiler.d.ts +4 -1
- package/dist/Compiler.js +4 -1
- package/dist/ShapesGraphToAstTransformer.d.ts +4 -1
- package/dist/ShapesGraphToAstTransformer.js +9 -6
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +1 -1
- package/dist/ast/AbstractCollectionType.d.ts +1 -1
- package/dist/ast/AbstractContainerType.d.ts +1 -1
- package/dist/ast/AbstractLazyObjectType.d.ts +19 -79
- package/dist/ast/AbstractTermType.d.ts +3 -33
- package/dist/ast/AbstractTermType.js +2 -3
- package/dist/ast/AbstractType.d.ts +1 -1
- package/dist/ast/AbstractType.js +1 -2
- package/dist/ast/BlankNodeType.d.ts +1 -1
- package/dist/ast/DefaultValueType.d.ts +2 -17
- package/dist/ast/DefaultValueType.js +1 -2
- package/dist/ast/IdentifierType.d.ts +1 -1
- package/dist/ast/LiteralType.d.ts +8 -98
- package/dist/ast/LiteralType.js +5 -7
- package/dist/ast/ObjectCompoundType.js +1 -2
- package/dist/ast/ObjectType.d.ts +9 -39
- package/dist/ast/ObjectType.js +9 -13
- package/dist/ast/SetType.d.ts +1 -1
- package/dist/ast/UnionType.d.ts +1 -1
- package/dist/generators/transformAstToLabeledPropertyGraph.js +3 -4
- package/dist/generators/ts/AbstractContainerType.d.ts +1 -0
- package/dist/generators/ts/AbstractContainerType.js +3 -0
- package/dist/generators/ts/AbstractDateType.js +1 -1
- package/dist/generators/ts/AbstractIdentifierType.d.ts +2 -2
- package/dist/generators/ts/AbstractIdentifierType.js +2 -5
- package/dist/generators/ts/AbstractLazyObjectType.d.ts +2 -1
- package/dist/generators/ts/AbstractLazyObjectType.js +6 -3
- package/dist/generators/ts/AbstractNamedUnionType.js +2 -2
- package/dist/generators/ts/AbstractNumericType.js +1 -1
- package/dist/generators/ts/AbstractTermType.d.ts +1 -0
- package/dist/generators/ts/AbstractTermType.js +8 -2
- package/dist/generators/ts/AbstractType.d.ts +21 -14
- package/dist/generators/ts/AbstractType.js +3 -1
- package/dist/generators/ts/AbstractUnionType.d.ts +5 -4
- package/dist/generators/ts/AbstractUnionType.js +83 -59
- package/dist/generators/ts/BlankNodeType.d.ts +2 -2
- package/dist/generators/ts/BlankNodeType.js +1 -1
- package/dist/generators/ts/BooleanType.js +1 -1
- package/dist/generators/ts/DefaultValueType.js +1 -1
- package/dist/generators/ts/IdentifierType.d.ts +2 -2
- package/dist/generators/ts/IdentifierType.js +1 -1
- package/dist/generators/ts/IriType.d.ts +1 -1
- package/dist/generators/ts/IriType.js +8 -13
- package/dist/generators/ts/LazyObjectOptionType.d.ts +1 -0
- package/dist/generators/ts/LazyObjectOptionType.js +1 -1
- package/dist/generators/ts/LazyObjectType.js +1 -1
- package/dist/generators/ts/ListType.js +5 -5
- package/dist/generators/ts/NamedObjectType.d.ts +1 -0
- package/dist/generators/ts/NamedObjectType.js +7 -0
- package/dist/generators/ts/NamedObjectUnionType.js +4 -1
- package/dist/generators/ts/SetType.js +1 -1
- package/dist/generators/ts/StringType.js +1 -1
- package/dist/generators/ts/TermType.js +3 -1
- package/dist/generators/ts/TsGenerator.d.ts +5 -0
- package/dist/generators/ts/TsGenerator.js +7 -1
- package/dist/generators/ts/TypeFactory.d.ts +5 -0
- package/dist/generators/ts/TypeFactory.js +35 -5
- package/dist/generators/ts/ZodGenerator.d.ts +4 -0
- package/dist/generators/ts/ZodGenerator.js +4 -1
- package/dist/generators/ts/_NamedObjectType/AbstractProperty.d.ts +4 -1
- package/dist/generators/ts/_NamedObjectType/AbstractProperty.js +3 -1
- package/dist/generators/ts/_NamedObjectType/IdentifierProperty.js +6 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.js +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/ShaclProperty.d.ts +1 -0
- package/dist/generators/ts/_NamedObjectType/ShaclProperty.js +16 -16
- package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.js +6 -2
- package/dist/generators/ts/_snippets/parseIri.d.ts +2 -0
- package/dist/generators/ts/_snippets/parseIri.js +12 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.js +4 -3
- package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.js +7 -5
- package/dist/generators/ts/_snippets/snippets_parseBlankNode.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_parseBlankNode.js +12 -0
- package/dist/generators/ts/_snippets/snippets_parseIdentifier.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_parseIdentifier.js +6 -0
- package/dist/generators/ts/graphqlSchemaVariableStatement.js +3 -3
- package/dist/generators/ts/imports.d.ts +2 -0
- package/dist/generators/ts/imports.js +3 -1
- package/dist/generators/ts/rdfjsTermExpression.d.ts +4 -1
- package/dist/generators/ts/rdfjsTermExpression.js +2 -3
- package/dist/generators/ts/snippets.d.ts +3 -2
- package/dist/generators/ts/snippets.js +6 -4
- package/dist/generators/ts/synthesizeUberObjectUnionType.d.ts +2 -0
- package/dist/generators/ts/synthesizeUberObjectUnionType.js +4 -0
- package/dist/input/ShapesGraph.d.ts +4 -1
- package/dist/input/ShapesGraph.js +3 -2
- package/dist/input/generated.d.ts +323 -323
- package/dist/input/generated.js +19 -20
- package/package.json +6 -7
- package/dist/ast/termToJson.d.ts +0 -18
- package/dist/ast/termToJson.js +0 -18
- package/dist/generators/ts/_snippets/snippets_blankNodeFromString.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_blankNodeFromString.js +0 -11
- package/dist/generators/ts/_snippets/snippets_identifierFromString.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_identifierFromString.js +0 -8
- package/dist/logger.d.ts +0 -2
- package/dist/logger.js +0 -8
|
@@ -16,7 +16,7 @@ function graphqlQueryObjectType({ namedObjectTypes, namedObjectUnionTypes, }) {
|
|
|
16
16
|
resolve: code `\
|
|
17
17
|
async (_source, args: { identifier: string }, { objectSet }): Promise<${namedObjectType.name}> =>
|
|
18
18
|
(await ${imports.EitherAsync}<Error, ${namedObjectType.name}>(async ({ liftEither }) =>
|
|
19
|
-
liftEither(await objectSet.${namedObjectType.objectSetMethodNames.object}(await liftEither(${namedObjectType.identifierTypeAlias}.
|
|
19
|
+
liftEither(await objectSet.${namedObjectType.objectSetMethodNames.object}(await liftEither(${namedObjectType.identifierTypeAlias}.parse(args.identifier))))
|
|
20
20
|
)).unsafeCoerce()`,
|
|
21
21
|
type: namedObjectType.graphqlType.name,
|
|
22
22
|
};
|
|
@@ -31,7 +31,7 @@ async (_source, args: { identifier: string }, { objectSet }): Promise<${namedObj
|
|
|
31
31
|
},
|
|
32
32
|
resolve: code `\
|
|
33
33
|
async (_source, args: { limit: number | null; offset: number | null; }, { objectSet }): Promise<readonly string[]> =>
|
|
34
|
-
(await objectSet.${namedObjectType.objectSetMethodNames.objectIdentifiers}({ limit: args.limit !== null ? args.limit : undefined, offset: args.offset !== null ? args.offset : undefined })).unsafeCoerce().map(${namedObjectType.identifierTypeAlias}.
|
|
34
|
+
(await objectSet.${namedObjectType.objectSetMethodNames.objectIdentifiers}({ limit: args.limit !== null ? args.limit : undefined, offset: args.offset !== null ? args.offset : undefined })).unsafeCoerce().map(${namedObjectType.identifierTypeAlias}.stringify)`,
|
|
35
35
|
type: code `new ${imports.GraphQLNonNull}(new ${imports.GraphQLList}(${imports.GraphQLString}))`,
|
|
36
36
|
};
|
|
37
37
|
fields[namedObjectType.objectSetMethodNames.objects] = {
|
|
@@ -53,7 +53,7 @@ async (_source, args: { identifiers: readonly string[] | null; limit: number | n
|
|
|
53
53
|
if (args.identifiers) {
|
|
54
54
|
const identifiers: ${namedObjectType.identifierTypeAlias}[] = [];
|
|
55
55
|
for (const identifierArg of args.identifiers) {
|
|
56
|
-
identifiers.push(await liftEither(${namedObjectType.identifierTypeAlias}.
|
|
56
|
+
identifiers.push(await liftEither(${namedObjectType.identifierTypeAlias}.parse(identifierArg)));
|
|
57
57
|
}
|
|
58
58
|
filter = { ${syntheticNamePrefix}identifier: { in: identifiers } };
|
|
59
59
|
}
|
|
@@ -25,6 +25,8 @@ export declare const imports: {
|
|
|
25
25
|
readonly Maybe: import("ts-poet/build/Import.js").Import;
|
|
26
26
|
readonly NamedNode: import("ts-poet/build/Import.js").Import;
|
|
27
27
|
readonly NonEmptyList: import("ts-poet/build/Import.js").Import;
|
|
28
|
+
readonly NTriplesIdentifier: import("ts-poet/build/Import.js").Import;
|
|
29
|
+
readonly NTriplesTerm: import("ts-poet/build/Import.js").Import;
|
|
28
30
|
readonly Quad: import("ts-poet/build/Import.js").Import;
|
|
29
31
|
readonly Quad_Graph: import("ts-poet/build/Import.js").Import;
|
|
30
32
|
readonly RdfjsResourcePropertyPath: import("ts-poet/build/Import.js").Import;
|
|
@@ -2,7 +2,7 @@ import { imp } from "./ts-poet-wrapper.js";
|
|
|
2
2
|
export const imports = {
|
|
3
3
|
BigDecimal: imp("Decimal:BigDecimal@decimal.js"),
|
|
4
4
|
BlankNode: imp("BlankNode@@rdfjs/types"),
|
|
5
|
-
dataFactory: imp("dataFactory=@
|
|
5
|
+
dataFactory: imp("dataFactory=@rdfx/data-factory"),
|
|
6
6
|
DatasetCore: imp("DatasetCore@@rdfjs/types"),
|
|
7
7
|
datasetFactory: imp("datasetFactory=@rdfjs/dataset"),
|
|
8
8
|
Either: imp("Either@purify-ts"),
|
|
@@ -26,6 +26,8 @@ export const imports = {
|
|
|
26
26
|
Maybe: imp("Maybe@purify-ts"),
|
|
27
27
|
NamedNode: imp("NamedNode@@rdfjs/types"),
|
|
28
28
|
NonEmptyList: imp("NonEmptyList@purify-ts"),
|
|
29
|
+
NTriplesIdentifier: imp("NTriplesIdentifier@@rdfx/string"),
|
|
30
|
+
NTriplesTerm: imp("NTriplesTerm@@rdfx/string"),
|
|
29
31
|
Quad: imp("Quad@@rdfjs/types"),
|
|
30
32
|
Quad_Graph: imp("Quad_Graph@@rdfjs/types"),
|
|
31
33
|
RdfjsResourcePropertyPath: imp("PropertyPath:RdfjsResourcePropertyPath@@rdfx/resource"),
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { BlankNode, Literal, NamedNode, Variable } from "@rdfjs/types";
|
|
2
|
+
import type { Logger } from "ts-log";
|
|
2
3
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
3
|
-
export declare function rdfjsTermExpression(rdfjsTerm: Omit<BlankNode, "equals"> | Omit<Literal, "equals"> | Omit<NamedNode, "equals"> | Omit<Variable, "equals"
|
|
4
|
+
export declare function rdfjsTermExpression(rdfjsTerm: Omit<BlankNode, "equals"> | Omit<Literal, "equals"> | Omit<NamedNode, "equals"> | Omit<Variable, "equals">, { logger }: {
|
|
5
|
+
logger: Logger;
|
|
6
|
+
}): Code;
|
|
4
7
|
//# sourceMappingURL=rdfjsTermExpression.d.ts.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { rdf, rdfs, xsd } from "@tpluscode/rdf-ns-builders";
|
|
2
|
-
import { logger } from "../../logger.js";
|
|
3
2
|
import { snippets_RdfVocabularies } from "./_snippets/snippets_RdfVocabularies.js";
|
|
4
3
|
import { imports } from "./imports.js";
|
|
5
4
|
import { code, literalOf } from "./ts-poet-wrapper.js";
|
|
6
|
-
export function rdfjsTermExpression(rdfjsTerm) {
|
|
5
|
+
export function rdfjsTermExpression(rdfjsTerm, { logger }) {
|
|
7
6
|
switch (rdfjsTerm.termType) {
|
|
8
7
|
case "BlankNode":
|
|
9
8
|
return code `${imports.dataFactory}.blankNode(${literalOf(rdfjsTerm.value)})`;
|
|
@@ -14,7 +13,7 @@ export function rdfjsTermExpression(rdfjsTerm) {
|
|
|
14
13
|
}
|
|
15
14
|
return code `${imports.dataFactory}.literal(${literalOf(rdfjsTerm.value)}, ${literalOf(rdfjsTerm.language)})`;
|
|
16
15
|
}
|
|
17
|
-
return code `${imports.dataFactory}.literal(${literalOf(rdfjsTerm.value)}, ${rdfjsTermExpression(rdfjsTerm.datatype)})`;
|
|
16
|
+
return code `${imports.dataFactory}.literal(${literalOf(rdfjsTerm.value)}, ${rdfjsTermExpression(rdfjsTerm.datatype, { logger })})`;
|
|
18
17
|
case "NamedNode": {
|
|
19
18
|
if (rdfjsTerm.value.startsWith(rdf[""].value)) {
|
|
20
19
|
const unqualifiedName = rdfjsTerm.value.substring(rdf[""].value.length);
|
|
@@ -5,7 +5,6 @@ export declare const snippets: {
|
|
|
5
5
|
bigDecimalSparqlWherePatterns: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
6
6
|
BlankNodeFilter: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
7
7
|
BlankNodeSchema: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
8
|
-
blankNodeFromString: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
9
8
|
blankNodeSparqlWherePatterns: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
10
9
|
booleanEquals: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
11
10
|
BooleanFilter: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
@@ -42,7 +41,6 @@ export declare const snippets: {
|
|
|
42
41
|
FromRdfResourceValuesFunction: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
43
42
|
Hasher: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
44
43
|
IdentifierFilter: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
45
|
-
identifierFromString: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
46
44
|
IdentifierSchema: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
47
45
|
IdentifierSet: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
48
46
|
identifierSparqlWherePatterns: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
@@ -74,6 +72,9 @@ export declare const snippets: {
|
|
|
74
72
|
NumericFilter: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
75
73
|
NumericSchema: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
76
74
|
numericSparqlWherePatterns: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
75
|
+
parseBlankNode: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
76
|
+
parseIdentifier: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
77
|
+
parseIri: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
77
78
|
PropertiesFromRdfResourceFunction: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
78
79
|
PropertyPath: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
79
80
|
RdfVocabularies: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { snippets_parseIri } from "./_snippets/parseIri.js";
|
|
1
2
|
import { snippets_arrayEquals } from "./_snippets/snippets_arrayEquals.js";
|
|
2
3
|
import { snippets_arrayIntersection } from "./_snippets/snippets_arrayIntersection.js";
|
|
3
4
|
import { snippets_BlankNodeFilter } from "./_snippets/snippets_BlankNodeFilter.js";
|
|
@@ -6,7 +7,6 @@ import { snippets_BooleanFilter } from "./_snippets/snippets_BooleanFilter.js";
|
|
|
6
7
|
import { snippets_BooleanSchema } from "./_snippets/snippets_BooleanSchema.js";
|
|
7
8
|
import { snippets_bigDecimalLiteral } from "./_snippets/snippets_bigDecimalLiteral.js";
|
|
8
9
|
import { snippets_bigDecimalSparqlWherePatterns } from "./_snippets/snippets_bigDecimalSparqlWherePatterns.js";
|
|
9
|
-
import { snippets_blankNodeFromString } from "./_snippets/snippets_blankNodeFromString.js";
|
|
10
10
|
import { snippets_blankNodeSparqlWherePatterns } from "./_snippets/snippets_blankNodeSparqlWherePatterns.js";
|
|
11
11
|
import { snippets_booleanEquals } from "./_snippets/snippets_booleanEquals.js";
|
|
12
12
|
import { snippets_booleanSparqlWherePatterns } from "./_snippets/snippets_booleanSparqlWherePatterns.js";
|
|
@@ -45,7 +45,6 @@ import { snippets_IdentifierSchema } from "./_snippets/snippets_IdentifierSchema
|
|
|
45
45
|
import { snippets_IdentifierSet } from "./_snippets/snippets_IdentifierSet.js";
|
|
46
46
|
import { snippets_IriFilter } from "./_snippets/snippets_IriFilter.js";
|
|
47
47
|
import { snippets_IriSchema } from "./_snippets/snippets_IriSchema.js";
|
|
48
|
-
import { snippets_identifierFromString } from "./_snippets/snippets_identifierFromString.js";
|
|
49
48
|
import { snippets_identifierSparqlWherePatterns } from "./_snippets/snippets_identifierSparqlWherePatterns.js";
|
|
50
49
|
import { snippets_iriSparqlWherePatterns } from "./_snippets/snippets_iriSparqlWherePatterns.js";
|
|
51
50
|
import { snippets_isReadonlyBigIntArray } from "./_snippets/snippets_isReadonlyBigIntArray.js";
|
|
@@ -75,6 +74,8 @@ import { snippets_normalizeSparqlWherePatterns } from "./_snippets/snippets_norm
|
|
|
75
74
|
import { snippets_numericSparqlWherePatterns } from "./_snippets/snippets_numericSparqlWherePatterns.js";
|
|
76
75
|
import { snippets_PropertiesFromRdfResourceFunction } from "./_snippets/snippets_PropertiesFromRdfResourceFunction.js";
|
|
77
76
|
import { snippets_PropertyPath } from "./_snippets/snippets_PropertyPath.js";
|
|
77
|
+
import { snippets_parseBlankNode } from "./_snippets/snippets_parseBlankNode.js";
|
|
78
|
+
import { snippets_parseIdentifier } from "./_snippets/snippets_parseIdentifier.js";
|
|
78
79
|
import { snippets_RdfVocabularies } from "./_snippets/snippets_RdfVocabularies.js";
|
|
79
80
|
import { snippets_ShaclPropertySchema } from "./_snippets/snippets_ShaclPropertySchema.js";
|
|
80
81
|
import { snippets_SparqlFilterPattern } from "./_snippets/snippets_SparqlFilterPattern.js";
|
|
@@ -110,7 +111,6 @@ export const snippets = {
|
|
|
110
111
|
bigDecimalSparqlWherePatterns: snippets_bigDecimalSparqlWherePatterns,
|
|
111
112
|
BlankNodeFilter: snippets_BlankNodeFilter,
|
|
112
113
|
BlankNodeSchema: snippets_BlankNodeSchema,
|
|
113
|
-
blankNodeFromString: snippets_blankNodeFromString,
|
|
114
114
|
blankNodeSparqlWherePatterns: snippets_blankNodeSparqlWherePatterns,
|
|
115
115
|
booleanEquals: snippets_booleanEquals,
|
|
116
116
|
BooleanFilter: snippets_BooleanFilter,
|
|
@@ -147,7 +147,6 @@ export const snippets = {
|
|
|
147
147
|
FromRdfResourceValuesFunction: snippets_FromRdfResourceValuesFunction,
|
|
148
148
|
Hasher: snippets_Hasher,
|
|
149
149
|
IdentifierFilter: snippets_IdentifierFilter,
|
|
150
|
-
identifierFromString: snippets_identifierFromString,
|
|
151
150
|
IdentifierSchema: snippets_IdentifierSchema,
|
|
152
151
|
IdentifierSet: snippets_IdentifierSet,
|
|
153
152
|
identifierSparqlWherePatterns: snippets_identifierSparqlWherePatterns,
|
|
@@ -179,6 +178,9 @@ export const snippets = {
|
|
|
179
178
|
NumericFilter: snippets_NumericFilter,
|
|
180
179
|
NumericSchema: snippets_NumericSchema,
|
|
181
180
|
numericSparqlWherePatterns: snippets_numericSparqlWherePatterns,
|
|
181
|
+
parseBlankNode: snippets_parseBlankNode,
|
|
182
|
+
parseIdentifier: snippets_parseIdentifier,
|
|
183
|
+
parseIri: snippets_parseIri,
|
|
182
184
|
PropertiesFromRdfResourceFunction: snippets_PropertiesFromRdfResourceFunction,
|
|
183
185
|
PropertyPath: snippets_PropertyPath,
|
|
184
186
|
RdfVocabularies: snippets_RdfVocabularies,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { Logger } from "ts-log";
|
|
1
2
|
import type { NamedObjectType } from "./NamedObjectType.js";
|
|
2
3
|
import { NamedObjectUnionType } from "./NamedObjectUnionType.js";
|
|
3
4
|
/**
|
|
4
5
|
* Synthesize the $Object union.
|
|
5
6
|
*/
|
|
6
7
|
export declare function synthesizeUberObjectUnionType(parameters: {
|
|
8
|
+
logger: Logger;
|
|
7
9
|
namedObjectTypes: readonly NamedObjectType[];
|
|
8
10
|
}): NamedObjectUnionType;
|
|
9
11
|
//# sourceMappingURL=synthesizeUberObjectUnionType.d.ts.map
|
|
@@ -22,6 +22,7 @@ export function synthesizeUberObjectUnionType(parameters) {
|
|
|
22
22
|
identifierType = new IdentifierType({
|
|
23
23
|
comment: Maybe.empty(),
|
|
24
24
|
label: Maybe.empty(),
|
|
25
|
+
logger: parameters.logger,
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
28
|
else {
|
|
@@ -30,6 +31,7 @@ export function synthesizeUberObjectUnionType(parameters) {
|
|
|
30
31
|
identifierType = new BlankNodeType({
|
|
31
32
|
comment: Maybe.empty(),
|
|
32
33
|
label: Maybe.empty(),
|
|
34
|
+
logger: parameters.logger,
|
|
33
35
|
});
|
|
34
36
|
break;
|
|
35
37
|
case "IRI":
|
|
@@ -38,6 +40,7 @@ export function synthesizeUberObjectUnionType(parameters) {
|
|
|
38
40
|
hasValues: [],
|
|
39
41
|
in_: [],
|
|
40
42
|
label: Maybe.empty(),
|
|
43
|
+
logger: parameters.logger,
|
|
41
44
|
});
|
|
42
45
|
break;
|
|
43
46
|
}
|
|
@@ -53,6 +56,7 @@ export function synthesizeUberObjectUnionType(parameters) {
|
|
|
53
56
|
}, new Set()),
|
|
54
57
|
identifierType,
|
|
55
58
|
label: Maybe.empty(),
|
|
59
|
+
logger: parameters.logger,
|
|
56
60
|
members: namedObjectTypes.map((namedObjectType) => ({
|
|
57
61
|
discriminantValue: Maybe.empty(),
|
|
58
62
|
type: namedObjectType,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractShapesGraph } from "@shaclmate/shacl-ast";
|
|
2
2
|
import type { Either } from "purify-ts";
|
|
3
|
+
import type { Logger } from "ts-log";
|
|
3
4
|
import type { Ast } from "../ast/Ast.js";
|
|
4
5
|
import type { TsFeature } from "../enums/TsFeature.js";
|
|
5
6
|
import type { Generator } from "../generators/Generator.js";
|
|
@@ -16,13 +17,15 @@ export declare class ShapesGraph extends AbstractShapesGraph<generated.NodeShape
|
|
|
16
17
|
*/
|
|
17
18
|
compile(parameters: {
|
|
18
19
|
generator: Generator;
|
|
20
|
+
logger: Logger;
|
|
19
21
|
tsFeaturesDefault?: ReadonlySet<TsFeature>;
|
|
20
22
|
}): Either<Error, string>;
|
|
21
23
|
static builder(): ShapesGraph.Builder;
|
|
22
24
|
/**
|
|
23
25
|
* Transform the shapes graph to an AST.
|
|
24
26
|
*/
|
|
25
|
-
toAst(
|
|
27
|
+
toAst({ logger, tsFeaturesDefault, }: {
|
|
28
|
+
logger: Logger;
|
|
26
29
|
tsFeaturesDefault?: ReadonlySet<TsFeature>;
|
|
27
30
|
}): Either<Error, Ast>;
|
|
28
31
|
}
|
|
@@ -22,10 +22,11 @@ export class ShapesGraph extends AbstractShapesGraph {
|
|
|
22
22
|
/**
|
|
23
23
|
* Transform the shapes graph to an AST.
|
|
24
24
|
*/
|
|
25
|
-
toAst(
|
|
25
|
+
toAst({ logger, tsFeaturesDefault, }) {
|
|
26
26
|
return new ShapesGraphToAstTransformer({
|
|
27
|
-
|
|
27
|
+
logger,
|
|
28
28
|
shapesGraph: this,
|
|
29
|
+
tsFeaturesDefault,
|
|
29
30
|
}).transform();
|
|
30
31
|
}
|
|
31
32
|
}
|