@shaclmate/compiler 4.0.41 → 4.0.42
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/ShapesGraphToAstTransformer.d.ts +1 -0
- package/dist/ShapesGraphToAstTransformer.js +10 -45
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.d.ts +17 -0
- package/dist/_ShapesGraphToAstTransformer/{transformPropertyShapeToAstObjectTypeProperty.js → transformPropertyShapeToAstStructTypeField.js} +71 -48
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +29 -20
- package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.d.ts → transformShapeToAstStructType.d.ts} +2 -2
- package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.js → transformShapeToAstStructType.js} +35 -29
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +2 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +3 -3
- package/dist/ast/AbstractCompoundType.d.ts +2 -2
- package/dist/ast/AbstractCompoundType.js +4 -4
- package/dist/ast/AbstractContainerType.d.ts +2 -2
- package/dist/ast/AbstractContainerType.js +4 -4
- package/dist/ast/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +10 -10
- package/dist/ast/{AbstractLazyObjectType.js → AbstractLazyType.js} +3 -3
- package/dist/ast/AbstractType.d.ts +1 -1
- package/dist/ast/AbstractType.js +3 -0
- package/dist/ast/Ast.d.ts +2 -4
- package/dist/ast/DefaultValueType.js +2 -1
- package/dist/ast/IntersectionType.d.ts +2 -2
- package/dist/ast/IntersectionType.js +3 -3
- 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 +2 -2
- package/dist/ast/ListType.js +4 -4
- package/dist/ast/OptionType.js +2 -1
- package/dist/ast/SetType.js +2 -1
- package/dist/ast/StructCompoundType.d.ts +12 -0
- package/dist/ast/{ObjectCompoundType.js → StructCompoundType.js} +18 -18
- package/dist/ast/StructIntersectionType.d.ts +4 -0
- package/dist/ast/StructIntersectionType.js +2 -0
- package/dist/ast/{ObjectType.d.ts → StructType.d.ts} +28 -27
- package/dist/ast/{ObjectType.js → StructType.js} +81 -78
- package/dist/ast/StructUnionType.d.ts +4 -0
- package/dist/ast/StructUnionType.js +2 -0
- package/dist/ast/Type.d.ts +5 -5
- package/dist/ast/Type.js +4 -4
- package/dist/ast/UnionType.d.ts +2 -2
- package/dist/ast/UnionType.js +3 -3
- package/dist/ast/index.d.ts +7 -7
- package/dist/ast/index.js +7 -7
- package/dist/generators/AstJsonGenerator.js +2 -2
- package/dist/generators/transformAstToLabeledPropertyGraph.js +8 -8
- package/dist/generators/ts/AbstractContainerType.d.ts +1 -1
- package/dist/generators/ts/AbstractContainerType.js +6 -6
- package/dist/generators/ts/AbstractDateType.d.ts +1 -7
- package/dist/generators/ts/AbstractDateType.js +1 -11
- package/dist/generators/ts/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +7 -7
- package/dist/generators/ts/{AbstractLazyObjectType.js → AbstractLazyType.js} +19 -17
- package/dist/generators/ts/AbstractLiteralType.d.ts +2 -5
- package/dist/generators/ts/AbstractLiteralType.js +0 -21
- package/dist/generators/ts/AbstractNumericType.d.ts +1 -7
- package/dist/generators/ts/AbstractNumericType.js +15 -25
- package/dist/generators/ts/AbstractObjectSetType.d.ts +1 -1
- package/dist/generators/ts/AbstractObjectSetType.js +2 -2
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +1 -1
- package/dist/generators/ts/AbstractPrimitiveType.js +1 -1
- package/dist/generators/ts/AbstractTermType.d.ts +6 -21
- package/dist/generators/ts/AbstractTermType.js +26 -55
- package/dist/generators/ts/AbstractType.d.ts +40 -47
- package/dist/generators/ts/AbstractType.js +17 -6
- package/dist/generators/ts/BigDecimalType.d.ts +3 -3
- package/dist/generators/ts/BigDecimalType.js +3 -8
- package/dist/generators/ts/BigIntType.d.ts +2 -2
- package/dist/generators/ts/BigIntType.js +7 -4
- package/dist/generators/ts/BlankNodeType.d.ts +2 -7
- package/dist/generators/ts/BlankNodeType.js +2 -7
- package/dist/generators/ts/BooleanType.d.ts +3 -3
- package/dist/generators/ts/BooleanType.js +12 -14
- package/dist/generators/ts/DateTimeType.d.ts +2 -2
- package/dist/generators/ts/DateTimeType.js +14 -4
- package/dist/generators/ts/DateType.d.ts +2 -2
- package/dist/generators/ts/DateType.js +14 -4
- package/dist/generators/ts/DefaultValueType.d.ts +8 -8
- package/dist/generators/ts/DefaultValueType.js +10 -12
- package/dist/generators/ts/FloatType.d.ts +2 -2
- package/dist/generators/ts/FloatType.js +7 -4
- package/dist/generators/ts/IdentifierType.d.ts +2 -2
- package/dist/generators/ts/IdentifierType.js +2 -7
- package/dist/generators/ts/IntType.d.ts +2 -2
- package/dist/generators/ts/IntType.js +7 -4
- package/dist/generators/ts/IriType.d.ts +2 -2
- package/dist/generators/ts/IriType.js +12 -14
- package/dist/generators/ts/{LazyObjectOptionType.d.ts → LazyOptionType.d.ts} +12 -11
- package/dist/generators/ts/{LazyObjectOptionType.js → LazyOptionType.js} +23 -14
- package/dist/generators/ts/LazySetType.d.ts +20 -0
- package/dist/generators/ts/{LazyObjectSetType.js → LazySetType.js} +22 -13
- package/dist/generators/ts/LazyType.d.ts +19 -0
- package/dist/generators/ts/{LazyObjectType.js → LazyType.js} +22 -13
- package/dist/generators/ts/ListType.d.ts +1 -1
- package/dist/generators/ts/ListType.js +9 -19
- package/dist/generators/ts/LiteralType.d.ts +3 -2
- package/dist/generators/ts/LiteralType.js +6 -2
- package/dist/generators/ts/ObjectType.d.ts +16 -3
- package/dist/generators/ts/ObjectType.js +301 -91
- package/dist/generators/ts/ObjectUnionType.js +40 -40
- package/dist/generators/ts/OptionType.d.ts +2 -2
- package/dist/generators/ts/OptionType.js +7 -5
- package/dist/generators/ts/SetType.d.ts +3 -3
- package/dist/generators/ts/SetType.js +8 -10
- package/dist/generators/ts/Snippets.d.ts +26 -8
- package/dist/generators/ts/Snippets.js +161 -35
- package/dist/generators/ts/StringType.d.ts +4 -3
- package/dist/generators/ts/StringType.js +18 -11
- package/dist/generators/ts/TermType.d.ts +7 -5
- package/dist/generators/ts/TermType.js +28 -9
- package/dist/generators/ts/TsGenerator.js +11 -6
- package/dist/generators/ts/Type.d.ts +4 -4
- package/dist/generators/ts/TypeFactory.d.ts +5 -5
- package/dist/generators/ts/TypeFactory.js +79 -58
- package/dist/generators/ts/UnionType.d.ts +23 -18
- package/dist/generators/ts/UnionType.js +227 -221
- package/dist/generators/ts/ZodGenerator.js +15 -7
- package/dist/generators/ts/_ObjectType/AbstractProperty.d.ts +24 -15
- package/dist/generators/ts/_ObjectType/AbstractProperty.js +1 -24
- package/dist/generators/ts/_ObjectType/DiscriminantProperty.d.ts +8 -6
- package/dist/generators/ts/_ObjectType/DiscriminantProperty.js +11 -24
- package/dist/generators/ts/_ObjectType/IdentifierProperty.d.ts +8 -2
- package/dist/generators/ts/_ObjectType/IdentifierProperty.js +44 -16
- 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_equalsFunctionDeclaration.js → ObjectType_equalsFunctionExpression.js} +6 -10
- 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_filterTypeDeclaration.js → ObjectType_filterTypeExpression.js} +6 -8
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_focusSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → ObjectType_focusSparqlConstructTriplesFunctionExpression.js} +5 -9
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_focusSparqlWherePatternsFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.js → ObjectType_focusSparqlWherePatternsFunctionExpression.js} +5 -9
- 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_fromRdfResourceFunctionDeclaration.js → ObjectType_fromRdfResourceFunctionExpression.js} +8 -16
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_graphqlTypeVariableStatement.js → ObjectType_graphqlTypeExpression.js} +6 -13
- 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/{identifierTypeDeclarations.js → ObjectType_identifierTypeDeclarations.js} +2 -5
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +3 -3
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +1 -2
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.js +2 -6
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_jsonSchemaFunctionDeclaration.js → ObjectType_jsonSchemaExpression.js} +3 -10
- 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 +1 -1
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.js +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +18 -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 +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +5 -9
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +4 -8
- 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_toRdfResourceFunctionDeclaration.js → ObjectType_toRdfResourceFunctionExpression.js} +6 -12
- 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_valueSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_valueSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionExpression.js +8 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_valueSparqlWherePatternsFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionExpression.js +10 -0
- package/dist/generators/ts/_ObjectType/ShaclProperty.d.ts +9 -2
- package/dist/generators/ts/_ObjectType/ShaclProperty.js +65 -33
- package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +4 -3
- package/dist/generators/ts/_snippets/snippets_DateSchema.js +4 -3
- package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +3 -3
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.js +6 -5
- package/dist/generators/ts/_snippets/snippets_IdentifierSchema.js +2 -1
- package/dist/generators/ts/_snippets/snippets_IriSchema.js +1 -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.js +1 -3
- package/dist/generators/ts/_snippets/snippets_LiteralSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_NumericSchema.js +2 -1
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +6 -8
- package/dist/generators/ts/_snippets/snippets_RdfVocabularies.js +32 -32
- package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +1 -1
- package/dist/generators/ts/_snippets/snippets_StringSchema.js +5 -3
- package/dist/generators/ts/_snippets/snippets_TermFilter.js +3 -3
- package/dist/generators/ts/_snippets/snippets_TermSchema.js +4 -2
- 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_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_booleanFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.js +6 -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_dateFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.js +6 -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_defaultValueFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.js +10 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterNumeric.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterTerm.js +1 -2
- 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_identifierFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.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_listFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.js +15 -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_maybeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.js +11 -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_numericSparqlWherePatterns.js +1 -1
- 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_shaclPropertyFromRdf.js +13 -7
- 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_termFilterSparqlPatterns.js +1 -1
- 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_termSparqlWherePatterns.js +2 -2
- package/dist/input/generated.d.ts +464 -389
- package/dist/input/generated.js +1748 -2294
- package/package.json +2 -2
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.d.ts +0 -9
- package/dist/ast/LazyObjectOptionType.d.ts +0 -6
- package/dist/ast/LazyObjectOptionType.js +0 -5
- package/dist/ast/LazyObjectSetType.d.ts +0 -6
- package/dist/ast/LazyObjectSetType.js +0 -5
- package/dist/ast/LazyObjectType.d.ts +0 -5
- package/dist/ast/LazyObjectType.js +0 -5
- package/dist/ast/ObjectCompoundType.d.ts +0 -12
- package/dist/ast/ObjectIntersectionType.d.ts +0 -4
- package/dist/ast/ObjectIntersectionType.js +0 -2
- package/dist/ast/ObjectUnionType.d.ts +0 -4
- package/dist/ast/ObjectUnionType.js +0 -2
- package/dist/generators/ts/LazyObjectSetType.d.ts +0 -20
- package/dist/generators/ts/LazyObjectType.d.ts +0 -19
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.js +0 -44
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.js +0 -21
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +0 -18
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.js +0 -10
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.js +0 -41
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.js +0 -12
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.js +0 -9
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +0 -12
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.js +0 -20
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.js +0 -29
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +0 -11
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js +0 -13
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +0 -4
- package/dist/generators/ts/_snippets/snippets_LazyObject.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_LazyObject.js +0 -22
- package/dist/generators/ts/_snippets/snippets_LazyObjectOption.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_LazyObjectOption.js +0 -25
- package/dist/generators/ts/_snippets/snippets_LazyObjectSet.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_LazyObjectSet.js +0 -40
- package/dist/generators/ts/_snippets/snippets_convertToLazyObject.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToLazyObject.js +0 -15
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.js +0 -31
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.js +0 -25
- package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.js +0 -15
- package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.js +0 -23
|
@@ -63,14 +63,14 @@ __decorate([
|
|
|
63
63
|
case "Iri":
|
|
64
64
|
case "List":
|
|
65
65
|
case "Literal":
|
|
66
|
-
case "
|
|
66
|
+
case "Struct":
|
|
67
67
|
case "Term":
|
|
68
68
|
case "Union":
|
|
69
69
|
return true;
|
|
70
70
|
case "DefaultValue":
|
|
71
|
-
case "
|
|
72
|
-
case "
|
|
73
|
-
case "
|
|
71
|
+
case "LazyOption":
|
|
72
|
+
case "LazySet":
|
|
73
|
+
case "Lazy":
|
|
74
74
|
case "Option":
|
|
75
75
|
case "Set":
|
|
76
76
|
return false;
|
|
@@ -6,7 +6,7 @@ import type { IntersectionType } from "./IntersectionType.js";
|
|
|
6
6
|
import type { IriType } from "./IriType.js";
|
|
7
7
|
import type { ListType } from "./ListType.js";
|
|
8
8
|
import type { LiteralType } from "./LiteralType.js";
|
|
9
|
-
import type {
|
|
9
|
+
import type { StructType } from "./StructType.js";
|
|
10
10
|
import type { TermType } from "./TermType.js";
|
|
11
11
|
import { Type } from "./Type.js";
|
|
12
12
|
import type { UnionType } from "./UnionType.js";
|
|
@@ -38,7 +38,7 @@ export declare abstract class AbstractContainerType<ItemTypeT extends AbstractCo
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
export declare namespace AbstractContainerType {
|
|
41
|
-
type ItemType = BlankNodeType | IdentifierType | IntersectionType | IriType | ListType | LiteralType |
|
|
41
|
+
type ItemType = BlankNodeType | IdentifierType | IntersectionType | IriType | ListType | LiteralType | StructType | TermType | UnionType;
|
|
42
42
|
function isItemType(type: Type): type is ItemType;
|
|
43
43
|
}
|
|
44
44
|
//# sourceMappingURL=AbstractContainerType.d.ts.map
|
|
@@ -45,14 +45,14 @@ export class AbstractContainerType extends AbstractType {
|
|
|
45
45
|
case "Iri":
|
|
46
46
|
case "List":
|
|
47
47
|
case "Literal":
|
|
48
|
-
case "
|
|
48
|
+
case "Struct":
|
|
49
49
|
case "Term":
|
|
50
50
|
case "Union":
|
|
51
51
|
return true;
|
|
52
52
|
case "DefaultValue":
|
|
53
|
-
case "
|
|
54
|
-
case "
|
|
55
|
-
case "
|
|
53
|
+
case "LazyOption":
|
|
54
|
+
case "LazySet":
|
|
55
|
+
case "Lazy":
|
|
56
56
|
case "Option":
|
|
57
57
|
case "Set":
|
|
58
58
|
return false;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { NodeKind } from "@shaclmate/shacl-ast";
|
|
2
2
|
import { AbstractType } from "./AbstractType.js";
|
|
3
|
-
import type { ObjectType } from "./ObjectType.js";
|
|
4
|
-
import type { ObjectUnionType } from "./ObjectUnionType.js";
|
|
5
3
|
import type { OptionType } from "./OptionType.js";
|
|
6
4
|
import type { SetType } from "./SetType.js";
|
|
5
|
+
import type { StructType } from "./StructType.js";
|
|
6
|
+
import type { StructUnionType } from "./StructUnionType.js";
|
|
7
7
|
/**
|
|
8
|
-
* Abstract base class of
|
|
8
|
+
* Abstract base class of LazyOptionType, LazySetType, and LazyType.
|
|
9
9
|
*/
|
|
10
|
-
export declare abstract class
|
|
11
|
-
abstract readonly kind: "
|
|
10
|
+
export declare abstract class AbstractLazyType<PartialTypeT extends AbstractLazyType.PartialTypeConstraint, ResolveTypeT extends AbstractLazyType.ResolveTypeConstraint> extends AbstractType {
|
|
11
|
+
abstract readonly kind: "Lazy" | "LazyOption" | "LazySet";
|
|
12
12
|
readonly partialType: PartialTypeT;
|
|
13
13
|
readonly resolveType: ResolveTypeT;
|
|
14
14
|
constructor({ partialType, resolveType, ...superParameters }: {
|
|
@@ -17,7 +17,7 @@ export declare abstract class AbstractLazyObjectType<PartialTypeT extends Abstra
|
|
|
17
17
|
} & ConstructorParameters<typeof AbstractType>[0]);
|
|
18
18
|
get nodeKinds(): ReadonlySet<NodeKind>;
|
|
19
19
|
get recursive(): boolean;
|
|
20
|
-
equals(other:
|
|
20
|
+
equals(other: AbstractLazyType<PartialTypeT, ResolveTypeT>): boolean;
|
|
21
21
|
toJSON(): {
|
|
22
22
|
partialType: {
|
|
23
23
|
fromRdfType: import("@rdfjs/types").NamedNode<string> | undefined;
|
|
@@ -109,9 +109,9 @@ export declare abstract class AbstractLazyObjectType<PartialTypeT extends Abstra
|
|
|
109
109
|
shapeIdentifier: import("@rdfjs/types").BlankNode | import("@rdfjs/types").NamedNode<string>;
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
export declare namespace
|
|
113
|
-
type
|
|
114
|
-
type PartialTypeConstraint =
|
|
112
|
+
export declare namespace AbstractLazyType {
|
|
113
|
+
type ItemTypeConstraint = StructType | StructUnionType;
|
|
114
|
+
type PartialTypeConstraint = ItemTypeConstraint | OptionType<ItemTypeConstraint> | SetType<ItemTypeConstraint>;
|
|
115
115
|
type ResolveTypeConstraint = PartialTypeConstraint;
|
|
116
116
|
}
|
|
117
|
-
//# sourceMappingURL=
|
|
117
|
+
//# sourceMappingURL=AbstractLazyType.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AbstractType } from "./AbstractType.js";
|
|
2
2
|
import { Type } from "./Type.js";
|
|
3
3
|
/**
|
|
4
|
-
* Abstract base class of
|
|
4
|
+
* Abstract base class of LazyOptionType, LazySetType, and LazyType.
|
|
5
5
|
*/
|
|
6
|
-
export class
|
|
6
|
+
export class AbstractLazyType extends AbstractType {
|
|
7
7
|
partialType;
|
|
8
8
|
resolveType;
|
|
9
9
|
constructor({ partialType, resolveType, ...superParameters }) {
|
|
@@ -37,4 +37,4 @@ export class AbstractLazyObjectType extends AbstractType {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
//# sourceMappingURL=
|
|
40
|
+
//# sourceMappingURL=AbstractLazyType.js.map
|
|
@@ -24,7 +24,7 @@ export declare abstract class AbstractType {
|
|
|
24
24
|
/**
|
|
25
25
|
* The range of node kinds of this type.
|
|
26
26
|
*
|
|
27
|
-
* For example,
|
|
27
|
+
* For example, a struct type has blank and IRI node kinds, while a string type has a Literal node kind.
|
|
28
28
|
*/
|
|
29
29
|
abstract readonly nodeKinds: ReadonlySet<NodeKind>;
|
|
30
30
|
/**
|
package/dist/ast/AbstractType.js
CHANGED
package/dist/ast/Ast.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ObjectType } from "./ObjectType.js";
|
|
3
|
-
import type { UnionType } from "./UnionType.js";
|
|
1
|
+
import type { Type } from "./Type.js";
|
|
4
2
|
export interface Ast {
|
|
5
3
|
readonly lazyTypesCount: number;
|
|
6
|
-
readonly namedTypes: readonly
|
|
4
|
+
readonly namedTypes: readonly Type[];
|
|
7
5
|
}
|
|
8
6
|
//# sourceMappingURL=Ast.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
1
2
|
import { AbstractContainerType } from "./AbstractContainerType.js";
|
|
2
3
|
import { termEquals } from "./equals.js";
|
|
3
4
|
/**
|
|
@@ -16,7 +17,7 @@ export class DefaultValueType extends AbstractContainerType {
|
|
|
16
17
|
comment: itemType.comment,
|
|
17
18
|
itemType,
|
|
18
19
|
label: itemType.label,
|
|
19
|
-
name:
|
|
20
|
+
name: Maybe.empty(),
|
|
20
21
|
shapeIdentifier: itemType.shapeIdentifier,
|
|
21
22
|
});
|
|
22
23
|
this.defaultValue = defaultValue;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AbstractCompoundType } from "./AbstractCompoundType.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { StructIntersectionType } from "./StructIntersectionType.js";
|
|
3
3
|
/**
|
|
4
4
|
* A conjunction ("and") of types, corresponding to an sh:and.
|
|
5
5
|
*/
|
|
6
6
|
export declare class IntersectionType<MemberTypeT extends IntersectionType.MemberType = IntersectionType.MemberType> extends AbstractCompoundType<AbstractCompoundType.Member<MemberTypeT>, MemberTypeT> {
|
|
7
7
|
readonly kind = "Intersection";
|
|
8
|
-
|
|
8
|
+
isStructIntersectionType(): this is StructIntersectionType;
|
|
9
9
|
}
|
|
10
10
|
export declare namespace IntersectionType {
|
|
11
11
|
type MemberType = AbstractCompoundType.MemberType;
|
|
@@ -4,11 +4,11 @@ import { AbstractCompoundType } from "./AbstractCompoundType.js";
|
|
|
4
4
|
*/
|
|
5
5
|
export class IntersectionType extends AbstractCompoundType {
|
|
6
6
|
kind = "Intersection";
|
|
7
|
-
|
|
7
|
+
isStructIntersectionType() {
|
|
8
8
|
return (this.members.length > 0 &&
|
|
9
|
-
this.members.every((member) => member.type.kind === "
|
|
9
|
+
this.members.every((member) => member.type.kind === "Struct" ||
|
|
10
10
|
(member.type.kind === "Intersection" &&
|
|
11
|
-
member.type.
|
|
11
|
+
member.type.isStructIntersectionType())));
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
(function (IntersectionType) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AbstractLazyType } from "./AbstractLazyType.js";
|
|
2
|
+
import type { OptionType } from "./OptionType.js";
|
|
3
|
+
export declare class LazyOptionType extends AbstractLazyType<OptionType<AbstractLazyType.ItemTypeConstraint>, OptionType<AbstractLazyType.ItemTypeConstraint>> {
|
|
4
|
+
readonly kind = "LazyOption";
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=LazyOptionType.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AbstractLazyType } from "./AbstractLazyType.js";
|
|
2
|
+
import type { SetType } from "./SetType.js";
|
|
3
|
+
export declare class LazySetType extends AbstractLazyType<SetType<AbstractLazyType.ItemTypeConstraint>, SetType<AbstractLazyType.ItemTypeConstraint>> {
|
|
4
|
+
readonly kind = "LazySet";
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=LazySetType.d.ts.map
|
package/dist/ast/ListType.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { IdentifierType } from "./IdentifierType.js";
|
|
|
6
6
|
import type { IntersectionType } from "./IntersectionType.js";
|
|
7
7
|
import type { IriType } from "./IriType.js";
|
|
8
8
|
import type { LiteralType } from "./LiteralType.js";
|
|
9
|
-
import type {
|
|
9
|
+
import type { StructType } from "./StructType.js";
|
|
10
10
|
import type { TermType } from "./TermType.js";
|
|
11
11
|
import type { Type } from "./Type.js";
|
|
12
12
|
import type { UnionType } from "./UnionType.js";
|
|
@@ -38,7 +38,7 @@ export declare class ListType<ItemTypeT extends ListType.ItemType = ListType.Ite
|
|
|
38
38
|
equals(other: ListType<ItemTypeT>): boolean;
|
|
39
39
|
}
|
|
40
40
|
export declare namespace ListType {
|
|
41
|
-
type ItemType = BlankNodeType | IdentifierType | IntersectionType | IriType | ListType | LiteralType |
|
|
41
|
+
type ItemType = BlankNodeType | IdentifierType | IntersectionType | IriType | ListType | LiteralType | StructType | TermType | UnionType;
|
|
42
42
|
function isItemType(type: Type): type is ItemType;
|
|
43
43
|
}
|
|
44
44
|
//# sourceMappingURL=ListType.d.ts.map
|
package/dist/ast/ListType.js
CHANGED
|
@@ -38,14 +38,14 @@ export class ListType extends AbstractCollectionType {
|
|
|
38
38
|
case "Iri":
|
|
39
39
|
case "List":
|
|
40
40
|
case "Literal":
|
|
41
|
-
case "
|
|
41
|
+
case "Struct":
|
|
42
42
|
case "Term":
|
|
43
43
|
case "Union":
|
|
44
44
|
return true;
|
|
45
45
|
case "DefaultValue":
|
|
46
|
-
case "
|
|
47
|
-
case "
|
|
48
|
-
case "
|
|
46
|
+
case "LazyOption":
|
|
47
|
+
case "LazySet":
|
|
48
|
+
case "Lazy":
|
|
49
49
|
case "Option":
|
|
50
50
|
case "Set":
|
|
51
51
|
return false;
|
package/dist/ast/OptionType.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
1
2
|
import { AbstractContainerType } from "./AbstractContainerType.js";
|
|
2
3
|
/**
|
|
3
4
|
* A type with zero or one values of an item type.
|
|
@@ -9,7 +10,7 @@ export class OptionType extends AbstractContainerType {
|
|
|
9
10
|
comment: itemType.comment,
|
|
10
11
|
itemType,
|
|
11
12
|
label: itemType.label,
|
|
12
|
-
name:
|
|
13
|
+
name: Maybe.empty(),
|
|
13
14
|
shapeIdentifier: itemType.shapeIdentifier,
|
|
14
15
|
});
|
|
15
16
|
}
|
package/dist/ast/SetType.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
1
2
|
import { AbstractCollectionType } from "./AbstractCollectionType.js";
|
|
2
3
|
/**
|
|
3
4
|
* An unordered set of items of a specific type.
|
|
@@ -14,7 +15,7 @@ export class SetType extends AbstractCollectionType {
|
|
|
14
15
|
comment: itemType.comment,
|
|
15
16
|
itemType,
|
|
16
17
|
label: itemType.label,
|
|
17
|
-
name:
|
|
18
|
+
name: Maybe.empty(),
|
|
18
19
|
shapeIdentifier: itemType.shapeIdentifier,
|
|
19
20
|
});
|
|
20
21
|
this.minCount = minCount;
|
|
@@ -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 { StructIntersectionType } from "./StructIntersectionType.js";
|
|
5
|
+
import type { StructType } from "./StructType.js";
|
|
6
|
+
import type { StructUnionType } from "./StructUnionType.js";
|
|
7
|
+
export type StructCompoundType = StructIntersectionType | StructUnionType;
|
|
8
|
+
export declare namespace StructCompoundType {
|
|
9
|
+
function identifierType(objectCompoundType: StructCompoundType): BlankNodeType | IdentifierType | IriType;
|
|
10
|
+
function memberStructTypes(objectCompoundType: StructCompoundType): readonly StructType[];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=StructCompoundType.d.ts.map
|
|
@@ -4,12 +4,12 @@ import { invariant } from "ts-invariant";
|
|
|
4
4
|
import { BlankNodeType } from "./BlankNodeType.js";
|
|
5
5
|
import { IdentifierType } from "./IdentifierType.js";
|
|
6
6
|
import { IriType } from "./IriType.js";
|
|
7
|
-
export var
|
|
8
|
-
(function (
|
|
7
|
+
export var StructCompoundType;
|
|
8
|
+
(function (StructCompoundType) {
|
|
9
9
|
function identifierType(objectCompoundType) {
|
|
10
10
|
const memberIdentifierTypeNodeKinds = new Set();
|
|
11
11
|
const memberIdentifierTypesIn = new TermSet();
|
|
12
|
-
for (const memberType of
|
|
12
|
+
for (const memberType of memberStructTypes(objectCompoundType)) {
|
|
13
13
|
for (const nodeKind of memberType.identifierType.nodeKinds) {
|
|
14
14
|
memberIdentifierTypeNodeKinds.add(nodeKind);
|
|
15
15
|
}
|
|
@@ -49,39 +49,39 @@ export var ObjectCompoundType;
|
|
|
49
49
|
throw new Error("should never reach here");
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
function
|
|
54
|
-
const
|
|
52
|
+
StructCompoundType.identifierType = identifierType;
|
|
53
|
+
function memberStructTypes(objectCompoundType) {
|
|
54
|
+
const memberStructTypes_ = [];
|
|
55
55
|
for (const member of objectCompoundType.members) {
|
|
56
56
|
switch (member.type.kind) {
|
|
57
|
-
case "
|
|
58
|
-
|
|
57
|
+
case "Struct":
|
|
58
|
+
memberStructTypes_.push(member.type);
|
|
59
59
|
break;
|
|
60
60
|
case "Intersection":
|
|
61
61
|
case "Union": {
|
|
62
62
|
invariant(member.type.kind === objectCompoundType.kind);
|
|
63
|
-
|
|
63
|
+
memberStructTypes_.push(...memberStructTypes(member.type));
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
invariant(
|
|
68
|
+
invariant(memberStructTypes_.length >= objectCompoundType.members.length, "object compound type has no member StructType's");
|
|
69
69
|
// Member object types must have distinct RDF types or no RDF types at all.
|
|
70
70
|
const fromRdfTypes = new TermSet();
|
|
71
71
|
let expectUniqueFromRdfTypesCount = 0;
|
|
72
|
-
for (const
|
|
73
|
-
if (
|
|
72
|
+
for (const memberStructType of memberStructTypes_) {
|
|
73
|
+
if (memberStructType.extern) {
|
|
74
74
|
continue;
|
|
75
75
|
}
|
|
76
76
|
expectUniqueFromRdfTypesCount++;
|
|
77
|
-
|
|
77
|
+
memberStructType.fromRdfType.ifJust((fromRdfType) => fromRdfTypes.add(fromRdfType));
|
|
78
78
|
}
|
|
79
79
|
if (fromRdfTypes.size > 0 &&
|
|
80
80
|
fromRdfTypes.size !== expectUniqueFromRdfTypesCount) {
|
|
81
|
-
throw new Error(`one or more ${objectCompoundType} members ([${
|
|
81
|
+
throw new Error(`one or more ${objectCompoundType} members ([${memberStructTypes_.map((memberType) => memberType.toString()).join(", ")}]) lack distinguishing fromRdfType's ({${[...fromRdfTypes].join(", ")}})`);
|
|
82
82
|
}
|
|
83
|
-
return
|
|
83
|
+
return memberStructTypes_;
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
})(
|
|
87
|
-
//# sourceMappingURL=
|
|
85
|
+
StructCompoundType.memberStructTypes = memberStructTypes;
|
|
86
|
+
})(StructCompoundType || (StructCompoundType = {}));
|
|
87
|
+
//# sourceMappingURL=StructCompoundType.js.map
|
|
@@ -7,16 +7,17 @@ import type { BlankNodeType } from "./BlankNodeType.js";
|
|
|
7
7
|
import type { IdentifierType } from "./IdentifierType.js";
|
|
8
8
|
import type { IriType } from "./IriType.js";
|
|
9
9
|
import { Type } from "./Type.js";
|
|
10
|
-
export declare class
|
|
10
|
+
export declare class StructType extends AbstractType {
|
|
11
11
|
#private;
|
|
12
|
+
private fieldNames;
|
|
12
13
|
/**
|
|
13
|
-
* If true, the code for this
|
|
14
|
+
* If true, the code for this StructType is defined externally and should not be generated.
|
|
14
15
|
*
|
|
15
16
|
* Defaults to false.
|
|
16
17
|
*/
|
|
17
18
|
readonly extern: boolean;
|
|
18
19
|
/**
|
|
19
|
-
* The expected rdf:type of instances of this
|
|
20
|
+
* The expected rdf:type of instances of this StructType.
|
|
20
21
|
*
|
|
21
22
|
* This is usually the identifier of an sh:NodeShape that is also an rdfs:Class (i.e., a node shape with implicit
|
|
22
23
|
* class targets).
|
|
@@ -29,7 +30,7 @@ export declare class ObjectType extends AbstractType {
|
|
|
29
30
|
/**
|
|
30
31
|
* Type discriminant.
|
|
31
32
|
*/
|
|
32
|
-
readonly kind = "
|
|
33
|
+
readonly kind = "Struct";
|
|
33
34
|
readonly nodeKinds: ReadonlySet<NodeKind>;
|
|
34
35
|
/**
|
|
35
36
|
* Was this type synthesized or did it come from SHACL?
|
|
@@ -45,7 +46,7 @@ export declare class ObjectType extends AbstractType {
|
|
|
45
46
|
/**
|
|
46
47
|
* TypeScript imports to add to generated code.
|
|
47
48
|
*
|
|
48
|
-
* This is often used in conjunction with extern=true to import the extern'd
|
|
49
|
+
* This is often used in conjunction with extern=true to import the extern'd StructType code in order for generated
|
|
49
50
|
* code to reference it.
|
|
50
51
|
*
|
|
51
52
|
* import { MyType } from "./MyType.js"
|
|
@@ -59,11 +60,11 @@ export declare class ObjectType extends AbstractType {
|
|
|
59
60
|
toRdfTypes: readonly NamedNode[];
|
|
60
61
|
tsImports: readonly string[];
|
|
61
62
|
} & ConstructorParameters<typeof AbstractType>[0]);
|
|
62
|
-
get
|
|
63
|
+
get fields(): readonly StructType.Field[];
|
|
63
64
|
get recursive(): boolean;
|
|
64
|
-
|
|
65
|
-
equals(other:
|
|
66
|
-
|
|
65
|
+
addFields(...fields: readonly StructType.Field[]): void;
|
|
66
|
+
equals(other: StructType): boolean;
|
|
67
|
+
sortFields(): void;
|
|
67
68
|
toJSON(): {
|
|
68
69
|
fromRdfType: NamedNode<string> | undefined;
|
|
69
70
|
identifierType: {
|
|
@@ -87,8 +88,8 @@ export declare class ObjectType extends AbstractType {
|
|
|
87
88
|
shapeIdentifier: BlankNode | NamedNode<string>;
|
|
88
89
|
};
|
|
89
90
|
}
|
|
90
|
-
export declare namespace
|
|
91
|
-
class
|
|
91
|
+
export declare namespace StructType {
|
|
92
|
+
class Field {
|
|
92
93
|
/**
|
|
93
94
|
* Documentation comment from rdfs:comment.
|
|
94
95
|
*/
|
|
@@ -98,7 +99,7 @@ export declare namespace ObjectType {
|
|
|
98
99
|
*/
|
|
99
100
|
readonly description: Maybe<string>;
|
|
100
101
|
/**
|
|
101
|
-
* Should the
|
|
102
|
+
* Should the field and its value be displayed in a toString()-type representation?
|
|
102
103
|
*/
|
|
103
104
|
readonly display: boolean;
|
|
104
105
|
/**
|
|
@@ -106,50 +107,50 @@ export declare namespace ObjectType {
|
|
|
106
107
|
*/
|
|
107
108
|
readonly label: Maybe<string>;
|
|
108
109
|
/**
|
|
109
|
-
* The
|
|
110
|
+
* The field should be mutable in generated code i.e., it should be re-assignable. The field value may or may
|
|
110
111
|
* not be mutable.
|
|
111
112
|
*/
|
|
112
113
|
readonly mutable: boolean;
|
|
113
114
|
/**
|
|
114
|
-
* Name of this
|
|
115
|
+
* Name of this field, derived from sh:name or shaclmate:name.
|
|
115
116
|
*/
|
|
116
117
|
readonly name: string;
|
|
117
118
|
/**
|
|
118
|
-
*
|
|
119
|
-
*/
|
|
120
|
-
readonly objectType: ObjectType;
|
|
121
|
-
/**
|
|
122
|
-
* Relative order of this property, derived from sh:order.
|
|
119
|
+
* Relative order of this field, derived from sh:order.
|
|
123
120
|
*/
|
|
124
121
|
readonly order: number;
|
|
125
122
|
/**
|
|
126
|
-
* SHACL property path (https://www.w3.org/TR/shacl/#
|
|
123
|
+
* SHACL property path (https://www.w3.org/TR/shacl/#field-paths)
|
|
127
124
|
*/
|
|
128
125
|
readonly path: PropertyPath;
|
|
129
126
|
/**
|
|
130
|
-
* Identifier of the
|
|
127
|
+
* Identifier of the field shape.
|
|
131
128
|
*/
|
|
132
129
|
readonly shapeIdentifier: BlankNode | NamedNode;
|
|
133
130
|
/**
|
|
134
|
-
*
|
|
131
|
+
* StructType this field belongs to.
|
|
132
|
+
*/
|
|
133
|
+
readonly structType: StructType;
|
|
134
|
+
/**
|
|
135
|
+
* Type of this field.
|
|
135
136
|
*/
|
|
136
137
|
readonly type: Type;
|
|
137
|
-
constructor({ comment, description, display, label, mutable, name,
|
|
138
|
+
constructor({ comment, description, display, label, mutable, name, order, path, shapeIdentifier, structType, type, }: {
|
|
138
139
|
comment: Maybe<string>;
|
|
139
140
|
description: Maybe<string>;
|
|
140
141
|
display: boolean;
|
|
141
142
|
label: Maybe<string>;
|
|
142
143
|
mutable: boolean;
|
|
143
144
|
name: string;
|
|
144
|
-
objectType: ObjectType;
|
|
145
145
|
order: number;
|
|
146
146
|
path: PropertyPath;
|
|
147
147
|
shapeIdentifier: BlankNode | NamedNode;
|
|
148
|
+
structType: StructType;
|
|
148
149
|
type: Type;
|
|
149
150
|
});
|
|
150
|
-
equals(other:
|
|
151
|
+
equals(other: Field): boolean;
|
|
151
152
|
/**
|
|
152
|
-
* Does the
|
|
153
|
+
* Does the field directly or indirectly reference the StructType itself?
|
|
153
154
|
*/
|
|
154
155
|
get recursive(): boolean;
|
|
155
156
|
toJSON(): {
|
|
@@ -174,4 +175,4 @@ export declare namespace ObjectType {
|
|
|
174
175
|
toString(): string;
|
|
175
176
|
}
|
|
176
177
|
}
|
|
177
|
-
//# sourceMappingURL=
|
|
178
|
+
//# sourceMappingURL=StructType.d.ts.map
|