@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
package/dist/input/generated.js
CHANGED
|
@@ -4,6 +4,16 @@ import { LiteralFactory } from "@rdfx/literal";
|
|
|
4
4
|
import { PropertyPath as RdfxResourcePropertyPath, Resource, ResourceSet, } from "@rdfx/resource";
|
|
5
5
|
import { NTriplesIdentifier, NTriplesTerm } from "@rdfx/string";
|
|
6
6
|
import { Either, Left, Maybe, Right } from "purify-ts";
|
|
7
|
+
function $bigIntFromRdfResourceValues(values, options) {
|
|
8
|
+
return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
|
|
9
|
+
? value.toBigInt(options.schema.in)
|
|
10
|
+
: value.toBigInt()));
|
|
11
|
+
}
|
|
12
|
+
function $booleanFromRdfResourceValues(values, options) {
|
|
13
|
+
return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
|
|
14
|
+
? value.toBoolean(options.schema.in)
|
|
15
|
+
: value.toBoolean()));
|
|
16
|
+
}
|
|
7
17
|
/**
|
|
8
18
|
* Remove undefined values from a record.
|
|
9
19
|
*/
|
|
@@ -15,11 +25,6 @@ function $compactRecord(record) {
|
|
|
15
25
|
return definedProperties;
|
|
16
26
|
}, {});
|
|
17
27
|
}
|
|
18
|
-
function $convertToArray(convertToItem, _readonly) {
|
|
19
|
-
return (value) => (typeof value === "undefined"
|
|
20
|
-
? Either.of([])
|
|
21
|
-
: Either.sequence(value.map(convertToItem)));
|
|
22
|
-
}
|
|
23
28
|
function $convertToIdentifier(value) {
|
|
24
29
|
switch (typeof value) {
|
|
25
30
|
case "object":
|
|
@@ -56,6 +61,9 @@ function $convertToIri(value) {
|
|
|
56
61
|
return Either.of(dataFactory.namedNode(value));
|
|
57
62
|
}
|
|
58
63
|
}
|
|
64
|
+
function $convertToList(convertToItem, _readonly) {
|
|
65
|
+
return (value) => Either.sequence(value.map(convertToItem));
|
|
66
|
+
}
|
|
59
67
|
function $convertToLiteral(value) {
|
|
60
68
|
if (typeof value === "object") {
|
|
61
69
|
if (value instanceof Date) {
|
|
@@ -80,6 +88,19 @@ function $convertToMaybe(convertToItem) {
|
|
|
80
88
|
return convertToItem(value).map(Maybe.of);
|
|
81
89
|
};
|
|
82
90
|
}
|
|
91
|
+
function $convertToScalarSet(convertToItem, _readonly) {
|
|
92
|
+
return (value) => {
|
|
93
|
+
if (typeof value === "undefined") {
|
|
94
|
+
return Either.of([]);
|
|
95
|
+
}
|
|
96
|
+
if (Array.isArray(value)) {
|
|
97
|
+
return Either.sequence(value.map(convertToItem));
|
|
98
|
+
}
|
|
99
|
+
return convertToItem(value).map((value) => [
|
|
100
|
+
value,
|
|
101
|
+
]);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
83
104
|
function $convertWithDefaultValue(convertToItem, defaultValue) {
|
|
84
105
|
return (value) => {
|
|
85
106
|
if (typeof value === "undefined") {
|
|
@@ -88,6 +109,16 @@ function $convertWithDefaultValue(convertToItem, defaultValue) {
|
|
|
88
109
|
return convertToItem(value);
|
|
89
110
|
};
|
|
90
111
|
}
|
|
112
|
+
function $defaultValueFromRdfResourceValues(itemFromRdfResourceValues) {
|
|
113
|
+
return (values, options) => itemFromRdfResourceValues(values.length > 0
|
|
114
|
+
? values
|
|
115
|
+
: new Resource.Value({
|
|
116
|
+
dataFactory: dataFactory,
|
|
117
|
+
focusResource: options.focusResource,
|
|
118
|
+
propertyPath: options.propertyPath,
|
|
119
|
+
term: options.schema.defaultValue,
|
|
120
|
+
}).toValues(), { ...options, schema: options.schema.itemType });
|
|
121
|
+
}
|
|
91
122
|
function $ensureRdfResourceType(resource, types, options) {
|
|
92
123
|
return resource
|
|
93
124
|
.value($RdfVocabularies.rdf.type, options)
|
|
@@ -116,27 +147,13 @@ export var $EqualsResult;
|
|
|
116
147
|
}
|
|
117
148
|
$EqualsResult.fromBooleanEqualsResult = fromBooleanEqualsResult;
|
|
118
149
|
})($EqualsResult || ($EqualsResult = {}));
|
|
119
|
-
function $
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
for (const preferredLanguage of preferredLanguages) {
|
|
127
|
-
for (const value of values) {
|
|
128
|
-
value.toLiteral().ifRight((literal) => {
|
|
129
|
-
if (literal.language === preferredLanguage) {
|
|
130
|
-
filteredValues.push(value);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return Right(Resource.Values.fromArray({
|
|
136
|
-
focusResource: values.focusResource,
|
|
137
|
-
propertyPath: values.propertyPath,
|
|
138
|
-
values: filteredValues,
|
|
139
|
-
}));
|
|
150
|
+
function $floatFromRdfResourceValues(values, options) {
|
|
151
|
+
return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
|
|
152
|
+
? value.toFloat(options.schema.in)
|
|
153
|
+
: value.toFloat()));
|
|
154
|
+
}
|
|
155
|
+
function $identifierFromRdfResourceValues(values, options) {
|
|
156
|
+
return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => value.toIdentifier()));
|
|
140
157
|
}
|
|
141
158
|
function $identityConversionFunction(value) {
|
|
142
159
|
return Either.of(value);
|
|
@@ -144,7 +161,37 @@ function $identityConversionFunction(value) {
|
|
|
144
161
|
function $identityValidationFunction(_schema, value) {
|
|
145
162
|
return Either.of(value);
|
|
146
163
|
}
|
|
164
|
+
function $iriFromRdfResourceValues(values, options) {
|
|
165
|
+
return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
|
|
166
|
+
? value.toIri(options.schema.in)
|
|
167
|
+
: value.toIri()));
|
|
168
|
+
}
|
|
169
|
+
function $listFromRdfResourceValues(itemFromRdfResourceValues) {
|
|
170
|
+
return (values, options) => values
|
|
171
|
+
.chainMap((value) => value.toList({ graph: options.graph })) // Resource.Values<Resource.Value> to Resource.Values<Resource.Values>;
|
|
172
|
+
.chain((valueLists) => valueLists.chainMap((valueList) => itemFromRdfResourceValues(Resource.Values.fromArray({
|
|
173
|
+
focusResource: options.focusResource,
|
|
174
|
+
propertyPath: options.propertyPath,
|
|
175
|
+
values: valueList.toArray(),
|
|
176
|
+
}), { ...options, schema: options.schema.itemType }))) // Resource.Values<Resource.Values> to Resource.Values<item type arrays>
|
|
177
|
+
.map((valueLists) => valueLists.map((valueList) => valueList.toArray())); // Convert inner Resource.Values to arrays
|
|
178
|
+
}
|
|
147
179
|
const $literalFactory = new LiteralFactory({ dataFactory: dataFactory });
|
|
180
|
+
function $literalFromRdfResourceValues(values, options) {
|
|
181
|
+
return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => value.toLiteral()));
|
|
182
|
+
}
|
|
183
|
+
function $maybeFromRdfResourceValues(itemFromRdfResourceValues) {
|
|
184
|
+
return (values, options) => itemFromRdfResourceValues(values, {
|
|
185
|
+
...options,
|
|
186
|
+
schema: options.schema.itemType,
|
|
187
|
+
}).map((values) => values.length > 0
|
|
188
|
+
? values.map((value) => Maybe.of(value))
|
|
189
|
+
: Resource.Values.fromValue({
|
|
190
|
+
focusResource: options.focusResource,
|
|
191
|
+
propertyPath: options.propertyPath,
|
|
192
|
+
value: Maybe.empty(),
|
|
193
|
+
}));
|
|
194
|
+
}
|
|
148
195
|
function $monkeyPatchObject(obj, methods) {
|
|
149
196
|
if (methods.toJson &&
|
|
150
197
|
(!globalThis.Object.prototype.hasOwnProperty.call(obj, "toJSON") ||
|
|
@@ -168,50 +215,47 @@ const $parseIdentifier = NTriplesIdentifier.parser(dataFactory);
|
|
|
168
215
|
export var $PropertyPath;
|
|
169
216
|
(function ($PropertyPath) {
|
|
170
217
|
$PropertyPath.fromRdfResource = RdfxResourcePropertyPath.fromResource;
|
|
171
|
-
$PropertyPath.fromRdfResourceValues = (values, options) => values.
|
|
218
|
+
$PropertyPath.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
172
219
|
.toResource()
|
|
173
|
-
.chain((resource) => $PropertyPath.fromRdfResource(resource, options)))
|
|
220
|
+
.chain((resource) => $PropertyPath.fromRdfResource(resource, options)));
|
|
174
221
|
$PropertyPath.schema = {};
|
|
175
222
|
$PropertyPath.toRdfResource = RdfxResourcePropertyPath.toResource;
|
|
176
223
|
$PropertyPath.$toString = RdfxResourcePropertyPath.toString;
|
|
177
224
|
})($PropertyPath || ($PropertyPath = {}));
|
|
178
225
|
var $RdfVocabularies;
|
|
179
226
|
(function ($RdfVocabularies) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
xsd.unsignedLong = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedLong");
|
|
213
|
-
xsd.unsignedShort = dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedShort");
|
|
214
|
-
})(xsd = $RdfVocabularies.xsd || ($RdfVocabularies.xsd = {}));
|
|
227
|
+
$RdfVocabularies.rdf = {
|
|
228
|
+
first: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),
|
|
229
|
+
nil: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"),
|
|
230
|
+
rest: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),
|
|
231
|
+
subject: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#subject"),
|
|
232
|
+
type: dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
|
|
233
|
+
};
|
|
234
|
+
$RdfVocabularies.rdfs = {
|
|
235
|
+
subClassOf: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),
|
|
236
|
+
};
|
|
237
|
+
$RdfVocabularies.xsd = {
|
|
238
|
+
boolean: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),
|
|
239
|
+
byte: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#byte"),
|
|
240
|
+
date: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#date"),
|
|
241
|
+
dateTime: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),
|
|
242
|
+
decimal: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),
|
|
243
|
+
double: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#double"),
|
|
244
|
+
float: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#float"),
|
|
245
|
+
int: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#int"),
|
|
246
|
+
integer: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#integer"),
|
|
247
|
+
long: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#long"),
|
|
248
|
+
negativeInteger: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#negativeInteger"),
|
|
249
|
+
nonNegativeInteger: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#nonNegativeInteger"),
|
|
250
|
+
nonPositiveInteger: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#nonPositiveInteger"),
|
|
251
|
+
positiveInteger: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#positiveInteger"),
|
|
252
|
+
short: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#short"),
|
|
253
|
+
string: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#string"),
|
|
254
|
+
unsignedByte: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedByte"),
|
|
255
|
+
unsignedInt: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedInt"),
|
|
256
|
+
unsignedLong: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedLong"),
|
|
257
|
+
unsignedShort: dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#unsignedShort"),
|
|
258
|
+
};
|
|
215
259
|
})($RdfVocabularies || ($RdfVocabularies = {}));
|
|
216
260
|
function $sequenceRecord(record) {
|
|
217
261
|
const result = {};
|
|
@@ -224,8 +268,26 @@ function $sequenceRecord(record) {
|
|
|
224
268
|
}
|
|
225
269
|
return Right(result);
|
|
226
270
|
}
|
|
227
|
-
function $
|
|
228
|
-
return
|
|
271
|
+
function $setFromRdfResourceValues(itemFromRdfResourceValues) {
|
|
272
|
+
return (values, options) => itemFromRdfResourceValues(values, {
|
|
273
|
+
...options,
|
|
274
|
+
schema: options.schema.itemType,
|
|
275
|
+
})
|
|
276
|
+
.map((values) => values.toArray())
|
|
277
|
+
.map((valuesArray) => Resource.Values.fromValue({
|
|
278
|
+
focusResource: options.focusResource,
|
|
279
|
+
propertyPath: options.propertyPath,
|
|
280
|
+
value: valuesArray,
|
|
281
|
+
}));
|
|
282
|
+
}
|
|
283
|
+
function $shaclPropertyFromRdf({ focusResource, graph, propertySchema, typeFromRdfResourceValues, ...otherParameters }) {
|
|
284
|
+
return typeFromRdfResourceValues(focusResource.values(propertySchema.path, { graph, unique: true }), {
|
|
285
|
+
...otherParameters,
|
|
286
|
+
focusResource,
|
|
287
|
+
graph,
|
|
288
|
+
propertyPath: propertySchema.path,
|
|
289
|
+
schema: propertySchema.type,
|
|
290
|
+
}).chain((values) => values.head());
|
|
229
291
|
}
|
|
230
292
|
/**
|
|
231
293
|
* Compare two values for strict equality (===), returning an $EqualsResult rather than a boolean.
|
|
@@ -233,6 +295,84 @@ function $shaclPropertyFromRdf({ graph, propertySchema, resource, typeFromRdf, }
|
|
|
233
295
|
function $strictEquals(left, right) {
|
|
234
296
|
return $EqualsResult.fromBooleanEqualsResult(left, right, left === right);
|
|
235
297
|
}
|
|
298
|
+
function $stringFromRdfResourceValues(values, options) {
|
|
299
|
+
return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => options.schema.in
|
|
300
|
+
? value.toString(options.schema.in)
|
|
301
|
+
: value.toString()));
|
|
302
|
+
}
|
|
303
|
+
function $termFromRdfResourceValues(values, options) {
|
|
304
|
+
const { focusResource, propertyPath, schema } = options;
|
|
305
|
+
return $termLikeFromRdfResourceValues(values, options).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
306
|
+
if (schema.in &&
|
|
307
|
+
schema.in.length > 0 &&
|
|
308
|
+
!schema.in.some((in_) => in_.equals(term))) {
|
|
309
|
+
return Left(new Resource.MistypedTermValueError({
|
|
310
|
+
actualValue: term,
|
|
311
|
+
expectedValueType: "Term in",
|
|
312
|
+
focusResource,
|
|
313
|
+
propertyPath,
|
|
314
|
+
}));
|
|
315
|
+
}
|
|
316
|
+
if (!schema.types.some((type) => term.termType === type)) {
|
|
317
|
+
return Left(new Resource.MistypedTermValueError({
|
|
318
|
+
actualValue: term,
|
|
319
|
+
expectedValueType: "Term types",
|
|
320
|
+
focusResource,
|
|
321
|
+
propertyPath,
|
|
322
|
+
}));
|
|
323
|
+
}
|
|
324
|
+
return Right(term);
|
|
325
|
+
})));
|
|
326
|
+
}
|
|
327
|
+
const $termLikeFromRdfResourceValues = (values, { preferredLanguages, schema: { hasValues, languageIn } }) => {
|
|
328
|
+
let chain = Either.of(values);
|
|
329
|
+
if (hasValues && hasValues.length > 0) {
|
|
330
|
+
chain = chain.chain((values) => Either.sequence(hasValues.map((hasValue) => values.find((value) => value.term.equals(hasValue)))).map(() => values));
|
|
331
|
+
}
|
|
332
|
+
if (languageIn && languageIn.length > 0) {
|
|
333
|
+
chain = chain.chain((values) => values.chainMap((value) => value.toLiteral().chain((literal) => languageIn.includes(literal.language)
|
|
334
|
+
? Right(value)
|
|
335
|
+
: Left(new Resource.MistypedTermValueError({
|
|
336
|
+
actualValue: literal,
|
|
337
|
+
expectedValueType: "Literal",
|
|
338
|
+
focusResource: value.focusResource,
|
|
339
|
+
propertyPath: value.propertyPath,
|
|
340
|
+
})))));
|
|
341
|
+
}
|
|
342
|
+
if (preferredLanguages && preferredLanguages.length > 0) {
|
|
343
|
+
chain = chain.chain((values) => {
|
|
344
|
+
const literals = [];
|
|
345
|
+
const literalValues = [];
|
|
346
|
+
const nonLiteralValues = [];
|
|
347
|
+
for (const value of values) {
|
|
348
|
+
const term = value.toTerm().unsafeCoerce();
|
|
349
|
+
if (term.termType === "Literal") {
|
|
350
|
+
literals.push(term);
|
|
351
|
+
literalValues.push(value);
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
nonLiteralValues.push(value);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
// Return all literals for the first preferredLanguage, then all literals for the second preferredLanguage, etc.
|
|
358
|
+
// Within a preferredLanguage the literals may be in any order.
|
|
359
|
+
const preferredLanguageLiteralValues = [];
|
|
360
|
+
for (const preferredLanguage of preferredLanguages) {
|
|
361
|
+
for (let literalI = 0; literalI < literals.length; literalI++) {
|
|
362
|
+
if (literals[literalI].language === preferredLanguage) {
|
|
363
|
+
preferredLanguageLiteralValues.push(literalValues[literalI]);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return Right(Resource.Values.fromArray({
|
|
368
|
+
focusResource: values.focusResource,
|
|
369
|
+
propertyPath: values.propertyPath,
|
|
370
|
+
values: nonLiteralValues.concat(preferredLanguageLiteralValues),
|
|
371
|
+
}));
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
return chain;
|
|
375
|
+
};
|
|
236
376
|
function $validateArray(validateItem, _readonly) {
|
|
237
377
|
return (schema, valueArray) => {
|
|
238
378
|
if (schema.minCount !== undefined && valueArray.length < schema.minCount) {
|
|
@@ -277,677 +417,471 @@ function $wrap_ToRdfResourceFunction(_toRdfResourceFunction) {
|
|
|
277
417
|
return resource;
|
|
278
418
|
};
|
|
279
419
|
}
|
|
280
|
-
export var
|
|
281
|
-
(function (
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
420
|
+
export var NodeShape;
|
|
421
|
+
(function (NodeShape) {
|
|
422
|
+
NodeShape.create = (parameters) => $sequenceRecord({
|
|
423
|
+
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
424
|
+
and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
|
|
425
|
+
classes: $convertToScalarSet(($convertToIri), true)(parameters?.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
|
|
426
|
+
closed: $convertToMaybe($identityConversionFunction)(parameters?.closed).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.closed.type, value)),
|
|
427
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
428
|
+
datatype: $convertToMaybe(($convertToIri))(parameters?.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
|
|
429
|
+
deactivated: $convertToMaybe($identityConversionFunction)(parameters?.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
|
|
430
|
+
discriminantValue: $convertToMaybe($identityConversionFunction)(parameters?.discriminantValue).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.discriminantValue.type, value)),
|
|
431
|
+
extern: $convertToMaybe($identityConversionFunction)(parameters?.extern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.extern.type, value)),
|
|
432
|
+
flags: $convertToMaybe($identityConversionFunction)(parameters?.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
|
|
433
|
+
fromRdfType: $convertToMaybe(($convertToIri))(parameters?.fromRdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.fromRdfType.type, value)),
|
|
434
|
+
hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters?.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
|
|
435
|
+
ignoredProperties: $convertToMaybe($convertToList(($convertToIri), true))(parameters?.ignoredProperties).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.ignoredProperties.type, value)),
|
|
436
|
+
in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
|
|
437
|
+
isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters?.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
|
|
438
|
+
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
439
|
+
languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters?.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
|
|
440
|
+
maxExclusive: $convertToMaybe($convertToLiteral)(parameters?.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
|
|
441
|
+
maxInclusive: $convertToMaybe($convertToLiteral)(parameters?.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
|
|
442
|
+
maxLength: $convertToMaybe($identityConversionFunction)(parameters?.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
|
|
443
|
+
message: $convertToMaybe($identityConversionFunction)(parameters?.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
|
|
444
|
+
minExclusive: $convertToMaybe($convertToLiteral)(parameters?.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
|
|
445
|
+
minInclusive: $convertToMaybe($convertToLiteral)(parameters?.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
|
|
446
|
+
minLength: $convertToMaybe($identityConversionFunction)(parameters?.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
|
|
447
|
+
mutable: $convertToMaybe($identityConversionFunction)(parameters?.mutable).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.mutable.type, value)),
|
|
448
|
+
node: $convertToMaybe($convertToIdentifier)(parameters?.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
|
|
449
|
+
nodeKind: $convertToMaybe(($convertToIri))(parameters?.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
|
|
450
|
+
not: $convertToScalarSet($convertToIdentifier, true)(parameters?.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
|
|
451
|
+
or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
|
|
452
|
+
pattern: $convertToMaybe($identityConversionFunction)(parameters?.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
|
|
453
|
+
properties: $convertToScalarSet($convertToIdentifier, true)(parameters?.properties).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.properties.type, value)),
|
|
454
|
+
rdfType: $convertToMaybe(($convertToIri))(parameters?.rdfType).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.rdfType.type, value)),
|
|
455
|
+
severity: $convertToMaybe(($convertToIri))(parameters?.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
|
|
456
|
+
shaclmateName: $convertToMaybe($identityConversionFunction)(parameters?.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.shaclmateName.type, value)),
|
|
457
|
+
subClassOf: $convertToScalarSet(($convertToIri), true)(parameters?.subClassOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.subClassOf.type, value)),
|
|
458
|
+
targetClasses: $convertToScalarSet(($convertToIri), true)(parameters?.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
|
|
459
|
+
targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters?.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
|
|
460
|
+
targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
|
|
461
|
+
targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters?.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
|
|
462
|
+
toRdfTypes: $convertToScalarSet(($convertToIri), true)(parameters?.toRdfTypes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.toRdfTypes.type, value)),
|
|
463
|
+
tsImports: $convertToScalarSet($identityConversionFunction, true)(parameters?.tsImports).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.tsImports.type, value)),
|
|
464
|
+
types: $convertToScalarSet(($convertToIri), true)(parameters?.types).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.types.type, value)),
|
|
465
|
+
xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters?.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
|
|
466
|
+
})
|
|
467
|
+
.map((properties) => ({ ...properties, $type: "NodeShape" }))
|
|
468
|
+
.map((object) => $monkeyPatchObject(object, { $toString: NodeShape.$toString }));
|
|
324
469
|
function createUnsafe(parameters) {
|
|
325
|
-
return create(parameters).unsafeCoerce();
|
|
470
|
+
return NodeShape.create(parameters).unsafeCoerce();
|
|
326
471
|
}
|
|
327
|
-
|
|
472
|
+
NodeShape.createUnsafe = createUnsafe;
|
|
473
|
+
NodeShape._fromRdfResource = ($resource, _$options) => (!_$options.ignoreRdfType
|
|
474
|
+
? $ensureRdfResourceType($resource, [NodeShape.schema.fromRdfType], {
|
|
475
|
+
graph: _$options.graph,
|
|
476
|
+
})
|
|
477
|
+
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
478
|
+
$identifier: $identifierFromRdfResourceValues(new Resource.Value({
|
|
479
|
+
dataFactory: dataFactory,
|
|
480
|
+
focusResource: $resource,
|
|
481
|
+
propertyPath: $RdfVocabularies.rdf.subject,
|
|
482
|
+
term: $resource.identifier,
|
|
483
|
+
}).toValues(), {
|
|
484
|
+
context: _$options.context,
|
|
485
|
+
graph: _$options.graph,
|
|
486
|
+
focusResource: $resource,
|
|
487
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
488
|
+
propertyPath: $RdfVocabularies.rdf.subject,
|
|
489
|
+
schema: NodeShape.schema.properties.$identifier.type,
|
|
490
|
+
}).chain((values) => values.head()),
|
|
491
|
+
and: $shaclPropertyFromRdf({
|
|
492
|
+
context: _$options.context,
|
|
493
|
+
graph: _$options.graph,
|
|
494
|
+
focusResource: $resource,
|
|
495
|
+
ignoreRdfType: true,
|
|
496
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
497
|
+
propertySchema: NodeShape.schema.properties.and,
|
|
498
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
|
|
499
|
+
}),
|
|
500
|
+
classes: $shaclPropertyFromRdf({
|
|
501
|
+
context: _$options.context,
|
|
502
|
+
graph: _$options.graph,
|
|
503
|
+
focusResource: $resource,
|
|
504
|
+
ignoreRdfType: true,
|
|
505
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
506
|
+
propertySchema: NodeShape.schema.properties.classes,
|
|
507
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
508
|
+
}),
|
|
509
|
+
closed: $shaclPropertyFromRdf({
|
|
510
|
+
context: _$options.context,
|
|
511
|
+
graph: _$options.graph,
|
|
512
|
+
focusResource: $resource,
|
|
513
|
+
ignoreRdfType: true,
|
|
514
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
515
|
+
propertySchema: NodeShape.schema.properties.closed,
|
|
516
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
|
|
517
|
+
}),
|
|
518
|
+
comment: $shaclPropertyFromRdf({
|
|
519
|
+
context: _$options.context,
|
|
520
|
+
graph: _$options.graph,
|
|
521
|
+
focusResource: $resource,
|
|
522
|
+
ignoreRdfType: true,
|
|
523
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
524
|
+
propertySchema: NodeShape.schema.properties.comment,
|
|
525
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
526
|
+
}),
|
|
527
|
+
datatype: $shaclPropertyFromRdf({
|
|
528
|
+
context: _$options.context,
|
|
529
|
+
graph: _$options.graph,
|
|
530
|
+
focusResource: $resource,
|
|
531
|
+
ignoreRdfType: true,
|
|
532
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
533
|
+
propertySchema: NodeShape.schema.properties.datatype,
|
|
534
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
535
|
+
}),
|
|
536
|
+
deactivated: $shaclPropertyFromRdf({
|
|
537
|
+
context: _$options.context,
|
|
538
|
+
graph: _$options.graph,
|
|
539
|
+
focusResource: $resource,
|
|
540
|
+
ignoreRdfType: true,
|
|
541
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
542
|
+
propertySchema: NodeShape.schema.properties.deactivated,
|
|
543
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
|
|
544
|
+
}),
|
|
545
|
+
discriminantValue: $shaclPropertyFromRdf({
|
|
546
|
+
context: _$options.context,
|
|
547
|
+
graph: _$options.graph,
|
|
548
|
+
focusResource: $resource,
|
|
549
|
+
ignoreRdfType: true,
|
|
550
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
551
|
+
propertySchema: NodeShape.schema.properties.discriminantValue,
|
|
552
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
553
|
+
}),
|
|
554
|
+
extern: $shaclPropertyFromRdf({
|
|
555
|
+
context: _$options.context,
|
|
556
|
+
graph: _$options.graph,
|
|
557
|
+
focusResource: $resource,
|
|
558
|
+
ignoreRdfType: true,
|
|
559
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
560
|
+
propertySchema: NodeShape.schema.properties.extern,
|
|
561
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
|
|
562
|
+
}),
|
|
563
|
+
flags: $shaclPropertyFromRdf({
|
|
564
|
+
context: _$options.context,
|
|
565
|
+
graph: _$options.graph,
|
|
566
|
+
focusResource: $resource,
|
|
567
|
+
ignoreRdfType: true,
|
|
568
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
569
|
+
propertySchema: NodeShape.schema.properties.flags,
|
|
570
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
571
|
+
}),
|
|
572
|
+
fromRdfType: $shaclPropertyFromRdf({
|
|
573
|
+
context: _$options.context,
|
|
574
|
+
graph: _$options.graph,
|
|
575
|
+
focusResource: $resource,
|
|
576
|
+
ignoreRdfType: true,
|
|
577
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
578
|
+
propertySchema: NodeShape.schema.properties.fromRdfType,
|
|
579
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
580
|
+
}),
|
|
581
|
+
hasValues: $shaclPropertyFromRdf({
|
|
582
|
+
context: _$options.context,
|
|
583
|
+
graph: _$options.graph,
|
|
584
|
+
focusResource: $resource,
|
|
585
|
+
ignoreRdfType: true,
|
|
586
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
587
|
+
propertySchema: NodeShape.schema.properties.hasValues,
|
|
588
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($termFromRdfResourceValues)),
|
|
589
|
+
}),
|
|
590
|
+
ignoredProperties: $shaclPropertyFromRdf({
|
|
591
|
+
context: _$options.context,
|
|
592
|
+
graph: _$options.graph,
|
|
593
|
+
focusResource: $resource,
|
|
594
|
+
ignoreRdfType: true,
|
|
595
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
596
|
+
propertySchema: NodeShape.schema.properties.ignoredProperties,
|
|
597
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($iriFromRdfResourceValues))),
|
|
598
|
+
}),
|
|
599
|
+
in_: $shaclPropertyFromRdf({
|
|
600
|
+
context: _$options.context,
|
|
601
|
+
graph: _$options.graph,
|
|
602
|
+
focusResource: $resource,
|
|
603
|
+
ignoreRdfType: true,
|
|
604
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
605
|
+
propertySchema: NodeShape.schema.properties.in_,
|
|
606
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($termFromRdfResourceValues))),
|
|
607
|
+
}),
|
|
608
|
+
isDefinedBy: $shaclPropertyFromRdf({
|
|
609
|
+
context: _$options.context,
|
|
610
|
+
graph: _$options.graph,
|
|
611
|
+
focusResource: $resource,
|
|
612
|
+
ignoreRdfType: true,
|
|
613
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
614
|
+
propertySchema: NodeShape.schema.properties.isDefinedBy,
|
|
615
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
|
|
616
|
+
}),
|
|
617
|
+
label: $shaclPropertyFromRdf({
|
|
618
|
+
context: _$options.context,
|
|
619
|
+
graph: _$options.graph,
|
|
620
|
+
focusResource: $resource,
|
|
621
|
+
ignoreRdfType: true,
|
|
622
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
623
|
+
propertySchema: NodeShape.schema.properties.label,
|
|
624
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
625
|
+
}),
|
|
626
|
+
languageIn: $shaclPropertyFromRdf({
|
|
627
|
+
context: _$options.context,
|
|
628
|
+
graph: _$options.graph,
|
|
629
|
+
focusResource: $resource,
|
|
630
|
+
ignoreRdfType: true,
|
|
631
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
632
|
+
propertySchema: NodeShape.schema.properties.languageIn,
|
|
633
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($stringFromRdfResourceValues))),
|
|
634
|
+
}),
|
|
635
|
+
maxExclusive: $shaclPropertyFromRdf({
|
|
636
|
+
context: _$options.context,
|
|
637
|
+
graph: _$options.graph,
|
|
638
|
+
focusResource: $resource,
|
|
639
|
+
ignoreRdfType: true,
|
|
640
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
641
|
+
propertySchema: NodeShape.schema.properties.maxExclusive,
|
|
642
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
|
|
643
|
+
}),
|
|
644
|
+
maxInclusive: $shaclPropertyFromRdf({
|
|
645
|
+
context: _$options.context,
|
|
646
|
+
graph: _$options.graph,
|
|
647
|
+
focusResource: $resource,
|
|
648
|
+
ignoreRdfType: true,
|
|
649
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
650
|
+
propertySchema: NodeShape.schema.properties.maxInclusive,
|
|
651
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
|
|
652
|
+
}),
|
|
653
|
+
maxLength: $shaclPropertyFromRdf({
|
|
654
|
+
context: _$options.context,
|
|
655
|
+
graph: _$options.graph,
|
|
656
|
+
focusResource: $resource,
|
|
657
|
+
ignoreRdfType: true,
|
|
658
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
659
|
+
propertySchema: NodeShape.schema.properties.maxLength,
|
|
660
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
|
|
661
|
+
}),
|
|
662
|
+
message: $shaclPropertyFromRdf({
|
|
663
|
+
context: _$options.context,
|
|
664
|
+
graph: _$options.graph,
|
|
665
|
+
focusResource: $resource,
|
|
666
|
+
ignoreRdfType: true,
|
|
667
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
668
|
+
propertySchema: NodeShape.schema.properties.message,
|
|
669
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
670
|
+
}),
|
|
671
|
+
minExclusive: $shaclPropertyFromRdf({
|
|
672
|
+
context: _$options.context,
|
|
673
|
+
graph: _$options.graph,
|
|
674
|
+
focusResource: $resource,
|
|
675
|
+
ignoreRdfType: true,
|
|
676
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
677
|
+
propertySchema: NodeShape.schema.properties.minExclusive,
|
|
678
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
|
|
679
|
+
}),
|
|
680
|
+
minInclusive: $shaclPropertyFromRdf({
|
|
681
|
+
context: _$options.context,
|
|
682
|
+
graph: _$options.graph,
|
|
683
|
+
focusResource: $resource,
|
|
684
|
+
ignoreRdfType: true,
|
|
685
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
686
|
+
propertySchema: NodeShape.schema.properties.minInclusive,
|
|
687
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
|
|
688
|
+
}),
|
|
689
|
+
minLength: $shaclPropertyFromRdf({
|
|
690
|
+
context: _$options.context,
|
|
691
|
+
graph: _$options.graph,
|
|
692
|
+
focusResource: $resource,
|
|
693
|
+
ignoreRdfType: true,
|
|
694
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
695
|
+
propertySchema: NodeShape.schema.properties.minLength,
|
|
696
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
|
|
697
|
+
}),
|
|
698
|
+
mutable: $shaclPropertyFromRdf({
|
|
699
|
+
context: _$options.context,
|
|
700
|
+
graph: _$options.graph,
|
|
701
|
+
focusResource: $resource,
|
|
702
|
+
ignoreRdfType: true,
|
|
703
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
704
|
+
propertySchema: NodeShape.schema.properties.mutable,
|
|
705
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
|
|
706
|
+
}),
|
|
707
|
+
node: $shaclPropertyFromRdf({
|
|
708
|
+
context: _$options.context,
|
|
709
|
+
graph: _$options.graph,
|
|
710
|
+
focusResource: $resource,
|
|
711
|
+
ignoreRdfType: true,
|
|
712
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
713
|
+
propertySchema: NodeShape.schema.properties.node,
|
|
714
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
|
|
715
|
+
}),
|
|
716
|
+
nodeKind: $shaclPropertyFromRdf({
|
|
717
|
+
context: _$options.context,
|
|
718
|
+
graph: _$options.graph,
|
|
719
|
+
focusResource: $resource,
|
|
720
|
+
ignoreRdfType: true,
|
|
721
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
722
|
+
propertySchema: NodeShape.schema.properties.nodeKind,
|
|
723
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
724
|
+
}),
|
|
725
|
+
not: $shaclPropertyFromRdf({
|
|
726
|
+
context: _$options.context,
|
|
727
|
+
graph: _$options.graph,
|
|
728
|
+
focusResource: $resource,
|
|
729
|
+
ignoreRdfType: true,
|
|
730
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
731
|
+
propertySchema: NodeShape.schema.properties.not,
|
|
732
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues($identifierFromRdfResourceValues),
|
|
733
|
+
}),
|
|
734
|
+
or: $shaclPropertyFromRdf({
|
|
735
|
+
context: _$options.context,
|
|
736
|
+
graph: _$options.graph,
|
|
737
|
+
focusResource: $resource,
|
|
738
|
+
ignoreRdfType: true,
|
|
739
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
740
|
+
propertySchema: NodeShape.schema.properties.or,
|
|
741
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
|
|
742
|
+
}),
|
|
743
|
+
pattern: $shaclPropertyFromRdf({
|
|
744
|
+
context: _$options.context,
|
|
745
|
+
graph: _$options.graph,
|
|
746
|
+
focusResource: $resource,
|
|
747
|
+
ignoreRdfType: true,
|
|
748
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
749
|
+
propertySchema: NodeShape.schema.properties.pattern,
|
|
750
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
751
|
+
}),
|
|
752
|
+
properties: $shaclPropertyFromRdf({
|
|
753
|
+
context: _$options.context,
|
|
754
|
+
graph: _$options.graph,
|
|
755
|
+
focusResource: $resource,
|
|
756
|
+
ignoreRdfType: true,
|
|
757
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
758
|
+
propertySchema: NodeShape.schema.properties.properties,
|
|
759
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues($identifierFromRdfResourceValues),
|
|
760
|
+
}),
|
|
761
|
+
rdfType: $shaclPropertyFromRdf({
|
|
762
|
+
context: _$options.context,
|
|
763
|
+
graph: _$options.graph,
|
|
764
|
+
focusResource: $resource,
|
|
765
|
+
ignoreRdfType: true,
|
|
766
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
767
|
+
propertySchema: NodeShape.schema.properties.rdfType,
|
|
768
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
769
|
+
}),
|
|
770
|
+
severity: $shaclPropertyFromRdf({
|
|
771
|
+
context: _$options.context,
|
|
772
|
+
graph: _$options.graph,
|
|
773
|
+
focusResource: $resource,
|
|
774
|
+
ignoreRdfType: true,
|
|
775
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
776
|
+
propertySchema: NodeShape.schema.properties.severity,
|
|
777
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
778
|
+
}),
|
|
779
|
+
shaclmateName: $shaclPropertyFromRdf({
|
|
780
|
+
context: _$options.context,
|
|
781
|
+
graph: _$options.graph,
|
|
782
|
+
focusResource: $resource,
|
|
783
|
+
ignoreRdfType: true,
|
|
784
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
785
|
+
propertySchema: NodeShape.schema.properties.shaclmateName,
|
|
786
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
787
|
+
}),
|
|
788
|
+
subClassOf: $shaclPropertyFromRdf({
|
|
789
|
+
context: _$options.context,
|
|
790
|
+
graph: _$options.graph,
|
|
791
|
+
focusResource: $resource,
|
|
792
|
+
ignoreRdfType: true,
|
|
793
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
794
|
+
propertySchema: NodeShape.schema.properties.subClassOf,
|
|
795
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
796
|
+
}),
|
|
797
|
+
targetClasses: $shaclPropertyFromRdf({
|
|
798
|
+
context: _$options.context,
|
|
799
|
+
graph: _$options.graph,
|
|
800
|
+
focusResource: $resource,
|
|
801
|
+
ignoreRdfType: true,
|
|
802
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
803
|
+
propertySchema: NodeShape.schema.properties.targetClasses,
|
|
804
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
805
|
+
}),
|
|
806
|
+
targetNodes: $shaclPropertyFromRdf({
|
|
807
|
+
context: _$options.context,
|
|
808
|
+
graph: _$options.graph,
|
|
809
|
+
focusResource: $resource,
|
|
810
|
+
ignoreRdfType: true,
|
|
811
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
812
|
+
propertySchema: NodeShape.schema.properties.targetNodes,
|
|
813
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($termFromRdfResourceValues)),
|
|
814
|
+
}),
|
|
815
|
+
targetObjectsOf: $shaclPropertyFromRdf({
|
|
816
|
+
context: _$options.context,
|
|
817
|
+
graph: _$options.graph,
|
|
818
|
+
focusResource: $resource,
|
|
819
|
+
ignoreRdfType: true,
|
|
820
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
821
|
+
propertySchema: NodeShape.schema.properties.targetObjectsOf,
|
|
822
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
823
|
+
}),
|
|
824
|
+
targetSubjectsOf: $shaclPropertyFromRdf({
|
|
825
|
+
context: _$options.context,
|
|
826
|
+
graph: _$options.graph,
|
|
827
|
+
focusResource: $resource,
|
|
828
|
+
ignoreRdfType: true,
|
|
829
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
830
|
+
propertySchema: NodeShape.schema.properties.targetSubjectsOf,
|
|
831
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
832
|
+
}),
|
|
833
|
+
toRdfTypes: $shaclPropertyFromRdf({
|
|
834
|
+
context: _$options.context,
|
|
835
|
+
graph: _$options.graph,
|
|
836
|
+
focusResource: $resource,
|
|
837
|
+
ignoreRdfType: true,
|
|
838
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
839
|
+
propertySchema: NodeShape.schema.properties.toRdfTypes,
|
|
840
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
841
|
+
}),
|
|
842
|
+
tsImports: $shaclPropertyFromRdf({
|
|
843
|
+
context: _$options.context,
|
|
844
|
+
graph: _$options.graph,
|
|
845
|
+
focusResource: $resource,
|
|
846
|
+
ignoreRdfType: true,
|
|
847
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
848
|
+
propertySchema: NodeShape.schema.properties.tsImports,
|
|
849
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
850
|
+
}),
|
|
851
|
+
types: $shaclPropertyFromRdf({
|
|
852
|
+
context: _$options.context,
|
|
853
|
+
graph: _$options.graph,
|
|
854
|
+
focusResource: $resource,
|
|
855
|
+
ignoreRdfType: true,
|
|
856
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
857
|
+
propertySchema: NodeShape.schema.properties.types,
|
|
858
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
859
|
+
}),
|
|
860
|
+
xone: $shaclPropertyFromRdf({
|
|
861
|
+
context: _$options.context,
|
|
862
|
+
graph: _$options.graph,
|
|
863
|
+
focusResource: $resource,
|
|
864
|
+
ignoreRdfType: true,
|
|
865
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
866
|
+
propertySchema: NodeShape.schema.properties.xone,
|
|
867
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
|
|
868
|
+
}),
|
|
869
|
+
}).chain((properties) => NodeShape.create(properties)));
|
|
870
|
+
NodeShape.fromRdfResource = $wrap_FromRdfResourceFunction(NodeShape._fromRdfResource);
|
|
871
|
+
NodeShape.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
872
|
+
.toResource()
|
|
873
|
+
.chain((resource) => NodeShape.fromRdfResource(resource, options)));
|
|
328
874
|
let Identifier;
|
|
329
875
|
(function (Identifier) {
|
|
330
876
|
Identifier.parse = $parseIdentifier;
|
|
331
877
|
Identifier.stringify = NTriplesTerm.stringify;
|
|
332
|
-
})(Identifier =
|
|
333
|
-
|
|
334
|
-
return
|
|
335
|
-
? $ensureRdfResourceType($resource, [PropertyShape.fromRdfType], {
|
|
336
|
-
graph: _$options.graph,
|
|
337
|
-
})
|
|
338
|
-
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
339
|
-
$identifier: Right(new Resource.Value({
|
|
340
|
-
dataFactory: dataFactory,
|
|
341
|
-
focusResource: $resource,
|
|
342
|
-
propertyPath: $RdfVocabularies.rdf.subject,
|
|
343
|
-
term: $resource.identifier,
|
|
344
|
-
}).toValues())
|
|
345
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
346
|
-
.chain((values) => values.head()),
|
|
347
|
-
and: $shaclPropertyFromRdf({
|
|
348
|
-
graph: _$options.graph,
|
|
349
|
-
resource: $resource,
|
|
350
|
-
propertySchema: PropertyShape.schema.properties.and,
|
|
351
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
352
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
353
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
354
|
-
focusResource: $resource,
|
|
355
|
-
propertyPath: PropertyShape.schema.properties.and.path,
|
|
356
|
-
values: valueList.toArray(),
|
|
357
|
-
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
358
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
359
|
-
.map((values) => values.length > 0
|
|
360
|
-
? values.map((value) => Maybe.of(value))
|
|
361
|
-
: Resource.Values.fromValue({
|
|
362
|
-
focusResource: $resource,
|
|
363
|
-
propertyPath: PropertyShape.schema.properties.and.path,
|
|
364
|
-
value: Maybe.empty(),
|
|
365
|
-
})),
|
|
366
|
-
}),
|
|
367
|
-
classes: $shaclPropertyFromRdf({
|
|
368
|
-
graph: _$options.graph,
|
|
369
|
-
resource: $resource,
|
|
370
|
-
propertySchema: PropertyShape.schema.properties.classes,
|
|
371
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
372
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
373
|
-
.map((values) => values.toArray())
|
|
374
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
375
|
-
focusResource: $resource,
|
|
376
|
-
propertyPath: PropertyShape.schema.properties.classes.path,
|
|
377
|
-
value: valuesArray,
|
|
378
|
-
})),
|
|
379
|
-
}),
|
|
380
|
-
comment: $shaclPropertyFromRdf({
|
|
381
|
-
graph: _$options.graph,
|
|
382
|
-
resource: $resource,
|
|
383
|
-
propertySchema: PropertyShape.schema.properties.comment,
|
|
384
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
385
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
386
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
387
|
-
.map((values) => values.length > 0
|
|
388
|
-
? values.map((value) => Maybe.of(value))
|
|
389
|
-
: Resource.Values.fromValue({
|
|
390
|
-
focusResource: $resource,
|
|
391
|
-
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
392
|
-
value: Maybe.empty(),
|
|
393
|
-
})),
|
|
394
|
-
}),
|
|
395
|
-
datatype: $shaclPropertyFromRdf({
|
|
396
|
-
graph: _$options.graph,
|
|
397
|
-
resource: $resource,
|
|
398
|
-
propertySchema: PropertyShape.schema.properties.datatype,
|
|
399
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
400
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
401
|
-
.map((values) => values.length > 0
|
|
402
|
-
? values.map((value) => Maybe.of(value))
|
|
403
|
-
: Resource.Values.fromValue({
|
|
404
|
-
focusResource: $resource,
|
|
405
|
-
propertyPath: PropertyShape.schema.properties.datatype.path,
|
|
406
|
-
value: Maybe.empty(),
|
|
407
|
-
})),
|
|
408
|
-
}),
|
|
409
|
-
deactivated: $shaclPropertyFromRdf({
|
|
410
|
-
graph: _$options.graph,
|
|
411
|
-
resource: $resource,
|
|
412
|
-
propertySchema: PropertyShape.schema.properties.deactivated,
|
|
413
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
414
|
-
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
415
|
-
.map((values) => values.length > 0
|
|
416
|
-
? values.map((value) => Maybe.of(value))
|
|
417
|
-
: Resource.Values.fromValue({
|
|
418
|
-
focusResource: $resource,
|
|
419
|
-
propertyPath: PropertyShape.schema.properties.deactivated.path,
|
|
420
|
-
value: Maybe.empty(),
|
|
421
|
-
})),
|
|
422
|
-
}),
|
|
423
|
-
defaultValue: $shaclPropertyFromRdf({
|
|
424
|
-
graph: _$options.graph,
|
|
425
|
-
resource: $resource,
|
|
426
|
-
propertySchema: PropertyShape.schema.properties.defaultValue,
|
|
427
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
428
|
-
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
429
|
-
switch (term.termType) {
|
|
430
|
-
case "NamedNode":
|
|
431
|
-
case "Literal":
|
|
432
|
-
return Either.of(term);
|
|
433
|
-
default:
|
|
434
|
-
return Left(new Resource.MistypedTermValueError({
|
|
435
|
-
actualValue: term,
|
|
436
|
-
expectedValueType: "(NamedNode | Literal)",
|
|
437
|
-
focusResource: $resource,
|
|
438
|
-
propertyPath: PropertyShape.schema.properties.defaultValue.path,
|
|
439
|
-
}));
|
|
440
|
-
}
|
|
441
|
-
})))
|
|
442
|
-
.map((values) => values.length > 0
|
|
443
|
-
? values.map((value) => Maybe.of(value))
|
|
444
|
-
: Resource.Values.fromValue({
|
|
445
|
-
focusResource: $resource,
|
|
446
|
-
propertyPath: PropertyShape.schema.properties.defaultValue.path,
|
|
447
|
-
value: Maybe.empty(),
|
|
448
|
-
})),
|
|
449
|
-
}),
|
|
450
|
-
description: $shaclPropertyFromRdf({
|
|
451
|
-
graph: _$options.graph,
|
|
452
|
-
resource: $resource,
|
|
453
|
-
propertySchema: PropertyShape.schema.properties.description,
|
|
454
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
455
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
456
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
457
|
-
.map((values) => values.length > 0
|
|
458
|
-
? values.map((value) => Maybe.of(value))
|
|
459
|
-
: Resource.Values.fromValue({
|
|
460
|
-
focusResource: $resource,
|
|
461
|
-
propertyPath: PropertyShape.schema.properties.description.path,
|
|
462
|
-
value: Maybe.empty(),
|
|
463
|
-
})),
|
|
464
|
-
}),
|
|
465
|
-
display: $shaclPropertyFromRdf({
|
|
466
|
-
graph: _$options.graph,
|
|
467
|
-
resource: $resource,
|
|
468
|
-
propertySchema: PropertyShape.schema.properties.display,
|
|
469
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
470
|
-
.map((values) => values.length > 0
|
|
471
|
-
? values
|
|
472
|
-
: new Resource.Value({
|
|
473
|
-
dataFactory: dataFactory,
|
|
474
|
-
focusResource: $resource,
|
|
475
|
-
propertyPath: PropertyShape.schema.properties.display.path,
|
|
476
|
-
term: dataFactory.literal("false", $RdfVocabularies.xsd.boolean),
|
|
477
|
-
}).toValues())
|
|
478
|
-
.chain((values) => values.chainMap((value) => value.toBoolean())),
|
|
479
|
-
}),
|
|
480
|
-
flags: $shaclPropertyFromRdf({
|
|
481
|
-
graph: _$options.graph,
|
|
482
|
-
resource: $resource,
|
|
483
|
-
propertySchema: PropertyShape.schema.properties.flags,
|
|
484
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
485
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
486
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
487
|
-
.map((values) => values.toArray())
|
|
488
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
489
|
-
focusResource: $resource,
|
|
490
|
-
propertyPath: PropertyShape.schema.properties.flags.path,
|
|
491
|
-
value: valuesArray,
|
|
492
|
-
})),
|
|
493
|
-
}),
|
|
494
|
-
groups: $shaclPropertyFromRdf({
|
|
495
|
-
graph: _$options.graph,
|
|
496
|
-
resource: $resource,
|
|
497
|
-
propertySchema: PropertyShape.schema.properties.groups,
|
|
498
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
499
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
500
|
-
.map((values) => values.toArray())
|
|
501
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
502
|
-
focusResource: $resource,
|
|
503
|
-
propertyPath: PropertyShape.schema.properties.groups.path,
|
|
504
|
-
value: valuesArray,
|
|
505
|
-
})),
|
|
506
|
-
}),
|
|
507
|
-
hasValues: $shaclPropertyFromRdf({
|
|
508
|
-
graph: _$options.graph,
|
|
509
|
-
resource: $resource,
|
|
510
|
-
propertySchema: PropertyShape.schema.properties.hasValues,
|
|
511
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
512
|
-
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
513
|
-
switch (term.termType) {
|
|
514
|
-
case "NamedNode":
|
|
515
|
-
case "Literal":
|
|
516
|
-
return Either.of(term);
|
|
517
|
-
default:
|
|
518
|
-
return Left(new Resource.MistypedTermValueError({
|
|
519
|
-
actualValue: term,
|
|
520
|
-
expectedValueType: "(NamedNode | Literal)",
|
|
521
|
-
focusResource: $resource,
|
|
522
|
-
propertyPath: PropertyShape.schema.properties.hasValues.path,
|
|
523
|
-
}));
|
|
524
|
-
}
|
|
525
|
-
})))
|
|
526
|
-
.map((values) => values.toArray())
|
|
527
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
528
|
-
focusResource: $resource,
|
|
529
|
-
propertyPath: PropertyShape.schema.properties.hasValues.path,
|
|
530
|
-
value: valuesArray,
|
|
531
|
-
})),
|
|
532
|
-
}),
|
|
533
|
-
in_: $shaclPropertyFromRdf({
|
|
534
|
-
graph: _$options.graph,
|
|
535
|
-
resource: $resource,
|
|
536
|
-
propertySchema: PropertyShape.schema.properties.in_,
|
|
537
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
538
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
539
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
540
|
-
focusResource: $resource,
|
|
541
|
-
propertyPath: PropertyShape.schema.properties.in_.path,
|
|
542
|
-
values: valueList.toArray(),
|
|
543
|
-
})).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
544
|
-
switch (term.termType) {
|
|
545
|
-
case "NamedNode":
|
|
546
|
-
case "Literal":
|
|
547
|
-
return Either.of(term);
|
|
548
|
-
default:
|
|
549
|
-
return Left(new Resource.MistypedTermValueError({
|
|
550
|
-
actualValue: term,
|
|
551
|
-
expectedValueType: "(NamedNode | Literal)",
|
|
552
|
-
focusResource: $resource,
|
|
553
|
-
propertyPath: PropertyShape.schema.properties.in_.path,
|
|
554
|
-
}));
|
|
555
|
-
}
|
|
556
|
-
})))))
|
|
557
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
558
|
-
.map((values) => values.length > 0
|
|
559
|
-
? values.map((value) => Maybe.of(value))
|
|
560
|
-
: Resource.Values.fromValue({
|
|
561
|
-
focusResource: $resource,
|
|
562
|
-
propertyPath: PropertyShape.schema.properties.in_.path,
|
|
563
|
-
value: Maybe.empty(),
|
|
564
|
-
})),
|
|
565
|
-
}),
|
|
566
|
-
isDefinedBy: $shaclPropertyFromRdf({
|
|
567
|
-
graph: _$options.graph,
|
|
568
|
-
resource: $resource,
|
|
569
|
-
propertySchema: PropertyShape.schema.properties.isDefinedBy,
|
|
570
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
571
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
572
|
-
.map((values) => values.length > 0
|
|
573
|
-
? values.map((value) => Maybe.of(value))
|
|
574
|
-
: Resource.Values.fromValue({
|
|
575
|
-
focusResource: $resource,
|
|
576
|
-
propertyPath: PropertyShape.schema.properties.isDefinedBy.path,
|
|
577
|
-
value: Maybe.empty(),
|
|
578
|
-
})),
|
|
579
|
-
}),
|
|
580
|
-
label: $shaclPropertyFromRdf({
|
|
581
|
-
graph: _$options.graph,
|
|
582
|
-
resource: $resource,
|
|
583
|
-
propertySchema: PropertyShape.schema.properties.label,
|
|
584
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
585
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
586
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
587
|
-
.map((values) => values.length > 0
|
|
588
|
-
? values.map((value) => Maybe.of(value))
|
|
589
|
-
: Resource.Values.fromValue({
|
|
590
|
-
focusResource: $resource,
|
|
591
|
-
propertyPath: PropertyShape.schema.properties.label.path,
|
|
592
|
-
value: Maybe.empty(),
|
|
593
|
-
})),
|
|
594
|
-
}),
|
|
595
|
-
languageIn: $shaclPropertyFromRdf({
|
|
596
|
-
graph: _$options.graph,
|
|
597
|
-
resource: $resource,
|
|
598
|
-
propertySchema: PropertyShape.schema.properties.languageIn,
|
|
599
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
600
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
601
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
602
|
-
focusResource: $resource,
|
|
603
|
-
propertyPath: PropertyShape.schema.properties.languageIn.path,
|
|
604
|
-
values: valueList.toArray(),
|
|
605
|
-
}))
|
|
606
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
607
|
-
.chain((values) => values.chainMap((value) => value.toString()))))
|
|
608
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
609
|
-
.map((values) => values.length > 0
|
|
610
|
-
? values.map((value) => Maybe.of(value))
|
|
611
|
-
: Resource.Values.fromValue({
|
|
612
|
-
focusResource: $resource,
|
|
613
|
-
propertyPath: PropertyShape.schema.properties.languageIn.path,
|
|
614
|
-
value: Maybe.empty(),
|
|
615
|
-
})),
|
|
616
|
-
}),
|
|
617
|
-
maxCount: $shaclPropertyFromRdf({
|
|
618
|
-
graph: _$options.graph,
|
|
619
|
-
resource: $resource,
|
|
620
|
-
propertySchema: PropertyShape.schema.properties.maxCount,
|
|
621
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
622
|
-
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
623
|
-
.map((values) => values.length > 0
|
|
624
|
-
? values.map((value) => Maybe.of(value))
|
|
625
|
-
: Resource.Values.fromValue({
|
|
626
|
-
focusResource: $resource,
|
|
627
|
-
propertyPath: PropertyShape.schema.properties.maxCount.path,
|
|
628
|
-
value: Maybe.empty(),
|
|
629
|
-
})),
|
|
630
|
-
}),
|
|
631
|
-
maxExclusive: $shaclPropertyFromRdf({
|
|
632
|
-
graph: _$options.graph,
|
|
633
|
-
resource: $resource,
|
|
634
|
-
propertySchema: PropertyShape.schema.properties.maxExclusive,
|
|
635
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
636
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
637
|
-
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
638
|
-
.map((values) => values.length > 0
|
|
639
|
-
? values.map((value) => Maybe.of(value))
|
|
640
|
-
: Resource.Values.fromValue({
|
|
641
|
-
focusResource: $resource,
|
|
642
|
-
propertyPath: PropertyShape.schema.properties.maxExclusive.path,
|
|
643
|
-
value: Maybe.empty(),
|
|
644
|
-
})),
|
|
645
|
-
}),
|
|
646
|
-
maxInclusive: $shaclPropertyFromRdf({
|
|
647
|
-
graph: _$options.graph,
|
|
648
|
-
resource: $resource,
|
|
649
|
-
propertySchema: PropertyShape.schema.properties.maxInclusive,
|
|
650
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
651
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
652
|
-
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
653
|
-
.map((values) => values.length > 0
|
|
654
|
-
? values.map((value) => Maybe.of(value))
|
|
655
|
-
: Resource.Values.fromValue({
|
|
656
|
-
focusResource: $resource,
|
|
657
|
-
propertyPath: PropertyShape.schema.properties.maxInclusive.path,
|
|
658
|
-
value: Maybe.empty(),
|
|
659
|
-
})),
|
|
660
|
-
}),
|
|
661
|
-
maxLength: $shaclPropertyFromRdf({
|
|
662
|
-
graph: _$options.graph,
|
|
663
|
-
resource: $resource,
|
|
664
|
-
propertySchema: PropertyShape.schema.properties.maxLength,
|
|
665
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
666
|
-
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
667
|
-
.map((values) => values.length > 0
|
|
668
|
-
? values.map((value) => Maybe.of(value))
|
|
669
|
-
: Resource.Values.fromValue({
|
|
670
|
-
focusResource: $resource,
|
|
671
|
-
propertyPath: PropertyShape.schema.properties.maxLength.path,
|
|
672
|
-
value: Maybe.empty(),
|
|
673
|
-
})),
|
|
674
|
-
}),
|
|
675
|
-
minCount: $shaclPropertyFromRdf({
|
|
676
|
-
graph: _$options.graph,
|
|
677
|
-
resource: $resource,
|
|
678
|
-
propertySchema: PropertyShape.schema.properties.minCount,
|
|
679
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
680
|
-
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
681
|
-
.map((values) => values.length > 0
|
|
682
|
-
? values.map((value) => Maybe.of(value))
|
|
683
|
-
: Resource.Values.fromValue({
|
|
684
|
-
focusResource: $resource,
|
|
685
|
-
propertyPath: PropertyShape.schema.properties.minCount.path,
|
|
686
|
-
value: Maybe.empty(),
|
|
687
|
-
})),
|
|
688
|
-
}),
|
|
689
|
-
minExclusive: $shaclPropertyFromRdf({
|
|
690
|
-
graph: _$options.graph,
|
|
691
|
-
resource: $resource,
|
|
692
|
-
propertySchema: PropertyShape.schema.properties.minExclusive,
|
|
693
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
694
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
695
|
-
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
696
|
-
.map((values) => values.length > 0
|
|
697
|
-
? values.map((value) => Maybe.of(value))
|
|
698
|
-
: Resource.Values.fromValue({
|
|
699
|
-
focusResource: $resource,
|
|
700
|
-
propertyPath: PropertyShape.schema.properties.minExclusive.path,
|
|
701
|
-
value: Maybe.empty(),
|
|
702
|
-
})),
|
|
703
|
-
}),
|
|
704
|
-
minInclusive: $shaclPropertyFromRdf({
|
|
705
|
-
graph: _$options.graph,
|
|
706
|
-
resource: $resource,
|
|
707
|
-
propertySchema: PropertyShape.schema.properties.minInclusive,
|
|
708
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
709
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
710
|
-
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
711
|
-
.map((values) => values.length > 0
|
|
712
|
-
? values.map((value) => Maybe.of(value))
|
|
713
|
-
: Resource.Values.fromValue({
|
|
714
|
-
focusResource: $resource,
|
|
715
|
-
propertyPath: PropertyShape.schema.properties.minInclusive.path,
|
|
716
|
-
value: Maybe.empty(),
|
|
717
|
-
})),
|
|
718
|
-
}),
|
|
719
|
-
minLength: $shaclPropertyFromRdf({
|
|
720
|
-
graph: _$options.graph,
|
|
721
|
-
resource: $resource,
|
|
722
|
-
propertySchema: PropertyShape.schema.properties.minLength,
|
|
723
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
724
|
-
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
725
|
-
.map((values) => values.length > 0
|
|
726
|
-
? values.map((value) => Maybe.of(value))
|
|
727
|
-
: Resource.Values.fromValue({
|
|
728
|
-
focusResource: $resource,
|
|
729
|
-
propertyPath: PropertyShape.schema.properties.minLength.path,
|
|
730
|
-
value: Maybe.empty(),
|
|
731
|
-
})),
|
|
732
|
-
}),
|
|
733
|
-
mutable: $shaclPropertyFromRdf({
|
|
734
|
-
graph: _$options.graph,
|
|
735
|
-
resource: $resource,
|
|
736
|
-
propertySchema: PropertyShape.schema.properties.mutable,
|
|
737
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
738
|
-
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
739
|
-
.map((values) => values.length > 0
|
|
740
|
-
? values.map((value) => Maybe.of(value))
|
|
741
|
-
: Resource.Values.fromValue({
|
|
742
|
-
focusResource: $resource,
|
|
743
|
-
propertyPath: PropertyShape.schema.properties.mutable.path,
|
|
744
|
-
value: Maybe.empty(),
|
|
745
|
-
})),
|
|
746
|
-
}),
|
|
747
|
-
name: $shaclPropertyFromRdf({
|
|
748
|
-
graph: _$options.graph,
|
|
749
|
-
resource: $resource,
|
|
750
|
-
propertySchema: PropertyShape.schema.properties.name,
|
|
751
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
752
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
753
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
754
|
-
.map((values) => values.length > 0
|
|
755
|
-
? values.map((value) => Maybe.of(value))
|
|
756
|
-
: Resource.Values.fromValue({
|
|
757
|
-
focusResource: $resource,
|
|
758
|
-
propertyPath: PropertyShape.schema.properties.name.path,
|
|
759
|
-
value: Maybe.empty(),
|
|
760
|
-
})),
|
|
761
|
-
}),
|
|
762
|
-
node: $shaclPropertyFromRdf({
|
|
763
|
-
graph: _$options.graph,
|
|
764
|
-
resource: $resource,
|
|
765
|
-
propertySchema: PropertyShape.schema.properties.node,
|
|
766
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
767
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
768
|
-
.map((values) => values.length > 0
|
|
769
|
-
? values.map((value) => Maybe.of(value))
|
|
770
|
-
: Resource.Values.fromValue({
|
|
771
|
-
focusResource: $resource,
|
|
772
|
-
propertyPath: PropertyShape.schema.properties.node.path,
|
|
773
|
-
value: Maybe.empty(),
|
|
774
|
-
})),
|
|
775
|
-
}),
|
|
776
|
-
nodeKind: $shaclPropertyFromRdf({
|
|
777
|
-
graph: _$options.graph,
|
|
778
|
-
resource: $resource,
|
|
779
|
-
propertySchema: PropertyShape.schema.properties.nodeKind,
|
|
780
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
781
|
-
.chain((values) => values.chainMap((value) => value.toIri([
|
|
782
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
|
|
783
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrIRI"),
|
|
784
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrLiteral"),
|
|
785
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#IRI"),
|
|
786
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
|
|
787
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
|
|
788
|
-
])))
|
|
789
|
-
.map((values) => values.length > 0
|
|
790
|
-
? values.map((value) => Maybe.of(value))
|
|
791
|
-
: Resource.Values.fromValue({
|
|
792
|
-
focusResource: $resource,
|
|
793
|
-
propertyPath: PropertyShape.schema.properties.nodeKind.path,
|
|
794
|
-
value: Maybe.empty(),
|
|
795
|
-
})),
|
|
796
|
-
}),
|
|
797
|
-
not: $shaclPropertyFromRdf({
|
|
798
|
-
graph: _$options.graph,
|
|
799
|
-
resource: $resource,
|
|
800
|
-
propertySchema: PropertyShape.schema.properties.not,
|
|
801
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
802
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
803
|
-
.map((values) => values.toArray())
|
|
804
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
805
|
-
focusResource: $resource,
|
|
806
|
-
propertyPath: PropertyShape.schema.properties.not.path,
|
|
807
|
-
value: valuesArray,
|
|
808
|
-
})),
|
|
809
|
-
}),
|
|
810
|
-
or: $shaclPropertyFromRdf({
|
|
811
|
-
graph: _$options.graph,
|
|
812
|
-
resource: $resource,
|
|
813
|
-
propertySchema: PropertyShape.schema.properties.or,
|
|
814
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
815
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
816
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
817
|
-
focusResource: $resource,
|
|
818
|
-
propertyPath: PropertyShape.schema.properties.or.path,
|
|
819
|
-
values: valueList.toArray(),
|
|
820
|
-
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
821
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
822
|
-
.map((values) => values.length > 0
|
|
823
|
-
? values.map((value) => Maybe.of(value))
|
|
824
|
-
: Resource.Values.fromValue({
|
|
825
|
-
focusResource: $resource,
|
|
826
|
-
propertyPath: PropertyShape.schema.properties.or.path,
|
|
827
|
-
value: Maybe.empty(),
|
|
828
|
-
})),
|
|
829
|
-
}),
|
|
830
|
-
order: $shaclPropertyFromRdf({
|
|
831
|
-
graph: _$options.graph,
|
|
832
|
-
resource: $resource,
|
|
833
|
-
propertySchema: PropertyShape.schema.properties.order,
|
|
834
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
835
|
-
.chain((values) => values.chainMap((value) => value.toFloat()))
|
|
836
|
-
.map((values) => values.length > 0
|
|
837
|
-
? values.map((value) => Maybe.of(value))
|
|
838
|
-
: Resource.Values.fromValue({
|
|
839
|
-
focusResource: $resource,
|
|
840
|
-
propertyPath: PropertyShape.schema.properties.order.path,
|
|
841
|
-
value: Maybe.empty(),
|
|
842
|
-
})),
|
|
843
|
-
}),
|
|
844
|
-
path: $shaclPropertyFromRdf({
|
|
845
|
-
graph: _$options.graph,
|
|
846
|
-
resource: $resource,
|
|
847
|
-
propertySchema: PropertyShape.schema.properties.path,
|
|
848
|
-
typeFromRdf: (resourceValues) => $PropertyPath.fromRdfResourceValues(resourceValues, {
|
|
849
|
-
context: _$options.context,
|
|
850
|
-
graph: _$options.graph,
|
|
851
|
-
preferredLanguages: _$options.preferredLanguages,
|
|
852
|
-
resource: $resource,
|
|
853
|
-
ignoreRdfType: true,
|
|
854
|
-
propertyPath: PropertyShape.schema.properties.path.path,
|
|
855
|
-
}),
|
|
856
|
-
}),
|
|
857
|
-
patterns: $shaclPropertyFromRdf({
|
|
858
|
-
graph: _$options.graph,
|
|
859
|
-
resource: $resource,
|
|
860
|
-
propertySchema: PropertyShape.schema.properties.patterns,
|
|
861
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
862
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
863
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
864
|
-
.map((values) => values.toArray())
|
|
865
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
866
|
-
focusResource: $resource,
|
|
867
|
-
propertyPath: PropertyShape.schema.properties.patterns.path,
|
|
868
|
-
value: valuesArray,
|
|
869
|
-
})),
|
|
870
|
-
}),
|
|
871
|
-
resolve: $shaclPropertyFromRdf({
|
|
872
|
-
graph: _$options.graph,
|
|
873
|
-
resource: $resource,
|
|
874
|
-
propertySchema: PropertyShape.schema.properties.resolve,
|
|
875
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
876
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
877
|
-
.map((values) => values.length > 0
|
|
878
|
-
? values.map((value) => Maybe.of(value))
|
|
879
|
-
: Resource.Values.fromValue({
|
|
880
|
-
focusResource: $resource,
|
|
881
|
-
propertyPath: PropertyShape.schema.properties.resolve.path,
|
|
882
|
-
value: Maybe.empty(),
|
|
883
|
-
})),
|
|
884
|
-
}),
|
|
885
|
-
shaclmateName: $shaclPropertyFromRdf({
|
|
886
|
-
graph: _$options.graph,
|
|
887
|
-
resource: $resource,
|
|
888
|
-
propertySchema: PropertyShape.schema.properties.shaclmateName,
|
|
889
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
890
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
891
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
892
|
-
.map((values) => values.length > 0
|
|
893
|
-
? values.map((value) => Maybe.of(value))
|
|
894
|
-
: Resource.Values.fromValue({
|
|
895
|
-
focusResource: $resource,
|
|
896
|
-
propertyPath: PropertyShape.schema.properties.shaclmateName.path,
|
|
897
|
-
value: Maybe.empty(),
|
|
898
|
-
})),
|
|
899
|
-
}),
|
|
900
|
-
uniqueLang: $shaclPropertyFromRdf({
|
|
901
|
-
graph: _$options.graph,
|
|
902
|
-
resource: $resource,
|
|
903
|
-
propertySchema: PropertyShape.schema.properties.uniqueLang,
|
|
904
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
905
|
-
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
906
|
-
.map((values) => values.length > 0
|
|
907
|
-
? values.map((value) => Maybe.of(value))
|
|
908
|
-
: Resource.Values.fromValue({
|
|
909
|
-
focusResource: $resource,
|
|
910
|
-
propertyPath: PropertyShape.schema.properties.uniqueLang.path,
|
|
911
|
-
value: Maybe.empty(),
|
|
912
|
-
})),
|
|
913
|
-
}),
|
|
914
|
-
xone: $shaclPropertyFromRdf({
|
|
915
|
-
graph: _$options.graph,
|
|
916
|
-
resource: $resource,
|
|
917
|
-
propertySchema: PropertyShape.schema.properties.xone,
|
|
918
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
919
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
920
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
921
|
-
focusResource: $resource,
|
|
922
|
-
propertyPath: PropertyShape.schema.properties.xone.path,
|
|
923
|
-
values: valueList.toArray(),
|
|
924
|
-
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
925
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
926
|
-
.map((values) => values.length > 0
|
|
927
|
-
? values.map((value) => Maybe.of(value))
|
|
928
|
-
: Resource.Values.fromValue({
|
|
929
|
-
focusResource: $resource,
|
|
930
|
-
propertyPath: PropertyShape.schema.properties.xone.path,
|
|
931
|
-
value: Maybe.empty(),
|
|
932
|
-
})),
|
|
933
|
-
}),
|
|
934
|
-
}).chain((properties) => create(properties)));
|
|
935
|
-
};
|
|
936
|
-
PropertyShape.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyShape._fromRdfResource);
|
|
937
|
-
PropertyShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
938
|
-
.toResource()
|
|
939
|
-
.chain((resource) => PropertyShape.fromRdfResource(resource, options))));
|
|
940
|
-
PropertyShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape");
|
|
941
|
-
function isPropertyShape(object) {
|
|
942
|
-
switch (object.$type) {
|
|
943
|
-
case "PropertyShape":
|
|
944
|
-
return true;
|
|
945
|
-
default:
|
|
946
|
-
return false;
|
|
947
|
-
}
|
|
878
|
+
})(Identifier = NodeShape.Identifier || (NodeShape.Identifier = {}));
|
|
879
|
+
function isNodeShape(object) {
|
|
880
|
+
return object.$type === "NodeShape";
|
|
948
881
|
}
|
|
949
|
-
|
|
950
|
-
|
|
882
|
+
NodeShape.isNodeShape = isNodeShape;
|
|
883
|
+
NodeShape.schema = {
|
|
884
|
+
fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"),
|
|
951
885
|
properties: {
|
|
952
886
|
$identifier: {
|
|
953
887
|
kind: "Identifier",
|
|
@@ -969,6 +903,14 @@ export var PropertyShape;
|
|
|
969
903
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
|
|
970
904
|
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
971
905
|
},
|
|
906
|
+
closed: {
|
|
907
|
+
kind: "Shacl",
|
|
908
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#closed"),
|
|
909
|
+
type: {
|
|
910
|
+
kind: "Option",
|
|
911
|
+
itemType: { kind: "Boolean" },
|
|
912
|
+
},
|
|
913
|
+
},
|
|
972
914
|
comment: {
|
|
973
915
|
kind: "Shacl",
|
|
974
916
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
@@ -990,45 +932,53 @@ export var PropertyShape;
|
|
|
990
932
|
itemType: { kind: "Boolean" },
|
|
991
933
|
},
|
|
992
934
|
},
|
|
993
|
-
|
|
994
|
-
kind: "Shacl",
|
|
995
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"),
|
|
996
|
-
type: { kind: "Option", itemType: { kind: "Term" } },
|
|
997
|
-
},
|
|
998
|
-
description: {
|
|
935
|
+
discriminantValue: {
|
|
999
936
|
kind: "Shacl",
|
|
1000
|
-
path: dataFactory.namedNode("http://
|
|
937
|
+
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#discriminantValue"),
|
|
1001
938
|
type: {
|
|
1002
939
|
kind: "Option",
|
|
1003
940
|
itemType: { kind: "String" },
|
|
1004
941
|
},
|
|
1005
942
|
},
|
|
1006
|
-
|
|
943
|
+
extern: {
|
|
1007
944
|
kind: "Shacl",
|
|
1008
|
-
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#
|
|
945
|
+
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#extern"),
|
|
1009
946
|
type: {
|
|
1010
|
-
kind: "
|
|
947
|
+
kind: "Option",
|
|
1011
948
|
itemType: { kind: "Boolean" },
|
|
1012
|
-
defaultValue: false,
|
|
1013
949
|
},
|
|
1014
950
|
},
|
|
1015
951
|
flags: {
|
|
1016
952
|
kind: "Shacl",
|
|
1017
953
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
|
|
1018
|
-
type: {
|
|
954
|
+
type: {
|
|
955
|
+
kind: "Option",
|
|
956
|
+
itemType: { kind: "String" },
|
|
957
|
+
},
|
|
1019
958
|
},
|
|
1020
|
-
|
|
959
|
+
fromRdfType: {
|
|
1021
960
|
kind: "Shacl",
|
|
1022
|
-
path: dataFactory.namedNode("http://
|
|
961
|
+
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#fromRdfType"),
|
|
962
|
+
type: { kind: "Option", itemType: { kind: "Iri" } },
|
|
963
|
+
},
|
|
964
|
+
hasValues: {
|
|
965
|
+
kind: "Shacl",
|
|
966
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
|
|
1023
967
|
type: {
|
|
1024
968
|
kind: "Set",
|
|
1025
|
-
itemType: { kind: "
|
|
969
|
+
itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
|
|
1026
970
|
},
|
|
1027
971
|
},
|
|
1028
|
-
|
|
972
|
+
ignoredProperties: {
|
|
1029
973
|
kind: "Shacl",
|
|
1030
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#
|
|
1031
|
-
type: {
|
|
974
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#ignoredProperties"),
|
|
975
|
+
type: {
|
|
976
|
+
kind: "Option",
|
|
977
|
+
itemType: {
|
|
978
|
+
kind: "List",
|
|
979
|
+
itemType: { kind: "Iri" },
|
|
980
|
+
},
|
|
981
|
+
},
|
|
1032
982
|
},
|
|
1033
983
|
in_: {
|
|
1034
984
|
kind: "Shacl",
|
|
@@ -1037,7 +987,10 @@ export var PropertyShape;
|
|
|
1037
987
|
kind: "Option",
|
|
1038
988
|
itemType: {
|
|
1039
989
|
kind: "List",
|
|
1040
|
-
itemType: {
|
|
990
|
+
itemType: {
|
|
991
|
+
kind: "Term",
|
|
992
|
+
types: ["NamedNode", "Literal"],
|
|
993
|
+
},
|
|
1041
994
|
},
|
|
1042
995
|
},
|
|
1043
996
|
},
|
|
@@ -1068,14 +1021,6 @@ export var PropertyShape;
|
|
|
1068
1021
|
},
|
|
1069
1022
|
},
|
|
1070
1023
|
},
|
|
1071
|
-
maxCount: {
|
|
1072
|
-
kind: "Shacl",
|
|
1073
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
|
|
1074
|
-
type: {
|
|
1075
|
-
kind: "Option",
|
|
1076
|
-
itemType: { kind: "BigInt" },
|
|
1077
|
-
},
|
|
1078
|
-
},
|
|
1079
1024
|
maxExclusive: {
|
|
1080
1025
|
kind: "Shacl",
|
|
1081
1026
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
|
|
@@ -1100,12 +1045,12 @@ export var PropertyShape;
|
|
|
1100
1045
|
itemType: { kind: "BigInt" },
|
|
1101
1046
|
},
|
|
1102
1047
|
},
|
|
1103
|
-
|
|
1048
|
+
message: {
|
|
1104
1049
|
kind: "Shacl",
|
|
1105
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#
|
|
1050
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#message"),
|
|
1106
1051
|
type: {
|
|
1107
1052
|
kind: "Option",
|
|
1108
|
-
itemType: { kind: "
|
|
1053
|
+
itemType: { kind: "String" },
|
|
1109
1054
|
},
|
|
1110
1055
|
},
|
|
1111
1056
|
minExclusive: {
|
|
@@ -1140,14 +1085,6 @@ export var PropertyShape;
|
|
|
1140
1085
|
itemType: { kind: "Boolean" },
|
|
1141
1086
|
},
|
|
1142
1087
|
},
|
|
1143
|
-
name: {
|
|
1144
|
-
kind: "Shacl",
|
|
1145
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#name"),
|
|
1146
|
-
type: {
|
|
1147
|
-
kind: "Option",
|
|
1148
|
-
itemType: { kind: "String" },
|
|
1149
|
-
},
|
|
1150
|
-
},
|
|
1151
1088
|
node: {
|
|
1152
1089
|
kind: "Shacl",
|
|
1153
1090
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
|
|
@@ -1193,29 +1130,40 @@ export var PropertyShape;
|
|
|
1193
1130
|
},
|
|
1194
1131
|
},
|
|
1195
1132
|
},
|
|
1196
|
-
|
|
1133
|
+
pattern: {
|
|
1197
1134
|
kind: "Shacl",
|
|
1198
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#
|
|
1199
|
-
type: {
|
|
1135
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
|
|
1136
|
+
type: {
|
|
1137
|
+
kind: "Option",
|
|
1138
|
+
itemType: { kind: "String" },
|
|
1139
|
+
},
|
|
1200
1140
|
},
|
|
1201
|
-
|
|
1141
|
+
properties: {
|
|
1202
1142
|
kind: "Shacl",
|
|
1203
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#
|
|
1204
|
-
|
|
1205
|
-
|
|
1143
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#property"),
|
|
1144
|
+
type: {
|
|
1145
|
+
kind: "Set",
|
|
1146
|
+
itemType: { kind: "Identifier" },
|
|
1206
1147
|
},
|
|
1207
1148
|
},
|
|
1208
|
-
|
|
1149
|
+
rdfType: {
|
|
1209
1150
|
kind: "Shacl",
|
|
1210
|
-
path: dataFactory.namedNode("http://
|
|
1211
|
-
type: { kind: "
|
|
1151
|
+
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#rdfType"),
|
|
1152
|
+
type: { kind: "Option", itemType: { kind: "Iri" } },
|
|
1212
1153
|
},
|
|
1213
|
-
|
|
1154
|
+
severity: {
|
|
1214
1155
|
kind: "Shacl",
|
|
1215
|
-
path: dataFactory.namedNode("http://
|
|
1156
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#severity"),
|
|
1216
1157
|
type: {
|
|
1217
1158
|
kind: "Option",
|
|
1218
|
-
itemType: {
|
|
1159
|
+
itemType: {
|
|
1160
|
+
kind: "Iri",
|
|
1161
|
+
in: [
|
|
1162
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
|
|
1163
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
|
|
1164
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
|
|
1165
|
+
],
|
|
1166
|
+
},
|
|
1219
1167
|
},
|
|
1220
1168
|
},
|
|
1221
1169
|
shaclmateName: {
|
|
@@ -1226,14 +1174,49 @@ export var PropertyShape;
|
|
|
1226
1174
|
itemType: { kind: "String" },
|
|
1227
1175
|
},
|
|
1228
1176
|
},
|
|
1229
|
-
|
|
1177
|
+
subClassOf: {
|
|
1230
1178
|
kind: "Shacl",
|
|
1231
|
-
path:
|
|
1179
|
+
path: $RdfVocabularies.rdfs.subClassOf,
|
|
1180
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
1181
|
+
},
|
|
1182
|
+
targetClasses: {
|
|
1183
|
+
kind: "Shacl",
|
|
1184
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetClass"),
|
|
1185
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
1186
|
+
},
|
|
1187
|
+
targetNodes: {
|
|
1188
|
+
kind: "Shacl",
|
|
1189
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetNode"),
|
|
1232
1190
|
type: {
|
|
1233
|
-
kind: "
|
|
1234
|
-
itemType: { kind: "
|
|
1191
|
+
kind: "Set",
|
|
1192
|
+
itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
|
|
1235
1193
|
},
|
|
1236
1194
|
},
|
|
1195
|
+
targetObjectsOf: {
|
|
1196
|
+
kind: "Shacl",
|
|
1197
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetObjectsOf"),
|
|
1198
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
1199
|
+
},
|
|
1200
|
+
targetSubjectsOf: {
|
|
1201
|
+
kind: "Shacl",
|
|
1202
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetSubjectsOf"),
|
|
1203
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
1204
|
+
},
|
|
1205
|
+
toRdfTypes: {
|
|
1206
|
+
kind: "Shacl",
|
|
1207
|
+
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#toRdfType"),
|
|
1208
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
1209
|
+
},
|
|
1210
|
+
tsImports: {
|
|
1211
|
+
kind: "Shacl",
|
|
1212
|
+
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsImport"),
|
|
1213
|
+
type: { kind: "Set", itemType: { kind: "String" } },
|
|
1214
|
+
},
|
|
1215
|
+
types: {
|
|
1216
|
+
kind: "Shacl",
|
|
1217
|
+
path: $RdfVocabularies.rdf.type,
|
|
1218
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
1219
|
+
},
|
|
1237
1220
|
xone: {
|
|
1238
1221
|
kind: "Shacl",
|
|
1239
1222
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
|
|
@@ -1247,11 +1230,11 @@ export var PropertyShape;
|
|
|
1247
1230
|
},
|
|
1248
1231
|
},
|
|
1249
1232
|
};
|
|
1250
|
-
|
|
1233
|
+
NodeShape._toRdfResource = (parameters) => {
|
|
1251
1234
|
if (!parameters.ignoreRdfType) {
|
|
1252
|
-
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#
|
|
1235
|
+
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape"), parameters.graph);
|
|
1253
1236
|
}
|
|
1254
|
-
parameters.resource.add(
|
|
1237
|
+
parameters.resource.add(NodeShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
|
|
1255
1238
|
value.length > 0
|
|
1256
1239
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1257
1240
|
if (itemIndex === 0) {
|
|
@@ -1273,29 +1256,35 @@ export var PropertyShape;
|
|
|
1273
1256
|
}).listResource.identifier
|
|
1274
1257
|
: $RdfVocabularies.rdf.nil,
|
|
1275
1258
|
]), parameters.graph);
|
|
1276
|
-
parameters.resource.add(
|
|
1277
|
-
parameters.resource.add(
|
|
1259
|
+
parameters.resource.add(NodeShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
|
|
1260
|
+
parameters.resource.add(NodeShape.schema.properties.closed.path, parameters.object.closed
|
|
1261
|
+
.toList()
|
|
1262
|
+
.flatMap((value) => [
|
|
1263
|
+
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
1264
|
+
]), parameters.graph);
|
|
1265
|
+
parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
|
|
1278
1266
|
.toList()
|
|
1279
1267
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1280
|
-
parameters.resource.add(
|
|
1281
|
-
parameters.resource.add(
|
|
1268
|
+
parameters.resource.add(NodeShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
|
|
1269
|
+
parameters.resource.add(NodeShape.schema.properties.deactivated.path, parameters.object.deactivated
|
|
1282
1270
|
.toList()
|
|
1283
1271
|
.flatMap((value) => [
|
|
1284
1272
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
1285
1273
|
]), parameters.graph);
|
|
1286
|
-
parameters.resource.add(
|
|
1287
|
-
parameters.resource.add(PropertyShape.schema.properties.description.path, parameters.object.description
|
|
1274
|
+
parameters.resource.add(NodeShape.schema.properties.discriminantValue.path, parameters.object.discriminantValue
|
|
1288
1275
|
.toList()
|
|
1289
1276
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1290
|
-
parameters.resource.add(
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
parameters.resource.add(
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
parameters.resource.add(
|
|
1277
|
+
parameters.resource.add(NodeShape.schema.properties.extern.path, parameters.object.extern
|
|
1278
|
+
.toList()
|
|
1279
|
+
.flatMap((value) => [
|
|
1280
|
+
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
1281
|
+
]), parameters.graph);
|
|
1282
|
+
parameters.resource.add(NodeShape.schema.properties.flags.path, parameters.object.flags
|
|
1283
|
+
.toList()
|
|
1284
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1285
|
+
parameters.resource.add(NodeShape.schema.properties.fromRdfType.path, parameters.object.fromRdfType.toList(), parameters.graph);
|
|
1286
|
+
parameters.resource.add(NodeShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
|
|
1287
|
+
parameters.resource.add(NodeShape.schema.properties.ignoredProperties.path, parameters.object.ignoredProperties.toList().flatMap((value) => [
|
|
1299
1288
|
value.length > 0
|
|
1300
1289
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1301
1290
|
if (itemIndex === 0) {
|
|
@@ -1317,11 +1306,33 @@ export var PropertyShape;
|
|
|
1317
1306
|
}).listResource.identifier
|
|
1318
1307
|
: $RdfVocabularies.rdf.nil,
|
|
1319
1308
|
]), parameters.graph);
|
|
1320
|
-
parameters.resource.add(
|
|
1321
|
-
|
|
1309
|
+
parameters.resource.add(NodeShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
|
|
1310
|
+
value.length > 0
|
|
1311
|
+
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1312
|
+
if (itemIndex === 0) {
|
|
1313
|
+
currentSubListResource = listResource;
|
|
1314
|
+
}
|
|
1315
|
+
else {
|
|
1316
|
+
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
1317
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
1318
|
+
currentSubListResource = newSubListResource;
|
|
1319
|
+
}
|
|
1320
|
+
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
1321
|
+
if (itemIndex + 1 === list.length) {
|
|
1322
|
+
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
1323
|
+
}
|
|
1324
|
+
return { currentSubListResource, listResource };
|
|
1325
|
+
}, {
|
|
1326
|
+
currentSubListResource: null,
|
|
1327
|
+
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
1328
|
+
}).listResource.identifier
|
|
1329
|
+
: $RdfVocabularies.rdf.nil,
|
|
1330
|
+
]), parameters.graph);
|
|
1331
|
+
parameters.resource.add(NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
|
|
1332
|
+
parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
|
|
1322
1333
|
.toList()
|
|
1323
1334
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1324
|
-
parameters.resource.add(
|
|
1335
|
+
parameters.resource.add(NodeShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
|
|
1325
1336
|
value.length > 0
|
|
1326
1337
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1327
1338
|
if (itemIndex === 0) {
|
|
@@ -1343,42 +1354,32 @@ export var PropertyShape;
|
|
|
1343
1354
|
}).listResource.identifier
|
|
1344
1355
|
: $RdfVocabularies.rdf.nil,
|
|
1345
1356
|
]), parameters.graph);
|
|
1346
|
-
parameters.resource.add(
|
|
1357
|
+
parameters.resource.add(NodeShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
|
|
1358
|
+
parameters.resource.add(NodeShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
|
|
1359
|
+
parameters.resource.add(NodeShape.schema.properties.maxLength.path, parameters.object.maxLength
|
|
1347
1360
|
.toList()
|
|
1348
1361
|
.flatMap((value) => [
|
|
1349
1362
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
1350
1363
|
]), parameters.graph);
|
|
1351
|
-
parameters.resource.add(
|
|
1352
|
-
parameters.resource.add(PropertyShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
|
|
1353
|
-
parameters.resource.add(PropertyShape.schema.properties.maxLength.path, parameters.object.maxLength
|
|
1364
|
+
parameters.resource.add(NodeShape.schema.properties.message.path, parameters.object.message
|
|
1354
1365
|
.toList()
|
|
1355
|
-
.flatMap((value) => [
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
parameters.resource.add(
|
|
1359
|
-
.toList()
|
|
1360
|
-
.flatMap((value) => [
|
|
1361
|
-
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
1362
|
-
]), parameters.graph);
|
|
1363
|
-
parameters.resource.add(PropertyShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
|
|
1364
|
-
parameters.resource.add(PropertyShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
|
|
1365
|
-
parameters.resource.add(PropertyShape.schema.properties.minLength.path, parameters.object.minLength
|
|
1366
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1367
|
+
parameters.resource.add(NodeShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
|
|
1368
|
+
parameters.resource.add(NodeShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
|
|
1369
|
+
parameters.resource.add(NodeShape.schema.properties.minLength.path, parameters.object.minLength
|
|
1366
1370
|
.toList()
|
|
1367
1371
|
.flatMap((value) => [
|
|
1368
1372
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
1369
1373
|
]), parameters.graph);
|
|
1370
|
-
parameters.resource.add(
|
|
1374
|
+
parameters.resource.add(NodeShape.schema.properties.mutable.path, parameters.object.mutable
|
|
1371
1375
|
.toList()
|
|
1372
1376
|
.flatMap((value) => [
|
|
1373
1377
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
1374
1378
|
]), parameters.graph);
|
|
1375
|
-
parameters.resource.add(
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
parameters.resource.add(
|
|
1379
|
-
parameters.resource.add(PropertyShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
|
|
1380
|
-
parameters.resource.add(PropertyShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
|
|
1381
|
-
parameters.resource.add(PropertyShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
|
|
1379
|
+
parameters.resource.add(NodeShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
|
|
1380
|
+
parameters.resource.add(NodeShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
|
|
1381
|
+
parameters.resource.add(NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
|
|
1382
|
+
parameters.resource.add(NodeShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
|
|
1382
1383
|
value.length > 0
|
|
1383
1384
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1384
1385
|
if (itemIndex === 0) {
|
|
@@ -1400,30 +1401,26 @@ export var PropertyShape;
|
|
|
1400
1401
|
}).listResource.identifier
|
|
1401
1402
|
: $RdfVocabularies.rdf.nil,
|
|
1402
1403
|
]), parameters.graph);
|
|
1403
|
-
parameters.resource.add(
|
|
1404
|
-
.toList()
|
|
1405
|
-
.flatMap((value) => [
|
|
1406
|
-
$literalFactory.number(value, $RdfVocabularies.xsd.double),
|
|
1407
|
-
]), parameters.graph);
|
|
1408
|
-
parameters.resource.add(PropertyShape.schema.properties.path.path, [
|
|
1409
|
-
$PropertyPath.toRdfResource(parameters.object.path, {
|
|
1410
|
-
graph: parameters.graph,
|
|
1411
|
-
resourceSet: parameters.resourceSet,
|
|
1412
|
-
}).identifier,
|
|
1413
|
-
], parameters.graph);
|
|
1414
|
-
parameters.resource.add(PropertyShape.schema.properties.patterns.path, parameters.object.patterns.flatMap((item) => [
|
|
1415
|
-
$literalFactory.string(item),
|
|
1416
|
-
]), parameters.graph);
|
|
1417
|
-
parameters.resource.add(PropertyShape.schema.properties.resolve.path, parameters.object.resolve.toList(), parameters.graph);
|
|
1418
|
-
parameters.resource.add(PropertyShape.schema.properties.shaclmateName.path, parameters.object.shaclmateName
|
|
1404
|
+
parameters.resource.add(NodeShape.schema.properties.pattern.path, parameters.object.pattern
|
|
1419
1405
|
.toList()
|
|
1420
1406
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1421
|
-
parameters.resource.add(
|
|
1407
|
+
parameters.resource.add(NodeShape.schema.properties.properties.path, parameters.object.properties.flatMap((item) => [item]), parameters.graph);
|
|
1408
|
+
parameters.resource.add(NodeShape.schema.properties.rdfType.path, parameters.object.rdfType.toList(), parameters.graph);
|
|
1409
|
+
parameters.resource.add(NodeShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
|
|
1410
|
+
parameters.resource.add(NodeShape.schema.properties.shaclmateName.path, parameters.object.shaclmateName
|
|
1422
1411
|
.toList()
|
|
1423
|
-
.flatMap((value) => [
|
|
1424
|
-
|
|
1412
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1413
|
+
parameters.resource.add(NodeShape.schema.properties.subClassOf.path, parameters.object.subClassOf.flatMap((item) => [item]), parameters.graph);
|
|
1414
|
+
parameters.resource.add(NodeShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
|
|
1415
|
+
parameters.resource.add(NodeShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
|
|
1416
|
+
parameters.resource.add(NodeShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
|
|
1417
|
+
parameters.resource.add(NodeShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
|
|
1418
|
+
parameters.resource.add(NodeShape.schema.properties.toRdfTypes.path, parameters.object.toRdfTypes.flatMap((item) => [item]), parameters.graph);
|
|
1419
|
+
parameters.resource.add(NodeShape.schema.properties.tsImports.path, parameters.object.tsImports.flatMap((item) => [
|
|
1420
|
+
$literalFactory.string(item),
|
|
1425
1421
|
]), parameters.graph);
|
|
1426
|
-
parameters.resource.add(
|
|
1422
|
+
parameters.resource.add(NodeShape.schema.properties.types.path, parameters.object.types.flatMap((item) => [item]), parameters.graph);
|
|
1423
|
+
parameters.resource.add(NodeShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
|
|
1427
1424
|
value.length > 0
|
|
1428
1425
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
1429
1426
|
if (itemIndex === 0) {
|
|
@@ -1447,104 +1444,81 @@ export var PropertyShape;
|
|
|
1447
1444
|
]), parameters.graph);
|
|
1448
1445
|
return parameters.resource;
|
|
1449
1446
|
};
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
(function (PropertyGroup) {
|
|
1470
|
-
function create(parameters) {
|
|
1471
|
-
return $sequenceRecord({
|
|
1472
|
-
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
1473
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
|
|
1474
|
-
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
|
|
1475
|
-
}).map((properties) => $monkeyPatchObject({ ...properties, $type: "PropertyGroup" }, { $toString }));
|
|
1476
|
-
}
|
|
1477
|
-
PropertyGroup.create = create;
|
|
1447
|
+
NodeShape.toRdfResource = $wrap_ToRdfResourceFunction(NodeShape._toRdfResource);
|
|
1448
|
+
NodeShape.$toString = (_nodeShape) => `NodeShape(${JSON.stringify(NodeShape.toStringRecord(_nodeShape))})`;
|
|
1449
|
+
NodeShape.toStringRecord = (_nodeShape) => $compactRecord({
|
|
1450
|
+
$identifier: _nodeShape.$identifier().toString(),
|
|
1451
|
+
label: _nodeShape.label.map((item) => item.toString()).extract(),
|
|
1452
|
+
shaclmateName: _nodeShape.shaclmateName
|
|
1453
|
+
.map((item) => item.toString())
|
|
1454
|
+
.extract(),
|
|
1455
|
+
});
|
|
1456
|
+
})(NodeShape || (NodeShape = {}));
|
|
1457
|
+
export var Ontology;
|
|
1458
|
+
(function (Ontology) {
|
|
1459
|
+
Ontology.create = (parameters) => $sequenceRecord({
|
|
1460
|
+
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
1461
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1462
|
+
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1463
|
+
})
|
|
1464
|
+
.map((properties) => ({ ...properties, $type: "Ontology" }))
|
|
1465
|
+
.map((object) => $monkeyPatchObject(object, { $toString: Ontology.$toString }));
|
|
1478
1466
|
function createUnsafe(parameters) {
|
|
1479
|
-
return create(parameters).unsafeCoerce();
|
|
1467
|
+
return Ontology.create(parameters).unsafeCoerce();
|
|
1480
1468
|
}
|
|
1481
|
-
|
|
1469
|
+
Ontology.createUnsafe = createUnsafe;
|
|
1470
|
+
Ontology._fromRdfResource = ($resource, _$options) => (!_$options.ignoreRdfType
|
|
1471
|
+
? $ensureRdfResourceType($resource, [Ontology.schema.fromRdfType], {
|
|
1472
|
+
graph: _$options.graph,
|
|
1473
|
+
})
|
|
1474
|
+
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
1475
|
+
$identifier: $identifierFromRdfResourceValues(new Resource.Value({
|
|
1476
|
+
dataFactory: dataFactory,
|
|
1477
|
+
focusResource: $resource,
|
|
1478
|
+
propertyPath: $RdfVocabularies.rdf.subject,
|
|
1479
|
+
term: $resource.identifier,
|
|
1480
|
+
}).toValues(), {
|
|
1481
|
+
context: _$options.context,
|
|
1482
|
+
graph: _$options.graph,
|
|
1483
|
+
focusResource: $resource,
|
|
1484
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1485
|
+
propertyPath: $RdfVocabularies.rdf.subject,
|
|
1486
|
+
schema: Ontology.schema.properties.$identifier.type,
|
|
1487
|
+
}).chain((values) => values.head()),
|
|
1488
|
+
comment: $shaclPropertyFromRdf({
|
|
1489
|
+
context: _$options.context,
|
|
1490
|
+
graph: _$options.graph,
|
|
1491
|
+
focusResource: $resource,
|
|
1492
|
+
ignoreRdfType: true,
|
|
1493
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1494
|
+
propertySchema: Ontology.schema.properties.comment,
|
|
1495
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
1496
|
+
}),
|
|
1497
|
+
label: $shaclPropertyFromRdf({
|
|
1498
|
+
context: _$options.context,
|
|
1499
|
+
graph: _$options.graph,
|
|
1500
|
+
focusResource: $resource,
|
|
1501
|
+
ignoreRdfType: true,
|
|
1502
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1503
|
+
propertySchema: Ontology.schema.properties.label,
|
|
1504
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
1505
|
+
}),
|
|
1506
|
+
}).chain((properties) => Ontology.create(properties)));
|
|
1507
|
+
Ontology.fromRdfResource = $wrap_FromRdfResourceFunction(Ontology._fromRdfResource);
|
|
1508
|
+
Ontology.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
1509
|
+
.toResource()
|
|
1510
|
+
.chain((resource) => Ontology.fromRdfResource(resource, options)));
|
|
1482
1511
|
let Identifier;
|
|
1483
1512
|
(function (Identifier) {
|
|
1484
1513
|
Identifier.parse = $parseIdentifier;
|
|
1485
1514
|
Identifier.stringify = NTriplesTerm.stringify;
|
|
1486
|
-
})(Identifier =
|
|
1487
|
-
|
|
1488
|
-
return
|
|
1489
|
-
? $ensureRdfResourceType($resource, [PropertyGroup.fromRdfType], {
|
|
1490
|
-
graph: _$options.graph,
|
|
1491
|
-
})
|
|
1492
|
-
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
1493
|
-
$identifier: Right(new Resource.Value({
|
|
1494
|
-
dataFactory: dataFactory,
|
|
1495
|
-
focusResource: $resource,
|
|
1496
|
-
propertyPath: $RdfVocabularies.rdf.subject,
|
|
1497
|
-
term: $resource.identifier,
|
|
1498
|
-
}).toValues())
|
|
1499
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1500
|
-
.chain((values) => values.head()),
|
|
1501
|
-
comment: $shaclPropertyFromRdf({
|
|
1502
|
-
graph: _$options.graph,
|
|
1503
|
-
resource: $resource,
|
|
1504
|
-
propertySchema: PropertyGroup.schema.properties.comment,
|
|
1505
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1506
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1507
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1508
|
-
.map((values) => values.length > 0
|
|
1509
|
-
? values.map((value) => Maybe.of(value))
|
|
1510
|
-
: Resource.Values.fromValue({
|
|
1511
|
-
focusResource: $resource,
|
|
1512
|
-
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
1513
|
-
value: Maybe.empty(),
|
|
1514
|
-
})),
|
|
1515
|
-
}),
|
|
1516
|
-
label: $shaclPropertyFromRdf({
|
|
1517
|
-
graph: _$options.graph,
|
|
1518
|
-
resource: $resource,
|
|
1519
|
-
propertySchema: PropertyGroup.schema.properties.label,
|
|
1520
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1521
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1522
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1523
|
-
.map((values) => values.length > 0
|
|
1524
|
-
? values.map((value) => Maybe.of(value))
|
|
1525
|
-
: Resource.Values.fromValue({
|
|
1526
|
-
focusResource: $resource,
|
|
1527
|
-
propertyPath: PropertyShape.schema.properties.label.path,
|
|
1528
|
-
value: Maybe.empty(),
|
|
1529
|
-
})),
|
|
1530
|
-
}),
|
|
1531
|
-
}).chain((properties) => create(properties)));
|
|
1532
|
-
};
|
|
1533
|
-
PropertyGroup.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyGroup._fromRdfResource);
|
|
1534
|
-
PropertyGroup.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
1535
|
-
.toResource()
|
|
1536
|
-
.chain((resource) => PropertyGroup.fromRdfResource(resource, options))));
|
|
1537
|
-
PropertyGroup.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup");
|
|
1538
|
-
function isPropertyGroup(object) {
|
|
1539
|
-
switch (object.$type) {
|
|
1540
|
-
case "PropertyGroup":
|
|
1541
|
-
return true;
|
|
1542
|
-
default:
|
|
1543
|
-
return false;
|
|
1544
|
-
}
|
|
1515
|
+
})(Identifier = Ontology.Identifier || (Ontology.Identifier = {}));
|
|
1516
|
+
function isOntology(object) {
|
|
1517
|
+
return object.$type === "Ontology";
|
|
1545
1518
|
}
|
|
1546
|
-
|
|
1547
|
-
|
|
1519
|
+
Ontology.isOntology = isOntology;
|
|
1520
|
+
Ontology.schema = {
|
|
1521
|
+
fromRdfType: dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"),
|
|
1548
1522
|
properties: {
|
|
1549
1523
|
$identifier: {
|
|
1550
1524
|
kind: "Identifier",
|
|
@@ -1568,111 +1542,90 @@ export var PropertyGroup;
|
|
|
1568
1542
|
},
|
|
1569
1543
|
},
|
|
1570
1544
|
};
|
|
1571
|
-
|
|
1545
|
+
Ontology._toRdfResource = (parameters) => {
|
|
1572
1546
|
if (!parameters.ignoreRdfType) {
|
|
1573
|
-
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/
|
|
1547
|
+
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology"), parameters.graph);
|
|
1574
1548
|
}
|
|
1575
|
-
parameters.resource.add(
|
|
1549
|
+
parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
|
|
1576
1550
|
.toList()
|
|
1577
1551
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1578
|
-
parameters.resource.add(
|
|
1552
|
+
parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
|
|
1579
1553
|
.toList()
|
|
1580
1554
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1581
1555
|
return parameters.resource;
|
|
1582
1556
|
};
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
(
|
|
1598
|
-
|
|
1599
|
-
return $sequenceRecord({
|
|
1600
|
-
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
1601
|
-
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.comment.type, value)),
|
|
1602
|
-
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.label.type, value)),
|
|
1603
|
-
}).map((properties) => $monkeyPatchObject({ ...properties, $type: "Ontology" }, { $toString }));
|
|
1604
|
-
}
|
|
1605
|
-
Ontology.create = create;
|
|
1557
|
+
Ontology.toRdfResource = $wrap_ToRdfResourceFunction(Ontology._toRdfResource);
|
|
1558
|
+
Ontology.$toString = (_ontology) => `Ontology(${JSON.stringify(Ontology.toStringRecord(_ontology))})`;
|
|
1559
|
+
Ontology.toStringRecord = (_ontology) => $compactRecord({
|
|
1560
|
+
$identifier: _ontology.$identifier().toString(),
|
|
1561
|
+
label: _ontology.label.map((item) => item.toString()).extract(),
|
|
1562
|
+
});
|
|
1563
|
+
})(Ontology || (Ontology = {}));
|
|
1564
|
+
export var PropertyGroup;
|
|
1565
|
+
(function (PropertyGroup) {
|
|
1566
|
+
PropertyGroup.create = (parameters) => $sequenceRecord({
|
|
1567
|
+
$identifier: $convertToIdentifierProperty(parameters?.$identifier),
|
|
1568
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters?.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1569
|
+
label: $convertToMaybe($identityConversionFunction)(parameters?.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1570
|
+
})
|
|
1571
|
+
.map((properties) => ({ ...properties, $type: "PropertyGroup" }))
|
|
1572
|
+
.map((object) => $monkeyPatchObject(object, { $toString: PropertyGroup.$toString }));
|
|
1606
1573
|
function createUnsafe(parameters) {
|
|
1607
|
-
return create(parameters).unsafeCoerce();
|
|
1574
|
+
return PropertyGroup.create(parameters).unsafeCoerce();
|
|
1608
1575
|
}
|
|
1609
|
-
|
|
1576
|
+
PropertyGroup.createUnsafe = createUnsafe;
|
|
1577
|
+
PropertyGroup._fromRdfResource = ($resource, _$options) => (!_$options.ignoreRdfType
|
|
1578
|
+
? $ensureRdfResourceType($resource, [PropertyGroup.schema.fromRdfType], {
|
|
1579
|
+
graph: _$options.graph,
|
|
1580
|
+
})
|
|
1581
|
+
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
1582
|
+
$identifier: $identifierFromRdfResourceValues(new Resource.Value({
|
|
1583
|
+
dataFactory: dataFactory,
|
|
1584
|
+
focusResource: $resource,
|
|
1585
|
+
propertyPath: $RdfVocabularies.rdf.subject,
|
|
1586
|
+
term: $resource.identifier,
|
|
1587
|
+
}).toValues(), {
|
|
1588
|
+
context: _$options.context,
|
|
1589
|
+
graph: _$options.graph,
|
|
1590
|
+
focusResource: $resource,
|
|
1591
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1592
|
+
propertyPath: $RdfVocabularies.rdf.subject,
|
|
1593
|
+
schema: PropertyGroup.schema.properties.$identifier.type,
|
|
1594
|
+
}).chain((values) => values.head()),
|
|
1595
|
+
comment: $shaclPropertyFromRdf({
|
|
1596
|
+
context: _$options.context,
|
|
1597
|
+
graph: _$options.graph,
|
|
1598
|
+
focusResource: $resource,
|
|
1599
|
+
ignoreRdfType: true,
|
|
1600
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1601
|
+
propertySchema: PropertyGroup.schema.properties.comment,
|
|
1602
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
1603
|
+
}),
|
|
1604
|
+
label: $shaclPropertyFromRdf({
|
|
1605
|
+
context: _$options.context,
|
|
1606
|
+
graph: _$options.graph,
|
|
1607
|
+
focusResource: $resource,
|
|
1608
|
+
ignoreRdfType: true,
|
|
1609
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1610
|
+
propertySchema: PropertyGroup.schema.properties.label,
|
|
1611
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
1612
|
+
}),
|
|
1613
|
+
}).chain((properties) => PropertyGroup.create(properties)));
|
|
1614
|
+
PropertyGroup.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyGroup._fromRdfResource);
|
|
1615
|
+
PropertyGroup.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
1616
|
+
.toResource()
|
|
1617
|
+
.chain((resource) => PropertyGroup.fromRdfResource(resource, options)));
|
|
1610
1618
|
let Identifier;
|
|
1611
1619
|
(function (Identifier) {
|
|
1612
1620
|
Identifier.parse = $parseIdentifier;
|
|
1613
1621
|
Identifier.stringify = NTriplesTerm.stringify;
|
|
1614
|
-
})(Identifier =
|
|
1615
|
-
|
|
1616
|
-
return
|
|
1617
|
-
? $ensureRdfResourceType($resource, [Ontology.fromRdfType], {
|
|
1618
|
-
graph: _$options.graph,
|
|
1619
|
-
})
|
|
1620
|
-
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
1621
|
-
$identifier: Right(new Resource.Value({
|
|
1622
|
-
dataFactory: dataFactory,
|
|
1623
|
-
focusResource: $resource,
|
|
1624
|
-
propertyPath: $RdfVocabularies.rdf.subject,
|
|
1625
|
-
term: $resource.identifier,
|
|
1626
|
-
}).toValues())
|
|
1627
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1628
|
-
.chain((values) => values.head()),
|
|
1629
|
-
comment: $shaclPropertyFromRdf({
|
|
1630
|
-
graph: _$options.graph,
|
|
1631
|
-
resource: $resource,
|
|
1632
|
-
propertySchema: Ontology.schema.properties.comment,
|
|
1633
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1634
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1635
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1636
|
-
.map((values) => values.length > 0
|
|
1637
|
-
? values.map((value) => Maybe.of(value))
|
|
1638
|
-
: Resource.Values.fromValue({
|
|
1639
|
-
focusResource: $resource,
|
|
1640
|
-
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
1641
|
-
value: Maybe.empty(),
|
|
1642
|
-
})),
|
|
1643
|
-
}),
|
|
1644
|
-
label: $shaclPropertyFromRdf({
|
|
1645
|
-
graph: _$options.graph,
|
|
1646
|
-
resource: $resource,
|
|
1647
|
-
propertySchema: Ontology.schema.properties.label,
|
|
1648
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1649
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1650
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1651
|
-
.map((values) => values.length > 0
|
|
1652
|
-
? values.map((value) => Maybe.of(value))
|
|
1653
|
-
: Resource.Values.fromValue({
|
|
1654
|
-
focusResource: $resource,
|
|
1655
|
-
propertyPath: PropertyShape.schema.properties.label.path,
|
|
1656
|
-
value: Maybe.empty(),
|
|
1657
|
-
})),
|
|
1658
|
-
}),
|
|
1659
|
-
}).chain((properties) => create(properties)));
|
|
1660
|
-
};
|
|
1661
|
-
Ontology.fromRdfResource = $wrap_FromRdfResourceFunction(Ontology._fromRdfResource);
|
|
1662
|
-
Ontology.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
1663
|
-
.toResource()
|
|
1664
|
-
.chain((resource) => Ontology.fromRdfResource(resource, options))));
|
|
1665
|
-
Ontology.fromRdfType = dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology");
|
|
1666
|
-
function isOntology(object) {
|
|
1667
|
-
switch (object.$type) {
|
|
1668
|
-
case "Ontology":
|
|
1669
|
-
return true;
|
|
1670
|
-
default:
|
|
1671
|
-
return false;
|
|
1672
|
-
}
|
|
1622
|
+
})(Identifier = PropertyGroup.Identifier || (PropertyGroup.Identifier = {}));
|
|
1623
|
+
function isPropertyGroup(object) {
|
|
1624
|
+
return object.$type === "PropertyGroup";
|
|
1673
1625
|
}
|
|
1674
|
-
|
|
1675
|
-
|
|
1626
|
+
PropertyGroup.isPropertyGroup = isPropertyGroup;
|
|
1627
|
+
PropertyGroup.schema = {
|
|
1628
|
+
fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"),
|
|
1676
1629
|
properties: {
|
|
1677
1630
|
$identifier: {
|
|
1678
1631
|
kind: "Identifier",
|
|
@@ -1696,721 +1649,580 @@ export var Ontology;
|
|
|
1696
1649
|
},
|
|
1697
1650
|
},
|
|
1698
1651
|
};
|
|
1699
|
-
|
|
1652
|
+
PropertyGroup._toRdfResource = (parameters) => {
|
|
1700
1653
|
if (!parameters.ignoreRdfType) {
|
|
1701
|
-
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/
|
|
1654
|
+
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup"), parameters.graph);
|
|
1702
1655
|
}
|
|
1703
|
-
parameters.resource.add(
|
|
1656
|
+
parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
|
|
1704
1657
|
.toList()
|
|
1705
1658
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1706
|
-
parameters.resource.add(
|
|
1659
|
+
parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
|
|
1707
1660
|
.toList()
|
|
1708
1661
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
1709
1662
|
return parameters.resource;
|
|
1710
1663
|
};
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
(
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1664
|
+
PropertyGroup.toRdfResource = $wrap_ToRdfResourceFunction(PropertyGroup._toRdfResource);
|
|
1665
|
+
PropertyGroup.$toString = (_propertyGroup) => `PropertyGroup(${JSON.stringify(PropertyGroup.toStringRecord(_propertyGroup))})`;
|
|
1666
|
+
PropertyGroup.toStringRecord = (_propertyGroup) => $compactRecord({
|
|
1667
|
+
$identifier: _propertyGroup.$identifier().toString(),
|
|
1668
|
+
label: _propertyGroup.label.map((item) => item.toString()).extract(),
|
|
1669
|
+
});
|
|
1670
|
+
})(PropertyGroup || (PropertyGroup = {}));
|
|
1671
|
+
export var PropertyShape;
|
|
1672
|
+
(function (PropertyShape) {
|
|
1673
|
+
PropertyShape.create = (parameters) => $sequenceRecord({
|
|
1674
|
+
$identifier: $convertToIdentifierProperty(parameters.$identifier),
|
|
1675
|
+
and: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.and).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.and.type, value)),
|
|
1676
|
+
classes: $convertToScalarSet(($convertToIri), true)(parameters.classes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.classes.type, value)),
|
|
1677
|
+
comment: $convertToMaybe($identityConversionFunction)(parameters.comment).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.comment.type, value)),
|
|
1678
|
+
datatype: $convertToMaybe(($convertToIri))(parameters.datatype).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.datatype.type, value)),
|
|
1679
|
+
deactivated: $convertToMaybe($identityConversionFunction)(parameters.deactivated).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.deactivated.type, value)),
|
|
1680
|
+
defaultValue: $convertToMaybe($identityConversionFunction)(parameters.defaultValue).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.defaultValue.type, value)),
|
|
1681
|
+
description: $convertToMaybe($identityConversionFunction)(parameters.description).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.description.type, value)),
|
|
1682
|
+
disjoint: $convertToScalarSet(($convertToIri), true)(parameters.disjoint).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.disjoint.type, value)),
|
|
1683
|
+
display: $convertWithDefaultValue($identityConversionFunction, false)(parameters.display),
|
|
1684
|
+
equals: $convertToScalarSet(($convertToIri), true)(parameters.equals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.equals.type, value)),
|
|
1685
|
+
flags: $convertToMaybe($identityConversionFunction)(parameters.flags).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.flags.type, value)),
|
|
1686
|
+
groups: $convertToScalarSet($convertToIdentifier, true)(parameters.groups).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.groups.type, value)),
|
|
1687
|
+
hasValues: $convertToScalarSet($identityConversionFunction, true)(parameters.hasValues).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.hasValues.type, value)),
|
|
1688
|
+
ignore: $convertWithDefaultValue($identityConversionFunction, false)(parameters.ignore),
|
|
1689
|
+
in_: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.in_).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.in_.type, value)),
|
|
1690
|
+
isDefinedBy: $convertToMaybe($convertToIdentifier)(parameters.isDefinedBy).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.isDefinedBy.type, value)),
|
|
1691
|
+
label: $convertToMaybe($identityConversionFunction)(parameters.label).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.label.type, value)),
|
|
1692
|
+
languageIn: $convertToMaybe($convertToList($identityConversionFunction, true))(parameters.languageIn).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.languageIn.type, value)),
|
|
1693
|
+
lessThan: $convertToScalarSet(($convertToIri), true)(parameters.lessThan).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThan.type, value)),
|
|
1694
|
+
lessThanOrEquals: $convertToScalarSet(($convertToIri), true)(parameters.lessThanOrEquals).chain((value) => $validateArray($identityValidationFunction, true)(PropertyShape.schema.properties.lessThanOrEquals.type, value)),
|
|
1695
|
+
maxCount: $convertToMaybe($identityConversionFunction)(parameters.maxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.maxCount.type, value)),
|
|
1696
|
+
maxExclusive: $convertToMaybe($convertToLiteral)(parameters.maxExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxExclusive.type, value)),
|
|
1697
|
+
maxInclusive: $convertToMaybe($convertToLiteral)(parameters.maxInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxInclusive.type, value)),
|
|
1698
|
+
maxLength: $convertToMaybe($identityConversionFunction)(parameters.maxLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.maxLength.type, value)),
|
|
1699
|
+
message: $convertToMaybe($identityConversionFunction)(parameters.message).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.message.type, value)),
|
|
1700
|
+
minCount: $convertToMaybe($identityConversionFunction)(parameters.minCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.minCount.type, value)),
|
|
1701
|
+
minExclusive: $convertToMaybe($convertToLiteral)(parameters.minExclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minExclusive.type, value)),
|
|
1702
|
+
minInclusive: $convertToMaybe($convertToLiteral)(parameters.minInclusive).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minInclusive.type, value)),
|
|
1703
|
+
minLength: $convertToMaybe($identityConversionFunction)(parameters.minLength).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.minLength.type, value)),
|
|
1704
|
+
mutable: $convertToMaybe($identityConversionFunction)(parameters.mutable).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.mutable.type, value)),
|
|
1705
|
+
name: $convertToMaybe($identityConversionFunction)(parameters.name).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.name.type, value)),
|
|
1706
|
+
node: $convertToMaybe($convertToIdentifier)(parameters.node).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.node.type, value)),
|
|
1707
|
+
nodeKind: $convertToMaybe(($convertToIri))(parameters.nodeKind).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.nodeKind.type, value)),
|
|
1708
|
+
not: $convertToScalarSet($convertToIdentifier, true)(parameters.not).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.not.type, value)),
|
|
1709
|
+
or: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.or).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.or.type, value)),
|
|
1710
|
+
order: $convertToMaybe($identityConversionFunction)(parameters.order).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.order.type, value)),
|
|
1711
|
+
path: Either.of(parameters.path),
|
|
1712
|
+
pattern: $convertToMaybe($identityConversionFunction)(parameters.pattern).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.pattern.type, value)),
|
|
1713
|
+
qualifiedMaxCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMaxCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMaxCount.type, value)),
|
|
1714
|
+
qualifiedMinCount: $convertToMaybe($identityConversionFunction)(parameters.qualifiedMinCount).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedMinCount.type, value)),
|
|
1715
|
+
qualifiedValueShape: $convertToMaybe($convertToIdentifier)(parameters.qualifiedValueShape).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShape.type, value)),
|
|
1716
|
+
qualifiedValueShapesDisjoint: $convertToMaybe($identityConversionFunction)(parameters.qualifiedValueShapesDisjoint).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.type, value)),
|
|
1717
|
+
resolve: $convertToMaybe($convertToIdentifier)(parameters.resolve).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.resolve.type, value)),
|
|
1718
|
+
severity: $convertToMaybe(($convertToIri))(parameters.severity).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.severity.type, value)),
|
|
1719
|
+
shaclmateName: $convertToMaybe($identityConversionFunction)(parameters.shaclmateName).chain((value) => $validateMaybe($identityValidationFunction)(NodeShape.schema.properties.shaclmateName.type, value)),
|
|
1720
|
+
targetClasses: $convertToScalarSet(($convertToIri), true)(parameters.targetClasses).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetClasses.type, value)),
|
|
1721
|
+
targetNodes: $convertToScalarSet($identityConversionFunction, true)(parameters.targetNodes).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetNodes.type, value)),
|
|
1722
|
+
targetObjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetObjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetObjectsOf.type, value)),
|
|
1723
|
+
targetSubjectsOf: $convertToScalarSet(($convertToIri), true)(parameters.targetSubjectsOf).chain((value) => $validateArray($identityValidationFunction, true)(NodeShape.schema.properties.targetSubjectsOf.type, value)),
|
|
1724
|
+
uniqueLang: $convertToMaybe($identityConversionFunction)(parameters.uniqueLang).chain((value) => $validateMaybe($identityValidationFunction)(PropertyShape.schema.properties.uniqueLang.type, value)),
|
|
1725
|
+
xone: $convertToMaybe($convertToList($convertToIdentifier, true))(parameters.xone).chain((value) => $validateMaybe($validateArray($identityValidationFunction, true))(NodeShape.schema.properties.xone.type, value)),
|
|
1726
|
+
})
|
|
1727
|
+
.map((properties) => ({ ...properties, $type: "PropertyShape" }))
|
|
1728
|
+
.map((object) => $monkeyPatchObject(object, { $toString: PropertyShape.$toString }));
|
|
1770
1729
|
function createUnsafe(parameters) {
|
|
1771
|
-
return create(parameters).unsafeCoerce();
|
|
1730
|
+
return PropertyShape.create(parameters).unsafeCoerce();
|
|
1772
1731
|
}
|
|
1773
|
-
|
|
1732
|
+
PropertyShape.createUnsafe = createUnsafe;
|
|
1733
|
+
PropertyShape._fromRdfResource = ($resource, _$options) => (!_$options.ignoreRdfType
|
|
1734
|
+
? $ensureRdfResourceType($resource, [PropertyShape.schema.fromRdfType], {
|
|
1735
|
+
graph: _$options.graph,
|
|
1736
|
+
})
|
|
1737
|
+
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
1738
|
+
$identifier: $identifierFromRdfResourceValues(new Resource.Value({
|
|
1739
|
+
dataFactory: dataFactory,
|
|
1740
|
+
focusResource: $resource,
|
|
1741
|
+
propertyPath: $RdfVocabularies.rdf.subject,
|
|
1742
|
+
term: $resource.identifier,
|
|
1743
|
+
}).toValues(), {
|
|
1744
|
+
context: _$options.context,
|
|
1745
|
+
graph: _$options.graph,
|
|
1746
|
+
focusResource: $resource,
|
|
1747
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1748
|
+
propertyPath: $RdfVocabularies.rdf.subject,
|
|
1749
|
+
schema: PropertyShape.schema.properties.$identifier.type,
|
|
1750
|
+
}).chain((values) => values.head()),
|
|
1751
|
+
and: $shaclPropertyFromRdf({
|
|
1752
|
+
context: _$options.context,
|
|
1753
|
+
graph: _$options.graph,
|
|
1754
|
+
focusResource: $resource,
|
|
1755
|
+
ignoreRdfType: true,
|
|
1756
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1757
|
+
propertySchema: PropertyShape.schema.properties.and,
|
|
1758
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
|
|
1759
|
+
}),
|
|
1760
|
+
classes: $shaclPropertyFromRdf({
|
|
1761
|
+
context: _$options.context,
|
|
1762
|
+
graph: _$options.graph,
|
|
1763
|
+
focusResource: $resource,
|
|
1764
|
+
ignoreRdfType: true,
|
|
1765
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1766
|
+
propertySchema: PropertyShape.schema.properties.classes,
|
|
1767
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
1768
|
+
}),
|
|
1769
|
+
comment: $shaclPropertyFromRdf({
|
|
1770
|
+
context: _$options.context,
|
|
1771
|
+
graph: _$options.graph,
|
|
1772
|
+
focusResource: $resource,
|
|
1773
|
+
ignoreRdfType: true,
|
|
1774
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1775
|
+
propertySchema: PropertyShape.schema.properties.comment,
|
|
1776
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
1777
|
+
}),
|
|
1778
|
+
datatype: $shaclPropertyFromRdf({
|
|
1779
|
+
context: _$options.context,
|
|
1780
|
+
graph: _$options.graph,
|
|
1781
|
+
focusResource: $resource,
|
|
1782
|
+
ignoreRdfType: true,
|
|
1783
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1784
|
+
propertySchema: PropertyShape.schema.properties.datatype,
|
|
1785
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
1786
|
+
}),
|
|
1787
|
+
deactivated: $shaclPropertyFromRdf({
|
|
1788
|
+
context: _$options.context,
|
|
1789
|
+
graph: _$options.graph,
|
|
1790
|
+
focusResource: $resource,
|
|
1791
|
+
ignoreRdfType: true,
|
|
1792
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1793
|
+
propertySchema: PropertyShape.schema.properties.deactivated,
|
|
1794
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
|
|
1795
|
+
}),
|
|
1796
|
+
defaultValue: $shaclPropertyFromRdf({
|
|
1797
|
+
context: _$options.context,
|
|
1798
|
+
graph: _$options.graph,
|
|
1799
|
+
focusResource: $resource,
|
|
1800
|
+
ignoreRdfType: true,
|
|
1801
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1802
|
+
propertySchema: PropertyShape.schema.properties.defaultValue,
|
|
1803
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($termFromRdfResourceValues)),
|
|
1804
|
+
}),
|
|
1805
|
+
description: $shaclPropertyFromRdf({
|
|
1806
|
+
context: _$options.context,
|
|
1807
|
+
graph: _$options.graph,
|
|
1808
|
+
focusResource: $resource,
|
|
1809
|
+
ignoreRdfType: true,
|
|
1810
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1811
|
+
propertySchema: PropertyShape.schema.properties.description,
|
|
1812
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
1813
|
+
}),
|
|
1814
|
+
disjoint: $shaclPropertyFromRdf({
|
|
1815
|
+
context: _$options.context,
|
|
1816
|
+
graph: _$options.graph,
|
|
1817
|
+
focusResource: $resource,
|
|
1818
|
+
ignoreRdfType: true,
|
|
1819
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1820
|
+
propertySchema: PropertyShape.schema.properties.disjoint,
|
|
1821
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
1822
|
+
}),
|
|
1823
|
+
display: $shaclPropertyFromRdf({
|
|
1824
|
+
context: _$options.context,
|
|
1825
|
+
graph: _$options.graph,
|
|
1826
|
+
focusResource: $resource,
|
|
1827
|
+
ignoreRdfType: true,
|
|
1828
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1829
|
+
propertySchema: PropertyShape.schema.properties.display,
|
|
1830
|
+
typeFromRdfResourceValues: $defaultValueFromRdfResourceValues(($booleanFromRdfResourceValues)),
|
|
1831
|
+
}),
|
|
1832
|
+
equals: $shaclPropertyFromRdf({
|
|
1833
|
+
context: _$options.context,
|
|
1834
|
+
graph: _$options.graph,
|
|
1835
|
+
focusResource: $resource,
|
|
1836
|
+
ignoreRdfType: true,
|
|
1837
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1838
|
+
propertySchema: PropertyShape.schema.properties.equals,
|
|
1839
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
1840
|
+
}),
|
|
1841
|
+
flags: $shaclPropertyFromRdf({
|
|
1842
|
+
context: _$options.context,
|
|
1843
|
+
graph: _$options.graph,
|
|
1844
|
+
focusResource: $resource,
|
|
1845
|
+
ignoreRdfType: true,
|
|
1846
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1847
|
+
propertySchema: PropertyShape.schema.properties.flags,
|
|
1848
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
1849
|
+
}),
|
|
1850
|
+
groups: $shaclPropertyFromRdf({
|
|
1851
|
+
context: _$options.context,
|
|
1852
|
+
graph: _$options.graph,
|
|
1853
|
+
focusResource: $resource,
|
|
1854
|
+
ignoreRdfType: true,
|
|
1855
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1856
|
+
propertySchema: PropertyShape.schema.properties.groups,
|
|
1857
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues($identifierFromRdfResourceValues),
|
|
1858
|
+
}),
|
|
1859
|
+
hasValues: $shaclPropertyFromRdf({
|
|
1860
|
+
context: _$options.context,
|
|
1861
|
+
graph: _$options.graph,
|
|
1862
|
+
focusResource: $resource,
|
|
1863
|
+
ignoreRdfType: true,
|
|
1864
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1865
|
+
propertySchema: PropertyShape.schema.properties.hasValues,
|
|
1866
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($termFromRdfResourceValues)),
|
|
1867
|
+
}),
|
|
1868
|
+
ignore: $shaclPropertyFromRdf({
|
|
1869
|
+
context: _$options.context,
|
|
1870
|
+
graph: _$options.graph,
|
|
1871
|
+
focusResource: $resource,
|
|
1872
|
+
ignoreRdfType: true,
|
|
1873
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1874
|
+
propertySchema: PropertyShape.schema.properties.ignore,
|
|
1875
|
+
typeFromRdfResourceValues: $defaultValueFromRdfResourceValues(($booleanFromRdfResourceValues)),
|
|
1876
|
+
}),
|
|
1877
|
+
in_: $shaclPropertyFromRdf({
|
|
1878
|
+
context: _$options.context,
|
|
1879
|
+
graph: _$options.graph,
|
|
1880
|
+
focusResource: $resource,
|
|
1881
|
+
ignoreRdfType: true,
|
|
1882
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1883
|
+
propertySchema: PropertyShape.schema.properties.in_,
|
|
1884
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($termFromRdfResourceValues))),
|
|
1885
|
+
}),
|
|
1886
|
+
isDefinedBy: $shaclPropertyFromRdf({
|
|
1887
|
+
context: _$options.context,
|
|
1888
|
+
graph: _$options.graph,
|
|
1889
|
+
focusResource: $resource,
|
|
1890
|
+
ignoreRdfType: true,
|
|
1891
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1892
|
+
propertySchema: PropertyShape.schema.properties.isDefinedBy,
|
|
1893
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
|
|
1894
|
+
}),
|
|
1895
|
+
label: $shaclPropertyFromRdf({
|
|
1896
|
+
context: _$options.context,
|
|
1897
|
+
graph: _$options.graph,
|
|
1898
|
+
focusResource: $resource,
|
|
1899
|
+
ignoreRdfType: true,
|
|
1900
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1901
|
+
propertySchema: PropertyShape.schema.properties.label,
|
|
1902
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
1903
|
+
}),
|
|
1904
|
+
languageIn: $shaclPropertyFromRdf({
|
|
1905
|
+
context: _$options.context,
|
|
1906
|
+
graph: _$options.graph,
|
|
1907
|
+
focusResource: $resource,
|
|
1908
|
+
ignoreRdfType: true,
|
|
1909
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1910
|
+
propertySchema: PropertyShape.schema.properties.languageIn,
|
|
1911
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues(($stringFromRdfResourceValues))),
|
|
1912
|
+
}),
|
|
1913
|
+
lessThan: $shaclPropertyFromRdf({
|
|
1914
|
+
context: _$options.context,
|
|
1915
|
+
graph: _$options.graph,
|
|
1916
|
+
focusResource: $resource,
|
|
1917
|
+
ignoreRdfType: true,
|
|
1918
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1919
|
+
propertySchema: PropertyShape.schema.properties.lessThan,
|
|
1920
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
1921
|
+
}),
|
|
1922
|
+
lessThanOrEquals: $shaclPropertyFromRdf({
|
|
1923
|
+
context: _$options.context,
|
|
1924
|
+
graph: _$options.graph,
|
|
1925
|
+
focusResource: $resource,
|
|
1926
|
+
ignoreRdfType: true,
|
|
1927
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1928
|
+
propertySchema: PropertyShape.schema.properties.lessThanOrEquals,
|
|
1929
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
1930
|
+
}),
|
|
1931
|
+
maxCount: $shaclPropertyFromRdf({
|
|
1932
|
+
context: _$options.context,
|
|
1933
|
+
graph: _$options.graph,
|
|
1934
|
+
focusResource: $resource,
|
|
1935
|
+
ignoreRdfType: true,
|
|
1936
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1937
|
+
propertySchema: PropertyShape.schema.properties.maxCount,
|
|
1938
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
|
|
1939
|
+
}),
|
|
1940
|
+
maxExclusive: $shaclPropertyFromRdf({
|
|
1941
|
+
context: _$options.context,
|
|
1942
|
+
graph: _$options.graph,
|
|
1943
|
+
focusResource: $resource,
|
|
1944
|
+
ignoreRdfType: true,
|
|
1945
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1946
|
+
propertySchema: PropertyShape.schema.properties.maxExclusive,
|
|
1947
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
|
|
1948
|
+
}),
|
|
1949
|
+
maxInclusive: $shaclPropertyFromRdf({
|
|
1950
|
+
context: _$options.context,
|
|
1951
|
+
graph: _$options.graph,
|
|
1952
|
+
focusResource: $resource,
|
|
1953
|
+
ignoreRdfType: true,
|
|
1954
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1955
|
+
propertySchema: PropertyShape.schema.properties.maxInclusive,
|
|
1956
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
|
|
1957
|
+
}),
|
|
1958
|
+
maxLength: $shaclPropertyFromRdf({
|
|
1959
|
+
context: _$options.context,
|
|
1960
|
+
graph: _$options.graph,
|
|
1961
|
+
focusResource: $resource,
|
|
1962
|
+
ignoreRdfType: true,
|
|
1963
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1964
|
+
propertySchema: PropertyShape.schema.properties.maxLength,
|
|
1965
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
|
|
1966
|
+
}),
|
|
1967
|
+
message: $shaclPropertyFromRdf({
|
|
1968
|
+
context: _$options.context,
|
|
1969
|
+
graph: _$options.graph,
|
|
1970
|
+
focusResource: $resource,
|
|
1971
|
+
ignoreRdfType: true,
|
|
1972
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1973
|
+
propertySchema: PropertyShape.schema.properties.message,
|
|
1974
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
1975
|
+
}),
|
|
1976
|
+
minCount: $shaclPropertyFromRdf({
|
|
1977
|
+
context: _$options.context,
|
|
1978
|
+
graph: _$options.graph,
|
|
1979
|
+
focusResource: $resource,
|
|
1980
|
+
ignoreRdfType: true,
|
|
1981
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1982
|
+
propertySchema: PropertyShape.schema.properties.minCount,
|
|
1983
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
|
|
1984
|
+
}),
|
|
1985
|
+
minExclusive: $shaclPropertyFromRdf({
|
|
1986
|
+
context: _$options.context,
|
|
1987
|
+
graph: _$options.graph,
|
|
1988
|
+
focusResource: $resource,
|
|
1989
|
+
ignoreRdfType: true,
|
|
1990
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1991
|
+
propertySchema: PropertyShape.schema.properties.minExclusive,
|
|
1992
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
|
|
1993
|
+
}),
|
|
1994
|
+
minInclusive: $shaclPropertyFromRdf({
|
|
1995
|
+
context: _$options.context,
|
|
1996
|
+
graph: _$options.graph,
|
|
1997
|
+
focusResource: $resource,
|
|
1998
|
+
ignoreRdfType: true,
|
|
1999
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2000
|
+
propertySchema: PropertyShape.schema.properties.minInclusive,
|
|
2001
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($literalFromRdfResourceValues),
|
|
2002
|
+
}),
|
|
2003
|
+
minLength: $shaclPropertyFromRdf({
|
|
2004
|
+
context: _$options.context,
|
|
2005
|
+
graph: _$options.graph,
|
|
2006
|
+
focusResource: $resource,
|
|
2007
|
+
ignoreRdfType: true,
|
|
2008
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2009
|
+
propertySchema: PropertyShape.schema.properties.minLength,
|
|
2010
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
|
|
2011
|
+
}),
|
|
2012
|
+
mutable: $shaclPropertyFromRdf({
|
|
2013
|
+
context: _$options.context,
|
|
2014
|
+
graph: _$options.graph,
|
|
2015
|
+
focusResource: $resource,
|
|
2016
|
+
ignoreRdfType: true,
|
|
2017
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2018
|
+
propertySchema: PropertyShape.schema.properties.mutable,
|
|
2019
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
|
|
2020
|
+
}),
|
|
2021
|
+
name: $shaclPropertyFromRdf({
|
|
2022
|
+
context: _$options.context,
|
|
2023
|
+
graph: _$options.graph,
|
|
2024
|
+
focusResource: $resource,
|
|
2025
|
+
ignoreRdfType: true,
|
|
2026
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2027
|
+
propertySchema: PropertyShape.schema.properties.name,
|
|
2028
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
2029
|
+
}),
|
|
2030
|
+
node: $shaclPropertyFromRdf({
|
|
2031
|
+
context: _$options.context,
|
|
2032
|
+
graph: _$options.graph,
|
|
2033
|
+
focusResource: $resource,
|
|
2034
|
+
ignoreRdfType: true,
|
|
2035
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2036
|
+
propertySchema: PropertyShape.schema.properties.node,
|
|
2037
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
|
|
2038
|
+
}),
|
|
2039
|
+
nodeKind: $shaclPropertyFromRdf({
|
|
2040
|
+
context: _$options.context,
|
|
2041
|
+
graph: _$options.graph,
|
|
2042
|
+
focusResource: $resource,
|
|
2043
|
+
ignoreRdfType: true,
|
|
2044
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2045
|
+
propertySchema: PropertyShape.schema.properties.nodeKind,
|
|
2046
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
2047
|
+
}),
|
|
2048
|
+
not: $shaclPropertyFromRdf({
|
|
2049
|
+
context: _$options.context,
|
|
2050
|
+
graph: _$options.graph,
|
|
2051
|
+
focusResource: $resource,
|
|
2052
|
+
ignoreRdfType: true,
|
|
2053
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2054
|
+
propertySchema: PropertyShape.schema.properties.not,
|
|
2055
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues($identifierFromRdfResourceValues),
|
|
2056
|
+
}),
|
|
2057
|
+
or: $shaclPropertyFromRdf({
|
|
2058
|
+
context: _$options.context,
|
|
2059
|
+
graph: _$options.graph,
|
|
2060
|
+
focusResource: $resource,
|
|
2061
|
+
ignoreRdfType: true,
|
|
2062
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2063
|
+
propertySchema: PropertyShape.schema.properties.or,
|
|
2064
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
|
|
2065
|
+
}),
|
|
2066
|
+
order: $shaclPropertyFromRdf({
|
|
2067
|
+
context: _$options.context,
|
|
2068
|
+
graph: _$options.graph,
|
|
2069
|
+
focusResource: $resource,
|
|
2070
|
+
ignoreRdfType: true,
|
|
2071
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2072
|
+
propertySchema: PropertyShape.schema.properties.order,
|
|
2073
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($floatFromRdfResourceValues)),
|
|
2074
|
+
}),
|
|
2075
|
+
path: $shaclPropertyFromRdf({
|
|
2076
|
+
context: _$options.context,
|
|
2077
|
+
graph: _$options.graph,
|
|
2078
|
+
focusResource: $resource,
|
|
2079
|
+
ignoreRdfType: true,
|
|
2080
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2081
|
+
propertySchema: PropertyShape.schema.properties.path,
|
|
2082
|
+
typeFromRdfResourceValues: $PropertyPath.fromRdfResourceValues,
|
|
2083
|
+
}),
|
|
2084
|
+
pattern: $shaclPropertyFromRdf({
|
|
2085
|
+
context: _$options.context,
|
|
2086
|
+
graph: _$options.graph,
|
|
2087
|
+
focusResource: $resource,
|
|
2088
|
+
ignoreRdfType: true,
|
|
2089
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2090
|
+
propertySchema: PropertyShape.schema.properties.pattern,
|
|
2091
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
2092
|
+
}),
|
|
2093
|
+
qualifiedMaxCount: $shaclPropertyFromRdf({
|
|
2094
|
+
context: _$options.context,
|
|
2095
|
+
graph: _$options.graph,
|
|
2096
|
+
focusResource: $resource,
|
|
2097
|
+
ignoreRdfType: true,
|
|
2098
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2099
|
+
propertySchema: PropertyShape.schema.properties.qualifiedMaxCount,
|
|
2100
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
|
|
2101
|
+
}),
|
|
2102
|
+
qualifiedMinCount: $shaclPropertyFromRdf({
|
|
2103
|
+
context: _$options.context,
|
|
2104
|
+
graph: _$options.graph,
|
|
2105
|
+
focusResource: $resource,
|
|
2106
|
+
ignoreRdfType: true,
|
|
2107
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2108
|
+
propertySchema: PropertyShape.schema.properties.qualifiedMinCount,
|
|
2109
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($bigIntFromRdfResourceValues)),
|
|
2110
|
+
}),
|
|
2111
|
+
qualifiedValueShape: $shaclPropertyFromRdf({
|
|
2112
|
+
context: _$options.context,
|
|
2113
|
+
graph: _$options.graph,
|
|
2114
|
+
focusResource: $resource,
|
|
2115
|
+
ignoreRdfType: true,
|
|
2116
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2117
|
+
propertySchema: PropertyShape.schema.properties.qualifiedValueShape,
|
|
2118
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
|
|
2119
|
+
}),
|
|
2120
|
+
qualifiedValueShapesDisjoint: $shaclPropertyFromRdf({
|
|
2121
|
+
context: _$options.context,
|
|
2122
|
+
graph: _$options.graph,
|
|
2123
|
+
focusResource: $resource,
|
|
2124
|
+
ignoreRdfType: true,
|
|
2125
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2126
|
+
propertySchema: PropertyShape.schema.properties.qualifiedValueShapesDisjoint,
|
|
2127
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
|
|
2128
|
+
}),
|
|
2129
|
+
resolve: $shaclPropertyFromRdf({
|
|
2130
|
+
context: _$options.context,
|
|
2131
|
+
graph: _$options.graph,
|
|
2132
|
+
focusResource: $resource,
|
|
2133
|
+
ignoreRdfType: true,
|
|
2134
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2135
|
+
propertySchema: PropertyShape.schema.properties.resolve,
|
|
2136
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($identifierFromRdfResourceValues),
|
|
2137
|
+
}),
|
|
2138
|
+
severity: $shaclPropertyFromRdf({
|
|
2139
|
+
context: _$options.context,
|
|
2140
|
+
graph: _$options.graph,
|
|
2141
|
+
focusResource: $resource,
|
|
2142
|
+
ignoreRdfType: true,
|
|
2143
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2144
|
+
propertySchema: PropertyShape.schema.properties.severity,
|
|
2145
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
2146
|
+
}),
|
|
2147
|
+
shaclmateName: $shaclPropertyFromRdf({
|
|
2148
|
+
context: _$options.context,
|
|
2149
|
+
graph: _$options.graph,
|
|
2150
|
+
focusResource: $resource,
|
|
2151
|
+
ignoreRdfType: true,
|
|
2152
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2153
|
+
propertySchema: PropertyShape.schema.properties.shaclmateName,
|
|
2154
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($stringFromRdfResourceValues)),
|
|
2155
|
+
}),
|
|
2156
|
+
targetClasses: $shaclPropertyFromRdf({
|
|
2157
|
+
context: _$options.context,
|
|
2158
|
+
graph: _$options.graph,
|
|
2159
|
+
focusResource: $resource,
|
|
2160
|
+
ignoreRdfType: true,
|
|
2161
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2162
|
+
propertySchema: PropertyShape.schema.properties.targetClasses,
|
|
2163
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
2164
|
+
}),
|
|
2165
|
+
targetNodes: $shaclPropertyFromRdf({
|
|
2166
|
+
context: _$options.context,
|
|
2167
|
+
graph: _$options.graph,
|
|
2168
|
+
focusResource: $resource,
|
|
2169
|
+
ignoreRdfType: true,
|
|
2170
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2171
|
+
propertySchema: PropertyShape.schema.properties.targetNodes,
|
|
2172
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($termFromRdfResourceValues)),
|
|
2173
|
+
}),
|
|
2174
|
+
targetObjectsOf: $shaclPropertyFromRdf({
|
|
2175
|
+
context: _$options.context,
|
|
2176
|
+
graph: _$options.graph,
|
|
2177
|
+
focusResource: $resource,
|
|
2178
|
+
ignoreRdfType: true,
|
|
2179
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2180
|
+
propertySchema: PropertyShape.schema.properties.targetObjectsOf,
|
|
2181
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
2182
|
+
}),
|
|
2183
|
+
targetSubjectsOf: $shaclPropertyFromRdf({
|
|
2184
|
+
context: _$options.context,
|
|
2185
|
+
graph: _$options.graph,
|
|
2186
|
+
focusResource: $resource,
|
|
2187
|
+
ignoreRdfType: true,
|
|
2188
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2189
|
+
propertySchema: PropertyShape.schema.properties.targetSubjectsOf,
|
|
2190
|
+
typeFromRdfResourceValues: $setFromRdfResourceValues(($iriFromRdfResourceValues)),
|
|
2191
|
+
}),
|
|
2192
|
+
uniqueLang: $shaclPropertyFromRdf({
|
|
2193
|
+
context: _$options.context,
|
|
2194
|
+
graph: _$options.graph,
|
|
2195
|
+
focusResource: $resource,
|
|
2196
|
+
ignoreRdfType: true,
|
|
2197
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2198
|
+
propertySchema: PropertyShape.schema.properties.uniqueLang,
|
|
2199
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues(($booleanFromRdfResourceValues)),
|
|
2200
|
+
}),
|
|
2201
|
+
xone: $shaclPropertyFromRdf({
|
|
2202
|
+
context: _$options.context,
|
|
2203
|
+
graph: _$options.graph,
|
|
2204
|
+
focusResource: $resource,
|
|
2205
|
+
ignoreRdfType: true,
|
|
2206
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
2207
|
+
propertySchema: PropertyShape.schema.properties.xone,
|
|
2208
|
+
typeFromRdfResourceValues: $maybeFromRdfResourceValues($listFromRdfResourceValues($identifierFromRdfResourceValues)),
|
|
2209
|
+
}),
|
|
2210
|
+
}).chain((properties) => PropertyShape.create(properties)));
|
|
2211
|
+
PropertyShape.fromRdfResource = $wrap_FromRdfResourceFunction(PropertyShape._fromRdfResource);
|
|
2212
|
+
PropertyShape.fromRdfResourceValues = (values, options) => values.chainMap((value) => value
|
|
2213
|
+
.toResource()
|
|
2214
|
+
.chain((resource) => PropertyShape.fromRdfResource(resource, options)));
|
|
1774
2215
|
let Identifier;
|
|
1775
2216
|
(function (Identifier) {
|
|
1776
2217
|
Identifier.parse = $parseIdentifier;
|
|
1777
2218
|
Identifier.stringify = NTriplesTerm.stringify;
|
|
1778
|
-
})(Identifier =
|
|
1779
|
-
|
|
1780
|
-
return
|
|
1781
|
-
? $ensureRdfResourceType($resource, [NodeShape.fromRdfType], {
|
|
1782
|
-
graph: _$options.graph,
|
|
1783
|
-
})
|
|
1784
|
-
: Right(true)).chain((_rdfTypeCheck) => $sequenceRecord({
|
|
1785
|
-
$identifier: Right(new Resource.Value({
|
|
1786
|
-
dataFactory: dataFactory,
|
|
1787
|
-
focusResource: $resource,
|
|
1788
|
-
propertyPath: $RdfVocabularies.rdf.subject,
|
|
1789
|
-
term: $resource.identifier,
|
|
1790
|
-
}).toValues())
|
|
1791
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1792
|
-
.chain((values) => values.head()),
|
|
1793
|
-
and: $shaclPropertyFromRdf({
|
|
1794
|
-
graph: _$options.graph,
|
|
1795
|
-
resource: $resource,
|
|
1796
|
-
propertySchema: NodeShape.schema.properties.and,
|
|
1797
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1798
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
1799
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1800
|
-
focusResource: $resource,
|
|
1801
|
-
propertyPath: PropertyShape.schema.properties.and.path,
|
|
1802
|
-
values: valueList.toArray(),
|
|
1803
|
-
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
1804
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
1805
|
-
.map((values) => values.length > 0
|
|
1806
|
-
? values.map((value) => Maybe.of(value))
|
|
1807
|
-
: Resource.Values.fromValue({
|
|
1808
|
-
focusResource: $resource,
|
|
1809
|
-
propertyPath: PropertyShape.schema.properties.and.path,
|
|
1810
|
-
value: Maybe.empty(),
|
|
1811
|
-
})),
|
|
1812
|
-
}),
|
|
1813
|
-
classes: $shaclPropertyFromRdf({
|
|
1814
|
-
graph: _$options.graph,
|
|
1815
|
-
resource: $resource,
|
|
1816
|
-
propertySchema: NodeShape.schema.properties.classes,
|
|
1817
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1818
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
1819
|
-
.map((values) => values.toArray())
|
|
1820
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
1821
|
-
focusResource: $resource,
|
|
1822
|
-
propertyPath: PropertyShape.schema.properties.classes.path,
|
|
1823
|
-
value: valuesArray,
|
|
1824
|
-
})),
|
|
1825
|
-
}),
|
|
1826
|
-
closed: $shaclPropertyFromRdf({
|
|
1827
|
-
graph: _$options.graph,
|
|
1828
|
-
resource: $resource,
|
|
1829
|
-
propertySchema: NodeShape.schema.properties.closed,
|
|
1830
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1831
|
-
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
1832
|
-
.map((values) => values.length > 0
|
|
1833
|
-
? values.map((value) => Maybe.of(value))
|
|
1834
|
-
: Resource.Values.fromValue({
|
|
1835
|
-
focusResource: $resource,
|
|
1836
|
-
propertyPath: NodeShape.schema.properties.closed.path,
|
|
1837
|
-
value: Maybe.empty(),
|
|
1838
|
-
})),
|
|
1839
|
-
}),
|
|
1840
|
-
comment: $shaclPropertyFromRdf({
|
|
1841
|
-
graph: _$options.graph,
|
|
1842
|
-
resource: $resource,
|
|
1843
|
-
propertySchema: NodeShape.schema.properties.comment,
|
|
1844
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1845
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1846
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1847
|
-
.map((values) => values.length > 0
|
|
1848
|
-
? values.map((value) => Maybe.of(value))
|
|
1849
|
-
: Resource.Values.fromValue({
|
|
1850
|
-
focusResource: $resource,
|
|
1851
|
-
propertyPath: PropertyShape.schema.properties.comment.path,
|
|
1852
|
-
value: Maybe.empty(),
|
|
1853
|
-
})),
|
|
1854
|
-
}),
|
|
1855
|
-
datatype: $shaclPropertyFromRdf({
|
|
1856
|
-
graph: _$options.graph,
|
|
1857
|
-
resource: $resource,
|
|
1858
|
-
propertySchema: NodeShape.schema.properties.datatype,
|
|
1859
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1860
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
1861
|
-
.map((values) => values.length > 0
|
|
1862
|
-
? values.map((value) => Maybe.of(value))
|
|
1863
|
-
: Resource.Values.fromValue({
|
|
1864
|
-
focusResource: $resource,
|
|
1865
|
-
propertyPath: PropertyShape.schema.properties.datatype.path,
|
|
1866
|
-
value: Maybe.empty(),
|
|
1867
|
-
})),
|
|
1868
|
-
}),
|
|
1869
|
-
deactivated: $shaclPropertyFromRdf({
|
|
1870
|
-
graph: _$options.graph,
|
|
1871
|
-
resource: $resource,
|
|
1872
|
-
propertySchema: NodeShape.schema.properties.deactivated,
|
|
1873
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1874
|
-
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
1875
|
-
.map((values) => values.length > 0
|
|
1876
|
-
? values.map((value) => Maybe.of(value))
|
|
1877
|
-
: Resource.Values.fromValue({
|
|
1878
|
-
focusResource: $resource,
|
|
1879
|
-
propertyPath: PropertyShape.schema.properties.deactivated.path,
|
|
1880
|
-
value: Maybe.empty(),
|
|
1881
|
-
})),
|
|
1882
|
-
}),
|
|
1883
|
-
discriminantValue: $shaclPropertyFromRdf({
|
|
1884
|
-
graph: _$options.graph,
|
|
1885
|
-
resource: $resource,
|
|
1886
|
-
propertySchema: NodeShape.schema.properties.discriminantValue,
|
|
1887
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1888
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1889
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1890
|
-
.map((values) => values.length > 0
|
|
1891
|
-
? values.map((value) => Maybe.of(value))
|
|
1892
|
-
: Resource.Values.fromValue({
|
|
1893
|
-
focusResource: $resource,
|
|
1894
|
-
propertyPath: NodeShape.schema.properties.discriminantValue.path,
|
|
1895
|
-
value: Maybe.empty(),
|
|
1896
|
-
})),
|
|
1897
|
-
}),
|
|
1898
|
-
extern: $shaclPropertyFromRdf({
|
|
1899
|
-
graph: _$options.graph,
|
|
1900
|
-
resource: $resource,
|
|
1901
|
-
propertySchema: NodeShape.schema.properties.extern,
|
|
1902
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1903
|
-
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
1904
|
-
.map((values) => values.length > 0
|
|
1905
|
-
? values.map((value) => Maybe.of(value))
|
|
1906
|
-
: Resource.Values.fromValue({
|
|
1907
|
-
focusResource: $resource,
|
|
1908
|
-
propertyPath: NodeShape.schema.properties.extern.path,
|
|
1909
|
-
value: Maybe.empty(),
|
|
1910
|
-
})),
|
|
1911
|
-
}),
|
|
1912
|
-
flags: $shaclPropertyFromRdf({
|
|
1913
|
-
graph: _$options.graph,
|
|
1914
|
-
resource: $resource,
|
|
1915
|
-
propertySchema: NodeShape.schema.properties.flags,
|
|
1916
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1917
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1918
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1919
|
-
.map((values) => values.toArray())
|
|
1920
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
1921
|
-
focusResource: $resource,
|
|
1922
|
-
propertyPath: PropertyShape.schema.properties.flags.path,
|
|
1923
|
-
value: valuesArray,
|
|
1924
|
-
})),
|
|
1925
|
-
}),
|
|
1926
|
-
fromRdfType: $shaclPropertyFromRdf({
|
|
1927
|
-
graph: _$options.graph,
|
|
1928
|
-
resource: $resource,
|
|
1929
|
-
propertySchema: NodeShape.schema.properties.fromRdfType,
|
|
1930
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1931
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
1932
|
-
.map((values) => values.length > 0
|
|
1933
|
-
? values.map((value) => Maybe.of(value))
|
|
1934
|
-
: Resource.Values.fromValue({
|
|
1935
|
-
focusResource: $resource,
|
|
1936
|
-
propertyPath: NodeShape.schema.properties.fromRdfType.path,
|
|
1937
|
-
value: Maybe.empty(),
|
|
1938
|
-
})),
|
|
1939
|
-
}),
|
|
1940
|
-
hasValues: $shaclPropertyFromRdf({
|
|
1941
|
-
graph: _$options.graph,
|
|
1942
|
-
resource: $resource,
|
|
1943
|
-
propertySchema: NodeShape.schema.properties.hasValues,
|
|
1944
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1945
|
-
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1946
|
-
switch (term.termType) {
|
|
1947
|
-
case "NamedNode":
|
|
1948
|
-
case "Literal":
|
|
1949
|
-
return Either.of(term);
|
|
1950
|
-
default:
|
|
1951
|
-
return Left(new Resource.MistypedTermValueError({
|
|
1952
|
-
actualValue: term,
|
|
1953
|
-
expectedValueType: "(NamedNode | Literal)",
|
|
1954
|
-
focusResource: $resource,
|
|
1955
|
-
propertyPath: PropertyShape.schema.properties.hasValues.path,
|
|
1956
|
-
}));
|
|
1957
|
-
}
|
|
1958
|
-
})))
|
|
1959
|
-
.map((values) => values.toArray())
|
|
1960
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
1961
|
-
focusResource: $resource,
|
|
1962
|
-
propertyPath: PropertyShape.schema.properties.hasValues.path,
|
|
1963
|
-
value: valuesArray,
|
|
1964
|
-
})),
|
|
1965
|
-
}),
|
|
1966
|
-
ignoredProperties: $shaclPropertyFromRdf({
|
|
1967
|
-
graph: _$options.graph,
|
|
1968
|
-
resource: $resource,
|
|
1969
|
-
propertySchema: NodeShape.schema.properties.ignoredProperties,
|
|
1970
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1971
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
1972
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1973
|
-
focusResource: $resource,
|
|
1974
|
-
propertyPath: NodeShape.schema.properties.ignoredProperties.path,
|
|
1975
|
-
values: valueList.toArray(),
|
|
1976
|
-
})).chain((values) => values.chainMap((value) => value.toIri()))))
|
|
1977
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
1978
|
-
.map((values) => values.length > 0
|
|
1979
|
-
? values.map((value) => Maybe.of(value))
|
|
1980
|
-
: Resource.Values.fromValue({
|
|
1981
|
-
focusResource: $resource,
|
|
1982
|
-
propertyPath: NodeShape.schema.properties.ignoredProperties.path,
|
|
1983
|
-
value: Maybe.empty(),
|
|
1984
|
-
})),
|
|
1985
|
-
}),
|
|
1986
|
-
in_: $shaclPropertyFromRdf({
|
|
1987
|
-
graph: _$options.graph,
|
|
1988
|
-
resource: $resource,
|
|
1989
|
-
propertySchema: NodeShape.schema.properties.in_,
|
|
1990
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
1991
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
1992
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1993
|
-
focusResource: $resource,
|
|
1994
|
-
propertyPath: PropertyShape.schema.properties.in_.path,
|
|
1995
|
-
values: valueList.toArray(),
|
|
1996
|
-
})).chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
1997
|
-
switch (term.termType) {
|
|
1998
|
-
case "NamedNode":
|
|
1999
|
-
case "Literal":
|
|
2000
|
-
return Either.of(term);
|
|
2001
|
-
default:
|
|
2002
|
-
return Left(new Resource.MistypedTermValueError({
|
|
2003
|
-
actualValue: term,
|
|
2004
|
-
expectedValueType: "(NamedNode | Literal)",
|
|
2005
|
-
focusResource: $resource,
|
|
2006
|
-
propertyPath: PropertyShape.schema.properties.in_.path,
|
|
2007
|
-
}));
|
|
2008
|
-
}
|
|
2009
|
-
})))))
|
|
2010
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
2011
|
-
.map((values) => values.length > 0
|
|
2012
|
-
? values.map((value) => Maybe.of(value))
|
|
2013
|
-
: Resource.Values.fromValue({
|
|
2014
|
-
focusResource: $resource,
|
|
2015
|
-
propertyPath: PropertyShape.schema.properties.in_.path,
|
|
2016
|
-
value: Maybe.empty(),
|
|
2017
|
-
})),
|
|
2018
|
-
}),
|
|
2019
|
-
isDefinedBy: $shaclPropertyFromRdf({
|
|
2020
|
-
graph: _$options.graph,
|
|
2021
|
-
resource: $resource,
|
|
2022
|
-
propertySchema: NodeShape.schema.properties.isDefinedBy,
|
|
2023
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2024
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2025
|
-
.map((values) => values.length > 0
|
|
2026
|
-
? values.map((value) => Maybe.of(value))
|
|
2027
|
-
: Resource.Values.fromValue({
|
|
2028
|
-
focusResource: $resource,
|
|
2029
|
-
propertyPath: PropertyShape.schema.properties.isDefinedBy.path,
|
|
2030
|
-
value: Maybe.empty(),
|
|
2031
|
-
})),
|
|
2032
|
-
}),
|
|
2033
|
-
label: $shaclPropertyFromRdf({
|
|
2034
|
-
graph: _$options.graph,
|
|
2035
|
-
resource: $resource,
|
|
2036
|
-
propertySchema: NodeShape.schema.properties.label,
|
|
2037
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2038
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2039
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2040
|
-
.map((values) => values.length > 0
|
|
2041
|
-
? values.map((value) => Maybe.of(value))
|
|
2042
|
-
: Resource.Values.fromValue({
|
|
2043
|
-
focusResource: $resource,
|
|
2044
|
-
propertyPath: PropertyShape.schema.properties.label.path,
|
|
2045
|
-
value: Maybe.empty(),
|
|
2046
|
-
})),
|
|
2047
|
-
}),
|
|
2048
|
-
languageIn: $shaclPropertyFromRdf({
|
|
2049
|
-
graph: _$options.graph,
|
|
2050
|
-
resource: $resource,
|
|
2051
|
-
propertySchema: NodeShape.schema.properties.languageIn,
|
|
2052
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2053
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
2054
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
2055
|
-
focusResource: $resource,
|
|
2056
|
-
propertyPath: PropertyShape.schema.properties.languageIn.path,
|
|
2057
|
-
values: valueList.toArray(),
|
|
2058
|
-
}))
|
|
2059
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2060
|
-
.chain((values) => values.chainMap((value) => value.toString()))))
|
|
2061
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
2062
|
-
.map((values) => values.length > 0
|
|
2063
|
-
? values.map((value) => Maybe.of(value))
|
|
2064
|
-
: Resource.Values.fromValue({
|
|
2065
|
-
focusResource: $resource,
|
|
2066
|
-
propertyPath: PropertyShape.schema.properties.languageIn.path,
|
|
2067
|
-
value: Maybe.empty(),
|
|
2068
|
-
})),
|
|
2069
|
-
}),
|
|
2070
|
-
maxCount: $shaclPropertyFromRdf({
|
|
2071
|
-
graph: _$options.graph,
|
|
2072
|
-
resource: $resource,
|
|
2073
|
-
propertySchema: NodeShape.schema.properties.maxCount,
|
|
2074
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2075
|
-
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
2076
|
-
.map((values) => values.length > 0
|
|
2077
|
-
? values.map((value) => Maybe.of(value))
|
|
2078
|
-
: Resource.Values.fromValue({
|
|
2079
|
-
focusResource: $resource,
|
|
2080
|
-
propertyPath: PropertyShape.schema.properties.maxCount.path,
|
|
2081
|
-
value: Maybe.empty(),
|
|
2082
|
-
})),
|
|
2083
|
-
}),
|
|
2084
|
-
maxExclusive: $shaclPropertyFromRdf({
|
|
2085
|
-
graph: _$options.graph,
|
|
2086
|
-
resource: $resource,
|
|
2087
|
-
propertySchema: NodeShape.schema.properties.maxExclusive,
|
|
2088
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2089
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2090
|
-
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
2091
|
-
.map((values) => values.length > 0
|
|
2092
|
-
? values.map((value) => Maybe.of(value))
|
|
2093
|
-
: Resource.Values.fromValue({
|
|
2094
|
-
focusResource: $resource,
|
|
2095
|
-
propertyPath: PropertyShape.schema.properties.maxExclusive.path,
|
|
2096
|
-
value: Maybe.empty(),
|
|
2097
|
-
})),
|
|
2098
|
-
}),
|
|
2099
|
-
maxInclusive: $shaclPropertyFromRdf({
|
|
2100
|
-
graph: _$options.graph,
|
|
2101
|
-
resource: $resource,
|
|
2102
|
-
propertySchema: NodeShape.schema.properties.maxInclusive,
|
|
2103
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2104
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2105
|
-
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
2106
|
-
.map((values) => values.length > 0
|
|
2107
|
-
? values.map((value) => Maybe.of(value))
|
|
2108
|
-
: Resource.Values.fromValue({
|
|
2109
|
-
focusResource: $resource,
|
|
2110
|
-
propertyPath: PropertyShape.schema.properties.maxInclusive.path,
|
|
2111
|
-
value: Maybe.empty(),
|
|
2112
|
-
})),
|
|
2113
|
-
}),
|
|
2114
|
-
maxLength: $shaclPropertyFromRdf({
|
|
2115
|
-
graph: _$options.graph,
|
|
2116
|
-
resource: $resource,
|
|
2117
|
-
propertySchema: NodeShape.schema.properties.maxLength,
|
|
2118
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2119
|
-
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
2120
|
-
.map((values) => values.length > 0
|
|
2121
|
-
? values.map((value) => Maybe.of(value))
|
|
2122
|
-
: Resource.Values.fromValue({
|
|
2123
|
-
focusResource: $resource,
|
|
2124
|
-
propertyPath: PropertyShape.schema.properties.maxLength.path,
|
|
2125
|
-
value: Maybe.empty(),
|
|
2126
|
-
})),
|
|
2127
|
-
}),
|
|
2128
|
-
minCount: $shaclPropertyFromRdf({
|
|
2129
|
-
graph: _$options.graph,
|
|
2130
|
-
resource: $resource,
|
|
2131
|
-
propertySchema: NodeShape.schema.properties.minCount,
|
|
2132
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2133
|
-
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
2134
|
-
.map((values) => values.length > 0
|
|
2135
|
-
? values.map((value) => Maybe.of(value))
|
|
2136
|
-
: Resource.Values.fromValue({
|
|
2137
|
-
focusResource: $resource,
|
|
2138
|
-
propertyPath: PropertyShape.schema.properties.minCount.path,
|
|
2139
|
-
value: Maybe.empty(),
|
|
2140
|
-
})),
|
|
2141
|
-
}),
|
|
2142
|
-
minExclusive: $shaclPropertyFromRdf({
|
|
2143
|
-
graph: _$options.graph,
|
|
2144
|
-
resource: $resource,
|
|
2145
|
-
propertySchema: NodeShape.schema.properties.minExclusive,
|
|
2146
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2147
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2148
|
-
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
2149
|
-
.map((values) => values.length > 0
|
|
2150
|
-
? values.map((value) => Maybe.of(value))
|
|
2151
|
-
: Resource.Values.fromValue({
|
|
2152
|
-
focusResource: $resource,
|
|
2153
|
-
propertyPath: PropertyShape.schema.properties.minExclusive.path,
|
|
2154
|
-
value: Maybe.empty(),
|
|
2155
|
-
})),
|
|
2156
|
-
}),
|
|
2157
|
-
minInclusive: $shaclPropertyFromRdf({
|
|
2158
|
-
graph: _$options.graph,
|
|
2159
|
-
resource: $resource,
|
|
2160
|
-
propertySchema: NodeShape.schema.properties.minInclusive,
|
|
2161
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2162
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2163
|
-
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
2164
|
-
.map((values) => values.length > 0
|
|
2165
|
-
? values.map((value) => Maybe.of(value))
|
|
2166
|
-
: Resource.Values.fromValue({
|
|
2167
|
-
focusResource: $resource,
|
|
2168
|
-
propertyPath: PropertyShape.schema.properties.minInclusive.path,
|
|
2169
|
-
value: Maybe.empty(),
|
|
2170
|
-
})),
|
|
2171
|
-
}),
|
|
2172
|
-
minLength: $shaclPropertyFromRdf({
|
|
2173
|
-
graph: _$options.graph,
|
|
2174
|
-
resource: $resource,
|
|
2175
|
-
propertySchema: NodeShape.schema.properties.minLength,
|
|
2176
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2177
|
-
.chain((values) => values.chainMap((value) => value.toBigInt()))
|
|
2178
|
-
.map((values) => values.length > 0
|
|
2179
|
-
? values.map((value) => Maybe.of(value))
|
|
2180
|
-
: Resource.Values.fromValue({
|
|
2181
|
-
focusResource: $resource,
|
|
2182
|
-
propertyPath: PropertyShape.schema.properties.minLength.path,
|
|
2183
|
-
value: Maybe.empty(),
|
|
2184
|
-
})),
|
|
2185
|
-
}),
|
|
2186
|
-
mutable: $shaclPropertyFromRdf({
|
|
2187
|
-
graph: _$options.graph,
|
|
2188
|
-
resource: $resource,
|
|
2189
|
-
propertySchema: NodeShape.schema.properties.mutable,
|
|
2190
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2191
|
-
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
2192
|
-
.map((values) => values.length > 0
|
|
2193
|
-
? values.map((value) => Maybe.of(value))
|
|
2194
|
-
: Resource.Values.fromValue({
|
|
2195
|
-
focusResource: $resource,
|
|
2196
|
-
propertyPath: PropertyShape.schema.properties.mutable.path,
|
|
2197
|
-
value: Maybe.empty(),
|
|
2198
|
-
})),
|
|
2199
|
-
}),
|
|
2200
|
-
node: $shaclPropertyFromRdf({
|
|
2201
|
-
graph: _$options.graph,
|
|
2202
|
-
resource: $resource,
|
|
2203
|
-
propertySchema: NodeShape.schema.properties.node,
|
|
2204
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2205
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2206
|
-
.map((values) => values.length > 0
|
|
2207
|
-
? values.map((value) => Maybe.of(value))
|
|
2208
|
-
: Resource.Values.fromValue({
|
|
2209
|
-
focusResource: $resource,
|
|
2210
|
-
propertyPath: PropertyShape.schema.properties.node.path,
|
|
2211
|
-
value: Maybe.empty(),
|
|
2212
|
-
})),
|
|
2213
|
-
}),
|
|
2214
|
-
nodeKind: $shaclPropertyFromRdf({
|
|
2215
|
-
graph: _$options.graph,
|
|
2216
|
-
resource: $resource,
|
|
2217
|
-
propertySchema: NodeShape.schema.properties.nodeKind,
|
|
2218
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2219
|
-
.chain((values) => values.chainMap((value) => value.toIri([
|
|
2220
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNode"),
|
|
2221
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrIRI"),
|
|
2222
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#BlankNodeOrLiteral"),
|
|
2223
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#IRI"),
|
|
2224
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#IRIOrLiteral"),
|
|
2225
|
-
dataFactory.namedNode("http://www.w3.org/ns/shacl#Literal"),
|
|
2226
|
-
])))
|
|
2227
|
-
.map((values) => values.length > 0
|
|
2228
|
-
? values.map((value) => Maybe.of(value))
|
|
2229
|
-
: Resource.Values.fromValue({
|
|
2230
|
-
focusResource: $resource,
|
|
2231
|
-
propertyPath: PropertyShape.schema.properties.nodeKind.path,
|
|
2232
|
-
value: Maybe.empty(),
|
|
2233
|
-
})),
|
|
2234
|
-
}),
|
|
2235
|
-
not: $shaclPropertyFromRdf({
|
|
2236
|
-
graph: _$options.graph,
|
|
2237
|
-
resource: $resource,
|
|
2238
|
-
propertySchema: NodeShape.schema.properties.not,
|
|
2239
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2240
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2241
|
-
.map((values) => values.toArray())
|
|
2242
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
2243
|
-
focusResource: $resource,
|
|
2244
|
-
propertyPath: PropertyShape.schema.properties.not.path,
|
|
2245
|
-
value: valuesArray,
|
|
2246
|
-
})),
|
|
2247
|
-
}),
|
|
2248
|
-
or: $shaclPropertyFromRdf({
|
|
2249
|
-
graph: _$options.graph,
|
|
2250
|
-
resource: $resource,
|
|
2251
|
-
propertySchema: NodeShape.schema.properties.or,
|
|
2252
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2253
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
2254
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
2255
|
-
focusResource: $resource,
|
|
2256
|
-
propertyPath: PropertyShape.schema.properties.or.path,
|
|
2257
|
-
values: valueList.toArray(),
|
|
2258
|
-
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
2259
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
2260
|
-
.map((values) => values.length > 0
|
|
2261
|
-
? values.map((value) => Maybe.of(value))
|
|
2262
|
-
: Resource.Values.fromValue({
|
|
2263
|
-
focusResource: $resource,
|
|
2264
|
-
propertyPath: PropertyShape.schema.properties.or.path,
|
|
2265
|
-
value: Maybe.empty(),
|
|
2266
|
-
})),
|
|
2267
|
-
}),
|
|
2268
|
-
patterns: $shaclPropertyFromRdf({
|
|
2269
|
-
graph: _$options.graph,
|
|
2270
|
-
resource: $resource,
|
|
2271
|
-
propertySchema: NodeShape.schema.properties.patterns,
|
|
2272
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2273
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2274
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2275
|
-
.map((values) => values.toArray())
|
|
2276
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
2277
|
-
focusResource: $resource,
|
|
2278
|
-
propertyPath: PropertyShape.schema.properties.patterns.path,
|
|
2279
|
-
value: valuesArray,
|
|
2280
|
-
})),
|
|
2281
|
-
}),
|
|
2282
|
-
properties: $shaclPropertyFromRdf({
|
|
2283
|
-
graph: _$options.graph,
|
|
2284
|
-
resource: $resource,
|
|
2285
|
-
propertySchema: NodeShape.schema.properties.properties,
|
|
2286
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2287
|
-
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2288
|
-
.map((values) => values.toArray())
|
|
2289
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
2290
|
-
focusResource: $resource,
|
|
2291
|
-
propertyPath: NodeShape.schema.properties.properties.path,
|
|
2292
|
-
value: valuesArray,
|
|
2293
|
-
})),
|
|
2294
|
-
}),
|
|
2295
|
-
rdfType: $shaclPropertyFromRdf({
|
|
2296
|
-
graph: _$options.graph,
|
|
2297
|
-
resource: $resource,
|
|
2298
|
-
propertySchema: NodeShape.schema.properties.rdfType,
|
|
2299
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2300
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
2301
|
-
.map((values) => values.length > 0
|
|
2302
|
-
? values.map((value) => Maybe.of(value))
|
|
2303
|
-
: Resource.Values.fromValue({
|
|
2304
|
-
focusResource: $resource,
|
|
2305
|
-
propertyPath: NodeShape.schema.properties.rdfType.path,
|
|
2306
|
-
value: Maybe.empty(),
|
|
2307
|
-
})),
|
|
2308
|
-
}),
|
|
2309
|
-
shaclmateName: $shaclPropertyFromRdf({
|
|
2310
|
-
graph: _$options.graph,
|
|
2311
|
-
resource: $resource,
|
|
2312
|
-
propertySchema: NodeShape.schema.properties.shaclmateName,
|
|
2313
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2314
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2315
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2316
|
-
.map((values) => values.length > 0
|
|
2317
|
-
? values.map((value) => Maybe.of(value))
|
|
2318
|
-
: Resource.Values.fromValue({
|
|
2319
|
-
focusResource: $resource,
|
|
2320
|
-
propertyPath: PropertyShape.schema.properties.shaclmateName.path,
|
|
2321
|
-
value: Maybe.empty(),
|
|
2322
|
-
})),
|
|
2323
|
-
}),
|
|
2324
|
-
subClassOf: $shaclPropertyFromRdf({
|
|
2325
|
-
graph: _$options.graph,
|
|
2326
|
-
resource: $resource,
|
|
2327
|
-
propertySchema: NodeShape.schema.properties.subClassOf,
|
|
2328
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2329
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
2330
|
-
.map((values) => values.toArray())
|
|
2331
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
2332
|
-
focusResource: $resource,
|
|
2333
|
-
propertyPath: NodeShape.schema.properties.subClassOf.path,
|
|
2334
|
-
value: valuesArray,
|
|
2335
|
-
})),
|
|
2336
|
-
}),
|
|
2337
|
-
toRdfTypes: $shaclPropertyFromRdf({
|
|
2338
|
-
graph: _$options.graph,
|
|
2339
|
-
resource: $resource,
|
|
2340
|
-
propertySchema: NodeShape.schema.properties.toRdfTypes,
|
|
2341
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2342
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
2343
|
-
.map((values) => values.toArray())
|
|
2344
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
2345
|
-
focusResource: $resource,
|
|
2346
|
-
propertyPath: NodeShape.schema.properties.toRdfTypes.path,
|
|
2347
|
-
value: valuesArray,
|
|
2348
|
-
})),
|
|
2349
|
-
}),
|
|
2350
|
-
tsImports: $shaclPropertyFromRdf({
|
|
2351
|
-
graph: _$options.graph,
|
|
2352
|
-
resource: $resource,
|
|
2353
|
-
propertySchema: NodeShape.schema.properties.tsImports,
|
|
2354
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2355
|
-
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2356
|
-
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2357
|
-
.map((values) => values.toArray())
|
|
2358
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
2359
|
-
focusResource: $resource,
|
|
2360
|
-
propertyPath: NodeShape.schema.properties.tsImports.path,
|
|
2361
|
-
value: valuesArray,
|
|
2362
|
-
})),
|
|
2363
|
-
}),
|
|
2364
|
-
types: $shaclPropertyFromRdf({
|
|
2365
|
-
graph: _$options.graph,
|
|
2366
|
-
resource: $resource,
|
|
2367
|
-
propertySchema: NodeShape.schema.properties.types,
|
|
2368
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2369
|
-
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
2370
|
-
.map((values) => values.toArray())
|
|
2371
|
-
.map((valuesArray) => Resource.Values.fromValue({
|
|
2372
|
-
focusResource: $resource,
|
|
2373
|
-
propertyPath: NodeShape.schema.properties.types.path,
|
|
2374
|
-
value: valuesArray,
|
|
2375
|
-
})),
|
|
2376
|
-
}),
|
|
2377
|
-
xone: $shaclPropertyFromRdf({
|
|
2378
|
-
graph: _$options.graph,
|
|
2379
|
-
resource: $resource,
|
|
2380
|
-
propertySchema: NodeShape.schema.properties.xone,
|
|
2381
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2382
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
2383
|
-
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
2384
|
-
focusResource: $resource,
|
|
2385
|
-
propertyPath: PropertyShape.schema.properties.xone.path,
|
|
2386
|
-
values: valueList.toArray(),
|
|
2387
|
-
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
2388
|
-
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
2389
|
-
.map((values) => values.length > 0
|
|
2390
|
-
? values.map((value) => Maybe.of(value))
|
|
2391
|
-
: Resource.Values.fromValue({
|
|
2392
|
-
focusResource: $resource,
|
|
2393
|
-
propertyPath: PropertyShape.schema.properties.xone.path,
|
|
2394
|
-
value: Maybe.empty(),
|
|
2395
|
-
})),
|
|
2396
|
-
}),
|
|
2397
|
-
}).chain((properties) => create(properties)));
|
|
2398
|
-
};
|
|
2399
|
-
NodeShape.fromRdfResource = $wrap_FromRdfResourceFunction(NodeShape._fromRdfResource);
|
|
2400
|
-
NodeShape.fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
2401
|
-
.toResource()
|
|
2402
|
-
.chain((resource) => NodeShape.fromRdfResource(resource, options))));
|
|
2403
|
-
NodeShape.fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape");
|
|
2404
|
-
function isNodeShape(object) {
|
|
2405
|
-
switch (object.$type) {
|
|
2406
|
-
case "NodeShape":
|
|
2407
|
-
return true;
|
|
2408
|
-
default:
|
|
2409
|
-
return false;
|
|
2410
|
-
}
|
|
2219
|
+
})(Identifier = PropertyShape.Identifier || (PropertyShape.Identifier = {}));
|
|
2220
|
+
function isPropertyShape(object) {
|
|
2221
|
+
return object.$type === "PropertyShape";
|
|
2411
2222
|
}
|
|
2412
|
-
|
|
2413
|
-
|
|
2223
|
+
PropertyShape.isPropertyShape = isPropertyShape;
|
|
2224
|
+
PropertyShape.schema = {
|
|
2225
|
+
fromRdfType: dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"),
|
|
2414
2226
|
properties: {
|
|
2415
2227
|
$identifier: {
|
|
2416
2228
|
kind: "Identifier",
|
|
@@ -2432,14 +2244,6 @@ export var NodeShape;
|
|
|
2432
2244
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#class"),
|
|
2433
2245
|
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
2434
2246
|
},
|
|
2435
|
-
closed: {
|
|
2436
|
-
kind: "Shacl",
|
|
2437
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#closed"),
|
|
2438
|
-
type: {
|
|
2439
|
-
kind: "Option",
|
|
2440
|
-
itemType: { kind: "Boolean" },
|
|
2441
|
-
},
|
|
2442
|
-
},
|
|
2443
2247
|
comment: {
|
|
2444
2248
|
kind: "Shacl",
|
|
2445
2249
|
path: dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),
|
|
@@ -2461,46 +2265,72 @@ export var NodeShape;
|
|
|
2461
2265
|
itemType: { kind: "Boolean" },
|
|
2462
2266
|
},
|
|
2463
2267
|
},
|
|
2464
|
-
|
|
2268
|
+
defaultValue: {
|
|
2465
2269
|
kind: "Shacl",
|
|
2466
|
-
path: dataFactory.namedNode("http://
|
|
2270
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#defaultValue"),
|
|
2467
2271
|
type: {
|
|
2468
2272
|
kind: "Option",
|
|
2469
|
-
itemType: { kind: "
|
|
2273
|
+
itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
|
|
2470
2274
|
},
|
|
2471
2275
|
},
|
|
2472
|
-
|
|
2276
|
+
description: {
|
|
2473
2277
|
kind: "Shacl",
|
|
2474
|
-
path: dataFactory.namedNode("http://
|
|
2278
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#description"),
|
|
2475
2279
|
type: {
|
|
2476
2280
|
kind: "Option",
|
|
2281
|
+
itemType: { kind: "String" },
|
|
2282
|
+
},
|
|
2283
|
+
},
|
|
2284
|
+
disjoint: {
|
|
2285
|
+
kind: "Shacl",
|
|
2286
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#disjoint"),
|
|
2287
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
2288
|
+
},
|
|
2289
|
+
display: {
|
|
2290
|
+
kind: "Shacl",
|
|
2291
|
+
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#display"),
|
|
2292
|
+
type: {
|
|
2293
|
+
kind: "DefaultValue",
|
|
2477
2294
|
itemType: { kind: "Boolean" },
|
|
2295
|
+
defaultValue: dataFactory.literal("false", $RdfVocabularies.xsd.boolean),
|
|
2478
2296
|
},
|
|
2479
2297
|
},
|
|
2298
|
+
equals: {
|
|
2299
|
+
kind: "Shacl",
|
|
2300
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#equals"),
|
|
2301
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
2302
|
+
},
|
|
2480
2303
|
flags: {
|
|
2481
2304
|
kind: "Shacl",
|
|
2482
2305
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
|
|
2483
|
-
type: {
|
|
2306
|
+
type: {
|
|
2307
|
+
kind: "Option",
|
|
2308
|
+
itemType: { kind: "String" },
|
|
2309
|
+
},
|
|
2484
2310
|
},
|
|
2485
|
-
|
|
2311
|
+
groups: {
|
|
2486
2312
|
kind: "Shacl",
|
|
2487
|
-
path: dataFactory.namedNode("http://
|
|
2488
|
-
type: {
|
|
2313
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#group"),
|
|
2314
|
+
type: {
|
|
2315
|
+
kind: "Set",
|
|
2316
|
+
itemType: { kind: "Identifier" },
|
|
2317
|
+
},
|
|
2489
2318
|
},
|
|
2490
2319
|
hasValues: {
|
|
2491
2320
|
kind: "Shacl",
|
|
2492
2321
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
|
|
2493
|
-
type: { kind: "Set", itemType: { kind: "Term" } },
|
|
2494
|
-
},
|
|
2495
|
-
ignoredProperties: {
|
|
2496
|
-
kind: "Shacl",
|
|
2497
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#ignoredProperties"),
|
|
2498
2322
|
type: {
|
|
2499
|
-
kind: "
|
|
2500
|
-
itemType: {
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2323
|
+
kind: "Set",
|
|
2324
|
+
itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
|
|
2325
|
+
},
|
|
2326
|
+
},
|
|
2327
|
+
ignore: {
|
|
2328
|
+
kind: "Shacl",
|
|
2329
|
+
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#ignore"),
|
|
2330
|
+
type: {
|
|
2331
|
+
kind: "DefaultValue",
|
|
2332
|
+
itemType: { kind: "Boolean" },
|
|
2333
|
+
defaultValue: dataFactory.literal("false", $RdfVocabularies.xsd.boolean),
|
|
2504
2334
|
},
|
|
2505
2335
|
},
|
|
2506
2336
|
in_: {
|
|
@@ -2510,7 +2340,10 @@ export var NodeShape;
|
|
|
2510
2340
|
kind: "Option",
|
|
2511
2341
|
itemType: {
|
|
2512
2342
|
kind: "List",
|
|
2513
|
-
itemType: {
|
|
2343
|
+
itemType: {
|
|
2344
|
+
kind: "Term",
|
|
2345
|
+
types: ["NamedNode", "Literal"],
|
|
2346
|
+
},
|
|
2514
2347
|
},
|
|
2515
2348
|
},
|
|
2516
2349
|
},
|
|
@@ -2541,6 +2374,16 @@ export var NodeShape;
|
|
|
2541
2374
|
},
|
|
2542
2375
|
},
|
|
2543
2376
|
},
|
|
2377
|
+
lessThan: {
|
|
2378
|
+
kind: "Shacl",
|
|
2379
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#lessThan"),
|
|
2380
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
2381
|
+
},
|
|
2382
|
+
lessThanOrEquals: {
|
|
2383
|
+
kind: "Shacl",
|
|
2384
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#lessThanOrEquals"),
|
|
2385
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
2386
|
+
},
|
|
2544
2387
|
maxCount: {
|
|
2545
2388
|
kind: "Shacl",
|
|
2546
2389
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
|
|
@@ -2573,6 +2416,14 @@ export var NodeShape;
|
|
|
2573
2416
|
itemType: { kind: "BigInt" },
|
|
2574
2417
|
},
|
|
2575
2418
|
},
|
|
2419
|
+
message: {
|
|
2420
|
+
kind: "Shacl",
|
|
2421
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#message"),
|
|
2422
|
+
type: {
|
|
2423
|
+
kind: "Option",
|
|
2424
|
+
itemType: { kind: "String" },
|
|
2425
|
+
},
|
|
2426
|
+
},
|
|
2576
2427
|
minCount: {
|
|
2577
2428
|
kind: "Shacl",
|
|
2578
2429
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#minCount"),
|
|
@@ -2613,6 +2464,14 @@ export var NodeShape;
|
|
|
2613
2464
|
itemType: { kind: "Boolean" },
|
|
2614
2465
|
},
|
|
2615
2466
|
},
|
|
2467
|
+
name: {
|
|
2468
|
+
kind: "Shacl",
|
|
2469
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#name"),
|
|
2470
|
+
type: {
|
|
2471
|
+
kind: "Option",
|
|
2472
|
+
itemType: { kind: "String" },
|
|
2473
|
+
},
|
|
2474
|
+
},
|
|
2616
2475
|
node: {
|
|
2617
2476
|
kind: "Shacl",
|
|
2618
2477
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#node"),
|
|
@@ -2658,23 +2517,80 @@ export var NodeShape;
|
|
|
2658
2517
|
},
|
|
2659
2518
|
},
|
|
2660
2519
|
},
|
|
2661
|
-
|
|
2520
|
+
order: {
|
|
2521
|
+
kind: "Shacl",
|
|
2522
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#order"),
|
|
2523
|
+
type: { kind: "Option", itemType: { kind: "Float" } },
|
|
2524
|
+
},
|
|
2525
|
+
path: {
|
|
2526
|
+
kind: "Shacl",
|
|
2527
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#path"),
|
|
2528
|
+
get type() {
|
|
2529
|
+
return $PropertyPath.schema;
|
|
2530
|
+
},
|
|
2531
|
+
},
|
|
2532
|
+
pattern: {
|
|
2662
2533
|
kind: "Shacl",
|
|
2663
2534
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
|
|
2664
|
-
type: {
|
|
2535
|
+
type: {
|
|
2536
|
+
kind: "Option",
|
|
2537
|
+
itemType: { kind: "String" },
|
|
2538
|
+
},
|
|
2665
2539
|
},
|
|
2666
|
-
|
|
2540
|
+
qualifiedMaxCount: {
|
|
2667
2541
|
kind: "Shacl",
|
|
2668
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#
|
|
2542
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedMaxCount"),
|
|
2669
2543
|
type: {
|
|
2670
|
-
kind: "
|
|
2544
|
+
kind: "Option",
|
|
2545
|
+
itemType: { kind: "BigInt" },
|
|
2546
|
+
},
|
|
2547
|
+
},
|
|
2548
|
+
qualifiedMinCount: {
|
|
2549
|
+
kind: "Shacl",
|
|
2550
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedMinCount"),
|
|
2551
|
+
type: {
|
|
2552
|
+
kind: "Option",
|
|
2553
|
+
itemType: { kind: "BigInt" },
|
|
2554
|
+
},
|
|
2555
|
+
},
|
|
2556
|
+
qualifiedValueShape: {
|
|
2557
|
+
kind: "Shacl",
|
|
2558
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedValueShape"),
|
|
2559
|
+
type: {
|
|
2560
|
+
kind: "Option",
|
|
2671
2561
|
itemType: { kind: "Identifier" },
|
|
2672
2562
|
},
|
|
2673
2563
|
},
|
|
2674
|
-
|
|
2564
|
+
qualifiedValueShapesDisjoint: {
|
|
2675
2565
|
kind: "Shacl",
|
|
2676
|
-
path: dataFactory.namedNode("http://
|
|
2677
|
-
type: {
|
|
2566
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#qualifiedValueShapesDisjoint"),
|
|
2567
|
+
type: {
|
|
2568
|
+
kind: "Option",
|
|
2569
|
+
itemType: { kind: "Boolean" },
|
|
2570
|
+
},
|
|
2571
|
+
},
|
|
2572
|
+
resolve: {
|
|
2573
|
+
kind: "Shacl",
|
|
2574
|
+
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#resolve"),
|
|
2575
|
+
type: {
|
|
2576
|
+
kind: "Option",
|
|
2577
|
+
itemType: { kind: "Identifier" },
|
|
2578
|
+
},
|
|
2579
|
+
},
|
|
2580
|
+
severity: {
|
|
2581
|
+
kind: "Shacl",
|
|
2582
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#severity"),
|
|
2583
|
+
type: {
|
|
2584
|
+
kind: "Option",
|
|
2585
|
+
itemType: {
|
|
2586
|
+
kind: "Iri",
|
|
2587
|
+
in: [
|
|
2588
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
|
|
2589
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
|
|
2590
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
|
|
2591
|
+
],
|
|
2592
|
+
},
|
|
2593
|
+
},
|
|
2678
2594
|
},
|
|
2679
2595
|
shaclmateName: {
|
|
2680
2596
|
kind: "Shacl",
|
|
@@ -2684,26 +2600,37 @@ export var NodeShape;
|
|
|
2684
2600
|
itemType: { kind: "String" },
|
|
2685
2601
|
},
|
|
2686
2602
|
},
|
|
2687
|
-
|
|
2603
|
+
targetClasses: {
|
|
2688
2604
|
kind: "Shacl",
|
|
2689
|
-
path:
|
|
2605
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetClass"),
|
|
2690
2606
|
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
2691
2607
|
},
|
|
2692
|
-
|
|
2608
|
+
targetNodes: {
|
|
2693
2609
|
kind: "Shacl",
|
|
2694
|
-
path: dataFactory.namedNode("http://
|
|
2695
|
-
type: {
|
|
2610
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetNode"),
|
|
2611
|
+
type: {
|
|
2612
|
+
kind: "Set",
|
|
2613
|
+
itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
|
|
2614
|
+
},
|
|
2696
2615
|
},
|
|
2697
|
-
|
|
2616
|
+
targetObjectsOf: {
|
|
2698
2617
|
kind: "Shacl",
|
|
2699
|
-
path: dataFactory.namedNode("http://
|
|
2700
|
-
type: { kind: "Set", itemType: { kind: "
|
|
2618
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetObjectsOf"),
|
|
2619
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
2701
2620
|
},
|
|
2702
|
-
|
|
2621
|
+
targetSubjectsOf: {
|
|
2703
2622
|
kind: "Shacl",
|
|
2704
|
-
path:
|
|
2623
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetSubjectsOf"),
|
|
2705
2624
|
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
2706
2625
|
},
|
|
2626
|
+
uniqueLang: {
|
|
2627
|
+
kind: "Shacl",
|
|
2628
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#uniqueLang"),
|
|
2629
|
+
type: {
|
|
2630
|
+
kind: "Option",
|
|
2631
|
+
itemType: { kind: "Boolean" },
|
|
2632
|
+
},
|
|
2633
|
+
},
|
|
2707
2634
|
xone: {
|
|
2708
2635
|
kind: "Shacl",
|
|
2709
2636
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
|
|
@@ -2717,11 +2644,11 @@ export var NodeShape;
|
|
|
2717
2644
|
},
|
|
2718
2645
|
},
|
|
2719
2646
|
};
|
|
2720
|
-
|
|
2647
|
+
PropertyShape._toRdfResource = (parameters) => {
|
|
2721
2648
|
if (!parameters.ignoreRdfType) {
|
|
2722
|
-
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#
|
|
2649
|
+
parameters.resource.add($RdfVocabularies.rdf.type, dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape"), parameters.graph);
|
|
2723
2650
|
}
|
|
2724
|
-
parameters.resource.add(
|
|
2651
|
+
parameters.resource.add(NodeShape.schema.properties.and.path, parameters.object.and.toList().flatMap((value) => [
|
|
2725
2652
|
value.length > 0
|
|
2726
2653
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2727
2654
|
if (itemIndex === 0) {
|
|
@@ -2743,55 +2670,38 @@ export var NodeShape;
|
|
|
2743
2670
|
}).listResource.identifier
|
|
2744
2671
|
: $RdfVocabularies.rdf.nil,
|
|
2745
2672
|
]), parameters.graph);
|
|
2746
|
-
parameters.resource.add(
|
|
2747
|
-
parameters.resource.add(NodeShape.schema.properties.
|
|
2748
|
-
.toList()
|
|
2749
|
-
.flatMap((value) => [
|
|
2750
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2751
|
-
]), parameters.graph);
|
|
2752
|
-
parameters.resource.add(PropertyShape.schema.properties.comment.path, parameters.object.comment
|
|
2673
|
+
parameters.resource.add(NodeShape.schema.properties.classes.path, parameters.object.classes.flatMap((item) => [item]), parameters.graph);
|
|
2674
|
+
parameters.resource.add(NodeShape.schema.properties.comment.path, parameters.object.comment
|
|
2753
2675
|
.toList()
|
|
2754
2676
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2755
|
-
parameters.resource.add(
|
|
2756
|
-
parameters.resource.add(
|
|
2677
|
+
parameters.resource.add(NodeShape.schema.properties.datatype.path, parameters.object.datatype.toList(), parameters.graph);
|
|
2678
|
+
parameters.resource.add(NodeShape.schema.properties.deactivated.path, parameters.object.deactivated
|
|
2757
2679
|
.toList()
|
|
2758
2680
|
.flatMap((value) => [
|
|
2759
2681
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2760
2682
|
]), parameters.graph);
|
|
2761
|
-
parameters.resource.add(
|
|
2683
|
+
parameters.resource.add(PropertyShape.schema.properties.defaultValue.path, parameters.object.defaultValue.toList(), parameters.graph);
|
|
2684
|
+
parameters.resource.add(PropertyShape.schema.properties.description.path, parameters.object.description
|
|
2762
2685
|
.toList()
|
|
2763
2686
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2764
|
-
parameters.resource.add(
|
|
2687
|
+
parameters.resource.add(PropertyShape.schema.properties.disjoint.path, parameters.object.disjoint.flatMap((item) => [item]), parameters.graph);
|
|
2688
|
+
parameters.resource.add(PropertyShape.schema.properties.display.path, $strictEquals(parameters.object.display, false).isLeft()
|
|
2689
|
+
? [
|
|
2690
|
+
$literalFactory.boolean(parameters.object.display, $RdfVocabularies.xsd.boolean),
|
|
2691
|
+
]
|
|
2692
|
+
: [], parameters.graph);
|
|
2693
|
+
parameters.resource.add(PropertyShape.schema.properties.equals.path, parameters.object.equals.flatMap((item) => [item]), parameters.graph);
|
|
2694
|
+
parameters.resource.add(NodeShape.schema.properties.flags.path, parameters.object.flags
|
|
2765
2695
|
.toList()
|
|
2766
|
-
.flatMap((value) => [
|
|
2767
|
-
|
|
2768
|
-
]), parameters.graph);
|
|
2769
|
-
parameters.resource.add(PropertyShape.schema.properties.
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
if (itemIndex === 0) {
|
|
2776
|
-
currentSubListResource = listResource;
|
|
2777
|
-
}
|
|
2778
|
-
else {
|
|
2779
|
-
const newSubListResource = parameters.resourceSet.resource((() => dataFactory.blankNode())());
|
|
2780
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, newSubListResource.identifier, parameters.graph);
|
|
2781
|
-
currentSubListResource = newSubListResource;
|
|
2782
|
-
}
|
|
2783
|
-
currentSubListResource.add($RdfVocabularies.rdf.first, [item], parameters.graph);
|
|
2784
|
-
if (itemIndex + 1 === list.length) {
|
|
2785
|
-
currentSubListResource.add($RdfVocabularies.rdf.rest, $RdfVocabularies.rdf.nil, parameters.graph);
|
|
2786
|
-
}
|
|
2787
|
-
return { currentSubListResource, listResource };
|
|
2788
|
-
}, {
|
|
2789
|
-
currentSubListResource: null,
|
|
2790
|
-
listResource: parameters.resourceSet.resource((() => dataFactory.blankNode())()),
|
|
2791
|
-
}).listResource.identifier
|
|
2792
|
-
: $RdfVocabularies.rdf.nil,
|
|
2793
|
-
]), parameters.graph);
|
|
2794
|
-
parameters.resource.add(PropertyShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
|
|
2696
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2697
|
+
parameters.resource.add(PropertyShape.schema.properties.groups.path, parameters.object.groups.flatMap((item) => [item]), parameters.graph);
|
|
2698
|
+
parameters.resource.add(NodeShape.schema.properties.hasValues.path, parameters.object.hasValues.flatMap((item) => [item]), parameters.graph);
|
|
2699
|
+
parameters.resource.add(PropertyShape.schema.properties.ignore.path, $strictEquals(parameters.object.ignore, false).isLeft()
|
|
2700
|
+
? [
|
|
2701
|
+
$literalFactory.boolean(parameters.object.ignore, $RdfVocabularies.xsd.boolean),
|
|
2702
|
+
]
|
|
2703
|
+
: [], parameters.graph);
|
|
2704
|
+
parameters.resource.add(NodeShape.schema.properties.in_.path, parameters.object.in_.toList().flatMap((value) => [
|
|
2795
2705
|
value.length > 0
|
|
2796
2706
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2797
2707
|
if (itemIndex === 0) {
|
|
@@ -2813,11 +2723,11 @@ export var NodeShape;
|
|
|
2813
2723
|
}).listResource.identifier
|
|
2814
2724
|
: $RdfVocabularies.rdf.nil,
|
|
2815
2725
|
]), parameters.graph);
|
|
2816
|
-
parameters.resource.add(
|
|
2817
|
-
parameters.resource.add(
|
|
2726
|
+
parameters.resource.add(NodeShape.schema.properties.isDefinedBy.path, parameters.object.isDefinedBy.toList(), parameters.graph);
|
|
2727
|
+
parameters.resource.add(NodeShape.schema.properties.label.path, parameters.object.label
|
|
2818
2728
|
.toList()
|
|
2819
2729
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2820
|
-
parameters.resource.add(
|
|
2730
|
+
parameters.resource.add(NodeShape.schema.properties.languageIn.path, parameters.object.languageIn.toList().flatMap((value) => [
|
|
2821
2731
|
value.length > 0
|
|
2822
2732
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2823
2733
|
if (itemIndex === 0) {
|
|
@@ -2839,39 +2749,47 @@ export var NodeShape;
|
|
|
2839
2749
|
}).listResource.identifier
|
|
2840
2750
|
: $RdfVocabularies.rdf.nil,
|
|
2841
2751
|
]), parameters.graph);
|
|
2752
|
+
parameters.resource.add(PropertyShape.schema.properties.lessThan.path, parameters.object.lessThan.flatMap((item) => [item]), parameters.graph);
|
|
2753
|
+
parameters.resource.add(PropertyShape.schema.properties.lessThanOrEquals.path, parameters.object.lessThanOrEquals.flatMap((item) => [item]), parameters.graph);
|
|
2842
2754
|
parameters.resource.add(PropertyShape.schema.properties.maxCount.path, parameters.object.maxCount
|
|
2843
2755
|
.toList()
|
|
2844
2756
|
.flatMap((value) => [
|
|
2845
2757
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2846
2758
|
]), parameters.graph);
|
|
2847
|
-
parameters.resource.add(
|
|
2848
|
-
parameters.resource.add(
|
|
2849
|
-
parameters.resource.add(
|
|
2759
|
+
parameters.resource.add(NodeShape.schema.properties.maxExclusive.path, parameters.object.maxExclusive.toList(), parameters.graph);
|
|
2760
|
+
parameters.resource.add(NodeShape.schema.properties.maxInclusive.path, parameters.object.maxInclusive.toList(), parameters.graph);
|
|
2761
|
+
parameters.resource.add(NodeShape.schema.properties.maxLength.path, parameters.object.maxLength
|
|
2850
2762
|
.toList()
|
|
2851
2763
|
.flatMap((value) => [
|
|
2852
2764
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2853
2765
|
]), parameters.graph);
|
|
2766
|
+
parameters.resource.add(NodeShape.schema.properties.message.path, parameters.object.message
|
|
2767
|
+
.toList()
|
|
2768
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2854
2769
|
parameters.resource.add(PropertyShape.schema.properties.minCount.path, parameters.object.minCount
|
|
2855
2770
|
.toList()
|
|
2856
2771
|
.flatMap((value) => [
|
|
2857
2772
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2858
2773
|
]), parameters.graph);
|
|
2859
|
-
parameters.resource.add(
|
|
2860
|
-
parameters.resource.add(
|
|
2861
|
-
parameters.resource.add(
|
|
2774
|
+
parameters.resource.add(NodeShape.schema.properties.minExclusive.path, parameters.object.minExclusive.toList(), parameters.graph);
|
|
2775
|
+
parameters.resource.add(NodeShape.schema.properties.minInclusive.path, parameters.object.minInclusive.toList(), parameters.graph);
|
|
2776
|
+
parameters.resource.add(NodeShape.schema.properties.minLength.path, parameters.object.minLength
|
|
2862
2777
|
.toList()
|
|
2863
2778
|
.flatMap((value) => [
|
|
2864
2779
|
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2865
2780
|
]), parameters.graph);
|
|
2866
|
-
parameters.resource.add(
|
|
2781
|
+
parameters.resource.add(NodeShape.schema.properties.mutable.path, parameters.object.mutable
|
|
2867
2782
|
.toList()
|
|
2868
2783
|
.flatMap((value) => [
|
|
2869
2784
|
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2870
2785
|
]), parameters.graph);
|
|
2871
|
-
parameters.resource.add(PropertyShape.schema.properties.
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
parameters.resource.add(
|
|
2786
|
+
parameters.resource.add(PropertyShape.schema.properties.name.path, parameters.object.name
|
|
2787
|
+
.toList()
|
|
2788
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2789
|
+
parameters.resource.add(NodeShape.schema.properties.node.path, parameters.object.node.toList(), parameters.graph);
|
|
2790
|
+
parameters.resource.add(NodeShape.schema.properties.nodeKind.path, parameters.object.nodeKind.toList(), parameters.graph);
|
|
2791
|
+
parameters.resource.add(NodeShape.schema.properties.not.path, parameters.object.not.flatMap((item) => [item]), parameters.graph);
|
|
2792
|
+
parameters.resource.add(NodeShape.schema.properties.or.path, parameters.object.or.toList().flatMap((value) => [
|
|
2875
2793
|
value.length > 0
|
|
2876
2794
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2877
2795
|
if (itemIndex === 0) {
|
|
@@ -2893,21 +2811,51 @@ export var NodeShape;
|
|
|
2893
2811
|
}).listResource.identifier
|
|
2894
2812
|
: $RdfVocabularies.rdf.nil,
|
|
2895
2813
|
]), parameters.graph);
|
|
2896
|
-
parameters.resource.add(PropertyShape.schema.properties.
|
|
2897
|
-
|
|
2814
|
+
parameters.resource.add(PropertyShape.schema.properties.order.path, parameters.object.order
|
|
2815
|
+
.toList()
|
|
2816
|
+
.flatMap((value) => [
|
|
2817
|
+
$literalFactory.number(value, $RdfVocabularies.xsd.double),
|
|
2898
2818
|
]), parameters.graph);
|
|
2899
|
-
parameters.resource.add(
|
|
2900
|
-
|
|
2901
|
-
|
|
2819
|
+
parameters.resource.add(PropertyShape.schema.properties.path.path, [
|
|
2820
|
+
$PropertyPath.toRdfResource(parameters.object.path, {
|
|
2821
|
+
graph: parameters.graph,
|
|
2822
|
+
resourceSet: parameters.resourceSet,
|
|
2823
|
+
}).identifier,
|
|
2824
|
+
], parameters.graph);
|
|
2825
|
+
parameters.resource.add(NodeShape.schema.properties.pattern.path, parameters.object.pattern
|
|
2902
2826
|
.toList()
|
|
2903
2827
|
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2904
|
-
parameters.resource.add(
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
$literalFactory.
|
|
2828
|
+
parameters.resource.add(PropertyShape.schema.properties.qualifiedMaxCount.path, parameters.object.qualifiedMaxCount
|
|
2829
|
+
.toList()
|
|
2830
|
+
.flatMap((value) => [
|
|
2831
|
+
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2908
2832
|
]), parameters.graph);
|
|
2909
|
-
parameters.resource.add(
|
|
2910
|
-
|
|
2833
|
+
parameters.resource.add(PropertyShape.schema.properties.qualifiedMinCount.path, parameters.object.qualifiedMinCount
|
|
2834
|
+
.toList()
|
|
2835
|
+
.flatMap((value) => [
|
|
2836
|
+
$literalFactory.bigint(value, $RdfVocabularies.xsd.integer),
|
|
2837
|
+
]), parameters.graph);
|
|
2838
|
+
parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShape.path, parameters.object.qualifiedValueShape.toList(), parameters.graph);
|
|
2839
|
+
parameters.resource.add(PropertyShape.schema.properties.qualifiedValueShapesDisjoint.path, parameters.object.qualifiedValueShapesDisjoint
|
|
2840
|
+
.toList()
|
|
2841
|
+
.flatMap((value) => [
|
|
2842
|
+
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2843
|
+
]), parameters.graph);
|
|
2844
|
+
parameters.resource.add(PropertyShape.schema.properties.resolve.path, parameters.object.resolve.toList(), parameters.graph);
|
|
2845
|
+
parameters.resource.add(NodeShape.schema.properties.severity.path, parameters.object.severity.toList(), parameters.graph);
|
|
2846
|
+
parameters.resource.add(NodeShape.schema.properties.shaclmateName.path, parameters.object.shaclmateName
|
|
2847
|
+
.toList()
|
|
2848
|
+
.flatMap((value) => [$literalFactory.string(value)]), parameters.graph);
|
|
2849
|
+
parameters.resource.add(NodeShape.schema.properties.targetClasses.path, parameters.object.targetClasses.flatMap((item) => [item]), parameters.graph);
|
|
2850
|
+
parameters.resource.add(NodeShape.schema.properties.targetNodes.path, parameters.object.targetNodes.flatMap((item) => [item]), parameters.graph);
|
|
2851
|
+
parameters.resource.add(NodeShape.schema.properties.targetObjectsOf.path, parameters.object.targetObjectsOf.flatMap((item) => [item]), parameters.graph);
|
|
2852
|
+
parameters.resource.add(NodeShape.schema.properties.targetSubjectsOf.path, parameters.object.targetSubjectsOf.flatMap((item) => [item]), parameters.graph);
|
|
2853
|
+
parameters.resource.add(PropertyShape.schema.properties.uniqueLang.path, parameters.object.uniqueLang
|
|
2854
|
+
.toList()
|
|
2855
|
+
.flatMap((value) => [
|
|
2856
|
+
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
2857
|
+
]), parameters.graph);
|
|
2858
|
+
parameters.resource.add(NodeShape.schema.properties.xone.path, parameters.object.xone.toList().flatMap((value) => [
|
|
2911
2859
|
value.length > 0
|
|
2912
2860
|
? value.reduce(({ currentSubListResource, listResource }, item, itemIndex, list) => {
|
|
2913
2861
|
if (itemIndex === 0) {
|
|
@@ -2931,22 +2879,18 @@ export var NodeShape;
|
|
|
2931
2879
|
]), parameters.graph);
|
|
2932
2880
|
return parameters.resource;
|
|
2933
2881
|
};
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
return `NodeShape(${JSON.stringify(_propertiesToStrings(_nodeShape))})`;
|
|
2947
|
-
}
|
|
2948
|
-
NodeShape.$toString = $toString;
|
|
2949
|
-
})(NodeShape || (NodeShape = {}));
|
|
2882
|
+
PropertyShape.toRdfResource = $wrap_ToRdfResourceFunction(PropertyShape._toRdfResource);
|
|
2883
|
+
PropertyShape.$toString = (_propertyShape) => `PropertyShape(${JSON.stringify(PropertyShape.toStringRecord(_propertyShape))})`;
|
|
2884
|
+
PropertyShape.toStringRecord = (_propertyShape) => $compactRecord({
|
|
2885
|
+
$identifier: _propertyShape.$identifier().toString(),
|
|
2886
|
+
label: _propertyShape.label.map((item) => item.toString()).extract(),
|
|
2887
|
+
name: _propertyShape.name.map((item) => item.toString()).extract(),
|
|
2888
|
+
path: $PropertyPath.$toString(_propertyShape.path),
|
|
2889
|
+
shaclmateName: _propertyShape.shaclmateName
|
|
2890
|
+
.map((item) => item.toString())
|
|
2891
|
+
.extract(),
|
|
2892
|
+
});
|
|
2893
|
+
})(PropertyShape || (PropertyShape = {}));
|
|
2950
2894
|
export var Shape;
|
|
2951
2895
|
(function (Shape) {
|
|
2952
2896
|
Shape.$toString = (value) => {
|
|
@@ -2965,26 +2909,18 @@ export var Shape;
|
|
|
2965
2909
|
...options,
|
|
2966
2910
|
ignoreRdfType: false,
|
|
2967
2911
|
}));
|
|
2968
|
-
Shape.fromRdfResourceValues = ((values,
|
|
2969
|
-
const valueAsValues =
|
|
2912
|
+
Shape.fromRdfResourceValues = ((values, options) => values.chainMap((value) => {
|
|
2913
|
+
const valueAsValues = value.toValues();
|
|
2970
2914
|
return NodeShape.fromRdfResourceValues(valueAsValues, {
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
ignoreRdfType: false,
|
|
2974
|
-
preferredLanguages: _options.preferredLanguages,
|
|
2975
|
-
propertyPath: _options.propertyPath,
|
|
2976
|
-
resource: _options.resource,
|
|
2915
|
+
...options,
|
|
2916
|
+
schema: options.schema.members["NodeShape"].type,
|
|
2977
2917
|
})
|
|
2978
2918
|
.altLazy(() => PropertyShape.fromRdfResourceValues(valueAsValues, {
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
ignoreRdfType: false,
|
|
2982
|
-
preferredLanguages: _options.preferredLanguages,
|
|
2983
|
-
propertyPath: _options.propertyPath,
|
|
2984
|
-
resource: _options.resource,
|
|
2919
|
+
...options,
|
|
2920
|
+
schema: options.schema.members["PropertyShape"].type,
|
|
2985
2921
|
}))
|
|
2986
2922
|
.chain((values) => values.head());
|
|
2987
|
-
}))
|
|
2923
|
+
}));
|
|
2988
2924
|
let Identifier;
|
|
2989
2925
|
(function (Identifier) {
|
|
2990
2926
|
Identifier.parse = $parseIdentifier;
|
|
@@ -3044,12 +2980,18 @@ export var Shape;
|
|
|
3044
2980
|
flags: {
|
|
3045
2981
|
kind: "Shacl",
|
|
3046
2982
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#flags"),
|
|
3047
|
-
type: {
|
|
2983
|
+
type: {
|
|
2984
|
+
kind: "Option",
|
|
2985
|
+
itemType: { kind: "String" },
|
|
2986
|
+
},
|
|
3048
2987
|
},
|
|
3049
2988
|
hasValues: {
|
|
3050
2989
|
kind: "Shacl",
|
|
3051
2990
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#hasValue"),
|
|
3052
|
-
type: {
|
|
2991
|
+
type: {
|
|
2992
|
+
kind: "Set",
|
|
2993
|
+
itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
|
|
2994
|
+
},
|
|
3053
2995
|
},
|
|
3054
2996
|
in_: {
|
|
3055
2997
|
kind: "Shacl",
|
|
@@ -3058,7 +3000,10 @@ export var Shape;
|
|
|
3058
3000
|
kind: "Option",
|
|
3059
3001
|
itemType: {
|
|
3060
3002
|
kind: "List",
|
|
3061
|
-
itemType: {
|
|
3003
|
+
itemType: {
|
|
3004
|
+
kind: "Term",
|
|
3005
|
+
types: ["NamedNode", "Literal"],
|
|
3006
|
+
},
|
|
3062
3007
|
},
|
|
3063
3008
|
},
|
|
3064
3009
|
},
|
|
@@ -3089,14 +3034,6 @@ export var Shape;
|
|
|
3089
3034
|
},
|
|
3090
3035
|
},
|
|
3091
3036
|
},
|
|
3092
|
-
maxCount: {
|
|
3093
|
-
kind: "Shacl",
|
|
3094
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxCount"),
|
|
3095
|
-
type: {
|
|
3096
|
-
kind: "Option",
|
|
3097
|
-
itemType: { kind: "BigInt" },
|
|
3098
|
-
},
|
|
3099
|
-
},
|
|
3100
3037
|
maxExclusive: {
|
|
3101
3038
|
kind: "Shacl",
|
|
3102
3039
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#maxExclusive"),
|
|
@@ -3121,12 +3058,12 @@ export var Shape;
|
|
|
3121
3058
|
itemType: { kind: "BigInt" },
|
|
3122
3059
|
},
|
|
3123
3060
|
},
|
|
3124
|
-
|
|
3061
|
+
message: {
|
|
3125
3062
|
kind: "Shacl",
|
|
3126
|
-
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#
|
|
3063
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#message"),
|
|
3127
3064
|
type: {
|
|
3128
3065
|
kind: "Option",
|
|
3129
|
-
itemType: { kind: "
|
|
3066
|
+
itemType: { kind: "String" },
|
|
3130
3067
|
},
|
|
3131
3068
|
},
|
|
3132
3069
|
minExclusive: {
|
|
@@ -3206,10 +3143,28 @@ export var Shape;
|
|
|
3206
3143
|
},
|
|
3207
3144
|
},
|
|
3208
3145
|
},
|
|
3209
|
-
|
|
3146
|
+
pattern: {
|
|
3210
3147
|
kind: "Shacl",
|
|
3211
3148
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#pattern"),
|
|
3212
|
-
type: {
|
|
3149
|
+
type: {
|
|
3150
|
+
kind: "Option",
|
|
3151
|
+
itemType: { kind: "String" },
|
|
3152
|
+
},
|
|
3153
|
+
},
|
|
3154
|
+
severity: {
|
|
3155
|
+
kind: "Shacl",
|
|
3156
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#severity"),
|
|
3157
|
+
type: {
|
|
3158
|
+
kind: "Option",
|
|
3159
|
+
itemType: {
|
|
3160
|
+
kind: "Iri",
|
|
3161
|
+
in: [
|
|
3162
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#Info"),
|
|
3163
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#Warning"),
|
|
3164
|
+
dataFactory.namedNode("http://www.w3.org/ns/shacl#Violation"),
|
|
3165
|
+
],
|
|
3166
|
+
},
|
|
3167
|
+
},
|
|
3213
3168
|
},
|
|
3214
3169
|
shaclmateName: {
|
|
3215
3170
|
kind: "Shacl",
|
|
@@ -3219,6 +3174,29 @@ export var Shape;
|
|
|
3219
3174
|
itemType: { kind: "String" },
|
|
3220
3175
|
},
|
|
3221
3176
|
},
|
|
3177
|
+
targetClasses: {
|
|
3178
|
+
kind: "Shacl",
|
|
3179
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetClass"),
|
|
3180
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
3181
|
+
},
|
|
3182
|
+
targetNodes: {
|
|
3183
|
+
kind: "Shacl",
|
|
3184
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetNode"),
|
|
3185
|
+
type: {
|
|
3186
|
+
kind: "Set",
|
|
3187
|
+
itemType: { kind: "Term", types: ["NamedNode", "Literal"] },
|
|
3188
|
+
},
|
|
3189
|
+
},
|
|
3190
|
+
targetObjectsOf: {
|
|
3191
|
+
kind: "Shacl",
|
|
3192
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetObjectsOf"),
|
|
3193
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
3194
|
+
},
|
|
3195
|
+
targetSubjectsOf: {
|
|
3196
|
+
kind: "Shacl",
|
|
3197
|
+
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#targetSubjectsOf"),
|
|
3198
|
+
type: { kind: "Set", itemType: { kind: "Iri" } },
|
|
3199
|
+
},
|
|
3222
3200
|
xone: {
|
|
3223
3201
|
kind: "Shacl",
|
|
3224
3202
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#xone"),
|
|
@@ -3294,42 +3272,26 @@ export var $Object;
|
|
|
3294
3272
|
...options,
|
|
3295
3273
|
ignoreRdfType: false,
|
|
3296
3274
|
}));
|
|
3297
|
-
$Object.fromRdfResourceValues = ((values,
|
|
3298
|
-
const valueAsValues =
|
|
3275
|
+
$Object.fromRdfResourceValues = ((values, options) => values.chainMap((value) => {
|
|
3276
|
+
const valueAsValues = value.toValues();
|
|
3299
3277
|
return NodeShape.fromRdfResourceValues(valueAsValues, {
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
ignoreRdfType: false,
|
|
3303
|
-
preferredLanguages: _options.preferredLanguages,
|
|
3304
|
-
propertyPath: _options.propertyPath,
|
|
3305
|
-
resource: _options.resource,
|
|
3278
|
+
...options,
|
|
3279
|
+
schema: options.schema.members["NodeShape"].type,
|
|
3306
3280
|
})
|
|
3307
3281
|
.altLazy(() => Ontology.fromRdfResourceValues(valueAsValues, {
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
ignoreRdfType: false,
|
|
3311
|
-
preferredLanguages: _options.preferredLanguages,
|
|
3312
|
-
propertyPath: _options.propertyPath,
|
|
3313
|
-
resource: _options.resource,
|
|
3282
|
+
...options,
|
|
3283
|
+
schema: options.schema.members["Ontology"].type,
|
|
3314
3284
|
}))
|
|
3315
3285
|
.altLazy(() => PropertyGroup.fromRdfResourceValues(valueAsValues, {
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
ignoreRdfType: false,
|
|
3319
|
-
preferredLanguages: _options.preferredLanguages,
|
|
3320
|
-
propertyPath: _options.propertyPath,
|
|
3321
|
-
resource: _options.resource,
|
|
3286
|
+
...options,
|
|
3287
|
+
schema: options.schema.members["PropertyGroup"].type,
|
|
3322
3288
|
}))
|
|
3323
3289
|
.altLazy(() => PropertyShape.fromRdfResourceValues(valueAsValues, {
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
ignoreRdfType: false,
|
|
3327
|
-
preferredLanguages: _options.preferredLanguages,
|
|
3328
|
-
propertyPath: _options.propertyPath,
|
|
3329
|
-
resource: _options.resource,
|
|
3290
|
+
...options,
|
|
3291
|
+
schema: options.schema.members["PropertyShape"].type,
|
|
3330
3292
|
}))
|
|
3331
3293
|
.chain((values) => values.head());
|
|
3332
|
-
}))
|
|
3294
|
+
}));
|
|
3333
3295
|
let Identifier;
|
|
3334
3296
|
(function (Identifier) {
|
|
3335
3297
|
Identifier.parse = $parseIdentifier;
|