@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
|
@@ -14,6 +14,9 @@ export class AbstractContainerType extends AbstractType {
|
|
|
14
14
|
super(superParameters);
|
|
15
15
|
this.itemType = itemType;
|
|
16
16
|
}
|
|
17
|
+
get recursive() {
|
|
18
|
+
return this.itemType.recursive;
|
|
19
|
+
}
|
|
17
20
|
equals(other) {
|
|
18
21
|
if (!super.equals(other)) {
|
|
19
22
|
return false;
|
|
@@ -36,9 +39,7 @@ export class AbstractContainerType extends AbstractType {
|
|
|
36
39
|
case "IriType":
|
|
37
40
|
case "ListType":
|
|
38
41
|
case "LiteralType":
|
|
39
|
-
case "ObjectIntersectionType":
|
|
40
42
|
case "ObjectType":
|
|
41
|
-
case "ObjectUnionType":
|
|
42
43
|
case "TermType":
|
|
43
44
|
case "UnionType":
|
|
44
45
|
return true;
|
|
@@ -49,8 +50,6 @@ export class AbstractContainerType extends AbstractType {
|
|
|
49
50
|
case "OptionType":
|
|
50
51
|
case "SetType":
|
|
51
52
|
return false;
|
|
52
|
-
case "PlaceholderType":
|
|
53
|
-
throw new Error("should never happen");
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
AbstractContainerType.isItemType = isItemType;
|
|
@@ -14,6 +14,7 @@ export declare abstract class AbstractLazyObjectType<PartialTypeT extends Abstra
|
|
|
14
14
|
partialType: PartialTypeT;
|
|
15
15
|
resolveType: ResolveTypeT;
|
|
16
16
|
} & ConstructorParameters<typeof AbstractType>[0]);
|
|
17
|
+
get recursive(): boolean;
|
|
17
18
|
equals(other: AbstractLazyObjectType<PartialTypeT, ResolveTypeT>): boolean;
|
|
18
19
|
toString(): string;
|
|
19
20
|
}
|
|
@@ -11,6 +11,9 @@ export class AbstractLazyObjectType extends AbstractType {
|
|
|
11
11
|
this.partialType = partialType;
|
|
12
12
|
this.resolveType = resolveType;
|
|
13
13
|
}
|
|
14
|
+
get recursive() {
|
|
15
|
+
return this.partialType.recursive;
|
|
16
|
+
}
|
|
14
17
|
equals(other) {
|
|
15
18
|
if (!super.equals(other)) {
|
|
16
19
|
return false;
|
|
@@ -14,6 +14,7 @@ export declare abstract class AbstractTermType<ConstantTermT extends Literal | N
|
|
|
14
14
|
readonly in_: readonly ConstantTermT[];
|
|
15
15
|
abstract readonly kind: "BlankNodeType" | "IdentifierType" | "IriType" | "LiteralType" | "TermType";
|
|
16
16
|
abstract readonly nodeKinds: ReadonlySet<NodeKind>;
|
|
17
|
+
readonly recursive = false;
|
|
17
18
|
constructor({ hasValues, in_, ...superParameters }: {
|
|
18
19
|
hasValues: readonly ConstantTermT[];
|
|
19
20
|
in_: readonly ConstantTermT[];
|
|
@@ -11,6 +11,7 @@ import { arrayEquals, setEquals, strictEquals, termEquals } from "./equals.js";
|
|
|
11
11
|
export class AbstractTermType extends AbstractType {
|
|
12
12
|
hasValues;
|
|
13
13
|
in_;
|
|
14
|
+
recursive = false;
|
|
14
15
|
constructor({ hasValues, in_, ...superParameters }) {
|
|
15
16
|
super(superParameters);
|
|
16
17
|
this.hasValues = hasValues;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BlankNode, NamedNode } from "@rdfjs/types";
|
|
1
2
|
import { Maybe } from "purify-ts";
|
|
2
3
|
/**
|
|
3
4
|
* Abstract base class for Types.
|
|
@@ -11,9 +12,23 @@ export declare abstract class AbstractType {
|
|
|
11
12
|
* Human-readable label from rdfs:label.
|
|
12
13
|
*/
|
|
13
14
|
readonly label: Maybe<string>;
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Name of this type, from shaclmate:name or sh:name.
|
|
17
|
+
*/
|
|
18
|
+
readonly name: Maybe<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Does this type directly or indirectly reference itself?
|
|
21
|
+
*/
|
|
22
|
+
abstract readonly recursive: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Identifier of the shape this type was derived from.
|
|
25
|
+
*/
|
|
26
|
+
readonly shapeIdentifier: BlankNode | NamedNode;
|
|
27
|
+
constructor({ comment, label, name, shapeIdentifier, }: {
|
|
15
28
|
comment: Maybe<string>;
|
|
16
29
|
label: Maybe<string>;
|
|
30
|
+
name: Maybe<string>;
|
|
31
|
+
shapeIdentifier: BlankNode | NamedNode;
|
|
17
32
|
});
|
|
18
33
|
equals(other: AbstractType): boolean;
|
|
19
34
|
abstract toString(): string;
|
package/dist/ast/AbstractType.js
CHANGED
|
@@ -12,9 +12,19 @@ export class AbstractType {
|
|
|
12
12
|
* Human-readable label from rdfs:label.
|
|
13
13
|
*/
|
|
14
14
|
label = Maybe.empty();
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Name of this type, from shaclmate:name or sh:name.
|
|
17
|
+
*/
|
|
18
|
+
name;
|
|
19
|
+
/**
|
|
20
|
+
* Identifier of the shape this type was derived from.
|
|
21
|
+
*/
|
|
22
|
+
shapeIdentifier;
|
|
23
|
+
constructor({ comment, label, name, shapeIdentifier, }) {
|
|
16
24
|
this.comment = comment;
|
|
17
25
|
this.label = label;
|
|
26
|
+
this.name = name;
|
|
27
|
+
this.shapeIdentifier = shapeIdentifier;
|
|
18
28
|
}
|
|
19
29
|
equals(other) {
|
|
20
30
|
if (!maybeEquals(strictEquals)(this.comment, other.comment)) {
|
package/dist/ast/Ast.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IntersectionType } from "./IntersectionType.js";
|
|
2
2
|
import type { ObjectType } from "./ObjectType.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { UnionType } from "./UnionType.js";
|
|
4
4
|
export interface Ast {
|
|
5
|
-
readonly
|
|
6
|
-
readonly
|
|
7
|
-
readonly
|
|
5
|
+
readonly namedIntersectionTypes: readonly IntersectionType[];
|
|
6
|
+
readonly namedObjectTypes: readonly ObjectType[];
|
|
7
|
+
readonly namedUnionTypes: readonly UnionType[];
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=Ast.d.ts.map
|
|
@@ -6,6 +6,6 @@ import { AbstractTermType } from "./AbstractTermType.js";
|
|
|
6
6
|
export declare class BlankNodeType extends AbstractTermType<NamedNode, BlankNode> {
|
|
7
7
|
readonly kind = "BlankNodeType";
|
|
8
8
|
readonly nodeKinds: ReadonlySet<"BlankNode">;
|
|
9
|
-
constructor(superParameters: Pick<ConstructorParameters<typeof AbstractTermType<NamedNode, BlankNode>>[0], "comment" | "label">);
|
|
9
|
+
constructor(superParameters: Pick<ConstructorParameters<typeof AbstractTermType<NamedNode, BlankNode>>[0], "comment" | "label" | "name" | "shapeIdentifier">);
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=BlankNodeType.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Literal, NamedNode } from "@rdfjs/types";
|
|
2
2
|
import { AbstractContainerType } from "./AbstractContainerType.js";
|
|
3
3
|
import type { BlankNodeType } from "./BlankNodeType.js";
|
|
4
|
-
import type { PlaceholderType } from "./PlaceholderType.js";
|
|
5
4
|
import type { Type } from "./Type.js";
|
|
6
5
|
/**
|
|
7
6
|
* A type with an sh:defaultValue.
|
|
@@ -20,7 +19,7 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
|
|
|
20
19
|
equals(other: DefaultValueType<ItemTypeT>): boolean;
|
|
21
20
|
}
|
|
22
21
|
export declare namespace DefaultValueType {
|
|
23
|
-
type ItemType = Exclude<AbstractContainerType.ItemType, BlankNodeType
|
|
22
|
+
type ItemType = Exclude<AbstractContainerType.ItemType, BlankNodeType>;
|
|
24
23
|
function isItemType(type: Type): type is ItemType;
|
|
25
24
|
}
|
|
26
25
|
//# sourceMappingURL=DefaultValueType.d.ts.map
|
|
@@ -7,6 +7,6 @@ import { AbstractTermType } from "./AbstractTermType.js";
|
|
|
7
7
|
export declare class IdentifierType extends AbstractTermType<NamedNode, BlankNode | NamedNode> {
|
|
8
8
|
readonly kind = "IdentifierType";
|
|
9
9
|
readonly nodeKinds: ReadonlySet<IdentifierNodeKind>;
|
|
10
|
-
constructor(superParameters: Pick<ConstructorParameters<typeof AbstractTermType<NamedNode, BlankNode>>[0], "comment" | "label">);
|
|
10
|
+
constructor(superParameters: Pick<ConstructorParameters<typeof AbstractTermType<NamedNode, BlankNode>>[0], "comment" | "label" | "name" | "shapeIdentifier">);
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=IdentifierType.d.ts.map
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { AbstractCompoundType } from "./AbstractCompoundType.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ObjectIntersectionType } from "./ObjectIntersectionType.js";
|
|
3
3
|
/**
|
|
4
4
|
* A conjunction ("and") of types, corresponding to an sh:and.
|
|
5
5
|
*/
|
|
6
|
-
export declare class IntersectionType extends AbstractCompoundType<
|
|
6
|
+
export declare class IntersectionType<MemberTypeT extends IntersectionType.MemberType = IntersectionType.MemberType> extends AbstractCompoundType<AbstractCompoundType.Member<MemberTypeT>, MemberTypeT> {
|
|
7
7
|
readonly kind = "IntersectionType";
|
|
8
|
+
isObjectIntersectionType(): this is ObjectIntersectionType;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace IntersectionType {
|
|
11
|
+
type MemberType = AbstractCompoundType.MemberType;
|
|
12
|
+
const isMemberType: typeof AbstractCompoundType.isMemberType;
|
|
8
13
|
}
|
|
9
14
|
//# sourceMappingURL=IntersectionType.d.ts.map
|
|
@@ -4,5 +4,13 @@ import { AbstractCompoundType } from "./AbstractCompoundType.js";
|
|
|
4
4
|
*/
|
|
5
5
|
export class IntersectionType extends AbstractCompoundType {
|
|
6
6
|
kind = "IntersectionType";
|
|
7
|
+
isObjectIntersectionType() {
|
|
8
|
+
return this.members.every((member) => member.type.kind === "ObjectType" ||
|
|
9
|
+
(member.type.kind === "IntersectionType" &&
|
|
10
|
+
member.type.isObjectIntersectionType()));
|
|
11
|
+
}
|
|
7
12
|
}
|
|
13
|
+
(function (IntersectionType) {
|
|
14
|
+
IntersectionType.isMemberType = AbstractCompoundType.isMemberType;
|
|
15
|
+
})(IntersectionType || (IntersectionType = {}));
|
|
8
16
|
//# sourceMappingURL=IntersectionType.js.map
|
package/dist/ast/ListType.d.ts
CHANGED
|
@@ -8,10 +8,7 @@ import type { IdentifierType } from "./IdentifierType.js";
|
|
|
8
8
|
import type { IntersectionType } from "./IntersectionType.js";
|
|
9
9
|
import type { IriType } from "./IriType.js";
|
|
10
10
|
import type { LiteralType } from "./LiteralType.js";
|
|
11
|
-
import type { ObjectIntersectionType } from "./ObjectIntersectionType.js";
|
|
12
11
|
import type { ObjectType } from "./ObjectType.js";
|
|
13
|
-
import type { ObjectUnionType } from "./ObjectUnionType.js";
|
|
14
|
-
import type { PlaceholderType } from "./PlaceholderType.js";
|
|
15
12
|
import type { TermType } from "./TermType.js";
|
|
16
13
|
import type { Type } from "./Type.js";
|
|
17
14
|
import type { UnionType } from "./UnionType.js";
|
|
@@ -32,10 +29,6 @@ export declare class ListType<ItemTypeT extends ListType.ItemType = ListType.Ite
|
|
|
32
29
|
* Strategy for minting new list and sub-list identifiers.
|
|
33
30
|
*/
|
|
34
31
|
readonly identifierMintingStrategy: Maybe<IdentifierMintingStrategy>;
|
|
35
|
-
/**
|
|
36
|
-
* Identifier of the node shape this type was derived from.
|
|
37
|
-
*/
|
|
38
|
-
readonly shapeIdentifier: BlankNode | NamedNode;
|
|
39
32
|
/**
|
|
40
33
|
* rdf:type's that will be added to this object when it's serialized toRdf.
|
|
41
34
|
*
|
|
@@ -43,7 +36,7 @@ export declare class ListType<ItemTypeT extends ListType.ItemType = ListType.Ite
|
|
|
43
36
|
* class targets).
|
|
44
37
|
*/
|
|
45
38
|
readonly toRdfTypes: readonly NamedNode[];
|
|
46
|
-
constructor({ identifierMintingStrategy, identifierNodeKind,
|
|
39
|
+
constructor({ identifierMintingStrategy, identifierNodeKind, toRdfTypes, ...superParameters }: {
|
|
47
40
|
identifierMintingStrategy: Maybe<IdentifierMintingStrategy>;
|
|
48
41
|
identifierNodeKind: IdentifierNodeKind;
|
|
49
42
|
shapeIdentifier: BlankNode | NamedNode;
|
|
@@ -52,7 +45,7 @@ export declare class ListType<ItemTypeT extends ListType.ItemType = ListType.Ite
|
|
|
52
45
|
equals(other: ListType<ItemTypeT>): boolean;
|
|
53
46
|
}
|
|
54
47
|
export declare namespace ListType {
|
|
55
|
-
type ItemType = BlankNodeType | IdentifierType | IntersectionType | IriType | LiteralType |
|
|
48
|
+
type ItemType = BlankNodeType | IdentifierType | IntersectionType | IriType | LiteralType | ObjectType | TermType | UnionType;
|
|
56
49
|
function isItemType(type: Type): type is ItemType;
|
|
57
50
|
}
|
|
58
51
|
//# sourceMappingURL=ListType.d.ts.map
|
package/dist/ast/ListType.js
CHANGED
|
@@ -16,10 +16,6 @@ export class ListType extends AbstractCollectionType {
|
|
|
16
16
|
* Strategy for minting new list and sub-list identifiers.
|
|
17
17
|
*/
|
|
18
18
|
identifierMintingStrategy;
|
|
19
|
-
/**
|
|
20
|
-
* Identifier of the node shape this type was derived from.
|
|
21
|
-
*/
|
|
22
|
-
shapeIdentifier;
|
|
23
19
|
/**
|
|
24
20
|
* rdf:type's that will be added to this object when it's serialized toRdf.
|
|
25
21
|
*
|
|
@@ -27,11 +23,10 @@ export class ListType extends AbstractCollectionType {
|
|
|
27
23
|
* class targets).
|
|
28
24
|
*/
|
|
29
25
|
toRdfTypes;
|
|
30
|
-
constructor({ identifierMintingStrategy, identifierNodeKind,
|
|
26
|
+
constructor({ identifierMintingStrategy, identifierNodeKind, toRdfTypes, ...superParameters }) {
|
|
31
27
|
super(superParameters);
|
|
32
28
|
this.identifierMintingStrategy = identifierMintingStrategy;
|
|
33
29
|
this.identifierNodeKind = identifierNodeKind;
|
|
34
|
-
this.shapeIdentifier = shapeIdentifier;
|
|
35
30
|
this.toRdfTypes = toRdfTypes;
|
|
36
31
|
}
|
|
37
32
|
equals(other) {
|
|
@@ -47,10 +42,7 @@ export class ListType extends AbstractCollectionType {
|
|
|
47
42
|
case "IntersectionType":
|
|
48
43
|
case "IriType":
|
|
49
44
|
case "LiteralType":
|
|
50
|
-
case "ObjectIntersectionType":
|
|
51
45
|
case "ObjectType":
|
|
52
|
-
case "ObjectUnionType":
|
|
53
|
-
case "PlaceholderType":
|
|
54
46
|
case "TermType":
|
|
55
47
|
case "UnionType":
|
|
56
48
|
return true;
|
|
@@ -18,6 +18,7 @@ export declare class LiteralType extends AbstractTermType<Literal, Literal> {
|
|
|
18
18
|
minExclusive: Maybe<Literal>;
|
|
19
19
|
minInclusive: Maybe<Literal>;
|
|
20
20
|
} & Omit<ConstructorParameters<typeof AbstractTermType<Literal, Literal>>[0], "nodeKinds">);
|
|
21
|
+
equals(other: AbstractTermType<Literal, Literal>): boolean;
|
|
21
22
|
toString(): string;
|
|
22
23
|
}
|
|
23
24
|
//# sourceMappingURL=LiteralType.d.ts.map
|
package/dist/ast/LiteralType.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AbstractTermType } from "./AbstractTermType.js";
|
|
2
|
+
import { arrayEquals, maybeEquals, strictEquals, termEquals, } from "./equals.js";
|
|
2
3
|
export class LiteralType extends AbstractTermType {
|
|
3
4
|
datatype;
|
|
4
5
|
kind = "LiteralType";
|
|
@@ -17,6 +18,31 @@ export class LiteralType extends AbstractTermType {
|
|
|
17
18
|
this.minExclusive = minExclusive;
|
|
18
19
|
this.minInclusive = minInclusive;
|
|
19
20
|
}
|
|
21
|
+
equals(other) {
|
|
22
|
+
if (!super.equals(other)) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const otherLiteralType = other;
|
|
26
|
+
if (!maybeEquals(termEquals)(this.datatype, otherLiteralType.datatype)) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
if (!arrayEquals(strictEquals)(this.languageIn, otherLiteralType.languageIn)) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
if (!maybeEquals(termEquals)(this.maxExclusive, otherLiteralType.maxExclusive)) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
if (!maybeEquals(termEquals)(this.maxInclusive, otherLiteralType.maxInclusive)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (!maybeEquals(termEquals)(this.minExclusive, otherLiteralType.minExclusive)) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
if (!maybeEquals(termEquals)(this.minInclusive, otherLiteralType.minInclusive)) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
20
46
|
toString() {
|
|
21
47
|
return `${this.kind}()`;
|
|
22
48
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BlankNodeType } from "./BlankNodeType.js";
|
|
2
|
+
import { IdentifierType } from "./IdentifierType.js";
|
|
3
|
+
import { IriType } from "./IriType.js";
|
|
4
|
+
import type { ObjectIntersectionType } from "./ObjectIntersectionType.js";
|
|
5
|
+
import type { ObjectType } from "./ObjectType.js";
|
|
6
|
+
import type { ObjectUnionType } from "./ObjectUnionType.js";
|
|
7
|
+
export type ObjectCompoundType = ObjectIntersectionType | ObjectUnionType;
|
|
8
|
+
export declare namespace ObjectCompoundType {
|
|
9
|
+
function identifierType(objectCompoundType: ObjectCompoundType): BlankNodeType | IdentifierType | IriType;
|
|
10
|
+
function memberObjectTypes(objectCompoundType: ObjectCompoundType): readonly ObjectType[];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ObjectCompoundType.d.ts.map
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import TermSet from "@rdfjs/term-set";
|
|
2
|
+
import { Maybe } from "purify-ts";
|
|
3
|
+
import { Resource } from "rdfjs-resource";
|
|
4
|
+
import { invariant } from "ts-invariant";
|
|
5
|
+
import { BlankNodeType } from "./BlankNodeType.js";
|
|
6
|
+
import { IdentifierType } from "./IdentifierType.js";
|
|
7
|
+
import { IriType } from "./IriType.js";
|
|
8
|
+
export var ObjectCompoundType;
|
|
9
|
+
(function (ObjectCompoundType) {
|
|
10
|
+
function identifierType(objectCompoundType) {
|
|
11
|
+
const memberIdentifierTypeNodeKinds = new Set();
|
|
12
|
+
const memberIdentifierTypesIn = new TermSet();
|
|
13
|
+
for (const memberType of memberObjectTypes(objectCompoundType)) {
|
|
14
|
+
for (const nodeKind of memberType.identifierType.nodeKinds) {
|
|
15
|
+
memberIdentifierTypeNodeKinds.add(nodeKind);
|
|
16
|
+
}
|
|
17
|
+
for (const in_ of memberType.identifierType.in_) {
|
|
18
|
+
memberIdentifierTypesIn.add(in_);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
invariant(memberIdentifierTypeNodeKinds.size > 0);
|
|
22
|
+
if (memberIdentifierTypeNodeKinds.size === 2) {
|
|
23
|
+
return new IdentifierType({
|
|
24
|
+
comment: Maybe.empty(),
|
|
25
|
+
label: Maybe.empty(),
|
|
26
|
+
name: Maybe.empty(),
|
|
27
|
+
shapeIdentifier: objectCompoundType.shapeIdentifier,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const memberIdentifierTypeNodeKind = [...memberIdentifierTypeNodeKinds][0];
|
|
31
|
+
switch (memberIdentifierTypeNodeKind) {
|
|
32
|
+
case "BlankNode":
|
|
33
|
+
return new BlankNodeType({
|
|
34
|
+
comment: Maybe.empty(),
|
|
35
|
+
label: Maybe.empty(),
|
|
36
|
+
name: Maybe.empty(),
|
|
37
|
+
shapeIdentifier: objectCompoundType.shapeIdentifier,
|
|
38
|
+
});
|
|
39
|
+
case "IRI":
|
|
40
|
+
return new IriType({
|
|
41
|
+
comment: Maybe.empty(),
|
|
42
|
+
hasValues: [],
|
|
43
|
+
in_: [...memberIdentifierTypesIn],
|
|
44
|
+
label: Maybe.empty(),
|
|
45
|
+
name: Maybe.empty(),
|
|
46
|
+
shapeIdentifier: objectCompoundType.shapeIdentifier,
|
|
47
|
+
});
|
|
48
|
+
default:
|
|
49
|
+
memberIdentifierTypeNodeKind;
|
|
50
|
+
throw new Error("should never reach here");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
ObjectCompoundType.identifierType = identifierType;
|
|
54
|
+
function memberObjectTypes(objectCompoundType) {
|
|
55
|
+
const memberObjectTypes_ = [];
|
|
56
|
+
for (const member of objectCompoundType.members) {
|
|
57
|
+
switch (member.type.kind) {
|
|
58
|
+
case "ObjectType":
|
|
59
|
+
memberObjectTypes_.push(member.type);
|
|
60
|
+
break;
|
|
61
|
+
case "IntersectionType":
|
|
62
|
+
case "UnionType": {
|
|
63
|
+
invariant(member.type.kind === objectCompoundType.kind);
|
|
64
|
+
memberObjectTypes_.push(...memberObjectTypes(member.type));
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
invariant(memberObjectTypes_.length >= objectCompoundType.members.length, "object compound type has no member ObjectType's");
|
|
70
|
+
// Member object types must have distinct RDF types or no RDF types at all.
|
|
71
|
+
const fromRdfTypes = new TermSet();
|
|
72
|
+
let expectUniqueFromRdfTypesCount = 0;
|
|
73
|
+
for (const memberObjectType of memberObjectTypes_) {
|
|
74
|
+
if (memberObjectType.extern) {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
expectUniqueFromRdfTypesCount++;
|
|
78
|
+
memberObjectType.fromRdfType.ifJust((fromRdfType) => fromRdfTypes.add(fromRdfType));
|
|
79
|
+
}
|
|
80
|
+
if (fromRdfTypes.size > 0 &&
|
|
81
|
+
fromRdfTypes.size !== expectUniqueFromRdfTypesCount) {
|
|
82
|
+
throw new Error(`one or more ${objectCompoundType} members ([${memberObjectTypes_.map((memberType) => memberType.toString()).join(", ")}]) lack distinguishing fromRdfType's ({${[...fromRdfTypes].map((fromRdfType) => Resource.Identifier.toString(fromRdfType)).join(", ")}})`);
|
|
83
|
+
}
|
|
84
|
+
return memberObjectTypes_;
|
|
85
|
+
}
|
|
86
|
+
ObjectCompoundType.memberObjectTypes = memberObjectTypes;
|
|
87
|
+
})(ObjectCompoundType || (ObjectCompoundType = {}));
|
|
88
|
+
//# sourceMappingURL=ObjectCompoundType.js.map
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export declare class ObjectIntersectionType extends AbstractObjectCompoundType<ObjectIntersectionType> {
|
|
6
|
-
readonly kind = "ObjectIntersectionType";
|
|
7
|
-
}
|
|
1
|
+
import type { IntersectionType } from "./IntersectionType.js";
|
|
2
|
+
import type { ObjectType } from "./ObjectType.js";
|
|
3
|
+
export type ObjectIntersectionType = IntersectionType<IntersectionType<ObjectType> | ObjectType>;
|
|
8
4
|
//# sourceMappingURL=ObjectIntersectionType.d.ts.map
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* A conjunction/intersection of object types, corresponding to an sh:and on a node shape.
|
|
4
|
-
*/
|
|
5
|
-
export class ObjectIntersectionType extends AbstractObjectCompoundType {
|
|
6
|
-
kind = "ObjectIntersectionType";
|
|
7
|
-
}
|
|
1
|
+
export {};
|
|
8
2
|
//# sourceMappingURL=ObjectIntersectionType.js.map
|
package/dist/ast/ObjectType.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import type { TsFeature } from "../enums/TsFeature.js";
|
|
|
7
7
|
import type { TsObjectDeclarationType } from "../enums/TsObjectDeclarationType.js";
|
|
8
8
|
import { AbstractType } from "./AbstractType.js";
|
|
9
9
|
import type { BlankNodeType } from "./BlankNodeType.js";
|
|
10
|
-
import type { Curie } from "./Curie.js";
|
|
11
10
|
import type { IdentifierType } from "./IdentifierType.js";
|
|
12
11
|
import type { IriType } from "./IriType.js";
|
|
13
12
|
import { Type } from "./Type.js";
|
|
@@ -19,12 +18,6 @@ export declare class ObjectType extends AbstractType {
|
|
|
19
18
|
* Defaults to false.
|
|
20
19
|
*/
|
|
21
20
|
readonly abstract: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Should generated code derived from this ObjectType be visible outside its module?
|
|
24
|
-
*
|
|
25
|
-
* Defaults to true.
|
|
26
|
-
*/
|
|
27
|
-
readonly export: boolean;
|
|
28
21
|
/**
|
|
29
22
|
* If true, the code for this ObjectType is defined externally and should not be generated.
|
|
30
23
|
*
|
|
@@ -50,14 +43,6 @@ export declare class ObjectType extends AbstractType {
|
|
|
50
43
|
* Type discriminant.
|
|
51
44
|
*/
|
|
52
45
|
readonly kind = "ObjectType";
|
|
53
|
-
/**
|
|
54
|
-
* Name of this type, from shaclmate:name.
|
|
55
|
-
*/
|
|
56
|
-
readonly name: Maybe<string>;
|
|
57
|
-
/**
|
|
58
|
-
* Identifier of the shape this ObjectType was derived from.
|
|
59
|
-
*/
|
|
60
|
-
readonly shapeIdentifier: BlankNode | NamedNode;
|
|
61
46
|
/**
|
|
62
47
|
* Was this type synthesized or did it come from SHACL?
|
|
63
48
|
*/
|
|
@@ -86,31 +71,29 @@ export declare class ObjectType extends AbstractType {
|
|
|
86
71
|
* Whether to generate a TypeScript class or interface for this type.
|
|
87
72
|
*/
|
|
88
73
|
readonly tsObjectDeclarationType: TsObjectDeclarationType;
|
|
89
|
-
constructor({ abstract,
|
|
74
|
+
constructor({ abstract, extern, fromRdfType, identifierMintingStrategy, identifierType, synthetic, toRdfTypes, tsFeatures, tsImports, tsObjectDeclarationType, ...superParameters }: {
|
|
90
75
|
abstract: boolean;
|
|
91
|
-
export_: boolean;
|
|
92
76
|
extern: boolean;
|
|
93
77
|
fromRdfType: Maybe<NamedNode>;
|
|
94
78
|
identifierMintingStrategy: Maybe<IdentifierMintingStrategy>;
|
|
95
79
|
identifierType: BlankNodeType | IdentifierType | IriType;
|
|
96
|
-
name: Maybe<string>;
|
|
97
|
-
shapeIdentifier: BlankNode | Curie | NamedNode;
|
|
98
80
|
synthetic: boolean;
|
|
99
81
|
toRdfTypes: readonly NamedNode[];
|
|
100
82
|
tsFeatures: ReadonlySet<TsFeature>;
|
|
101
83
|
tsImports: readonly string[];
|
|
102
84
|
tsObjectDeclarationType: TsObjectDeclarationType;
|
|
103
85
|
} & ConstructorParameters<typeof AbstractType>[0]);
|
|
104
|
-
addAncestorObjectTypes(...ancestorObjectTypes: readonly ObjectType[]): void;
|
|
105
|
-
addChildObjectTypes(...childObjectTypes: readonly ObjectType[]): void;
|
|
106
|
-
addDescendantObjectTypes(...descendantObjectTypes: readonly ObjectType[]): void;
|
|
107
|
-
addParentObjectTypes(...parentObjectTypes: readonly ObjectType[]): void;
|
|
108
|
-
addProperties(...properties: readonly ObjectType.Property[]): void;
|
|
109
86
|
get ancestorObjectTypes(): readonly ObjectType[];
|
|
110
87
|
get childObjectTypes(): readonly ObjectType[];
|
|
111
88
|
get descendantObjectTypes(): readonly ObjectType[];
|
|
112
89
|
get parentObjectTypes(): readonly ObjectType[];
|
|
113
90
|
get properties(): readonly ObjectType.Property[];
|
|
91
|
+
get recursive(): boolean;
|
|
92
|
+
addAncestorObjectTypes(...ancestorObjectTypes: readonly ObjectType[]): void;
|
|
93
|
+
addChildObjectTypes(...childObjectTypes: readonly ObjectType[]): void;
|
|
94
|
+
addDescendantObjectTypes(...descendantObjectTypes: readonly ObjectType[]): void;
|
|
95
|
+
addParentObjectTypes(...parentObjectTypes: readonly ObjectType[]): void;
|
|
96
|
+
addProperties(...properties: readonly ObjectType.Property[]): void;
|
|
114
97
|
equals(other: ObjectType): boolean;
|
|
115
98
|
sortProperties(): void;
|
|
116
99
|
toString(): string;
|
|
@@ -135,13 +118,13 @@ export declare namespace ObjectType {
|
|
|
135
118
|
*/
|
|
136
119
|
readonly mutable: boolean;
|
|
137
120
|
/**
|
|
138
|
-
*
|
|
121
|
+
* Name of this property, derived from sh:name or shaclmate:name.
|
|
139
122
|
*/
|
|
140
|
-
readonly
|
|
123
|
+
readonly name: string;
|
|
141
124
|
/**
|
|
142
|
-
*
|
|
125
|
+
* Object type this property belongs to.
|
|
143
126
|
*/
|
|
144
|
-
readonly
|
|
127
|
+
readonly objectType: ObjectType;
|
|
145
128
|
/**
|
|
146
129
|
* Relative order of this property, derived from sh:order.
|
|
147
130
|
*/
|
|
@@ -149,7 +132,7 @@ export declare namespace ObjectType {
|
|
|
149
132
|
/**
|
|
150
133
|
* SHACL property path (https://www.w3.org/TR/shacl/#property-paths)
|
|
151
134
|
*/
|
|
152
|
-
readonly path:
|
|
135
|
+
readonly path: PropertyPath;
|
|
153
136
|
/**
|
|
154
137
|
* Identifier of the property shape.
|
|
155
138
|
*/
|
|
@@ -167,10 +150,10 @@ export declare namespace ObjectType {
|
|
|
167
150
|
description: Maybe<string>;
|
|
168
151
|
label: Maybe<string>;
|
|
169
152
|
mutable: boolean;
|
|
170
|
-
name:
|
|
153
|
+
name: string;
|
|
171
154
|
objectType: ObjectType;
|
|
172
155
|
order: number;
|
|
173
|
-
path:
|
|
156
|
+
path: PropertyPath;
|
|
174
157
|
shapeIdentifier: BlankNode | NamedNode;
|
|
175
158
|
type: Type;
|
|
176
159
|
visibility: PropertyVisibility;
|