@shaclmate/compiler 4.0.7 → 4.0.9
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 +4 -4
- 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 +16 -14
- package/dist/generators/ts/AbstractCollectionType.js +8 -10
- package/dist/generators/ts/AbstractContainerType.d.ts +8 -3
- package/dist/generators/ts/AbstractContainerType.js +9 -2
- 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 +11 -8
- package/dist/generators/ts/AbstractLazyObjectType.js +19 -14
- package/dist/generators/ts/AbstractNamedUnionType.d.ts +33 -0
- package/dist/generators/ts/AbstractNamedUnionType.js +193 -0
- package/dist/generators/ts/AbstractNumericType.d.ts +2 -2
- package/dist/generators/ts/AbstractNumericType.js +3 -3
- package/dist/generators/ts/AbstractTermType.d.ts +7 -4
- package/dist/generators/ts/AbstractTermType.js +7 -4
- package/dist/generators/ts/AbstractType.d.ts +29 -14
- 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 +3 -3
- package/dist/generators/ts/BigDecimalType.js +3 -3
- package/dist/generators/ts/BlankNodeType.d.ts +1 -1
- package/dist/generators/ts/BlankNodeType.js +1 -1
- package/dist/generators/ts/BooleanType.d.ts +2 -2
- package/dist/generators/ts/BooleanType.js +2 -2
- package/dist/generators/ts/DefaultValueType.d.ts +4 -4
- package/dist/generators/ts/DefaultValueType.js +14 -13
- package/dist/generators/ts/IdentifierType.d.ts +1 -1
- package/dist/generators/ts/IdentifierType.js +1 -1
- package/dist/generators/ts/IriType.d.ts +1 -1
- package/dist/generators/ts/IriType.js +1 -1
- package/dist/generators/ts/LazyObjectOptionType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectOptionType.js +9 -9
- package/dist/generators/ts/LazyObjectSetType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectSetType.js +7 -7
- package/dist/generators/ts/LazyObjectType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectType.js +7 -8
- package/dist/generators/ts/ListType.d.ts +8 -7
- package/dist/generators/ts/ListType.js +14 -13
- package/dist/generators/ts/LiteralType.d.ts +1 -1
- package/dist/generators/ts/LiteralType.js +2 -2
- package/dist/generators/ts/NamedObjectUnionType.d.ts +35 -0
- package/dist/generators/ts/NamedObjectUnionType.js +221 -0
- package/dist/generators/ts/NamedUnionType.d.ts +11 -0
- package/dist/generators/ts/NamedUnionType.js +13 -0
- package/dist/generators/ts/ObjectType.d.ts +34 -25
- package/dist/generators/ts/ObjectType.js +62 -52
- package/dist/generators/ts/OptionType.d.ts +4 -4
- package/dist/generators/ts/OptionType.js +10 -10
- package/dist/generators/ts/SetType.d.ts +4 -4
- package/dist/generators/ts/SetType.js +13 -11
- package/dist/generators/ts/StringType.d.ts +2 -2
- package/dist/generators/ts/StringType.js +2 -2
- package/dist/generators/ts/TermType.d.ts +1 -1
- package/dist/generators/ts/TermType.js +2 -2
- package/dist/generators/ts/TsGenerator.js +23 -15
- package/dist/generators/ts/Type.d.ts +4 -3
- package/dist/generators/ts/TypeFactory.d.ts +7 -5
- package/dist/generators/ts/TypeFactory.js +117 -90
- package/dist/generators/ts/ZodGenerator.js +6 -6
- package/dist/generators/ts/_ObjectType/AbstractProperty.d.ts +3 -3
- package/dist/generators/ts/_ObjectType/{TypeDiscriminantProperty.d.ts → DiscriminantProperty.d.ts} +14 -14
- package/dist/generators/ts/_ObjectType/{TypeDiscriminantProperty.js → DiscriminantProperty.js} +10 -10
- package/dist/generators/ts/_ObjectType/IdentifierPrefixProperty.d.ts +2 -2
- package/dist/generators/ts/_ObjectType/IdentifierPrefixProperty.js +2 -2
- package/dist/generators/ts/_ObjectType/IdentifierProperty.d.ts +2 -2
- package/dist/generators/ts/_ObjectType/IdentifierProperty.js +7 -4
- package/dist/generators/ts/_ObjectType/ObjectType_classDeclaration.js +8 -8
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_sparqlConstructTriplesFunctionDeclaration.js → ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +6 -5
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_sparqlWherePatternsFunctionDeclarations.js → ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +5 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +20 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_fromRdfFunctionDeclaration.js → ObjectType_fromRdfResourceFunctionDeclaration.js} +6 -7
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +20 -0
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_parseJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_parseJsonFunctionDeclaration.js +19 -0
- package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.js +38 -0
- package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_propertiesFromRdfFunctionDeclaration.js → ObjectType_propertiesFromRdfResourceFunctionDeclaration.js} +16 -15
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +1 -2
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_toRdfFunctionOrMethodDeclaration.js → ObjectType_toRdfResourceFunctionOrMethodDeclaration.js} +10 -8
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +13 -0
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js +15 -0
- package/dist/generators/ts/_ObjectType/Property.d.ts +2 -2
- package/dist/generators/ts/_ObjectType/ShaclProperty.d.ts +2 -2
- package/dist/generators/ts/_ObjectType/ShaclProperty.js +6 -6
- 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 +2 -2
- package/dist/generators/ts/graphqlSchemaVariableStatement.js +4 -4
- package/dist/generators/ts/imports.d.ts +1 -1
- package/dist/generators/ts/imports.js +1 -1
- package/dist/generators/ts/objectSetDeclarations.d.ts +3 -3
- package/dist/generators/ts/objectSetDeclarations.js +15 -15
- package/dist/generators/ts/objectSetInterfaceDeclaration.d.ts +3 -3
- package/dist/generators/ts/objectSetInterfaceDeclaration.js +2 -2
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.d.ts +3 -3
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +16 -17
- package/dist/generators/ts/snippets.d.ts +10 -6
- package/dist/generators/ts/snippets.js +20 -12
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.d.ts +3 -3
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +7 -8
- package/dist/generators/ts/synthesizeUberObjectUnionType.d.ts +2 -2
- package/dist/generators/ts/synthesizeUberObjectUnionType.js +9 -4
- package/dist/input/NodeShape.d.ts +5 -6
- package/dist/input/NodeShape.js +19 -22
- package/dist/input/Ontology.d.ts +4 -4
- package/dist/input/Ontology.js +10 -10
- package/dist/input/PropertyShape.d.ts +4 -4
- package/dist/input/PropertyShape.js +10 -10
- package/dist/input/ShapesGraph.d.ts +3 -2
- package/dist/input/ShapesGraph.js +13 -8
- package/dist/input/generated.d.ts +2551 -2040
- package/dist/input/generated.js +2806 -2346
- package/package.json +3 -5
- 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/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_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_propertiesFromRdfFunctionDeclaration.d.ts +0 -5
- 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_toRdfFunctionOrMethodDeclaration.d.ts +0 -5
- 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
|
@@ -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) :
|
|
@@ -3,10 +3,10 @@ import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
|
3
3
|
import { snippets_IdentifierFilter } from "./snippets_IdentifierFilter.js";
|
|
4
4
|
import { snippets_IdentifierSchema } from "./snippets_IdentifierSchema.js";
|
|
5
5
|
import { snippets_SparqlPattern } from "./snippets_SparqlPattern.js";
|
|
6
|
-
import { snippets_SparqlWherePatternsFunction } from "./snippets_SparqlWherePatternsFunction.js";
|
|
7
6
|
import { snippets_sparqlValueInPattern } from "./snippets_sparqlValueInPattern.js";
|
|
7
|
+
import { snippets_ValueSparqlWherePatternsFunction } from "./snippets_ValueSparqlWherePatternsFunction.js";
|
|
8
8
|
export const snippets_identifierSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}identifierSparqlWherePatterns`, code `\
|
|
9
|
-
const ${syntheticNamePrefix}identifierSparqlWherePatterns: ${
|
|
9
|
+
const ${syntheticNamePrefix}identifierSparqlWherePatterns: ${snippets_ValueSparqlWherePatternsFunction}<${snippets_IdentifierFilter}, ${snippets_IdentifierSchema}> =
|
|
10
10
|
({ filter, propertyPatterns, valueVariable }) => {
|
|
11
11
|
const patterns: ${snippets_SparqlPattern}[] = propertyPatterns.concat();
|
|
12
12
|
|
|
@@ -3,11 +3,11 @@ import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
|
3
3
|
import { snippets_IriFilter } from "./snippets_IriFilter.js";
|
|
4
4
|
import { snippets_IriSchema } from "./snippets_IriSchema.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_iriSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}iriSparqlWherePatterns`, code `\
|
|
10
|
-
const ${syntheticNamePrefix}iriSparqlWherePatterns: ${
|
|
10
|
+
const ${syntheticNamePrefix}iriSparqlWherePatterns: ${snippets_ValueSparqlWherePatternsFunction}<${snippets_IriFilter}, ${snippets_IriSchema}> =
|
|
11
11
|
({ filter, valueVariable, ...otherParameters }) => {
|
|
12
12
|
const filterPatterns: ${snippets_SparqlFilterPattern}[] = [];
|
|
13
13
|
|
|
@@ -4,9 +4,9 @@ import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
|
4
4
|
import { snippets_CollectionFilter } from "./snippets_CollectionFilter.js";
|
|
5
5
|
import { snippets_CollectionSchema } from "./snippets_CollectionSchema.js";
|
|
6
6
|
import { snippets_RdfVocabularies } from "./snippets_RdfVocabularies.js";
|
|
7
|
-
import {
|
|
7
|
+
import { snippets_ValueSparqlConstructTriplesFunction } from "./snippets_ValueSparqlConstructTriplesFunction.js";
|
|
8
8
|
export const snippets_listSparqlConstructTriples = conditionalOutput(`${syntheticNamePrefix}listSparqlConstructTriples`, code `\
|
|
9
|
-
function ${syntheticNamePrefix}listSparqlConstructTriples<ItemFilterT, ItemSchemaT>(itemSparqlConstructTriplesFunction: ${
|
|
9
|
+
function ${syntheticNamePrefix}listSparqlConstructTriples<ItemFilterT, ItemSchemaT>(itemSparqlConstructTriplesFunction: ${snippets_ValueSparqlConstructTriplesFunction}<ItemFilterT, ItemSchemaT>): ${snippets_ValueSparqlConstructTriplesFunction}<${snippets_CollectionFilter}<ItemFilterT>, ${snippets_CollectionSchema}<ItemSchemaT>> {
|
|
10
10
|
return ({ filter, schema, valueVariable: listVariable, variablePrefix: variablePrefixPrefix }) => {
|
|
11
11
|
let triples: ${imports.sparqljs}.Triple[] = [];
|
|
12
12
|
const variable = (suffix: string) => ${imports.dataFactory}.variable!(\`\${variablePrefixPrefix}\${suffix}\`);
|
|
@@ -6,9 +6,9 @@ import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
|
6
6
|
import { snippets_CollectionFilter } from "./snippets_CollectionFilter.js";
|
|
7
7
|
import { snippets_CollectionSchema } from "./snippets_CollectionSchema.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_listSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}listSparqlWherePatterns`, code `\
|
|
11
|
-
function ${syntheticNamePrefix}listSparqlWherePatterns<ItemFilterT, ItemSchemaT>(itemSparqlWherePatternsFunction: ${
|
|
11
|
+
function ${syntheticNamePrefix}listSparqlWherePatterns<ItemFilterT, ItemSchemaT>(itemSparqlWherePatternsFunction: ${snippets_ValueSparqlWherePatternsFunction}<ItemFilterT, ItemSchemaT>): ${snippets_ValueSparqlWherePatternsFunction}<${snippets_CollectionFilter}<ItemFilterT>, ${snippets_CollectionSchema}<ItemSchemaT>> {
|
|
12
12
|
return (parameters) => {
|
|
13
13
|
// Need to handle two cases:
|
|
14
14
|
// (1) (?s, ?p, ?list) where ?list binds to rdf:nil
|
|
@@ -2,9 +2,9 @@ import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
|
2
2
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
3
3
|
import { snippets_LiteralFilter } from "./snippets_LiteralFilter.js";
|
|
4
4
|
import { snippets_LiteralSchema } from "./snippets_LiteralSchema.js";
|
|
5
|
-
import { snippets_SparqlWherePatternsFunction } from "./snippets_SparqlWherePatternsFunction.js";
|
|
6
5
|
import { snippets_termFilterSparqlPatterns } from "./snippets_termFilterSparqlPatterns.js";
|
|
6
|
+
import { snippets_ValueSparqlWherePatternsFunction } from "./snippets_ValueSparqlWherePatternsFunction.js";
|
|
7
7
|
export const snippets_literalSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}literalSparqlWherePatterns`, code `\
|
|
8
|
-
const ${syntheticNamePrefix}literalSparqlWherePatterns: ${
|
|
8
|
+
const ${syntheticNamePrefix}literalSparqlWherePatterns: ${snippets_ValueSparqlWherePatternsFunction}<${snippets_LiteralFilter}, ${snippets_LiteralSchema}> =
|
|
9
9
|
(parameters) => ${syntheticNamePrefix}literalSchemaSparqlPatterns({ filterPatterns: ${snippets_termFilterSparqlPatterns}(parameters), ...parameters });`);
|
|
10
10
|
//# sourceMappingURL=snippets_literalSparqlWherePatterns.js.map
|
|
@@ -2,9 +2,9 @@ import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
|
2
2
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
3
3
|
import { snippets_MaybeFilter } from "./snippets_MaybeFilter.js";
|
|
4
4
|
import { snippets_MaybeSchema } from "./snippets_MaybeSchema.js";
|
|
5
|
-
import {
|
|
5
|
+
import { snippets_ValueSparqlConstructTriplesFunction } from "./snippets_ValueSparqlConstructTriplesFunction.js";
|
|
6
6
|
export const snippets_maybeSparqlConstructTriples = conditionalOutput(`${syntheticNamePrefix}maybeSparqlConstructTriples`, code `\
|
|
7
|
-
function ${syntheticNamePrefix}maybeSparqlConstructTriples<ItemFilterT, ItemSchemaT>(itemSparqlConstructTriplesFunction: ${
|
|
7
|
+
function ${syntheticNamePrefix}maybeSparqlConstructTriples<ItemFilterT, ItemSchemaT>(itemSparqlConstructTriplesFunction: ${snippets_ValueSparqlConstructTriplesFunction}<ItemFilterT, ItemSchemaT>): ${snippets_ValueSparqlConstructTriplesFunction}<${snippets_MaybeFilter}<ItemFilterT>, ${snippets_MaybeSchema}<ItemSchemaT>> {
|
|
8
8
|
return ({ filter, schema, ...otherParameters }) => itemSparqlConstructTriplesFunction({ ...otherParameters, filter: filter ?? undefined, schema: schema.item() });
|
|
9
9
|
}`);
|
|
10
10
|
//# sourceMappingURL=snippets_maybeSparqlConstructTriples.js.map
|
|
@@ -3,9 +3,9 @@ import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
|
3
3
|
import { snippets_liftSparqlPatterns } from "./snippets_liftSparqlPatterns.js";
|
|
4
4
|
import { snippets_MaybeFilter } from "./snippets_MaybeFilter.js";
|
|
5
5
|
import { snippets_MaybeSchema } from "./snippets_MaybeSchema.js";
|
|
6
|
-
import {
|
|
6
|
+
import { snippets_ValueSparqlWherePatternsFunction } from "./snippets_ValueSparqlWherePatternsFunction.js";
|
|
7
7
|
export const snippets_maybeSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}maybeSparqlWherePatterns`, code `\
|
|
8
|
-
function ${syntheticNamePrefix}maybeSparqlWherePatterns<ItemFilterT, ItemSchemaT>(itemSparqlWherePatternsFunction: ${
|
|
8
|
+
function ${syntheticNamePrefix}maybeSparqlWherePatterns<ItemFilterT, ItemSchemaT>(itemSparqlWherePatternsFunction: ${snippets_ValueSparqlWherePatternsFunction}<ItemFilterT, ItemSchemaT>): ${snippets_ValueSparqlWherePatternsFunction}<${snippets_MaybeFilter}<ItemFilterT>, ${snippets_MaybeSchema}<ItemSchemaT>> {
|
|
9
9
|
return ({ filter, schema, ...otherParameters }) => {
|
|
10
10
|
if (filter === undefined) {
|
|
11
11
|
// Treat the item's patterns as optional
|
|
@@ -4,12 +4,11 @@ import { snippets_literalFactory } from "./snippets_literalFactory.js";
|
|
|
4
4
|
import { snippets_NumericFilter } from "./snippets_NumericFilter.js";
|
|
5
5
|
import { snippets_NumericSchema } from "./snippets_NumericSchema.js";
|
|
6
6
|
import { snippets_SparqlFilterPattern } from "./snippets_SparqlFilterPattern.js";
|
|
7
|
-
import { snippets_SparqlPattern } from "./snippets_SparqlPattern.js";
|
|
8
|
-
import { snippets_SparqlWherePatternsFunctionParameters } from "./snippets_SparqlWherePatternsFunctionParameters.js";
|
|
9
7
|
import { snippets_sparqlValueInPattern } from "./snippets_sparqlValueInPattern.js";
|
|
10
8
|
import { snippets_termSchemaSparqlPatterns } from "./snippets_termSchemaSparqlPatterns.js";
|
|
9
|
+
import { snippets_ValueSparqlWherePatternsFunction } from "./snippets_ValueSparqlWherePatternsFunction.js";
|
|
11
10
|
export const snippets_numericSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}numericSparqlWherePatterns`, code `\
|
|
12
|
-
function $
|
|
11
|
+
function $numericSparqlWherePatterns<T extends bigint | number>({ filter, valueVariable, ...otherParameters }: Parameters<${snippets_ValueSparqlWherePatternsFunction}<${snippets_NumericFilter}<T>, ${snippets_NumericSchema}<T>>>[0]): ReturnType<${snippets_ValueSparqlWherePatternsFunction}<${snippets_NumericFilter}<T>, ${snippets_NumericSchema}<T>>> {
|
|
13
12
|
const filterPatterns: ${snippets_SparqlFilterPattern}[] = [];
|
|
14
13
|
|
|
15
14
|
if (filter) {
|
|
@@ -2,9 +2,9 @@ import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
|
2
2
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
3
3
|
import { snippets_CollectionFilter } from "./snippets_CollectionFilter.js";
|
|
4
4
|
import { snippets_CollectionSchema } from "./snippets_CollectionSchema.js";
|
|
5
|
-
import {
|
|
5
|
+
import { snippets_ValueSparqlConstructTriplesFunction } from "./snippets_ValueSparqlConstructTriplesFunction.js";
|
|
6
6
|
export const snippets_setSparqlConstructTriples = conditionalOutput(`${syntheticNamePrefix}setSparqlConstructTriples`, code `\
|
|
7
|
-
function ${syntheticNamePrefix}setSparqlConstructTriples<ItemFilterT, ItemSchemaT>(itemSparqlConstructTriplesFunction: ${
|
|
7
|
+
function ${syntheticNamePrefix}setSparqlConstructTriples<ItemFilterT, ItemSchemaT>(itemSparqlConstructTriplesFunction: ${snippets_ValueSparqlConstructTriplesFunction}<ItemFilterT, ItemSchemaT>): ${snippets_ValueSparqlConstructTriplesFunction}<${snippets_CollectionFilter}<ItemFilterT>, ${snippets_CollectionSchema}<ItemSchemaT>> {
|
|
8
8
|
return ({ schema, ...otherParameters }) => itemSparqlConstructTriplesFunction({ ...otherParameters, schema: schema.item() });
|
|
9
9
|
}`);
|
|
10
10
|
//# sourceMappingURL=snippets_setSparqlConstructTriples.js.map
|
|
@@ -3,9 +3,9 @@ import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
|
3
3
|
import { snippets_CollectionFilter } from "./snippets_CollectionFilter.js";
|
|
4
4
|
import { snippets_CollectionSchema } from "./snippets_CollectionSchema.js";
|
|
5
5
|
import { snippets_liftSparqlPatterns } from "./snippets_liftSparqlPatterns.js";
|
|
6
|
-
import {
|
|
6
|
+
import { snippets_ValueSparqlWherePatternsFunction } from "./snippets_ValueSparqlWherePatternsFunction.js";
|
|
7
7
|
export const snippets_setSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}setSparqlWherePatterns`, code `\
|
|
8
|
-
function ${syntheticNamePrefix}setSparqlWherePatterns<ItemFilterT, ItemSchemaT>(itemSparqlWherePatternsFunction: ${
|
|
8
|
+
function ${syntheticNamePrefix}setSparqlWherePatterns<ItemFilterT, ItemSchemaT>(itemSparqlWherePatternsFunction: ${snippets_ValueSparqlWherePatternsFunction}<ItemFilterT, ItemSchemaT>): ${snippets_ValueSparqlWherePatternsFunction}<${snippets_CollectionFilter}<ItemFilterT>, ${snippets_CollectionSchema}<ItemSchemaT>> {
|
|
9
9
|
return ({ filter, schema, ...otherParameters }) => {
|
|
10
10
|
const itemSparqlWherePatterns = itemSparqlWherePatternsFunction({ ...otherParameters, filter, schema: schema.item() });
|
|
11
11
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { imports } from "../imports.js";
|
|
2
2
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
3
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
|
+
import { snippets_PropertyPath } from "./snippets_PropertyPath.js";
|
|
4
5
|
import { snippets_ShaclPropertySchema } from "./snippets_ShaclPropertySchema.js";
|
|
5
|
-
import {
|
|
6
|
+
import { snippets_ValueSparqlConstructTriplesFunction } from "./snippets_ValueSparqlConstructTriplesFunction.js";
|
|
6
7
|
export const snippets_shaclPropertySparqlConstructTriples = conditionalOutput(`${syntheticNamePrefix}shaclPropertySparqlConstructTriples`, code `\
|
|
7
8
|
function ${syntheticNamePrefix}shaclPropertySparqlConstructTriples<FilterT, TypeSchemaT>({ filter, focusIdentifier, ignoreRdfType, propertyName, propertySchema, typeSparqlConstructTriples, variablePrefix }: {
|
|
8
9
|
filter: FilterT | undefined;
|
|
@@ -10,13 +11,13 @@ function ${syntheticNamePrefix}shaclPropertySparqlConstructTriples<FilterT, Type
|
|
|
10
11
|
ignoreRdfType: boolean;
|
|
11
12
|
propertySchema: ${snippets_ShaclPropertySchema}<TypeSchemaT>;
|
|
12
13
|
propertyName: string;
|
|
13
|
-
typeSparqlConstructTriples: ${
|
|
14
|
+
typeSparqlConstructTriples: ${snippets_ValueSparqlConstructTriplesFunction}<FilterT, TypeSchemaT>;
|
|
14
15
|
variablePrefix: string;
|
|
15
16
|
}): readonly ${imports.sparqljs}.Triple[] {
|
|
16
17
|
const propertyPathSparqlConstructTriples = ({ end, propertyPath, start, variableCounter }: {
|
|
17
18
|
variableCounter: { value: number };
|
|
18
19
|
end: ${imports.Literal} | ${imports.NamedNode} | ${imports.Variable};
|
|
19
|
-
propertyPath: ${
|
|
20
|
+
propertyPath: ${snippets_PropertyPath};
|
|
20
21
|
start: ${imports.NamedNode} | ${imports.Variable};
|
|
21
22
|
}): readonly ${imports.sparqljs}.Triple[] => {
|
|
22
23
|
switch (propertyPath.termType) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { imports } from "../imports.js";
|
|
2
2
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
3
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
|
+
import { snippets_PropertyPath } from "./snippets_PropertyPath.js";
|
|
4
5
|
import { snippets_ShaclPropertySchema } from "./snippets_ShaclPropertySchema.js";
|
|
5
6
|
import { snippets_SparqlPattern } from "./snippets_SparqlPattern.js";
|
|
6
|
-
import { snippets_SparqlWherePatternsFunction } from "./snippets_SparqlWherePatternsFunction.js";
|
|
7
7
|
import { snippets_sparqlPropertyPath } from "./snippets_sparqlPropertyPath.js";
|
|
8
|
+
import { snippets_ValueSparqlWherePatternsFunction } from "./snippets_ValueSparqlWherePatternsFunction.js";
|
|
8
9
|
export const snippets_shaclPropertySparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}shaclPropertySparqlWherePatterns`, code `\
|
|
9
10
|
function ${syntheticNamePrefix}shaclPropertySparqlWherePatterns<FilterT, TypeSchemaT>({ filter, focusIdentifier, ignoreRdfType, preferredLanguages, propertyName, propertySchema, typeSparqlWherePatterns, variablePrefix }: {
|
|
10
11
|
filter: FilterT | undefined;
|
|
@@ -13,12 +14,12 @@ function ${syntheticNamePrefix}shaclPropertySparqlWherePatterns<FilterT, TypeSch
|
|
|
13
14
|
preferredLanguages: readonly string[] | undefined;
|
|
14
15
|
propertySchema: ${snippets_ShaclPropertySchema}<TypeSchemaT>;
|
|
15
16
|
propertyName: string;
|
|
16
|
-
typeSparqlWherePatterns: ${
|
|
17
|
+
typeSparqlWherePatterns: ${snippets_ValueSparqlWherePatternsFunction}<FilterT, TypeSchemaT>;
|
|
17
18
|
variablePrefix: string;
|
|
18
19
|
}): readonly ${snippets_SparqlPattern}[] {
|
|
19
20
|
const propertyPathSparqlWherePatterns = ({ end, propertyPath, start, variableCounter }: {
|
|
20
21
|
end: ${imports.Literal} | ${imports.NamedNode} | ${imports.Variable};
|
|
21
|
-
propertyPath: ${
|
|
22
|
+
propertyPath: ${snippets_PropertyPath};
|
|
22
23
|
start: ${imports.NamedNode} | ${imports.Variable};
|
|
23
24
|
variableCounter: { value: number };
|
|
24
25
|
}): ${snippets_SparqlPattern}[] => {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { imports } from "../imports.js";
|
|
2
2
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
3
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
4
|
+
import { snippets_PropertyPath } from "./snippets_PropertyPath.js";
|
|
4
5
|
export const snippets_sparqlPropertyPath = conditionalOutput(`${syntheticNamePrefix}sparqlPropertyPath`, code `\
|
|
5
6
|
/**
|
|
6
|
-
* Convert a ${
|
|
7
|
+
* Convert a ${snippets_PropertyPath} to a ${imports.sparqljs}.PropertyPath.
|
|
7
8
|
*/
|
|
8
|
-
function ${syntheticNamePrefix}sparqlPropertyPath(propertyPath: ${
|
|
9
|
+
function ${syntheticNamePrefix}sparqlPropertyPath(propertyPath: ${snippets_PropertyPath}): ${imports.NamedNode} | ${imports.sparqljs}.PropertyPath {
|
|
9
10
|
switch (propertyPath.termType) {
|
|
10
11
|
case "AlternativePath":
|
|
11
12
|
return {
|
|
@@ -3,12 +3,12 @@ import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
|
3
3
|
import { snippets_literalFactory } from "./snippets_literalFactory.js";
|
|
4
4
|
import { snippets_literalSchemaSparqlPatterns } from "./snippets_literalSchemaSparqlPatterns.js";
|
|
5
5
|
import { snippets_SparqlFilterPattern } from "./snippets_SparqlFilterPattern.js";
|
|
6
|
-
import { snippets_SparqlWherePatternsFunction } from "./snippets_SparqlWherePatternsFunction.js";
|
|
7
6
|
import { snippets_StringFilter } from "./snippets_StringFilter.js";
|
|
8
7
|
import { snippets_StringSchema } from "./snippets_StringSchema.js";
|
|
9
8
|
import { snippets_sparqlValueInPattern } from "./snippets_sparqlValueInPattern.js";
|
|
9
|
+
import { snippets_ValueSparqlWherePatternsFunction } from "./snippets_ValueSparqlWherePatternsFunction.js";
|
|
10
10
|
export const snippets_stringSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}stringSparqlWherePatterns`, code `\
|
|
11
|
-
const ${syntheticNamePrefix}stringSparqlWherePatterns: ${
|
|
11
|
+
const ${syntheticNamePrefix}stringSparqlWherePatterns: ${snippets_ValueSparqlWherePatternsFunction}<${snippets_StringFilter}, ${snippets_StringSchema}> =
|
|
12
12
|
({ filter, valueVariable, ...otherParameters }) => {
|
|
13
13
|
const filterPatterns: ${snippets_SparqlFilterPattern}[] = [];
|
|
14
14
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
2
2
|
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
3
|
-
import { snippets_SparqlWherePatternsFunction } from "./snippets_SparqlWherePatternsFunction.js";
|
|
4
3
|
import { snippets_TermFilter } from "./snippets_TermFilter.js";
|
|
5
4
|
import { snippets_TermSchema } from "./snippets_TermSchema.js";
|
|
6
5
|
import { snippets_termFilterSparqlPatterns } from "./snippets_termFilterSparqlPatterns.js";
|
|
7
6
|
import { snippets_termSchemaSparqlPatterns } from "./snippets_termSchemaSparqlPatterns.js";
|
|
7
|
+
import { snippets_ValueSparqlWherePatternsFunction } from "./snippets_ValueSparqlWherePatternsFunction.js";
|
|
8
8
|
export const snippets_termSparqlWherePatterns = conditionalOutput(`${syntheticNamePrefix}termSparqlWherePatterns`, code `\
|
|
9
|
-
const ${syntheticNamePrefix}termSparqlWherePatterns: ${
|
|
9
|
+
const ${syntheticNamePrefix}termSparqlWherePatterns: ${snippets_ValueSparqlWherePatternsFunction}<${snippets_TermFilter}, ${snippets_TermSchema}> =
|
|
10
10
|
(parameters) => ${snippets_termSchemaSparqlPatterns}({ filterPatterns: ${snippets_termFilterSparqlPatterns}(parameters), ...parameters })`);
|
|
11
11
|
//# sourceMappingURL=snippets_termSparqlWherePatterns.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectUnionType } from "./NamedObjectUnionType.js";
|
|
2
3
|
import type { ObjectType } from "./ObjectType.js";
|
|
3
|
-
import type { ObjectUnionType } from "./ObjectUnionType.js";
|
|
4
4
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
5
5
|
export declare function graphqlSchemaVariableStatement(parameters: {
|
|
6
6
|
objectTypes: readonly ObjectType[];
|
|
7
|
-
|
|
7
|
+
namedObjectUnionTypes: NamedObjectUnionType[];
|
|
8
8
|
}): Maybe<Code>;
|
|
9
9
|
//# sourceMappingURL=graphqlSchemaVariableStatement.d.ts.map
|
|
@@ -2,10 +2,10 @@ import { Maybe } from "purify-ts";
|
|
|
2
2
|
import { imports } from "./imports.js";
|
|
3
3
|
import { syntheticNamePrefix } from "./syntheticNamePrefix.js";
|
|
4
4
|
import { code } from "./ts-poet-wrapper.js";
|
|
5
|
-
function graphqlQueryObjectType({ objectTypes,
|
|
5
|
+
function graphqlQueryObjectType({ objectTypes, namedObjectUnionTypes, }) {
|
|
6
6
|
return code `new ${imports.GraphQLObjectType}<null, { objectSet: ${syntheticNamePrefix}ObjectSet }>({ name: "Query", fields: ${[
|
|
7
7
|
...objectTypes,
|
|
8
|
-
...
|
|
8
|
+
...namedObjectUnionTypes,
|
|
9
9
|
].reduce((fields, objectType) => {
|
|
10
10
|
fields[objectType.objectSetMethodNames.object] = {
|
|
11
11
|
args: {
|
|
@@ -71,12 +71,12 @@ async (_source, _args, { objectSet }): Promise<number> => (await objectSet.${obj
|
|
|
71
71
|
}
|
|
72
72
|
export function graphqlSchemaVariableStatement(parameters) {
|
|
73
73
|
const objectTypes = parameters.objectTypes.filter((objectType) => objectType.features.has("graphql") && !objectType.synthetic);
|
|
74
|
-
const
|
|
74
|
+
const namedObjectUnionTypes = parameters.namedObjectUnionTypes.filter((namedObjectUnionType) => namedObjectUnionType.features.has("graphql"));
|
|
75
75
|
if (objectTypes.length === 0) {
|
|
76
76
|
return Maybe.empty();
|
|
77
77
|
}
|
|
78
78
|
return Maybe.of(code `\
|
|
79
|
-
export const graphqlSchema = new ${imports.GraphQLSchema}({ query: ${graphqlQueryObjectType({ objectTypes,
|
|
79
|
+
export const graphqlSchema = new ${imports.GraphQLSchema}({ query: ${graphqlQueryObjectType({ objectTypes, namedObjectUnionTypes })} });
|
|
80
80
|
`);
|
|
81
81
|
}
|
|
82
82
|
//# sourceMappingURL=graphqlSchemaVariableStatement.js.map
|
|
@@ -25,9 +25,9 @@ export declare const imports: {
|
|
|
25
25
|
readonly Maybe: import("ts-poet/build/Import.js").Import;
|
|
26
26
|
readonly NamedNode: import("ts-poet/build/Import.js").Import;
|
|
27
27
|
readonly NonEmptyList: import("ts-poet/build/Import.js").Import;
|
|
28
|
-
readonly PropertyPath: import("ts-poet/build/Import.js").Import;
|
|
29
28
|
readonly Quad: import("ts-poet/build/Import.js").Import;
|
|
30
29
|
readonly Quad_Graph: import("ts-poet/build/Import.js").Import;
|
|
30
|
+
readonly RdfjsResourcePropertyPath: import("ts-poet/build/Import.js").Import;
|
|
31
31
|
readonly Resource: import("ts-poet/build/Import.js").Import;
|
|
32
32
|
readonly ResourceSet: import("ts-poet/build/Import.js").Import;
|
|
33
33
|
readonly Right: import("ts-poet/build/Import.js").Import;
|