@shaclmate/compiler 4.0.41 → 4.0.43
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/ShapesGraphToAstTransformer.d.ts +1 -0
- package/dist/ShapesGraphToAstTransformer.js +11 -43
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.d.ts +17 -0
- package/dist/_ShapesGraphToAstTransformer/{transformPropertyShapeToAstObjectTypeProperty.js → transformPropertyShapeToAstStructTypeField.js} +71 -48
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +29 -20
- package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.d.ts → transformShapeToAstStructType.d.ts} +2 -2
- package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.js → transformShapeToAstStructType.js} +35 -29
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +2 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +9 -4
- package/dist/ast/AbstractCompoundType.d.ts +2 -2
- package/dist/ast/AbstractCompoundType.js +4 -4
- package/dist/ast/AbstractContainerType.d.ts +2 -2
- package/dist/ast/AbstractContainerType.js +4 -4
- package/dist/ast/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +10 -10
- package/dist/ast/{AbstractLazyObjectType.js → AbstractLazyType.js} +3 -3
- package/dist/ast/AbstractType.d.ts +1 -1
- package/dist/ast/AbstractType.js +3 -0
- package/dist/ast/Ast.d.ts +2 -4
- package/dist/ast/DefaultValueType.js +2 -1
- package/dist/ast/IntersectionType.d.ts +2 -2
- package/dist/ast/IntersectionType.js +3 -3
- package/dist/ast/LazyOptionType.d.ts +6 -0
- package/dist/ast/LazyOptionType.js +5 -0
- package/dist/ast/LazySetType.d.ts +6 -0
- package/dist/ast/LazySetType.js +5 -0
- package/dist/ast/LazyType.d.ts +5 -0
- package/dist/ast/LazyType.js +5 -0
- package/dist/ast/ListType.d.ts +2 -2
- package/dist/ast/ListType.js +4 -4
- package/dist/ast/OptionType.js +2 -1
- package/dist/ast/SetType.js +2 -1
- package/dist/ast/StructCompoundType.d.ts +12 -0
- package/dist/ast/{ObjectCompoundType.js → StructCompoundType.js} +18 -18
- package/dist/ast/StructIntersectionType.d.ts +4 -0
- package/dist/ast/StructIntersectionType.js +2 -0
- package/dist/ast/{ObjectType.d.ts → StructType.d.ts} +28 -27
- package/dist/ast/{ObjectType.js → StructType.js} +81 -78
- package/dist/ast/StructUnionType.d.ts +4 -0
- package/dist/ast/StructUnionType.js +2 -0
- package/dist/ast/Type.d.ts +5 -5
- package/dist/ast/Type.js +4 -4
- package/dist/ast/UnionType.d.ts +2 -2
- package/dist/ast/UnionType.js +3 -3
- package/dist/ast/index.d.ts +7 -7
- package/dist/ast/index.js +7 -7
- package/dist/generators/AstJsonGenerator.js +2 -2
- package/dist/generators/transformAstToLabeledPropertyGraph.js +8 -8
- package/dist/generators/ts/AbstractContainerType.d.ts +1 -1
- package/dist/generators/ts/AbstractContainerType.js +6 -6
- package/dist/generators/ts/AbstractDateType.d.ts +1 -7
- package/dist/generators/ts/AbstractDateType.js +1 -11
- package/dist/generators/ts/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +7 -7
- package/dist/generators/ts/{AbstractLazyObjectType.js → AbstractLazyType.js} +19 -17
- package/dist/generators/ts/AbstractLiteralType.d.ts +2 -5
- package/dist/generators/ts/AbstractLiteralType.js +0 -21
- package/dist/generators/ts/AbstractNumericType.d.ts +1 -7
- package/dist/generators/ts/AbstractNumericType.js +15 -25
- package/dist/generators/ts/AbstractObjectSetType.d.ts +1 -1
- package/dist/generators/ts/AbstractObjectSetType.js +2 -2
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +1 -1
- package/dist/generators/ts/AbstractPrimitiveType.js +1 -1
- package/dist/generators/ts/AbstractTermType.d.ts +6 -21
- package/dist/generators/ts/AbstractTermType.js +26 -55
- package/dist/generators/ts/AbstractType.d.ts +40 -47
- package/dist/generators/ts/AbstractType.js +17 -6
- package/dist/generators/ts/BigDecimalType.d.ts +3 -3
- package/dist/generators/ts/BigDecimalType.js +3 -8
- package/dist/generators/ts/BigIntType.d.ts +2 -2
- package/dist/generators/ts/BigIntType.js +7 -4
- package/dist/generators/ts/BlankNodeType.d.ts +2 -7
- package/dist/generators/ts/BlankNodeType.js +2 -7
- package/dist/generators/ts/BooleanType.d.ts +3 -3
- package/dist/generators/ts/BooleanType.js +12 -14
- package/dist/generators/ts/DateTimeType.d.ts +2 -2
- package/dist/generators/ts/DateTimeType.js +14 -4
- package/dist/generators/ts/DateType.d.ts +2 -2
- package/dist/generators/ts/DateType.js +14 -4
- package/dist/generators/ts/DefaultValueType.d.ts +8 -8
- package/dist/generators/ts/DefaultValueType.js +10 -12
- package/dist/generators/ts/FloatType.d.ts +2 -2
- package/dist/generators/ts/FloatType.js +7 -4
- package/dist/generators/ts/IdentifierType.d.ts +2 -2
- package/dist/generators/ts/IdentifierType.js +2 -7
- package/dist/generators/ts/IntType.d.ts +2 -2
- package/dist/generators/ts/IntType.js +7 -4
- package/dist/generators/ts/IriType.d.ts +2 -2
- package/dist/generators/ts/IriType.js +12 -14
- package/dist/generators/ts/{LazyObjectOptionType.d.ts → LazyOptionType.d.ts} +12 -11
- package/dist/generators/ts/{LazyObjectOptionType.js → LazyOptionType.js} +23 -14
- package/dist/generators/ts/LazySetType.d.ts +20 -0
- package/dist/generators/ts/{LazyObjectSetType.js → LazySetType.js} +22 -13
- package/dist/generators/ts/LazyType.d.ts +19 -0
- package/dist/generators/ts/{LazyObjectType.js → LazyType.js} +22 -13
- package/dist/generators/ts/ListType.d.ts +1 -1
- package/dist/generators/ts/ListType.js +9 -19
- package/dist/generators/ts/LiteralType.d.ts +3 -2
- package/dist/generators/ts/LiteralType.js +6 -2
- package/dist/generators/ts/ObjectType.d.ts +16 -3
- package/dist/generators/ts/ObjectType.js +301 -91
- package/dist/generators/ts/ObjectUnionType.js +40 -40
- package/dist/generators/ts/OptionType.d.ts +2 -2
- package/dist/generators/ts/OptionType.js +7 -5
- package/dist/generators/ts/SetType.d.ts +3 -3
- package/dist/generators/ts/SetType.js +8 -10
- package/dist/generators/ts/Snippets.d.ts +26 -8
- package/dist/generators/ts/Snippets.js +161 -35
- package/dist/generators/ts/StringType.d.ts +4 -3
- package/dist/generators/ts/StringType.js +18 -11
- package/dist/generators/ts/TermType.d.ts +7 -5
- package/dist/generators/ts/TermType.js +28 -9
- package/dist/generators/ts/TsGenerator.js +11 -6
- package/dist/generators/ts/Type.d.ts +4 -4
- package/dist/generators/ts/TypeFactory.d.ts +5 -5
- package/dist/generators/ts/TypeFactory.js +79 -58
- package/dist/generators/ts/UnionType.d.ts +23 -18
- package/dist/generators/ts/UnionType.js +227 -221
- package/dist/generators/ts/ZodGenerator.js +15 -7
- package/dist/generators/ts/_ObjectType/AbstractProperty.d.ts +24 -15
- package/dist/generators/ts/_ObjectType/AbstractProperty.js +1 -24
- package/dist/generators/ts/_ObjectType/DiscriminantProperty.d.ts +8 -6
- package/dist/generators/ts/_ObjectType/DiscriminantProperty.js +11 -24
- package/dist/generators/ts/_ObjectType/IdentifierProperty.d.ts +8 -2
- package/dist/generators/ts/_ObjectType/IdentifierProperty.js +44 -16
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.js +28 -0
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_equalsFunctionDeclaration.js → ObjectType_equalsFunctionExpression.js} +6 -10
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_filterTypeDeclaration.js → ObjectType_filterTypeExpression.js} +6 -8
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_focusSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → ObjectType_focusSparqlConstructTriplesFunctionExpression.js} +5 -9
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_focusSparqlWherePatternsFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.js → ObjectType_focusSparqlWherePatternsFunctionExpression.js} +5 -9
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_fromRdfResourceFunctionDeclaration.js → ObjectType_fromRdfResourceFunctionExpression.js} +8 -16
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_graphqlTypeVariableStatement.js → ObjectType_graphqlTypeExpression.js} +6 -13
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.js +30 -0
- package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{identifierTypeDeclarations.js → ObjectType_identifierTypeDeclarations.js} +2 -5
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +3 -3
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +1 -2
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.js +2 -6
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_jsonSchemaFunctionDeclaration.js → ObjectType_jsonSchemaExpression.js} +3 -10
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.js +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.js +17 -0
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.d.ts +1 -1
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.js +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +5 -9
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +4 -8
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.js +14 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_toRdfResourceFunctionDeclaration.js → ObjectType_toRdfResourceFunctionExpression.js} +6 -12
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.js +7 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.js +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_valueSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionExpression.js +8 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_valueSparqlWherePatternsFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionExpression.js +10 -0
- package/dist/generators/ts/_ObjectType/ShaclProperty.d.ts +9 -2
- package/dist/generators/ts/_ObjectType/ShaclProperty.js +65 -33
- package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +4 -3
- package/dist/generators/ts/_snippets/snippets_DateSchema.js +4 -3
- package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +3 -3
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.js +6 -5
- package/dist/generators/ts/_snippets/snippets_IdentifierSchema.js +2 -1
- package/dist/generators/ts/_snippets/snippets_IriSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_Lazy.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_Lazy.js +22 -0
- package/dist/generators/ts/_snippets/snippets_LazyOption.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LazyOption.js +25 -0
- package/dist/generators/ts/_snippets/snippets_LazySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LazySet.js +40 -0
- package/dist/generators/ts/_snippets/snippets_LiteralFilter.js +1 -3
- package/dist/generators/ts/_snippets/snippets_LiteralSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_NumericSchema.js +2 -1
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +6 -8
- package/dist/generators/ts/_snippets/snippets_RdfVocabularies.js +32 -32
- package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +1 -1
- package/dist/generators/ts/_snippets/snippets_StringSchema.js +5 -3
- package/dist/generators/ts/_snippets/snippets_TermFilter.js +3 -3
- package/dist/generators/ts/_snippets/snippets_TermSchema.js +4 -2
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazy.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazy.js +15 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyOption.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyOption.js +33 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazySet.js +27 -0
- package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.js +10 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterNumeric.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterTerm.js +1 -2
- package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.js +15 -0
- package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.js +11 -0
- package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.js +8 -0
- package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.js +8 -0
- package/dist/generators/ts/_snippets/snippets_numericSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.js +9 -0
- package/dist/generators/ts/_snippets/snippets_shaclPropertyFromRdf.js +13 -7
- package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_termFilterSparqlPatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.js +17 -0
- package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.js +60 -0
- package/dist/generators/ts/_snippets/snippets_termSparqlWherePatterns.js +2 -2
- package/dist/input/generated.d.ts +511 -386
- package/dist/input/generated.js +1780 -2293
- package/package.json +2 -2
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.d.ts +0 -9
- package/dist/ast/LazyObjectOptionType.d.ts +0 -6
- package/dist/ast/LazyObjectOptionType.js +0 -5
- package/dist/ast/LazyObjectSetType.d.ts +0 -6
- package/dist/ast/LazyObjectSetType.js +0 -5
- package/dist/ast/LazyObjectType.d.ts +0 -5
- package/dist/ast/LazyObjectType.js +0 -5
- package/dist/ast/ObjectCompoundType.d.ts +0 -12
- package/dist/ast/ObjectIntersectionType.d.ts +0 -4
- package/dist/ast/ObjectIntersectionType.js +0 -2
- package/dist/ast/ObjectUnionType.d.ts +0 -4
- package/dist/ast/ObjectUnionType.js +0 -2
- package/dist/generators/ts/LazyObjectSetType.d.ts +0 -20
- package/dist/generators/ts/LazyObjectType.d.ts +0 -19
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.js +0 -44
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.js +0 -21
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +0 -18
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.js +0 -10
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.js +0 -41
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.js +0 -12
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.js +0 -9
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +0 -12
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.js +0 -20
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.js +0 -29
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +0 -11
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js +0 -13
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +0 -4
- package/dist/generators/ts/_snippets/snippets_LazyObject.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_LazyObject.js +0 -22
- package/dist/generators/ts/_snippets/snippets_LazyObjectOption.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_LazyObjectOption.js +0 -25
- package/dist/generators/ts/_snippets/snippets_LazyObjectSet.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_LazyObjectSet.js +0 -40
- package/dist/generators/ts/_snippets/snippets_convertToLazyObject.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToLazyObject.js +0 -15
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.js +0 -31
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.js +0 -25
- package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.js +0 -15
- package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.js +0 -23
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_convertToLazy = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}convertToLazy`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}convertToLazy<PartialT, ResolvedT>(resolvedToPartial: (resolved: ResolvedT) => PartialT) {
|
|
4
|
+
return (value: ${snippets.Lazy}<PartialT, ResolvedT> | ResolvedT): ${imports.Either}<Error, ${snippets.Lazy}<PartialT, ResolvedT>> => {
|
|
5
|
+
if (value instanceof ${snippets.Lazy}) {
|
|
6
|
+
return ${imports.Either}.of(value);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return ${imports.Either}.of(new ${snippets.Lazy}({
|
|
10
|
+
partial: resolvedToPartial(value),
|
|
11
|
+
resolver: async () => ${imports.Right}(value)
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
}`);
|
|
15
|
+
//# sourceMappingURL=snippets_convertToLazy.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_convertToLazyOption = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}convertToLazyOption`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}convertToLazyOption<PartialT, ResolvedT>(resolvedToPartial: (resolved: ResolvedT) => PartialT) {
|
|
4
|
+
return (value: ${snippets.LazyOption}<PartialT, ResolvedT> | ${imports.Maybe}<ResolvedT> | ResolvedT | undefined): ${imports.Either}<Error, ${snippets.LazyOption}<PartialT, ResolvedT>> => {
|
|
5
|
+
switch (typeof value) {
|
|
6
|
+
case "object": {
|
|
7
|
+
if (value instanceof ${snippets.LazyOption}) {
|
|
8
|
+
return ${imports.Either}.of(value);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (${imports.Maybe}.isMaybe(value)) {
|
|
12
|
+
return ${imports.Either}.of(new ${snippets.LazyOption}<PartialT, ResolvedT>({
|
|
13
|
+
partial: value.map(resolvedToPartial),
|
|
14
|
+
resolver: async () => ${imports.Right}(value.unsafeCoerce())
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
case "undefined":
|
|
21
|
+
return ${imports.Either}.of(new ${snippets.LazyOption}<PartialT, ResolvedT>({
|
|
22
|
+
partial: ${imports.Maybe}.empty(),
|
|
23
|
+
resolver: async () => { throw new Error("should never be called"); }
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return ${imports.Either}.of(new ${snippets.LazyOption}<PartialT, ResolvedT>({
|
|
28
|
+
partial: ${imports.Maybe}.of(resolvedToPartial(value)),
|
|
29
|
+
resolver: async () => ${imports.Right}(value)
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
}`);
|
|
33
|
+
//# sourceMappingURL=snippets_convertToLazyOption.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_convertToLazySet = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}convertToLazySet`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}convertToLazySet<PartialT, ResolvedT>(resolvedToPartial: (resolved: ResolvedT) => PartialT) {
|
|
4
|
+
return (value: ${snippets.LazySet}<PartialT, ResolvedT> | readonly ResolvedT[] | undefined): ${imports.Either}<Error, ${snippets.LazySet}<PartialT, ResolvedT>> => {
|
|
5
|
+
switch (typeof value) {
|
|
6
|
+
case "object": {
|
|
7
|
+
if (value instanceof ${snippets.LazySet}) {
|
|
8
|
+
return ${imports.Either}.of(value);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
break;
|
|
12
|
+
}
|
|
13
|
+
case "undefined":
|
|
14
|
+
return ${imports.Either}.of(new ${snippets.LazySet}<PartialT, ResolvedT>({
|
|
15
|
+
partials: [],
|
|
16
|
+
resolver: async () => ${imports.Right}([])
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const captureValue = value;
|
|
21
|
+
return ${imports.Either}.of(new ${snippets.LazySet}<PartialT, ResolvedT>({
|
|
22
|
+
partials: value.map(resolvedToPartial),
|
|
23
|
+
resolver: async () => ${imports.Right}(captureValue)
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
}`);
|
|
27
|
+
//# sourceMappingURL=snippets_convertToLazySet.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_dateFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}dateFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}dateFromRdfResourceValues(values: ${imports.Resource}.Values, options: Parameters<${snippets.FromRdfResourceValuesFunction}<Date, ${snippets.DateSchema}>>[1]): ${imports.Either}<Error, ${imports.Resource}.Values<Date>> {
|
|
4
|
+
return ${snippets.termLikeFromRdfResourceValues}(values, options).chain(values => values.chainMap(value => options.schema.in ? value.toDate(options.schema.in) : value.toDate()));
|
|
5
|
+
}`);
|
|
6
|
+
//# sourceMappingURL=snippets_dateFromRdfResourceValues.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_dateTimeFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}dateTimeFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}dateTimeFromRdfResourceValues(values: ${imports.Resource}.Values, options: Parameters<${snippets.FromRdfResourceValuesFunction}<Date, ${snippets.DateSchema}>>[1]): ${imports.Either}<Error, ${imports.Resource}.Values<Date>> {
|
|
4
|
+
return ${snippets.termLikeFromRdfResourceValues}(values, options).chain(values => values.chainMap(value => options.schema.in ? value.toDateTime(options.schema.in) : value.toDateTime()));
|
|
5
|
+
}`);
|
|
6
|
+
//# sourceMappingURL=snippets_dateTimeFromRdfResourceValues.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_defaultValueFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}defaultValueFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}defaultValueFromRdfResourceValues<ItemT, ItemSchemaT>(itemFromRdfResourceValues: ${snippets.FromRdfResourceValuesFunction}<ItemT, ItemSchemaT>): ${snippets.FromRdfResourceValuesFunction}<ItemT, ${snippets.DefaultValueSchema}<ItemSchemaT>> {
|
|
4
|
+
return (values, options) =>
|
|
5
|
+
itemFromRdfResourceValues(
|
|
6
|
+
values.length > 0 ? values : new ${imports.Resource}.Value({ dataFactory: ${imports.dataFactory}, focusResource: options.focusResource, propertyPath: options.propertyPath, term: options.schema.defaultValue }).toValues(),
|
|
7
|
+
{ ...options, schema: options.schema.itemType }
|
|
8
|
+
);
|
|
9
|
+
}`);
|
|
10
|
+
//# sourceMappingURL=snippets_defaultValueFromRdfResourceValues.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
2
|
export const snippets_defaultValueSparqlWherePatterns = ({ snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}defaultValueSparqlWherePatterns`, code `\
|
|
3
|
-
function ${syntheticNamePrefix}defaultValueSparqlWherePatterns<ItemFilterT, ItemSchemaT>(itemSparqlWherePatternsFunction: ${snippets.ValueSparqlWherePatternsFunction}<ItemFilterT, ItemSchemaT>): ${snippets.ValueSparqlWherePatternsFunction}<ItemFilterT, ${snippets.DefaultValueSchema}<
|
|
3
|
+
function ${syntheticNamePrefix}defaultValueSparqlWherePatterns<ItemFilterT, ItemSchemaT>(itemSparqlWherePatternsFunction: ${snippets.ValueSparqlWherePatternsFunction}<ItemFilterT, ItemSchemaT>): ${snippets.ValueSparqlWherePatternsFunction}<ItemFilterT, ${snippets.DefaultValueSchema}<ItemSchemaT>> {
|
|
4
4
|
return ({ schema, ...otherParameters }) => {
|
|
5
5
|
const [itemSparqlWherePatterns, liftSparqlPatterns] = ${snippets.liftSparqlPatterns}(itemSparqlWherePatternsFunction({ ...otherParameters, schema: schema.itemType }));
|
|
6
6
|
return [{ patterns: itemSparqlWherePatterns.concat(), type: "optional" }, ...liftSparqlPatterns];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
2
|
export const snippets_filterNumeric = ({ snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}filterNumeric`, code `\
|
|
3
|
-
function ${syntheticNamePrefix}filterNumeric<
|
|
3
|
+
function ${syntheticNamePrefix}filterNumeric<NumericT extends bigint | number>(filter: ${snippets.NumericFilter}<NumericT>, value: NumericT) {
|
|
4
4
|
if (filter.in !== undefined && !filter.in.some(inValue => inValue === value)) {
|
|
5
5
|
return false;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
2
|
export const snippets_filterTerm = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}filterTerm`, code `\
|
|
3
|
-
function ${syntheticNamePrefix}filterTerm(filter: ${snippets.TermFilter}
|
|
3
|
+
function ${syntheticNamePrefix}filterTerm<TermT extends ${imports.BlankNode} | ${imports.Literal} | ${imports.NamedNode}>(filter: ${snippets.TermFilter}<TermT>, value: ${imports.BlankNode} | ${imports.Literal} | ${imports.NamedNode}): boolean {
|
|
4
4
|
if (filter.datatypeIn !== undefined && (value.termType !== "Literal" || !filter.datatypeIn.some(inDatatype => inDatatype.equals(value.datatype)))) {
|
|
5
5
|
return false;
|
|
6
6
|
}
|
|
@@ -8,7 +8,6 @@ export const snippets_filterTerm = ({ imports, snippets, syntheticNamePrefix, })
|
|
|
8
8
|
if (filter.in !== undefined && !filter.in.some(inTerm => inTerm.equals(value))) {
|
|
9
9
|
return false;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
11
|
|
|
13
12
|
if (filter.languageIn !== undefined && (value.termType !== "Literal" || !filter.languageIn.some(inLanguage => inLanguage === value.language))) {
|
|
14
13
|
return false;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_floatFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}floatFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}floatFromRdfResourceValues<FloatT extends number>(values: ${imports.Resource}.Values, options: Parameters<${snippets.FromRdfResourceValuesFunction}<FloatT, ${snippets.NumericSchema}<FloatT>>>[1]): ${imports.Either}<Error, ${imports.Resource}.Values<FloatT>> {
|
|
4
|
+
return ${snippets.termLikeFromRdfResourceValues}(values, options).chain(values => values.chainMap(value => options.schema.in ? value.toFloat(options.schema.in) : value.toFloat() as ${imports.Either}<Error, FloatT>));
|
|
5
|
+
}`);
|
|
6
|
+
//# sourceMappingURL=snippets_floatFromRdfResourceValues.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_identifierFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}identifierFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}identifierFromRdfResourceValues(values: ${imports.Resource}.Values, options: Parameters<${snippets.FromRdfResourceValuesFunction}<${imports.BlankNode} | ${imports.NamedNode}, ${snippets.IdentifierSchema}>>[1]): ${imports.Either}<Error, ${imports.Resource}.Values<${imports.BlankNode} | ${imports.NamedNode}>> {
|
|
4
|
+
return ${snippets.termLikeFromRdfResourceValues}(values, options).chain(values => values.chainMap(value => value.toIdentifier()));
|
|
5
|
+
}`);
|
|
6
|
+
//# sourceMappingURL=snippets_identifierFromRdfResourceValues.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_intFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}intFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}intFromRdfResourceValues<IntT extends number>(values: ${imports.Resource}.Values, options: Parameters<${snippets.FromRdfResourceValuesFunction}<IntT, ${snippets.NumericSchema}<IntT>>>[1]): ${imports.Either}<Error, ${imports.Resource}.Values<IntT>> {
|
|
4
|
+
return ${snippets.termLikeFromRdfResourceValues}(values, options).chain(values => values.chainMap(value => options.schema.in ? value.toInt(options.schema.in) : value.toInt() as Either<Error, IntT>));
|
|
5
|
+
}`);
|
|
6
|
+
//# sourceMappingURL=snippets_intFromRdfResourceValues.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_iriFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}iriFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}iriFromRdfResourceValues<IriT extends string = string>(values: ${imports.Resource}.Values, options: Parameters<${snippets.FromRdfResourceValuesFunction}<${imports.NamedNode}<IriT>, ${snippets.IriSchema}<IriT>>>[1]): ${imports.Either}<Error, ${imports.Resource}.Values<${imports.NamedNode}<IriT>>> {
|
|
4
|
+
return ${snippets.termLikeFromRdfResourceValues}(values, options).chain(values => values.chainMap(value => options.schema.in ? value.toIri(options.schema.in) : value.toIri() as ${imports.Either}<Error, ${imports.NamedNode}<IriT>>));
|
|
5
|
+
}`);
|
|
6
|
+
//# sourceMappingURL=snippets_iriFromRdfResourceValues.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_listFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}listFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}listFromRdfResourceValues<ItemT, ItemSchemaT>(itemFromRdfResourceValues: ${snippets.FromRdfResourceValuesFunction}<ItemT, ItemSchemaT>): ${snippets.FromRdfResourceValuesFunction}<readonly ItemT[], ${snippets.CollectionSchema}<ItemSchemaT>> {
|
|
4
|
+
return (values, options) =>
|
|
5
|
+
values\
|
|
6
|
+
.chainMap(value => value.toList({ graph: options.graph }))\ // Resource.Values<Resource.Value> to Resource.Values<Resource.Values>;
|
|
7
|
+
.chain(valueLists => valueLists.chainMap(valueList =>
|
|
8
|
+
itemFromRdfResourceValues(
|
|
9
|
+
${imports.Resource}.Values.fromArray({ focusResource: options.focusResource, propertyPath: options.propertyPath, values: valueList.toArray() }),
|
|
10
|
+
{ ...options, schema: options.schema.itemType }
|
|
11
|
+
)
|
|
12
|
+
))\ // Resource.Values<Resource.Values> to Resource.Values<item type arrays>
|
|
13
|
+
.map(valueLists => valueLists.map(valueList => valueList.toArray())); // Convert inner Resource.Values to arrays
|
|
14
|
+
}`);
|
|
15
|
+
//# sourceMappingURL=snippets_listFromRdfResourceValues.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_literalFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}literalFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}literalFromRdfResourceValues(values: ${imports.Resource}.Values, options: Parameters<${snippets.FromRdfResourceValuesFunction}<${imports.Literal}, ${snippets.LiteralSchema}>>[1]): ${imports.Either}<Error, ${imports.Resource}.Values<${imports.Literal}>> {
|
|
4
|
+
return ${snippets.termLikeFromRdfResourceValues}(values, options).chain(values => values.chainMap(value => value.toLiteral()));
|
|
5
|
+
}`);
|
|
6
|
+
//# sourceMappingURL=snippets_literalFromRdfResourceValues.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_maybeFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}maybeFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}maybeFromRdfResourceValues<ItemT, ItemSchemaT>(itemFromRdfResourceValues: ${snippets.FromRdfResourceValuesFunction}<ItemT, ItemSchemaT>): ${snippets.FromRdfResourceValuesFunction}<${imports.Maybe}<ItemT>, ${snippets.MaybeSchema}<ItemSchemaT>> {
|
|
4
|
+
return (values, options) =>
|
|
5
|
+
itemFromRdfResourceValues(values, { ...options, schema: options.schema.itemType })\
|
|
6
|
+
.map(values => values.length > 0
|
|
7
|
+
? values.map(value => ${imports.Maybe}.of(value))
|
|
8
|
+
: ${imports.Resource}.Values.fromValue<${imports.Maybe}<ItemT>>({ focusResource: options.focusResource, propertyPath: options.propertyPath, value: ${imports.Maybe}.empty() })
|
|
9
|
+
);
|
|
10
|
+
}`);
|
|
11
|
+
//# sourceMappingURL=snippets_maybeFromRdfResourceValues.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_mutableListFromRdfResourceValues = ({ snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}mutableListFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}mutableListFromRdfResourceValues<ItemT, ItemSchemaT>(itemFromRdfResourceValues: ${snippets.FromRdfResourceValuesFunction}<ItemT, ItemSchemaT>): ${snippets.FromRdfResourceValuesFunction}<ItemT[], ${snippets.CollectionSchema}<ItemSchemaT>> {
|
|
4
|
+
const immutableListFromRdfResourceValues = ${snippets.listFromRdfResourceValues}(itemFromRdfResourceValues);
|
|
5
|
+
return (values, options) =>
|
|
6
|
+
immutableListFromRdfResourceValues(values, options).map(values => values.map(value => value.concat()));
|
|
7
|
+
}`);
|
|
8
|
+
//# sourceMappingURL=snippets_mutableListFromRdfResourceValues.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_mutableSetFromRdfResourceValues = ({ snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}mutableSetFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}mutableSetFromRdfResourceValues<ItemT, ItemSchemaT>(itemFromRdfResourceValues: ${snippets.FromRdfResourceValuesFunction}<ItemT, ItemSchemaT>): ${snippets.FromRdfResourceValuesFunction}<ItemT[], ${snippets.CollectionSchema}<ItemSchemaT>> {
|
|
4
|
+
const immutableSetFromRdfResourceValues = ${snippets.setFromRdfResourceValues}(itemFromRdfResourceValues);
|
|
5
|
+
return (values, options) =>
|
|
6
|
+
immutableSetFromRdfResourceValues(values, options).map(values => values.map(value => value.concat()));
|
|
7
|
+
}`);
|
|
8
|
+
//# sourceMappingURL=snippets_mutableSetFromRdfResourceValues.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
2
|
export const snippets_numericSparqlWherePatterns = ({ snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}numericSparqlWherePatterns`, code `\
|
|
3
|
-
function $numericSparqlWherePatterns<
|
|
3
|
+
function $numericSparqlWherePatterns<NumericT extends bigint | number>({ filter, valueVariable, ...otherParameters }: Parameters<${snippets.ValueSparqlWherePatternsFunction}<${snippets.NumericFilter}<NumericT>, ${snippets.NumericSchema}<NumericT>>>[0]): ReturnType<${snippets.ValueSparqlWherePatternsFunction}<${snippets.NumericFilter}<NumericT>, ${snippets.NumericSchema}<NumericT>>> {
|
|
4
4
|
const filterPatterns: ${snippets.SparqlFilterPattern}[] = [];
|
|
5
5
|
|
|
6
6
|
if (filter) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_setFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}setFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}setFromRdfResourceValues<ItemT, ItemSchemaT>(itemFromRdfResourceValues: ${snippets.FromRdfResourceValuesFunction}<ItemT, ItemSchemaT>): ${snippets.FromRdfResourceValuesFunction}<readonly ItemT[], ${snippets.CollectionSchema}<ItemSchemaT>> {
|
|
4
|
+
return (values, options) =>
|
|
5
|
+
itemFromRdfResourceValues(values, { ...options, schema: options.schema.itemType })\
|
|
6
|
+
.map(values => values.toArray())\
|
|
7
|
+
.map(valuesArray => ${imports.Resource}.Values.fromValue({ focusResource: options.focusResource, propertyPath: options.propertyPath, value: valuesArray }));
|
|
8
|
+
}`);
|
|
9
|
+
//# sourceMappingURL=snippets_setFromRdfResourceValues.js.map
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
2
|
export const snippets_shaclPropertyFromRdf = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}shaclPropertyFromRdf`, code `\
|
|
3
|
-
function ${syntheticNamePrefix}shaclPropertyFromRdf<
|
|
4
|
-
graph
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
3
|
+
function ${syntheticNamePrefix}shaclPropertyFromRdf<TypeT, TypeSchemaT>(
|
|
4
|
+
{ focusResource, graph, propertySchema, typeFromRdfResourceValues, ...otherParameters }:
|
|
5
|
+
{
|
|
6
|
+
propertySchema: ${snippets.ShaclPropertySchema}<TypeSchemaT>;
|
|
7
|
+
typeFromRdfResourceValues: ${snippets.FromRdfResourceValuesFunction}<TypeT, TypeSchemaT>;
|
|
8
|
+
} & Omit<Parameters<${snippets.FromRdfResourceValuesFunction}<TypeT, TypeSchemaT>>[1], "propertyPath" | "schema">
|
|
9
|
+
): ${imports.Either}<Error, TypeT> {
|
|
10
|
+
return \
|
|
11
|
+
typeFromRdfResourceValues(
|
|
12
|
+
focusResource.values(propertySchema.path, { graph, unique: true }),
|
|
13
|
+
{ ...otherParameters, focusResource, graph, propertyPath: propertySchema.path, schema: propertySchema.type }
|
|
14
|
+
)
|
|
15
|
+
.chain(values => values.head());
|
|
10
16
|
}`);
|
|
11
17
|
//# sourceMappingURL=snippets_shaclPropertyFromRdf.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_stringFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}stringFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}stringFromRdfResourceValues<StringT extends string>(values: ${imports.Resource}.Values, options: Parameters<${snippets.FromRdfResourceValuesFunction}<StringT, ${snippets.StringSchema}<StringT>>>[1]): ${imports.Either}<Error, ${imports.Resource}.Values<StringT>> {
|
|
4
|
+
return ${snippets.termLikeFromRdfResourceValues}(values, options).chain(values => values.chainMap(value => options.schema.in ? value.toString(options.schema.in) : value.toString() as ${imports.Either}<Error, StringT>));
|
|
5
|
+
}`);
|
|
6
|
+
//# sourceMappingURL=snippets_stringFromRdfResourceValues.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
2
|
export const snippets_termFilterSparqlPatterns = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}termFilterSparqlPatterns`, code `\
|
|
3
|
-
function ${syntheticNamePrefix}termFilterSparqlPatterns({ filter, valueVariable }: { filter?: ${snippets.TermFilter}
|
|
3
|
+
function ${syntheticNamePrefix}termFilterSparqlPatterns({ filter, valueVariable }: { filter?: ${snippets.TermFilter}<${imports.BlankNode} | ${imports.Literal} | ${imports.NamedNode}>; valueVariable: ${imports.Variable} }): readonly ${snippets.SparqlFilterPattern}[] {
|
|
4
4
|
if (!filter) {
|
|
5
5
|
return [];
|
|
6
6
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_termFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}termFromRdfResourceValues`, code `\
|
|
3
|
+
function ${syntheticNamePrefix}termFromRdfResourceValues<TermT extends ${imports.BlankNode} | ${imports.Literal} | ${imports.NamedNode}>(values: ${imports.Resource}.Values, options: Parameters<${snippets.FromRdfResourceValuesFunction}<TermT, ${snippets.TermSchema}<TermT>>>[1]): ${imports.Either}<Error, ${imports.Resource}.Values<TermT>> {
|
|
4
|
+
const { focusResource, propertyPath, schema } = options;
|
|
5
|
+
return ${snippets.termLikeFromRdfResourceValues}(values, options).chain(values => values.chainMap(value => value.toTerm().chain(term => {
|
|
6
|
+
if (schema.in && schema.in.length > 0 && !schema.in.some(in_ => in_.equals(term))) {
|
|
7
|
+
return ${imports.Left}(new ${imports.Resource}.MistypedTermValueError({ actualValue: term, expectedValueType: "Term in", focusResource, propertyPath }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if (!schema.types.some(type => term.termType === type)) {
|
|
11
|
+
return ${imports.Left}(new ${imports.Resource}.MistypedTermValueError({ actualValue: term, expectedValueType: "Term types", focusResource, propertyPath }));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return ${imports.Right}(term as TermT);
|
|
15
|
+
})));
|
|
16
|
+
}`);
|
|
17
|
+
//# sourceMappingURL=snippets_termFromRdfResourceValues.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
+
export const snippets_termLikeFromRdfResourceValues = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}termLikeFromRdfResourceValues`, code `\
|
|
3
|
+
const ${syntheticNamePrefix}termLikeFromRdfResourceValues:
|
|
4
|
+
${snippets.FromRdfResourceValuesFunction}<${imports.Resource}.Value, {
|
|
5
|
+
readonly hasValues?: readonly (${imports.Literal} | ${imports.NamedNode})[];
|
|
6
|
+
readonly languageIn?: readonly string[];
|
|
7
|
+
}> = (values, { preferredLanguages, schema: { hasValues, languageIn } }) => {
|
|
8
|
+
let chain = ${imports.Either}.of<Error, ${imports.Resource}.Values>(values);
|
|
9
|
+
|
|
10
|
+
if (hasValues && hasValues.length > 0) {
|
|
11
|
+
chain = chain.chain(values => ${imports.Either}.sequence(hasValues.map(hasValue => values.find(value => value.term.equals(hasValue)))).map(() => values));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (languageIn && languageIn.length > 0) {
|
|
15
|
+
chain = chain.chain(values => values.chainMap(value => value.toLiteral().chain(literal =>
|
|
16
|
+
languageIn.includes(literal.language) ?
|
|
17
|
+
${imports.Right}(value) :
|
|
18
|
+
${imports.Left}(new ${imports.Resource}.MistypedTermValueError(${{
|
|
19
|
+
actualValue: code `literal`,
|
|
20
|
+
expectedValueType: "Literal",
|
|
21
|
+
focusResource: code `value.focusResource`,
|
|
22
|
+
propertyPath: code `value.propertyPath`,
|
|
23
|
+
}}))
|
|
24
|
+
)));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (preferredLanguages && preferredLanguages.length > 0) {
|
|
28
|
+
chain = chain.chain(values => {
|
|
29
|
+
const literals: ${imports.Literal}[] = [];
|
|
30
|
+
const literalValues: ${imports.Resource}.Value[] = [];
|
|
31
|
+
const nonLiteralValues: ${imports.Resource}.Value[] = [];
|
|
32
|
+
|
|
33
|
+
for (const value of values) {
|
|
34
|
+
const term = value.toTerm().unsafeCoerce();
|
|
35
|
+
if (term.termType === "Literal") {
|
|
36
|
+
literals.push(term);
|
|
37
|
+
literalValues.push(value);
|
|
38
|
+
} else {
|
|
39
|
+
nonLiteralValues.push(value);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Return all literals for the first preferredLanguage, then all literals for the second preferredLanguage, etc.
|
|
44
|
+
// Within a preferredLanguage the literals may be in any order.
|
|
45
|
+
const preferredLanguageLiteralValues: ${imports.Resource}.Value[] = [];
|
|
46
|
+
for (const preferredLanguage of preferredLanguages) {
|
|
47
|
+
for (let literalI = 0; literalI < literals.length; literalI++) {
|
|
48
|
+
if (literals[literalI].language === preferredLanguage) {
|
|
49
|
+
preferredLanguageLiteralValues.push(literalValues[literalI]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return ${imports.Right}(${imports.Resource}.Values.fromArray({ focusResource: values.focusResource, propertyPath: values.propertyPath, values: nonLiteralValues.concat(preferredLanguageLiteralValues) }));
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return chain;
|
|
59
|
+
};`);
|
|
60
|
+
//# sourceMappingURL=snippets_termLikeFromRdfResourceValues.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
-
export const snippets_termSparqlWherePatterns = ({ snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}termSparqlWherePatterns`, code `\
|
|
3
|
-
const ${syntheticNamePrefix}termSparqlWherePatterns: ${snippets.ValueSparqlWherePatternsFunction}<${snippets.TermFilter}
|
|
2
|
+
export const snippets_termSparqlWherePatterns = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}termSparqlWherePatterns`, code `\
|
|
3
|
+
const ${syntheticNamePrefix}termSparqlWherePatterns: ${snippets.ValueSparqlWherePatternsFunction}<${snippets.TermFilter}<${imports.BlankNode} | ${imports.Literal} | ${imports.NamedNode}>, ${snippets.TermSchema}<${imports.BlankNode} | ${imports.Literal} | ${imports.NamedNode}>> =
|
|
4
4
|
(parameters) => ${snippets.termSchemaSparqlPatterns}({ filterPatterns: ${snippets.termFilterSparqlPatterns}(parameters), ...parameters })`);
|
|
5
5
|
//# sourceMappingURL=snippets_termSparqlWherePatterns.js.map
|