@shaclmate/compiler 4.0.50 → 4.0.52
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 +14 -0
- package/dist/Compiler.js +18 -0
- package/dist/Eithers.d.ts +14 -0
- package/dist/Eithers.js +67 -0
- package/dist/ShapesGraphToAstTransformer.d.ts +18 -0
- package/dist/ShapesGraphToAstTransformer.js +50 -0
- package/dist/_ShapesGraphToAstTransformer/ShapeStack.d.ts +15 -0
- package/dist/_ShapesGraphToAstTransformer/ShapeStack.js +51 -0
- 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 +24 -0
- package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.d.ts +9 -0
- package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +150 -0
- package/dist/_ShapesGraphToAstTransformer/shapeOntology.d.ts +5 -0
- package/dist/_ShapesGraphToAstTransformer/shapeOntology.js +26 -0
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.d.ts +17 -0
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.js +285 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.d.ts +10 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +92 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +11 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +149 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstStructType.d.ts +7 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstStructType.js +171 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.d.ts +12 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +110 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +11 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +46 -0
- package/dist/ast/AbstractCollectionType.d.ts +30 -0
- package/dist/ast/AbstractCollectionType.js +33 -0
- package/dist/ast/AbstractCompoundType.d.ts +45 -0
- package/dist/ast/AbstractCompoundType.js +81 -0
- package/dist/ast/AbstractContainerType.d.ts +44 -0
- package/dist/ast/AbstractContainerType.js +63 -0
- package/dist/ast/AbstractLazyType.d.ts +117 -0
- package/dist/ast/AbstractLazyType.js +40 -0
- package/dist/ast/AbstractTermType.d.ts +33 -0
- package/dist/ast/AbstractTermType.js +47 -0
- package/dist/ast/AbstractType.d.ts +55 -0
- package/dist/ast/AbstractType.js +55 -0
- package/dist/ast/Ast.d.ts +6 -0
- package/dist/ast/Ast.js +2 -0
- package/dist/ast/BlankNodeType.d.ts +11 -0
- package/dist/ast/BlankNodeType.js +17 -0
- package/dist/ast/DefaultValueType.d.ts +35 -0
- package/dist/ast/DefaultValueType.js +50 -0
- package/dist/ast/IdentifierType.d.ts +12 -0
- package/dist/ast/IdentifierType.js +20 -0
- package/dist/ast/IntersectionType.d.ts +14 -0
- package/dist/ast/IntersectionType.js +17 -0
- package/dist/ast/IriType.d.ts +10 -0
- package/dist/ast/IriType.js +10 -0
- package/dist/ast/LazyOptionType.d.ts +6 -0
- package/dist/ast/LazyOptionType.js +5 -0
- package/dist/ast/LazySetType.d.ts +6 -0
- package/dist/ast/LazySetType.js +5 -0
- package/dist/ast/LazyType.d.ts +5 -0
- package/dist/ast/LazyType.js +5 -0
- package/dist/ast/ListType.d.ts +44 -0
- package/dist/ast/ListType.js +56 -0
- package/dist/ast/LiteralType.d.ts +40 -0
- package/dist/ast/LiteralType.js +59 -0
- package/dist/ast/OptionType.d.ts +13 -0
- package/dist/ast/OptionType.js +21 -0
- package/dist/ast/SetType.d.ts +31 -0
- package/dist/ast/SetType.js +42 -0
- package/dist/ast/StructCompoundType.d.ts +12 -0
- package/dist/ast/StructCompoundType.js +87 -0
- package/dist/ast/StructIntersectionType.d.ts +4 -0
- package/dist/ast/StructIntersectionType.js +2 -0
- package/dist/ast/StructType.d.ts +178 -0
- package/dist/ast/StructType.js +314 -0
- package/dist/ast/StructUnionType.d.ts +4 -0
- package/dist/ast/StructUnionType.js +2 -0
- package/dist/ast/TermType.d.ts +14 -0
- package/dist/ast/TermType.js +16 -0
- package/dist/ast/Type.d.ts +20 -0
- package/dist/ast/Type.js +42 -0
- package/dist/ast/UnionType.d.ts +30 -0
- package/dist/ast/UnionType.js +27 -0
- package/dist/ast/equals.d.ts +12 -0
- package/dist/ast/equals.js +65 -0
- package/dist/ast/index.d.ts +21 -0
- package/dist/ast/index.js +21 -0
- package/dist/generators/AstJsonGenerator.d.ts +6 -0
- package/dist/generators/AstJsonGenerator.js +15 -0
- package/dist/generators/Cx2Generator.d.ts +10 -0
- package/dist/generators/Cx2Generator.js +140 -0
- package/dist/generators/Generator.d.ts +5 -0
- package/dist/generators/Generator.js +2 -0
- package/dist/generators/LabeledPropertyGraph.d.ts +42 -0
- package/dist/generators/LabeledPropertyGraph.js +2 -0
- package/dist/generators/index.d.ts +6 -0
- package/dist/generators/index.js +6 -0
- package/dist/generators/transformAstToLabeledPropertyGraph.d.ts +4 -0
- package/dist/generators/transformAstToLabeledPropertyGraph.js +78 -0
- package/dist/generators/ts/AbstractCollectionType.d.ts +37 -0
- package/dist/generators/ts/AbstractCollectionType.js +88 -0
- package/dist/generators/ts/AbstractContainerType.d.ts +53 -0
- package/dist/generators/ts/AbstractContainerType.js +97 -0
- package/dist/generators/ts/AbstractDateType.d.ts +23 -0
- package/dist/generators/ts/AbstractDateType.js +37 -0
- package/dist/generators/ts/AbstractIdentifierType.d.ts +21 -0
- package/dist/generators/ts/AbstractIdentifierType.js +25 -0
- package/dist/generators/ts/AbstractLazyType.d.ts +67 -0
- package/dist/generators/ts/AbstractLazyType.js +154 -0
- package/dist/generators/ts/AbstractLiteralType.d.ts +26 -0
- package/dist/generators/ts/AbstractLiteralType.js +15 -0
- package/dist/generators/ts/AbstractNumericType.d.ts +21 -0
- package/dist/generators/ts/AbstractNumericType.js +65 -0
- package/dist/generators/ts/AbstractObjectSetType.d.ts +36 -0
- package/dist/generators/ts/AbstractObjectSetType.js +44 -0
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +32 -0
- package/dist/generators/ts/AbstractPrimitiveType.js +51 -0
- package/dist/generators/ts/AbstractTermType.d.ts +50 -0
- package/dist/generators/ts/AbstractTermType.js +102 -0
- package/dist/generators/ts/AbstractType.d.ts +345 -0
- package/dist/generators/ts/AbstractType.js +135 -0
- package/dist/generators/ts/BigDecimalType.d.ts +28 -0
- package/dist/generators/ts/BigDecimalType.js +58 -0
- package/dist/generators/ts/BigIntType.d.ts +17 -0
- package/dist/generators/ts/BigIntType.js +56 -0
- package/dist/generators/ts/BlankNodeType.d.ts +22 -0
- package/dist/generators/ts/BlankNodeType.js +67 -0
- package/dist/generators/ts/BooleanType.d.ts +21 -0
- package/dist/generators/ts/BooleanType.js +53 -0
- package/dist/generators/ts/DateTimeType.d.ts +13 -0
- package/dist/generators/ts/DateTimeType.js +31 -0
- package/dist/generators/ts/DateType.d.ts +14 -0
- package/dist/generators/ts/DateType.js +32 -0
- package/dist/generators/ts/DefaultValueType.d.ts +83 -0
- package/dist/generators/ts/DefaultValueType.js +143 -0
- package/dist/generators/ts/FloatType.d.ts +13 -0
- package/dist/generators/ts/FloatType.js +30 -0
- package/dist/generators/ts/GraphqlSchema.d.ts +22 -0
- package/dist/generators/ts/GraphqlSchema.js +87 -0
- package/dist/generators/ts/IdentifierType.d.ts +23 -0
- package/dist/generators/ts/IdentifierType.js +83 -0
- package/dist/generators/ts/Imports.d.ts +40 -0
- package/dist/generators/ts/Imports.js +41 -0
- package/dist/generators/ts/IntType.d.ts +13 -0
- package/dist/generators/ts/IntType.js +30 -0
- package/dist/generators/ts/IriType.d.ts +23 -0
- package/dist/generators/ts/IriType.js +112 -0
- package/dist/generators/ts/LazyOptionType.d.ts +36 -0
- package/dist/generators/ts/LazyOptionType.js +75 -0
- package/dist/generators/ts/LazySetType.d.ts +20 -0
- package/dist/generators/ts/LazySetType.js +76 -0
- package/dist/generators/ts/LazyType.d.ts +19 -0
- package/dist/generators/ts/LazyType.js +65 -0
- package/dist/generators/ts/ListType.d.ts +49 -0
- package/dist/generators/ts/ListType.js +161 -0
- package/dist/generators/ts/LiteralType.d.ts +27 -0
- package/dist/generators/ts/LiteralType.js +71 -0
- package/dist/generators/ts/ObjectSetType.d.ts +6 -0
- package/dist/generators/ts/ObjectSetType.js +36 -0
- package/dist/generators/ts/ObjectType.d.ts +105 -0
- package/dist/generators/ts/ObjectType.js +503 -0
- package/dist/generators/ts/ObjectUnionType.d.ts +20 -0
- package/dist/generators/ts/ObjectUnionType.js +223 -0
- package/dist/generators/ts/OptionType.d.ts +39 -0
- package/dist/generators/ts/OptionType.js +157 -0
- package/dist/generators/ts/RdfjsDatasetObjectSetType.d.ts +6 -0
- package/dist/generators/ts/RdfjsDatasetObjectSetType.js +323 -0
- package/dist/generators/ts/Reusables.d.ts +13 -0
- package/dist/generators/ts/Reusables.js +15 -0
- package/dist/generators/ts/SetType.d.ts +32 -0
- package/dist/generators/ts/SetType.js +132 -0
- package/dist/generators/ts/Snippet.d.ts +3 -0
- package/dist/generators/ts/Snippet.js +2 -0
- package/dist/generators/ts/SnippetFactory.d.ts +16 -0
- package/dist/generators/ts/SnippetFactory.js +2 -0
- package/dist/generators/ts/Snippets.d.ts +180 -0
- package/dist/generators/ts/Snippets.js +1184 -0
- package/dist/generators/ts/SparqlObjectSetType.d.ts +6 -0
- package/dist/generators/ts/SparqlObjectSetType.js +241 -0
- package/dist/generators/ts/StringType.d.ts +22 -0
- package/dist/generators/ts/StringType.js +68 -0
- package/dist/generators/ts/TermType.d.ts +31 -0
- package/dist/generators/ts/TermType.js +143 -0
- package/dist/generators/ts/TsFeature.d.ts +3 -0
- package/dist/generators/ts/TsFeature.js +28 -0
- package/dist/generators/ts/TsGenerator.d.ts +30 -0
- package/dist/generators/ts/TsGenerator.js +292 -0
- package/dist/generators/ts/Type.d.ts +25 -0
- package/dist/generators/ts/Type.js +2 -0
- package/dist/generators/ts/TypeFactory.d.ts +43 -0
- package/dist/generators/ts/TypeFactory.js +540 -0
- package/dist/generators/ts/Typeof.d.ts +2 -0
- package/dist/generators/ts/Typeof.js +2 -0
- package/dist/generators/ts/UnionType.d.ts +126 -0
- package/dist/generators/ts/UnionType.js +850 -0
- package/dist/generators/ts/ZodGenerator.d.ts +11 -0
- package/dist/generators/ts/ZodGenerator.js +60 -0
- package/dist/generators/ts/_ObjectType/AbstractProperty.d.ts +217 -0
- package/dist/generators/ts/_ObjectType/AbstractProperty.js +37 -0
- package/dist/generators/ts/_ObjectType/DiscriminantProperty.d.ts +45 -0
- package/dist/generators/ts/_ObjectType/DiscriminantProperty.js +104 -0
- package/dist/generators/ts/_ObjectType/IdentifierProperty.d.ts +43 -0
- package/dist/generators/ts/_ObjectType/IdentifierProperty.js +205 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.js +28 -0
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionExpression.js +19 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeExpression.js +20 -0
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionExpression.js +46 -0
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionExpression.js +79 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.js +38 -0
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeExpression.js +26 -0
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.js +30 -0
- package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.js +13 -0
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +20 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.js +10 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.js +22 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.js +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.js +17 -0
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.d.ts +11 -0
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.js +23 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +21 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +10 -0
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +35 -0
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts +10 -0
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +8 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.js +14 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.js +33 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.js +7 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.js +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionExpression.js +8 -0
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionExpression.js +10 -0
- package/dist/generators/ts/_ObjectType/Property.d.ts +6 -0
- package/dist/generators/ts/_ObjectType/Property.js +2 -0
- package/dist/generators/ts/_ObjectType/ShaclProperty.d.ts +53 -0
- package/dist/generators/ts/_ObjectType/ShaclProperty.js +284 -0
- package/dist/generators/ts/_snippets/snippets_BlankNodeFilter.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_BlankNodeFilter.js +5 -0
- package/dist/generators/ts/_snippets/snippets_BlankNodeSchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_BlankNodeSchema.js +6 -0
- package/dist/generators/ts/_snippets/snippets_BooleanFilter.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_BooleanFilter.js +6 -0
- package/dist/generators/ts/_snippets/snippets_BooleanSchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +8 -0
- package/dist/generators/ts/_snippets/snippets_CollectionFilter.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_CollectionFilter.js +7 -0
- package/dist/generators/ts/_snippets/snippets_CollectionSchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_CollectionSchema.js +8 -0
- package/dist/generators/ts/_snippets/snippets_ConversionFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ConversionFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_DateFilter.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_DateFilter.js +10 -0
- package/dist/generators/ts/_snippets/snippets_DateSchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_DateSchema.js +8 -0
- package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +8 -0
- package/dist/generators/ts/_snippets/snippets_EqualsFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_EqualsFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_EqualsResult.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_EqualsResult.js +63 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlConstructTriplesFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlConstructTriplesFunction.js +10 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlWherePatternsFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlWherePatternsFunction.js +11 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceFunction.js +13 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.js +16 -0
- package/dist/generators/ts/_snippets/snippets_HashFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_HashFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_Hasher.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_Hasher.js +3 -0
- package/dist/generators/ts/_snippets/snippets_IdentifierFilter.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_IdentifierFilter.js +7 -0
- package/dist/generators/ts/_snippets/snippets_IdentifierSchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_IdentifierSchema.js +7 -0
- package/dist/generators/ts/_snippets/snippets_IdentifierSet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_IdentifierSet.js +27 -0
- package/dist/generators/ts/_snippets/snippets_IriFilter.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_IriFilter.js +6 -0
- package/dist/generators/ts/_snippets/snippets_IriSchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_IriSchema.js +8 -0
- package/dist/generators/ts/_snippets/snippets_Lazy.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_Lazy.js +22 -0
- package/dist/generators/ts/_snippets/snippets_LazyOption.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LazyOption.js +25 -0
- package/dist/generators/ts/_snippets/snippets_LazySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LazySet.js +40 -0
- package/dist/generators/ts/_snippets/snippets_LiteralFilter.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LiteralFilter.js +4 -0
- package/dist/generators/ts/_snippets/snippets_LiteralSchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LiteralSchema.js +9 -0
- package/dist/generators/ts/_snippets/snippets_MaybeFilter.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_MaybeFilter.js +4 -0
- package/dist/generators/ts/_snippets/snippets_MaybeSchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_MaybeSchema.js +7 -0
- package/dist/generators/ts/_snippets/snippets_NumericFilter.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_NumericFilter.js +10 -0
- package/dist/generators/ts/_snippets/snippets_NumericSchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_NumericSchema.js +8 -0
- package/dist/generators/ts/_snippets/snippets_PropertyPath.d.ts +6 -0
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +46 -0
- package/dist/generators/ts/_snippets/snippets_RdfVocabularies.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_RdfVocabularies.js +40 -0
- package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +8 -0
- package/dist/generators/ts/_snippets/snippets_SparqlFilterPattern.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_SparqlFilterPattern.js +3 -0
- package/dist/generators/ts/_snippets/snippets_SparqlPattern.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_SparqlPattern.js +3 -0
- package/dist/generators/ts/_snippets/snippets_SparqlPattern_isSolutionGenerating.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_SparqlPattern_isSolutionGenerating.js +30 -0
- package/dist/generators/ts/_snippets/snippets_StringFilter.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_StringFilter.js +8 -0
- package/dist/generators/ts/_snippets/snippets_StringSchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_StringSchema.js +9 -0
- package/dist/generators/ts/_snippets/snippets_TermFilter.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_TermFilter.js +9 -0
- package/dist/generators/ts/_snippets/snippets_TermSchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_TermSchema.js +9 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.js +11 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.js +16 -0
- package/dist/generators/ts/_snippets/snippets_UnwrapR.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_UnwrapR.js +4 -0
- package/dist/generators/ts/_snippets/snippets_ValidationFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ValidationFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlConstructTriplesFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlConstructTriplesFunction.js +11 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlWherePatternsFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlWherePatternsFunction.js +13 -0
- package/dist/generators/ts/_snippets/snippets__FromRdfResourceFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets__FromRdfResourceFunction.js +13 -0
- package/dist/generators/ts/_snippets/snippets__ToRdfResourceFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets__ToRdfResourceFunction.js +12 -0
- package/dist/generators/ts/_snippets/snippets_arrayEquals.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_arrayEquals.js +68 -0
- package/dist/generators/ts/_snippets/snippets_arrayIntersection.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_arrayIntersection.js +29 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalLiteral.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalLiteral.js +9 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalSparqlWherePatterns.js +83 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeSparqlWherePatterns.js +5 -0
- package/dist/generators/ts/_snippets/snippets_booleanEquals.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_booleanEquals.js +16 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_booleanSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_booleanSparqlWherePatterns.js +15 -0
- package/dist/generators/ts/_snippets/snippets_compactRecord.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_compactRecord.js +15 -0
- package/dist/generators/ts/_snippets/snippets_convertToArraySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToArraySet.js +8 -0
- package/dist/generators/ts/_snippets/snippets_convertToBlankNode.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToBlankNode.js +11 -0
- package/dist/generators/ts/_snippets/snippets_convertToBlankNodeIdentifierProperty.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToBlankNodeIdentifierProperty.js +17 -0
- package/dist/generators/ts/_snippets/snippets_convertToIdentifier.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToIdentifier.js +13 -0
- package/dist/generators/ts/_snippets/snippets_convertToIdentifierProperty.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToIdentifierProperty.js +21 -0
- package/dist/generators/ts/_snippets/snippets_convertToIri.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToIri.js +11 -0
- package/dist/generators/ts/_snippets/snippets_convertToIriIdentifierProperty.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToIriIdentifierProperty.js +17 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazy.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazy.js +15 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyOption.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyOption.js +33 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazySet.js +27 -0
- package/dist/generators/ts/_snippets/snippets_convertToList.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToList.js +7 -0
- package/dist/generators/ts/_snippets/snippets_convertToLiteral.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLiteral.js +13 -0
- package/dist/generators/ts/_snippets/snippets_convertToMaybe.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToMaybe.js +19 -0
- package/dist/generators/ts/_snippets/snippets_convertToScalarSet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToScalarSet.js +15 -0
- package/dist/generators/ts/_snippets/snippets_convertWithDefaultValue.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertWithDefaultValue.js +11 -0
- package/dist/generators/ts/_snippets/snippets_dateEquals.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateEquals.js +13 -0
- package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_dateSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateSparqlWherePatterns.js +71 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_decodeBigDecimalLiteral.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_decodeBigDecimalLiteral.js +9 -0
- package/dist/generators/ts/_snippets/snippets_deduplicateSparqlPatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_deduplicateSparqlPatterns.js +19 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.js +10 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +9 -0
- package/dist/generators/ts/_snippets/snippets_ensureRdfResourceType.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ensureRdfResourceType.js +16 -0
- package/dist/generators/ts/_snippets/snippets_filterArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_filterArray.js +22 -0
- package/dist/generators/ts/_snippets/snippets_filterBigDecimal.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_filterBigDecimal.js +26 -0
- package/dist/generators/ts/_snippets/snippets_filterBlankNode.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_filterBlankNode.js +6 -0
- package/dist/generators/ts/_snippets/snippets_filterBoolean.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_filterBoolean.js +10 -0
- package/dist/generators/ts/_snippets/snippets_filterDate.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_filterDate.js +26 -0
- package/dist/generators/ts/_snippets/snippets_filterIdentifier.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_filterIdentifier.js +14 -0
- package/dist/generators/ts/_snippets/snippets_filterIri.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_filterIri.js +10 -0
- package/dist/generators/ts/_snippets/snippets_filterLiteral.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_filterLiteral.js +6 -0
- package/dist/generators/ts/_snippets/snippets_filterMaybe.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_filterMaybe.js +22 -0
- package/dist/generators/ts/_snippets/snippets_filterNumeric.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_filterNumeric.js +26 -0
- package/dist/generators/ts/_snippets/snippets_filterString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_filterString.js +18 -0
- package/dist/generators/ts/_snippets/snippets_filterTerm.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_filterTerm.js +22 -0
- package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_hashArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashArray.js +11 -0
- package/dist/generators/ts/_snippets/snippets_hashBigDecimal.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashBigDecimal.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashBoolean.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashBoolean.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashDate.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashDate.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashDateTime.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashDateTime.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashMaybe.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashMaybe.js +11 -0
- package/dist/generators/ts/_snippets/snippets_hashNumeric.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashNumeric.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashString.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashTerm.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashTerm.js +12 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_identifierSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierSparqlWherePatterns.js +30 -0
- package/dist/generators/ts/_snippets/snippets_identityConversionFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identityConversionFunction.js +6 -0
- package/dist/generators/ts/_snippets/snippets_identityValidationFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identityValidationFunction.js +6 -0
- package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_iriSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_iriSparqlWherePatterns.js +13 -0
- package/dist/generators/ts/_snippets/snippets_liftSparqlPatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_liftSparqlPatterns.js +15 -0
- package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.js +15 -0
- package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +37 -0
- package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.js +116 -0
- package/dist/generators/ts/_snippets/snippets_literalFactory.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_literalFactory.js +3 -0
- package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_literalSchemaSparqlPatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_literalSchemaSparqlPatterns.js +39 -0
- package/dist/generators/ts/_snippets/snippets_literalSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_literalSparqlWherePatterns.js +5 -0
- package/dist/generators/ts/_snippets/snippets_maybeEquals.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeEquals.js +31 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.js +11 -0
- package/dist/generators/ts/_snippets/snippets_maybeSparqlConstructTriples.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeSparqlConstructTriples.js +6 -0
- package/dist/generators/ts/_snippets/snippets_maybeSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeSparqlWherePatterns.js +21 -0
- package/dist/generators/ts/_snippets/snippets_monkeyPatchObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_monkeyPatchObject.js +16 -0
- package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.js +8 -0
- package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.js +8 -0
- package/dist/generators/ts/_snippets/snippets_normalizeSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_normalizeSparqlWherePatterns.js +92 -0
- package/dist/generators/ts/_snippets/snippets_numericSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_numericSparqlWherePatterns.js +62 -0
- package/dist/generators/ts/_snippets/snippets_parseBlankNode.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_parseBlankNode.js +9 -0
- package/dist/generators/ts/_snippets/snippets_parseIdentifier.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_parseIdentifier.js +4 -0
- package/dist/generators/ts/_snippets/snippets_parseIri.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_parseIri.js +9 -0
- package/dist/generators/ts/_snippets/snippets_propertyEquals.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_propertyEquals.js +11 -0
- package/dist/generators/ts/_snippets/snippets_rdfResourceIdentifierValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_rdfResourceIdentifierValues.js +12 -0
- package/dist/generators/ts/_snippets/snippets_sequenceRecord.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_sequenceRecord.js +18 -0
- package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.js +9 -0
- package/dist/generators/ts/_snippets/snippets_setSparqlConstructTriples.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_setSparqlConstructTriples.js +6 -0
- package/dist/generators/ts/_snippets/snippets_setSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_setSparqlWherePatterns.js +17 -0
- package/dist/generators/ts/_snippets/snippets_shaclPropertyFromRdf.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_shaclPropertyFromRdf.js +17 -0
- package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlConstructTriples.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlConstructTriples.js +90 -0
- package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlWherePatterns.js +86 -0
- package/dist/generators/ts/_snippets/snippets_sortSparqlPatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_sortSparqlPatterns.js +24 -0
- package/dist/generators/ts/_snippets/snippets_sparqlInstancesOfPattern.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_sparqlInstancesOfPattern.js +29 -0
- package/dist/generators/ts/_snippets/snippets_sparqlPropertyPath.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_sparqlPropertyPath.js +59 -0
- package/dist/generators/ts/_snippets/snippets_sparqlValueInPattern.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_sparqlValueInPattern.js +23 -0
- package/dist/generators/ts/_snippets/snippets_strictEquals.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_strictEquals.js +12 -0
- package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_stringSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_stringSparqlWherePatterns.js +39 -0
- package/dist/generators/ts/_snippets/snippets_termFilterSparqlPatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termFilterSparqlPatterns.js +93 -0
- package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.js +17 -0
- package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.js +60 -0
- package/dist/generators/ts/_snippets/snippets_termSchemaSparqlPatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termSchemaSparqlPatterns.js +24 -0
- package/dist/generators/ts/_snippets/snippets_termSparqlWherePatterns.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termSparqlWherePatterns.js +5 -0
- package/dist/generators/ts/_snippets/snippets_toIsoDateString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_toIsoDateString.js +6 -0
- package/dist/generators/ts/_snippets/snippets_validateArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_validateArray.js +13 -0
- package/dist/generators/ts/_snippets/snippets_validateMaybe.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_validateMaybe.js +7 -0
- package/dist/generators/ts/_snippets/snippets_wrap_FromRdfResourceFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_wrap_FromRdfResourceFunction.js +9 -0
- package/dist/generators/ts/_snippets/snippets_wrap_ToRdfResourceFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_wrap_ToRdfResourceFunction.js +14 -0
- package/dist/generators/ts/codeEquals.d.ts +3 -0
- package/dist/generators/ts/codeEquals.js +7 -0
- package/dist/generators/ts/rdfjsTermExpression.d.ts +11 -0
- package/dist/generators/ts/rdfjsTermExpression.js +72 -0
- package/dist/generators/ts/singleEntryRecord.d.ts +2 -0
- package/dist/generators/ts/singleEntryRecord.js +6 -0
- package/dist/generators/ts/ts-poet-wrapper.d.ts +5 -0
- package/dist/generators/ts/ts-poet-wrapper.js +13 -0
- package/dist/generators/ts/tsComment.d.ts +5 -0
- package/dist/generators/ts/tsComment.js +11 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/input/ShapesGraph.d.ts +44 -0
- package/dist/input/ShapesGraph.js +66 -0
- package/dist/input/index.d.ts +3 -0
- package/dist/input/index.js +3 -0
- package/dist/input/input.shaclmate.d.ts +4567 -0
- package/dist/input/input.shaclmate.js +3595 -0
- package/package.json +600 -600
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import dataFactory from "@rdfx/data-factory";
|
|
2
|
+
import { Curie } from "@shaclmate/shacl-ast";
|
|
3
|
+
import { sh } from "@tpluscode/rdf-ns-builders";
|
|
4
|
+
import { Either, Left, Maybe } from "purify-ts";
|
|
5
|
+
import { invariant } from "ts-invariant";
|
|
6
|
+
import * as ast from "../ast/index.js";
|
|
7
|
+
import { Eithers } from "../Eithers.js";
|
|
8
|
+
import { ShapeStack } from "./ShapeStack.js";
|
|
9
|
+
import { transformShapeToAstType } from "./transformShapeToAstType.js";
|
|
10
|
+
function fieldName(propertyShape, structType) {
|
|
11
|
+
// Explicit shaclmate:name or sh:name
|
|
12
|
+
const name = propertyShape.shaclmateName.alt(propertyShape.name).extract();
|
|
13
|
+
if (name) {
|
|
14
|
+
return name;
|
|
15
|
+
}
|
|
16
|
+
// Explicit rdfs:label
|
|
17
|
+
const label = propertyShape.label.extract();
|
|
18
|
+
if (label) {
|
|
19
|
+
return label;
|
|
20
|
+
}
|
|
21
|
+
// Pick up the common pattern of a property shape identifier being the node shape's identifier -localName,
|
|
22
|
+
// like ex:NodeShape-property
|
|
23
|
+
const propertyShapeIdentifier = propertyShape.$identifier();
|
|
24
|
+
if (propertyShapeIdentifier.termType === "NamedNode" &&
|
|
25
|
+
structType.shapeIdentifier.termType === "NamedNode") {
|
|
26
|
+
const propertyShapeIdentifierPrefix = `${structType.shapeIdentifier.value}-`;
|
|
27
|
+
if (propertyShapeIdentifier.value.startsWith(propertyShapeIdentifierPrefix) &&
|
|
28
|
+
propertyShapeIdentifier.value.length >
|
|
29
|
+
propertyShapeIdentifierPrefix.length) {
|
|
30
|
+
return propertyShapeIdentifier.value.substring(propertyShapeIdentifierPrefix.length);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// sh:path CURIE reference
|
|
34
|
+
if (propertyShape.path instanceof Curie) {
|
|
35
|
+
return propertyShape.path.reference;
|
|
36
|
+
}
|
|
37
|
+
// Shape identifier CURIE reference
|
|
38
|
+
if (propertyShapeIdentifier instanceof Curie) {
|
|
39
|
+
return propertyShapeIdentifier.reference;
|
|
40
|
+
}
|
|
41
|
+
// Shape identifier IRI
|
|
42
|
+
if (propertyShapeIdentifier.termType === "NamedNode") {
|
|
43
|
+
return propertyShapeIdentifier.value;
|
|
44
|
+
}
|
|
45
|
+
// sh:path IRI
|
|
46
|
+
if (propertyShape.path.termType === "NamedNode") {
|
|
47
|
+
return propertyShape.path.value;
|
|
48
|
+
}
|
|
49
|
+
throw new Error(`${propertyShape}: unable to infer name`);
|
|
50
|
+
}
|
|
51
|
+
function synthesizePartialAstStructType({ identifierType, }) {
|
|
52
|
+
let syntheticName;
|
|
53
|
+
switch (identifierType.kind) {
|
|
54
|
+
case "BlankNode":
|
|
55
|
+
throw new Error("should never happen");
|
|
56
|
+
case "Identifier":
|
|
57
|
+
syntheticName = "DefaultPartial";
|
|
58
|
+
break;
|
|
59
|
+
case "Iri":
|
|
60
|
+
syntheticName = "NamedDefaultPartial";
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
let partialAstStructType = this.syntheticAstStructTypesByName.get(syntheticName);
|
|
64
|
+
if (partialAstStructType) {
|
|
65
|
+
return partialAstStructType;
|
|
66
|
+
}
|
|
67
|
+
partialAstStructType = new ast.StructType({
|
|
68
|
+
comment: Maybe.empty(),
|
|
69
|
+
extern: false,
|
|
70
|
+
fromRdfType: Maybe.empty(),
|
|
71
|
+
identifierType,
|
|
72
|
+
label: Maybe.empty(),
|
|
73
|
+
name: Maybe.of(syntheticName),
|
|
74
|
+
shapeIdentifier: dataFactory.namedNode(`urn:shaclmate:synthetic:${syntheticName}`),
|
|
75
|
+
synthetic: true,
|
|
76
|
+
toRdfTypes: [],
|
|
77
|
+
tsImports: [],
|
|
78
|
+
});
|
|
79
|
+
this.syntheticAstStructTypesByName.set(syntheticName, partialAstStructType);
|
|
80
|
+
return partialAstStructType;
|
|
81
|
+
}
|
|
82
|
+
function transformPropertyShapeToAstType(propertyShape, shapeStack) {
|
|
83
|
+
// if (
|
|
84
|
+
// propertyShape.path.kind === "PredicatePath" &&
|
|
85
|
+
// propertyShape.path.iri.value.endsWith("termProperty")
|
|
86
|
+
// ) {
|
|
87
|
+
// }
|
|
88
|
+
return transformShapeToAstType
|
|
89
|
+
.call(this, propertyShape, shapeStack)
|
|
90
|
+
.chain((propertyShapeAstType) => {
|
|
91
|
+
let maxCount = propertyShape.maxCount.orDefault(BigInt(Number.MAX_SAFE_INTEGER));
|
|
92
|
+
let minCount = propertyShape.minCount.orDefault(0n);
|
|
93
|
+
if (minCount < 0n) {
|
|
94
|
+
minCount = 0n;
|
|
95
|
+
}
|
|
96
|
+
if (propertyShape.hasValues.length > minCount) {
|
|
97
|
+
minCount = BigInt(propertyShape.hasValues.length);
|
|
98
|
+
}
|
|
99
|
+
if (maxCount < minCount) {
|
|
100
|
+
maxCount = minCount;
|
|
101
|
+
}
|
|
102
|
+
if (propertyShapeAstType.kind === "DefaultValue") {
|
|
103
|
+
if (minCount > 0n) {
|
|
104
|
+
return Left(new Error(`${propertyShape}: has sh:minCount > 0 and sh:defaultValue`));
|
|
105
|
+
}
|
|
106
|
+
if (maxCount > 1) {
|
|
107
|
+
return Left(new Error(`${propertyShape}: sets with sh:defaultValue are currently unsupported`));
|
|
108
|
+
}
|
|
109
|
+
return Either.of(propertyShapeAstType);
|
|
110
|
+
}
|
|
111
|
+
if (minCount === 1n && maxCount === 1n) {
|
|
112
|
+
return Either.of(propertyShapeAstType);
|
|
113
|
+
}
|
|
114
|
+
if (minCount === 0n && maxCount === 1n) {
|
|
115
|
+
if (!ast.OptionType.isItemType(propertyShapeAstType)) {
|
|
116
|
+
return Left(new Error(`${propertyShape}: ${propertyShapeAstType} is not an OptionType item type`));
|
|
117
|
+
}
|
|
118
|
+
return Either.of(new ast.OptionType({
|
|
119
|
+
itemType: propertyShapeAstType,
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
if (!ast.SetType.isItemType(propertyShapeAstType)) {
|
|
123
|
+
return Left(new Error(`${propertyShape}: ${propertyShapeAstType} is not a SetType item type`));
|
|
124
|
+
}
|
|
125
|
+
return Either.of(new ast.SetType({
|
|
126
|
+
itemType: propertyShapeAstType,
|
|
127
|
+
minCount,
|
|
128
|
+
mutable: propertyShape.mutable.orDefault(false),
|
|
129
|
+
}));
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Try to transform a property shape to an ast.StructType.Field.
|
|
134
|
+
*
|
|
135
|
+
* Returns:
|
|
136
|
+
* - Right<Just<ast.StructType.Field>> if the transformation succeeds
|
|
137
|
+
* - Right<Nothing> if the property shape should be ignored
|
|
138
|
+
* - Left<Error> if the transformation fails
|
|
139
|
+
*/
|
|
140
|
+
export function transformPropertyShapeToAstStructTypeField({ propertyShape, structType, }) {
|
|
141
|
+
if (propertyShape.ignore) {
|
|
142
|
+
return Either.of(Maybe.empty());
|
|
143
|
+
}
|
|
144
|
+
switch (propertyShape.severity.orDefault(sh.Violation).value) {
|
|
145
|
+
case "http://www.w3.org/ns/shacl#Info":
|
|
146
|
+
case "http://www.w3.org/ns/shacl#Warning":
|
|
147
|
+
return Either.of(Maybe.empty());
|
|
148
|
+
}
|
|
149
|
+
const shapeStack = new ShapeStack(); // Start a new ShapeStack per property shape
|
|
150
|
+
return Eithers.chain2(propertyShape.resolve.isJust()
|
|
151
|
+
? this.shapesGraph
|
|
152
|
+
.nodeShape(propertyShape.resolve.extract())
|
|
153
|
+
.map(Maybe.of)
|
|
154
|
+
: Either.of(Maybe.empty()), transformPropertyShapeToAstType.call(this, propertyShape, shapeStack)).chain(([propertyShapeResolve, astType]) => {
|
|
155
|
+
let astResolveItemType;
|
|
156
|
+
if (propertyShapeResolve.isJust()) {
|
|
157
|
+
const astResolveTypeEither = transformShapeToAstType
|
|
158
|
+
.call(this, propertyShapeResolve.unsafeCoerce(), shapeStack)
|
|
159
|
+
.chain((astResolveType) => {
|
|
160
|
+
switch (astResolveType.kind) {
|
|
161
|
+
case "Struct":
|
|
162
|
+
return Either.of(astResolveType);
|
|
163
|
+
case "Union":
|
|
164
|
+
if (
|
|
165
|
+
// This check relies on .members being populated, which may not happen in cycles
|
|
166
|
+
astResolveType.members.length > 0 &&
|
|
167
|
+
!astResolveType.isStructUnionType()) {
|
|
168
|
+
return Left(new Error(`${propertyShape} resolve cannot refer to a ${astResolveType.kind} with non-StructType members`));
|
|
169
|
+
}
|
|
170
|
+
return Either.of(astResolveType);
|
|
171
|
+
default:
|
|
172
|
+
return Left(new Error(`${propertyShape} resolve cannot refer to a ${astResolveType.kind}`));
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
if (astResolveTypeEither.isLeft()) {
|
|
176
|
+
return astResolveTypeEither;
|
|
177
|
+
}
|
|
178
|
+
astResolveItemType = astResolveTypeEither.unsafeCoerce();
|
|
179
|
+
}
|
|
180
|
+
if (astResolveItemType) {
|
|
181
|
+
let astItemType;
|
|
182
|
+
switch (astType.kind) {
|
|
183
|
+
case "DefaultValue":
|
|
184
|
+
case "Option":
|
|
185
|
+
case "Set":
|
|
186
|
+
astItemType = astType.itemType;
|
|
187
|
+
break;
|
|
188
|
+
case "LazyOption":
|
|
189
|
+
case "LazySet":
|
|
190
|
+
// biome-ignore lint/suspicious/noFallthroughSwitchClause: break is unreachable
|
|
191
|
+
case "Lazy":
|
|
192
|
+
invariant(false, `lazy types should not appear here: ${astType.kind}`);
|
|
193
|
+
default:
|
|
194
|
+
astItemType = astType;
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
let astPartialItemType;
|
|
198
|
+
switch (astItemType.kind) {
|
|
199
|
+
case "BlankNode":
|
|
200
|
+
case "Identifier":
|
|
201
|
+
case "Iri":
|
|
202
|
+
astPartialItemType = synthesizePartialAstStructType.call(this, {
|
|
203
|
+
identifierType: astItemType,
|
|
204
|
+
});
|
|
205
|
+
break;
|
|
206
|
+
case "Struct":
|
|
207
|
+
astPartialItemType = astItemType;
|
|
208
|
+
break;
|
|
209
|
+
case "Union":
|
|
210
|
+
if (!astItemType.isStructUnionType()) {
|
|
211
|
+
return Left(new Error(`${propertyShape} partial type cannot be a ${astItemType.kind} with non-StructType members`));
|
|
212
|
+
}
|
|
213
|
+
astPartialItemType = astItemType;
|
|
214
|
+
break;
|
|
215
|
+
default:
|
|
216
|
+
return Left(new Error(`${propertyShape} has a resolve with an incompatible partial type ${astItemType.kind}`));
|
|
217
|
+
}
|
|
218
|
+
const astAbstractTypeProperties = {
|
|
219
|
+
comment: Maybe.empty(),
|
|
220
|
+
label: Maybe.empty(),
|
|
221
|
+
name: Maybe.empty(),
|
|
222
|
+
shapeIdentifier: propertyShape.$identifier(),
|
|
223
|
+
};
|
|
224
|
+
switch (astType.kind) {
|
|
225
|
+
case "BlankNode":
|
|
226
|
+
case "Identifier":
|
|
227
|
+
case "Iri":
|
|
228
|
+
case "Struct":
|
|
229
|
+
case "Union":
|
|
230
|
+
astType = new ast.LazyType({
|
|
231
|
+
...astAbstractTypeProperties,
|
|
232
|
+
partialType: astPartialItemType,
|
|
233
|
+
resolveType: astResolveItemType,
|
|
234
|
+
});
|
|
235
|
+
break;
|
|
236
|
+
case "Option":
|
|
237
|
+
astType = new ast.LazyOptionType({
|
|
238
|
+
...astAbstractTypeProperties,
|
|
239
|
+
partialType: new ast.OptionType({
|
|
240
|
+
itemType: astPartialItemType,
|
|
241
|
+
}),
|
|
242
|
+
resolveType: new ast.OptionType({
|
|
243
|
+
itemType: astResolveItemType,
|
|
244
|
+
}),
|
|
245
|
+
});
|
|
246
|
+
break;
|
|
247
|
+
case "Set":
|
|
248
|
+
astType = new ast.LazySetType({
|
|
249
|
+
...astAbstractTypeProperties,
|
|
250
|
+
partialType: new ast.SetType({
|
|
251
|
+
itemType: astPartialItemType,
|
|
252
|
+
minCount: 0n,
|
|
253
|
+
mutable: false,
|
|
254
|
+
}),
|
|
255
|
+
resolveType: new ast.SetType({
|
|
256
|
+
itemType: astResolveItemType,
|
|
257
|
+
minCount: 0n,
|
|
258
|
+
mutable: false,
|
|
259
|
+
}),
|
|
260
|
+
});
|
|
261
|
+
break;
|
|
262
|
+
default:
|
|
263
|
+
invariant(false, `unexpected lazy AST type ${astType.kind}`);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (propertyShape.path.termType === "InversePath" &&
|
|
267
|
+
astType.nodeKinds.has("Literal")) {
|
|
268
|
+
return Left(new Error(`${propertyShape}: property shapes with inverse paths can only have blank node or IRI node kinds`));
|
|
269
|
+
}
|
|
270
|
+
return Either.of(Maybe.of(new ast.StructType.Field({
|
|
271
|
+
comment: propertyShape.comment,
|
|
272
|
+
description: propertyShape.description,
|
|
273
|
+
display: propertyShape.display,
|
|
274
|
+
label: propertyShape.label,
|
|
275
|
+
mutable: propertyShape.mutable.orDefault(false),
|
|
276
|
+
name: fieldName.call(this, propertyShape, structType),
|
|
277
|
+
order: propertyShape.order.orDefault(0),
|
|
278
|
+
path: propertyShape.path,
|
|
279
|
+
shapeIdentifier: propertyShape.$identifier(),
|
|
280
|
+
structType,
|
|
281
|
+
type: astType,
|
|
282
|
+
})));
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
//# sourceMappingURL=transformPropertyShapeToAstStructTypeField.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Either, Maybe } from "purify-ts";
|
|
2
|
+
import * as ast from "../ast/index.js";
|
|
3
|
+
import type * as input from "../input/index.js";
|
|
4
|
+
import type { ShapesGraphToAstTransformer } from "../ShapesGraphToAstTransformer.js";
|
|
5
|
+
import type { ShapeStack } from "./ShapeStack.js";
|
|
6
|
+
/**
|
|
7
|
+
* Try to convert a shape to a compound type (intersection or union) using some heuristics.
|
|
8
|
+
*/
|
|
9
|
+
export declare function transformShapeToAstCompoundType(this: ShapesGraphToAstTransformer, shape: input.Shape, shapeStack: ShapeStack): Either<Error, Maybe<ast.Type>>;
|
|
10
|
+
//# sourceMappingURL=transformShapeToAstCompoundType.d.ts.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Either, Left, Maybe } from "purify-ts";
|
|
2
|
+
import { invariant } from "ts-invariant";
|
|
3
|
+
import * as ast from "../ast/index.js";
|
|
4
|
+
import { Eithers } from "../Eithers.js";
|
|
5
|
+
import { shapeAstTypeName } from "./shapeAstTypeName.js";
|
|
6
|
+
import { transformShapeToAstType } from "./transformShapeToAstType.js";
|
|
7
|
+
/**
|
|
8
|
+
* Try to convert a shape to a compound type (intersection or union) using some heuristics.
|
|
9
|
+
*/
|
|
10
|
+
export function transformShapeToAstCompoundType(shape, shapeStack) {
|
|
11
|
+
shapeStack.push(shape);
|
|
12
|
+
try {
|
|
13
|
+
return Eithers.chain2(Either.sequence(shape.and
|
|
14
|
+
.orDefault([])
|
|
15
|
+
.map((shapeIdentifier) => this.shapesGraph.shape(shapeIdentifier))), Either.sequence(shape.xone
|
|
16
|
+
.orDefault([])
|
|
17
|
+
.map((shapeIdentifier) => this.shapesGraph.shape(shapeIdentifier)))).chain(([andConstraintShapes, xoneConstraintShapes]) => {
|
|
18
|
+
let compoundTypeKind;
|
|
19
|
+
// Distinguish constraints that take arbitrary shapes from those that only take node shapes
|
|
20
|
+
// With the latter we'll do special transformations.
|
|
21
|
+
let memberShapes;
|
|
22
|
+
if (andConstraintShapes.length > 0) {
|
|
23
|
+
memberShapes = andConstraintShapes;
|
|
24
|
+
compoundTypeKind = "Intersection";
|
|
25
|
+
}
|
|
26
|
+
else if (xoneConstraintShapes.length > 0) {
|
|
27
|
+
memberShapes = xoneConstraintShapes;
|
|
28
|
+
compoundTypeKind = "Union";
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
return Either.of(Maybe.empty());
|
|
32
|
+
}
|
|
33
|
+
invariant(memberShapes.length > 0);
|
|
34
|
+
const memberDiscriminantValues = new Set();
|
|
35
|
+
const compoundType = new (compoundTypeKind === "Intersection"
|
|
36
|
+
? ast.IntersectionType
|
|
37
|
+
: ast.UnionType)({
|
|
38
|
+
comment: shape.comment,
|
|
39
|
+
label: shape.label,
|
|
40
|
+
name: shapeAstTypeName(shape),
|
|
41
|
+
shapeIdentifier: shape.$identifier(),
|
|
42
|
+
synthetic: false,
|
|
43
|
+
});
|
|
44
|
+
if (memberShapes.length === 1) {
|
|
45
|
+
return transformShapeToAstType
|
|
46
|
+
.call(this, memberShapes[0], shapeStack)
|
|
47
|
+
.map(Maybe.of);
|
|
48
|
+
}
|
|
49
|
+
// Put a placeholder in the cache to deal with cyclic references
|
|
50
|
+
this.cachedAstTypesByShapeIdentifier.set(shape.$identifier(), compoundType);
|
|
51
|
+
return Either.sequence(memberShapes.map((memberShape) => transformShapeToAstType.call(this, memberShape, shapeStack)))
|
|
52
|
+
.chain((memberShapeTypes) => {
|
|
53
|
+
for (let memberI = 0; memberI < memberShapes.length; memberI++) {
|
|
54
|
+
const memberShape = memberShapes[memberI];
|
|
55
|
+
const memberType = memberShapeTypes[memberI];
|
|
56
|
+
if (!ast.IntersectionType.isMemberType(memberType)) {
|
|
57
|
+
return Left(new Error(`${shape} has an invalid member type kind "${memberType.kind}"`));
|
|
58
|
+
}
|
|
59
|
+
if (memberI > 0 &&
|
|
60
|
+
compoundType.members.some((existingMember) => ast.Type.equals(memberType, existingMember.type))) {
|
|
61
|
+
return Left(new Error(`${shape} has duplicate ${compoundTypeKind} member type: ${memberType}`));
|
|
62
|
+
}
|
|
63
|
+
let memberDiscriminantValue;
|
|
64
|
+
if (compoundTypeKind === "Union") {
|
|
65
|
+
if (memberShape.$type === "NodeShape") {
|
|
66
|
+
memberDiscriminantValue =
|
|
67
|
+
memberShape.discriminantValue.extract();
|
|
68
|
+
}
|
|
69
|
+
if (memberDiscriminantValue) {
|
|
70
|
+
if (memberDiscriminantValues.has(memberDiscriminantValue)) {
|
|
71
|
+
return Left(new Error(`${shape} member ${memberShape} has a duplicate discriminant value: ${memberDiscriminantValue}`));
|
|
72
|
+
}
|
|
73
|
+
memberDiscriminantValues.add(memberDiscriminantValue);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
compoundType.addMember({
|
|
77
|
+
discriminantValue: Maybe.fromNullable(memberDiscriminantValue),
|
|
78
|
+
type: memberType,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return Either.of(Maybe.of(compoundType));
|
|
82
|
+
})
|
|
83
|
+
.ifLeft(() => {
|
|
84
|
+
this.cachedAstTypesByShapeIdentifier.delete(shape.$identifier());
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
shapeStack.pop(shape);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=transformShapeToAstCompoundType.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Either, Maybe } from "purify-ts";
|
|
2
|
+
import * as ast from "../ast/index.js";
|
|
3
|
+
import type * as input from "../input/index.js";
|
|
4
|
+
import type { ShapesGraphToAstTransformer } from "../ShapesGraphToAstTransformer.js";
|
|
5
|
+
import type { ShapeStack } from "./ShapeStack.js";
|
|
6
|
+
/**
|
|
7
|
+
* Is an ast.StructType actually the shape of an RDF list?
|
|
8
|
+
* If so, return the type of its rdf:first.
|
|
9
|
+
*/
|
|
10
|
+
export declare function transformShapeToAstListType(this: ShapesGraphToAstTransformer, shape: input.Shape, shapeStack: ShapeStack): Either<Error, Maybe<ast.ListType>>;
|
|
11
|
+
//# sourceMappingURL=transformShapeToAstListType.d.ts.map
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import dataFactory from "@rdfx/data-factory";
|
|
2
|
+
import { rdf } from "@tpluscode/rdf-ns-builders";
|
|
3
|
+
import { Either, Left, Maybe } from "purify-ts";
|
|
4
|
+
import * as ast from "../ast/index.js";
|
|
5
|
+
import { Eithers } from "../Eithers.js";
|
|
6
|
+
import { defaultNodeShapeNodeKinds } from "./defaultNodeShapeNodeKinds.js";
|
|
7
|
+
import { shapeNodeKinds } from "./shapeNodeKinds.js";
|
|
8
|
+
import { transformPropertyShapeToAstStructTypeField } from "./transformPropertyShapeToAstStructTypeField.js";
|
|
9
|
+
const listPropertiesStructType = new ast.StructType({
|
|
10
|
+
extern: false,
|
|
11
|
+
comment: Maybe.empty(),
|
|
12
|
+
label: Maybe.empty(),
|
|
13
|
+
identifierType: new ast.IdentifierType({
|
|
14
|
+
comment: Maybe.empty(),
|
|
15
|
+
label: Maybe.empty(),
|
|
16
|
+
name: Maybe.empty(),
|
|
17
|
+
shapeIdentifier: dataFactory.blankNode(),
|
|
18
|
+
}),
|
|
19
|
+
fromRdfType: Maybe.empty(),
|
|
20
|
+
name: Maybe.empty(),
|
|
21
|
+
toRdfTypes: [],
|
|
22
|
+
shapeIdentifier: dataFactory.blankNode(),
|
|
23
|
+
synthetic: true,
|
|
24
|
+
tsImports: [],
|
|
25
|
+
});
|
|
26
|
+
const astListTypePlaceholderItemType = new ast.BlankNodeType({
|
|
27
|
+
comment: Maybe.empty(),
|
|
28
|
+
label: Maybe.empty(),
|
|
29
|
+
name: Maybe.empty(),
|
|
30
|
+
shapeIdentifier: dataFactory.blankNode(),
|
|
31
|
+
});
|
|
32
|
+
const empty = Either.of(Maybe.empty());
|
|
33
|
+
/**
|
|
34
|
+
* Is an ast.StructType actually the shape of an RDF list?
|
|
35
|
+
* If so, return the type of its rdf:first.
|
|
36
|
+
*/
|
|
37
|
+
export function transformShapeToAstListType(shape, shapeStack) {
|
|
38
|
+
shapeStack.push(shape);
|
|
39
|
+
try {
|
|
40
|
+
if (shape.$type !== "NodeShape") {
|
|
41
|
+
return empty;
|
|
42
|
+
}
|
|
43
|
+
const nodeShape = shape;
|
|
44
|
+
return Eithers.chain2(shapeNodeKinds.call(this, nodeShape, { defaultNodeShapeNodeKinds }), Either.sequence(nodeShape.xone
|
|
45
|
+
.orDefault([])
|
|
46
|
+
.map((shapeIdentifier) => this.shapesGraph.shape(shapeIdentifier)))).chain(([nodeKinds, xone]) => {
|
|
47
|
+
// Put a placeholder in the cache to deal with cyclic references
|
|
48
|
+
// Remove the placeholder if the transformation fails.
|
|
49
|
+
const listType = new ast.ListType({
|
|
50
|
+
comment: nodeShape.comment,
|
|
51
|
+
identifierNodeKind: nodeKinds.has("BlankNode") ? "BlankNode" : "IRI",
|
|
52
|
+
itemType: astListTypePlaceholderItemType,
|
|
53
|
+
label: nodeShape.label,
|
|
54
|
+
mutable: nodeShape.mutable.orDefault(false),
|
|
55
|
+
// name: shapeAstTypeName(nodeShape),
|
|
56
|
+
// List types don't need names currently
|
|
57
|
+
name: Maybe.empty(),
|
|
58
|
+
shapeIdentifier: nodeShape.$identifier(),
|
|
59
|
+
toRdfTypes: nodeShape.toRdfTypes,
|
|
60
|
+
});
|
|
61
|
+
this.cachedAstTypesByShapeIdentifier.set(nodeShape.$identifier(), listType);
|
|
62
|
+
return (() => {
|
|
63
|
+
let emptyListShape;
|
|
64
|
+
let nonEmptyListShape;
|
|
65
|
+
for (const shape of xone) {
|
|
66
|
+
if (shape.hasValues.length === 1 &&
|
|
67
|
+
shape.hasValues[0].equals(rdf.nil)) {
|
|
68
|
+
emptyListShape = shape;
|
|
69
|
+
}
|
|
70
|
+
else if (shape.$type === "NodeShape" &&
|
|
71
|
+
shape.properties.length >= 2) {
|
|
72
|
+
nonEmptyListShape = shape;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (!emptyListShape || !nonEmptyListShape) {
|
|
76
|
+
return empty;
|
|
77
|
+
}
|
|
78
|
+
return Either.sequence(nonEmptyListShape.properties.map((propertyShapeIdentifier) => this.shapesGraph.propertyShape(propertyShapeIdentifier))).chain((nonEmptyListShapePropertyShapes) => {
|
|
79
|
+
let firstPropertyShape;
|
|
80
|
+
let restPropertyShape;
|
|
81
|
+
for (const propertyShape of nonEmptyListShapePropertyShapes) {
|
|
82
|
+
if (propertyShape.path.termType !== "NamedNode") {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (propertyShape.path.equals(rdf.first)) {
|
|
86
|
+
firstPropertyShape = propertyShape;
|
|
87
|
+
}
|
|
88
|
+
else if (propertyShape.path.equals(rdf.rest)) {
|
|
89
|
+
restPropertyShape = propertyShape;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (!firstPropertyShape) {
|
|
93
|
+
return empty;
|
|
94
|
+
}
|
|
95
|
+
if (firstPropertyShape.maxCount.extract() !== 1n ||
|
|
96
|
+
firstPropertyShape.minCount.extract() !== 1n) {
|
|
97
|
+
return Left(new Error(`${nodeShape} non-empty list shape rdf:first property shape does not have sh:maxCount=1 and/or sh:minCount=1`));
|
|
98
|
+
}
|
|
99
|
+
if (!restPropertyShape) {
|
|
100
|
+
return empty;
|
|
101
|
+
}
|
|
102
|
+
if (restPropertyShape.maxCount.extract() !== 1n ||
|
|
103
|
+
restPropertyShape.minCount.extract() !== 1n) {
|
|
104
|
+
return Left(new Error(`${nodeShape} non-empty list shape rdf:rest property shape does not have sh:maxCount=1 and/or sh:minCount=1`));
|
|
105
|
+
}
|
|
106
|
+
return transformPropertyShapeToAstStructTypeField
|
|
107
|
+
.call(this, {
|
|
108
|
+
// Just need a dummy ast.StructType here to get the properties transformed.
|
|
109
|
+
propertyShape: firstPropertyShape,
|
|
110
|
+
structType: listPropertiesStructType,
|
|
111
|
+
})
|
|
112
|
+
.chain((firstFieldMaybe) => {
|
|
113
|
+
const firstField = firstFieldMaybe.extract();
|
|
114
|
+
if (!firstField) {
|
|
115
|
+
return Left(new Error(`${nodeShape}: rdf:first field is ignored`));
|
|
116
|
+
}
|
|
117
|
+
if (!ast.ListType.isItemType(firstField.type)) {
|
|
118
|
+
return Left(new Error(`${nodeShape}: ${firstField.type.kind} is not a valid list item type`));
|
|
119
|
+
}
|
|
120
|
+
listType.itemType = firstField.type;
|
|
121
|
+
return transformPropertyShapeToAstStructTypeField
|
|
122
|
+
.call(this, {
|
|
123
|
+
// Just need a dummy ast.StructType here to get the properties transformed.
|
|
124
|
+
propertyShape: restPropertyShape,
|
|
125
|
+
structType: listPropertiesStructType,
|
|
126
|
+
})
|
|
127
|
+
.chain((restFieldMaybe) => {
|
|
128
|
+
const restField = restFieldMaybe.extract();
|
|
129
|
+
if (!restField) {
|
|
130
|
+
return Left(new Error(`${nodeShape}: rdf:rest field is ignored`));
|
|
131
|
+
}
|
|
132
|
+
if (restField.type.kind !== "List" ||
|
|
133
|
+
!restField.type.shapeIdentifier.equals(nodeShape.$identifier())) {
|
|
134
|
+
return Left(new Error(`${nodeShape} rdf:rest property is not recursive into the node shape`));
|
|
135
|
+
}
|
|
136
|
+
return Either.of(Maybe.of(listType));
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
})().ifLeft(() => {
|
|
141
|
+
this.cachedAstTypesByShapeIdentifier.delete(nodeShape.$identifier());
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
finally {
|
|
146
|
+
shapeStack.pop(shape);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=transformShapeToAstListType.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Either, Maybe } from "purify-ts";
|
|
2
|
+
import * as ast from "../ast/index.js";
|
|
3
|
+
import type * as input from "../input/index.js";
|
|
4
|
+
import type { ShapesGraphToAstTransformer } from "../ShapesGraphToAstTransformer.js";
|
|
5
|
+
import type { ShapeStack } from "./ShapeStack.js";
|
|
6
|
+
export declare function transformShapeToAstStructType(this: ShapesGraphToAstTransformer, shape: input.Shape, shapeStack: ShapeStack): Either<Error, Maybe<ast.Type>>;
|
|
7
|
+
//# sourceMappingURL=transformShapeToAstStructType.d.ts.map
|