@shaclmate/compiler 4.0.8 → 4.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Compiler.d.ts +1 -4
- package/dist/Compiler.js +1 -5
- package/dist/ShapesGraphToAstTransformer.d.ts +2 -11
- package/dist/ShapesGraphToAstTransformer.js +25 -27
- package/dist/_ShapesGraphToAstTransformer/defaultNodeShapeNodeKinds.d.ts +3 -0
- package/dist/_ShapesGraphToAstTransformer/defaultNodeShapeNodeKinds.js +5 -0
- package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.d.ts +4 -0
- package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +27 -0
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +74 -19
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +45 -91
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +11 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +146 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.d.ts +7 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +182 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +9 -7
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +3 -5
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +33 -10
- package/dist/ast/AbstractCompoundType.d.ts +26 -8
- package/dist/ast/AbstractCompoundType.js +84 -16
- package/dist/ast/AbstractContainerType.d.ts +2 -4
- package/dist/ast/AbstractContainerType.js +3 -4
- package/dist/ast/AbstractLazyObjectType.d.ts +1 -0
- package/dist/ast/AbstractLazyObjectType.js +3 -0
- package/dist/ast/AbstractTermType.d.ts +1 -0
- package/dist/ast/AbstractTermType.js +1 -0
- package/dist/ast/AbstractType.d.ts +16 -1
- package/dist/ast/AbstractType.js +11 -1
- package/dist/ast/Ast.d.ts +5 -5
- package/dist/ast/BlankNodeType.d.ts +1 -1
- package/dist/ast/DefaultValueType.d.ts +1 -2
- package/dist/ast/DefaultValueType.js +2 -0
- package/dist/ast/IdentifierType.d.ts +1 -1
- package/dist/ast/IntersectionType.d.ts +7 -2
- package/dist/ast/IntersectionType.js +8 -0
- package/dist/ast/ListType.d.ts +2 -9
- package/dist/ast/ListType.js +1 -9
- package/dist/ast/LiteralType.d.ts +1 -0
- package/dist/ast/LiteralType.js +26 -0
- package/dist/ast/ObjectCompoundType.d.ts +12 -0
- package/dist/ast/ObjectCompoundType.js +88 -0
- package/dist/ast/ObjectIntersectionType.d.ts +3 -7
- package/dist/ast/ObjectIntersectionType.js +1 -7
- package/dist/ast/ObjectType.d.ts +14 -31
- package/dist/ast/ObjectType.js +41 -73
- package/dist/ast/ObjectUnionType.d.ts +3 -7
- package/dist/ast/ObjectUnionType.js +1 -7
- package/dist/ast/OptionType.d.ts +1 -2
- package/dist/ast/OptionType.js +2 -0
- package/dist/ast/SetType.d.ts +1 -2
- package/dist/ast/SetType.js +2 -0
- package/dist/ast/Type.d.ts +1 -4
- package/dist/ast/Type.js +0 -6
- package/dist/ast/UnionType.d.ts +11 -6
- package/dist/ast/UnionType.js +6 -4
- package/dist/ast/index.d.ts +1 -2
- package/dist/ast/index.js +1 -2
- package/dist/generators/json/AstJsonGenerator.js +17 -15
- package/dist/generators/ts/AbstractCollectionType.d.ts +1 -1
- package/dist/generators/ts/AbstractCollectionType.js +10 -12
- package/dist/generators/ts/AbstractContainerType.d.ts +9 -4
- package/dist/generators/ts/AbstractContainerType.js +10 -3
- package/dist/generators/ts/AbstractDateType.d.ts +2 -2
- package/dist/generators/ts/AbstractDateType.js +2 -2
- package/dist/generators/ts/AbstractIdentifierType.d.ts +1 -1
- package/dist/generators/ts/AbstractIdentifierType.js +1 -1
- package/dist/generators/ts/AbstractLazyObjectType.d.ts +13 -10
- package/dist/generators/ts/AbstractLazyObjectType.js +21 -16
- package/dist/generators/ts/AbstractNamedUnionType.d.ts +33 -0
- package/dist/generators/ts/AbstractNamedUnionType.js +195 -0
- package/dist/generators/ts/AbstractNumericType.d.ts +3 -3
- package/dist/generators/ts/AbstractNumericType.js +4 -4
- package/dist/generators/ts/AbstractTermType.d.ts +7 -4
- package/dist/generators/ts/AbstractTermType.js +7 -4
- package/dist/generators/ts/AbstractType.d.ts +34 -19
- package/dist/generators/ts/AbstractUnionType.d.ts +80 -0
- package/dist/generators/ts/AbstractUnionType.js +514 -0
- package/dist/generators/ts/AnonymousUnionType.d.ts +26 -0
- package/dist/generators/ts/AnonymousUnionType.js +56 -0
- package/dist/generators/ts/BigDecimalType.d.ts +4 -4
- package/dist/generators/ts/BigDecimalType.js +5 -5
- package/dist/generators/ts/BigIntType.d.ts +1 -1
- package/dist/generators/ts/BigIntType.js +1 -1
- package/dist/generators/ts/BlankNodeType.d.ts +2 -2
- package/dist/generators/ts/BlankNodeType.js +2 -2
- package/dist/generators/ts/BooleanType.d.ts +3 -3
- package/dist/generators/ts/BooleanType.js +3 -3
- package/dist/generators/ts/DateTimeType.d.ts +1 -1
- package/dist/generators/ts/DateTimeType.js +1 -1
- package/dist/generators/ts/DateType.d.ts +1 -1
- package/dist/generators/ts/DateType.js +1 -1
- package/dist/generators/ts/DefaultValueType.d.ts +5 -5
- package/dist/generators/ts/DefaultValueType.js +17 -16
- package/dist/generators/ts/IdentifierType.d.ts +2 -2
- package/dist/generators/ts/IdentifierType.js +2 -2
- package/dist/generators/ts/IriType.d.ts +2 -2
- package/dist/generators/ts/IriType.js +2 -2
- package/dist/generators/ts/LazyObjectOptionType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectOptionType.js +10 -10
- package/dist/generators/ts/LazyObjectSetType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectSetType.js +8 -8
- package/dist/generators/ts/LazyObjectType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectType.js +9 -10
- package/dist/generators/ts/ListType.d.ts +9 -8
- package/dist/generators/ts/ListType.js +15 -14
- package/dist/generators/ts/LiteralType.d.ts +2 -2
- package/dist/generators/ts/LiteralType.js +3 -3
- package/dist/generators/ts/NamedObjectType.d.ts +126 -0
- package/dist/generators/ts/NamedObjectType.js +420 -0
- package/dist/generators/ts/NamedObjectUnionType.d.ts +35 -0
- package/dist/generators/ts/NamedObjectUnionType.js +217 -0
- package/dist/generators/ts/NamedUnionType.d.ts +11 -0
- package/dist/generators/ts/NamedUnionType.js +13 -0
- package/dist/generators/ts/OptionType.d.ts +5 -5
- package/dist/generators/ts/OptionType.js +12 -12
- package/dist/generators/ts/SetType.d.ts +4 -4
- package/dist/generators/ts/SetType.js +13 -11
- package/dist/generators/ts/StringType.d.ts +3 -3
- package/dist/generators/ts/StringType.js +3 -3
- package/dist/generators/ts/TermType.d.ts +2 -2
- package/dist/generators/ts/TermType.js +3 -3
- package/dist/generators/ts/TsGenerator.js +28 -20
- package/dist/generators/ts/Type.d.ts +5 -4
- package/dist/generators/ts/TypeFactory.d.ts +9 -7
- package/dist/generators/ts/TypeFactory.js +139 -112
- package/dist/generators/ts/ZodGenerator.js +18 -16
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/AbstractProperty.d.ts +9 -9
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/AbstractProperty.js +3 -3
- package/dist/generators/ts/{_ObjectType/TypeDiscriminantProperty.d.ts → _NamedObjectType/DiscriminantProperty.d.ts} +14 -14
- package/dist/generators/ts/{_ObjectType/TypeDiscriminantProperty.js → _NamedObjectType/DiscriminantProperty.js} +22 -20
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierPrefixProperty.d.ts +3 -3
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierPrefixProperty.js +6 -6
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierProperty.d.ts +3 -3
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierProperty.js +31 -28
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_classDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_classDeclaration.js → _NamedObjectType/NamedObjectType_classDeclaration.js} +15 -15
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_createFunctionDeclaration.js → _NamedObjectType/NamedObjectType_createFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_equalsFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_filterFunctionDeclaration.js → _NamedObjectType/NamedObjectType_filterFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_filterTypeDeclaration.js → _NamedObjectType/NamedObjectType_filterTypeDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructTriplesFunctionDeclaration.js → _NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +6 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlWherePatternsFunctionDeclarations.js → _NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +5 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +20 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_fromRdfFunctionDeclaration.js → _NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js} +6 -7
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +20 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_fromRdfTypeVariableStatement.js → _NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_graphqlTypeVariableStatement.js → _NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_hashFunctionOrMethodDeclarations.js → _NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_interfaceDeclaration.js → _NamedObjectType/NamedObjectType_interfaceDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_isTypeFunctionDeclaration.js → _NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js +19 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.js → _NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js} +5 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_jsonTypeAliasDeclaration.js → _NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js → _NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts +9 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_objectSetMethodNames.js → _NamedObjectType/NamedObjectType_objectSetMethodNames.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.js +38 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_propertiesFromRdfFunctionDeclaration.js → _NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.js} +16 -15
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_schemaVariableStatement.js → _NamedObjectType/NamedObjectType_schemaVariableStatement.js} +3 -4
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +2 -2
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js → _NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +2 -2
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js → _NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_toJsonFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_toRdfFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js} +10 -8
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +13 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js +15 -0
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/Property.d.ts +2 -2
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/ShaclProperty.d.ts +3 -3
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/ShaclProperty.js +14 -14
- package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +4 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlConstructTriplesFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlConstructTriplesFunction.js +12 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlWherePatternsFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlWherePatternsFunction.js +14 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceFunction.js +15 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.js +17 -0
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfResourceFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfResourceFunction.js +15 -0
- package/dist/generators/ts/_snippets/snippets_PropertyPath.d.ts +5 -0
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +35 -0
- package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +2 -2
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.js +7 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.js +16 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlConstructTriplesFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlConstructTriplesFunction.js +13 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlWherePatternsFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlWherePatternsFunction.js +16 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_blankNodeSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_booleanEquals.js +1 -1
- package/dist/generators/ts/_snippets/snippets_booleanSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_dateSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.js +1 -1
- package/dist/generators/ts/_snippets/snippets_identifierSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_iriSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +2 -2
- package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_literalSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_maybeSparqlConstructTriples.js +2 -2
- package/dist/generators/ts/_snippets/snippets_maybeSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_numericSparqlWherePatterns.js +2 -3
- package/dist/generators/ts/_snippets/snippets_setSparqlConstructTriples.js +2 -2
- package/dist/generators/ts/_snippets/snippets_setSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlConstructTriples.js +4 -3
- package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlWherePatterns.js +4 -3
- package/dist/generators/ts/_snippets/snippets_sparqlPropertyPath.js +3 -2
- package/dist/generators/ts/_snippets/snippets_stringSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_termSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/graphqlSchemaVariableStatement.d.ts +4 -4
- package/dist/generators/ts/graphqlSchemaVariableStatement.js +25 -25
- package/dist/generators/ts/imports.d.ts +1 -1
- package/dist/generators/ts/imports.js +1 -1
- package/dist/generators/ts/objectSetDeclarations.d.ts +5 -5
- package/dist/generators/ts/objectSetDeclarations.js +34 -31
- package/dist/generators/ts/objectSetInterfaceDeclaration.d.ts +5 -5
- package/dist/generators/ts/objectSetInterfaceDeclaration.js +6 -4
- package/dist/generators/ts/objectSetMethodSignatures.d.ts +4 -4
- package/dist/generators/ts/objectSetMethodSignatures.js +9 -9
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.d.ts +5 -5
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +54 -53
- package/dist/generators/ts/singleEntryRecord.d.ts +2 -0
- package/dist/generators/ts/singleEntryRecord.js +6 -0
- package/dist/generators/ts/snippets.d.ts +10 -6
- package/dist/generators/ts/snippets.js +20 -12
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.d.ts +5 -5
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +19 -20
- package/dist/generators/ts/synthesizeUberObjectUnionType.d.ts +4 -4
- package/dist/generators/ts/synthesizeUberObjectUnionType.js +14 -9
- package/dist/generators/ts/unsupportedObjectSetMethodDeclarations.d.ts +5 -5
- package/dist/generators/ts/unsupportedObjectSetMethodDeclarations.js +2 -2
- package/dist/input/NodeShape.d.ts +0 -1
- package/dist/input/NodeShape.js +0 -3
- package/dist/input/ShapesGraph.d.ts +3 -2
- package/dist/input/ShapesGraph.js +12 -7
- package/dist/input/generated.d.ts +1899 -88
- package/dist/input/generated.js +676 -564
- package/package.json +5 -7
- package/dist/_ShapesGraphToAstTransformer/CurieFactory.d.ts +0 -16
- package/dist/_ShapesGraphToAstTransformer/CurieFactory.js +0 -45
- package/dist/_ShapesGraphToAstTransformer/NodeShapeAstType.d.ts +0 -3
- package/dist/_ShapesGraphToAstTransformer/NodeShapeAstType.js +0 -2
- package/dist/_ShapesGraphToAstTransformer/index.d.ts +0 -6
- package/dist/_ShapesGraphToAstTransformer/index.js +0 -6
- package/dist/_ShapesGraphToAstTransformer/shapeIdentifier.d.ts +0 -5
- package/dist/_ShapesGraphToAstTransformer/shapeIdentifier.js +0 -9
- package/dist/_ShapesGraphToAstTransformer/transformNodeShapeToAstType.d.ts +0 -11
- package/dist/_ShapesGraphToAstTransformer/transformNodeShapeToAstType.js +0 -338
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstAbstractTypeProperties.d.ts +0 -12
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstAbstractTypeProperties.js +0 -31
- package/dist/ast/AbstractObjectCompoundType.d.ts +0 -45
- package/dist/ast/AbstractObjectCompoundType.js +0 -180
- package/dist/ast/Curie.d.ts +0 -21
- package/dist/ast/Curie.js +0 -29
- package/dist/ast/PlaceholderType.d.ts +0 -15
- package/dist/ast/PlaceholderType.js +0 -19
- package/dist/generators/codeName.d.ts +0 -6
- package/dist/generators/codeName.js +0 -66
- package/dist/generators/ts/AbstractDeclaredType.d.ts +0 -23
- package/dist/generators/ts/AbstractDeclaredType.js +0 -17
- package/dist/generators/ts/ObjectType.d.ts +0 -117
- package/dist/generators/ts/ObjectType.js +0 -402
- package/dist/generators/ts/ObjectUnionType.d.ts +0 -65
- package/dist/generators/ts/ObjectUnionType.js +0 -257
- package/dist/generators/ts/UnionType.d.ts +0 -40
- package/dist/generators/ts/UnionType.js +0 -527
- package/dist/generators/ts/_ObjectType/ObjectType_classDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionOrMethodDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclarations.js +0 -66
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionOrMethodDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js +0 -14
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.d.ts +0 -9
- package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromRdfFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlWherePatternsFunctionDeclarations.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionOrMethodDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfFunctionOrMethodDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/MemberType.d.ts +0 -34
- package/dist/generators/ts/_ObjectUnionType/MemberType.js +0 -105
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_equalsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_equalsFunctionDeclaration.js +0 -29
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterFunctionDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterFunctionDeclaration.js +0 -19
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterTypeDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterTypeDeclaration.js +0 -10
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromJsonFunctionDeclaration.js +0 -19
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromRdfFunctionDeclarations.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromRdfFunctionDeclarations.js +0 -20
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_graphqlTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_graphqlTypeVariableStatement.js +0 -18
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_hashFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_hashFunctionDeclaration.js +0 -28
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_identifierTypeDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_identifierTypeDeclarations.js +0 -9
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_isTypeFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_isTypeFunctionDeclaration.js +0 -13
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonTypeAliasDeclaration.js +0 -10
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.js +0 -14
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_schemaVariableStatement.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_schemaVariableStatement.js +0 -37
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlWherePatternsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlWherePatternsFunctionDeclaration.js +0 -35
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toJsonFunctionDeclaration.js +0 -26
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toRdfFunctionDeclarations.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toRdfFunctionDeclarations.js +0 -43
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_typeAliasDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_typeAliasDeclaration.js +0 -10
- package/dist/generators/ts/_snippets/snippets_FromRdfOptions.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_FromRdfOptions.js +0 -5
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfParameters.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfParameters.js +0 -5
- package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunction.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunction.js +0 -6
- package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunctionParameters.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunctionParameters.js +0 -12
- package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunction.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunction.js +0 -6
- package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunctionParameters.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunctionParameters.js +0 -15
- /package/dist/generators/ts/{_ObjectType → _NamedObjectType}/Property.js +0 -0
- /package/dist/generators/ts/{_ObjectType → _NamedObjectType}/identifierTypeDeclarations.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
3
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
4
|
-
export function
|
|
4
|
+
export function NamedObjectType_toJsonFunctionOrMethodDeclaration() {
|
|
5
5
|
if (!this.features.has("json")) {
|
|
6
6
|
return Maybe.empty();
|
|
7
7
|
}
|
|
@@ -56,4 +56,4 @@ ${preamble}${syntheticNamePrefix}toJson(${joinCode(parameters, { on: ", " })}):
|
|
|
56
56
|
return JSON.parse(JSON.stringify({ ${joinCode(jsonObjectMembers, { on: "," })} } satisfies ${this.jsonType().name}));
|
|
57
57
|
}`);
|
|
58
58
|
}
|
|
59
|
-
//# sourceMappingURL=
|
|
59
|
+
//# sourceMappingURL=NamedObjectType_toJsonFunctionOrMethodDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_toRdfResourceFunctionOrMethodDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.d.ts.map
|
|
@@ -2,9 +2,10 @@ import { rdf } from "@tpluscode/rdf-ns-builders";
|
|
|
2
2
|
import { Maybe } from "purify-ts";
|
|
3
3
|
import { imports } from "../imports.js";
|
|
4
4
|
import { rdfjsTermExpression } from "../rdfjsTermExpression.js";
|
|
5
|
+
import { snippets } from "../snippets.js";
|
|
5
6
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
6
7
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
7
|
-
export function
|
|
8
|
+
export function NamedObjectType_toRdfResourceFunctionOrMethodDeclaration() {
|
|
8
9
|
if (!this.features.has("rdf")) {
|
|
9
10
|
return Maybe.empty();
|
|
10
11
|
}
|
|
@@ -17,7 +18,7 @@ export function ObjectType_toRdfFunctionOrMethodDeclaration() {
|
|
|
17
18
|
if (this.declarationType === "interface") {
|
|
18
19
|
parameters.push(code `${this.thisVariable}: ${this.name}`);
|
|
19
20
|
}
|
|
20
|
-
parameters.push(code `options?: {
|
|
21
|
+
parameters.push(code `options?: Parameters<${snippets.ToRdfResourceFunction}<${this.name}>>[1]`);
|
|
21
22
|
const statements = [
|
|
22
23
|
code `const ${variables.resourceSet} = options?.${variables.resourceSet} ?? new ${imports.ResourceSet}(${imports.datasetFactory}.dataset(), { dataFactory: ${imports.dataFactory} });`,
|
|
23
24
|
];
|
|
@@ -27,10 +28,10 @@ export function ObjectType_toRdfFunctionOrMethodDeclaration() {
|
|
|
27
28
|
switch (this.declarationType) {
|
|
28
29
|
case "class":
|
|
29
30
|
preamble = "override ";
|
|
30
|
-
superToRdfCall = code `super.${syntheticNamePrefix}
|
|
31
|
+
superToRdfCall = code `super.${syntheticNamePrefix}toRdfResource(${superToRdfOptions})`;
|
|
31
32
|
break;
|
|
32
33
|
case "interface":
|
|
33
|
-
superToRdfCall = code `${this.parentObjectTypes[0].staticModuleName}.${syntheticNamePrefix}
|
|
34
|
+
superToRdfCall = code `${this.parentObjectTypes[0].staticModuleName}.${syntheticNamePrefix}toRdfResource(${this.thisVariable}, ${superToRdfOptions})`;
|
|
34
35
|
break;
|
|
35
36
|
}
|
|
36
37
|
statements.push(code `const ${variables.resource} = ${superToRdfCall};`);
|
|
@@ -42,17 +43,18 @@ export function ObjectType_toRdfFunctionOrMethodDeclaration() {
|
|
|
42
43
|
statements.push(code `if (!options?.${variables.ignoreRdfType}) { ${joinCode(this.toRdfTypes.map((toRdfType) => code `${variables.resource}.add(${rdfjsTermExpression(rdf.type)}, ${imports.dataFactory}.namedNode("${toRdfType.value}"), options?.${variables.graph});`), { on: " " })} }`);
|
|
43
44
|
}
|
|
44
45
|
for (const property of this.properties) {
|
|
45
|
-
statements.push(...property.
|
|
46
|
+
statements.push(...property.toRdfRdfResourceValuesStatements({
|
|
46
47
|
variables: {
|
|
47
|
-
...variables,
|
|
48
48
|
graph: code `options?.${variables.graph}`,
|
|
49
|
+
resource: variables.resource,
|
|
50
|
+
resourceSet: variables.resourceSet,
|
|
49
51
|
value: code `${this.thisVariable}.${property.name}`,
|
|
50
52
|
},
|
|
51
53
|
}));
|
|
52
54
|
}
|
|
53
55
|
statements.push(code `return ${variables.resource};`);
|
|
54
56
|
return Maybe.of(code `\
|
|
55
|
-
${preamble}${syntheticNamePrefix}
|
|
57
|
+
${preamble}${syntheticNamePrefix}toRdfResource(${joinCode(parameters, { on: "," })}): ${this.toRdfjsResourceType} {
|
|
56
58
|
${joinCode(statements)}
|
|
57
59
|
}`);
|
|
58
60
|
}
|
|
@@ -62,4 +64,4 @@ const variables = {
|
|
|
62
64
|
resource: code `resource`,
|
|
63
65
|
resourceSet: code `resourceSet`,
|
|
64
66
|
};
|
|
65
|
-
//# sourceMappingURL=
|
|
67
|
+
//# sourceMappingURL=NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import { snippets } from "../snippets.js";
|
|
3
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
4
|
+
import { code } from "../ts-poet-wrapper.js";
|
|
5
|
+
export function NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration() {
|
|
6
|
+
if (!this.features.has("sparql")) {
|
|
7
|
+
return Maybe.empty();
|
|
8
|
+
}
|
|
9
|
+
return Maybe.of(code `\
|
|
10
|
+
export const ${syntheticNamePrefix}valueSparqlConstructTriples: ${snippets.ValueSparqlConstructTriplesFunction}<${this.filterType}, ${this.schemaType}> = ({ filter, ignoreRdfType, valueVariable, variablePrefix }) =>
|
|
11
|
+
${this.staticModuleName}.${syntheticNamePrefix}focusSparqlConstructTriples({ filter, focusIdentifier: valueVariable, ignoreRdfType, variablePrefix });`);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_valueSparqlWherePatternsFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import { snippets } from "../snippets.js";
|
|
3
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
4
|
+
import { code } from "../ts-poet-wrapper.js";
|
|
5
|
+
export function NamedObjectType_valueSparqlWherePatternsFunctionDeclaration() {
|
|
6
|
+
if (!this.features.has("sparql")) {
|
|
7
|
+
return Maybe.empty();
|
|
8
|
+
}
|
|
9
|
+
return Maybe.of(code `\
|
|
10
|
+
export const ${syntheticNamePrefix}valueSparqlWherePatterns: ${snippets.ValueSparqlWherePatternsFunction}<${this.filterType}, ${this.schemaType}> = ({ filter, ignoreRdfType, preferredLanguages, propertyPatterns, valueVariable, variablePrefix }) =>
|
|
11
|
+
(propertyPatterns as readonly ${snippets.SparqlPattern}[]).concat(
|
|
12
|
+
${this.staticModuleName}.${syntheticNamePrefix}focusSparqlWherePatterns({ filter, focusIdentifier: valueVariable, ignoreRdfType, preferredLanguages, variablePrefix })
|
|
13
|
+
);`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Type } from "../Type.js";
|
|
2
|
+
import type { DiscriminantProperty } from "./DiscriminantProperty.js";
|
|
2
3
|
import type { IdentifierPrefixProperty } from "./IdentifierPrefixProperty.js";
|
|
3
4
|
import type { IdentifierProperty } from "./IdentifierProperty.js";
|
|
4
5
|
import type { ShaclProperty } from "./ShaclProperty.js";
|
|
5
|
-
|
|
6
|
-
export type Property = IdentifierProperty | IdentifierPrefixProperty | ShaclProperty<Type> | TypeDiscriminantProperty;
|
|
6
|
+
export type Property = IdentifierProperty | IdentifierPrefixProperty | ShaclProperty<Type> | DiscriminantProperty;
|
|
7
7
|
//# sourceMappingURL=Property.d.ts.map
|
|
@@ -29,7 +29,7 @@ export declare class ShaclProperty<TypeT extends Type> extends AbstractProperty<
|
|
|
29
29
|
get getAccessorDeclaration(): Maybe<Code>;
|
|
30
30
|
get graphqlField(): AbstractProperty<TypeT>["graphqlField"];
|
|
31
31
|
get jsonSignature(): Maybe<Code>;
|
|
32
|
-
get
|
|
32
|
+
get jsonZchema(): AbstractProperty<TypeT>["jsonZchema"];
|
|
33
33
|
protected get schemaObject(): {
|
|
34
34
|
path: Code | undefined;
|
|
35
35
|
kind: Code;
|
|
@@ -37,12 +37,12 @@ export declare class ShaclProperty<TypeT extends Type> extends AbstractProperty<
|
|
|
37
37
|
};
|
|
38
38
|
constructorStatements({ variables, }: Parameters<AbstractProperty<TypeT>["constructorStatements"]>[0]): readonly Code[];
|
|
39
39
|
fromJsonStatements({ variables, }: Parameters<AbstractProperty<TypeT>["fromJsonStatements"]>[0]): readonly Code[];
|
|
40
|
-
|
|
40
|
+
fromRdfResourceValuesExpression({ variables, }: Parameters<AbstractProperty<TypeT>["fromRdfResourceValuesExpression"]>[0]): Maybe<Code>;
|
|
41
41
|
hashStatements(parameters: Parameters<AbstractProperty<TypeT>["hashStatements"]>[0]): readonly Code[];
|
|
42
42
|
jsonUiSchemaElement({ variables, }: Parameters<AbstractProperty<TypeT>["jsonUiSchemaElement"]>[0]): Maybe<Code>;
|
|
43
43
|
sparqlConstructTriplesExpression({ variables, }: Parameters<AbstractProperty<TypeT>["sparqlConstructTriplesExpression"]>[0]): Maybe<Code>;
|
|
44
44
|
sparqlWherePatternsExpression({ variables, }: Parameters<AbstractProperty<TypeT>["sparqlWherePatternsExpression"]>[0]): ReturnType<AbstractProperty<TypeT>["sparqlWherePatternsExpression"]>;
|
|
45
45
|
toJsonObjectMemberExpression(parameters: Parameters<AbstractProperty<TypeT>["toJsonObjectMemberExpression"]>[0]): Maybe<Code>;
|
|
46
|
-
|
|
46
|
+
toRdfRdfResourceValuesStatements({ variables, }: Parameters<AbstractProperty<TypeT>["toRdfRdfResourceValuesStatements"]>[0]): readonly Code[];
|
|
47
47
|
}
|
|
48
48
|
//# sourceMappingURL=ShaclProperty.d.ts.map
|
|
@@ -59,7 +59,7 @@ export class ShaclProperty extends AbstractProperty {
|
|
|
59
59
|
}
|
|
60
60
|
get declaration() {
|
|
61
61
|
const lhs = [];
|
|
62
|
-
if (this.
|
|
62
|
+
if (this.namedObjectType.declarationType === "class" &&
|
|
63
63
|
this.visibility !== "public") {
|
|
64
64
|
lhs.push(code `${this.visibility}`);
|
|
65
65
|
}
|
|
@@ -103,8 +103,8 @@ export class ShaclProperty extends AbstractProperty {
|
|
|
103
103
|
const typeJsonType = this.type.jsonType();
|
|
104
104
|
return Maybe.of(code `readonly ${this.name}${typeJsonType.optional ? "?" : ""}: ${typeJsonType.requiredName}`);
|
|
105
105
|
}
|
|
106
|
-
get
|
|
107
|
-
let schema = this.type.
|
|
106
|
+
get jsonZchema() {
|
|
107
|
+
let schema = this.type.jsonSchema({
|
|
108
108
|
context: "property",
|
|
109
109
|
});
|
|
110
110
|
this.comment.alt(this.description).ifJust((description) => {
|
|
@@ -120,7 +120,7 @@ export class ShaclProperty extends AbstractProperty {
|
|
|
120
120
|
...super.schemaObject,
|
|
121
121
|
// comment: this.comment.map(JSON.stringify).extract(),
|
|
122
122
|
// description: this.description.map(JSON.stringify).extract(),
|
|
123
|
-
path: this.
|
|
123
|
+
path: this.namedObjectType.features.has("rdf")
|
|
124
124
|
? propertyPathToCode(this.path)
|
|
125
125
|
: undefined,
|
|
126
126
|
// label: this.label.map(JSON.stringify).extract(),
|
|
@@ -135,7 +135,7 @@ export class ShaclProperty extends AbstractProperty {
|
|
|
135
135
|
constructorStatements({ variables, }) {
|
|
136
136
|
const typeConversions = this.type.conversions;
|
|
137
137
|
if (typeConversions.length === 1) {
|
|
138
|
-
switch (this.
|
|
138
|
+
switch (this.namedObjectType.declarationType) {
|
|
139
139
|
case "class":
|
|
140
140
|
return [code `this.${this.name} = ${variables.parameter};`];
|
|
141
141
|
case "interface":
|
|
@@ -144,7 +144,7 @@ export class ShaclProperty extends AbstractProperty {
|
|
|
144
144
|
}
|
|
145
145
|
let lhs;
|
|
146
146
|
const statements = [];
|
|
147
|
-
switch (this.
|
|
147
|
+
switch (this.namedObjectType.declarationType) {
|
|
148
148
|
case "class":
|
|
149
149
|
lhs = `this.${this.name}`;
|
|
150
150
|
break;
|
|
@@ -164,7 +164,7 @@ export class ShaclProperty extends AbstractProperty {
|
|
|
164
164
|
code `const ${this.name} = ${this.type.fromJsonExpression({ variables: { value: code `${variables.jsonObject}["${this.name}"]` } })};`,
|
|
165
165
|
];
|
|
166
166
|
}
|
|
167
|
-
|
|
167
|
+
fromRdfResourceValuesExpression({ variables, }) {
|
|
168
168
|
// Assume the property has the correct range and ignore the object's RDF type.
|
|
169
169
|
// This also accommodates the case where the object of a property is a dangling identifier that's not the
|
|
170
170
|
// subject of any statements.
|
|
@@ -172,11 +172,11 @@ export class ShaclProperty extends AbstractProperty {
|
|
|
172
172
|
graph: variables.graph,
|
|
173
173
|
resource: variables.resource,
|
|
174
174
|
propertySchema: code `${syntheticNamePrefix}schema.properties.${this.name}`,
|
|
175
|
-
typeFromRdf: code `((resourceValues) => ${this.type.
|
|
175
|
+
typeFromRdf: code `((resourceValues) => ${this.type.fromRdfResourceValuesExpression({
|
|
176
176
|
variables: {
|
|
177
177
|
...variables,
|
|
178
178
|
ignoreRdfType: true,
|
|
179
|
-
propertyPath: code `${this.
|
|
179
|
+
propertyPath: code `${this.namedObjectType.staticModuleName}.${syntheticNamePrefix}schema.properties.${this.name}.path`,
|
|
180
180
|
resourceValues: code `resourceValues`,
|
|
181
181
|
},
|
|
182
182
|
})})`,
|
|
@@ -200,7 +200,7 @@ export class ShaclProperty extends AbstractProperty {
|
|
|
200
200
|
ignoreRdfType: true,
|
|
201
201
|
propertyName: this.name,
|
|
202
202
|
propertySchema: code `${syntheticNamePrefix}schema.properties.${this.name}`,
|
|
203
|
-
typeSparqlConstructTriples: this.type.
|
|
203
|
+
typeSparqlConstructTriples: this.type.valueSparqlConstructTriplesFunction,
|
|
204
204
|
variablePrefix: variables.variablePrefix,
|
|
205
205
|
}})`);
|
|
206
206
|
}
|
|
@@ -215,7 +215,7 @@ export class ShaclProperty extends AbstractProperty {
|
|
|
215
215
|
preferredLanguages: variables.preferredLanguages,
|
|
216
216
|
propertyName: this.name,
|
|
217
217
|
propertySchema: code `${syntheticNamePrefix}schema.properties.${this.name}`,
|
|
218
|
-
typeSparqlWherePatterns: this.type.
|
|
218
|
+
typeSparqlWherePatterns: this.type.valueSparqlWherePatternsFunction,
|
|
219
219
|
variablePrefix: variables.variablePrefix,
|
|
220
220
|
}})`,
|
|
221
221
|
});
|
|
@@ -223,7 +223,7 @@ export class ShaclProperty extends AbstractProperty {
|
|
|
223
223
|
toJsonObjectMemberExpression(parameters) {
|
|
224
224
|
return Maybe.of(code `${this.name}: ${this.type.toJsonExpression(parameters)}`);
|
|
225
225
|
}
|
|
226
|
-
|
|
226
|
+
toRdfRdfResourceValuesStatements({ variables, }) {
|
|
227
227
|
switch (this.path.termType) {
|
|
228
228
|
case "NamedNode":
|
|
229
229
|
break;
|
|
@@ -237,7 +237,7 @@ export class ShaclProperty extends AbstractProperty {
|
|
|
237
237
|
}
|
|
238
238
|
const propertyPath = propertyPathToCode(this.path);
|
|
239
239
|
return [
|
|
240
|
-
code `${variables.resource}.add(${propertyPath}, ${this.type.
|
|
240
|
+
code `${variables.resource}.add(${propertyPath}, ${this.type.toRdfResourceValuesExpression({
|
|
241
241
|
variables: { ...variables, propertyPath },
|
|
242
242
|
})}, ${variables.graph});`,
|
|
243
243
|
];
|
|
@@ -263,5 +263,5 @@ __decorate([
|
|
|
263
263
|
], ShaclProperty.prototype, "jsonSignature", null);
|
|
264
264
|
__decorate([
|
|
265
265
|
Memoize()
|
|
266
|
-
], ShaclProperty.prototype, "
|
|
266
|
+
], ShaclProperty.prototype, "jsonZchema", null);
|
|
267
267
|
//# sourceMappingURL=ShaclProperty.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { imports } from "../imports.js";
|
|
2
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
|
+
export const snippets_FocusSparqlConstructTriplesFunction = conditionalOutput(`${syntheticNamePrefix}FocusSparqlConstructTriplesFunction`, code `\
|
|
5
|
+
type ${syntheticNamePrefix}FocusSparqlConstructTriplesFunction<FilterT> =
|
|
6
|
+
(parameters: {
|
|
7
|
+
filter: FilterT | undefined;
|
|
8
|
+
focusIdentifier: ${imports.NamedNode} | ${imports.Variable};
|
|
9
|
+
ignoreRdfType: boolean;
|
|
10
|
+
variablePrefix: string;
|
|
11
|
+
}) => readonly ${imports.sparqljs}.Triple[];`);
|
|
12
|
+
//# sourceMappingURL=snippets_FocusSparqlConstructTriplesFunction.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { imports } from "../imports.js";
|
|
2
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
|
+
import { snippets_SparqlPattern } from "./snippets_SparqlPattern.js";
|
|
5
|
+
export const snippets_FocusSparqlWherePatternsFunction = conditionalOutput(`${syntheticNamePrefix}FocusSparqlWherePatternsFunction`, code `\
|
|
6
|
+
type ${syntheticNamePrefix}FocusSparqlWherePatternsFunction<FilterT> =
|
|
7
|
+
(parameters: {
|
|
8
|
+
filter: FilterT | undefined;
|
|
9
|
+
focusIdentifier: ${imports.NamedNode} | ${imports.Variable};
|
|
10
|
+
ignoreRdfType: boolean;
|
|
11
|
+
preferredLanguages: readonly string[] | undefined;
|
|
12
|
+
variablePrefix: string;
|
|
13
|
+
}) => readonly ${snippets_SparqlPattern}[];`);
|
|
14
|
+
//# sourceMappingURL=snippets_FocusSparqlWherePatternsFunction.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { imports } from "../imports.js";
|
|
2
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
|
+
export const snippets_FromRdfResourceFunction = conditionalOutput(`${syntheticNamePrefix}FromRdfResourceFunction`, code `\
|
|
5
|
+
export type ${syntheticNamePrefix}FromRdfResourceFunction<T> = (
|
|
6
|
+
resource: ${imports.Resource},
|
|
7
|
+
options?: {
|
|
8
|
+
context?: unknown;
|
|
9
|
+
graph?: Exclude<${imports.Quad_Graph}, ${imports.Variable}>;
|
|
10
|
+
ignoreRdfType?: boolean;
|
|
11
|
+
objectSet?: ${syntheticNamePrefix}ObjectSet;
|
|
12
|
+
preferredLanguages?: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
) => ${imports.Either}<Error, T>`);
|
|
15
|
+
//# sourceMappingURL=snippets_FromRdfResourceFunction.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { imports } from "../imports.js";
|
|
2
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
|
+
export const snippets_FromRdfResourceValuesFunction = conditionalOutput(`${syntheticNamePrefix}FromRdfResourceValuesFunction`, code `\
|
|
5
|
+
export type ${syntheticNamePrefix}FromRdfResourceValuesFunction<T> = (
|
|
6
|
+
resourceValues: ${imports.Either}<Error, ${imports.Resource}.Values>,
|
|
7
|
+
options: {
|
|
8
|
+
context?: unknown;
|
|
9
|
+
graph?: Exclude<${imports.Quad_Graph}, ${imports.Variable}>;
|
|
10
|
+
ignoreRdfType?: boolean;
|
|
11
|
+
objectSet?: ${syntheticNamePrefix}ObjectSet;
|
|
12
|
+
preferredLanguages?: readonly string[];
|
|
13
|
+
propertyPath: ${syntheticNamePrefix}PropertyPath;
|
|
14
|
+
resource: ${imports.Resource};
|
|
15
|
+
}
|
|
16
|
+
) => ${imports.Either}<Error, ${imports.Resource}.Values<T>>;`);
|
|
17
|
+
//# sourceMappingURL=snippets_FromRdfResourceValuesFunction.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { imports } from "../imports.js";
|
|
2
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
|
+
export const snippets_PropertiesFromRdfResourceFunction = conditionalOutput(`${syntheticNamePrefix}PropertiesFromRdfResourceFunction`, code `\
|
|
5
|
+
type ${syntheticNamePrefix}PropertiesFromRdfResourceFunction<T> = (
|
|
6
|
+
resource: ${imports.Resource},
|
|
7
|
+
options: {
|
|
8
|
+
context: undefined | unknown;
|
|
9
|
+
graph: Exclude<${imports.Quad_Graph}, ${imports.Variable}> | undefined;
|
|
10
|
+
ignoreRdfType: boolean;
|
|
11
|
+
objectSet: ${syntheticNamePrefix}ObjectSet;
|
|
12
|
+
preferredLanguages?: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
) => ${imports.Either}<Error, T>;`);
|
|
15
|
+
//# sourceMappingURL=snippets_PropertiesFromRdfResourceFunction.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { imports } from "../imports.js";
|
|
2
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
|
+
import { snippets_FromRdfResourceFunction } from "./snippets_FromRdfResourceFunction.js";
|
|
5
|
+
import { snippets_FromRdfResourceValuesFunction } from "./snippets_FromRdfResourceValuesFunction.js";
|
|
6
|
+
import { snippets_ToRdfResourceFunction } from "./snippets_ToRdfResourceFunction.js";
|
|
7
|
+
/**
|
|
8
|
+
* Adapter between generated code and the rdfjs-resource PropertyPath.
|
|
9
|
+
*/
|
|
10
|
+
export const snippets_PropertyPath = conditionalOutput(`${syntheticNamePrefix}PropertyPath`, code `\
|
|
11
|
+
export type ${syntheticNamePrefix}PropertyPath = ${imports.RdfjsResourcePropertyPath};
|
|
12
|
+
|
|
13
|
+
export namespace ${syntheticNamePrefix}PropertyPath {
|
|
14
|
+
export type $Filter = object;
|
|
15
|
+
|
|
16
|
+
export function $filter(_filter: $Filter, _value: ${syntheticNamePrefix}PropertyPath): boolean {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const ${syntheticNamePrefix}fromRdfResource: ${snippets_FromRdfResourceFunction}<${syntheticNamePrefix}PropertyPath> = ${imports.RdfjsResourcePropertyPath}.fromResource;
|
|
21
|
+
|
|
22
|
+
export const $fromRdfResourceValues: ${snippets_FromRdfResourceValuesFunction}<${syntheticNamePrefix}PropertyPath> = (values, options) =>
|
|
23
|
+
values.chain((values) =>
|
|
24
|
+
values.chainMap((value) =>
|
|
25
|
+
value
|
|
26
|
+
.toResource()
|
|
27
|
+
.chain((resource) => ${syntheticNamePrefix}fromRdfResource(resource, options)),
|
|
28
|
+
),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export const $schema: Readonly<object> = {};
|
|
32
|
+
|
|
33
|
+
export const ${syntheticNamePrefix}toRdfResource: ${snippets_ToRdfResourceFunction}<${syntheticNamePrefix}PropertyPath> = ${imports.RdfjsResourcePropertyPath}.toResource;
|
|
34
|
+
}`);
|
|
35
|
+
//# sourceMappingURL=snippets_PropertyPath.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { imports } from "../imports.js";
|
|
2
1
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
2
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
3
|
+
import { snippets_PropertyPath } from "./snippets_PropertyPath.js";
|
|
4
4
|
export const snippets_ShaclPropertySchema = conditionalOutput(`${syntheticNamePrefix}ShaclPropertySchema`, code `\
|
|
5
5
|
export interface ${syntheticNamePrefix}ShaclPropertySchema<TypeSchemaT = object> {
|
|
6
6
|
readonly kind: "Shacl";
|
|
7
|
-
readonly path: ${
|
|
7
|
+
readonly path: ${snippets_PropertyPath};
|
|
8
8
|
readonly type: () => TypeSchemaT;
|
|
9
9
|
}`);
|
|
10
10
|
//# sourceMappingURL=snippets_ShaclPropertySchema.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { imports } from "../imports.js";
|
|
2
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
|
+
export const snippets_ToRdfResourceFunction = conditionalOutput(`${syntheticNamePrefix}ToRdfResourceFunction`, code `\
|
|
5
|
+
export type ${syntheticNamePrefix}ToRdfResourceFunction<T> =
|
|
6
|
+
(value: T, options?: { graph?: Exclude<${imports.Quad_Graph}, ${imports.Variable}>; ignoreRdfType?: boolean; resourceSet?: ${imports.ResourceSet}; }) => ${imports.Resource};`);
|
|
7
|
+
//# sourceMappingURL=snippets_ToRdfResourceFunction.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { imports } from "../imports.js";
|
|
2
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
|
+
import { snippets_PropertyPath } from "./snippets_PropertyPath.js";
|
|
5
|
+
export const snippets_ToRdfResourceValuesFunction = conditionalOutput(`${syntheticNamePrefix}ToRdfResourceValuesFunction`, code `\
|
|
6
|
+
export type ${syntheticNamePrefix}ToRdfResourceValuesFunction<T> =
|
|
7
|
+
(value: T,
|
|
8
|
+
options: {
|
|
9
|
+
graph?: Exclude<${imports.Quad_Graph}, ${imports.Variable}>;
|
|
10
|
+
ignoreRdfType?: boolean;
|
|
11
|
+
propertyPath: ${snippets_PropertyPath};
|
|
12
|
+
resource: ${imports.Resource};
|
|
13
|
+
resourceSet: ${imports.ResourceSet};
|
|
14
|
+
}
|
|
15
|
+
) => (bigint | boolean | number | string | ${imports.BlankNode} | ${imports.Literal} | ${imports.NamedNode})[];`);
|
|
16
|
+
//# sourceMappingURL=snippets_ToRdfResourceValuesFunction.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { imports } from "../imports.js";
|
|
2
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
|
+
export const snippets_ValueSparqlConstructTriplesFunction = conditionalOutput(`${syntheticNamePrefix}ValueSparqlConstructTriplesFunction`, code `\
|
|
5
|
+
type ${syntheticNamePrefix}ValueSparqlConstructTriplesFunction<FilterT, SchemaT> =
|
|
6
|
+
(parameters: {
|
|
7
|
+
filter: FilterT | undefined;
|
|
8
|
+
ignoreRdfType: boolean;
|
|
9
|
+
schema: SchemaT;
|
|
10
|
+
valueVariable: ${imports.Variable};
|
|
11
|
+
variablePrefix: string;
|
|
12
|
+
}) => readonly ${imports.sparqljs}.Triple[];`);
|
|
13
|
+
//# sourceMappingURL=snippets_ValueSparqlConstructTriplesFunction.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { imports } from "../imports.js";
|
|
2
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
|
+
import { snippets_SparqlPattern } from "./snippets_SparqlPattern.js";
|
|
5
|
+
export const snippets_ValueSparqlWherePatternsFunction = conditionalOutput(`${syntheticNamePrefix}ValueSparqlWherePatternsFunction`, code `\
|
|
6
|
+
type ${syntheticNamePrefix}ValueSparqlWherePatternsFunction<FilterT, SchemaT> =
|
|
7
|
+
(parameters: {
|
|
8
|
+
filter: FilterT | undefined;
|
|
9
|
+
ignoreRdfType: boolean;
|
|
10
|
+
preferredLanguages: readonly string[] | undefined;
|
|
11
|
+
propertyPatterns: readonly ${snippets_SparqlPattern}[];
|
|
12
|
+
schema: SchemaT;
|
|
13
|
+
valueVariable: ${imports.Variable};
|
|
14
|
+
variablePrefix: string;
|
|
15
|
+
}) => readonly ${snippets_SparqlPattern}[];`);
|
|
16
|
+
//# sourceMappingURL=snippets_ValueSparqlWherePatternsFunction.js.map
|
|
@@ -6,9 +6,9 @@ import { snippets_NumericFilter } from "./snippets_NumericFilter.js";
|
|
|
6
6
|
import { snippets_NumericSchema } from "./snippets_NumericSchema.js";
|
|
7
7
|
import { snippets_SparqlFilterPattern } from "./snippets_SparqlFilterPattern.js";
|
|
8
8
|
import { snippets_SparqlPattern } from "./snippets_SparqlPattern.js";
|
|
9
|
-
import {
|
|
9
|
+
import { snippets_ValueSparqlWherePatternsFunction } from "./snippets_ValueSparqlWherePatternsFunction.js";
|
|
10
10
|
export const snippets_bigDecimalSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}bigDecimalSparqlWherePatterns`, code `\
|
|
11
|
-
|
|
11
|
+
const ${syntheticNamePrefix}bigDecimalSparqlWherePatterns: ${snippets_ValueSparqlWherePatternsFunction}<${snippets_NumericFilter}<${imports.BigDecimal}>, ${snippets_NumericSchema}<${imports.BigDecimal}>> = ({ filter, propertyPatterns, schema, valueVariable }) => {
|
|
12
12
|
const filterPatterns: ${snippets_SparqlFilterPattern}[] = [];
|
|
13
13
|
|
|
14
14
|
if (filter) {
|
|
@@ -2,8 +2,8 @@ import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
|
2
2
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
3
3
|
import { snippets_BlankNodeFilter } from "./snippets_BlankNodeFilter.js";
|
|
4
4
|
import { snippets_BlankNodeSchema } from "./snippets_BlankNodeSchema.js";
|
|
5
|
-
import {
|
|
5
|
+
import { snippets_ValueSparqlWherePatternsFunction } from "./snippets_ValueSparqlWherePatternsFunction.js";
|
|
6
6
|
export const snippets_blankNodeSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}blankNodeSparqlWherePatterns`, code `\
|
|
7
|
-
const ${syntheticNamePrefix}blankNodeSparqlWherePatterns: ${
|
|
7
|
+
const ${syntheticNamePrefix}blankNodeSparqlWherePatterns: ${snippets_ValueSparqlWherePatternsFunction}<${snippets_BlankNodeFilter}, ${snippets_BlankNodeSchema}> =
|
|
8
8
|
({ propertyPatterns }) => propertyPatterns;`);
|
|
9
9
|
//# sourceMappingURL=snippets_blankNodeSparqlWherePatterns.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { code, conditionalOutput } from "ts-poet";
|
|
2
1
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
2
|
+
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
3
3
|
import { snippets_EqualsResult } from "./snippets_EqualsResult.js";
|
|
4
4
|
export const snippets_booleanEquals = conditionalOutput(`${syntheticNamePrefix}booleanEquals`, code `\
|
|
5
5
|
/**
|
|
@@ -3,11 +3,11 @@ import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
|
3
3
|
import { snippets_BooleanFilter } from "./snippets_BooleanFilter.js";
|
|
4
4
|
import { snippets_BooleanSchema } from "./snippets_BooleanSchema.js";
|
|
5
5
|
import { snippets_SparqlFilterPattern } from "./snippets_SparqlFilterPattern.js";
|
|
6
|
-
import { snippets_SparqlWherePatternsFunction } from "./snippets_SparqlWherePatternsFunction.js";
|
|
7
6
|
import { snippets_sparqlValueInPattern } from "./snippets_sparqlValueInPattern.js";
|
|
8
7
|
import { snippets_termSchemaSparqlPatterns } from "./snippets_termSchemaSparqlPatterns.js";
|
|
8
|
+
import { snippets_ValueSparqlWherePatternsFunction } from "./snippets_ValueSparqlWherePatternsFunction.js";
|
|
9
9
|
export const snippets_booleanSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}booleanSparqlWherePatterns`, code `\
|
|
10
|
-
const ${syntheticNamePrefix}booleanSparqlWherePatterns: ${
|
|
10
|
+
const ${syntheticNamePrefix}booleanSparqlWherePatterns: ${snippets_ValueSparqlWherePatternsFunction}<${snippets_BooleanFilter}, ${snippets_BooleanSchema}> =
|
|
11
11
|
({ filter, valueVariable, ...otherParameters }) => {
|
|
12
12
|
const filterPatterns: ${snippets_SparqlFilterPattern}[] = [];
|
|
13
13
|
|
|
@@ -5,10 +5,10 @@ import { snippets_DateSchema } from "./snippets_DateSchema.js";
|
|
|
5
5
|
import { snippets_literalFactory } from "./snippets_literalFactory.js";
|
|
6
6
|
import { snippets_RdfVocabularies } from "./snippets_RdfVocabularies.js";
|
|
7
7
|
import { snippets_SparqlFilterPattern } from "./snippets_SparqlFilterPattern.js";
|
|
8
|
-
import { snippets_SparqlWherePatternsFunction } from "./snippets_SparqlWherePatternsFunction.js";
|
|
9
8
|
import { snippets_termSchemaSparqlPatterns } from "./snippets_termSchemaSparqlPatterns.js";
|
|
9
|
+
import { snippets_ValueSparqlWherePatternsFunction } from "./snippets_ValueSparqlWherePatternsFunction.js";
|
|
10
10
|
export const snippets_dateSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}dateSparqlWherePatterns`, code `\
|
|
11
|
-
const ${syntheticNamePrefix}dateSparqlWherePatterns: ${
|
|
11
|
+
const ${syntheticNamePrefix}dateSparqlWherePatterns: ${snippets_ValueSparqlWherePatternsFunction}<${snippets_DateFilter}, ${snippets_DateSchema}> =
|
|
12
12
|
({ filter, schema, valueVariable, ...otherParameters }) => {
|
|
13
13
|
const filterPatterns: ${snippets_SparqlFilterPattern}[] = [];
|
|
14
14
|
|
|
@@ -2,9 +2,9 @@ import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
|
2
2
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
3
3
|
import { snippets_DefaultValueSchema } from "./snippets_DefaultValueSchema.js";
|
|
4
4
|
import { snippets_liftSparqlPatterns } from "./snippets_liftSparqlPatterns.js";
|
|
5
|
-
import {
|
|
5
|
+
import { snippets_ValueSparqlWherePatternsFunction } from "./snippets_ValueSparqlWherePatternsFunction.js";
|
|
6
6
|
export const snippets_defaultValueSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}defaultValueSparqlWherePatterns`, code `\
|
|
7
|
-
function ${syntheticNamePrefix}defaultValueSparqlWherePatterns<ItemFilterT, ItemSchemaT>(itemSparqlWherePatternsFunction: ${
|
|
7
|
+
function ${syntheticNamePrefix}defaultValueSparqlWherePatterns<ItemFilterT, ItemSchemaT>(itemSparqlWherePatternsFunction: ${snippets_ValueSparqlWherePatternsFunction}<ItemFilterT, ItemSchemaT>): ${snippets_ValueSparqlWherePatternsFunction}<ItemFilterT, ${snippets_DefaultValueSchema}<ItemSchemaT>> {
|
|
8
8
|
return ({ schema, ...otherParameters }) => {
|
|
9
9
|
const [itemSparqlWherePatterns, liftSparqlPatterns] = ${snippets_liftSparqlPatterns}(itemSparqlWherePatternsFunction({ ...otherParameters, schema: schema.item() }));
|
|
10
10
|
return [{ patterns: itemSparqlWherePatterns.concat(), type: "optional" }, ...liftSparqlPatterns];
|
|
@@ -2,7 +2,7 @@ import { imports } from "../imports.js";
|
|
|
2
2
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
3
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
4
|
export const snippets_fromRdfLanguageIn = conditionalOutput(`${syntheticNamePrefix}fromRdfLanguageIn`, code `\
|
|
5
|
-
function ${syntheticNamePrefix}fromRdfLanguageIn(
|
|
5
|
+
function ${syntheticNamePrefix}fromRdfLanguageIn(values: ${imports.Resource}.Values, languageIn: readonly string[]): ${imports.Either}<Error, ${imports.Resource}.Values> {
|
|
6
6
|
return values.chainMap(value => value.toLiteral().chain(literal =>
|
|
7
7
|
languageIn.includes(literal.language) ?
|
|
8
8
|
${imports.Right}(value) :
|