@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
|
@@ -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 {
|
|
3
|
-
import type {
|
|
2
|
+
import type { NamedObjectType } from "./NamedObjectType.js";
|
|
3
|
+
import type { NamedObjectUnionType } from "./NamedObjectUnionType.js";
|
|
4
4
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
5
5
|
export declare function graphqlSchemaVariableStatement(parameters: {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
namedObjectTypes: readonly NamedObjectType[];
|
|
7
|
+
namedObjectUnionTypes: NamedObjectUnionType[];
|
|
8
8
|
}): Maybe<Code>;
|
|
9
9
|
//# sourceMappingURL=graphqlSchemaVariableStatement.d.ts.map
|
|
@@ -2,25 +2,25 @@ 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({
|
|
5
|
+
function graphqlQueryObjectType({ namedObjectTypes, namedObjectUnionTypes, }) {
|
|
6
6
|
return code `new ${imports.GraphQLObjectType}<null, { objectSet: ${syntheticNamePrefix}ObjectSet }>({ name: "Query", fields: ${[
|
|
7
|
-
...
|
|
8
|
-
...
|
|
9
|
-
].reduce((fields,
|
|
10
|
-
fields[
|
|
7
|
+
...namedObjectTypes,
|
|
8
|
+
...namedObjectUnionTypes,
|
|
9
|
+
].reduce((fields, namedObjectType) => {
|
|
10
|
+
fields[namedObjectType.objectSetMethodNames.object] = {
|
|
11
11
|
args: {
|
|
12
12
|
identifier: {
|
|
13
13
|
type: code `new ${imports.GraphQLNonNull}(${imports.GraphQLID})`,
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
resolve: code `\
|
|
17
|
-
async (_source, args: { identifier: string }, { objectSet }): Promise<${
|
|
18
|
-
(await ${imports.EitherAsync}<Error, ${
|
|
19
|
-
liftEither(await objectSet.${
|
|
17
|
+
async (_source, args: { identifier: string }, { objectSet }): Promise<${namedObjectType.name}> =>
|
|
18
|
+
(await ${imports.EitherAsync}<Error, ${namedObjectType.name}>(async ({ liftEither }) =>
|
|
19
|
+
liftEither(await objectSet.${namedObjectType.objectSetMethodNames.object}(await liftEither(${namedObjectType.identifierTypeAlias}.fromString(args.identifier))))
|
|
20
20
|
)).unsafeCoerce()`,
|
|
21
|
-
type:
|
|
21
|
+
type: namedObjectType.graphqlType.name,
|
|
22
22
|
};
|
|
23
|
-
fields[
|
|
23
|
+
fields[namedObjectType.objectSetMethodNames.objectIdentifiers] = {
|
|
24
24
|
args: {
|
|
25
25
|
limit: {
|
|
26
26
|
type: code `${imports.GraphQLInt}`,
|
|
@@ -31,10 +31,10 @@ async (_source, args: { identifier: string }, { objectSet }): Promise<${objectTy
|
|
|
31
31
|
},
|
|
32
32
|
resolve: code `\
|
|
33
33
|
async (_source, args: { limit: number | null; offset: number | null; }, { objectSet }): Promise<readonly string[]> =>
|
|
34
|
-
(await objectSet.${
|
|
34
|
+
(await objectSet.${namedObjectType.objectSetMethodNames.objectIdentifiers}({ limit: args.limit !== null ? args.limit : undefined, offset: args.offset !== null ? args.offset : undefined })).unsafeCoerce().map(${namedObjectType.identifierTypeAlias}.toString)`,
|
|
35
35
|
type: code `new ${imports.GraphQLNonNull}(new ${imports.GraphQLList}(${imports.GraphQLString}))`,
|
|
36
36
|
};
|
|
37
|
-
fields[
|
|
37
|
+
fields[namedObjectType.objectSetMethodNames.objects] = {
|
|
38
38
|
args: {
|
|
39
39
|
identifiers: {
|
|
40
40
|
type: code `new ${imports.GraphQLList}(new ${imports.GraphQLNonNull}(${imports.GraphQLID}))`,
|
|
@@ -47,36 +47,36 @@ async (_source, args: { identifier: string }, { objectSet }): Promise<${objectTy
|
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
resolve: code `\
|
|
50
|
-
async (_source, args: { identifiers: readonly string[] | null; limit: number | null; offset: number | null; }, { objectSet }): Promise<readonly ${
|
|
51
|
-
(await ${imports.EitherAsync}<Error, readonly ${
|
|
52
|
-
let filter: ${
|
|
50
|
+
async (_source, args: { identifiers: readonly string[] | null; limit: number | null; offset: number | null; }, { objectSet }): Promise<readonly ${namedObjectType.name}[]> =>
|
|
51
|
+
(await ${imports.EitherAsync}<Error, readonly ${namedObjectType.name}[]>(async ({ liftEither }) => {
|
|
52
|
+
let filter: ${namedObjectType.filterType} | undefined;
|
|
53
53
|
if (args.identifiers) {
|
|
54
|
-
const identifiers: ${
|
|
54
|
+
const identifiers: ${namedObjectType.identifierTypeAlias}[] = [];
|
|
55
55
|
for (const identifierArg of args.identifiers) {
|
|
56
|
-
identifiers.push(await liftEither(${
|
|
56
|
+
identifiers.push(await liftEither(${namedObjectType.identifierTypeAlias}.fromString(identifierArg)));
|
|
57
57
|
}
|
|
58
58
|
filter = { ${syntheticNamePrefix}identifier: { in: identifiers } };
|
|
59
59
|
}
|
|
60
|
-
return await liftEither(await objectSet.${
|
|
60
|
+
return await liftEither(await objectSet.${namedObjectType.objectSetMethodNames.objects}({ filter, limit: args.limit !== null ? args.limit : undefined, offset: args.offset !== null ? args.offset : undefined }));
|
|
61
61
|
})).unsafeCoerce()`,
|
|
62
|
-
type: code `new ${imports.GraphQLNonNull}(new ${imports.GraphQLList}(${
|
|
62
|
+
type: code `new ${imports.GraphQLNonNull}(new ${imports.GraphQLList}(${namedObjectType.graphqlType.name}))`,
|
|
63
63
|
};
|
|
64
|
-
fields[
|
|
64
|
+
fields[namedObjectType.objectSetMethodNames.objectCount] = {
|
|
65
65
|
resolve: code `\
|
|
66
|
-
async (_source, _args, { objectSet }): Promise<number> => (await objectSet.${
|
|
66
|
+
async (_source, _args, { objectSet }): Promise<number> => (await objectSet.${namedObjectType.objectSetMethodNames.objectCount}()).unsafeCoerce()`,
|
|
67
67
|
type: code `new ${imports.GraphQLNonNull}(${imports.GraphQLInt})`,
|
|
68
68
|
};
|
|
69
69
|
return fields;
|
|
70
70
|
}, {})} })`;
|
|
71
71
|
}
|
|
72
72
|
export function graphqlSchemaVariableStatement(parameters) {
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
73
|
+
const namedObjectTypes = parameters.namedObjectTypes.filter((namedObjectType) => namedObjectType.features.has("graphql") && !namedObjectType.synthetic);
|
|
74
|
+
const namedObjectUnionTypes = parameters.namedObjectUnionTypes.filter((namedObjectUnionType) => namedObjectUnionType.features.has("graphql"));
|
|
75
|
+
if (namedObjectTypes.length === 0) {
|
|
76
76
|
return Maybe.empty();
|
|
77
77
|
}
|
|
78
78
|
return Maybe.of(code `\
|
|
79
|
-
export const graphqlSchema = new ${imports.GraphQLSchema}({ query: ${graphqlQueryObjectType({
|
|
79
|
+
export const graphqlSchema = new ${imports.GraphQLSchema}({ query: ${graphqlQueryObjectType({ namedObjectTypes: namedObjectTypes, 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;
|
|
@@ -26,9 +26,9 @@ export const imports = {
|
|
|
26
26
|
Maybe: imp("Maybe@purify-ts"),
|
|
27
27
|
NamedNode: imp("NamedNode@@rdfjs/types"),
|
|
28
28
|
NonEmptyList: imp("NonEmptyList@purify-ts"),
|
|
29
|
-
PropertyPath: imp("PropertyPath@rdfjs-resource"),
|
|
30
29
|
Quad: imp("Quad@@rdfjs/types"),
|
|
31
30
|
Quad_Graph: imp("Quad_Graph@@rdfjs/types"),
|
|
31
|
+
RdfjsResourcePropertyPath: imp("PropertyPath:RdfjsResourcePropertyPath@rdfjs-resource"),
|
|
32
32
|
Resource: imp("Resource@rdfjs-resource"),
|
|
33
33
|
ResourceSet: imp("ResourceSet@rdfjs-resource"),
|
|
34
34
|
Right: imp("Right@purify-ts"),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { NamedObjectType } from "./NamedObjectType.js";
|
|
2
|
+
import type { NamedObjectUnionType } from "./NamedObjectUnionType.js";
|
|
3
3
|
import type { Code } from "./ts-poet-wrapper.js";
|
|
4
|
-
export declare function objectSetDeclarations({
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export declare function objectSetDeclarations({ namedObjectUnionTypes, ...parameters }: {
|
|
5
|
+
namedObjectTypes: readonly NamedObjectType[];
|
|
6
|
+
namedObjectUnionTypes: readonly NamedObjectUnionType[];
|
|
7
7
|
}): readonly Code[];
|
|
8
8
|
//# sourceMappingURL=objectSetDeclarations.d.ts.map
|
|
@@ -1,57 +1,60 @@
|
|
|
1
1
|
import { objectSetInterfaceDeclaration } from "./objectSetInterfaceDeclaration.js";
|
|
2
2
|
import { rdfjsDatasetObjectSetClassDeclaration } from "./rdfjsDatasetObjectSetClassDeclaration.js";
|
|
3
3
|
import { sparqlObjectSetClassDeclaration } from "./sparqlObjectSetClassDeclaration.js";
|
|
4
|
-
export function objectSetDeclarations({
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
export function objectSetDeclarations({ namedObjectUnionTypes, ...parameters }) {
|
|
5
|
+
const namedObjectTypes = parameters.namedObjectTypes.filter((namedObjectType) => !namedObjectType.abstract &&
|
|
6
|
+
!namedObjectType.extern &&
|
|
7
|
+
!namedObjectType.synthetic);
|
|
8
|
+
let namedObjectTypesWithRdfFeatureCount = 0;
|
|
9
|
+
let namedObjectTypesWithSparqlFeatureCount = 0;
|
|
10
|
+
for (const namedObjectType of namedObjectTypes) {
|
|
11
|
+
if (!namedObjectType.features.has("rdf") &&
|
|
12
|
+
!namedObjectType.features.has("sparql")) {
|
|
10
13
|
continue;
|
|
11
14
|
}
|
|
12
|
-
if (
|
|
13
|
-
|
|
15
|
+
if (namedObjectType.features.has("rdf")) {
|
|
16
|
+
namedObjectTypesWithRdfFeatureCount++;
|
|
14
17
|
}
|
|
15
|
-
if (
|
|
16
|
-
|
|
18
|
+
if (namedObjectType.features.has("sparql")) {
|
|
19
|
+
namedObjectTypesWithSparqlFeatureCount++;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
|
-
let
|
|
20
|
-
let
|
|
21
|
-
for (const
|
|
22
|
-
if (!
|
|
23
|
-
!
|
|
22
|
+
let namedObjectUnionTypesWithRdfFeatureCount = 0;
|
|
23
|
+
let namedObjectUnionTypesWithSparqlFeatureCount = 0;
|
|
24
|
+
for (const namedObjectUnionType of namedObjectUnionTypes) {
|
|
25
|
+
if (!namedObjectUnionType.features.has("rdf") &&
|
|
26
|
+
!namedObjectUnionType.features.has("sparql")) {
|
|
24
27
|
continue;
|
|
25
28
|
}
|
|
26
|
-
if (
|
|
27
|
-
|
|
29
|
+
if (namedObjectUnionType.features.has("rdf")) {
|
|
30
|
+
namedObjectUnionTypesWithRdfFeatureCount++;
|
|
28
31
|
}
|
|
29
|
-
if (
|
|
30
|
-
|
|
32
|
+
if (namedObjectUnionType.features.has("sparql")) {
|
|
33
|
+
namedObjectUnionTypesWithSparqlFeatureCount++;
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
if (namedObjectTypesWithRdfFeatureCount === 0 &&
|
|
37
|
+
namedObjectTypesWithSparqlFeatureCount === 0 &&
|
|
38
|
+
namedObjectUnionTypesWithRdfFeatureCount === 0 &&
|
|
39
|
+
namedObjectUnionTypesWithSparqlFeatureCount === 0) {
|
|
37
40
|
return [];
|
|
38
41
|
}
|
|
39
42
|
const declarations = [
|
|
40
43
|
objectSetInterfaceDeclaration({
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
namedObjectTypes: namedObjectTypes,
|
|
45
|
+
namedObjectUnionTypes,
|
|
43
46
|
}),
|
|
44
47
|
];
|
|
45
|
-
if (
|
|
48
|
+
if (namedObjectTypesWithRdfFeatureCount > 0) {
|
|
46
49
|
declarations.push(rdfjsDatasetObjectSetClassDeclaration({
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
namedObjectTypes: namedObjectTypes,
|
|
51
|
+
namedObjectUnionTypes,
|
|
49
52
|
}));
|
|
50
53
|
}
|
|
51
|
-
if (
|
|
54
|
+
if (namedObjectTypesWithSparqlFeatureCount > 0) {
|
|
52
55
|
declarations.push(sparqlObjectSetClassDeclaration({
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
namedObjectTypes: namedObjectTypes,
|
|
57
|
+
namedObjectUnionTypes,
|
|
55
58
|
}));
|
|
56
59
|
}
|
|
57
60
|
return declarations;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { NamedObjectType } from "./NamedObjectType.js";
|
|
2
|
+
import type { NamedObjectUnionType } from "./NamedObjectUnionType.js";
|
|
3
3
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
4
|
-
export declare function objectSetInterfaceDeclaration({
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export declare function objectSetInterfaceDeclaration({ namedObjectTypes, namedObjectUnionTypes, }: {
|
|
5
|
+
namedObjectTypes: readonly NamedObjectType[];
|
|
6
|
+
namedObjectUnionTypes: readonly NamedObjectUnionType[];
|
|
7
7
|
}): Code;
|
|
8
8
|
//# sourceMappingURL=objectSetInterfaceDeclaration.d.ts.map
|
|
@@ -2,12 +2,14 @@ import { imports } from "./imports.js";
|
|
|
2
2
|
import { objectSetMethodSignatures } from "./objectSetMethodSignatures.js";
|
|
3
3
|
import { syntheticNamePrefix } from "./syntheticNamePrefix.js";
|
|
4
4
|
import { code, joinCode } from "./ts-poet-wrapper.js";
|
|
5
|
-
export function objectSetInterfaceDeclaration({
|
|
5
|
+
export function objectSetInterfaceDeclaration({ namedObjectTypes, namedObjectUnionTypes, }) {
|
|
6
6
|
return code `\
|
|
7
7
|
export interface ${syntheticNamePrefix}ObjectSet {
|
|
8
|
-
${joinCode(
|
|
9
|
-
.flatMap((
|
|
10
|
-
.concat(
|
|
8
|
+
${joinCode(namedObjectTypes
|
|
9
|
+
.flatMap((namedObjectType) => Object.values(objectSetMethodSignatures({ namedObjectType })))
|
|
10
|
+
.concat(namedObjectUnionTypes.flatMap((namedObjectUnionType) => Object.values(objectSetMethodSignatures({
|
|
11
|
+
namedObjectType: namedObjectUnionType,
|
|
12
|
+
}))))
|
|
11
13
|
.map((methodSignature) => code `${methodSignature.name}(${methodSignature.parameters}): ${methodSignature.returnType};`), { on: "\n\n" })}
|
|
12
14
|
}
|
|
13
15
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NamedObjectType } from "./NamedObjectType.js";
|
|
2
2
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
3
3
|
export declare function objectSetMethodSignatures(parameters: {
|
|
4
|
-
|
|
4
|
+
namedObjectType: {
|
|
5
5
|
readonly filterType: Code;
|
|
6
6
|
readonly identifierTypeAlias: Code;
|
|
7
|
-
readonly objectSetMethodNames:
|
|
7
|
+
readonly objectSetMethodNames: NamedObjectType.ObjectSetMethodNames;
|
|
8
8
|
readonly name: string;
|
|
9
9
|
};
|
|
10
10
|
parameterNamePrefix?: string;
|
|
11
11
|
queryT?: string;
|
|
12
|
-
}): Readonly<Record<keyof
|
|
12
|
+
}): Readonly<Record<keyof NamedObjectType.ObjectSetMethodNames, {
|
|
13
13
|
readonly name: string;
|
|
14
14
|
readonly parameters: Code;
|
|
15
15
|
readonly returnType: Code;
|
|
@@ -2,30 +2,30 @@ import { imports } from "./imports.js";
|
|
|
2
2
|
import { syntheticNamePrefix } from "./syntheticNamePrefix.js";
|
|
3
3
|
import { code } from "./ts-poet-wrapper.js";
|
|
4
4
|
export function objectSetMethodSignatures(parameters) {
|
|
5
|
-
const {
|
|
5
|
+
const { namedObjectType } = parameters;
|
|
6
6
|
const parameterNamePrefix = parameters?.parameterNamePrefix ?? "";
|
|
7
7
|
const queryT = parameters.queryT ?? `${syntheticNamePrefix}ObjectSet.Query`;
|
|
8
|
-
const methodNames =
|
|
8
|
+
const methodNames = namedObjectType.objectSetMethodNames;
|
|
9
9
|
return {
|
|
10
10
|
object: {
|
|
11
11
|
name: methodNames.object,
|
|
12
|
-
parameters: code `${parameterNamePrefix}identifier: ${
|
|
13
|
-
returnType: code `Promise<${imports.Either}<Error, ${
|
|
12
|
+
parameters: code `${parameterNamePrefix}identifier: ${namedObjectType.identifierTypeAlias}, options?: { preferredLanguages?: readonly string[]; }`,
|
|
13
|
+
returnType: code `Promise<${imports.Either}<Error, ${namedObjectType.name}>>`,
|
|
14
14
|
},
|
|
15
15
|
objectCount: {
|
|
16
16
|
name: methodNames.objectCount,
|
|
17
|
-
parameters: code `${parameterNamePrefix}query?: Pick<${queryT}<${
|
|
17
|
+
parameters: code `${parameterNamePrefix}query?: Pick<${queryT}<${namedObjectType.filterType}, ${namedObjectType.identifierTypeAlias}>, "filter">`,
|
|
18
18
|
returnType: code `Promise<${imports.Either}<Error, number>>`,
|
|
19
19
|
},
|
|
20
20
|
objectIdentifiers: {
|
|
21
21
|
name: methodNames.objectIdentifiers,
|
|
22
|
-
parameters: code `${parameterNamePrefix}query?: ${queryT}<${
|
|
23
|
-
returnType: code `Promise<${imports.Either}<Error, readonly ${
|
|
22
|
+
parameters: code `${parameterNamePrefix}query?: ${queryT}<${namedObjectType.filterType}, ${namedObjectType.identifierTypeAlias}>`,
|
|
23
|
+
returnType: code `Promise<${imports.Either}<Error, readonly ${namedObjectType.identifierTypeAlias}[]>>`,
|
|
24
24
|
},
|
|
25
25
|
objects: {
|
|
26
26
|
name: methodNames.objects,
|
|
27
|
-
parameters: code `${parameterNamePrefix}query?: ${queryT}<${
|
|
28
|
-
returnType: code `Promise<${imports.Either}<Error, readonly ${
|
|
27
|
+
parameters: code `${parameterNamePrefix}query?: ${queryT}<${namedObjectType.filterType}, ${namedObjectType.identifierTypeAlias}>`,
|
|
28
|
+
returnType: code `Promise<${imports.Either}<Error, readonly ${namedObjectType.name}[]>>`,
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
31
|
}
|