@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/Eithers.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Either } from "purify-ts";
|
|
2
2
|
export declare namespace Eithers {
|
|
3
|
+
function chainMap<OldT, NewT>(oldValues: readonly OldT[], callback: (value: OldT, index: number) => Either<Error, NewT>): Either<Error, readonly NewT[]>;
|
|
3
4
|
function chain2<R1, R2>(either1: Either<Error, R1>, either2: Either<Error, R2>): Either<Error, [R1, R2]>;
|
|
4
5
|
function chain3<R1, R2, R3>(either1: Either<Error, R1>, either2: Either<Error, R2>, either3: Either<Error, R3>): Either<Error, [R1, R2, R3]>;
|
|
5
6
|
function chain4<R1, R2, R3, R4>(either1: Either<Error, R1>, either2: Either<Error, R2>, either3: Either<Error, R3>, either4: Either<Error, R4>): Either<Error, [R1, R2, R3, R4]>;
|
package/dist/Eithers.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
import { Either } from "purify-ts";
|
|
1
2
|
export var Eithers;
|
|
2
3
|
(function (Eithers) {
|
|
4
|
+
function chainMap(oldValues, callback) {
|
|
5
|
+
const newValues = [];
|
|
6
|
+
let valueI = 0;
|
|
7
|
+
for (const oldValue of oldValues) {
|
|
8
|
+
const callbackResult = callback(oldValue, valueI);
|
|
9
|
+
if (callbackResult.isLeft()) {
|
|
10
|
+
return callbackResult;
|
|
11
|
+
}
|
|
12
|
+
newValues.push(callbackResult.extract());
|
|
13
|
+
valueI++;
|
|
14
|
+
}
|
|
15
|
+
return Either.of(newValues);
|
|
16
|
+
}
|
|
17
|
+
Eithers.chainMap = chainMap;
|
|
3
18
|
function chain2(either1, either2) {
|
|
4
19
|
return either1.chain((r1) => either2.map((r2) => [r1, r2]));
|
|
5
20
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TermMap } from "@rdfx/collection";
|
|
2
2
|
import { Either } from "purify-ts";
|
|
3
3
|
import { ShapeStack } from "./_ShapesGraphToAstTransformer/ShapeStack.js";
|
|
4
|
+
// import { transformService } from "./_ShapesGraphToAstTransformer/transformService.js";
|
|
4
5
|
import { transformShapeToAstType } from "./_ShapesGraphToAstTransformer/transformShapeToAstType.js";
|
|
5
6
|
export class ShapesGraphToAstTransformer {
|
|
6
7
|
// Members are protected so they're accessible to functions in other files
|
|
@@ -30,6 +31,14 @@ export class ShapesGraphToAstTransformer {
|
|
|
30
31
|
astNamedTypes.push(nodeShapeAstType);
|
|
31
32
|
});
|
|
32
33
|
}
|
|
34
|
+
const astServices = [];
|
|
35
|
+
// for (const inputService of this.shapesGraph.services) {
|
|
36
|
+
// const astServiceEither = transformService.call(this, inputService);
|
|
37
|
+
// if (astServiceEither.isLeft()) {
|
|
38
|
+
// return astServiceEither;
|
|
39
|
+
// }
|
|
40
|
+
// astServices.push(astServiceEither.extract() as ast.Service);
|
|
41
|
+
// }
|
|
33
42
|
return Either.of({
|
|
34
43
|
lazyTypesCount: [...this.cachedAstTypesByShapeIdentifier.values()].reduce((acc, astType) => {
|
|
35
44
|
switch (astType.kind) {
|
|
@@ -42,6 +51,7 @@ export class ShapesGraphToAstTransformer {
|
|
|
42
51
|
}
|
|
43
52
|
}, 0),
|
|
44
53
|
namedTypes: astNamedTypes.concat(this.syntheticAstStructTypes),
|
|
54
|
+
services: astServices,
|
|
45
55
|
});
|
|
46
56
|
}
|
|
47
57
|
}
|
|
@@ -9,7 +9,7 @@ export declare class ShapeStack {
|
|
|
9
9
|
readonly in_: readonly (Literal | NamedNode)[];
|
|
10
10
|
};
|
|
11
11
|
get defaultValue(): Maybe<Literal | NamedNode>;
|
|
12
|
-
pop(shape: input.
|
|
13
|
-
push(shape: input.
|
|
12
|
+
pop(shape: input.UndiscriminatedShape): this;
|
|
13
|
+
push(shape: input.UndiscriminatedShape): this;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=ShapeStack.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { invariant } from "ts-invariant";
|
|
3
|
+
import { isPropertyShape } from "./isPropertyShape.js";
|
|
3
4
|
export class ShapeStack {
|
|
4
5
|
stack = [];
|
|
5
6
|
constructor() {
|
|
@@ -27,7 +28,7 @@ export class ShapeStack {
|
|
|
27
28
|
constraints;
|
|
28
29
|
get defaultValue() {
|
|
29
30
|
for (const shape of this.stack.toReversed()) {
|
|
30
|
-
if (shape
|
|
31
|
+
if (!isPropertyShape(shape)) {
|
|
31
32
|
continue;
|
|
32
33
|
}
|
|
33
34
|
if (shape.defaultValue.isJust()) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import type * as input from "../input/index.js";
|
|
3
|
-
|
|
3
|
+
import type { ShapesGraphToAstTransformer } from "../ShapesGraphToAstTransformer.js";
|
|
4
|
+
export declare function shapeAstTypeName(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape): Maybe<string>;
|
|
4
5
|
//# sourceMappingURL=shapeAstTypeName.d.ts.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Curie } from "@
|
|
1
|
+
import { Curie } from "@rdfx/curie";
|
|
2
2
|
import { Maybe } from "purify-ts";
|
|
3
|
+
import { isNodeShape } from "./isNodeShape.js";
|
|
3
4
|
export function shapeAstTypeName(shape) {
|
|
4
|
-
if (shape
|
|
5
|
+
if (!isNodeShape(shape)) {
|
|
5
6
|
return Maybe.empty();
|
|
6
7
|
}
|
|
7
8
|
const shapeIdentifier = shape.$identifier();
|
|
@@ -14,7 +15,7 @@ export function shapeAstTypeName(shape) {
|
|
|
14
15
|
}
|
|
15
16
|
// CURIE shape identifier
|
|
16
17
|
if (shapeIdentifier instanceof Curie) {
|
|
17
|
-
if (shapeIdentifier.
|
|
18
|
+
if (this.shapesGraph.uniqueCurieReferences.has(shapeIdentifier.reference)) {
|
|
18
19
|
return Maybe.of(shapeIdentifier.reference);
|
|
19
20
|
}
|
|
20
21
|
return Maybe.of(`${shapeIdentifier.prefix}_${shapeIdentifier.reference}`);
|
|
@@ -2,7 +2,7 @@ import { NodeKind } from "@shaclmate/shacl-ast";
|
|
|
2
2
|
import { Either } from "purify-ts";
|
|
3
3
|
import type * as input from "../input/index.js";
|
|
4
4
|
import type { ShapesGraphToAstTransformer } from "../ShapesGraphToAstTransformer.js";
|
|
5
|
-
export declare function shapeNodeKinds(this: ShapesGraphToAstTransformer, shape: input.
|
|
5
|
+
export declare function shapeNodeKinds(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape, options?: {
|
|
6
6
|
defaultNodeShapeNodeKinds: ReadonlySet<NodeKind>;
|
|
7
7
|
defaultPropertyShapeNodeKinds?: ReadonlySet<NodeKind>;
|
|
8
8
|
}): Either<Error, ReadonlySet<NodeKind>>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { NodeKind } from "@shaclmate/shacl-ast";
|
|
2
2
|
import { Either, Left, Maybe } from "purify-ts";
|
|
3
|
+
import { invariant } from "ts-invariant";
|
|
3
4
|
import { defaultNodeShapeNodeKinds } from "./defaultNodeShapeNodeKinds.js";
|
|
5
|
+
import { isNodeShape } from "./isNodeShape.js";
|
|
6
|
+
import { isPropertyShape } from "./isPropertyShape.js";
|
|
4
7
|
const defaultPropertyShapeNodeKinds = new Set([
|
|
5
8
|
"BlankNode",
|
|
6
9
|
"IRI",
|
|
@@ -31,7 +34,7 @@ export function shapeNodeKinds(shape, options) {
|
|
|
31
34
|
[
|
|
32
35
|
"sh:defaultValue",
|
|
33
36
|
{
|
|
34
|
-
includeNodeKinds: shape
|
|
37
|
+
includeNodeKinds: isPropertyShape(shape)
|
|
35
38
|
? shape.defaultValue
|
|
36
39
|
.map((value) => NodeKind.fromTermType(value.termType))
|
|
37
40
|
.toList()
|
|
@@ -103,7 +106,7 @@ export function shapeNodeKinds(shape, options) {
|
|
|
103
106
|
[
|
|
104
107
|
"shaclmate:resolve",
|
|
105
108
|
{
|
|
106
|
-
includeNodeKinds: (shape
|
|
109
|
+
includeNodeKinds: (isPropertyShape(shape)
|
|
107
110
|
? shape.resolve
|
|
108
111
|
: Maybe.empty())
|
|
109
112
|
.chain((resolve) => this.shapesGraph.nodeShape(resolve).toMaybe())
|
|
@@ -160,9 +163,10 @@ export function shapeNodeKinds(shape, options) {
|
|
|
160
163
|
if (constraintNodeKinds.size > 0) {
|
|
161
164
|
return Either.of(constraintNodeKinds);
|
|
162
165
|
}
|
|
163
|
-
if (shape
|
|
166
|
+
if (isNodeShape(shape)) {
|
|
164
167
|
return Either.of(options?.defaultNodeShapeNodeKinds ?? defaultNodeShapeNodeKinds);
|
|
165
168
|
}
|
|
169
|
+
invariant(isPropertyShape(shape));
|
|
166
170
|
if (shape.path.termType === "InversePath") {
|
|
167
171
|
// Inverse paths can only have blank nodes and IRIs as values, because the value is the subject of a triple.
|
|
168
172
|
return Either.of(new Set(["BlankNode", "IRI"]));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Either, Maybe } from "purify-ts";
|
|
2
2
|
import type * as input from "../input/index.js";
|
|
3
3
|
import type { ShapesGraphToAstTransformer } from "../ShapesGraphToAstTransformer.js";
|
|
4
|
-
export declare function shapeOntology(this: ShapesGraphToAstTransformer, shape: input.
|
|
4
|
+
export declare function shapeOntology(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape): Either<Error, Maybe<input.Ontology>>;
|
|
5
5
|
//# sourceMappingURL=shapeOntology.d.ts.map
|
|
@@ -13,5 +13,5 @@ import type { ShapesGraphToAstTransformer } from "../ShapesGraphToAstTransformer
|
|
|
13
13
|
export declare function transformPropertyShapeToAstStructTypeField(this: ShapesGraphToAstTransformer, { propertyShape, structType, }: {
|
|
14
14
|
propertyShape: input.PropertyShape;
|
|
15
15
|
structType: ast.StructType;
|
|
16
|
-
}): Either<Error, Maybe<ast.StructType.
|
|
16
|
+
}): Either<Error, Maybe<ast.StructType.ShaclField>>;
|
|
17
17
|
//# sourceMappingURL=transformPropertyShapeToAstStructTypeField.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Curie } from "@rdfx/curie";
|
|
1
2
|
import dataFactory from "@rdfx/data-factory";
|
|
2
|
-
import { Curie } from "@shaclmate/shacl-ast";
|
|
3
3
|
import { sh } from "@tpluscode/rdf-ns-builders";
|
|
4
4
|
import { Either, Left, Maybe } from "purify-ts";
|
|
5
5
|
import { invariant } from "ts-invariant";
|
|
@@ -48,11 +48,23 @@ function fieldName(propertyShape, structType) {
|
|
|
48
48
|
}
|
|
49
49
|
throw new Error(`${propertyShape}: unable to infer name`);
|
|
50
50
|
}
|
|
51
|
+
function propertyCardinality(propertyShape) {
|
|
52
|
+
let maxCount = propertyShape.maxCount.orDefault(BigInt(Number.MAX_SAFE_INTEGER));
|
|
53
|
+
let minCount = propertyShape.minCount.orDefault(0n);
|
|
54
|
+
if (minCount < 0n) {
|
|
55
|
+
minCount = 0n;
|
|
56
|
+
}
|
|
57
|
+
if (propertyShape.hasValues.length > minCount) {
|
|
58
|
+
minCount = BigInt(propertyShape.hasValues.length);
|
|
59
|
+
}
|
|
60
|
+
if (maxCount < minCount) {
|
|
61
|
+
maxCount = minCount;
|
|
62
|
+
}
|
|
63
|
+
return { maxCount, minCount };
|
|
64
|
+
}
|
|
51
65
|
function synthesizePartialAstStructType({ identifierType, }) {
|
|
52
66
|
let syntheticName;
|
|
53
67
|
switch (identifierType.kind) {
|
|
54
|
-
case "BlankNode":
|
|
55
|
-
throw new Error("should never happen");
|
|
56
68
|
case "Identifier":
|
|
57
69
|
syntheticName = "DefaultPartial";
|
|
58
70
|
break;
|
|
@@ -77,6 +89,10 @@ function synthesizePartialAstStructType({ identifierType, }) {
|
|
|
77
89
|
toRdfTypes: [],
|
|
78
90
|
tsImports: [],
|
|
79
91
|
});
|
|
92
|
+
partialAstStructType.addField(new ast.StructType.IdentifierField({
|
|
93
|
+
structType: partialAstStructType,
|
|
94
|
+
type: identifierType,
|
|
95
|
+
}));
|
|
80
96
|
this.syntheticAstStructTypes.push(partialAstStructType);
|
|
81
97
|
return partialAstStructType;
|
|
82
98
|
}
|
|
@@ -89,17 +105,7 @@ function transformPropertyShapeToAstType(propertyShape, shapeStack) {
|
|
|
89
105
|
return transformShapeToAstType
|
|
90
106
|
.call(this, propertyShape, shapeStack)
|
|
91
107
|
.chain((propertyShapeAstType) => {
|
|
92
|
-
|
|
93
|
-
let minCount = propertyShape.minCount.orDefault(0n);
|
|
94
|
-
if (minCount < 0n) {
|
|
95
|
-
minCount = 0n;
|
|
96
|
-
}
|
|
97
|
-
if (propertyShape.hasValues.length > minCount) {
|
|
98
|
-
minCount = BigInt(propertyShape.hasValues.length);
|
|
99
|
-
}
|
|
100
|
-
if (maxCount < minCount) {
|
|
101
|
-
maxCount = minCount;
|
|
102
|
-
}
|
|
108
|
+
const { maxCount, minCount } = propertyCardinality(propertyShape);
|
|
103
109
|
if (propertyShapeAstType.kind === "DefaultValue") {
|
|
104
110
|
if (minCount > 0n) {
|
|
105
111
|
return Left(new Error(`${propertyShape}: has sh:minCount > 0 and sh:defaultValue`));
|
|
@@ -197,7 +203,6 @@ export function transformPropertyShapeToAstStructTypeField({ propertyShape, stru
|
|
|
197
203
|
}
|
|
198
204
|
let astPartialItemType;
|
|
199
205
|
switch (astItemType.kind) {
|
|
200
|
-
case "BlankNode":
|
|
201
206
|
case "Identifier":
|
|
202
207
|
case "Iri":
|
|
203
208
|
astPartialItemType = synthesizePartialAstStructType.call(this, {
|
|
@@ -216,6 +221,18 @@ export function transformPropertyShapeToAstStructTypeField({ propertyShape, stru
|
|
|
216
221
|
default:
|
|
217
222
|
return Left(new Error(`${propertyShape} has a resolve with an incompatible partial type ${astItemType.kind}`));
|
|
218
223
|
}
|
|
224
|
+
const astPartialItemIdentifierType = astPartialItemType.kind === "Struct"
|
|
225
|
+
? astPartialItemType.identifierType
|
|
226
|
+
: ast.StructCompoundType.identifierType(astPartialItemType);
|
|
227
|
+
const astResolveItemIdentifierType = astResolveItemType.kind === "Struct"
|
|
228
|
+
? astResolveItemType.identifierType
|
|
229
|
+
: ast.StructCompoundType.identifierType(astResolveItemType);
|
|
230
|
+
if (astPartialItemIdentifierType.kind !== astResolveItemIdentifierType.kind) {
|
|
231
|
+
return Left(new Error(`${propertyShape} has a resolve with a different identifier type (${astResolveItemIdentifierType.kind}) than the partial's identifier type (${astPartialItemIdentifierType.kind})`));
|
|
232
|
+
}
|
|
233
|
+
if (astPartialItemIdentifierType.kind === "BlankNode") {
|
|
234
|
+
return Left(new Error(`${propertyShape} has a ${astPartialItemIdentifierType.kind} identifier type, which is incompatible with shaclmate:resolve`));
|
|
235
|
+
}
|
|
219
236
|
const astAbstractTypeProperties = {
|
|
220
237
|
comment: Maybe.empty(),
|
|
221
238
|
label: Maybe.empty(),
|
|
@@ -268,11 +285,12 @@ export function transformPropertyShapeToAstStructTypeField({ propertyShape, stru
|
|
|
268
285
|
astType.nodeKinds.has("Literal")) {
|
|
269
286
|
return Left(new Error(`${propertyShape}: property shapes with inverse paths can only have blank node or IRI node kinds`));
|
|
270
287
|
}
|
|
271
|
-
return Either.of(Maybe.of(new ast.StructType.
|
|
288
|
+
return Either.of(Maybe.of(new ast.StructType.ShaclField({
|
|
272
289
|
comment: propertyShape.comment,
|
|
273
290
|
description: propertyShape.description,
|
|
274
291
|
display: propertyShape.display,
|
|
275
292
|
label: propertyShape.label,
|
|
293
|
+
minCount: propertyCardinality(propertyShape).minCount,
|
|
276
294
|
mutable: propertyShape.mutable.orDefault(false),
|
|
277
295
|
name: fieldName.call(this, propertyShape, structType),
|
|
278
296
|
order: propertyShape.order.orDefault(0),
|
|
@@ -6,5 +6,5 @@ import type { ShapeStack } from "./ShapeStack.js";
|
|
|
6
6
|
/**
|
|
7
7
|
* Try to convert a shape to a compound type (intersection or union) using some heuristics.
|
|
8
8
|
*/
|
|
9
|
-
export declare function transformShapeToAstCompoundType(this: ShapesGraphToAstTransformer, shape: input.
|
|
9
|
+
export declare function transformShapeToAstCompoundType(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape, shapeStack: ShapeStack): Either<Error, Maybe<ast.Type>>;
|
|
10
10
|
//# sourceMappingURL=transformShapeToAstCompoundType.d.ts.map
|
|
@@ -2,6 +2,7 @@ import { Either, Left, Maybe } from "purify-ts";
|
|
|
2
2
|
import { invariant } from "ts-invariant";
|
|
3
3
|
import * as ast from "../ast/index.js";
|
|
4
4
|
import { Eithers } from "../Eithers.js";
|
|
5
|
+
import { isNodeShape } from "./isNodeShape.js";
|
|
5
6
|
import { shapeAstTypeName } from "./shapeAstTypeName.js";
|
|
6
7
|
import { transformShapeToAstType } from "./transformShapeToAstType.js";
|
|
7
8
|
/**
|
|
@@ -37,7 +38,7 @@ export function transformShapeToAstCompoundType(shape, shapeStack) {
|
|
|
37
38
|
: ast.DiscriminatedUnionType)({
|
|
38
39
|
comment: shape.comment,
|
|
39
40
|
label: shape.label,
|
|
40
|
-
name: shapeAstTypeName(shape),
|
|
41
|
+
name: shapeAstTypeName.call(this, shape),
|
|
41
42
|
shapeIdentifier: shape.$identifier(),
|
|
42
43
|
synthetic: false,
|
|
43
44
|
});
|
|
@@ -62,7 +63,7 @@ export function transformShapeToAstCompoundType(shape, shapeStack) {
|
|
|
62
63
|
}
|
|
63
64
|
let memberDiscriminantValue;
|
|
64
65
|
if (compoundTypeKind === "DiscriminatedUnion") {
|
|
65
|
-
if (memberShape
|
|
66
|
+
if (isNodeShape(memberShape)) {
|
|
66
67
|
memberDiscriminantValue =
|
|
67
68
|
memberShape.discriminantValue.extract();
|
|
68
69
|
}
|
|
@@ -7,5 +7,5 @@ import type { ShapeStack } from "./ShapeStack.js";
|
|
|
7
7
|
* Is an ast.StructType actually the shape of an RDF list?
|
|
8
8
|
* If so, return the type of its rdf:first.
|
|
9
9
|
*/
|
|
10
|
-
export declare function transformShapeToAstListType(this: ShapesGraphToAstTransformer, shape: input.
|
|
10
|
+
export declare function transformShapeToAstListType(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape, shapeStack: ShapeStack): Either<Error, Maybe<ast.ListType>>;
|
|
11
11
|
//# sourceMappingURL=transformShapeToAstListType.d.ts.map
|
|
@@ -4,6 +4,7 @@ import { Either, Left, Maybe } from "purify-ts";
|
|
|
4
4
|
import * as ast from "../ast/index.js";
|
|
5
5
|
import { Eithers } from "../Eithers.js";
|
|
6
6
|
import { defaultNodeShapeNodeKinds } from "./defaultNodeShapeNodeKinds.js";
|
|
7
|
+
import { isNodeShape } from "./isNodeShape.js";
|
|
7
8
|
import { shapeNodeKinds } from "./shapeNodeKinds.js";
|
|
8
9
|
import { transformPropertyShapeToAstStructTypeField } from "./transformPropertyShapeToAstStructTypeField.js";
|
|
9
10
|
const listPropertiesStructType = new ast.StructType({
|
|
@@ -37,7 +38,7 @@ const empty = Either.of(Maybe.empty());
|
|
|
37
38
|
export function transformShapeToAstListType(shape, shapeStack) {
|
|
38
39
|
shapeStack.push(shape);
|
|
39
40
|
try {
|
|
40
|
-
if (shape
|
|
41
|
+
if (!isNodeShape(shape)) {
|
|
41
42
|
return empty;
|
|
42
43
|
}
|
|
43
44
|
const nodeShape = shape;
|
|
@@ -67,8 +68,7 @@ export function transformShapeToAstListType(shape, shapeStack) {
|
|
|
67
68
|
shape.hasValues[0].equals(rdf.nil)) {
|
|
68
69
|
emptyListShape = shape;
|
|
69
70
|
}
|
|
70
|
-
else if (shape
|
|
71
|
-
shape.properties.length >= 2) {
|
|
71
|
+
else if (isNodeShape(shape) && shape.properties.length >= 2) {
|
|
72
72
|
nonEmptyListShape = shape;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -3,5 +3,5 @@ import * as ast from "../ast/index.js";
|
|
|
3
3
|
import type * as input from "../input/index.js";
|
|
4
4
|
import type { ShapesGraphToAstTransformer } from "../ShapesGraphToAstTransformer.js";
|
|
5
5
|
import type { ShapeStack } from "./ShapeStack.js";
|
|
6
|
-
export declare function transformShapeToAstStructType(this: ShapesGraphToAstTransformer, shape: input.
|
|
6
|
+
export declare function transformShapeToAstStructType(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape, shapeStack: ShapeStack): Either<Error, Maybe<ast.Type>>;
|
|
7
7
|
//# sourceMappingURL=transformShapeToAstStructType.d.ts.map
|
|
@@ -4,40 +4,78 @@ import { invariant } from "ts-invariant";
|
|
|
4
4
|
import * as ast from "../ast/index.js";
|
|
5
5
|
import { Eithers } from "../Eithers.js";
|
|
6
6
|
import { defaultNodeShapeNodeKinds } from "./defaultNodeShapeNodeKinds.js";
|
|
7
|
+
import { isNodeShape } from "./isNodeShape.js";
|
|
7
8
|
import { shapeAstTypeName } from "./shapeAstTypeName.js";
|
|
8
9
|
import { shapeNodeKinds } from "./shapeNodeKinds.js";
|
|
9
10
|
import { transformPropertyShapeToAstStructTypeField } from "./transformPropertyShapeToAstStructTypeField.js";
|
|
10
11
|
import { transformShapeToAstType } from "./transformShapeToAstType.js";
|
|
11
12
|
function isStructTypeFieldRequired(field) {
|
|
12
|
-
switch (field.
|
|
13
|
-
case "DefaultValue":
|
|
14
|
-
return false;
|
|
15
|
-
case "LazyOption":
|
|
16
|
-
return false;
|
|
17
|
-
case "LazySet":
|
|
18
|
-
return field.type.partialType.minCount > 0n;
|
|
19
|
-
case "Option":
|
|
20
|
-
return false;
|
|
21
|
-
case "Set":
|
|
22
|
-
return field.type.minCount > 0;
|
|
23
|
-
case "DiscriminatedUnion":
|
|
24
|
-
return field.type.members.every((member) => isStructTypeFieldRequired({ type: member.type }));
|
|
25
|
-
case "BlankNode":
|
|
13
|
+
switch (field.kind) {
|
|
26
14
|
case "Identifier":
|
|
27
|
-
|
|
28
|
-
case "
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
return field.type.kind === "Iri";
|
|
16
|
+
case "Shacl": {
|
|
17
|
+
switch (field.type.kind) {
|
|
18
|
+
case "DiscriminatedUnion":
|
|
19
|
+
return field.type.members.every((member) => isStructTypeFieldRequired({ kind: "Shacl", type: member.type }));
|
|
20
|
+
case "DefaultValue":
|
|
21
|
+
return false;
|
|
22
|
+
case "Intersection":
|
|
23
|
+
return field.type.members.every((member) => isStructTypeFieldRequired({ kind: "Shacl", type: member.type }));
|
|
24
|
+
case "LazyOption":
|
|
25
|
+
return false;
|
|
26
|
+
case "LazySet":
|
|
27
|
+
return field.type.partialType.minCount > 0n;
|
|
28
|
+
case "Option":
|
|
29
|
+
return false;
|
|
30
|
+
case "Set":
|
|
31
|
+
return field.type.minCount > 0;
|
|
32
|
+
case "BlankNode":
|
|
33
|
+
case "Identifier":
|
|
34
|
+
case "Iri":
|
|
35
|
+
case "Lazy":
|
|
36
|
+
case "List":
|
|
37
|
+
case "Literal":
|
|
38
|
+
case "Struct":
|
|
39
|
+
case "Term":
|
|
40
|
+
return true;
|
|
41
|
+
default:
|
|
42
|
+
field.type;
|
|
43
|
+
throw new Error("should never reach this point");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
36
46
|
default:
|
|
37
|
-
field.
|
|
47
|
+
field.kind;
|
|
38
48
|
throw new Error("should never reach this point");
|
|
39
49
|
}
|
|
40
50
|
}
|
|
51
|
+
function transformNodeShapeNodeKindsToAstIdentifierType(nodeKinds, nodeShape) {
|
|
52
|
+
const identifierTypeProperties = {
|
|
53
|
+
comment: Maybe.empty(),
|
|
54
|
+
label: Maybe.empty(),
|
|
55
|
+
name: Maybe.empty(),
|
|
56
|
+
shapeIdentifier: nodeShape.$identifier(),
|
|
57
|
+
};
|
|
58
|
+
if (nodeKinds.size === 2) {
|
|
59
|
+
invariant(nodeShape.in_.isNothing());
|
|
60
|
+
return new ast.IdentifierType(identifierTypeProperties);
|
|
61
|
+
}
|
|
62
|
+
const nodeKind = [...nodeKinds][0];
|
|
63
|
+
switch (nodeKind) {
|
|
64
|
+
case "BlankNode":
|
|
65
|
+
invariant(nodeShape.in_.isNothing());
|
|
66
|
+
return new ast.BlankNodeType(identifierTypeProperties);
|
|
67
|
+
case "IRI":
|
|
68
|
+
return new ast.IriType({
|
|
69
|
+
...identifierTypeProperties,
|
|
70
|
+
hasValues: [],
|
|
71
|
+
in_: nodeShape.in_
|
|
72
|
+
.orDefault([])
|
|
73
|
+
.filter((_) => _.termType === "NamedNode"),
|
|
74
|
+
});
|
|
75
|
+
default:
|
|
76
|
+
throw new Error("should never happen");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
41
79
|
export function transformShapeToAstStructType(shape, shapeStack) {
|
|
42
80
|
shapeStack.push(shape);
|
|
43
81
|
try {
|
|
@@ -48,7 +86,7 @@ export function transformShapeToAstStructType(shape, shapeStack) {
|
|
|
48
86
|
.chain((nodeShape) => transformShapeToAstType.call(this, nodeShape, shapeStack))
|
|
49
87
|
.map(Maybe.of);
|
|
50
88
|
}
|
|
51
|
-
if (shape
|
|
89
|
+
if (!isNodeShape(shape)) {
|
|
52
90
|
return Either.of(Maybe.empty());
|
|
53
91
|
}
|
|
54
92
|
const nodeShape = shape;
|
|
@@ -88,37 +126,7 @@ export function transformShapeToAstStructType(shape, shapeStack) {
|
|
|
88
126
|
if (nodeKinds.has("Literal")) {
|
|
89
127
|
return Left(new Error(`${nodeShape} should not have a nodeKind "Literal"`));
|
|
90
128
|
}
|
|
91
|
-
|
|
92
|
-
const identifierTypeProperties = {
|
|
93
|
-
comment: Maybe.empty(),
|
|
94
|
-
label: Maybe.empty(),
|
|
95
|
-
name: Maybe.empty(),
|
|
96
|
-
shapeIdentifier: nodeShape.$identifier(),
|
|
97
|
-
};
|
|
98
|
-
if (nodeKinds.size === 2) {
|
|
99
|
-
invariant(nodeShape.in_.isNothing());
|
|
100
|
-
identifierType = new ast.IdentifierType(identifierTypeProperties);
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
switch ([...nodeKinds][0]) {
|
|
104
|
-
case "BlankNode":
|
|
105
|
-
invariant(nodeShape.in_.isNothing());
|
|
106
|
-
identifierType = new ast.BlankNodeType(identifierTypeProperties);
|
|
107
|
-
break;
|
|
108
|
-
case "IRI":
|
|
109
|
-
identifierType = new ast.IriType({
|
|
110
|
-
...identifierTypeProperties,
|
|
111
|
-
hasValues: [],
|
|
112
|
-
in_: nodeShape.in_
|
|
113
|
-
.orDefault([])
|
|
114
|
-
.filter((_) => _.termType === "NamedNode"),
|
|
115
|
-
});
|
|
116
|
-
break;
|
|
117
|
-
default:
|
|
118
|
-
throw new Error("should never happen");
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
invariant(identifierType);
|
|
129
|
+
const identifierType = transformNodeShapeNodeKindsToAstIdentifierType.call(this, nodeKinds, nodeShape);
|
|
122
130
|
// Put a placeholder in the cache to deal with cyclic references
|
|
123
131
|
// Remove the placeholder if the transformation fails.
|
|
124
132
|
// If this node shape's properties (directly or indirectly) refer to the node shape itself,
|
|
@@ -127,30 +135,43 @@ export function transformShapeToAstStructType(shape, shapeStack) {
|
|
|
127
135
|
comment: nodeShape.comment,
|
|
128
136
|
extern: nodeShape.extern.orDefault(false),
|
|
129
137
|
fromRdfType,
|
|
130
|
-
label: nodeShape.label,
|
|
131
138
|
identifierType,
|
|
132
|
-
|
|
139
|
+
label: nodeShape.label,
|
|
140
|
+
name: shapeAstTypeName.call(this, nodeShape),
|
|
133
141
|
shapeIdentifier: nodeShape.$identifier(),
|
|
134
142
|
synthetic: false,
|
|
135
143
|
toRdfTypes,
|
|
136
144
|
tsImports: nodeShape.tsImports,
|
|
137
145
|
});
|
|
146
|
+
if (identifierType.kind !== "BlankNode") {
|
|
147
|
+
structType.addField(new ast.StructType.IdentifierField({
|
|
148
|
+
structType,
|
|
149
|
+
type: identifierType,
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
138
152
|
this.cachedAstTypesByShapeIdentifier.set(nodeShape.$identifier(), structType);
|
|
139
153
|
return (() => {
|
|
140
|
-
// Populate
|
|
154
|
+
// Populate fields
|
|
155
|
+
const fieldNames = new Set();
|
|
141
156
|
for (const propertyShape of propertyShapes) {
|
|
142
|
-
const fieldEither = transformPropertyShapeToAstStructTypeField
|
|
157
|
+
const fieldEither = transformPropertyShapeToAstStructTypeField
|
|
158
|
+
.call(this, {
|
|
143
159
|
propertyShape,
|
|
144
160
|
structType,
|
|
161
|
+
})
|
|
162
|
+
.chain((fieldMaybe) => {
|
|
163
|
+
const field = fieldMaybe.extract();
|
|
164
|
+
if (field) {
|
|
165
|
+
if (fieldNames.has(field.name)) {
|
|
166
|
+
return Left(new Error(`${nodeShape} has duplicate property name: ${field.name}`));
|
|
167
|
+
}
|
|
168
|
+
structType.addField(field);
|
|
169
|
+
}
|
|
170
|
+
return Either.of(undefined);
|
|
145
171
|
});
|
|
146
172
|
if (fieldEither.isLeft()) {
|
|
147
173
|
return fieldEither;
|
|
148
174
|
}
|
|
149
|
-
fieldEither.ifRight((property) => {
|
|
150
|
-
property.ifJust((property) => {
|
|
151
|
-
structType.addFields(property);
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
175
|
}
|
|
155
176
|
if (!structType.extern &&
|
|
156
177
|
structType.fromRdfType.isNothing() &&
|
|
@@ -7,6 +7,6 @@ type AstTermType = ast.BlankNodeType | ast.DefaultValueType<ast.IdentifierType |
|
|
|
7
7
|
/**
|
|
8
8
|
* Try to convert a shape to an AST TermType using some heuristics.
|
|
9
9
|
*/
|
|
10
|
-
export declare function transformShapeToAstTermType(this: ShapesGraphToAstTransformer, shape: input.
|
|
10
|
+
export declare function transformShapeToAstTermType(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape, shapeStack: ShapeStack): Either<Error, AstTermType>;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=transformShapeToAstTermType.d.ts.map
|
|
@@ -14,7 +14,7 @@ export function transformShapeToAstTermType(shape, shapeStack) {
|
|
|
14
14
|
const in_ = shapeStack.constraints.in_;
|
|
15
15
|
const astAbstractTypeProperties = {
|
|
16
16
|
comment: Maybe.empty(),
|
|
17
|
-
name: shapeAstTypeName(shape),
|
|
17
|
+
name: shapeAstTypeName.call(this, shape),
|
|
18
18
|
label: Maybe.empty(),
|
|
19
19
|
shapeIdentifier: shape.$identifier(),
|
|
20
20
|
};
|
|
@@ -7,5 +7,5 @@ import type { ShapeStack } from "./ShapeStack.js";
|
|
|
7
7
|
* Try to transform a shape to an AST type using some heuristics. All shape -> AST type transformation calls should go through this function,
|
|
8
8
|
* not the other transformShapeToAst*Type functions directly.
|
|
9
9
|
*/
|
|
10
|
-
export declare function transformShapeToAstType(this: ShapesGraphToAstTransformer, shape: input.
|
|
10
|
+
export declare function transformShapeToAstType(this: ShapesGraphToAstTransformer, shape: input.UndiscriminatedShape, shapeStack: ShapeStack): Either<Error, ast.Type>;
|
|
11
11
|
//# sourceMappingURL=transformShapeToAstType.d.ts.map
|
|
@@ -15,12 +15,12 @@ export declare abstract class AbstractCollectionType<ItemTypeT extends AbstractC
|
|
|
15
15
|
toJSON(): {
|
|
16
16
|
mutable: boolean | undefined;
|
|
17
17
|
itemType: any;
|
|
18
|
-
comment: string | undefined;
|
|
19
18
|
kind: string;
|
|
20
|
-
label: string | undefined;
|
|
21
19
|
name: string | undefined;
|
|
22
20
|
recursive: boolean | undefined;
|
|
23
21
|
shapeIdentifier: import("@rdfjs/types").BlankNode | import("@rdfjs/types").NamedNode<string>;
|
|
22
|
+
comment: string | undefined;
|
|
23
|
+
label: string | undefined;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
export declare namespace AbstractCollectionType {
|