@shaclmate/compiler 4.0.94 → 4.0.95
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/Eithers.d.ts +2 -1
- package/dist/Eithers.js +15 -0
- package/dist/ShapesGraphToAstTransformer.js +10 -0
- package/dist/_ShapesGraphToAstTransformer/ShapeStack.d.ts +2 -2
- package/dist/_ShapesGraphToAstTransformer/ShapeStack.js +2 -1
- package/dist/_ShapesGraphToAstTransformer/isNodeShape.d.ts +3 -0
- package/dist/_ShapesGraphToAstTransformer/isNodeShape.js +4 -0
- package/dist/_ShapesGraphToAstTransformer/isPropertyShape.d.ts +3 -0
- package/dist/_ShapesGraphToAstTransformer/isPropertyShape.js +4 -0
- package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.d.ts +2 -1
- package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +4 -3
- package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +7 -3
- package/dist/_ShapesGraphToAstTransformer/shapeOntology.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.js +34 -16
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +3 -2
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +3 -3
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstStructType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstStructType.js +86 -65
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +1 -1
- package/dist/ast/AbstractCollectionType.d.ts +2 -2
- package/dist/ast/AbstractConstruct.d.ts +25 -0
- package/dist/ast/AbstractConstruct.js +38 -0
- package/dist/ast/AbstractContainerType.d.ts +2 -2
- package/dist/ast/AbstractLazyType.d.ts +14 -36
- package/dist/ast/AbstractTermType.d.ts +2 -2
- package/dist/ast/AbstractType.d.ts +7 -17
- package/dist/ast/AbstractType.js +6 -22
- package/dist/ast/Ast.d.ts +2 -0
- package/dist/ast/DefaultValueType.d.ts +2 -2
- package/dist/ast/DiscriminatedUnionType.d.ts +2 -2
- package/dist/ast/DiscriminatedUnionType.js +3 -1
- package/dist/ast/LiteralType.d.ts +2 -2
- package/dist/ast/Operation.d.ts +67 -0
- package/dist/ast/Operation.js +32 -0
- package/dist/ast/Service.d.ts +17 -0
- package/dist/ast/Service.js +17 -0
- package/dist/ast/SetType.d.ts +2 -2
- package/dist/ast/StructCompoundType.d.ts +1 -1
- package/dist/ast/StructCompoundType.js +5 -5
- package/dist/ast/StructType.d.ts +64 -32
- package/dist/ast/StructType.js +62 -29
- package/dist/ast/index.d.ts +2 -0
- package/dist/ast/index.js +2 -0
- package/dist/generators/transformAstToLabeledPropertyGraph.js +13 -10
- package/dist/generators/ts/AbstractCallable.d.ts +20 -0
- package/dist/generators/ts/AbstractCallable.js +9 -0
- package/dist/generators/ts/AbstractCollectionType.d.ts +7 -9
- package/dist/generators/ts/AbstractCollectionType.js +11 -11
- package/dist/generators/ts/AbstractCompoundType.d.ts +18 -0
- package/dist/generators/ts/AbstractCompoundType.js +33 -0
- package/dist/generators/ts/AbstractConstruct.d.ts +31 -0
- package/dist/generators/ts/AbstractConstruct.js +31 -0
- package/dist/generators/ts/AbstractContainerType.d.ts +7 -4
- package/dist/generators/ts/AbstractContainerType.js +5 -2
- package/dist/generators/ts/AbstractDateType.d.ts +8 -5
- package/dist/generators/ts/AbstractDateType.js +22 -8
- package/dist/generators/ts/AbstractDiscriminatedUnionType.d.ts +43 -45
- package/dist/generators/ts/AbstractDiscriminatedUnionType.js +100 -258
- package/dist/generators/ts/AbstractIdentifierType.d.ts +8 -3
- package/dist/generators/ts/AbstractIdentifierType.js +34 -5
- package/dist/generators/ts/AbstractIntersectionType.d.ts +48 -0
- package/dist/generators/ts/AbstractIntersectionType.js +80 -0
- package/dist/generators/ts/AbstractLazyType.d.ts +28 -17
- package/dist/generators/ts/AbstractLazyType.js +61 -23
- package/dist/generators/ts/AbstractLiteralType.d.ts +2 -2
- package/dist/generators/ts/AbstractLiteralType.js +15 -1
- package/dist/generators/ts/AbstractNumericType.d.ts +5 -4
- package/dist/generators/ts/AbstractNumericType.js +4 -6
- package/dist/generators/ts/AbstractObjectSetType.d.ts +5 -6
- package/dist/generators/ts/AbstractObjectSetType.js +10 -13
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +7 -7
- package/dist/generators/ts/AbstractPrimitiveType.js +18 -36
- package/dist/generators/ts/AbstractStructuredType.d.ts +71 -0
- package/dist/generators/ts/AbstractStructuredType.js +273 -0
- package/dist/generators/ts/AbstractTermType.d.ts +8 -10
- package/dist/generators/ts/AbstractTermType.js +6 -18
- package/dist/generators/ts/AbstractType.d.ts +54 -78
- package/dist/generators/ts/AbstractType.js +25 -29
- package/dist/generators/ts/AbstractTypedLiteralType.d.ts +5 -4
- package/dist/generators/ts/AbstractTypedLiteralType.js +14 -3
- package/dist/generators/ts/BigDecimalType.d.ts +15 -13
- package/dist/generators/ts/BigDecimalType.js +13 -29
- package/dist/generators/ts/BigIntType.d.ts +10 -8
- package/dist/generators/ts/BigIntType.js +26 -51
- package/dist/generators/ts/BlankNodeType.d.ts +12 -12
- package/dist/generators/ts/BlankNodeType.js +9 -35
- package/dist/generators/ts/BooleanType.d.ts +12 -6
- package/dist/generators/ts/BooleanType.js +21 -11
- package/dist/generators/ts/Callable.d.ts +5 -0
- package/dist/generators/ts/Callable.js +2 -0
- package/dist/generators/ts/CodeThunk.d.ts +6 -0
- package/dist/generators/ts/CodeThunk.js +8 -0
- package/dist/generators/ts/DateTimeType.d.ts +7 -4
- package/dist/generators/ts/DateTimeType.js +8 -21
- package/dist/generators/ts/DateType.d.ts +7 -4
- package/dist/generators/ts/DateType.js +8 -21
- package/dist/generators/ts/DeclaredCallable.d.ts +23 -0
- package/dist/generators/ts/DeclaredCallable.js +59 -0
- package/dist/generators/ts/DefaultValueType.d.ts +24 -23
- package/dist/generators/ts/DefaultValueType.js +29 -59
- package/dist/generators/ts/FloatType.d.ts +7 -2
- package/dist/generators/ts/FloatType.js +16 -6
- package/dist/generators/ts/GraphqlSchema.js +1 -1
- package/dist/generators/ts/IdentifierType.d.ts +13 -13
- package/dist/generators/ts/IdentifierType.js +10 -39
- package/dist/generators/ts/Imports.d.ts +8 -0
- package/dist/generators/ts/Imports.js +15 -7
- package/dist/generators/ts/InlineCallable.d.ts +18 -0
- package/dist/generators/ts/InlineCallable.js +51 -0
- package/dist/generators/ts/IntType.d.ts +6 -1
- package/dist/generators/ts/IntType.js +16 -1
- package/dist/generators/ts/IriType.d.ts +12 -8
- package/dist/generators/ts/IriType.js +56 -43
- package/dist/generators/ts/LangStringType.d.ts +12 -7
- package/dist/generators/ts/LangStringType.js +37 -20
- package/dist/generators/ts/LazyOptionType.d.ts +10 -24
- package/dist/generators/ts/LazyOptionType.js +5 -26
- package/dist/generators/ts/LazySetType.d.ts +7 -2
- package/dist/generators/ts/LazySetType.js +5 -25
- package/dist/generators/ts/LazyType.d.ts +7 -2
- package/dist/generators/ts/LazyType.js +5 -21
- package/dist/generators/ts/ListType.d.ts +12 -7
- package/dist/generators/ts/ListType.js +45 -22
- package/dist/generators/ts/LiteralType.d.ts +11 -7
- package/dist/generators/ts/LiteralType.js +31 -21
- package/dist/generators/ts/ObjectDiscriminatedUnionType.d.ts +19 -2
- package/dist/generators/ts/ObjectDiscriminatedUnionType.js +105 -41
- package/dist/generators/ts/ObjectIntersectionType.d.ts +44 -0
- package/dist/generators/ts/ObjectIntersectionType.js +204 -0
- package/dist/generators/ts/ObjectSetType.js +0 -1
- package/dist/generators/ts/ObjectType.d.ts +78 -49
- package/dist/generators/ts/ObjectType.js +235 -362
- package/dist/generators/ts/Operation.d.ts +54 -0
- package/dist/generators/ts/Operation.js +206 -0
- package/dist/generators/ts/OptionType.d.ts +15 -13
- package/dist/generators/ts/OptionType.js +43 -33
- package/dist/generators/ts/RdfjsDatasetObjectSetType.js +14 -7
- package/dist/generators/ts/ReferenceCallable.d.ts +14 -0
- package/dist/generators/ts/ReferenceCallable.js +16 -0
- package/dist/generators/ts/Service.d.ts +15 -0
- package/dist/generators/ts/Service.js +53 -0
- package/dist/generators/ts/SetType.d.ts +11 -8
- package/dist/generators/ts/SetType.js +35 -35
- package/dist/generators/ts/SnippetFactory.d.ts +1 -1
- package/dist/generators/ts/Snippets.d.ts +80 -2
- package/dist/generators/ts/Snippets.js +622 -74
- package/dist/generators/ts/SparqlObjectSetType.js +1 -4
- package/dist/generators/ts/StringType.d.ts +10 -5
- package/dist/generators/ts/StringType.js +25 -17
- package/dist/generators/ts/TermType.d.ts +13 -7
- package/dist/generators/ts/TermType.js +61 -71
- package/dist/generators/ts/TsFeature.d.ts +4 -1
- package/dist/generators/ts/TsFeature.js +51 -0
- package/dist/generators/ts/TsGenerator.d.ts +2 -1
- package/dist/generators/ts/TsGenerator.js +98 -54
- package/dist/generators/ts/Type.d.ts +2 -1
- package/dist/generators/ts/TypeFactory.d.ts +10 -7
- package/dist/generators/ts/TypeFactory.js +193 -140
- package/dist/generators/ts/UberObjectDiscriminatedUnionType.d.ts +6 -2
- package/dist/generators/ts/UberObjectDiscriminatedUnionType.js +18 -12
- package/dist/generators/ts/ZodGenerator.js +6 -14
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_Discriminant.d.ts +3 -6
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_conversionFunctionExpression.d.ts → AbstractDiscriminatedUnionType_conversionFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_conversionFunctionExpression.js → AbstractDiscriminatedUnionType_conversionFunction.js} +2 -2
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_equalsFunctionExpression.d.ts → AbstractDiscriminatedUnionType_equalsFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_equalsFunctionExpression.js → AbstractDiscriminatedUnionType_equalsFunction.js} +4 -4
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_filterFunctionExpression.d.ts → AbstractDiscriminatedUnionType_filterFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_filterFunctionExpression.js → AbstractDiscriminatedUnionType_filterFunction.js} +7 -8
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_filterTypeExpression.js +1 -2
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonObjectFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonObjectFunction.js +18 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_fromRdfResourceValuesFunctionExpression.d.ts → AbstractDiscriminatedUnionType_fromRdfResourceValuesFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_fromRdfResourceValuesFunctionExpression.js → AbstractDiscriminatedUnionType_fromRdfResourceValuesFunction.js} +5 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_hashFunctionExpression.d.ts → AbstractDiscriminatedUnionType_hashFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_hashFunctionExpression.js → AbstractDiscriminatedUnionType_hashFunction.js} +4 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_inferDiscriminant.js +6 -9
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_inlineExpression.js +5 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonObjectFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonObjectFunction.js +16 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toLoggableFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toLoggableFunction.js +20 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_toRdfResourceValuesFunctionExpression.d.ts → AbstractDiscriminatedUnionType_toRdfResourceValuesFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toRdfResourceValuesFunction.js +18 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_toStringFunctionExpression.d.ts → AbstractDiscriminatedUnionType_toStringFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_toStringFunctionExpression.js → AbstractDiscriminatedUnionType_toStringFunction.js} +3 -3
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunctionExpression.d.ts → AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunctionExpression.js → AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunction.js} +4 -4
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunctionExpression.d.ts → AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunctionExpression.js → AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunction.js} +4 -4
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_equalsFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_equalsFunction.js +7 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_filterFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_filterFunction.js +7 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_hashFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_hashFunction.js +8 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_toLoggableFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_toLoggableFunction.js +14 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_toStringFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_toStringFunction.js +17 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_valueSparqlConstructTriplesFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_valueSparqlConstructTriplesFunction.js +13 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_valueSparqlWherePatternsFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_valueSparqlWherePatternsFunction.js +13 -0
- package/dist/generators/ts/_AbstractType/AbstractType_DiscriminatedType.d.ts +9 -0
- package/dist/generators/ts/_AbstractType/AbstractType_DiscriminatedType.js +2 -0
- package/dist/generators/ts/_AbstractType/AbstractType_JsonType.d.ts +196 -11
- package/dist/generators/ts/_AbstractType/AbstractType_JsonType.js +411 -17
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_focusSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_focusSparqlConstructTriplesFunction.d.ts} +3 -3
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlConstructTriplesFunction.js +12 -0
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunction.d.ts} +3 -3
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunction.js +32 -0
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_fromRdfResourceFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_fromRdfResourceFunction.d.ts} +3 -3
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_fromRdfResourceFunction.js +16 -0
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_graphqlTypeVariableStatement.d.ts → ObjectDiscriminatedUnionType_graphqlTypeExpression.d.ts} +2 -2
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_graphqlTypeExpression.js +11 -0
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_schemaExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_schemaVariableStatement.js → ObjectDiscriminatedUnionType_schemaExpression.js} +3 -8
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_toRdfResourceFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_toRdfResourceFunction.d.ts} +3 -3
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_toRdfResourceFunction.js +17 -0
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_typeGuardFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_typeGuardFunction.d.ts} +4 -3
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_typeGuardFunction.js +14 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType__fromRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType__fromRdfResourceFunction.js +16 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType__toRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType__toRdfResourceFunction.js +18 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createFunction.js +30 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createFunctionParameters.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createFunctionParameters.js +25 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createUnsafeFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createUnsafeFunction.js +10 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_focusSparqlConstructTriplesFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_focusSparqlConstructTriplesFunction.js +19 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_focusSparqlWherePatternsFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_focusSparqlWherePatternsFunction.js +19 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromJsonObjectFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromJsonObjectFunction.js +15 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceFunction.js +9 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceValuesFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceValuesFunction.js +8 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toJsonObjectFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toJsonObjectFunction.js +7 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toRdfResourceFunction.js +12 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toRdfResourceValuesFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toRdfResourceValuesFunction.js +5 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_typeGuardFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_typeGuardFunction.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.d.ts +37 -23
- package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.js +19 -1
- package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.d.ts +15 -15
- package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.js +22 -56
- package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.d.ts +9 -10
- package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.js +40 -49
- package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.d.ts +8 -9
- package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.js +47 -14
- package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.d.ts +10 -10
- package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.js +41 -57
- package/dist/generators/ts/_ObjectType/ObjectType__fromRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_fromRdfResourceFunctionExpression.js → ObjectType__fromRdfResourceFunction.js} +14 -11
- package/dist/generators/ts/_ObjectType/ObjectType__toRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType__toRdfResourceFunction.js +32 -0
- package/dist/generators/ts/_ObjectType/ObjectType_conversionFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_conversionFunction.js +28 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunction.js +31 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionParameters.d.ts +3 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionParameters.js +29 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createUnsafeFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createUnsafeFunction.js +10 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_equalsFunctionExpression.d.ts → ObjectType_equalsFunction.d.ts} +2 -1
- package/dist/generators/ts/_ObjectType/{ObjectType_equalsFunctionExpression.js → ObjectType_equalsFunction.js} +6 -4
- package/dist/generators/ts/_ObjectType/{ObjectType_filterFunctionExpression.d.ts → ObjectType_filterFunction.d.ts} +2 -1
- package/dist/generators/ts/_ObjectType/{ObjectType_filterFunctionExpression.js → ObjectType_filterFunction.js} +5 -2
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionExpression.d.ts → ObjectType_focusSparqlConstructTriplesFunction.d.ts} +3 -3
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionExpression.js → ObjectType_focusSparqlConstructTriplesFunction.js} +11 -4
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionExpression.d.ts → ObjectType_focusSparqlWherePatternsFunction.d.ts} +3 -3
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionExpression.js → ObjectType_focusSparqlWherePatternsFunction.js} +11 -4
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonObjectFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonObjectFunction.js +19 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunction.js +9 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunction.js +8 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_hashFunctionExpression.d.ts → ObjectType_hashFunction.d.ts} +2 -1
- package/dist/generators/ts/_ObjectType/{ObjectType_hashFunctionExpression.js → ObjectType_hashFunction.js} +10 -14
- package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.d.ts +6 -2
- package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.js +1 -2
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunction.d.ts +20 -0
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunction.js +39 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → ObjectType_sparqlConstructQueryStringFunction.d.ts} +11 -4
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunction.js +11 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonObjectFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonObjectFunction.js +16 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toLoggableFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toLoggableFunction.js +11 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunction.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceValuesFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceValuesFunction.js +8 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_toStringFunctionExpression.d.ts → ObjectType_toStringFunction.d.ts} +2 -1
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunction.js +10 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunction.js +17 -0
- package/dist/generators/ts/_ObjectType/ObjectType_typeGuardFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_typeGuardFunction.js +18 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlConstructTriplesFunctionExpression.d.ts → ObjectType_valueSparqlConstructTriplesFunction.d.ts} +1 -1
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunction.js +7 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlWherePatternsFunctionExpression.d.ts → ObjectType_valueSparqlWherePatternsFunction.d.ts} +1 -1
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunction.js +9 -0
- package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_DateSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_FilterFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_FilterFunction.js +3 -0
- package/dist/generators/ts/_snippets/snippets_FromJsonObjectFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_FromJsonObjectFunction.js +21 -0
- package/dist/generators/ts/_snippets/snippets_FromJsonValueFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_FromJsonValueFunction.js +21 -0
- package/dist/generators/ts/_snippets/snippets_HashFunction.js +1 -1
- package/dist/generators/ts/_snippets/snippets_Hasher.js +1 -1
- package/dist/generators/ts/_snippets/snippets_IdentifierJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_IdentifierJsonObject.js +12 -0
- package/dist/generators/ts/_snippets/snippets_LangStringJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LangStringJsonObject.js +14 -0
- package/dist/generators/ts/_snippets/snippets_Lazy.js +8 -1
- package/dist/generators/ts/_snippets/snippets_LazyOption.js +17 -1
- package/dist/generators/ts/_snippets/snippets_LazySet.js +8 -1
- package/dist/generators/ts/_snippets/snippets_LiteralJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LiteralJsonObject.js +16 -0
- package/dist/generators/ts/_snippets/snippets_NumericSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_ObjectTypeGuardFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ObjectTypeGuardFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_Primitive.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_Primitive.js +4 -0
- package/dist/generators/ts/_snippets/snippets_ProblemDetailsJson.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ProblemDetailsJson.js +41 -0
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +11 -6
- package/dist/generators/ts/_snippets/snippets_SparqlConstructQueryFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_SparqlConstructQueryFunction.js +12 -0
- package/dist/generators/ts/_snippets/snippets_SparqlConstructQueryStringFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_SparqlConstructQueryStringFunction.js +13 -0
- package/dist/generators/ts/_snippets/snippets_StringSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_TermJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_TermJsonObject.js +8 -0
- package/dist/generators/ts/_snippets/snippets_ToJsonObjectFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ToJsonObjectFunction.js +3 -0
- package/dist/generators/ts/_snippets/snippets_ToJsonValueFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ToJsonValueFunction.js +3 -0
- package/dist/generators/ts/_snippets/snippets_ToLoggableFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ToLoggableFunction.js +3 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.js +1 -1
- package/dist/generators/ts/_snippets/snippets_ToStringFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ToStringFunction.js +3 -0
- package/dist/generators/ts/_snippets/snippets_ToStringRecordFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ToStringRecordFunction.js +3 -0
- package/dist/generators/ts/_snippets/snippets_TypedLiteralJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_TypedLiteralJsonObject.js +14 -0
- package/dist/generators/ts/_snippets/snippets__ToRdfResourceFunction.js +1 -1
- package/dist/generators/ts/_snippets/snippets_arrayFromJsonArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_arrayFromJsonArray.js +13 -0
- package/dist/generators/ts/_snippets/snippets_arrayToJsonArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_arrayToJsonArray.js +6 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.js +3 -3
- package/dist/generators/ts/_snippets/snippets_bigDecimalLiteral.js +3 -2
- package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromJsonObject.js +9 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromJsonString.js +8 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.js +2 -2
- package/dist/generators/ts/_snippets/snippets_bigIntToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigIntToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_bigIntToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigIntToJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.js +2 -3
- package/dist/generators/ts/_snippets/snippets_blankNodeToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeToJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeToJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromJsonBoolean.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromJsonBoolean.js +6 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromJsonObject.js +9 -0
- package/dist/generators/ts/_snippets/snippets_constrainPrimitive.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_constrainPrimitive.js +12 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazy.js +2 -13
- package/dist/generators/ts/_snippets/snippets_convertToLazyOption.js +2 -13
- package/dist/generators/ts/_snippets/snippets_convertToLazySet.js +2 -15
- package/dist/generators/ts/_snippets/snippets_dateFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateFromJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_dateFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateFromJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.js +3 -4
- package/dist/generators/ts/_snippets/snippets_dateSparqlWherePatterns.js +7 -6
- package/dist/generators/ts/_snippets/snippets_dateTimeFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeFromJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.js +3 -4
- package/dist/generators/ts/_snippets/snippets_dateTimeToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeToJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_dateToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_dateToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateToJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonObject.js +9 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonValue.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonValue.js +9 -0
- package/dist/generators/ts/_snippets/snippets_errorToProblemDetailsJson.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_errorToProblemDetailsJson.js +27 -0
- package/dist/generators/ts/_snippets/snippets_filterBigDecimal.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterBlankNode.js +1 -3
- package/dist/generators/ts/_snippets/snippets_filterBoolean.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterDate.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterIdentifier.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterIri.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterLiteral.js +1 -3
- package/dist/generators/ts/_snippets/snippets_filterString.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterTerm.js +17 -17
- package/dist/generators/ts/_snippets/snippets_floatFromJsonNumber.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_floatFromJsonNumber.js +6 -0
- package/dist/generators/ts/_snippets/snippets_floatFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_floatFromJsonObject.js +9 -0
- package/dist/generators/ts/_snippets/snippets_hashArray.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashBigDecimal.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashBoolean.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashDate.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashDateTime.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashMaybe.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashNumeric.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashString.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashTerm.js +1 -2
- package/dist/generators/ts/_snippets/snippets_identifierFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.js +2 -3
- package/dist/generators/ts/_snippets/snippets_identifierToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierToJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_identifierToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierToJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_intFromJsonNumber.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_intFromJsonNumber.js +6 -0
- package/dist/generators/ts/_snippets/snippets_intFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_intFromJsonObject.js +9 -0
- package/dist/generators/ts/_snippets/snippets_iriFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_iriFromJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_iriFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_iriFromJsonString.js +6 -0
- package/dist/generators/ts/_snippets/snippets_iriToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_iriToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_iriToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_iriToJsonString.js +6 -0
- package/dist/generators/ts/_snippets/snippets_langStringFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_langStringFromJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_langStringFromRdfResourceValues.js +2 -3
- package/dist/generators/ts/_snippets/snippets_langStringToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_langStringToJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_listFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_listFromJsonObject.js +10 -0
- package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +6 -5
- package/dist/generators/ts/_snippets/snippets_listToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_listToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_literalFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_literalFromJsonObject.js +16 -0
- package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.js +2 -3
- package/dist/generators/ts/_snippets/snippets_literalToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_literalToJsonObject.js +15 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromJsonObject.js +12 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromJsonValue.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromJsonValue.js +12 -0
- package/dist/generators/ts/_snippets/snippets_maybeToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_maybeToJsonValue.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeToJsonValue.js +6 -0
- package/dist/generators/ts/_snippets/snippets_missingResolver.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_missingResolver.js +3 -0
- package/dist/generators/ts/_snippets/snippets_primitiveToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_primitiveToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_primitiveToJsonValue.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_primitiveToJsonValue.js +6 -0
- package/dist/generators/ts/_snippets/snippets_sparqlInstancesOfPattern.js +4 -3
- package/dist/generators/ts/_snippets/snippets_stringFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_stringFromJsonObject.js +9 -0
- package/dist/generators/ts/_snippets/snippets_stringFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_stringFromJsonString.js +6 -0
- package/dist/generators/ts/_snippets/snippets_termFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termFromJsonObject.js +31 -0
- package/dist/generators/ts/_snippets/snippets_termToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termToJsonObject.js +14 -0
- package/dist/generators/ts/_snippets/snippets_typedLiteralToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_typedLiteralToJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_wrap_ToRdfResourceFunction.js +23 -3
- package/dist/generators/ts/_snippets/snippets_zValidator.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_zValidator.js +16 -0
- package/dist/generators/ts/rdfjsTermExpression.d.ts +1 -1
- package/dist/generators/ts/rdfjsTermExpression.js +5 -54
- package/dist/input/ShapesGraph.d.ts +7 -3
- package/dist/input/ShapesGraph.js +74 -3
- package/dist/input/index.d.ts +3 -1
- package/dist/input/index.js +1 -1
- package/dist/input/input.shaclmate.d.ts +1494 -240
- package/dist/input/input.shaclmate.js +1159 -387
- package/dist/input/input.shaclmate.ttl +245 -0
- package/package.json +331 -98
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonFunctionExpression.d.ts +0 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonFunctionExpression.js +0 -14
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_jsonSchemaExpression.d.ts +0 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_jsonSchemaExpression.js +0 -32
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_jsonTypeLiteral.d.ts +0 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_jsonTypeLiteral.js +0 -26
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonFunctionExpression.d.ts +0 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonFunctionExpression.js +0 -10
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toRdfResourceValuesFunctionExpression.js +0 -30
- package/dist/generators/ts/_AbstractType/AbstractType_DiscriminantProperty.d.ts +0 -9
- package/dist/generators/ts/_AbstractType/AbstractType_DiscriminantProperty.js +0 -2
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlConstructTriplesFunctionDeclaration.js +0 -13
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunctionDeclaration.js +0 -32
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_fromRdfResourceFunctionDeclaration.js +0 -17
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_graphqlTypeVariableStatement.js +0 -16
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_identifierTypeDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_identifierTypeDeclarations.js +0 -14
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_schemaVariableStatement.d.ts +0 -4
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_toRdfResourceFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_typeGuardFunctionDeclaration.js +0 -16
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.js +0 -29
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.js +0 -12
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.js +0 -10
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.js +0 -22
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.js +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.js +0 -17
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +0 -10
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +0 -35
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +0 -8
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.js +0 -12
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.js +0 -26
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.js +0 -7
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.js +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_typeGuardFunctionExpression.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_typeGuardFunctionExpression.js +0 -14
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionExpression.js +0 -8
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionExpression.js +0 -10
- package/dist/generators/ts/_snippets/snippets_RdfVocabularies.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_RdfVocabularies.js +0 -42
package/dist/ast/StructType.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BlankNode, NamedNode } from "@rdfjs/types";
|
|
2
2
|
import { PropertyPath } from "@rdfx/resource";
|
|
3
3
|
import type { NodeKind } from "@shaclmate/shacl-ast";
|
|
4
|
-
import
|
|
4
|
+
import { Maybe } from "purify-ts";
|
|
5
5
|
import { AbstractType } from "./AbstractType.js";
|
|
6
6
|
import type { BlankNodeType } from "./BlankNodeType.js";
|
|
7
7
|
import type { IdentifierType } from "./IdentifierType.js";
|
|
@@ -9,7 +9,6 @@ import type { IriType } from "./IriType.js";
|
|
|
9
9
|
import { Type } from "./Type.js";
|
|
10
10
|
export declare class StructType extends AbstractType {
|
|
11
11
|
#private;
|
|
12
|
-
private fieldNames;
|
|
13
12
|
/**
|
|
14
13
|
* If true, the code for this StructType is defined externally and should not be generated.
|
|
15
14
|
*
|
|
@@ -24,13 +23,16 @@ export declare class StructType extends AbstractType {
|
|
|
24
23
|
*/
|
|
25
24
|
readonly fromRdfType: Maybe<NamedNode>;
|
|
26
25
|
/**
|
|
27
|
-
* Identifier type.
|
|
26
|
+
* Identifier type, derived from the node shape's node kinds.
|
|
28
27
|
*/
|
|
29
28
|
readonly identifierType: BlankNodeType | IdentifierType | IriType;
|
|
30
29
|
/**
|
|
31
30
|
* Type discriminant.
|
|
32
31
|
*/
|
|
33
32
|
readonly kind = "Struct";
|
|
33
|
+
/**
|
|
34
|
+
* Fixed node kinds.
|
|
35
|
+
*/
|
|
34
36
|
readonly nodeKinds: ReadonlySet<NodeKind>;
|
|
35
37
|
/**
|
|
36
38
|
* Was this type synthesized or did it come from SHACL?
|
|
@@ -61,35 +63,62 @@ export declare class StructType extends AbstractType {
|
|
|
61
63
|
tsImports: readonly string[];
|
|
62
64
|
} & ConstructorParameters<typeof AbstractType>[0]);
|
|
63
65
|
get fields(): readonly StructType.Field[];
|
|
66
|
+
get identifierField(): Maybe<StructType.IdentifierField>;
|
|
64
67
|
get recursive(): boolean;
|
|
65
|
-
|
|
68
|
+
addField(field: StructType.Field): void;
|
|
66
69
|
equals(other: StructType): boolean;
|
|
67
70
|
sortFields(): void;
|
|
68
71
|
toJSON(): {
|
|
69
72
|
fromRdfType: NamedNode<string> | undefined;
|
|
70
|
-
identifierType: {
|
|
71
|
-
hasValues: readonly NamedNode<string>[] | undefined;
|
|
72
|
-
in: readonly NamedNode<string>[] | undefined;
|
|
73
|
-
nodeKinds: NodeKind[];
|
|
74
|
-
comment: string | undefined;
|
|
75
|
-
kind: string;
|
|
76
|
-
label: string | undefined;
|
|
77
|
-
name: string | undefined;
|
|
78
|
-
recursive: boolean | undefined;
|
|
79
|
-
shapeIdentifier: BlankNode | NamedNode<string>;
|
|
80
|
-
};
|
|
81
73
|
synthetic: boolean | undefined;
|
|
82
74
|
toRdfTypes: readonly NamedNode<string>[] | undefined;
|
|
83
|
-
comment: string | undefined;
|
|
84
75
|
kind: string;
|
|
85
|
-
label: string | undefined;
|
|
86
76
|
name: string | undefined;
|
|
87
77
|
recursive: boolean | undefined;
|
|
88
78
|
shapeIdentifier: BlankNode | NamedNode<string>;
|
|
79
|
+
comment: string | undefined;
|
|
80
|
+
label: string | undefined;
|
|
89
81
|
};
|
|
90
82
|
}
|
|
91
83
|
export declare namespace StructType {
|
|
92
|
-
class
|
|
84
|
+
abstract class AbstractField {
|
|
85
|
+
/**
|
|
86
|
+
* Type discriminant.
|
|
87
|
+
*/
|
|
88
|
+
abstract readonly kind: "Identifier" | "Shacl";
|
|
89
|
+
/**
|
|
90
|
+
* Relative order of this field among the fields of the struct.
|
|
91
|
+
*/
|
|
92
|
+
abstract readonly order: number;
|
|
93
|
+
/**
|
|
94
|
+
* Does the field directly or indirectly reference the StructType itself?
|
|
95
|
+
*/
|
|
96
|
+
abstract readonly recursive: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* StructType this field belongs to.
|
|
99
|
+
*/
|
|
100
|
+
readonly structType: StructType;
|
|
101
|
+
constructor({ structType }: {
|
|
102
|
+
structType: StructType;
|
|
103
|
+
});
|
|
104
|
+
toJSON(): {
|
|
105
|
+
kind: "Identifier" | "Shacl";
|
|
106
|
+
};
|
|
107
|
+
toString(): string;
|
|
108
|
+
}
|
|
109
|
+
export class IdentifierField extends AbstractField {
|
|
110
|
+
readonly kind = "Identifier";
|
|
111
|
+
readonly order = 0;
|
|
112
|
+
readonly recursive = false;
|
|
113
|
+
/**
|
|
114
|
+
* Identifier type.
|
|
115
|
+
*/
|
|
116
|
+
readonly type: BlankNodeType | IdentifierType | IriType;
|
|
117
|
+
constructor({ type, ...superParameters }: {
|
|
118
|
+
type: BlankNodeType | IdentifierType | IriType;
|
|
119
|
+
} & ConstructorParameters<typeof AbstractField>[0]);
|
|
120
|
+
}
|
|
121
|
+
export class ShaclField extends AbstractField {
|
|
93
122
|
/**
|
|
94
123
|
* Documentation comment from rdfs:comment.
|
|
95
124
|
*/
|
|
@@ -102,10 +131,18 @@ export declare namespace StructType {
|
|
|
102
131
|
* Should the field and its value be displayed in a toString()-type representation?
|
|
103
132
|
*/
|
|
104
133
|
readonly display: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Type discriminant.
|
|
136
|
+
*/
|
|
137
|
+
readonly kind = "Shacl";
|
|
105
138
|
/**
|
|
106
139
|
* Human-readable label from rdfs:label.
|
|
107
140
|
*/
|
|
108
141
|
readonly label: Maybe<string>;
|
|
142
|
+
/**
|
|
143
|
+
* Minimum cardinality of this field, derived from sh:minCount.
|
|
144
|
+
*/
|
|
145
|
+
readonly minCount: bigint;
|
|
109
146
|
/**
|
|
110
147
|
* The field should be mutable in generated code i.e., it should be re-assignable. The field value may or may
|
|
111
148
|
* not be mutable.
|
|
@@ -127,31 +164,24 @@ export declare namespace StructType {
|
|
|
127
164
|
* Identifier of the field shape.
|
|
128
165
|
*/
|
|
129
166
|
readonly shapeIdentifier: BlankNode | NamedNode;
|
|
130
|
-
/**
|
|
131
|
-
* StructType this field belongs to.
|
|
132
|
-
*/
|
|
133
|
-
readonly structType: StructType;
|
|
134
167
|
/**
|
|
135
168
|
* Type of this field.
|
|
136
169
|
*/
|
|
137
170
|
readonly type: Type;
|
|
138
|
-
constructor({ comment, description, display, label, mutable, name, order, path, shapeIdentifier,
|
|
171
|
+
constructor({ comment, description, display, label, minCount, mutable, name, order, path, shapeIdentifier, type, ...superParameters }: {
|
|
139
172
|
comment: Maybe<string>;
|
|
140
173
|
description: Maybe<string>;
|
|
141
174
|
display: boolean;
|
|
142
175
|
label: Maybe<string>;
|
|
176
|
+
minCount: bigint;
|
|
143
177
|
mutable: boolean;
|
|
144
178
|
name: string;
|
|
145
179
|
order: number;
|
|
146
180
|
path: PropertyPath;
|
|
147
181
|
shapeIdentifier: BlankNode | NamedNode;
|
|
148
|
-
structType: StructType;
|
|
149
182
|
type: Type;
|
|
150
|
-
});
|
|
151
|
-
equals(other:
|
|
152
|
-
/**
|
|
153
|
-
* Does the field directly or indirectly reference the StructType itself?
|
|
154
|
-
*/
|
|
183
|
+
} & ConstructorParameters<typeof AbstractField>[0]);
|
|
184
|
+
equals(other: ShaclField): boolean;
|
|
155
185
|
get recursive(): boolean;
|
|
156
186
|
toJSON(): {
|
|
157
187
|
comment: string | undefined;
|
|
@@ -164,15 +194,17 @@ export declare namespace StructType {
|
|
|
164
194
|
recursive: boolean | undefined;
|
|
165
195
|
shapeIdentifier: BlankNode | NamedNode<string>;
|
|
166
196
|
type: {
|
|
167
|
-
comment: string | undefined;
|
|
168
197
|
kind: string;
|
|
169
|
-
label: string | undefined;
|
|
170
198
|
name: string | undefined;
|
|
171
199
|
recursive: boolean | undefined;
|
|
172
200
|
shapeIdentifier: BlankNode | NamedNode<string>;
|
|
201
|
+
comment: string | undefined;
|
|
202
|
+
label: string | undefined;
|
|
173
203
|
};
|
|
204
|
+
kind: "Identifier" | "Shacl";
|
|
174
205
|
};
|
|
175
|
-
toString(): string;
|
|
176
206
|
}
|
|
207
|
+
export type Field = IdentifierField | ShaclField;
|
|
208
|
+
export {};
|
|
177
209
|
}
|
|
178
210
|
//# sourceMappingURL=StructType.d.ts.map
|
package/dist/ast/StructType.js
CHANGED
|
@@ -5,6 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { PropertyPath } from "@rdfx/resource";
|
|
8
|
+
import { Maybe } from "purify-ts";
|
|
8
9
|
import { invariant } from "ts-invariant";
|
|
9
10
|
import { Memoize } from "typescript-memoize";
|
|
10
11
|
import { AbstractType } from "./AbstractType.js";
|
|
@@ -17,7 +18,6 @@ export class StructType extends AbstractType {
|
|
|
17
18
|
* Mutable to support cycle-handling logic in the compiler.
|
|
18
19
|
*/
|
|
19
20
|
#fields = [];
|
|
20
|
-
fieldNames = new Set();
|
|
21
21
|
/**
|
|
22
22
|
* If true, the code for this StructType is defined externally and should not be generated.
|
|
23
23
|
*
|
|
@@ -32,13 +32,16 @@ export class StructType extends AbstractType {
|
|
|
32
32
|
*/
|
|
33
33
|
fromRdfType;
|
|
34
34
|
/**
|
|
35
|
-
* Identifier type.
|
|
35
|
+
* Identifier type, derived from the node shape's node kinds.
|
|
36
36
|
*/
|
|
37
37
|
identifierType;
|
|
38
38
|
/**
|
|
39
39
|
* Type discriminant.
|
|
40
40
|
*/
|
|
41
41
|
kind = "Struct";
|
|
42
|
+
/**
|
|
43
|
+
* Fixed node kinds.
|
|
44
|
+
*/
|
|
42
45
|
nodeKinds = nodeKinds;
|
|
43
46
|
/**
|
|
44
47
|
* Was this type synthesized or did it come from SHACL?
|
|
@@ -72,16 +75,15 @@ export class StructType extends AbstractType {
|
|
|
72
75
|
get fields() {
|
|
73
76
|
return this.#fields;
|
|
74
77
|
}
|
|
78
|
+
get identifierField() {
|
|
79
|
+
return Maybe.fromNullable(this.fields.find((field) => field.kind === "Identifier"));
|
|
80
|
+
}
|
|
75
81
|
get recursive() {
|
|
76
82
|
return this.fields.some((field) => field.recursive);
|
|
77
83
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
invariant(!this.fieldNames.has(field.name), `${field.structType.shapeIdentifier}: duplicate field name: ${field.name}`);
|
|
82
|
-
this.#fields.push(field);
|
|
83
|
-
this.fieldNames.add(field.name);
|
|
84
|
-
}
|
|
84
|
+
addField(field) {
|
|
85
|
+
invariant(Object.is(field.structType, this), "field has unexpected .structType");
|
|
86
|
+
this.#fields.push(field);
|
|
85
87
|
}
|
|
86
88
|
equals(other) {
|
|
87
89
|
// Don't recurse
|
|
@@ -102,7 +104,6 @@ export class StructType extends AbstractType {
|
|
|
102
104
|
return {
|
|
103
105
|
...super.toJSON(),
|
|
104
106
|
fromRdfType: this.fromRdfType.extract(),
|
|
105
|
-
identifierType: this.identifierType.toJSON(),
|
|
106
107
|
synthetic: this.synthetic ? true : undefined,
|
|
107
108
|
toRdfTypes: this.toRdfTypes.length > 0 ? this.toRdfTypes : undefined,
|
|
108
109
|
};
|
|
@@ -110,7 +111,38 @@ export class StructType extends AbstractType {
|
|
|
110
111
|
}
|
|
111
112
|
const nodeKinds = new Set(["BlankNode", "IRI"]);
|
|
112
113
|
(function (StructType) {
|
|
113
|
-
class
|
|
114
|
+
class AbstractField {
|
|
115
|
+
/**
|
|
116
|
+
* StructType this field belongs to.
|
|
117
|
+
*/
|
|
118
|
+
structType;
|
|
119
|
+
constructor({ structType }) {
|
|
120
|
+
this.structType = structType;
|
|
121
|
+
}
|
|
122
|
+
toJSON() {
|
|
123
|
+
return {
|
|
124
|
+
kind: this.kind,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
toString() {
|
|
128
|
+
return JSON.stringify(this.toJSON());
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
class IdentifierField extends AbstractField {
|
|
132
|
+
kind = "Identifier";
|
|
133
|
+
order = 0;
|
|
134
|
+
recursive = false;
|
|
135
|
+
/**
|
|
136
|
+
* Identifier type.
|
|
137
|
+
*/
|
|
138
|
+
type;
|
|
139
|
+
constructor({ type, ...superParameters }) {
|
|
140
|
+
super(superParameters);
|
|
141
|
+
this.type = type;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
StructType.IdentifierField = IdentifierField;
|
|
145
|
+
class ShaclField extends AbstractField {
|
|
114
146
|
/**
|
|
115
147
|
* Documentation comment from rdfs:comment.
|
|
116
148
|
*/
|
|
@@ -123,10 +155,18 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
|
|
|
123
155
|
* Should the field and its value be displayed in a toString()-type representation?
|
|
124
156
|
*/
|
|
125
157
|
display;
|
|
158
|
+
/**
|
|
159
|
+
* Type discriminant.
|
|
160
|
+
*/
|
|
161
|
+
kind = "Shacl";
|
|
126
162
|
/**
|
|
127
163
|
* Human-readable label from rdfs:label.
|
|
128
164
|
*/
|
|
129
165
|
label;
|
|
166
|
+
/**
|
|
167
|
+
* Minimum cardinality of this field, derived from sh:minCount.
|
|
168
|
+
*/
|
|
169
|
+
minCount;
|
|
130
170
|
/**
|
|
131
171
|
* The field should be mutable in generated code i.e., it should be re-assignable. The field value may or may
|
|
132
172
|
* not be mutable.
|
|
@@ -148,22 +188,19 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
|
|
|
148
188
|
* Identifier of the field shape.
|
|
149
189
|
*/
|
|
150
190
|
shapeIdentifier;
|
|
151
|
-
/**
|
|
152
|
-
* StructType this field belongs to.
|
|
153
|
-
*/
|
|
154
|
-
structType;
|
|
155
191
|
/**
|
|
156
192
|
* Type of this field.
|
|
157
193
|
*/
|
|
158
194
|
type;
|
|
159
|
-
constructor({ comment, description, display, label, mutable, name, order, path, shapeIdentifier,
|
|
195
|
+
constructor({ comment, description, display, label, minCount, mutable, name, order, path, shapeIdentifier, type, ...superParameters }) {
|
|
196
|
+
super(superParameters);
|
|
160
197
|
this.comment = comment;
|
|
161
198
|
this.description = description;
|
|
162
199
|
this.display = display;
|
|
163
200
|
this.label = label;
|
|
201
|
+
this.minCount = minCount;
|
|
164
202
|
this.mutable = mutable;
|
|
165
203
|
this.name = name;
|
|
166
|
-
this.structType = structType;
|
|
167
204
|
this.order = order;
|
|
168
205
|
this.path = path;
|
|
169
206
|
this.shapeIdentifier = shapeIdentifier;
|
|
@@ -172,9 +209,6 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
|
|
|
172
209
|
equals(other) {
|
|
173
210
|
return this.shapeIdentifier.equals(other.shapeIdentifier);
|
|
174
211
|
}
|
|
175
|
-
/**
|
|
176
|
-
* Does the field directly or indirectly reference the StructType itself?
|
|
177
|
-
*/
|
|
178
212
|
get recursive() {
|
|
179
213
|
const DEBUG = false;
|
|
180
214
|
const rootField = this;
|
|
@@ -250,10 +284,11 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
|
|
|
250
284
|
process.stderr.write(`recurse into ${currentFieldType}`);
|
|
251
285
|
}
|
|
252
286
|
for (const field of currentFieldType.fields) {
|
|
253
|
-
if (
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
287
|
+
if (field.kind === "Shacl" &&
|
|
288
|
+
helper(stack.concat({
|
|
289
|
+
structType: currentFieldType,
|
|
290
|
+
field,
|
|
291
|
+
}))) {
|
|
257
292
|
return true;
|
|
258
293
|
}
|
|
259
294
|
}
|
|
@@ -290,6 +325,7 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
|
|
|
290
325
|
}
|
|
291
326
|
toJSON() {
|
|
292
327
|
return {
|
|
328
|
+
...super.toJSON(),
|
|
293
329
|
comment: this.comment.extract(),
|
|
294
330
|
description: this.description.extract(),
|
|
295
331
|
label: this.label.extract(),
|
|
@@ -302,13 +338,10 @@ const nodeKinds = new Set(["BlankNode", "IRI"]);
|
|
|
302
338
|
type: this.type.toJSON(),
|
|
303
339
|
};
|
|
304
340
|
}
|
|
305
|
-
toString() {
|
|
306
|
-
return JSON.stringify(this.toJSON());
|
|
307
|
-
}
|
|
308
341
|
}
|
|
309
342
|
__decorate([
|
|
310
343
|
Memoize()
|
|
311
|
-
],
|
|
312
|
-
StructType.
|
|
344
|
+
], ShaclField.prototype, "recursive", null);
|
|
345
|
+
StructType.ShaclField = ShaclField;
|
|
313
346
|
})(StructType || (StructType = {}));
|
|
314
347
|
//# sourceMappingURL=StructType.js.map
|
package/dist/ast/index.d.ts
CHANGED
|
@@ -10,7 +10,9 @@ export * from "./LazySetType.js";
|
|
|
10
10
|
export * from "./LazyType.js";
|
|
11
11
|
export * from "./ListType.js";
|
|
12
12
|
export * from "./LiteralType.js";
|
|
13
|
+
export * from "./Operation.js";
|
|
13
14
|
export * from "./OptionType.js";
|
|
15
|
+
export * from "./Service.js";
|
|
14
16
|
export * from "./SetType.js";
|
|
15
17
|
export * from "./StructCompoundType.js";
|
|
16
18
|
export * from "./StructDiscriminatedUnionType.js";
|
package/dist/ast/index.js
CHANGED
|
@@ -10,7 +10,9 @@ export * from "./LazySetType.js";
|
|
|
10
10
|
export * from "./LazyType.js";
|
|
11
11
|
export * from "./ListType.js";
|
|
12
12
|
export * from "./LiteralType.js";
|
|
13
|
+
export * from "./Operation.js";
|
|
13
14
|
export * from "./OptionType.js";
|
|
15
|
+
export * from "./Service.js";
|
|
14
16
|
export * from "./SetType.js";
|
|
15
17
|
export * from "./StructCompoundType.js";
|
|
16
18
|
export * from "./StructDiscriminatedUnionType.js";
|
|
@@ -9,24 +9,27 @@ export function transformAstToLabeledPropertyGraph(ast) {
|
|
|
9
9
|
const properties = {
|
|
10
10
|
name: { type: "string", value: typeName(namedType) },
|
|
11
11
|
};
|
|
12
|
-
for (const
|
|
12
|
+
for (const namedStructTypeField of namedStructType.fields) {
|
|
13
|
+
if (namedStructTypeField.kind !== "Shacl") {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
13
16
|
let itemType;
|
|
14
|
-
switch (
|
|
17
|
+
switch (namedStructTypeField.type.kind) {
|
|
15
18
|
case "DefaultValue":
|
|
16
19
|
case "List":
|
|
17
20
|
case "Option":
|
|
18
21
|
case "Set":
|
|
19
|
-
itemType =
|
|
22
|
+
itemType = namedStructTypeField.type.itemType;
|
|
20
23
|
break;
|
|
21
24
|
case "Lazy":
|
|
22
|
-
itemType =
|
|
25
|
+
itemType = namedStructTypeField.type.resolveType;
|
|
23
26
|
break;
|
|
24
27
|
case "LazyOption":
|
|
25
28
|
case "LazySet":
|
|
26
|
-
itemType =
|
|
29
|
+
itemType = namedStructTypeField.type.resolveType.itemType;
|
|
27
30
|
break;
|
|
28
31
|
default:
|
|
29
|
-
itemType =
|
|
32
|
+
itemType = namedStructTypeField.type;
|
|
30
33
|
break;
|
|
31
34
|
}
|
|
32
35
|
switch (itemType.kind) {
|
|
@@ -35,8 +38,8 @@ export function transformAstToLabeledPropertyGraph(ast) {
|
|
|
35
38
|
case "DiscriminatedUnion":
|
|
36
39
|
if (itemType.name.isJust()) {
|
|
37
40
|
relationships.push({
|
|
38
|
-
id:
|
|
39
|
-
label: Maybe.of(
|
|
41
|
+
id: namedStructTypeField.shapeIdentifier.toString(),
|
|
42
|
+
label: Maybe.of(namedStructTypeField.name),
|
|
40
43
|
properties: {},
|
|
41
44
|
sourceNodeId: id,
|
|
42
45
|
targetNodeId: typeId(itemType),
|
|
@@ -44,9 +47,9 @@ export function transformAstToLabeledPropertyGraph(ast) {
|
|
|
44
47
|
}
|
|
45
48
|
break;
|
|
46
49
|
default:
|
|
47
|
-
properties[
|
|
50
|
+
properties[namedStructTypeField.name] = {
|
|
48
51
|
type: "string",
|
|
49
|
-
value:
|
|
52
|
+
value: namedStructTypeField.toString(),
|
|
50
53
|
};
|
|
51
54
|
}
|
|
52
55
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Code } from "./ts-poet-wrapper.js";
|
|
2
|
+
/**
|
|
3
|
+
* Abstract base class for callables.
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class AbstractCallable {
|
|
6
|
+
/**
|
|
7
|
+
* Code to use this callable as a callee or reference it (in composition for example).
|
|
8
|
+
*
|
|
9
|
+
* If the callable has an optional type annotation, it will be included in the returned code.
|
|
10
|
+
*/
|
|
11
|
+
abstract readonly annotatedUsage: Code;
|
|
12
|
+
/**
|
|
13
|
+
* Code to use this callable as a callee or reference it (in composition, for example).
|
|
14
|
+
*
|
|
15
|
+
* If the callable has an optional type annotation, it won't be included in the returned code.
|
|
16
|
+
*/
|
|
17
|
+
abstract readonly unannotatedUsage: Code;
|
|
18
|
+
toString(): string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=AbstractCallable.d.ts.map
|
|
@@ -1,37 +1,35 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { AbstractContainerType } from "./AbstractContainerType.js";
|
|
3
|
+
import type { Callable } from "./Callable.js";
|
|
3
4
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
4
5
|
/**
|
|
5
6
|
* Abstract base class for ListType and SetType.
|
|
6
7
|
*/
|
|
7
8
|
export declare abstract class AbstractCollectionType<ItemTypeT extends AbstractCollectionType.ItemType> extends AbstractContainerType<ItemTypeT> {
|
|
8
9
|
protected readonly _mutable: boolean;
|
|
9
|
-
readonly discriminantProperty: Maybe<AbstractContainerType.DiscriminantProperty>;
|
|
10
10
|
readonly graphqlArgs: AbstractContainerType<ItemTypeT>["graphqlArgs"];
|
|
11
11
|
constructor({ mutable, ...superParameters }: {
|
|
12
12
|
mutable: boolean;
|
|
13
13
|
} & ConstructorParameters<typeof AbstractContainerType<ItemTypeT>>[0]);
|
|
14
|
-
get equalsFunction():
|
|
15
|
-
get filterFunction():
|
|
14
|
+
get equalsFunction(): Callable;
|
|
15
|
+
get filterFunction(): Callable;
|
|
16
16
|
get filterType(): Code;
|
|
17
17
|
get graphqlType(): AbstractContainerType.GraphqlType;
|
|
18
|
-
get hashFunction():
|
|
18
|
+
get hashFunction(): Callable;
|
|
19
19
|
get mutable(): boolean;
|
|
20
20
|
get schemaType(): Code;
|
|
21
|
-
get validationFunction(): Maybe<
|
|
21
|
+
get validationFunction(): Maybe<Callable>;
|
|
22
22
|
protected get inlineExpression(): Code;
|
|
23
23
|
graphqlResolveExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["graphqlResolveExpression"]>[0]): Code;
|
|
24
|
-
|
|
25
|
-
toJsonExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["toJsonExpression"]>[0]): Code;
|
|
24
|
+
toLoggableExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["toLoggableExpression"]>[0]): Code;
|
|
26
25
|
}
|
|
27
26
|
export declare namespace AbstractCollectionType {
|
|
28
27
|
type ConversionFunction = AbstractContainerType.ConversionFunction;
|
|
29
|
-
type
|
|
28
|
+
type DiscriminatedType = AbstractContainerType.DiscriminatedType;
|
|
30
29
|
const GraphqlType: typeof import("./_AbstractType/AbstractType_GraphqlType.js").AbstractType_GraphqlType;
|
|
31
30
|
type GraphqlType = AbstractContainerType.GraphqlType;
|
|
32
31
|
const isItemType: typeof AbstractContainerType.isItemType;
|
|
33
32
|
type ItemType = AbstractContainerType.ItemType;
|
|
34
|
-
const JsonType: typeof import("./_AbstractType/AbstractType_JsonType.js").AbstractType_JsonType;
|
|
35
33
|
type JsonType = AbstractContainerType.JsonType;
|
|
36
34
|
}
|
|
37
35
|
//# sourceMappingURL=AbstractCollectionType.d.ts.map
|
|
@@ -7,23 +7,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { Maybe } from "purify-ts";
|
|
8
8
|
import { Memoize } from "typescript-memoize";
|
|
9
9
|
import { AbstractContainerType } from "./AbstractContainerType.js";
|
|
10
|
+
import { InlineCallable } from "./InlineCallable.js";
|
|
10
11
|
import { code } from "./ts-poet-wrapper.js";
|
|
11
12
|
/**
|
|
12
13
|
* Abstract base class for ListType and SetType.
|
|
13
14
|
*/
|
|
14
15
|
export class AbstractCollectionType extends AbstractContainerType {
|
|
15
16
|
_mutable;
|
|
16
|
-
discriminantProperty = Maybe.empty();
|
|
17
17
|
graphqlArgs = Maybe.empty();
|
|
18
18
|
constructor({ mutable, ...superParameters }) {
|
|
19
19
|
super(superParameters);
|
|
20
20
|
this._mutable = mutable;
|
|
21
21
|
}
|
|
22
22
|
get equalsFunction() {
|
|
23
|
-
return code `((left, right) => ${this.reusables.snippets.arrayEquals}(left, right, ${this.itemType.equalsFunction}))
|
|
23
|
+
return new InlineCallable(code `((left, right) => ${this.reusables.snippets.arrayEquals}(left, right, ${this.itemType.equalsFunction.unannotatedUsage}))`, {
|
|
24
|
+
type: code `${this.reusables.snippets.EqualsFunction}<${this.expression}>`,
|
|
25
|
+
});
|
|
24
26
|
}
|
|
25
27
|
get filterFunction() {
|
|
26
|
-
return code `${this.reusables.snippets.filterArray}<${this.itemType.expression}, ${this.itemType.filterType}>(${this.itemType.filterFunction})
|
|
28
|
+
return new InlineCallable(code `${this.reusables.snippets.filterArray}<${this.itemType.expression}, ${this.itemType.filterType}>(${this.itemType.filterFunction.unannotatedUsage})`);
|
|
27
29
|
}
|
|
28
30
|
get filterType() {
|
|
29
31
|
return code `${this.reusables.snippets.CollectionFilter}<${this.itemType.filterType}>`;
|
|
@@ -32,7 +34,7 @@ export class AbstractCollectionType extends AbstractContainerType {
|
|
|
32
34
|
return new AbstractContainerType.GraphqlType(code `new ${this.reusables.imports.GraphQLList}(${this.itemType.graphqlType.expression})`, this.reusables);
|
|
33
35
|
}
|
|
34
36
|
get hashFunction() {
|
|
35
|
-
return code `${this.reusables.snippets.hashArray}(${this.itemType.hashFunction})
|
|
37
|
+
return new InlineCallable(code `${this.reusables.snippets.hashArray}(${this.itemType.hashFunction.annotatedUsage})`);
|
|
36
38
|
}
|
|
37
39
|
get mutable() {
|
|
38
40
|
return this._mutable || this.itemType.mutable;
|
|
@@ -41,7 +43,9 @@ export class AbstractCollectionType extends AbstractContainerType {
|
|
|
41
43
|
return code `${this.reusables.snippets.CollectionSchema}<${this.itemType.schemaType}>`;
|
|
42
44
|
}
|
|
43
45
|
get validationFunction() {
|
|
44
|
-
return Maybe.of(code `${this._mutable ? this.reusables.snippets.validateMutableArray : this.reusables.snippets.validateArray}(${this.itemType.validationFunction
|
|
46
|
+
return Maybe.of(new InlineCallable(code `${this._mutable ? this.reusables.snippets.validateMutableArray : this.reusables.snippets.validateArray}(${this.itemType.validationFunction
|
|
47
|
+
.map((_) => _.unannotatedUsage)
|
|
48
|
+
.orDefault(this.itemValidationFunctionDefault.unannotatedUsage)})`));
|
|
45
49
|
}
|
|
46
50
|
get inlineExpression() {
|
|
47
51
|
return code `${!this._mutable ? "readonly " : ""}(${this.itemType.expression})[]`;
|
|
@@ -49,11 +53,8 @@ export class AbstractCollectionType extends AbstractContainerType {
|
|
|
49
53
|
graphqlResolveExpression({ variables, }) {
|
|
50
54
|
return variables.value;
|
|
51
55
|
}
|
|
52
|
-
|
|
53
|
-
return this.itemType.
|
|
54
|
-
}
|
|
55
|
-
toJsonExpression({ variables, }) {
|
|
56
|
-
return code `${variables.value}.map(item => (${this.itemType.toJsonExpression({ variables: { value: code `item` } })}))`;
|
|
56
|
+
toLoggableExpression({ variables, }) {
|
|
57
|
+
return code `${variables.value}.map(item => (${this.itemType.toLoggableExpression({ variables: { value: code `item` } })}))`;
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
__decorate([
|
|
@@ -83,6 +84,5 @@ __decorate([
|
|
|
83
84
|
(function (AbstractCollectionType) {
|
|
84
85
|
AbstractCollectionType.GraphqlType = AbstractContainerType.GraphqlType;
|
|
85
86
|
AbstractCollectionType.isItemType = AbstractContainerType.isItemType;
|
|
86
|
-
AbstractCollectionType.JsonType = AbstractContainerType.JsonType;
|
|
87
87
|
})(AbstractCollectionType || (AbstractCollectionType = {}));
|
|
88
88
|
//# sourceMappingURL=AbstractCollectionType.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AbstractStructuredType } from "./AbstractStructuredType.js";
|
|
2
|
+
import type { Type } from "./Type.js";
|
|
3
|
+
export declare abstract class AbstractCompoundType<MemberT extends {
|
|
4
|
+
type: MemberTypeT;
|
|
5
|
+
}, MemberTypeT extends Type> extends AbstractStructuredType {
|
|
6
|
+
abstract readonly members: readonly MemberT[];
|
|
7
|
+
get mutable(): boolean;
|
|
8
|
+
get referencesNamedType(): boolean;
|
|
9
|
+
get toRdfResourceValueTypes(): AbstractStructuredType["toRdfResourceValueTypes"];
|
|
10
|
+
}
|
|
11
|
+
export declare namespace AbstractCompoundType {
|
|
12
|
+
type ConversionFunction = AbstractStructuredType.ConversionFunction;
|
|
13
|
+
type DiscriminatedType = AbstractStructuredType.DiscriminatedType;
|
|
14
|
+
type GraphqlType = AbstractStructuredType.GraphqlType;
|
|
15
|
+
type JsonType = AbstractStructuredType.JsonType;
|
|
16
|
+
type JsType = AbstractStructuredType.JsType;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=AbstractCompoundType.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { Memoize } from "typescript-memoize";
|
|
8
|
+
import { AbstractStructuredType } from "./AbstractStructuredType.js";
|
|
9
|
+
export class AbstractCompoundType extends AbstractStructuredType {
|
|
10
|
+
get mutable() {
|
|
11
|
+
return this.members.some((member) => member.type.mutable);
|
|
12
|
+
}
|
|
13
|
+
get referencesNamedType() {
|
|
14
|
+
return (this.name.isJust() ||
|
|
15
|
+
this.members.some((member) => member.type.referencesNamedType));
|
|
16
|
+
}
|
|
17
|
+
get toRdfResourceValueTypes() {
|
|
18
|
+
const set = new Set();
|
|
19
|
+
for (const member of this.members) {
|
|
20
|
+
for (const value of member.type.toRdfResourceValueTypes) {
|
|
21
|
+
set.add(value);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return set;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
__decorate([
|
|
28
|
+
Memoize()
|
|
29
|
+
], AbstractCompoundType.prototype, "mutable", null);
|
|
30
|
+
__decorate([
|
|
31
|
+
Memoize()
|
|
32
|
+
], AbstractCompoundType.prototype, "toRdfResourceValueTypes", null);
|
|
33
|
+
//# sourceMappingURL=AbstractCompoundType.js.map
|