@shaclmate/compiler 4.0.40 → 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 -8
- package/dist/ShapesGraphToAstTransformer.js +11 -126
- package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +128 -160
- 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} +3 -3
- package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.js → transformShapeToAstStructType.js} +35 -45
- 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 +3 -2
- package/dist/ast/AbstractCompoundType.js +5 -5
- 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 -12
- 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 -6
- 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 +5 -5
- 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 -39
- package/dist/ast/{ObjectType.js → StructType.js} +81 -156
- 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 +7 -3
- package/dist/generators/transformAstToLabeledPropertyGraph.js +59 -56
- package/dist/generators/ts/AbstractCollectionType.d.ts +4 -11
- package/dist/generators/ts/AbstractCollectionType.js +3 -62
- package/dist/generators/ts/AbstractContainerType.d.ts +1 -2
- package/dist/generators/ts/AbstractContainerType.js +7 -10
- package/dist/generators/ts/AbstractDateType.d.ts +5 -8
- package/dist/generators/ts/AbstractDateType.js +7 -12
- package/dist/generators/ts/AbstractIdentifierType.d.ts +4 -0
- package/dist/generators/ts/AbstractIdentifierType.js +3 -0
- package/dist/generators/ts/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +8 -8
- package/dist/generators/ts/{AbstractLazyObjectType.js → AbstractLazyType.js} +30 -17
- package/dist/generators/ts/AbstractLiteralType.d.ts +3 -5
- package/dist/generators/ts/AbstractLiteralType.js +0 -21
- package/dist/generators/ts/AbstractNumericType.d.ts +1 -7
- package/dist/generators/ts/AbstractNumericType.js +17 -27
- package/dist/generators/ts/AbstractObjectSetType.d.ts +1 -1
- package/dist/generators/ts/AbstractObjectSetType.js +2 -2
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +2 -1
- package/dist/generators/ts/AbstractPrimitiveType.js +1 -1
- package/dist/generators/ts/AbstractTermType.d.ts +7 -23
- package/dist/generators/ts/AbstractTermType.js +27 -58
- package/dist/generators/ts/AbstractType.d.ts +86 -63
- package/dist/generators/ts/AbstractType.js +48 -22
- package/dist/generators/ts/BigDecimalType.d.ts +7 -3
- package/dist/generators/ts/BigDecimalType.js +7 -9
- package/dist/generators/ts/BigIntType.d.ts +5 -3
- package/dist/generators/ts/BigIntType.js +8 -5
- package/dist/generators/ts/BlankNodeType.d.ts +2 -7
- package/dist/generators/ts/BlankNodeType.js +4 -9
- package/dist/generators/ts/BooleanType.d.ts +6 -4
- package/dist/generators/ts/BooleanType.js +13 -15
- 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 +40 -2
- package/dist/generators/ts/DefaultValueType.js +15 -14
- package/dist/generators/ts/FloatType.d.ts +5 -3
- package/dist/generators/ts/FloatType.js +8 -5
- package/dist/generators/ts/GraphqlSchema.js +2 -2
- package/dist/generators/ts/IdentifierType.d.ts +2 -2
- package/dist/generators/ts/IdentifierType.js +8 -11
- package/dist/generators/ts/IntType.d.ts +5 -3
- package/dist/generators/ts/IntType.js +8 -5
- package/dist/generators/ts/IriType.d.ts +2 -2
- package/dist/generators/ts/IriType.js +16 -16
- package/dist/generators/ts/{LazyObjectOptionType.d.ts → LazyOptionType.d.ts} +13 -11
- package/dist/generators/ts/LazyOptionType.js +75 -0
- package/dist/generators/ts/LazySetType.d.ts +20 -0
- package/dist/generators/ts/LazySetType.js +76 -0
- package/dist/generators/ts/LazyType.d.ts +19 -0
- package/dist/generators/ts/LazyType.js +65 -0
- package/dist/generators/ts/ListType.d.ts +11 -2
- package/dist/generators/ts/ListType.js +53 -26
- package/dist/generators/ts/LiteralType.d.ts +7 -2
- package/dist/generators/ts/LiteralType.js +12 -5
- package/dist/generators/ts/ObjectType.d.ts +24 -25
- package/dist/generators/ts/ObjectType.js +303 -161
- package/dist/generators/ts/ObjectUnionType.js +42 -42
- package/dist/generators/ts/OptionType.d.ts +6 -2
- package/dist/generators/ts/OptionType.js +16 -9
- package/dist/generators/ts/RdfjsDatasetObjectSetType.js +1 -4
- package/dist/generators/ts/SetType.d.ts +17 -2
- package/dist/generators/ts/SetType.js +85 -9
- package/dist/generators/ts/Snippets.d.ts +29 -9
- package/dist/generators/ts/Snippets.js +179 -39
- package/dist/generators/ts/StringType.d.ts +7 -4
- package/dist/generators/ts/StringType.js +23 -12
- package/dist/generators/ts/TermType.d.ts +9 -3
- package/dist/generators/ts/TermType.js +29 -7
- package/dist/generators/ts/TsGenerator.d.ts +1 -1
- package/dist/generators/ts/TsGenerator.js +62 -32
- package/dist/generators/ts/Type.d.ts +4 -4
- package/dist/generators/ts/TypeFactory.d.ts +5 -5
- package/dist/generators/ts/TypeFactory.js +90 -82
- package/dist/generators/ts/UnionType.d.ts +25 -23
- package/dist/generators/ts/UnionType.js +254 -261
- package/dist/generators/ts/ZodGenerator.d.ts +1 -1
- package/dist/generators/ts/ZodGenerator.js +29 -14
- package/dist/generators/ts/_ObjectType/AbstractProperty.d.ts +28 -16
- package/dist/generators/ts/_ObjectType/AbstractProperty.js +1 -24
- package/dist/generators/ts/_ObjectType/DiscriminantProperty.d.ts +15 -17
- package/dist/generators/ts/_ObjectType/DiscriminantProperty.js +24 -54
- package/dist/generators/ts/_ObjectType/IdentifierProperty.d.ts +8 -2
- package/dist/generators/ts/_ObjectType/IdentifierProperty.js +48 -20
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.js +28 -0
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionExpression.js +15 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_filterTypeDeclaration.js → ObjectType_filterTypeExpression.js} +5 -10
- 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 -13
- 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} +8 -31
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.js +43 -0
- 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/ObjectType_identifierTypeDeclarations.js +13 -0
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +11 -8
- 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_jsonSchemaExpression.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.js +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.js +17 -0
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.d.ts +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} +7 -13
- 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 +70 -38
- 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_convertToArraySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToArraySet.js +8 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazy.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazy.js +15 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyOption.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyOption.js +33 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazySet.js +27 -0
- package/dist/generators/ts/_snippets/snippets_convertToList.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToList.js +7 -0
- package/dist/generators/ts/_snippets/snippets_convertToScalarSet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToScalarSet.js +15 -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 +1116 -400
- package/dist/input/generated.js +1879 -1917
- package/package.json +2 -4
- 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/LazyObjectOptionType.js +0 -62
- package/dist/generators/ts/LazyObjectSetType.d.ts +0 -20
- package/dist/generators/ts/LazyObjectSetType.js +0 -61
- package/dist/generators/ts/LazyObjectType.d.ts +0 -19
- package/dist/generators/ts/LazyObjectType.js +0 -53
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.js +0 -65
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.js +0 -23
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.js +0 -24
- 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 -43
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js +0 -80
- 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 -45
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.js +0 -16
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js +0 -31
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.js +0 -16
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js +0 -17
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +0 -14
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.js +0 -41
- 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 -36
- 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/_ObjectType/identifierTypeDeclarations.js +0 -27
- 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_convertToArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToArray.js +0 -8
- 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
|
@@ -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;
|
|
@@ -32,7 +32,6 @@ export declare abstract class AbstractLazyObjectType<PartialTypeT extends Abstra
|
|
|
32
32
|
recursive: boolean | undefined;
|
|
33
33
|
shapeIdentifier: import("@rdfjs/types").BlankNode | import("@rdfjs/types").NamedNode<string>;
|
|
34
34
|
};
|
|
35
|
-
parentObjectTypes: (string | import("@rdfjs/types").BlankNode | import("@rdfjs/types").NamedNode<string>)[] | undefined;
|
|
36
35
|
synthetic: boolean | undefined;
|
|
37
36
|
toRdfTypes: readonly import("@rdfjs/types").NamedNode<string>[] | undefined;
|
|
38
37
|
comment: string | undefined;
|
|
@@ -74,7 +73,6 @@ export declare abstract class AbstractLazyObjectType<PartialTypeT extends Abstra
|
|
|
74
73
|
recursive: boolean | undefined;
|
|
75
74
|
shapeIdentifier: import("@rdfjs/types").BlankNode | import("@rdfjs/types").NamedNode<string>;
|
|
76
75
|
};
|
|
77
|
-
parentObjectTypes: (string | import("@rdfjs/types").BlankNode | import("@rdfjs/types").NamedNode<string>)[] | undefined;
|
|
78
76
|
synthetic: boolean | undefined;
|
|
79
77
|
toRdfTypes: readonly import("@rdfjs/types").NamedNode<string>[] | undefined;
|
|
80
78
|
comment: string | undefined;
|
|
@@ -111,9 +109,9 @@ export declare abstract class AbstractLazyObjectType<PartialTypeT extends Abstra
|
|
|
111
109
|
shapeIdentifier: import("@rdfjs/types").BlankNode | import("@rdfjs/types").NamedNode<string>;
|
|
112
110
|
};
|
|
113
111
|
}
|
|
114
|
-
export declare namespace
|
|
115
|
-
type
|
|
116
|
-
type PartialTypeConstraint =
|
|
112
|
+
export declare namespace AbstractLazyType {
|
|
113
|
+
type ItemTypeConstraint = StructType | StructUnionType;
|
|
114
|
+
type PartialTypeConstraint = ItemTypeConstraint | OptionType<ItemTypeConstraint> | SetType<ItemTypeConstraint>;
|
|
117
115
|
type ResolveTypeConstraint = PartialTypeConstraint;
|
|
118
116
|
}
|
|
119
|
-
//# 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,10 +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
|
|
7
|
-
readonly namedObjectTypes: readonly ObjectType[];
|
|
8
|
-
readonly namedUnionTypes: readonly UnionType[];
|
|
4
|
+
readonly namedTypes: readonly Type[];
|
|
9
5
|
}
|
|
10
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 | 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
|
@@ -36,16 +36,16 @@ export class ListType extends AbstractCollectionType {
|
|
|
36
36
|
case "Identifier":
|
|
37
37
|
case "Intersection":
|
|
38
38
|
case "Iri":
|
|
39
|
+
case "List":
|
|
39
40
|
case "Literal":
|
|
40
|
-
case "
|
|
41
|
+
case "Struct":
|
|
41
42
|
case "Term":
|
|
42
43
|
case "Union":
|
|
43
44
|
return true;
|
|
44
45
|
case "DefaultValue":
|
|
45
|
-
case "
|
|
46
|
-
case "
|
|
47
|
-
case "
|
|
48
|
-
case "List":
|
|
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,19 +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 childObjectTypes(): readonly ObjectType[];
|
|
64
|
-
get descendantObjectTypes(): readonly ObjectType[];
|
|
65
|
-
get parentObjectTypes(): readonly ObjectType[];
|
|
66
|
-
get properties(): readonly ObjectType.Property[];
|
|
63
|
+
get fields(): readonly StructType.Field[];
|
|
67
64
|
get recursive(): boolean;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
addParentObjectTypes(...parentObjectTypes: readonly ObjectType[]): void;
|
|
72
|
-
addProperties(...properties: readonly ObjectType.Property[]): void;
|
|
73
|
-
equals(other: ObjectType): boolean;
|
|
74
|
-
sortProperties(): void;
|
|
65
|
+
addFields(...fields: readonly StructType.Field[]): void;
|
|
66
|
+
equals(other: StructType): boolean;
|
|
67
|
+
sortFields(): void;
|
|
75
68
|
toJSON(): {
|
|
76
69
|
fromRdfType: NamedNode<string> | undefined;
|
|
77
70
|
identifierType: {
|
|
@@ -85,7 +78,6 @@ export declare class ObjectType extends AbstractType {
|
|
|
85
78
|
recursive: boolean | undefined;
|
|
86
79
|
shapeIdentifier: BlankNode | NamedNode<string>;
|
|
87
80
|
};
|
|
88
|
-
parentObjectTypes: (string | BlankNode | NamedNode<string>)[] | undefined;
|
|
89
81
|
synthetic: boolean | undefined;
|
|
90
82
|
toRdfTypes: readonly NamedNode<string>[] | undefined;
|
|
91
83
|
comment: string | undefined;
|
|
@@ -96,8 +88,8 @@ export declare class ObjectType extends AbstractType {
|
|
|
96
88
|
shapeIdentifier: BlankNode | NamedNode<string>;
|
|
97
89
|
};
|
|
98
90
|
}
|
|
99
|
-
export declare namespace
|
|
100
|
-
class
|
|
91
|
+
export declare namespace StructType {
|
|
92
|
+
class Field {
|
|
101
93
|
/**
|
|
102
94
|
* Documentation comment from rdfs:comment.
|
|
103
95
|
*/
|
|
@@ -107,7 +99,7 @@ export declare namespace ObjectType {
|
|
|
107
99
|
*/
|
|
108
100
|
readonly description: Maybe<string>;
|
|
109
101
|
/**
|
|
110
|
-
* Should the
|
|
102
|
+
* Should the field and its value be displayed in a toString()-type representation?
|
|
111
103
|
*/
|
|
112
104
|
readonly display: boolean;
|
|
113
105
|
/**
|
|
@@ -115,50 +107,50 @@ export declare namespace ObjectType {
|
|
|
115
107
|
*/
|
|
116
108
|
readonly label: Maybe<string>;
|
|
117
109
|
/**
|
|
118
|
-
* The
|
|
110
|
+
* The field should be mutable in generated code i.e., it should be re-assignable. The field value may or may
|
|
119
111
|
* not be mutable.
|
|
120
112
|
*/
|
|
121
113
|
readonly mutable: boolean;
|
|
122
114
|
/**
|
|
123
|
-
* Name of this
|
|
115
|
+
* Name of this field, derived from sh:name or shaclmate:name.
|
|
124
116
|
*/
|
|
125
117
|
readonly name: string;
|
|
126
118
|
/**
|
|
127
|
-
*
|
|
128
|
-
*/
|
|
129
|
-
readonly objectType: ObjectType;
|
|
130
|
-
/**
|
|
131
|
-
* Relative order of this property, derived from sh:order.
|
|
119
|
+
* Relative order of this field, derived from sh:order.
|
|
132
120
|
*/
|
|
133
121
|
readonly order: number;
|
|
134
122
|
/**
|
|
135
|
-
* SHACL property path (https://www.w3.org/TR/shacl/#
|
|
123
|
+
* SHACL property path (https://www.w3.org/TR/shacl/#field-paths)
|
|
136
124
|
*/
|
|
137
125
|
readonly path: PropertyPath;
|
|
138
126
|
/**
|
|
139
|
-
* Identifier of the
|
|
127
|
+
* Identifier of the field shape.
|
|
140
128
|
*/
|
|
141
129
|
readonly shapeIdentifier: BlankNode | NamedNode;
|
|
142
130
|
/**
|
|
143
|
-
*
|
|
131
|
+
* StructType this field belongs to.
|
|
132
|
+
*/
|
|
133
|
+
readonly structType: StructType;
|
|
134
|
+
/**
|
|
135
|
+
* Type of this field.
|
|
144
136
|
*/
|
|
145
137
|
readonly type: Type;
|
|
146
|
-
constructor({ comment, description, display, label, mutable, name,
|
|
138
|
+
constructor({ comment, description, display, label, mutable, name, order, path, shapeIdentifier, structType, type, }: {
|
|
147
139
|
comment: Maybe<string>;
|
|
148
140
|
description: Maybe<string>;
|
|
149
141
|
display: boolean;
|
|
150
142
|
label: Maybe<string>;
|
|
151
143
|
mutable: boolean;
|
|
152
144
|
name: string;
|
|
153
|
-
objectType: ObjectType;
|
|
154
145
|
order: number;
|
|
155
146
|
path: PropertyPath;
|
|
156
147
|
shapeIdentifier: BlankNode | NamedNode;
|
|
148
|
+
structType: StructType;
|
|
157
149
|
type: Type;
|
|
158
150
|
});
|
|
159
|
-
equals(other:
|
|
151
|
+
equals(other: Field): boolean;
|
|
160
152
|
/**
|
|
161
|
-
* Does the
|
|
153
|
+
* Does the field directly or indirectly reference the StructType itself?
|
|
162
154
|
*/
|
|
163
155
|
get recursive(): boolean;
|
|
164
156
|
toJSON(): {
|
|
@@ -183,7 +175,4 @@ export declare namespace ObjectType {
|
|
|
183
175
|
toString(): string;
|
|
184
176
|
}
|
|
185
177
|
}
|
|
186
|
-
|
|
187
|
-
function toposort(objectTypes: readonly ObjectType[]): readonly ObjectType[];
|
|
188
|
-
}
|
|
189
|
-
//# sourceMappingURL=ObjectType.d.ts.map
|
|
178
|
+
//# sourceMappingURL=StructType.d.ts.map
|