@shaclmate/compiler 4.0.8 → 4.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Compiler.d.ts +1 -4
- package/dist/Compiler.js +1 -5
- package/dist/ShapesGraphToAstTransformer.d.ts +2 -11
- package/dist/ShapesGraphToAstTransformer.js +25 -27
- package/dist/_ShapesGraphToAstTransformer/defaultNodeShapeNodeKinds.d.ts +3 -0
- package/dist/_ShapesGraphToAstTransformer/defaultNodeShapeNodeKinds.js +5 -0
- package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.d.ts +4 -0
- package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +27 -0
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +74 -19
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +45 -91
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +11 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +146 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.d.ts +7 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +182 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +9 -7
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +3 -5
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +33 -10
- package/dist/ast/AbstractCompoundType.d.ts +26 -8
- package/dist/ast/AbstractCompoundType.js +84 -16
- package/dist/ast/AbstractContainerType.d.ts +2 -4
- package/dist/ast/AbstractContainerType.js +3 -4
- package/dist/ast/AbstractLazyObjectType.d.ts +1 -0
- package/dist/ast/AbstractLazyObjectType.js +3 -0
- package/dist/ast/AbstractTermType.d.ts +1 -0
- package/dist/ast/AbstractTermType.js +1 -0
- package/dist/ast/AbstractType.d.ts +16 -1
- package/dist/ast/AbstractType.js +11 -1
- package/dist/ast/Ast.d.ts +5 -5
- package/dist/ast/BlankNodeType.d.ts +1 -1
- package/dist/ast/DefaultValueType.d.ts +1 -2
- package/dist/ast/DefaultValueType.js +2 -0
- package/dist/ast/IdentifierType.d.ts +1 -1
- package/dist/ast/IntersectionType.d.ts +7 -2
- package/dist/ast/IntersectionType.js +8 -0
- package/dist/ast/ListType.d.ts +2 -9
- package/dist/ast/ListType.js +1 -9
- package/dist/ast/LiteralType.d.ts +1 -0
- package/dist/ast/LiteralType.js +26 -0
- package/dist/ast/ObjectCompoundType.d.ts +12 -0
- package/dist/ast/ObjectCompoundType.js +88 -0
- package/dist/ast/ObjectIntersectionType.d.ts +3 -7
- package/dist/ast/ObjectIntersectionType.js +1 -7
- package/dist/ast/ObjectType.d.ts +14 -31
- package/dist/ast/ObjectType.js +41 -73
- package/dist/ast/ObjectUnionType.d.ts +3 -7
- package/dist/ast/ObjectUnionType.js +1 -7
- package/dist/ast/OptionType.d.ts +1 -2
- package/dist/ast/OptionType.js +2 -0
- package/dist/ast/SetType.d.ts +1 -2
- package/dist/ast/SetType.js +2 -0
- package/dist/ast/Type.d.ts +1 -4
- package/dist/ast/Type.js +0 -6
- package/dist/ast/UnionType.d.ts +11 -6
- package/dist/ast/UnionType.js +6 -4
- package/dist/ast/index.d.ts +1 -2
- package/dist/ast/index.js +1 -2
- package/dist/generators/json/AstJsonGenerator.js +17 -15
- package/dist/generators/ts/AbstractCollectionType.d.ts +1 -1
- package/dist/generators/ts/AbstractCollectionType.js +10 -12
- package/dist/generators/ts/AbstractContainerType.d.ts +9 -4
- package/dist/generators/ts/AbstractContainerType.js +10 -3
- package/dist/generators/ts/AbstractDateType.d.ts +2 -2
- package/dist/generators/ts/AbstractDateType.js +2 -2
- package/dist/generators/ts/AbstractIdentifierType.d.ts +1 -1
- package/dist/generators/ts/AbstractIdentifierType.js +1 -1
- package/dist/generators/ts/AbstractLazyObjectType.d.ts +13 -10
- package/dist/generators/ts/AbstractLazyObjectType.js +21 -16
- package/dist/generators/ts/AbstractNamedUnionType.d.ts +33 -0
- package/dist/generators/ts/AbstractNamedUnionType.js +195 -0
- package/dist/generators/ts/AbstractNumericType.d.ts +3 -3
- package/dist/generators/ts/AbstractNumericType.js +4 -4
- package/dist/generators/ts/AbstractTermType.d.ts +7 -4
- package/dist/generators/ts/AbstractTermType.js +7 -4
- package/dist/generators/ts/AbstractType.d.ts +34 -19
- package/dist/generators/ts/AbstractUnionType.d.ts +80 -0
- package/dist/generators/ts/AbstractUnionType.js +514 -0
- package/dist/generators/ts/AnonymousUnionType.d.ts +26 -0
- package/dist/generators/ts/AnonymousUnionType.js +56 -0
- package/dist/generators/ts/BigDecimalType.d.ts +4 -4
- package/dist/generators/ts/BigDecimalType.js +5 -5
- package/dist/generators/ts/BigIntType.d.ts +1 -1
- package/dist/generators/ts/BigIntType.js +1 -1
- package/dist/generators/ts/BlankNodeType.d.ts +2 -2
- package/dist/generators/ts/BlankNodeType.js +2 -2
- package/dist/generators/ts/BooleanType.d.ts +3 -3
- package/dist/generators/ts/BooleanType.js +3 -3
- package/dist/generators/ts/DateTimeType.d.ts +1 -1
- package/dist/generators/ts/DateTimeType.js +1 -1
- package/dist/generators/ts/DateType.d.ts +1 -1
- package/dist/generators/ts/DateType.js +1 -1
- package/dist/generators/ts/DefaultValueType.d.ts +5 -5
- package/dist/generators/ts/DefaultValueType.js +17 -16
- package/dist/generators/ts/IdentifierType.d.ts +2 -2
- package/dist/generators/ts/IdentifierType.js +2 -2
- package/dist/generators/ts/IriType.d.ts +2 -2
- package/dist/generators/ts/IriType.js +2 -2
- package/dist/generators/ts/LazyObjectOptionType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectOptionType.js +10 -10
- package/dist/generators/ts/LazyObjectSetType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectSetType.js +8 -8
- package/dist/generators/ts/LazyObjectType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectType.js +9 -10
- package/dist/generators/ts/ListType.d.ts +9 -8
- package/dist/generators/ts/ListType.js +15 -14
- package/dist/generators/ts/LiteralType.d.ts +2 -2
- package/dist/generators/ts/LiteralType.js +3 -3
- package/dist/generators/ts/NamedObjectType.d.ts +126 -0
- package/dist/generators/ts/NamedObjectType.js +420 -0
- package/dist/generators/ts/NamedObjectUnionType.d.ts +35 -0
- package/dist/generators/ts/NamedObjectUnionType.js +217 -0
- package/dist/generators/ts/NamedUnionType.d.ts +11 -0
- package/dist/generators/ts/NamedUnionType.js +13 -0
- package/dist/generators/ts/OptionType.d.ts +5 -5
- package/dist/generators/ts/OptionType.js +12 -12
- package/dist/generators/ts/SetType.d.ts +4 -4
- package/dist/generators/ts/SetType.js +13 -11
- package/dist/generators/ts/StringType.d.ts +3 -3
- package/dist/generators/ts/StringType.js +3 -3
- package/dist/generators/ts/TermType.d.ts +2 -2
- package/dist/generators/ts/TermType.js +3 -3
- package/dist/generators/ts/TsGenerator.js +28 -20
- package/dist/generators/ts/Type.d.ts +5 -4
- package/dist/generators/ts/TypeFactory.d.ts +9 -7
- package/dist/generators/ts/TypeFactory.js +139 -112
- package/dist/generators/ts/ZodGenerator.js +18 -16
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/AbstractProperty.d.ts +9 -9
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/AbstractProperty.js +3 -3
- package/dist/generators/ts/{_ObjectType/TypeDiscriminantProperty.d.ts → _NamedObjectType/DiscriminantProperty.d.ts} +14 -14
- package/dist/generators/ts/{_ObjectType/TypeDiscriminantProperty.js → _NamedObjectType/DiscriminantProperty.js} +22 -20
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierPrefixProperty.d.ts +3 -3
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierPrefixProperty.js +6 -6
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierProperty.d.ts +3 -3
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierProperty.js +31 -28
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_classDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_classDeclaration.js → _NamedObjectType/NamedObjectType_classDeclaration.js} +15 -15
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_createFunctionDeclaration.js → _NamedObjectType/NamedObjectType_createFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_equalsFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_filterFunctionDeclaration.js → _NamedObjectType/NamedObjectType_filterFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_filterTypeDeclaration.js → _NamedObjectType/NamedObjectType_filterTypeDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructTriplesFunctionDeclaration.js → _NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +6 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlWherePatternsFunctionDeclarations.js → _NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +5 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +20 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_fromRdfFunctionDeclaration.js → _NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js} +6 -7
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +20 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_fromRdfTypeVariableStatement.js → _NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_graphqlTypeVariableStatement.js → _NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_hashFunctionOrMethodDeclarations.js → _NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_interfaceDeclaration.js → _NamedObjectType/NamedObjectType_interfaceDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_isTypeFunctionDeclaration.js → _NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js +19 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.js → _NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js} +5 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_jsonTypeAliasDeclaration.js → _NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js → _NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts +9 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_objectSetMethodNames.js → _NamedObjectType/NamedObjectType_objectSetMethodNames.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.js +38 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_propertiesFromRdfFunctionDeclaration.js → _NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.js} +16 -15
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_schemaVariableStatement.js → _NamedObjectType/NamedObjectType_schemaVariableStatement.js} +3 -4
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +2 -2
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js → _NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +2 -2
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js → _NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_toJsonFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_toRdfFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js} +10 -8
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +13 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js +15 -0
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/Property.d.ts +2 -2
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/ShaclProperty.d.ts +3 -3
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/ShaclProperty.js +14 -14
- package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +4 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlConstructTriplesFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlConstructTriplesFunction.js +12 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlWherePatternsFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlWherePatternsFunction.js +14 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceFunction.js +15 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.js +17 -0
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfResourceFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfResourceFunction.js +15 -0
- package/dist/generators/ts/_snippets/snippets_PropertyPath.d.ts +5 -0
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +35 -0
- package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +2 -2
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.js +7 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.js +16 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlConstructTriplesFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlConstructTriplesFunction.js +13 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlWherePatternsFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlWherePatternsFunction.js +16 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_blankNodeSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_booleanEquals.js +1 -1
- package/dist/generators/ts/_snippets/snippets_booleanSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_dateSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.js +1 -1
- package/dist/generators/ts/_snippets/snippets_identifierSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_iriSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +2 -2
- package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_literalSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_maybeSparqlConstructTriples.js +2 -2
- package/dist/generators/ts/_snippets/snippets_maybeSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_numericSparqlWherePatterns.js +2 -3
- package/dist/generators/ts/_snippets/snippets_setSparqlConstructTriples.js +2 -2
- package/dist/generators/ts/_snippets/snippets_setSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlConstructTriples.js +4 -3
- package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlWherePatterns.js +4 -3
- package/dist/generators/ts/_snippets/snippets_sparqlPropertyPath.js +3 -2
- package/dist/generators/ts/_snippets/snippets_stringSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_termSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/graphqlSchemaVariableStatement.d.ts +4 -4
- package/dist/generators/ts/graphqlSchemaVariableStatement.js +25 -25
- package/dist/generators/ts/imports.d.ts +1 -1
- package/dist/generators/ts/imports.js +1 -1
- package/dist/generators/ts/objectSetDeclarations.d.ts +5 -5
- package/dist/generators/ts/objectSetDeclarations.js +34 -31
- package/dist/generators/ts/objectSetInterfaceDeclaration.d.ts +5 -5
- package/dist/generators/ts/objectSetInterfaceDeclaration.js +6 -4
- package/dist/generators/ts/objectSetMethodSignatures.d.ts +4 -4
- package/dist/generators/ts/objectSetMethodSignatures.js +9 -9
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.d.ts +5 -5
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +54 -53
- package/dist/generators/ts/singleEntryRecord.d.ts +2 -0
- package/dist/generators/ts/singleEntryRecord.js +6 -0
- package/dist/generators/ts/snippets.d.ts +10 -6
- package/dist/generators/ts/snippets.js +20 -12
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.d.ts +5 -5
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +19 -20
- package/dist/generators/ts/synthesizeUberObjectUnionType.d.ts +4 -4
- package/dist/generators/ts/synthesizeUberObjectUnionType.js +14 -9
- package/dist/generators/ts/unsupportedObjectSetMethodDeclarations.d.ts +5 -5
- package/dist/generators/ts/unsupportedObjectSetMethodDeclarations.js +2 -2
- package/dist/input/NodeShape.d.ts +0 -1
- package/dist/input/NodeShape.js +0 -3
- package/dist/input/ShapesGraph.d.ts +3 -2
- package/dist/input/ShapesGraph.js +12 -7
- package/dist/input/generated.d.ts +1899 -88
- package/dist/input/generated.js +676 -564
- package/package.json +5 -7
- package/dist/_ShapesGraphToAstTransformer/CurieFactory.d.ts +0 -16
- package/dist/_ShapesGraphToAstTransformer/CurieFactory.js +0 -45
- package/dist/_ShapesGraphToAstTransformer/NodeShapeAstType.d.ts +0 -3
- package/dist/_ShapesGraphToAstTransformer/NodeShapeAstType.js +0 -2
- package/dist/_ShapesGraphToAstTransformer/index.d.ts +0 -6
- package/dist/_ShapesGraphToAstTransformer/index.js +0 -6
- package/dist/_ShapesGraphToAstTransformer/shapeIdentifier.d.ts +0 -5
- package/dist/_ShapesGraphToAstTransformer/shapeIdentifier.js +0 -9
- package/dist/_ShapesGraphToAstTransformer/transformNodeShapeToAstType.d.ts +0 -11
- package/dist/_ShapesGraphToAstTransformer/transformNodeShapeToAstType.js +0 -338
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstAbstractTypeProperties.d.ts +0 -12
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstAbstractTypeProperties.js +0 -31
- package/dist/ast/AbstractObjectCompoundType.d.ts +0 -45
- package/dist/ast/AbstractObjectCompoundType.js +0 -180
- package/dist/ast/Curie.d.ts +0 -21
- package/dist/ast/Curie.js +0 -29
- package/dist/ast/PlaceholderType.d.ts +0 -15
- package/dist/ast/PlaceholderType.js +0 -19
- package/dist/generators/codeName.d.ts +0 -6
- package/dist/generators/codeName.js +0 -66
- package/dist/generators/ts/AbstractDeclaredType.d.ts +0 -23
- package/dist/generators/ts/AbstractDeclaredType.js +0 -17
- package/dist/generators/ts/ObjectType.d.ts +0 -117
- package/dist/generators/ts/ObjectType.js +0 -402
- package/dist/generators/ts/ObjectUnionType.d.ts +0 -65
- package/dist/generators/ts/ObjectUnionType.js +0 -257
- package/dist/generators/ts/UnionType.d.ts +0 -40
- package/dist/generators/ts/UnionType.js +0 -527
- package/dist/generators/ts/_ObjectType/ObjectType_classDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionOrMethodDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclarations.js +0 -66
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionOrMethodDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js +0 -14
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.d.ts +0 -9
- package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromRdfFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlWherePatternsFunctionDeclarations.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionOrMethodDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfFunctionOrMethodDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/MemberType.d.ts +0 -34
- package/dist/generators/ts/_ObjectUnionType/MemberType.js +0 -105
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_equalsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_equalsFunctionDeclaration.js +0 -29
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterFunctionDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterFunctionDeclaration.js +0 -19
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterTypeDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterTypeDeclaration.js +0 -10
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromJsonFunctionDeclaration.js +0 -19
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromRdfFunctionDeclarations.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromRdfFunctionDeclarations.js +0 -20
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_graphqlTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_graphqlTypeVariableStatement.js +0 -18
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_hashFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_hashFunctionDeclaration.js +0 -28
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_identifierTypeDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_identifierTypeDeclarations.js +0 -9
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_isTypeFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_isTypeFunctionDeclaration.js +0 -13
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonTypeAliasDeclaration.js +0 -10
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.js +0 -14
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_schemaVariableStatement.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_schemaVariableStatement.js +0 -37
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlWherePatternsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlWherePatternsFunctionDeclaration.js +0 -35
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toJsonFunctionDeclaration.js +0 -26
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toRdfFunctionDeclarations.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toRdfFunctionDeclarations.js +0 -43
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_typeAliasDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_typeAliasDeclaration.js +0 -10
- package/dist/generators/ts/_snippets/snippets_FromRdfOptions.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_FromRdfOptions.js +0 -5
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfParameters.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfParameters.js +0 -5
- package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunction.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunction.js +0 -6
- package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunctionParameters.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunctionParameters.js +0 -12
- package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunction.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunction.js +0 -6
- package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunctionParameters.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunctionParameters.js +0 -15
- /package/dist/generators/ts/{_ObjectType → _NamedObjectType}/Property.js +0 -0
- /package/dist/generators/ts/{_ObjectType → _NamedObjectType}/identifierTypeDeclarations.js +0 -0
package/dist/input/generated.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import dataFactory from "@rdfjs/data-model";
|
|
2
2
|
import datasetFactory from "@rdfjs/dataset";
|
|
3
3
|
import { Either, Left, Maybe, Right } from "purify-ts";
|
|
4
|
-
import { LiteralFactory, PropertyPath, Resource, ResourceSet, } from "rdfjs-resource";
|
|
4
|
+
import { LiteralFactory, PropertyPath as RdfjsResourcePropertyPath, Resource, ResourceSet, } from "rdfjs-resource";
|
|
5
5
|
function $filterArray(filterItem) {
|
|
6
6
|
return (filter, values) => {
|
|
7
7
|
for (const value of values) {
|
|
@@ -163,6 +163,19 @@ class $IdentifierSet {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
const $literalFactory = new LiteralFactory({ dataFactory: dataFactory });
|
|
166
|
+
export var $PropertyPath;
|
|
167
|
+
(function ($PropertyPath) {
|
|
168
|
+
function $filter(_filter, _value) {
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
$PropertyPath.$filter = $filter;
|
|
172
|
+
$PropertyPath.$fromRdfResource = RdfjsResourcePropertyPath.fromResource;
|
|
173
|
+
$PropertyPath.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
174
|
+
.toResource()
|
|
175
|
+
.chain((resource) => $PropertyPath.$fromRdfResource(resource, options))));
|
|
176
|
+
$PropertyPath.$schema = {};
|
|
177
|
+
$PropertyPath.$toRdfResource = RdfjsResourcePropertyPath.toResource;
|
|
178
|
+
})($PropertyPath || ($PropertyPath = {}));
|
|
166
179
|
var $RdfVocabularies;
|
|
167
180
|
(function ($RdfVocabularies) {
|
|
168
181
|
let rdf;
|
|
@@ -337,7 +350,7 @@ export var PropertyShape;
|
|
|
337
350
|
return false;
|
|
338
351
|
}
|
|
339
352
|
if (filter.path !== undefined &&
|
|
340
|
-
|
|
353
|
+
!$PropertyPath.$filter(filter.path, value.path)) {
|
|
341
354
|
return false;
|
|
342
355
|
}
|
|
343
356
|
if (filter.patterns !== undefined &&
|
|
@@ -363,20 +376,22 @@ export var PropertyShape;
|
|
|
363
376
|
return true;
|
|
364
377
|
}
|
|
365
378
|
PropertyShape.$filter = $filter;
|
|
366
|
-
|
|
367
|
-
let { context, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
379
|
+
PropertyShape.$fromRdfResource = (resource, options) => {
|
|
380
|
+
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
368
381
|
if (!objectSet) {
|
|
369
382
|
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
370
383
|
}
|
|
371
|
-
return PropertyShape.$
|
|
384
|
+
return PropertyShape.$propertiesFromRdfResource(resource, {
|
|
372
385
|
context,
|
|
386
|
+
graph,
|
|
373
387
|
ignoreRdfType,
|
|
374
388
|
objectSet,
|
|
375
389
|
preferredLanguages,
|
|
376
|
-
resource,
|
|
377
390
|
});
|
|
378
|
-
}
|
|
379
|
-
PropertyShape.$
|
|
391
|
+
};
|
|
392
|
+
PropertyShape.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
393
|
+
.toResource()
|
|
394
|
+
.chain((resource) => PropertyShape.$fromRdfResource(resource, options))));
|
|
380
395
|
PropertyShape.$fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyShape");
|
|
381
396
|
function isPropertyShape(object) {
|
|
382
397
|
switch (object.$type) {
|
|
@@ -387,10 +402,10 @@ export var PropertyShape;
|
|
|
387
402
|
}
|
|
388
403
|
}
|
|
389
404
|
PropertyShape.isPropertyShape = isPropertyShape;
|
|
390
|
-
|
|
391
|
-
return (
|
|
392
|
-
? $
|
|
393
|
-
.value($RdfVocabularies.rdf.type, { graph: $
|
|
405
|
+
PropertyShape.$propertiesFromRdfResource = ($resource, _$options) => {
|
|
406
|
+
return (!_$options.ignoreRdfType
|
|
407
|
+
? $resource
|
|
408
|
+
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
394
409
|
.chain((actualRdfType) => actualRdfType.toIri())
|
|
395
410
|
.chain((actualRdfType) => {
|
|
396
411
|
// Check the expected type and its known subtypes
|
|
@@ -399,95 +414,95 @@ export var PropertyShape;
|
|
|
399
414
|
return Right(true);
|
|
400
415
|
}
|
|
401
416
|
// Check arbitrary rdfs:subClassOf's of the expected type
|
|
402
|
-
if ($
|
|
403
|
-
graph: $
|
|
417
|
+
if ($resource.isInstanceOf(PropertyShape.$fromRdfType, {
|
|
418
|
+
graph: _$options.graph,
|
|
404
419
|
})) {
|
|
405
420
|
return Right(true);
|
|
406
421
|
}
|
|
407
|
-
return Left(new Error(`${Resource.Identifier.toString($
|
|
422
|
+
return Left(new Error(`${Resource.Identifier.toString($resource.identifier)} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#PropertyShape)`));
|
|
408
423
|
})
|
|
409
424
|
: Right(true)).chain((_rdfTypeCheck) => Right(new Resource.Value({
|
|
410
425
|
dataFactory: dataFactory,
|
|
411
|
-
focusResource: $
|
|
426
|
+
focusResource: $resource,
|
|
412
427
|
propertyPath: $RdfVocabularies.rdf.subject,
|
|
413
|
-
term: $
|
|
428
|
+
term: $resource.identifier,
|
|
414
429
|
}).toValues())
|
|
415
430
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
416
431
|
.chain((values) => values.head())
|
|
417
432
|
.chain(($identifier) => Right("PropertyShape").chain(($type) => $shaclPropertyFromRdf({
|
|
418
|
-
graph: $
|
|
419
|
-
resource: $
|
|
433
|
+
graph: _$options.graph,
|
|
434
|
+
resource: $resource,
|
|
420
435
|
propertySchema: PropertyShape.$schema.properties.and,
|
|
421
436
|
typeFromRdf: (resourceValues) => resourceValues
|
|
422
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: $
|
|
437
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
423
438
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
424
|
-
focusResource: $
|
|
439
|
+
focusResource: $resource,
|
|
425
440
|
propertyPath: PropertyShape.$schema.properties.and.path,
|
|
426
441
|
values: valueList.toArray(),
|
|
427
442
|
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
428
443
|
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
429
444
|
.map((values) => values.toArray())
|
|
430
445
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
431
|
-
focusResource: $
|
|
446
|
+
focusResource: $resource,
|
|
432
447
|
propertyPath: PropertyShape.$schema.properties.and.path,
|
|
433
448
|
value: valuesArray,
|
|
434
449
|
})),
|
|
435
450
|
}).chain((and) => $shaclPropertyFromRdf({
|
|
436
|
-
graph: $
|
|
437
|
-
resource: $
|
|
451
|
+
graph: _$options.graph,
|
|
452
|
+
resource: $resource,
|
|
438
453
|
propertySchema: PropertyShape.$schema.properties.classes,
|
|
439
454
|
typeFromRdf: (resourceValues) => resourceValues
|
|
440
455
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
441
456
|
.map((values) => values.toArray())
|
|
442
457
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
443
|
-
focusResource: $
|
|
458
|
+
focusResource: $resource,
|
|
444
459
|
propertyPath: PropertyShape.$schema.properties.classes.path,
|
|
445
460
|
value: valuesArray,
|
|
446
461
|
})),
|
|
447
462
|
}).chain((classes) => $shaclPropertyFromRdf({
|
|
448
|
-
graph: $
|
|
449
|
-
resource: $
|
|
463
|
+
graph: _$options.graph,
|
|
464
|
+
resource: $resource,
|
|
450
465
|
propertySchema: PropertyShape.$schema.properties.comments,
|
|
451
466
|
typeFromRdf: (resourceValues) => resourceValues
|
|
452
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
467
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
453
468
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
454
469
|
.map((values) => values.toArray())
|
|
455
470
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
456
|
-
focusResource: $
|
|
471
|
+
focusResource: $resource,
|
|
457
472
|
propertyPath: PropertyShape.$schema.properties.comments.path,
|
|
458
473
|
value: valuesArray,
|
|
459
474
|
})),
|
|
460
475
|
}).chain((comments) => $shaclPropertyFromRdf({
|
|
461
|
-
graph: $
|
|
462
|
-
resource: $
|
|
476
|
+
graph: _$options.graph,
|
|
477
|
+
resource: $resource,
|
|
463
478
|
propertySchema: PropertyShape.$schema.properties.datatype,
|
|
464
479
|
typeFromRdf: (resourceValues) => resourceValues
|
|
465
480
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
466
481
|
.map((values) => values.length > 0
|
|
467
482
|
? values.map((value) => Maybe.of(value))
|
|
468
483
|
: Resource.Values.fromValue({
|
|
469
|
-
focusResource: $
|
|
484
|
+
focusResource: $resource,
|
|
470
485
|
propertyPath: PropertyShape.$schema.properties.datatype
|
|
471
486
|
.path,
|
|
472
487
|
value: Maybe.empty(),
|
|
473
488
|
})),
|
|
474
489
|
}).chain((datatype) => $shaclPropertyFromRdf({
|
|
475
|
-
graph: $
|
|
476
|
-
resource: $
|
|
490
|
+
graph: _$options.graph,
|
|
491
|
+
resource: $resource,
|
|
477
492
|
propertySchema: PropertyShape.$schema.properties.deactivated,
|
|
478
493
|
typeFromRdf: (resourceValues) => resourceValues
|
|
479
494
|
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
480
495
|
.map((values) => values.length > 0
|
|
481
496
|
? values.map((value) => Maybe.of(value))
|
|
482
497
|
: Resource.Values.fromValue({
|
|
483
|
-
focusResource: $
|
|
498
|
+
focusResource: $resource,
|
|
484
499
|
propertyPath: PropertyShape.$schema.properties.deactivated
|
|
485
500
|
.path,
|
|
486
501
|
value: Maybe.empty(),
|
|
487
502
|
})),
|
|
488
503
|
}).chain((deactivated) => $shaclPropertyFromRdf({
|
|
489
|
-
graph: $
|
|
490
|
-
resource: $
|
|
504
|
+
graph: _$options.graph,
|
|
505
|
+
resource: $resource,
|
|
491
506
|
propertySchema: PropertyShape.$schema.properties.defaultValue,
|
|
492
507
|
typeFromRdf: (resourceValues) => resourceValues
|
|
493
508
|
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
@@ -499,7 +514,7 @@ export var PropertyShape;
|
|
|
499
514
|
return Left(new Resource.MistypedTermValueError({
|
|
500
515
|
actualValue: term,
|
|
501
516
|
expectedValueType: "(NamedNode | Literal)",
|
|
502
|
-
focusResource: $
|
|
517
|
+
focusResource: $resource,
|
|
503
518
|
propertyPath: PropertyShape.$schema.properties
|
|
504
519
|
.defaultValue.path,
|
|
505
520
|
}));
|
|
@@ -508,55 +523,55 @@ export var PropertyShape;
|
|
|
508
523
|
.map((values) => values.length > 0
|
|
509
524
|
? values.map((value) => Maybe.of(value))
|
|
510
525
|
: Resource.Values.fromValue({
|
|
511
|
-
focusResource: $
|
|
526
|
+
focusResource: $resource,
|
|
512
527
|
propertyPath: PropertyShape.$schema.properties
|
|
513
528
|
.defaultValue.path,
|
|
514
529
|
value: Maybe.empty(),
|
|
515
530
|
})),
|
|
516
531
|
}).chain((defaultValue) => $shaclPropertyFromRdf({
|
|
517
|
-
graph: $
|
|
518
|
-
resource: $
|
|
532
|
+
graph: _$options.graph,
|
|
533
|
+
resource: $resource,
|
|
519
534
|
propertySchema: PropertyShape.$schema.properties.descriptions,
|
|
520
535
|
typeFromRdf: (resourceValues) => resourceValues
|
|
521
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
536
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
522
537
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
523
538
|
.map((values) => values.toArray())
|
|
524
539
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
525
|
-
focusResource: $
|
|
540
|
+
focusResource: $resource,
|
|
526
541
|
propertyPath: PropertyShape.$schema.properties
|
|
527
542
|
.descriptions.path,
|
|
528
543
|
value: valuesArray,
|
|
529
544
|
})),
|
|
530
545
|
}).chain((descriptions) => $shaclPropertyFromRdf({
|
|
531
|
-
graph: $
|
|
532
|
-
resource: $
|
|
546
|
+
graph: _$options.graph,
|
|
547
|
+
resource: $resource,
|
|
533
548
|
propertySchema: PropertyShape.$schema.properties.flags,
|
|
534
549
|
typeFromRdf: (resourceValues) => resourceValues
|
|
535
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
550
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
536
551
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
537
552
|
.map((values) => values.toArray())
|
|
538
553
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
539
|
-
focusResource: $
|
|
554
|
+
focusResource: $resource,
|
|
540
555
|
propertyPath: PropertyShape.$schema.properties.flags
|
|
541
556
|
.path,
|
|
542
557
|
value: valuesArray,
|
|
543
558
|
})),
|
|
544
559
|
}).chain((flags) => $shaclPropertyFromRdf({
|
|
545
|
-
graph: $
|
|
546
|
-
resource: $
|
|
560
|
+
graph: _$options.graph,
|
|
561
|
+
resource: $resource,
|
|
547
562
|
propertySchema: PropertyShape.$schema.properties.groups,
|
|
548
563
|
typeFromRdf: (resourceValues) => resourceValues
|
|
549
564
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
550
565
|
.map((values) => values.toArray())
|
|
551
566
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
552
|
-
focusResource: $
|
|
567
|
+
focusResource: $resource,
|
|
553
568
|
propertyPath: PropertyShape.$schema.properties.groups
|
|
554
569
|
.path,
|
|
555
570
|
value: valuesArray,
|
|
556
571
|
})),
|
|
557
572
|
}).chain((groups) => $shaclPropertyFromRdf({
|
|
558
|
-
graph: $
|
|
559
|
-
resource: $
|
|
573
|
+
graph: _$options.graph,
|
|
574
|
+
resource: $resource,
|
|
560
575
|
propertySchema: PropertyShape.$schema.properties.hasValues,
|
|
561
576
|
typeFromRdf: (resourceValues) => resourceValues
|
|
562
577
|
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
@@ -568,7 +583,7 @@ export var PropertyShape;
|
|
|
568
583
|
return Left(new Resource.MistypedTermValueError({
|
|
569
584
|
actualValue: term,
|
|
570
585
|
expectedValueType: "(NamedNode | Literal)",
|
|
571
|
-
focusResource: $
|
|
586
|
+
focusResource: $resource,
|
|
572
587
|
propertyPath: PropertyShape.$schema
|
|
573
588
|
.properties.hasValues
|
|
574
589
|
.path,
|
|
@@ -577,21 +592,21 @@ export var PropertyShape;
|
|
|
577
592
|
})))
|
|
578
593
|
.map((values) => values.toArray())
|
|
579
594
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
580
|
-
focusResource: $
|
|
595
|
+
focusResource: $resource,
|
|
581
596
|
propertyPath: PropertyShape.$schema.properties
|
|
582
597
|
.hasValues.path,
|
|
583
598
|
value: valuesArray,
|
|
584
599
|
})),
|
|
585
600
|
}).chain((hasValues) => $shaclPropertyFromRdf({
|
|
586
|
-
graph: $
|
|
587
|
-
resource: $
|
|
601
|
+
graph: _$options.graph,
|
|
602
|
+
resource: $resource,
|
|
588
603
|
propertySchema: PropertyShape.$schema.properties.in_,
|
|
589
604
|
typeFromRdf: (resourceValues) => resourceValues
|
|
590
605
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
591
|
-
graph: $
|
|
606
|
+
graph: _$options.graph,
|
|
592
607
|
})))
|
|
593
608
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
594
|
-
focusResource: $
|
|
609
|
+
focusResource: $resource,
|
|
595
610
|
propertyPath: PropertyShape.$schema.properties
|
|
596
611
|
.in_.path,
|
|
597
612
|
values: valueList.toArray(),
|
|
@@ -604,7 +619,7 @@ export var PropertyShape;
|
|
|
604
619
|
return Left(new Resource.MistypedTermValueError({
|
|
605
620
|
actualValue: term,
|
|
606
621
|
expectedValueType: "(NamedNode | Literal)",
|
|
607
|
-
focusResource: $
|
|
622
|
+
focusResource: $resource,
|
|
608
623
|
propertyPath: PropertyShape
|
|
609
624
|
.$schema
|
|
610
625
|
.properties.in_
|
|
@@ -616,109 +631,109 @@ export var PropertyShape;
|
|
|
616
631
|
.map((values) => values.length > 0
|
|
617
632
|
? values.map((value) => Maybe.of(value))
|
|
618
633
|
: Resource.Values.fromValue({
|
|
619
|
-
focusResource: $
|
|
634
|
+
focusResource: $resource,
|
|
620
635
|
propertyPath: PropertyShape.$schema.properties
|
|
621
636
|
.in_.path,
|
|
622
637
|
value: Maybe.empty(),
|
|
623
638
|
})),
|
|
624
639
|
}).chain((in_) => $shaclPropertyFromRdf({
|
|
625
|
-
graph: $
|
|
626
|
-
resource: $
|
|
640
|
+
graph: _$options.graph,
|
|
641
|
+
resource: $resource,
|
|
627
642
|
propertySchema: PropertyShape.$schema.properties.isDefinedBy,
|
|
628
643
|
typeFromRdf: (resourceValues) => resourceValues
|
|
629
644
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
630
645
|
.map((values) => values.length > 0
|
|
631
646
|
? values.map((value) => Maybe.of(value))
|
|
632
647
|
: Resource.Values.fromValue({
|
|
633
|
-
focusResource: $
|
|
648
|
+
focusResource: $resource,
|
|
634
649
|
propertyPath: PropertyShape.$schema
|
|
635
650
|
.properties.isDefinedBy
|
|
636
651
|
.path,
|
|
637
652
|
value: Maybe.empty(),
|
|
638
653
|
})),
|
|
639
654
|
}).chain((isDefinedBy) => $shaclPropertyFromRdf({
|
|
640
|
-
graph: $
|
|
641
|
-
resource: $
|
|
655
|
+
graph: _$options.graph,
|
|
656
|
+
resource: $resource,
|
|
642
657
|
propertySchema: PropertyShape.$schema.properties.labels,
|
|
643
658
|
typeFromRdf: (resourceValues) => resourceValues
|
|
644
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
659
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
645
660
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
646
661
|
.map((values) => values.toArray())
|
|
647
662
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
648
|
-
focusResource: $
|
|
663
|
+
focusResource: $resource,
|
|
649
664
|
propertyPath: PropertyShape.$schema.properties
|
|
650
665
|
.labels.path,
|
|
651
666
|
value: valuesArray,
|
|
652
667
|
})),
|
|
653
668
|
}).chain((labels) => $shaclPropertyFromRdf({
|
|
654
|
-
graph: $
|
|
655
|
-
resource: $
|
|
669
|
+
graph: _$options.graph,
|
|
670
|
+
resource: $resource,
|
|
656
671
|
propertySchema: PropertyShape.$schema.properties.languageIn,
|
|
657
672
|
typeFromRdf: (resourceValues) => resourceValues
|
|
658
673
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
659
|
-
graph: $
|
|
674
|
+
graph: _$options.graph,
|
|
660
675
|
})))
|
|
661
676
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
662
|
-
focusResource: $
|
|
677
|
+
focusResource: $resource,
|
|
663
678
|
propertyPath: PropertyShape.$schema
|
|
664
679
|
.properties.languageIn
|
|
665
680
|
.path,
|
|
666
681
|
values: valueList.toArray(),
|
|
667
682
|
}))
|
|
668
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
683
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
669
684
|
.chain((values) => values.chainMap((value) => value.toString()))))
|
|
670
685
|
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
671
686
|
.map((values) => values.length > 0
|
|
672
687
|
? values.map((value) => Maybe.of(value))
|
|
673
688
|
: Resource.Values.fromValue({
|
|
674
|
-
focusResource: $
|
|
689
|
+
focusResource: $resource,
|
|
675
690
|
propertyPath: PropertyShape.$schema
|
|
676
691
|
.properties.languageIn
|
|
677
692
|
.path,
|
|
678
693
|
value: Maybe.empty(),
|
|
679
694
|
})),
|
|
680
695
|
}).chain((languageIn) => $shaclPropertyFromRdf({
|
|
681
|
-
graph: $
|
|
682
|
-
resource: $
|
|
696
|
+
graph: _$options.graph,
|
|
697
|
+
resource: $resource,
|
|
683
698
|
propertySchema: PropertyShape.$schema.properties.maxCount,
|
|
684
699
|
typeFromRdf: (resourceValues) => resourceValues
|
|
685
700
|
.chain((values) => values.chainMap((value) => value.toInt()))
|
|
686
701
|
.map((values) => values.length > 0
|
|
687
702
|
? values.map((value) => Maybe.of(value))
|
|
688
703
|
: Resource.Values.fromValue({
|
|
689
|
-
focusResource: $
|
|
704
|
+
focusResource: $resource,
|
|
690
705
|
propertyPath: PropertyShape.$schema
|
|
691
706
|
.properties.maxCount
|
|
692
707
|
.path,
|
|
693
708
|
value: Maybe.empty(),
|
|
694
709
|
})),
|
|
695
710
|
}).chain((maxCount) => $shaclPropertyFromRdf({
|
|
696
|
-
graph: $
|
|
697
|
-
resource: $
|
|
711
|
+
graph: _$options.graph,
|
|
712
|
+
resource: $resource,
|
|
698
713
|
propertySchema: PropertyShape.$schema.properties.maxExclusive,
|
|
699
714
|
typeFromRdf: (resourceValues) => resourceValues
|
|
700
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
715
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
701
716
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
702
717
|
.map((values) => values.length > 0
|
|
703
718
|
? values.map((value) => Maybe.of(value))
|
|
704
719
|
: Resource.Values.fromValue({
|
|
705
|
-
focusResource: $
|
|
720
|
+
focusResource: $resource,
|
|
706
721
|
propertyPath: PropertyShape.$schema
|
|
707
722
|
.properties
|
|
708
723
|
.maxExclusive.path,
|
|
709
724
|
value: Maybe.empty(),
|
|
710
725
|
})),
|
|
711
726
|
}).chain((maxExclusive) => $shaclPropertyFromRdf({
|
|
712
|
-
graph: $
|
|
713
|
-
resource: $
|
|
727
|
+
graph: _$options.graph,
|
|
728
|
+
resource: $resource,
|
|
714
729
|
propertySchema: PropertyShape.$schema.properties.maxInclusive,
|
|
715
730
|
typeFromRdf: (resourceValues) => resourceValues
|
|
716
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
731
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
717
732
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
718
733
|
.map((values) => values.length > 0
|
|
719
734
|
? values.map((value) => Maybe.of(value))
|
|
720
735
|
: Resource.Values.fromValue({
|
|
721
|
-
focusResource: $
|
|
736
|
+
focusResource: $resource,
|
|
722
737
|
propertyPath: PropertyShape
|
|
723
738
|
.$schema
|
|
724
739
|
.properties
|
|
@@ -727,15 +742,15 @@ export var PropertyShape;
|
|
|
727
742
|
value: Maybe.empty(),
|
|
728
743
|
})),
|
|
729
744
|
}).chain((maxInclusive) => $shaclPropertyFromRdf({
|
|
730
|
-
graph: $
|
|
731
|
-
resource: $
|
|
745
|
+
graph: _$options.graph,
|
|
746
|
+
resource: $resource,
|
|
732
747
|
propertySchema: PropertyShape.$schema.properties.maxLength,
|
|
733
748
|
typeFromRdf: (resourceValues) => resourceValues
|
|
734
749
|
.chain((values) => values.chainMap((value) => value.toInt()))
|
|
735
750
|
.map((values) => values.length > 0
|
|
736
751
|
? values.map((value) => Maybe.of(value))
|
|
737
752
|
: Resource.Values.fromValue({
|
|
738
|
-
focusResource: $
|
|
753
|
+
focusResource: $resource,
|
|
739
754
|
propertyPath: PropertyShape
|
|
740
755
|
.$schema
|
|
741
756
|
.properties
|
|
@@ -743,15 +758,15 @@ export var PropertyShape;
|
|
|
743
758
|
value: Maybe.empty(),
|
|
744
759
|
})),
|
|
745
760
|
}).chain((maxLength) => $shaclPropertyFromRdf({
|
|
746
|
-
graph: $
|
|
747
|
-
resource: $
|
|
761
|
+
graph: _$options.graph,
|
|
762
|
+
resource: $resource,
|
|
748
763
|
propertySchema: PropertyShape.$schema.properties.minCount,
|
|
749
764
|
typeFromRdf: (resourceValues) => resourceValues
|
|
750
765
|
.chain((values) => values.chainMap((value) => value.toInt()))
|
|
751
766
|
.map((values) => values.length > 0
|
|
752
767
|
? values.map((value) => Maybe.of(value))
|
|
753
768
|
: Resource.Values.fromValue({
|
|
754
|
-
focusResource: $
|
|
769
|
+
focusResource: $resource,
|
|
755
770
|
propertyPath: PropertyShape
|
|
756
771
|
.$schema
|
|
757
772
|
.properties
|
|
@@ -760,17 +775,17 @@ export var PropertyShape;
|
|
|
760
775
|
value: Maybe.empty(),
|
|
761
776
|
})),
|
|
762
777
|
}).chain((minCount) => $shaclPropertyFromRdf({
|
|
763
|
-
graph: $
|
|
764
|
-
resource: $
|
|
778
|
+
graph: _$options.graph,
|
|
779
|
+
resource: $resource,
|
|
765
780
|
propertySchema: PropertyShape.$schema.properties
|
|
766
781
|
.minExclusive,
|
|
767
782
|
typeFromRdf: (resourceValues) => resourceValues
|
|
768
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
783
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
769
784
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
770
785
|
.map((values) => values.length > 0
|
|
771
786
|
? values.map((value) => Maybe.of(value))
|
|
772
787
|
: Resource.Values.fromValue({
|
|
773
|
-
focusResource: $
|
|
788
|
+
focusResource: $resource,
|
|
774
789
|
propertyPath: PropertyShape
|
|
775
790
|
.$schema
|
|
776
791
|
.properties
|
|
@@ -779,17 +794,17 @@ export var PropertyShape;
|
|
|
779
794
|
value: Maybe.empty(),
|
|
780
795
|
})),
|
|
781
796
|
}).chain((minExclusive) => $shaclPropertyFromRdf({
|
|
782
|
-
graph: $
|
|
783
|
-
resource: $
|
|
797
|
+
graph: _$options.graph,
|
|
798
|
+
resource: $resource,
|
|
784
799
|
propertySchema: PropertyShape.$schema.properties
|
|
785
800
|
.minInclusive,
|
|
786
801
|
typeFromRdf: (resourceValues) => resourceValues
|
|
787
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
802
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
788
803
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
789
804
|
.map((values) => values.length > 0
|
|
790
805
|
? values.map((value) => Maybe.of(value))
|
|
791
806
|
: Resource.Values.fromValue({
|
|
792
|
-
focusResource: $
|
|
807
|
+
focusResource: $resource,
|
|
793
808
|
propertyPath: PropertyShape
|
|
794
809
|
.$schema
|
|
795
810
|
.properties
|
|
@@ -798,8 +813,8 @@ export var PropertyShape;
|
|
|
798
813
|
value: Maybe.empty(),
|
|
799
814
|
})),
|
|
800
815
|
}).chain((minInclusive) => $shaclPropertyFromRdf({
|
|
801
|
-
graph: $
|
|
802
|
-
resource: $
|
|
816
|
+
graph: _$options.graph,
|
|
817
|
+
resource: $resource,
|
|
803
818
|
propertySchema: PropertyShape.$schema.properties
|
|
804
819
|
.minLength,
|
|
805
820
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -807,7 +822,7 @@ export var PropertyShape;
|
|
|
807
822
|
.map((values) => values.length > 0
|
|
808
823
|
? values.map((value) => Maybe.of(value))
|
|
809
824
|
: Resource.Values.fromValue({
|
|
810
|
-
focusResource: $
|
|
825
|
+
focusResource: $resource,
|
|
811
826
|
propertyPath: PropertyShape
|
|
812
827
|
.$schema
|
|
813
828
|
.properties
|
|
@@ -816,8 +831,8 @@ export var PropertyShape;
|
|
|
816
831
|
value: Maybe.empty(),
|
|
817
832
|
})),
|
|
818
833
|
}).chain((minLength) => $shaclPropertyFromRdf({
|
|
819
|
-
graph: $
|
|
820
|
-
resource: $
|
|
834
|
+
graph: _$options.graph,
|
|
835
|
+
resource: $resource,
|
|
821
836
|
propertySchema: PropertyShape.$schema.properties
|
|
822
837
|
.mutable,
|
|
823
838
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -826,7 +841,7 @@ export var PropertyShape;
|
|
|
826
841
|
0
|
|
827
842
|
? values.map((value) => Maybe.of(value))
|
|
828
843
|
: Resource.Values.fromValue({
|
|
829
|
-
focusResource: $
|
|
844
|
+
focusResource: $resource,
|
|
830
845
|
propertyPath: PropertyShape
|
|
831
846
|
.$schema
|
|
832
847
|
.properties
|
|
@@ -835,19 +850,19 @@ export var PropertyShape;
|
|
|
835
850
|
value: Maybe.empty(),
|
|
836
851
|
})),
|
|
837
852
|
}).chain((mutable) => $shaclPropertyFromRdf({
|
|
838
|
-
graph: $
|
|
839
|
-
resource: $
|
|
853
|
+
graph: _$options.graph,
|
|
854
|
+
resource: $resource,
|
|
840
855
|
propertySchema: PropertyShape.$schema
|
|
841
856
|
.properties
|
|
842
857
|
.name,
|
|
843
858
|
typeFromRdf: (resourceValues) => resourceValues
|
|
844
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
859
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
845
860
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
846
861
|
.map((values) => values.length >
|
|
847
862
|
0
|
|
848
863
|
? values.map((value) => Maybe.of(value))
|
|
849
864
|
: Resource.Values.fromValue({
|
|
850
|
-
focusResource: $
|
|
865
|
+
focusResource: $resource,
|
|
851
866
|
propertyPath: PropertyShape
|
|
852
867
|
.$schema
|
|
853
868
|
.properties
|
|
@@ -856,17 +871,17 @@ export var PropertyShape;
|
|
|
856
871
|
value: Maybe.empty(),
|
|
857
872
|
})),
|
|
858
873
|
}).chain((name) => $shaclPropertyFromRdf({
|
|
859
|
-
graph: $
|
|
860
|
-
resource: $
|
|
874
|
+
graph: _$options.graph,
|
|
875
|
+
resource: $resource,
|
|
861
876
|
propertySchema: PropertyShape.$schema
|
|
862
877
|
.properties
|
|
863
878
|
.names,
|
|
864
879
|
typeFromRdf: (resourceValues) => resourceValues
|
|
865
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
880
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
866
881
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
867
882
|
.map((values) => values.toArray())
|
|
868
883
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
869
|
-
focusResource: $
|
|
884
|
+
focusResource: $resource,
|
|
870
885
|
propertyPath: PropertyShape
|
|
871
886
|
.$schema
|
|
872
887
|
.properties
|
|
@@ -875,8 +890,8 @@ export var PropertyShape;
|
|
|
875
890
|
value: valuesArray,
|
|
876
891
|
})),
|
|
877
892
|
}).chain((names) => $shaclPropertyFromRdf({
|
|
878
|
-
graph: $
|
|
879
|
-
resource: $
|
|
893
|
+
graph: _$options.graph,
|
|
894
|
+
resource: $resource,
|
|
880
895
|
propertySchema: PropertyShape.$schema
|
|
881
896
|
.properties
|
|
882
897
|
.nodeKind,
|
|
@@ -893,7 +908,7 @@ export var PropertyShape;
|
|
|
893
908
|
0
|
|
894
909
|
? values.map((value) => Maybe.of(value))
|
|
895
910
|
: Resource.Values.fromValue({
|
|
896
|
-
focusResource: $
|
|
911
|
+
focusResource: $resource,
|
|
897
912
|
propertyPath: PropertyShape
|
|
898
913
|
.$schema
|
|
899
914
|
.properties
|
|
@@ -902,8 +917,8 @@ export var PropertyShape;
|
|
|
902
917
|
value: Maybe.empty(),
|
|
903
918
|
})),
|
|
904
919
|
}).chain((nodeKind) => $shaclPropertyFromRdf({
|
|
905
|
-
graph: $
|
|
906
|
-
resource: $
|
|
920
|
+
graph: _$options.graph,
|
|
921
|
+
resource: $resource,
|
|
907
922
|
propertySchema: PropertyShape.$schema
|
|
908
923
|
.properties
|
|
909
924
|
.nodes,
|
|
@@ -911,7 +926,7 @@ export var PropertyShape;
|
|
|
911
926
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
912
927
|
.map((values) => values.toArray())
|
|
913
928
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
914
|
-
focusResource: $
|
|
929
|
+
focusResource: $resource,
|
|
915
930
|
propertyPath: PropertyShape
|
|
916
931
|
.$schema
|
|
917
932
|
.properties
|
|
@@ -920,8 +935,8 @@ export var PropertyShape;
|
|
|
920
935
|
value: valuesArray,
|
|
921
936
|
})),
|
|
922
937
|
}).chain((nodes) => $shaclPropertyFromRdf({
|
|
923
|
-
graph: $
|
|
924
|
-
resource: $
|
|
938
|
+
graph: _$options.graph,
|
|
939
|
+
resource: $resource,
|
|
925
940
|
propertySchema: PropertyShape.$schema
|
|
926
941
|
.properties
|
|
927
942
|
.not,
|
|
@@ -929,7 +944,7 @@ export var PropertyShape;
|
|
|
929
944
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
930
945
|
.map((values) => values.toArray())
|
|
931
946
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
932
|
-
focusResource: $
|
|
947
|
+
focusResource: $resource,
|
|
933
948
|
propertyPath: PropertyShape
|
|
934
949
|
.$schema
|
|
935
950
|
.properties
|
|
@@ -938,17 +953,17 @@ export var PropertyShape;
|
|
|
938
953
|
value: valuesArray,
|
|
939
954
|
})),
|
|
940
955
|
}).chain((not) => $shaclPropertyFromRdf({
|
|
941
|
-
graph: $
|
|
942
|
-
resource: $
|
|
956
|
+
graph: _$options.graph,
|
|
957
|
+
resource: $resource,
|
|
943
958
|
propertySchema: PropertyShape.$schema
|
|
944
959
|
.properties
|
|
945
960
|
.or,
|
|
946
961
|
typeFromRdf: (resourceValues) => resourceValues
|
|
947
962
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
948
|
-
graph: $
|
|
963
|
+
graph: _$options.graph,
|
|
949
964
|
})))
|
|
950
965
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
951
|
-
focusResource: $
|
|
966
|
+
focusResource: $resource,
|
|
952
967
|
propertyPath: PropertyShape
|
|
953
968
|
.$schema
|
|
954
969
|
.properties
|
|
@@ -959,7 +974,7 @@ export var PropertyShape;
|
|
|
959
974
|
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
960
975
|
.map((values) => values.toArray())
|
|
961
976
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
962
|
-
focusResource: $
|
|
977
|
+
focusResource: $resource,
|
|
963
978
|
propertyPath: PropertyShape
|
|
964
979
|
.$schema
|
|
965
980
|
.properties
|
|
@@ -968,8 +983,8 @@ export var PropertyShape;
|
|
|
968
983
|
value: valuesArray,
|
|
969
984
|
})),
|
|
970
985
|
}).chain((or) => $shaclPropertyFromRdf({
|
|
971
|
-
graph: $
|
|
972
|
-
resource: $
|
|
986
|
+
graph: _$options.graph,
|
|
987
|
+
resource: $resource,
|
|
973
988
|
propertySchema: PropertyShape.$schema
|
|
974
989
|
.properties
|
|
975
990
|
.order,
|
|
@@ -979,7 +994,7 @@ export var PropertyShape;
|
|
|
979
994
|
0
|
|
980
995
|
? values.map((value) => Maybe.of(value))
|
|
981
996
|
: Resource.Values.fromValue({
|
|
982
|
-
focusResource: $
|
|
997
|
+
focusResource: $resource,
|
|
983
998
|
propertyPath: PropertyShape
|
|
984
999
|
.$schema
|
|
985
1000
|
.properties
|
|
@@ -988,31 +1003,36 @@ export var PropertyShape;
|
|
|
988
1003
|
value: Maybe.empty(),
|
|
989
1004
|
})),
|
|
990
1005
|
}).chain((order) => $shaclPropertyFromRdf({
|
|
991
|
-
graph: $
|
|
992
|
-
resource: $
|
|
1006
|
+
graph: _$options.graph,
|
|
1007
|
+
resource: $resource,
|
|
993
1008
|
propertySchema: PropertyShape.$schema
|
|
994
1009
|
.properties
|
|
995
1010
|
.path,
|
|
996
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
997
|
-
.
|
|
998
|
-
.
|
|
999
|
-
|
|
1011
|
+
typeFromRdf: (resourceValues) => $PropertyPath.$fromRdfResourceValues(resourceValues, {
|
|
1012
|
+
context: _$options.context,
|
|
1013
|
+
graph: _$options.graph,
|
|
1014
|
+
preferredLanguages: _$options.preferredLanguages,
|
|
1015
|
+
objectSet: _$options.objectSet,
|
|
1016
|
+
resource: $resource,
|
|
1000
1017
|
ignoreRdfType: true,
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1018
|
+
propertyPath: PropertyShape
|
|
1019
|
+
.$schema
|
|
1020
|
+
.properties
|
|
1021
|
+
.path
|
|
1022
|
+
.path,
|
|
1023
|
+
}),
|
|
1004
1024
|
}).chain((path) => $shaclPropertyFromRdf({
|
|
1005
|
-
graph: $
|
|
1006
|
-
resource: $
|
|
1025
|
+
graph: _$options.graph,
|
|
1026
|
+
resource: $resource,
|
|
1007
1027
|
propertySchema: PropertyShape.$schema
|
|
1008
1028
|
.properties
|
|
1009
1029
|
.patterns,
|
|
1010
1030
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1011
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
1031
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1012
1032
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1013
1033
|
.map((values) => values.toArray())
|
|
1014
1034
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1015
|
-
focusResource: $
|
|
1035
|
+
focusResource: $resource,
|
|
1016
1036
|
propertyPath: PropertyShape
|
|
1017
1037
|
.$schema
|
|
1018
1038
|
.properties
|
|
@@ -1021,8 +1041,8 @@ export var PropertyShape;
|
|
|
1021
1041
|
value: valuesArray,
|
|
1022
1042
|
})),
|
|
1023
1043
|
}).chain((patterns) => $shaclPropertyFromRdf({
|
|
1024
|
-
graph: $
|
|
1025
|
-
resource: $
|
|
1044
|
+
graph: _$options.graph,
|
|
1045
|
+
resource: $resource,
|
|
1026
1046
|
propertySchema: PropertyShape.$schema
|
|
1027
1047
|
.properties
|
|
1028
1048
|
.resolve,
|
|
@@ -1032,7 +1052,7 @@ export var PropertyShape;
|
|
|
1032
1052
|
0
|
|
1033
1053
|
? values.map((value) => Maybe.of(value))
|
|
1034
1054
|
: Resource.Values.fromValue({
|
|
1035
|
-
focusResource: $
|
|
1055
|
+
focusResource: $resource,
|
|
1036
1056
|
propertyPath: PropertyShape
|
|
1037
1057
|
.$schema
|
|
1038
1058
|
.properties
|
|
@@ -1041,8 +1061,8 @@ export var PropertyShape;
|
|
|
1041
1061
|
value: Maybe.empty(),
|
|
1042
1062
|
})),
|
|
1043
1063
|
}).chain((resolve) => $shaclPropertyFromRdf({
|
|
1044
|
-
graph: $
|
|
1045
|
-
resource: $
|
|
1064
|
+
graph: _$options.graph,
|
|
1065
|
+
resource: $resource,
|
|
1046
1066
|
propertySchema: PropertyShape.$schema
|
|
1047
1067
|
.properties
|
|
1048
1068
|
.uniqueLang,
|
|
@@ -1052,7 +1072,7 @@ export var PropertyShape;
|
|
|
1052
1072
|
0
|
|
1053
1073
|
? values.map((value) => Maybe.of(value))
|
|
1054
1074
|
: Resource.Values.fromValue({
|
|
1055
|
-
focusResource: $
|
|
1075
|
+
focusResource: $resource,
|
|
1056
1076
|
propertyPath: PropertyShape
|
|
1057
1077
|
.$schema
|
|
1058
1078
|
.properties
|
|
@@ -1061,8 +1081,8 @@ export var PropertyShape;
|
|
|
1061
1081
|
value: Maybe.empty(),
|
|
1062
1082
|
})),
|
|
1063
1083
|
}).chain((uniqueLang) => $shaclPropertyFromRdf({
|
|
1064
|
-
graph: $
|
|
1065
|
-
resource: $
|
|
1084
|
+
graph: _$options.graph,
|
|
1085
|
+
resource: $resource,
|
|
1066
1086
|
propertySchema: PropertyShape.$schema
|
|
1067
1087
|
.properties
|
|
1068
1088
|
.visibility,
|
|
@@ -1076,7 +1096,7 @@ export var PropertyShape;
|
|
|
1076
1096
|
0
|
|
1077
1097
|
? values.map((value) => Maybe.of(value))
|
|
1078
1098
|
: Resource.Values.fromValue({
|
|
1079
|
-
focusResource: $
|
|
1099
|
+
focusResource: $resource,
|
|
1080
1100
|
propertyPath: PropertyShape
|
|
1081
1101
|
.$schema
|
|
1082
1102
|
.properties
|
|
@@ -1085,17 +1105,17 @@ export var PropertyShape;
|
|
|
1085
1105
|
value: Maybe.empty(),
|
|
1086
1106
|
})),
|
|
1087
1107
|
}).chain((visibility) => $shaclPropertyFromRdf({
|
|
1088
|
-
graph: $
|
|
1089
|
-
resource: $
|
|
1108
|
+
graph: _$options.graph,
|
|
1109
|
+
resource: $resource,
|
|
1090
1110
|
propertySchema: PropertyShape.$schema
|
|
1091
1111
|
.properties
|
|
1092
1112
|
.xone,
|
|
1093
1113
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1094
1114
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
1095
|
-
graph: $
|
|
1115
|
+
graph: _$options.graph,
|
|
1096
1116
|
})))
|
|
1097
1117
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
1098
|
-
focusResource: $
|
|
1118
|
+
focusResource: $resource,
|
|
1099
1119
|
propertyPath: PropertyShape
|
|
1100
1120
|
.$schema
|
|
1101
1121
|
.properties
|
|
@@ -1106,7 +1126,7 @@ export var PropertyShape;
|
|
|
1106
1126
|
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
1107
1127
|
.map((values) => values.toArray())
|
|
1108
1128
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1109
|
-
focusResource: $
|
|
1129
|
+
focusResource: $resource,
|
|
1110
1130
|
propertyPath: PropertyShape
|
|
1111
1131
|
.$schema
|
|
1112
1132
|
.properties
|
|
@@ -1154,8 +1174,7 @@ export var PropertyShape;
|
|
|
1154
1174
|
visibility,
|
|
1155
1175
|
xone,
|
|
1156
1176
|
}))))))))))))))))))))))))))))))))))))))));
|
|
1157
|
-
}
|
|
1158
|
-
PropertyShape.$propertiesFromRdf = $propertiesFromRdf;
|
|
1177
|
+
};
|
|
1159
1178
|
PropertyShape.$schema = {
|
|
1160
1179
|
properties: {
|
|
1161
1180
|
$identifier: {
|
|
@@ -1163,7 +1182,7 @@ export var PropertyShape;
|
|
|
1163
1182
|
type: () => ({ kind: "Identifier" }),
|
|
1164
1183
|
},
|
|
1165
1184
|
$type: {
|
|
1166
|
-
kind: "
|
|
1185
|
+
kind: "Discriminant",
|
|
1167
1186
|
type: () => ({
|
|
1168
1187
|
kind: "TypeDiscriminant",
|
|
1169
1188
|
ownValues: ["PropertyShape"],
|
|
@@ -1433,7 +1452,7 @@ export var PropertyShape;
|
|
|
1433
1452
|
},
|
|
1434
1453
|
path: {
|
|
1435
1454
|
kind: "Shacl",
|
|
1436
|
-
type: () => PropertyPath.$schema,
|
|
1455
|
+
type: () => $PropertyPath.$schema,
|
|
1437
1456
|
path: dataFactory.namedNode("http://www.w3.org/ns/shacl#path"),
|
|
1438
1457
|
},
|
|
1439
1458
|
patterns: {
|
|
@@ -1488,7 +1507,7 @@ export var PropertyShape;
|
|
|
1488
1507
|
},
|
|
1489
1508
|
},
|
|
1490
1509
|
};
|
|
1491
|
-
function $
|
|
1510
|
+
function $toRdfResource(_propertyShape, options) {
|
|
1492
1511
|
const resourceSet = options?.resourceSet ??
|
|
1493
1512
|
new ResourceSet(datasetFactory.dataset(), { dataFactory: dataFactory });
|
|
1494
1513
|
const resource = resourceSet.resource(_propertyShape.$identifier);
|
|
@@ -1642,7 +1661,7 @@ export var PropertyShape;
|
|
|
1642
1661
|
$literalFactory.number(value, $RdfVocabularies.xsd.double),
|
|
1643
1662
|
]), options?.graph);
|
|
1644
1663
|
resource.add(dataFactory.namedNode("http://www.w3.org/ns/shacl#path"), [
|
|
1645
|
-
PropertyPath.$
|
|
1664
|
+
$PropertyPath.$toRdfResource(_propertyShape.path, {
|
|
1646
1665
|
graph: options?.graph,
|
|
1647
1666
|
resourceSet: resourceSet,
|
|
1648
1667
|
}).identifier,
|
|
@@ -1679,7 +1698,7 @@ export var PropertyShape;
|
|
|
1679
1698
|
]), options?.graph);
|
|
1680
1699
|
return resource;
|
|
1681
1700
|
}
|
|
1682
|
-
PropertyShape.$
|
|
1701
|
+
PropertyShape.$toRdfResource = $toRdfResource;
|
|
1683
1702
|
})(PropertyShape || (PropertyShape = {}));
|
|
1684
1703
|
export var PropertyGroup;
|
|
1685
1704
|
(function (PropertyGroup) {
|
|
@@ -1704,20 +1723,22 @@ export var PropertyGroup;
|
|
|
1704
1723
|
return true;
|
|
1705
1724
|
}
|
|
1706
1725
|
PropertyGroup.$filter = $filter;
|
|
1707
|
-
|
|
1708
|
-
let { context, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
1726
|
+
PropertyGroup.$fromRdfResource = (resource, options) => {
|
|
1727
|
+
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
1709
1728
|
if (!objectSet) {
|
|
1710
1729
|
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
1711
1730
|
}
|
|
1712
|
-
return PropertyGroup.$
|
|
1731
|
+
return PropertyGroup.$propertiesFromRdfResource(resource, {
|
|
1713
1732
|
context,
|
|
1733
|
+
graph,
|
|
1714
1734
|
ignoreRdfType,
|
|
1715
1735
|
objectSet,
|
|
1716
1736
|
preferredLanguages,
|
|
1717
|
-
resource,
|
|
1718
1737
|
});
|
|
1719
|
-
}
|
|
1720
|
-
PropertyGroup.$
|
|
1738
|
+
};
|
|
1739
|
+
PropertyGroup.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
1740
|
+
.toResource()
|
|
1741
|
+
.chain((resource) => PropertyGroup.$fromRdfResource(resource, options))));
|
|
1721
1742
|
PropertyGroup.$fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#PropertyGroup");
|
|
1722
1743
|
function isPropertyGroup(object) {
|
|
1723
1744
|
switch (object.$type) {
|
|
@@ -1728,10 +1749,10 @@ export var PropertyGroup;
|
|
|
1728
1749
|
}
|
|
1729
1750
|
}
|
|
1730
1751
|
PropertyGroup.isPropertyGroup = isPropertyGroup;
|
|
1731
|
-
|
|
1732
|
-
return (
|
|
1733
|
-
? $
|
|
1734
|
-
.value($RdfVocabularies.rdf.type, { graph: $
|
|
1752
|
+
PropertyGroup.$propertiesFromRdfResource = ($resource, _$options) => {
|
|
1753
|
+
return (!_$options.ignoreRdfType
|
|
1754
|
+
? $resource
|
|
1755
|
+
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
1735
1756
|
.chain((actualRdfType) => actualRdfType.toIri())
|
|
1736
1757
|
.chain((actualRdfType) => {
|
|
1737
1758
|
// Check the expected type and its known subtypes
|
|
@@ -1740,50 +1761,49 @@ export var PropertyGroup;
|
|
|
1740
1761
|
return Right(true);
|
|
1741
1762
|
}
|
|
1742
1763
|
// Check arbitrary rdfs:subClassOf's of the expected type
|
|
1743
|
-
if ($
|
|
1744
|
-
graph: $
|
|
1764
|
+
if ($resource.isInstanceOf(PropertyGroup.$fromRdfType, {
|
|
1765
|
+
graph: _$options.graph,
|
|
1745
1766
|
})) {
|
|
1746
1767
|
return Right(true);
|
|
1747
1768
|
}
|
|
1748
|
-
return Left(new Error(`${Resource.Identifier.toString($
|
|
1769
|
+
return Left(new Error(`${Resource.Identifier.toString($resource.identifier)} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#PropertyGroup)`));
|
|
1749
1770
|
})
|
|
1750
1771
|
: Right(true)).chain((_rdfTypeCheck) => Right(new Resource.Value({
|
|
1751
1772
|
dataFactory: dataFactory,
|
|
1752
|
-
focusResource: $
|
|
1773
|
+
focusResource: $resource,
|
|
1753
1774
|
propertyPath: $RdfVocabularies.rdf.subject,
|
|
1754
|
-
term: $
|
|
1775
|
+
term: $resource.identifier,
|
|
1755
1776
|
}).toValues())
|
|
1756
1777
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1757
1778
|
.chain((values) => values.head())
|
|
1758
1779
|
.chain(($identifier) => Right("PropertyGroup").chain(($type) => $shaclPropertyFromRdf({
|
|
1759
|
-
graph: $
|
|
1760
|
-
resource: $
|
|
1780
|
+
graph: _$options.graph,
|
|
1781
|
+
resource: $resource,
|
|
1761
1782
|
propertySchema: PropertyGroup.$schema.properties.comments,
|
|
1762
1783
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1763
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
1784
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1764
1785
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1765
1786
|
.map((values) => values.toArray())
|
|
1766
1787
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1767
|
-
focusResource: $
|
|
1788
|
+
focusResource: $resource,
|
|
1768
1789
|
propertyPath: PropertyGroup.$schema.properties.comments.path,
|
|
1769
1790
|
value: valuesArray,
|
|
1770
1791
|
})),
|
|
1771
1792
|
}).chain((comments) => $shaclPropertyFromRdf({
|
|
1772
|
-
graph: $
|
|
1773
|
-
resource: $
|
|
1793
|
+
graph: _$options.graph,
|
|
1794
|
+
resource: $resource,
|
|
1774
1795
|
propertySchema: PropertyGroup.$schema.properties.labels,
|
|
1775
1796
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1776
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
1797
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1777
1798
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1778
1799
|
.map((values) => values.toArray())
|
|
1779
1800
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1780
|
-
focusResource: $
|
|
1801
|
+
focusResource: $resource,
|
|
1781
1802
|
propertyPath: PropertyGroup.$schema.properties.labels.path,
|
|
1782
1803
|
value: valuesArray,
|
|
1783
1804
|
})),
|
|
1784
1805
|
}).map((labels) => ({ $identifier, $type, comments, labels }))))));
|
|
1785
|
-
}
|
|
1786
|
-
PropertyGroup.$propertiesFromRdf = $propertiesFromRdf;
|
|
1806
|
+
};
|
|
1787
1807
|
PropertyGroup.$schema = {
|
|
1788
1808
|
properties: {
|
|
1789
1809
|
$identifier: {
|
|
@@ -1791,7 +1811,7 @@ export var PropertyGroup;
|
|
|
1791
1811
|
type: () => ({ kind: "Identifier" }),
|
|
1792
1812
|
},
|
|
1793
1813
|
$type: {
|
|
1794
|
-
kind: "
|
|
1814
|
+
kind: "Discriminant",
|
|
1795
1815
|
type: () => ({
|
|
1796
1816
|
kind: "TypeDiscriminant",
|
|
1797
1817
|
ownValues: ["PropertyGroup"],
|
|
@@ -1815,7 +1835,7 @@ export var PropertyGroup;
|
|
|
1815
1835
|
},
|
|
1816
1836
|
},
|
|
1817
1837
|
};
|
|
1818
|
-
function $
|
|
1838
|
+
function $toRdfResource(_propertyGroup, options) {
|
|
1819
1839
|
const resourceSet = options?.resourceSet ??
|
|
1820
1840
|
new ResourceSet(datasetFactory.dataset(), { dataFactory: dataFactory });
|
|
1821
1841
|
const resource = resourceSet.resource(_propertyGroup.$identifier);
|
|
@@ -1826,7 +1846,7 @@ export var PropertyGroup;
|
|
|
1826
1846
|
resource.add(dataFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#label"), _propertyGroup.labels.flatMap((item) => [$literalFactory.string(item)]), options?.graph);
|
|
1827
1847
|
return resource;
|
|
1828
1848
|
}
|
|
1829
|
-
PropertyGroup.$
|
|
1849
|
+
PropertyGroup.$toRdfResource = $toRdfResource;
|
|
1830
1850
|
})(PropertyGroup || (PropertyGroup = {}));
|
|
1831
1851
|
export var Ontology;
|
|
1832
1852
|
(function (Ontology) {
|
|
@@ -1863,20 +1883,22 @@ export var Ontology;
|
|
|
1863
1883
|
return true;
|
|
1864
1884
|
}
|
|
1865
1885
|
Ontology.$filter = $filter;
|
|
1866
|
-
|
|
1867
|
-
let { context, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
1886
|
+
Ontology.$fromRdfResource = (resource, options) => {
|
|
1887
|
+
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
1868
1888
|
if (!objectSet) {
|
|
1869
1889
|
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
1870
1890
|
}
|
|
1871
|
-
return Ontology.$
|
|
1891
|
+
return Ontology.$propertiesFromRdfResource(resource, {
|
|
1872
1892
|
context,
|
|
1893
|
+
graph,
|
|
1873
1894
|
ignoreRdfType,
|
|
1874
1895
|
objectSet,
|
|
1875
1896
|
preferredLanguages,
|
|
1876
|
-
resource,
|
|
1877
1897
|
});
|
|
1878
|
-
}
|
|
1879
|
-
Ontology.$
|
|
1898
|
+
};
|
|
1899
|
+
Ontology.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
1900
|
+
.toResource()
|
|
1901
|
+
.chain((resource) => Ontology.$fromRdfResource(resource, options))));
|
|
1880
1902
|
Ontology.$fromRdfType = dataFactory.namedNode("http://www.w3.org/2002/07/owl#Ontology");
|
|
1881
1903
|
function isOntology(object) {
|
|
1882
1904
|
switch (object.$type) {
|
|
@@ -1887,10 +1909,10 @@ export var Ontology;
|
|
|
1887
1909
|
}
|
|
1888
1910
|
}
|
|
1889
1911
|
Ontology.isOntology = isOntology;
|
|
1890
|
-
|
|
1891
|
-
return (
|
|
1892
|
-
? $
|
|
1893
|
-
.value($RdfVocabularies.rdf.type, { graph: $
|
|
1912
|
+
Ontology.$propertiesFromRdfResource = ($resource, _$options) => {
|
|
1913
|
+
return (!_$options.ignoreRdfType
|
|
1914
|
+
? $resource
|
|
1915
|
+
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
1894
1916
|
.chain((actualRdfType) => actualRdfType.toIri())
|
|
1895
1917
|
.chain((actualRdfType) => {
|
|
1896
1918
|
// Check the expected type and its known subtypes
|
|
@@ -1899,37 +1921,37 @@ export var Ontology;
|
|
|
1899
1921
|
return Right(true);
|
|
1900
1922
|
}
|
|
1901
1923
|
// Check arbitrary rdfs:subClassOf's of the expected type
|
|
1902
|
-
if ($
|
|
1903
|
-
graph: $
|
|
1924
|
+
if ($resource.isInstanceOf(Ontology.$fromRdfType, {
|
|
1925
|
+
graph: _$options.graph,
|
|
1904
1926
|
})) {
|
|
1905
1927
|
return Right(true);
|
|
1906
1928
|
}
|
|
1907
|
-
return Left(new Error(`${Resource.Identifier.toString($
|
|
1929
|
+
return Left(new Error(`${Resource.Identifier.toString($resource.identifier)} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/2002/07/owl#Ontology)`));
|
|
1908
1930
|
})
|
|
1909
1931
|
: Right(true)).chain((_rdfTypeCheck) => Right(new Resource.Value({
|
|
1910
1932
|
dataFactory: dataFactory,
|
|
1911
|
-
focusResource: $
|
|
1933
|
+
focusResource: $resource,
|
|
1912
1934
|
propertyPath: $RdfVocabularies.rdf.subject,
|
|
1913
|
-
term: $
|
|
1935
|
+
term: $resource.identifier,
|
|
1914
1936
|
}).toValues())
|
|
1915
1937
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
1916
1938
|
.chain((values) => values.head())
|
|
1917
1939
|
.chain(($identifier) => Right("Ontology").chain(($type) => $shaclPropertyFromRdf({
|
|
1918
|
-
graph: $
|
|
1919
|
-
resource: $
|
|
1940
|
+
graph: _$options.graph,
|
|
1941
|
+
resource: $resource,
|
|
1920
1942
|
propertySchema: Ontology.$schema.properties.labels,
|
|
1921
1943
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1922
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
1944
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1923
1945
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1924
1946
|
.map((values) => values.toArray())
|
|
1925
1947
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1926
|
-
focusResource: $
|
|
1948
|
+
focusResource: $resource,
|
|
1927
1949
|
propertyPath: Ontology.$schema.properties.labels.path,
|
|
1928
1950
|
value: valuesArray,
|
|
1929
1951
|
})),
|
|
1930
1952
|
}).chain((labels) => $shaclPropertyFromRdf({
|
|
1931
|
-
graph: $
|
|
1932
|
-
resource: $
|
|
1953
|
+
graph: _$options.graph,
|
|
1954
|
+
resource: $resource,
|
|
1933
1955
|
propertySchema: Ontology.$schema.properties.tsFeatureExcludes,
|
|
1934
1956
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1935
1957
|
.chain((values) => values.chainMap((value) => value.toIri([
|
|
@@ -1946,13 +1968,13 @@ export var Ontology;
|
|
|
1946
1968
|
])))
|
|
1947
1969
|
.map((values) => values.toArray())
|
|
1948
1970
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1949
|
-
focusResource: $
|
|
1971
|
+
focusResource: $resource,
|
|
1950
1972
|
propertyPath: Ontology.$schema.properties.tsFeatureExcludes.path,
|
|
1951
1973
|
value: valuesArray,
|
|
1952
1974
|
})),
|
|
1953
1975
|
}).chain((tsFeatureExcludes) => $shaclPropertyFromRdf({
|
|
1954
|
-
graph: $
|
|
1955
|
-
resource: $
|
|
1976
|
+
graph: _$options.graph,
|
|
1977
|
+
resource: $resource,
|
|
1956
1978
|
propertySchema: Ontology.$schema.properties.tsFeatureIncludes,
|
|
1957
1979
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1958
1980
|
.chain((values) => values.chainMap((value) => value.toIri([
|
|
@@ -1969,26 +1991,26 @@ export var Ontology;
|
|
|
1969
1991
|
])))
|
|
1970
1992
|
.map((values) => values.toArray())
|
|
1971
1993
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1972
|
-
focusResource: $
|
|
1994
|
+
focusResource: $resource,
|
|
1973
1995
|
propertyPath: Ontology.$schema.properties.tsFeatureIncludes.path,
|
|
1974
1996
|
value: valuesArray,
|
|
1975
1997
|
})),
|
|
1976
1998
|
}).chain((tsFeatureIncludes) => $shaclPropertyFromRdf({
|
|
1977
|
-
graph: $
|
|
1978
|
-
resource: $
|
|
1999
|
+
graph: _$options.graph,
|
|
2000
|
+
resource: $resource,
|
|
1979
2001
|
propertySchema: Ontology.$schema.properties.tsImports,
|
|
1980
2002
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1981
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
2003
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
1982
2004
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
1983
2005
|
.map((values) => values.toArray())
|
|
1984
2006
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
1985
|
-
focusResource: $
|
|
2007
|
+
focusResource: $resource,
|
|
1986
2008
|
propertyPath: Ontology.$schema.properties.tsImports.path,
|
|
1987
2009
|
value: valuesArray,
|
|
1988
2010
|
})),
|
|
1989
2011
|
}).chain((tsImports) => $shaclPropertyFromRdf({
|
|
1990
|
-
graph: $
|
|
1991
|
-
resource: $
|
|
2012
|
+
graph: _$options.graph,
|
|
2013
|
+
resource: $resource,
|
|
1992
2014
|
propertySchema: Ontology.$schema.properties.tsObjectDeclarationType,
|
|
1993
2015
|
typeFromRdf: (resourceValues) => resourceValues
|
|
1994
2016
|
.chain((values) => values.chainMap((value) => value.toIri([
|
|
@@ -1998,7 +2020,7 @@ export var Ontology;
|
|
|
1998
2020
|
.map((values) => values.length > 0
|
|
1999
2021
|
? values.map((value) => Maybe.of(value))
|
|
2000
2022
|
: Resource.Values.fromValue({
|
|
2001
|
-
focusResource: $
|
|
2023
|
+
focusResource: $resource,
|
|
2002
2024
|
propertyPath: Ontology.$schema.properties
|
|
2003
2025
|
.tsObjectDeclarationType.path,
|
|
2004
2026
|
value: Maybe.empty(),
|
|
@@ -2012,8 +2034,7 @@ export var Ontology;
|
|
|
2012
2034
|
tsImports,
|
|
2013
2035
|
tsObjectDeclarationType,
|
|
2014
2036
|
})))))))));
|
|
2015
|
-
}
|
|
2016
|
-
Ontology.$propertiesFromRdf = $propertiesFromRdf;
|
|
2037
|
+
};
|
|
2017
2038
|
Ontology.$schema = {
|
|
2018
2039
|
properties: {
|
|
2019
2040
|
$identifier: {
|
|
@@ -2021,7 +2042,7 @@ export var Ontology;
|
|
|
2021
2042
|
type: () => ({ kind: "Identifier" }),
|
|
2022
2043
|
},
|
|
2023
2044
|
$type: {
|
|
2024
|
-
kind: "
|
|
2045
|
+
kind: "Discriminant",
|
|
2025
2046
|
type: () => ({
|
|
2026
2047
|
kind: "TypeDiscriminant",
|
|
2027
2048
|
ownValues: ["Ontology"],
|
|
@@ -2103,7 +2124,7 @@ export var Ontology;
|
|
|
2103
2124
|
},
|
|
2104
2125
|
},
|
|
2105
2126
|
};
|
|
2106
|
-
function $
|
|
2127
|
+
function $toRdfResource(_ontology, options) {
|
|
2107
2128
|
const resourceSet = options?.resourceSet ??
|
|
2108
2129
|
new ResourceSet(datasetFactory.dataset(), { dataFactory: dataFactory });
|
|
2109
2130
|
const resource = resourceSet.resource(_ontology.$identifier);
|
|
@@ -2117,7 +2138,7 @@ export var Ontology;
|
|
|
2117
2138
|
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#tsObjectDeclarationType"), _ontology.tsObjectDeclarationType.toList(), options?.graph);
|
|
2118
2139
|
return resource;
|
|
2119
2140
|
}
|
|
2120
|
-
Ontology.$
|
|
2141
|
+
Ontology.$toRdfResource = $toRdfResource;
|
|
2121
2142
|
})(Ontology || (Ontology = {}));
|
|
2122
2143
|
export var NodeShape;
|
|
2123
2144
|
(function (NodeShape) {
|
|
@@ -2163,10 +2184,6 @@ export var NodeShape;
|
|
|
2163
2184
|
!$filterMaybe($filterString)(filter.discriminantValue, value.discriminantValue)) {
|
|
2164
2185
|
return false;
|
|
2165
2186
|
}
|
|
2166
|
-
if (filter.export_ !== undefined &&
|
|
2167
|
-
!$filterMaybe($filterBoolean)(filter.export_, value.export_)) {
|
|
2168
|
-
return false;
|
|
2169
|
-
}
|
|
2170
2187
|
if (filter.extern !== undefined &&
|
|
2171
2188
|
!$filterMaybe($filterBoolean)(filter.extern, value.extern)) {
|
|
2172
2189
|
return false;
|
|
@@ -2302,20 +2319,22 @@ export var NodeShape;
|
|
|
2302
2319
|
return true;
|
|
2303
2320
|
}
|
|
2304
2321
|
NodeShape.$filter = $filter;
|
|
2305
|
-
|
|
2306
|
-
let { context, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
2322
|
+
NodeShape.$fromRdfResource = (resource, options) => {
|
|
2323
|
+
let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages, } = options ?? {};
|
|
2307
2324
|
if (!objectSet) {
|
|
2308
2325
|
objectSet = new $RdfjsDatasetObjectSet(resource.dataset);
|
|
2309
2326
|
}
|
|
2310
|
-
return NodeShape.$
|
|
2327
|
+
return NodeShape.$propertiesFromRdfResource(resource, {
|
|
2311
2328
|
context,
|
|
2329
|
+
graph,
|
|
2312
2330
|
ignoreRdfType,
|
|
2313
2331
|
objectSet,
|
|
2314
2332
|
preferredLanguages,
|
|
2315
|
-
resource,
|
|
2316
2333
|
});
|
|
2317
|
-
}
|
|
2318
|
-
NodeShape.$
|
|
2334
|
+
};
|
|
2335
|
+
NodeShape.$fromRdfResourceValues = (values, options) => values.chain((values) => values.chainMap((value) => value
|
|
2336
|
+
.toResource()
|
|
2337
|
+
.chain((resource) => NodeShape.$fromRdfResource(resource, options))));
|
|
2319
2338
|
NodeShape.$fromRdfType = dataFactory.namedNode("http://www.w3.org/ns/shacl#NodeShape");
|
|
2320
2339
|
function isNodeShape(object) {
|
|
2321
2340
|
switch (object.$type) {
|
|
@@ -2326,10 +2345,10 @@ export var NodeShape;
|
|
|
2326
2345
|
}
|
|
2327
2346
|
}
|
|
2328
2347
|
NodeShape.isNodeShape = isNodeShape;
|
|
2329
|
-
|
|
2330
|
-
return (
|
|
2331
|
-
? $
|
|
2332
|
-
.value($RdfVocabularies.rdf.type, { graph: $
|
|
2348
|
+
NodeShape.$propertiesFromRdfResource = ($resource, _$options) => {
|
|
2349
|
+
return (!_$options.ignoreRdfType
|
|
2350
|
+
? $resource
|
|
2351
|
+
.value($RdfVocabularies.rdf.type, { graph: _$options.graph })
|
|
2333
2352
|
.chain((actualRdfType) => actualRdfType.toIri())
|
|
2334
2353
|
.chain((actualRdfType) => {
|
|
2335
2354
|
// Check the expected type and its known subtypes
|
|
@@ -2338,192 +2357,178 @@ export var NodeShape;
|
|
|
2338
2357
|
return Right(true);
|
|
2339
2358
|
}
|
|
2340
2359
|
// Check arbitrary rdfs:subClassOf's of the expected type
|
|
2341
|
-
if ($
|
|
2342
|
-
graph: $
|
|
2360
|
+
if ($resource.isInstanceOf(NodeShape.$fromRdfType, {
|
|
2361
|
+
graph: _$options.graph,
|
|
2343
2362
|
})) {
|
|
2344
2363
|
return Right(true);
|
|
2345
2364
|
}
|
|
2346
|
-
return Left(new Error(`${Resource.Identifier.toString($
|
|
2365
|
+
return Left(new Error(`${Resource.Identifier.toString($resource.identifier)} has unexpected RDF type (actual: ${actualRdfType.value}, expected: http://www.w3.org/ns/shacl#NodeShape)`));
|
|
2347
2366
|
})
|
|
2348
2367
|
: Right(true)).chain((_rdfTypeCheck) => Right(new Resource.Value({
|
|
2349
2368
|
dataFactory: dataFactory,
|
|
2350
|
-
focusResource: $
|
|
2369
|
+
focusResource: $resource,
|
|
2351
2370
|
propertyPath: $RdfVocabularies.rdf.subject,
|
|
2352
|
-
term: $
|
|
2371
|
+
term: $resource.identifier,
|
|
2353
2372
|
}).toValues())
|
|
2354
2373
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2355
2374
|
.chain((values) => values.head())
|
|
2356
2375
|
.chain(($identifier) => Right("NodeShape").chain(($type) => $shaclPropertyFromRdf({
|
|
2357
|
-
graph: $
|
|
2358
|
-
resource: $
|
|
2376
|
+
graph: _$options.graph,
|
|
2377
|
+
resource: $resource,
|
|
2359
2378
|
propertySchema: NodeShape.$schema.properties.abstract,
|
|
2360
2379
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2361
2380
|
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
2362
2381
|
.map((values) => values.length > 0
|
|
2363
2382
|
? values.map((value) => Maybe.of(value))
|
|
2364
2383
|
: Resource.Values.fromValue({
|
|
2365
|
-
focusResource: $
|
|
2384
|
+
focusResource: $resource,
|
|
2366
2385
|
propertyPath: NodeShape.$schema.properties.abstract.path,
|
|
2367
2386
|
value: Maybe.empty(),
|
|
2368
2387
|
})),
|
|
2369
2388
|
}).chain((abstract) => $shaclPropertyFromRdf({
|
|
2370
|
-
graph: $
|
|
2371
|
-
resource: $
|
|
2389
|
+
graph: _$options.graph,
|
|
2390
|
+
resource: $resource,
|
|
2372
2391
|
propertySchema: NodeShape.$schema.properties.and,
|
|
2373
2392
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2374
|
-
.chain((values) => values.chainMap((value) => value.toList({ graph: $
|
|
2393
|
+
.chain((values) => values.chainMap((value) => value.toList({ graph: _$options.graph })))
|
|
2375
2394
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
2376
|
-
focusResource: $
|
|
2395
|
+
focusResource: $resource,
|
|
2377
2396
|
propertyPath: PropertyShape.$schema.properties.and.path,
|
|
2378
2397
|
values: valueList.toArray(),
|
|
2379
2398
|
})).chain((values) => values.chainMap((value) => value.toIdentifier()))))
|
|
2380
2399
|
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
2381
2400
|
.map((values) => values.toArray())
|
|
2382
2401
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
2383
|
-
focusResource: $
|
|
2402
|
+
focusResource: $resource,
|
|
2384
2403
|
propertyPath: PropertyShape.$schema.properties.and.path,
|
|
2385
2404
|
value: valuesArray,
|
|
2386
2405
|
})),
|
|
2387
2406
|
}).chain((and) => $shaclPropertyFromRdf({
|
|
2388
|
-
graph: $
|
|
2389
|
-
resource: $
|
|
2407
|
+
graph: _$options.graph,
|
|
2408
|
+
resource: $resource,
|
|
2390
2409
|
propertySchema: NodeShape.$schema.properties.classes,
|
|
2391
2410
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2392
2411
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
2393
2412
|
.map((values) => values.toArray())
|
|
2394
2413
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
2395
|
-
focusResource: $
|
|
2414
|
+
focusResource: $resource,
|
|
2396
2415
|
propertyPath: PropertyShape.$schema.properties.classes.path,
|
|
2397
2416
|
value: valuesArray,
|
|
2398
2417
|
})),
|
|
2399
2418
|
}).chain((classes) => $shaclPropertyFromRdf({
|
|
2400
|
-
graph: $
|
|
2401
|
-
resource: $
|
|
2419
|
+
graph: _$options.graph,
|
|
2420
|
+
resource: $resource,
|
|
2402
2421
|
propertySchema: NodeShape.$schema.properties.closed,
|
|
2403
2422
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2404
2423
|
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
2405
2424
|
.map((values) => values.length > 0
|
|
2406
2425
|
? values.map((value) => Maybe.of(value))
|
|
2407
2426
|
: Resource.Values.fromValue({
|
|
2408
|
-
focusResource: $
|
|
2427
|
+
focusResource: $resource,
|
|
2409
2428
|
propertyPath: NodeShape.$schema.properties.closed.path,
|
|
2410
2429
|
value: Maybe.empty(),
|
|
2411
2430
|
})),
|
|
2412
2431
|
}).chain((closed) => $shaclPropertyFromRdf({
|
|
2413
|
-
graph: $
|
|
2414
|
-
resource: $
|
|
2432
|
+
graph: _$options.graph,
|
|
2433
|
+
resource: $resource,
|
|
2415
2434
|
propertySchema: NodeShape.$schema.properties.comments,
|
|
2416
2435
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2417
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
2436
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2418
2437
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2419
2438
|
.map((values) => values.toArray())
|
|
2420
2439
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
2421
|
-
focusResource: $
|
|
2440
|
+
focusResource: $resource,
|
|
2422
2441
|
propertyPath: PropertyShape.$schema.properties.comments.path,
|
|
2423
2442
|
value: valuesArray,
|
|
2424
2443
|
})),
|
|
2425
2444
|
}).chain((comments) => $shaclPropertyFromRdf({
|
|
2426
|
-
graph: $
|
|
2427
|
-
resource: $
|
|
2445
|
+
graph: _$options.graph,
|
|
2446
|
+
resource: $resource,
|
|
2428
2447
|
propertySchema: NodeShape.$schema.properties.datatype,
|
|
2429
2448
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2430
2449
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
2431
2450
|
.map((values) => values.length > 0
|
|
2432
2451
|
? values.map((value) => Maybe.of(value))
|
|
2433
2452
|
: Resource.Values.fromValue({
|
|
2434
|
-
focusResource: $
|
|
2453
|
+
focusResource: $resource,
|
|
2435
2454
|
propertyPath: PropertyShape.$schema.properties.datatype
|
|
2436
2455
|
.path,
|
|
2437
2456
|
value: Maybe.empty(),
|
|
2438
2457
|
})),
|
|
2439
2458
|
}).chain((datatype) => $shaclPropertyFromRdf({
|
|
2440
|
-
graph: $
|
|
2441
|
-
resource: $
|
|
2459
|
+
graph: _$options.graph,
|
|
2460
|
+
resource: $resource,
|
|
2442
2461
|
propertySchema: NodeShape.$schema.properties.deactivated,
|
|
2443
2462
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2444
2463
|
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
2445
2464
|
.map((values) => values.length > 0
|
|
2446
2465
|
? values.map((value) => Maybe.of(value))
|
|
2447
2466
|
: Resource.Values.fromValue({
|
|
2448
|
-
focusResource: $
|
|
2467
|
+
focusResource: $resource,
|
|
2449
2468
|
propertyPath: PropertyShape.$schema.properties
|
|
2450
2469
|
.deactivated.path,
|
|
2451
2470
|
value: Maybe.empty(),
|
|
2452
2471
|
})),
|
|
2453
2472
|
}).chain((deactivated) => $shaclPropertyFromRdf({
|
|
2454
|
-
graph: $
|
|
2455
|
-
resource: $
|
|
2473
|
+
graph: _$options.graph,
|
|
2474
|
+
resource: $resource,
|
|
2456
2475
|
propertySchema: NodeShape.$schema.properties.discriminantValue,
|
|
2457
2476
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2458
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
2477
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2459
2478
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2460
2479
|
.map((values) => values.length > 0
|
|
2461
2480
|
? values.map((value) => Maybe.of(value))
|
|
2462
2481
|
: Resource.Values.fromValue({
|
|
2463
|
-
focusResource: $
|
|
2482
|
+
focusResource: $resource,
|
|
2464
2483
|
propertyPath: NodeShape.$schema.properties
|
|
2465
2484
|
.discriminantValue.path,
|
|
2466
2485
|
value: Maybe.empty(),
|
|
2467
2486
|
})),
|
|
2468
2487
|
}).chain((discriminantValue) => $shaclPropertyFromRdf({
|
|
2469
|
-
graph: $
|
|
2470
|
-
resource: $
|
|
2471
|
-
propertySchema: NodeShape.$schema.properties.export_,
|
|
2472
|
-
typeFromRdf: (resourceValues) => resourceValues
|
|
2473
|
-
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
2474
|
-
.map((values) => values.length > 0
|
|
2475
|
-
? values.map((value) => Maybe.of(value))
|
|
2476
|
-
: Resource.Values.fromValue({
|
|
2477
|
-
focusResource: $parameters.resource,
|
|
2478
|
-
propertyPath: NodeShape.$schema.properties.export_
|
|
2479
|
-
.path,
|
|
2480
|
-
value: Maybe.empty(),
|
|
2481
|
-
})),
|
|
2482
|
-
}).chain((export_) => $shaclPropertyFromRdf({
|
|
2483
|
-
graph: $parameters.graph,
|
|
2484
|
-
resource: $parameters.resource,
|
|
2488
|
+
graph: _$options.graph,
|
|
2489
|
+
resource: $resource,
|
|
2485
2490
|
propertySchema: NodeShape.$schema.properties.extern,
|
|
2486
2491
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2487
2492
|
.chain((values) => values.chainMap((value) => value.toBoolean()))
|
|
2488
2493
|
.map((values) => values.length > 0
|
|
2489
2494
|
? values.map((value) => Maybe.of(value))
|
|
2490
2495
|
: Resource.Values.fromValue({
|
|
2491
|
-
focusResource: $
|
|
2492
|
-
propertyPath: NodeShape.$schema.properties
|
|
2493
|
-
.
|
|
2496
|
+
focusResource: $resource,
|
|
2497
|
+
propertyPath: NodeShape.$schema.properties.extern
|
|
2498
|
+
.path,
|
|
2494
2499
|
value: Maybe.empty(),
|
|
2495
2500
|
})),
|
|
2496
2501
|
}).chain((extern) => $shaclPropertyFromRdf({
|
|
2497
|
-
graph: $
|
|
2498
|
-
resource: $
|
|
2502
|
+
graph: _$options.graph,
|
|
2503
|
+
resource: $resource,
|
|
2499
2504
|
propertySchema: NodeShape.$schema.properties.flags,
|
|
2500
2505
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2501
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
2506
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2502
2507
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2503
2508
|
.map((values) => values.toArray())
|
|
2504
2509
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
2505
|
-
focusResource: $
|
|
2506
|
-
propertyPath: PropertyShape.$schema.properties
|
|
2507
|
-
.
|
|
2510
|
+
focusResource: $resource,
|
|
2511
|
+
propertyPath: PropertyShape.$schema.properties.flags
|
|
2512
|
+
.path,
|
|
2508
2513
|
value: valuesArray,
|
|
2509
2514
|
})),
|
|
2510
2515
|
}).chain((flags) => $shaclPropertyFromRdf({
|
|
2511
|
-
graph: $
|
|
2512
|
-
resource: $
|
|
2516
|
+
graph: _$options.graph,
|
|
2517
|
+
resource: $resource,
|
|
2513
2518
|
propertySchema: NodeShape.$schema.properties.fromRdfType,
|
|
2514
2519
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2515
2520
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
2516
2521
|
.map((values) => values.length > 0
|
|
2517
2522
|
? values.map((value) => Maybe.of(value))
|
|
2518
2523
|
: Resource.Values.fromValue({
|
|
2519
|
-
focusResource: $
|
|
2524
|
+
focusResource: $resource,
|
|
2520
2525
|
propertyPath: NodeShape.$schema.properties
|
|
2521
2526
|
.fromRdfType.path,
|
|
2522
2527
|
value: Maybe.empty(),
|
|
2523
2528
|
})),
|
|
2524
2529
|
}).chain((fromRdfType) => $shaclPropertyFromRdf({
|
|
2525
|
-
graph: $
|
|
2526
|
-
resource: $
|
|
2530
|
+
graph: _$options.graph,
|
|
2531
|
+
resource: $resource,
|
|
2527
2532
|
propertySchema: NodeShape.$schema.properties.hasValues,
|
|
2528
2533
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2529
2534
|
.chain((values) => values.chainMap((value) => value.toTerm().chain((term) => {
|
|
@@ -2535,9 +2540,8 @@ export var NodeShape;
|
|
|
2535
2540
|
return Left(new Resource.MistypedTermValueError({
|
|
2536
2541
|
actualValue: term,
|
|
2537
2542
|
expectedValueType: "(NamedNode | Literal)",
|
|
2538
|
-
focusResource: $
|
|
2539
|
-
propertyPath: PropertyShape
|
|
2540
|
-
.$schema
|
|
2543
|
+
focusResource: $resource,
|
|
2544
|
+
propertyPath: PropertyShape.$schema
|
|
2541
2545
|
.properties
|
|
2542
2546
|
.hasValues.path,
|
|
2543
2547
|
}));
|
|
@@ -2545,14 +2549,14 @@ export var NodeShape;
|
|
|
2545
2549
|
})))
|
|
2546
2550
|
.map((values) => values.toArray())
|
|
2547
2551
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
2548
|
-
focusResource: $
|
|
2552
|
+
focusResource: $resource,
|
|
2549
2553
|
propertyPath: PropertyShape.$schema.properties
|
|
2550
2554
|
.hasValues.path,
|
|
2551
2555
|
value: valuesArray,
|
|
2552
2556
|
})),
|
|
2553
2557
|
}).chain((hasValues) => $shaclPropertyFromRdf({
|
|
2554
|
-
graph: $
|
|
2555
|
-
resource: $
|
|
2558
|
+
graph: _$options.graph,
|
|
2559
|
+
resource: $resource,
|
|
2556
2560
|
propertySchema: NodeShape.$schema.properties
|
|
2557
2561
|
.identifierMintingStrategy,
|
|
2558
2562
|
typeFromRdf: (resourceValues) => resourceValues
|
|
@@ -2564,51 +2568,47 @@ export var NodeShape;
|
|
|
2564
2568
|
.map((values) => values.length > 0
|
|
2565
2569
|
? values.map((value) => Maybe.of(value))
|
|
2566
2570
|
: Resource.Values.fromValue({
|
|
2567
|
-
focusResource: $
|
|
2568
|
-
propertyPath: NodeShape.$schema
|
|
2569
|
-
.properties
|
|
2571
|
+
focusResource: $resource,
|
|
2572
|
+
propertyPath: NodeShape.$schema.properties
|
|
2570
2573
|
.identifierMintingStrategy
|
|
2571
2574
|
.path,
|
|
2572
2575
|
value: Maybe.empty(),
|
|
2573
2576
|
})),
|
|
2574
2577
|
}).chain((identifierMintingStrategy) => $shaclPropertyFromRdf({
|
|
2575
|
-
graph: $
|
|
2576
|
-
resource: $
|
|
2577
|
-
propertySchema: NodeShape.$schema.properties
|
|
2578
|
-
.ignoredProperties,
|
|
2578
|
+
graph: _$options.graph,
|
|
2579
|
+
resource: $resource,
|
|
2580
|
+
propertySchema: NodeShape.$schema.properties.ignoredProperties,
|
|
2579
2581
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2580
2582
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
2581
|
-
graph: $
|
|
2583
|
+
graph: _$options.graph,
|
|
2582
2584
|
})))
|
|
2583
2585
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
2584
|
-
focusResource: $
|
|
2586
|
+
focusResource: $resource,
|
|
2585
2587
|
propertyPath: NodeShape.$schema
|
|
2586
2588
|
.properties
|
|
2587
|
-
.ignoredProperties
|
|
2588
|
-
.path,
|
|
2589
|
+
.ignoredProperties.path,
|
|
2589
2590
|
values: valueList.toArray(),
|
|
2590
2591
|
})).chain((values) => values.chainMap((value) => value.toIri()))))
|
|
2591
2592
|
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
2592
2593
|
.map((values) => values.length > 0
|
|
2593
2594
|
? values.map((value) => Maybe.of(value))
|
|
2594
2595
|
: Resource.Values.fromValue({
|
|
2595
|
-
focusResource: $
|
|
2596
|
+
focusResource: $resource,
|
|
2596
2597
|
propertyPath: NodeShape.$schema
|
|
2597
2598
|
.properties
|
|
2598
|
-
.ignoredProperties
|
|
2599
|
-
.path,
|
|
2599
|
+
.ignoredProperties.path,
|
|
2600
2600
|
value: Maybe.empty(),
|
|
2601
2601
|
})),
|
|
2602
2602
|
}).chain((ignoredProperties) => $shaclPropertyFromRdf({
|
|
2603
|
-
graph: $
|
|
2604
|
-
resource: $
|
|
2603
|
+
graph: _$options.graph,
|
|
2604
|
+
resource: $resource,
|
|
2605
2605
|
propertySchema: NodeShape.$schema.properties.in_,
|
|
2606
2606
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2607
2607
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
2608
|
-
graph: $
|
|
2608
|
+
graph: _$options.graph,
|
|
2609
2609
|
})))
|
|
2610
2610
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
2611
|
-
focusResource: $
|
|
2611
|
+
focusResource: $resource,
|
|
2612
2612
|
propertyPath: PropertyShape
|
|
2613
2613
|
.$schema
|
|
2614
2614
|
.properties.in_
|
|
@@ -2625,7 +2625,7 @@ export var NodeShape;
|
|
|
2625
2625
|
return Left(new Resource.MistypedTermValueError({
|
|
2626
2626
|
actualValue: term,
|
|
2627
2627
|
expectedValueType: "(NamedNode | Literal)",
|
|
2628
|
-
focusResource: $
|
|
2628
|
+
focusResource: $resource,
|
|
2629
2629
|
propertyPath: PropertyShape
|
|
2630
2630
|
.$schema
|
|
2631
2631
|
.properties
|
|
@@ -2638,55 +2638,51 @@ export var NodeShape;
|
|
|
2638
2638
|
.map((values) => values.length > 0
|
|
2639
2639
|
? values.map((value) => Maybe.of(value))
|
|
2640
2640
|
: Resource.Values.fromValue({
|
|
2641
|
-
focusResource: $
|
|
2641
|
+
focusResource: $resource,
|
|
2642
2642
|
propertyPath: PropertyShape.$schema
|
|
2643
|
-
.properties.in_
|
|
2644
|
-
.path,
|
|
2643
|
+
.properties.in_.path,
|
|
2645
2644
|
value: Maybe.empty(),
|
|
2646
2645
|
})),
|
|
2647
2646
|
}).chain((in_) => $shaclPropertyFromRdf({
|
|
2648
|
-
graph: $
|
|
2649
|
-
resource: $
|
|
2647
|
+
graph: _$options.graph,
|
|
2648
|
+
resource: $resource,
|
|
2650
2649
|
propertySchema: NodeShape.$schema.properties.isDefinedBy,
|
|
2651
2650
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2652
2651
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2653
2652
|
.map((values) => values.length > 0
|
|
2654
2653
|
? values.map((value) => Maybe.of(value))
|
|
2655
2654
|
: Resource.Values.fromValue({
|
|
2656
|
-
focusResource: $
|
|
2657
|
-
propertyPath: PropertyShape
|
|
2658
|
-
.$schema
|
|
2655
|
+
focusResource: $resource,
|
|
2656
|
+
propertyPath: PropertyShape.$schema
|
|
2659
2657
|
.properties
|
|
2660
2658
|
.isDefinedBy.path,
|
|
2661
2659
|
value: Maybe.empty(),
|
|
2662
2660
|
})),
|
|
2663
2661
|
}).chain((isDefinedBy) => $shaclPropertyFromRdf({
|
|
2664
|
-
graph: $
|
|
2665
|
-
resource: $
|
|
2662
|
+
graph: _$options.graph,
|
|
2663
|
+
resource: $resource,
|
|
2666
2664
|
propertySchema: NodeShape.$schema.properties.labels,
|
|
2667
2665
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2668
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
2666
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2669
2667
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2670
2668
|
.map((values) => values.toArray())
|
|
2671
2669
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
2672
|
-
focusResource: $
|
|
2673
|
-
propertyPath: PropertyShape
|
|
2674
|
-
.$schema
|
|
2670
|
+
focusResource: $resource,
|
|
2671
|
+
propertyPath: PropertyShape.$schema
|
|
2675
2672
|
.properties.labels
|
|
2676
2673
|
.path,
|
|
2677
2674
|
value: valuesArray,
|
|
2678
2675
|
})),
|
|
2679
2676
|
}).chain((labels) => $shaclPropertyFromRdf({
|
|
2680
|
-
graph: $
|
|
2681
|
-
resource: $
|
|
2682
|
-
propertySchema: NodeShape.$schema.properties
|
|
2683
|
-
.languageIn,
|
|
2677
|
+
graph: _$options.graph,
|
|
2678
|
+
resource: $resource,
|
|
2679
|
+
propertySchema: NodeShape.$schema.properties.languageIn,
|
|
2684
2680
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2685
2681
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
2686
|
-
graph: $
|
|
2682
|
+
graph: _$options.graph,
|
|
2687
2683
|
})))
|
|
2688
2684
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
2689
|
-
focusResource: $
|
|
2685
|
+
focusResource: $resource,
|
|
2690
2686
|
propertyPath: PropertyShape
|
|
2691
2687
|
.$schema
|
|
2692
2688
|
.properties
|
|
@@ -2694,13 +2690,13 @@ export var NodeShape;
|
|
|
2694
2690
|
.path,
|
|
2695
2691
|
values: valueList.toArray(),
|
|
2696
2692
|
}))
|
|
2697
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
2693
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2698
2694
|
.chain((values) => values.chainMap((value) => value.toString()))))
|
|
2699
2695
|
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
2700
2696
|
.map((values) => values.length > 0
|
|
2701
2697
|
? values.map((value) => Maybe.of(value))
|
|
2702
2698
|
: Resource.Values.fromValue({
|
|
2703
|
-
focusResource: $
|
|
2699
|
+
focusResource: $resource,
|
|
2704
2700
|
propertyPath: PropertyShape
|
|
2705
2701
|
.$schema
|
|
2706
2702
|
.properties
|
|
@@ -2709,16 +2705,15 @@ export var NodeShape;
|
|
|
2709
2705
|
value: Maybe.empty(),
|
|
2710
2706
|
})),
|
|
2711
2707
|
}).chain((languageIn) => $shaclPropertyFromRdf({
|
|
2712
|
-
graph: $
|
|
2713
|
-
resource: $
|
|
2714
|
-
propertySchema: NodeShape.$schema.properties
|
|
2715
|
-
.maxCount,
|
|
2708
|
+
graph: _$options.graph,
|
|
2709
|
+
resource: $resource,
|
|
2710
|
+
propertySchema: NodeShape.$schema.properties.maxCount,
|
|
2716
2711
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2717
2712
|
.chain((values) => values.chainMap((value) => value.toInt()))
|
|
2718
2713
|
.map((values) => values.length > 0
|
|
2719
2714
|
? values.map((value) => Maybe.of(value))
|
|
2720
2715
|
: Resource.Values.fromValue({
|
|
2721
|
-
focusResource: $
|
|
2716
|
+
focusResource: $resource,
|
|
2722
2717
|
propertyPath: PropertyShape
|
|
2723
2718
|
.$schema
|
|
2724
2719
|
.properties
|
|
@@ -2727,17 +2722,17 @@ export var NodeShape;
|
|
|
2727
2722
|
value: Maybe.empty(),
|
|
2728
2723
|
})),
|
|
2729
2724
|
}).chain((maxCount) => $shaclPropertyFromRdf({
|
|
2730
|
-
graph: $
|
|
2731
|
-
resource: $
|
|
2725
|
+
graph: _$options.graph,
|
|
2726
|
+
resource: $resource,
|
|
2732
2727
|
propertySchema: NodeShape.$schema.properties
|
|
2733
2728
|
.maxExclusive,
|
|
2734
2729
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2735
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
2730
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2736
2731
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
2737
2732
|
.map((values) => values.length > 0
|
|
2738
2733
|
? values.map((value) => Maybe.of(value))
|
|
2739
2734
|
: Resource.Values.fromValue({
|
|
2740
|
-
focusResource: $
|
|
2735
|
+
focusResource: $resource,
|
|
2741
2736
|
propertyPath: PropertyShape
|
|
2742
2737
|
.$schema
|
|
2743
2738
|
.properties
|
|
@@ -2746,17 +2741,17 @@ export var NodeShape;
|
|
|
2746
2741
|
value: Maybe.empty(),
|
|
2747
2742
|
})),
|
|
2748
2743
|
}).chain((maxExclusive) => $shaclPropertyFromRdf({
|
|
2749
|
-
graph: $
|
|
2750
|
-
resource: $
|
|
2744
|
+
graph: _$options.graph,
|
|
2745
|
+
resource: $resource,
|
|
2751
2746
|
propertySchema: NodeShape.$schema.properties
|
|
2752
2747
|
.maxInclusive,
|
|
2753
2748
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2754
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
2749
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2755
2750
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
2756
2751
|
.map((values) => values.length > 0
|
|
2757
2752
|
? values.map((value) => Maybe.of(value))
|
|
2758
2753
|
: Resource.Values.fromValue({
|
|
2759
|
-
focusResource: $
|
|
2754
|
+
focusResource: $resource,
|
|
2760
2755
|
propertyPath: PropertyShape
|
|
2761
2756
|
.$schema
|
|
2762
2757
|
.properties
|
|
@@ -2765,17 +2760,16 @@ export var NodeShape;
|
|
|
2765
2760
|
value: Maybe.empty(),
|
|
2766
2761
|
})),
|
|
2767
2762
|
}).chain((maxInclusive) => $shaclPropertyFromRdf({
|
|
2768
|
-
graph: $
|
|
2769
|
-
resource: $
|
|
2763
|
+
graph: _$options.graph,
|
|
2764
|
+
resource: $resource,
|
|
2770
2765
|
propertySchema: NodeShape.$schema.properties
|
|
2771
2766
|
.maxLength,
|
|
2772
2767
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2773
2768
|
.chain((values) => values.chainMap((value) => value.toInt()))
|
|
2774
|
-
.map((values) => values.length >
|
|
2775
|
-
0
|
|
2769
|
+
.map((values) => values.length > 0
|
|
2776
2770
|
? values.map((value) => Maybe.of(value))
|
|
2777
2771
|
: Resource.Values.fromValue({
|
|
2778
|
-
focusResource: $
|
|
2772
|
+
focusResource: $resource,
|
|
2779
2773
|
propertyPath: PropertyShape
|
|
2780
2774
|
.$schema
|
|
2781
2775
|
.properties
|
|
@@ -2784,10 +2778,9 @@ export var NodeShape;
|
|
|
2784
2778
|
value: Maybe.empty(),
|
|
2785
2779
|
})),
|
|
2786
2780
|
}).chain((maxLength) => $shaclPropertyFromRdf({
|
|
2787
|
-
graph: $
|
|
2788
|
-
resource: $
|
|
2789
|
-
propertySchema: NodeShape.$schema
|
|
2790
|
-
.properties
|
|
2781
|
+
graph: _$options.graph,
|
|
2782
|
+
resource: $resource,
|
|
2783
|
+
propertySchema: NodeShape.$schema.properties
|
|
2791
2784
|
.minCount,
|
|
2792
2785
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2793
2786
|
.chain((values) => values.chainMap((value) => value.toInt()))
|
|
@@ -2795,7 +2788,7 @@ export var NodeShape;
|
|
|
2795
2788
|
0
|
|
2796
2789
|
? values.map((value) => Maybe.of(value))
|
|
2797
2790
|
: Resource.Values.fromValue({
|
|
2798
|
-
focusResource: $
|
|
2791
|
+
focusResource: $resource,
|
|
2799
2792
|
propertyPath: PropertyShape
|
|
2800
2793
|
.$schema
|
|
2801
2794
|
.properties
|
|
@@ -2804,19 +2797,19 @@ export var NodeShape;
|
|
|
2804
2797
|
value: Maybe.empty(),
|
|
2805
2798
|
})),
|
|
2806
2799
|
}).chain((minCount) => $shaclPropertyFromRdf({
|
|
2807
|
-
graph: $
|
|
2808
|
-
resource: $
|
|
2800
|
+
graph: _$options.graph,
|
|
2801
|
+
resource: $resource,
|
|
2809
2802
|
propertySchema: NodeShape.$schema
|
|
2810
2803
|
.properties
|
|
2811
2804
|
.minExclusive,
|
|
2812
2805
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2813
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
2806
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2814
2807
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
2815
2808
|
.map((values) => values.length >
|
|
2816
2809
|
0
|
|
2817
2810
|
? values.map((value) => Maybe.of(value))
|
|
2818
2811
|
: Resource.Values.fromValue({
|
|
2819
|
-
focusResource: $
|
|
2812
|
+
focusResource: $resource,
|
|
2820
2813
|
propertyPath: PropertyShape
|
|
2821
2814
|
.$schema
|
|
2822
2815
|
.properties
|
|
@@ -2825,19 +2818,19 @@ export var NodeShape;
|
|
|
2825
2818
|
value: Maybe.empty(),
|
|
2826
2819
|
})),
|
|
2827
2820
|
}).chain((minExclusive) => $shaclPropertyFromRdf({
|
|
2828
|
-
graph: $
|
|
2829
|
-
resource: $
|
|
2821
|
+
graph: _$options.graph,
|
|
2822
|
+
resource: $resource,
|
|
2830
2823
|
propertySchema: NodeShape.$schema
|
|
2831
2824
|
.properties
|
|
2832
2825
|
.minInclusive,
|
|
2833
2826
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2834
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
2827
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2835
2828
|
.chain((values) => values.chainMap((value) => value.toLiteral()))
|
|
2836
2829
|
.map((values) => values.length >
|
|
2837
2830
|
0
|
|
2838
2831
|
? values.map((value) => Maybe.of(value))
|
|
2839
2832
|
: Resource.Values.fromValue({
|
|
2840
|
-
focusResource: $
|
|
2833
|
+
focusResource: $resource,
|
|
2841
2834
|
propertyPath: PropertyShape
|
|
2842
2835
|
.$schema
|
|
2843
2836
|
.properties
|
|
@@ -2846,8 +2839,8 @@ export var NodeShape;
|
|
|
2846
2839
|
value: Maybe.empty(),
|
|
2847
2840
|
})),
|
|
2848
2841
|
}).chain((minInclusive) => $shaclPropertyFromRdf({
|
|
2849
|
-
graph: $
|
|
2850
|
-
resource: $
|
|
2842
|
+
graph: _$options.graph,
|
|
2843
|
+
resource: $resource,
|
|
2851
2844
|
propertySchema: NodeShape.$schema
|
|
2852
2845
|
.properties
|
|
2853
2846
|
.minLength,
|
|
@@ -2857,7 +2850,7 @@ export var NodeShape;
|
|
|
2857
2850
|
0
|
|
2858
2851
|
? values.map((value) => Maybe.of(value))
|
|
2859
2852
|
: Resource.Values.fromValue({
|
|
2860
|
-
focusResource: $
|
|
2853
|
+
focusResource: $resource,
|
|
2861
2854
|
propertyPath: PropertyShape
|
|
2862
2855
|
.$schema
|
|
2863
2856
|
.properties
|
|
@@ -2866,8 +2859,8 @@ export var NodeShape;
|
|
|
2866
2859
|
value: Maybe.empty(),
|
|
2867
2860
|
})),
|
|
2868
2861
|
}).chain((minLength) => $shaclPropertyFromRdf({
|
|
2869
|
-
graph: $
|
|
2870
|
-
resource: $
|
|
2862
|
+
graph: _$options.graph,
|
|
2863
|
+
resource: $resource,
|
|
2871
2864
|
propertySchema: NodeShape.$schema
|
|
2872
2865
|
.properties
|
|
2873
2866
|
.mutable,
|
|
@@ -2877,7 +2870,7 @@ export var NodeShape;
|
|
|
2877
2870
|
0
|
|
2878
2871
|
? values.map((value) => Maybe.of(value))
|
|
2879
2872
|
: Resource.Values.fromValue({
|
|
2880
|
-
focusResource: $
|
|
2873
|
+
focusResource: $resource,
|
|
2881
2874
|
propertyPath: PropertyShape
|
|
2882
2875
|
.$schema
|
|
2883
2876
|
.properties
|
|
@@ -2886,19 +2879,19 @@ export var NodeShape;
|
|
|
2886
2879
|
value: Maybe.empty(),
|
|
2887
2880
|
})),
|
|
2888
2881
|
}).chain((mutable) => $shaclPropertyFromRdf({
|
|
2889
|
-
graph: $
|
|
2890
|
-
resource: $
|
|
2882
|
+
graph: _$options.graph,
|
|
2883
|
+
resource: $resource,
|
|
2891
2884
|
propertySchema: NodeShape.$schema
|
|
2892
2885
|
.properties
|
|
2893
2886
|
.name,
|
|
2894
2887
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2895
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
2888
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
2896
2889
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
2897
2890
|
.map((values) => values.length >
|
|
2898
2891
|
0
|
|
2899
2892
|
? values.map((value) => Maybe.of(value))
|
|
2900
2893
|
: Resource.Values.fromValue({
|
|
2901
|
-
focusResource: $
|
|
2894
|
+
focusResource: $resource,
|
|
2902
2895
|
propertyPath: PropertyShape
|
|
2903
2896
|
.$schema
|
|
2904
2897
|
.properties
|
|
@@ -2907,8 +2900,8 @@ export var NodeShape;
|
|
|
2907
2900
|
value: Maybe.empty(),
|
|
2908
2901
|
})),
|
|
2909
2902
|
}).chain((name) => $shaclPropertyFromRdf({
|
|
2910
|
-
graph: $
|
|
2911
|
-
resource: $
|
|
2903
|
+
graph: _$options.graph,
|
|
2904
|
+
resource: $resource,
|
|
2912
2905
|
propertySchema: NodeShape.$schema
|
|
2913
2906
|
.properties
|
|
2914
2907
|
.nodeKind,
|
|
@@ -2925,7 +2918,7 @@ export var NodeShape;
|
|
|
2925
2918
|
0
|
|
2926
2919
|
? values.map((value) => Maybe.of(value))
|
|
2927
2920
|
: Resource.Values.fromValue({
|
|
2928
|
-
focusResource: $
|
|
2921
|
+
focusResource: $resource,
|
|
2929
2922
|
propertyPath: PropertyShape
|
|
2930
2923
|
.$schema
|
|
2931
2924
|
.properties
|
|
@@ -2934,8 +2927,8 @@ export var NodeShape;
|
|
|
2934
2927
|
value: Maybe.empty(),
|
|
2935
2928
|
})),
|
|
2936
2929
|
}).chain((nodeKind) => $shaclPropertyFromRdf({
|
|
2937
|
-
graph: $
|
|
2938
|
-
resource: $
|
|
2930
|
+
graph: _$options.graph,
|
|
2931
|
+
resource: $resource,
|
|
2939
2932
|
propertySchema: NodeShape.$schema
|
|
2940
2933
|
.properties
|
|
2941
2934
|
.nodes,
|
|
@@ -2943,7 +2936,7 @@ export var NodeShape;
|
|
|
2943
2936
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2944
2937
|
.map((values) => values.toArray())
|
|
2945
2938
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
2946
|
-
focusResource: $
|
|
2939
|
+
focusResource: $resource,
|
|
2947
2940
|
propertyPath: PropertyShape
|
|
2948
2941
|
.$schema
|
|
2949
2942
|
.properties
|
|
@@ -2952,8 +2945,8 @@ export var NodeShape;
|
|
|
2952
2945
|
value: valuesArray,
|
|
2953
2946
|
})),
|
|
2954
2947
|
}).chain((nodes) => $shaclPropertyFromRdf({
|
|
2955
|
-
graph: $
|
|
2956
|
-
resource: $
|
|
2948
|
+
graph: _$options.graph,
|
|
2949
|
+
resource: $resource,
|
|
2957
2950
|
propertySchema: NodeShape.$schema
|
|
2958
2951
|
.properties
|
|
2959
2952
|
.not,
|
|
@@ -2961,7 +2954,7 @@ export var NodeShape;
|
|
|
2961
2954
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
2962
2955
|
.map((values) => values.toArray())
|
|
2963
2956
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
2964
|
-
focusResource: $
|
|
2957
|
+
focusResource: $resource,
|
|
2965
2958
|
propertyPath: PropertyShape
|
|
2966
2959
|
.$schema
|
|
2967
2960
|
.properties
|
|
@@ -2970,17 +2963,17 @@ export var NodeShape;
|
|
|
2970
2963
|
value: valuesArray,
|
|
2971
2964
|
})),
|
|
2972
2965
|
}).chain((not) => $shaclPropertyFromRdf({
|
|
2973
|
-
graph: $
|
|
2974
|
-
resource: $
|
|
2966
|
+
graph: _$options.graph,
|
|
2967
|
+
resource: $resource,
|
|
2975
2968
|
propertySchema: NodeShape.$schema
|
|
2976
2969
|
.properties
|
|
2977
2970
|
.or,
|
|
2978
2971
|
typeFromRdf: (resourceValues) => resourceValues
|
|
2979
2972
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
2980
|
-
graph: $
|
|
2973
|
+
graph: _$options.graph,
|
|
2981
2974
|
})))
|
|
2982
2975
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
2983
|
-
focusResource: $
|
|
2976
|
+
focusResource: $resource,
|
|
2984
2977
|
propertyPath: PropertyShape
|
|
2985
2978
|
.$schema
|
|
2986
2979
|
.properties
|
|
@@ -2991,7 +2984,7 @@ export var NodeShape;
|
|
|
2991
2984
|
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
2992
2985
|
.map((values) => values.toArray())
|
|
2993
2986
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
2994
|
-
focusResource: $
|
|
2987
|
+
focusResource: $resource,
|
|
2995
2988
|
propertyPath: PropertyShape
|
|
2996
2989
|
.$schema
|
|
2997
2990
|
.properties
|
|
@@ -3000,17 +2993,17 @@ export var NodeShape;
|
|
|
3000
2993
|
value: valuesArray,
|
|
3001
2994
|
})),
|
|
3002
2995
|
}).chain((or) => $shaclPropertyFromRdf({
|
|
3003
|
-
graph: $
|
|
3004
|
-
resource: $
|
|
2996
|
+
graph: _$options.graph,
|
|
2997
|
+
resource: $resource,
|
|
3005
2998
|
propertySchema: NodeShape.$schema
|
|
3006
2999
|
.properties
|
|
3007
3000
|
.patterns,
|
|
3008
3001
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3009
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
3002
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3010
3003
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
3011
3004
|
.map((values) => values.toArray())
|
|
3012
3005
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3013
|
-
focusResource: $
|
|
3006
|
+
focusResource: $resource,
|
|
3014
3007
|
propertyPath: PropertyShape
|
|
3015
3008
|
.$schema
|
|
3016
3009
|
.properties
|
|
@@ -3019,8 +3012,8 @@ export var NodeShape;
|
|
|
3019
3012
|
value: valuesArray,
|
|
3020
3013
|
})),
|
|
3021
3014
|
}).chain((patterns) => $shaclPropertyFromRdf({
|
|
3022
|
-
graph: $
|
|
3023
|
-
resource: $
|
|
3015
|
+
graph: _$options.graph,
|
|
3016
|
+
resource: $resource,
|
|
3024
3017
|
propertySchema: NodeShape.$schema
|
|
3025
3018
|
.properties
|
|
3026
3019
|
.properties,
|
|
@@ -3028,7 +3021,7 @@ export var NodeShape;
|
|
|
3028
3021
|
.chain((values) => values.chainMap((value) => value.toIdentifier()))
|
|
3029
3022
|
.map((values) => values.toArray())
|
|
3030
3023
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3031
|
-
focusResource: $
|
|
3024
|
+
focusResource: $resource,
|
|
3032
3025
|
propertyPath: NodeShape
|
|
3033
3026
|
.$schema
|
|
3034
3027
|
.properties
|
|
@@ -3037,8 +3030,8 @@ export var NodeShape;
|
|
|
3037
3030
|
value: valuesArray,
|
|
3038
3031
|
})),
|
|
3039
3032
|
}).chain((properties) => $shaclPropertyFromRdf({
|
|
3040
|
-
graph: $
|
|
3041
|
-
resource: $
|
|
3033
|
+
graph: _$options.graph,
|
|
3034
|
+
resource: $resource,
|
|
3042
3035
|
propertySchema: NodeShape.$schema
|
|
3043
3036
|
.properties
|
|
3044
3037
|
.rdfType,
|
|
@@ -3048,7 +3041,7 @@ export var NodeShape;
|
|
|
3048
3041
|
0
|
|
3049
3042
|
? values.map((value) => Maybe.of(value))
|
|
3050
3043
|
: Resource.Values.fromValue({
|
|
3051
|
-
focusResource: $
|
|
3044
|
+
focusResource: $resource,
|
|
3052
3045
|
propertyPath: NodeShape
|
|
3053
3046
|
.$schema
|
|
3054
3047
|
.properties
|
|
@@ -3057,8 +3050,8 @@ export var NodeShape;
|
|
|
3057
3050
|
value: Maybe.empty(),
|
|
3058
3051
|
})),
|
|
3059
3052
|
}).chain((rdfType) => $shaclPropertyFromRdf({
|
|
3060
|
-
graph: $
|
|
3061
|
-
resource: $
|
|
3053
|
+
graph: _$options.graph,
|
|
3054
|
+
resource: $resource,
|
|
3062
3055
|
propertySchema: NodeShape.$schema
|
|
3063
3056
|
.properties
|
|
3064
3057
|
.toRdfTypes,
|
|
@@ -3066,7 +3059,7 @@ export var NodeShape;
|
|
|
3066
3059
|
.chain((values) => values.chainMap((value) => value.toIri()))
|
|
3067
3060
|
.map((values) => values.toArray())
|
|
3068
3061
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3069
|
-
focusResource: $
|
|
3062
|
+
focusResource: $resource,
|
|
3070
3063
|
propertyPath: NodeShape
|
|
3071
3064
|
.$schema
|
|
3072
3065
|
.properties
|
|
@@ -3075,8 +3068,8 @@ export var NodeShape;
|
|
|
3075
3068
|
value: valuesArray,
|
|
3076
3069
|
})),
|
|
3077
3070
|
}).chain((toRdfTypes) => $shaclPropertyFromRdf({
|
|
3078
|
-
graph: $
|
|
3079
|
-
resource: $
|
|
3071
|
+
graph: _$options.graph,
|
|
3072
|
+
resource: $resource,
|
|
3080
3073
|
propertySchema: NodeShape.$schema
|
|
3081
3074
|
.properties
|
|
3082
3075
|
.tsFeatureExcludes,
|
|
@@ -3095,7 +3088,7 @@ export var NodeShape;
|
|
|
3095
3088
|
])))
|
|
3096
3089
|
.map((values) => values.toArray())
|
|
3097
3090
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3098
|
-
focusResource: $
|
|
3091
|
+
focusResource: $resource,
|
|
3099
3092
|
propertyPath: Ontology
|
|
3100
3093
|
.$schema
|
|
3101
3094
|
.properties
|
|
@@ -3104,8 +3097,8 @@ export var NodeShape;
|
|
|
3104
3097
|
value: valuesArray,
|
|
3105
3098
|
})),
|
|
3106
3099
|
}).chain((tsFeatureExcludes) => $shaclPropertyFromRdf({
|
|
3107
|
-
graph: $
|
|
3108
|
-
resource: $
|
|
3100
|
+
graph: _$options.graph,
|
|
3101
|
+
resource: $resource,
|
|
3109
3102
|
propertySchema: NodeShape.$schema
|
|
3110
3103
|
.properties
|
|
3111
3104
|
.tsFeatureIncludes,
|
|
@@ -3124,7 +3117,7 @@ export var NodeShape;
|
|
|
3124
3117
|
])))
|
|
3125
3118
|
.map((values) => values.toArray())
|
|
3126
3119
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3127
|
-
focusResource: $
|
|
3120
|
+
focusResource: $resource,
|
|
3128
3121
|
propertyPath: Ontology
|
|
3129
3122
|
.$schema
|
|
3130
3123
|
.properties
|
|
@@ -3133,17 +3126,17 @@ export var NodeShape;
|
|
|
3133
3126
|
value: valuesArray,
|
|
3134
3127
|
})),
|
|
3135
3128
|
}).chain((tsFeatureIncludes) => $shaclPropertyFromRdf({
|
|
3136
|
-
graph: $
|
|
3137
|
-
resource: $
|
|
3129
|
+
graph: _$options.graph,
|
|
3130
|
+
resource: $resource,
|
|
3138
3131
|
propertySchema: NodeShape.$schema
|
|
3139
3132
|
.properties
|
|
3140
3133
|
.tsImports,
|
|
3141
3134
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3142
|
-
.chain((values) => $fromRdfPreferredLanguages(values, $
|
|
3135
|
+
.chain((values) => $fromRdfPreferredLanguages(values, _$options.preferredLanguages))
|
|
3143
3136
|
.chain((values) => values.chainMap((value) => value.toString()))
|
|
3144
3137
|
.map((values) => values.toArray())
|
|
3145
3138
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3146
|
-
focusResource: $
|
|
3139
|
+
focusResource: $resource,
|
|
3147
3140
|
propertyPath: Ontology
|
|
3148
3141
|
.$schema
|
|
3149
3142
|
.properties
|
|
@@ -3152,8 +3145,8 @@ export var NodeShape;
|
|
|
3152
3145
|
value: valuesArray,
|
|
3153
3146
|
})),
|
|
3154
3147
|
}).chain((tsImports) => $shaclPropertyFromRdf({
|
|
3155
|
-
graph: $
|
|
3156
|
-
resource: $
|
|
3148
|
+
graph: _$options.graph,
|
|
3149
|
+
resource: $resource,
|
|
3157
3150
|
propertySchema: NodeShape.$schema
|
|
3158
3151
|
.properties
|
|
3159
3152
|
.tsObjectDeclarationType,
|
|
@@ -3166,7 +3159,7 @@ export var NodeShape;
|
|
|
3166
3159
|
0
|
|
3167
3160
|
? values.map((value) => Maybe.of(value))
|
|
3168
3161
|
: Resource.Values.fromValue({
|
|
3169
|
-
focusResource: $
|
|
3162
|
+
focusResource: $resource,
|
|
3170
3163
|
propertyPath: Ontology
|
|
3171
3164
|
.$schema
|
|
3172
3165
|
.properties
|
|
@@ -3175,17 +3168,17 @@ export var NodeShape;
|
|
|
3175
3168
|
value: Maybe.empty(),
|
|
3176
3169
|
})),
|
|
3177
3170
|
}).chain((tsObjectDeclarationType) => $shaclPropertyFromRdf({
|
|
3178
|
-
graph: $
|
|
3179
|
-
resource: $
|
|
3171
|
+
graph: _$options.graph,
|
|
3172
|
+
resource: $resource,
|
|
3180
3173
|
propertySchema: NodeShape.$schema
|
|
3181
3174
|
.properties
|
|
3182
3175
|
.xone,
|
|
3183
3176
|
typeFromRdf: (resourceValues) => resourceValues
|
|
3184
3177
|
.chain((values) => values.chainMap((value) => value.toList({
|
|
3185
|
-
graph: $
|
|
3178
|
+
graph: _$options.graph,
|
|
3186
3179
|
})))
|
|
3187
3180
|
.chain((valueLists) => valueLists.chainMap((valueList) => Right(Resource.Values.fromArray({
|
|
3188
|
-
focusResource: $
|
|
3181
|
+
focusResource: $resource,
|
|
3189
3182
|
propertyPath: PropertyShape
|
|
3190
3183
|
.$schema
|
|
3191
3184
|
.properties
|
|
@@ -3196,7 +3189,7 @@ export var NodeShape;
|
|
|
3196
3189
|
.map((valueLists) => valueLists.map((valueList) => valueList.toArray()))
|
|
3197
3190
|
.map((values) => values.toArray())
|
|
3198
3191
|
.map((valuesArray) => Resource.Values.fromValue({
|
|
3199
|
-
focusResource: $
|
|
3192
|
+
focusResource: $resource,
|
|
3200
3193
|
propertyPath: PropertyShape
|
|
3201
3194
|
.$schema
|
|
3202
3195
|
.properties
|
|
@@ -3215,7 +3208,6 @@ export var NodeShape;
|
|
|
3215
3208
|
datatype,
|
|
3216
3209
|
deactivated,
|
|
3217
3210
|
discriminantValue,
|
|
3218
|
-
export_,
|
|
3219
3211
|
extern,
|
|
3220
3212
|
flags,
|
|
3221
3213
|
fromRdfType,
|
|
@@ -3249,9 +3241,8 @@ export var NodeShape;
|
|
|
3249
3241
|
tsImports,
|
|
3250
3242
|
tsObjectDeclarationType,
|
|
3251
3243
|
xone,
|
|
3252
|
-
})))))))))))))))))))))))))))))))))))))))))))))
|
|
3253
|
-
}
|
|
3254
|
-
NodeShape.$propertiesFromRdf = $propertiesFromRdf;
|
|
3244
|
+
})))))))))))))))))))))))))))))))))))))))))))));
|
|
3245
|
+
};
|
|
3255
3246
|
NodeShape.$schema = {
|
|
3256
3247
|
properties: {
|
|
3257
3248
|
$identifier: {
|
|
@@ -3259,7 +3250,7 @@ export var NodeShape;
|
|
|
3259
3250
|
type: () => ({ kind: "Identifier" }),
|
|
3260
3251
|
},
|
|
3261
3252
|
$type: {
|
|
3262
|
-
kind: "
|
|
3253
|
+
kind: "Discriminant",
|
|
3263
3254
|
type: () => ({
|
|
3264
3255
|
kind: "TypeDiscriminant",
|
|
3265
3256
|
ownValues: ["NodeShape"],
|
|
@@ -3332,14 +3323,6 @@ export var NodeShape;
|
|
|
3332
3323
|
}),
|
|
3333
3324
|
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#discriminantValue"),
|
|
3334
3325
|
},
|
|
3335
|
-
export_: {
|
|
3336
|
-
kind: "Shacl",
|
|
3337
|
-
type: () => ({
|
|
3338
|
-
kind: "Maybe",
|
|
3339
|
-
item: () => ({ kind: "Boolean" }),
|
|
3340
|
-
}),
|
|
3341
|
-
path: dataFactory.namedNode("http://purl.org/shaclmate/ontology#export"),
|
|
3342
|
-
},
|
|
3343
3326
|
extern: {
|
|
3344
3327
|
kind: "Shacl",
|
|
3345
3328
|
type: () => ({
|
|
@@ -3672,7 +3655,7 @@ export var NodeShape;
|
|
|
3672
3655
|
},
|
|
3673
3656
|
},
|
|
3674
3657
|
};
|
|
3675
|
-
function $
|
|
3658
|
+
function $toRdfResource(_nodeShape, options) {
|
|
3676
3659
|
const resourceSet = options?.resourceSet ??
|
|
3677
3660
|
new ResourceSet(datasetFactory.dataset(), { dataFactory: dataFactory });
|
|
3678
3661
|
const resource = resourceSet.resource(_nodeShape.$identifier);
|
|
@@ -3722,11 +3705,6 @@ export var NodeShape;
|
|
|
3722
3705
|
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#discriminantValue"), _nodeShape.discriminantValue
|
|
3723
3706
|
.toList()
|
|
3724
3707
|
.flatMap((value) => [$literalFactory.string(value)]), options?.graph);
|
|
3725
|
-
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#export"), _nodeShape.export_
|
|
3726
|
-
.toList()
|
|
3727
|
-
.flatMap((value) => [
|
|
3728
|
-
$literalFactory.boolean(value, $RdfVocabularies.xsd.boolean),
|
|
3729
|
-
]), options?.graph);
|
|
3730
3708
|
resource.add(dataFactory.namedNode("http://purl.org/shaclmate/ontology#extern"), _nodeShape.extern
|
|
3731
3709
|
.toList()
|
|
3732
3710
|
.flatMap((value) => [
|
|
@@ -3893,48 +3871,81 @@ export var NodeShape;
|
|
|
3893
3871
|
]), options?.graph);
|
|
3894
3872
|
return resource;
|
|
3895
3873
|
}
|
|
3896
|
-
NodeShape.$
|
|
3874
|
+
NodeShape.$toRdfResource = $toRdfResource;
|
|
3897
3875
|
})(NodeShape || (NodeShape = {}));
|
|
3898
3876
|
export var Shape;
|
|
3899
3877
|
(function (Shape) {
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3878
|
+
Shape.$toRdfResource = (value, options) => {
|
|
3879
|
+
if (NodeShape.isNodeShape(value)) {
|
|
3880
|
+
return NodeShape.$toRdfResource(value, options);
|
|
3881
|
+
}
|
|
3882
|
+
if (PropertyShape.isPropertyShape(value)) {
|
|
3883
|
+
return PropertyShape.$toRdfResource(value, options);
|
|
3884
|
+
}
|
|
3885
|
+
throw new Error("unrecognized type");
|
|
3886
|
+
};
|
|
3887
|
+
Shape.$filter = (filter, value) => {
|
|
3906
3888
|
if (filter.$identifier !== undefined &&
|
|
3907
3889
|
!$filterIdentifier(filter.$identifier, value.$identifier)) {
|
|
3908
3890
|
return false;
|
|
3909
3891
|
}
|
|
3910
|
-
if (NodeShape
|
|
3911
|
-
|
|
3912
|
-
!NodeShape.$filter(filter.on
|
|
3913
|
-
|
|
3892
|
+
if (filter.on?.["NodeShape"] !== undefined &&
|
|
3893
|
+
NodeShape.isNodeShape(value)) {
|
|
3894
|
+
if (!NodeShape.$filter(filter.on["NodeShape"], value)) {
|
|
3895
|
+
return false;
|
|
3896
|
+
}
|
|
3914
3897
|
}
|
|
3915
|
-
if (PropertyShape
|
|
3916
|
-
|
|
3917
|
-
!PropertyShape.$filter(filter.on
|
|
3918
|
-
|
|
3898
|
+
if (filter.on?.["PropertyShape"] !== undefined &&
|
|
3899
|
+
PropertyShape.isPropertyShape(value)) {
|
|
3900
|
+
if (!PropertyShape.$filter(filter.on["PropertyShape"], value)) {
|
|
3901
|
+
return false;
|
|
3902
|
+
}
|
|
3919
3903
|
}
|
|
3920
3904
|
return true;
|
|
3921
|
-
}
|
|
3922
|
-
Shape.$
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3905
|
+
};
|
|
3906
|
+
Shape.$fromRdfResource = (resource, options) => NodeShape.$fromRdfResource(resource, {
|
|
3907
|
+
...options,
|
|
3908
|
+
ignoreRdfType: false,
|
|
3909
|
+
}).altLazy(() => PropertyShape.$fromRdfResource(resource, {
|
|
3910
|
+
...options,
|
|
3911
|
+
ignoreRdfType: false,
|
|
3912
|
+
}));
|
|
3913
|
+
Shape.$fromRdfResourceValues = ((values, _options) => values.chain((values) => values.chainMap((value) => {
|
|
3914
|
+
const valueAsValues = Right(value.toValues());
|
|
3915
|
+
return NodeShape.$fromRdfResourceValues(valueAsValues, {
|
|
3916
|
+
context: _options.context,
|
|
3917
|
+
graph: _options.graph,
|
|
3926
3918
|
ignoreRdfType: false,
|
|
3927
|
-
|
|
3928
|
-
|
|
3919
|
+
objectSet: _options.objectSet,
|
|
3920
|
+
preferredLanguages: _options.preferredLanguages,
|
|
3921
|
+
propertyPath: _options.propertyPath,
|
|
3922
|
+
resource: _options.resource,
|
|
3923
|
+
})
|
|
3924
|
+
.altLazy(() => PropertyShape.$fromRdfResourceValues(valueAsValues, {
|
|
3925
|
+
context: _options.context,
|
|
3926
|
+
graph: _options.graph,
|
|
3929
3927
|
ignoreRdfType: false,
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3928
|
+
objectSet: _options.objectSet,
|
|
3929
|
+
preferredLanguages: _options.preferredLanguages,
|
|
3930
|
+
propertyPath: _options.propertyPath,
|
|
3931
|
+
resource: _options.resource,
|
|
3932
|
+
}))
|
|
3933
|
+
.chain((values) => values.head());
|
|
3934
|
+
})));
|
|
3935
|
+
let $Identifier;
|
|
3936
|
+
(function ($Identifier) {
|
|
3937
|
+
$Identifier.fromString = $identifierFromString; // biome-ignore lint/suspicious/noShadowRestrictedNames: allow toString
|
|
3938
|
+
$Identifier.toString = Resource.Identifier.toString;
|
|
3939
|
+
})($Identifier = Shape.$Identifier || (Shape.$Identifier = {}));
|
|
3937
3940
|
Shape.$schema = {
|
|
3941
|
+
kind: "NamedObjectUnion",
|
|
3942
|
+
members: {
|
|
3943
|
+
NodeShape: { discriminantValues: ["NodeShape"], type: NodeShape.$schema },
|
|
3944
|
+
PropertyShape: {
|
|
3945
|
+
discriminantValues: ["PropertyShape"],
|
|
3946
|
+
type: PropertyShape.$schema,
|
|
3947
|
+
},
|
|
3948
|
+
},
|
|
3938
3949
|
properties: {
|
|
3939
3950
|
and: {
|
|
3940
3951
|
kind: "Shacl",
|
|
@@ -4179,72 +4190,152 @@ export var Shape;
|
|
|
4179
4190
|
},
|
|
4180
4191
|
},
|
|
4181
4192
|
};
|
|
4182
|
-
|
|
4183
|
-
if (NodeShape.isNodeShape(
|
|
4184
|
-
return
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4193
|
+
Shape.$toRdfResourceValues = ((value, _options) => {
|
|
4194
|
+
if (NodeShape.isNodeShape(value)) {
|
|
4195
|
+
return [
|
|
4196
|
+
NodeShape.$toRdfResource(value, {
|
|
4197
|
+
graph: _options.graph,
|
|
4198
|
+
resourceSet: _options.resourceSet,
|
|
4199
|
+
}).identifier,
|
|
4200
|
+
];
|
|
4201
|
+
}
|
|
4202
|
+
if (PropertyShape.isPropertyShape(value)) {
|
|
4203
|
+
return [
|
|
4204
|
+
PropertyShape.$toRdfResource(value, {
|
|
4205
|
+
graph: _options.graph,
|
|
4206
|
+
resourceSet: _options.resourceSet,
|
|
4207
|
+
}).identifier,
|
|
4208
|
+
];
|
|
4209
|
+
}
|
|
4210
|
+
throw new Error("unable to serialize to RDF");
|
|
4211
|
+
});
|
|
4212
|
+
function isShape(object) {
|
|
4213
|
+
return (NodeShape.isNodeShape(object) || PropertyShape.isPropertyShape(object));
|
|
4190
4214
|
}
|
|
4191
|
-
Shape
|
|
4215
|
+
Shape.isShape = isShape;
|
|
4192
4216
|
})(Shape || (Shape = {}));
|
|
4193
4217
|
export var $Object;
|
|
4194
4218
|
(function ($Object) {
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4219
|
+
$Object.$toRdfResource = (value, options) => {
|
|
4220
|
+
if (NodeShape.isNodeShape(value)) {
|
|
4221
|
+
return NodeShape.$toRdfResource(value, options);
|
|
4222
|
+
}
|
|
4223
|
+
if (Ontology.isOntology(value)) {
|
|
4224
|
+
return Ontology.$toRdfResource(value, options);
|
|
4225
|
+
}
|
|
4226
|
+
if (PropertyGroup.isPropertyGroup(value)) {
|
|
4227
|
+
return PropertyGroup.$toRdfResource(value, options);
|
|
4228
|
+
}
|
|
4229
|
+
if (PropertyShape.isPropertyShape(value)) {
|
|
4230
|
+
return PropertyShape.$toRdfResource(value, options);
|
|
4231
|
+
}
|
|
4232
|
+
throw new Error("unrecognized type");
|
|
4233
|
+
};
|
|
4234
|
+
$Object.$filter = (filter, value) => {
|
|
4201
4235
|
if (filter.$identifier !== undefined &&
|
|
4202
4236
|
!$filterIdentifier(filter.$identifier, value.$identifier)) {
|
|
4203
4237
|
return false;
|
|
4204
4238
|
}
|
|
4205
|
-
if (NodeShape
|
|
4206
|
-
|
|
4207
|
-
!NodeShape.$filter(filter.on
|
|
4208
|
-
|
|
4239
|
+
if (filter.on?.["NodeShape"] !== undefined &&
|
|
4240
|
+
NodeShape.isNodeShape(value)) {
|
|
4241
|
+
if (!NodeShape.$filter(filter.on["NodeShape"], value)) {
|
|
4242
|
+
return false;
|
|
4243
|
+
}
|
|
4209
4244
|
}
|
|
4210
|
-
if (Ontology.isOntology(value)
|
|
4211
|
-
filter.on
|
|
4212
|
-
|
|
4213
|
-
|
|
4245
|
+
if (filter.on?.["Ontology"] !== undefined && Ontology.isOntology(value)) {
|
|
4246
|
+
if (!Ontology.$filter(filter.on["Ontology"], value)) {
|
|
4247
|
+
return false;
|
|
4248
|
+
}
|
|
4214
4249
|
}
|
|
4215
|
-
if (PropertyGroup
|
|
4216
|
-
|
|
4217
|
-
!PropertyGroup.$filter(filter.on
|
|
4218
|
-
|
|
4250
|
+
if (filter.on?.["PropertyGroup"] !== undefined &&
|
|
4251
|
+
PropertyGroup.isPropertyGroup(value)) {
|
|
4252
|
+
if (!PropertyGroup.$filter(filter.on["PropertyGroup"], value)) {
|
|
4253
|
+
return false;
|
|
4254
|
+
}
|
|
4219
4255
|
}
|
|
4220
|
-
if (PropertyShape
|
|
4221
|
-
|
|
4222
|
-
!PropertyShape.$filter(filter.on
|
|
4223
|
-
|
|
4256
|
+
if (filter.on?.["PropertyShape"] !== undefined &&
|
|
4257
|
+
PropertyShape.isPropertyShape(value)) {
|
|
4258
|
+
if (!PropertyShape.$filter(filter.on["PropertyShape"], value)) {
|
|
4259
|
+
return false;
|
|
4260
|
+
}
|
|
4224
4261
|
}
|
|
4225
4262
|
return true;
|
|
4226
|
-
}
|
|
4227
|
-
$Object.$
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4263
|
+
};
|
|
4264
|
+
$Object.$fromRdfResource = (resource, options) => NodeShape.$fromRdfResource(resource, {
|
|
4265
|
+
...options,
|
|
4266
|
+
ignoreRdfType: false,
|
|
4267
|
+
})
|
|
4268
|
+
.altLazy(() => Ontology.$fromRdfResource(resource, {
|
|
4269
|
+
...options,
|
|
4270
|
+
ignoreRdfType: false,
|
|
4271
|
+
}))
|
|
4272
|
+
.altLazy(() => PropertyGroup.$fromRdfResource(resource, {
|
|
4273
|
+
...options,
|
|
4274
|
+
ignoreRdfType: false,
|
|
4275
|
+
}))
|
|
4276
|
+
.altLazy(() => PropertyShape.$fromRdfResource(resource, {
|
|
4277
|
+
...options,
|
|
4278
|
+
ignoreRdfType: false,
|
|
4279
|
+
}));
|
|
4280
|
+
$Object.$fromRdfResourceValues = ((values, _options) => values.chain((values) => values.chainMap((value) => {
|
|
4281
|
+
const valueAsValues = Right(value.toValues());
|
|
4282
|
+
return NodeShape.$fromRdfResourceValues(valueAsValues, {
|
|
4283
|
+
context: _options.context,
|
|
4284
|
+
graph: _options.graph,
|
|
4231
4285
|
ignoreRdfType: false,
|
|
4286
|
+
objectSet: _options.objectSet,
|
|
4287
|
+
preferredLanguages: _options.preferredLanguages,
|
|
4288
|
+
propertyPath: _options.propertyPath,
|
|
4289
|
+
resource: _options.resource,
|
|
4232
4290
|
})
|
|
4233
|
-
.altLazy(() => Ontology.$
|
|
4234
|
-
|
|
4291
|
+
.altLazy(() => Ontology.$fromRdfResourceValues(valueAsValues, {
|
|
4292
|
+
context: _options.context,
|
|
4293
|
+
graph: _options.graph,
|
|
4235
4294
|
ignoreRdfType: false,
|
|
4295
|
+
objectSet: _options.objectSet,
|
|
4296
|
+
preferredLanguages: _options.preferredLanguages,
|
|
4297
|
+
propertyPath: _options.propertyPath,
|
|
4298
|
+
resource: _options.resource,
|
|
4236
4299
|
}))
|
|
4237
|
-
.altLazy(() => PropertyGroup.$
|
|
4238
|
-
|
|
4300
|
+
.altLazy(() => PropertyGroup.$fromRdfResourceValues(valueAsValues, {
|
|
4301
|
+
context: _options.context,
|
|
4302
|
+
graph: _options.graph,
|
|
4239
4303
|
ignoreRdfType: false,
|
|
4304
|
+
objectSet: _options.objectSet,
|
|
4305
|
+
preferredLanguages: _options.preferredLanguages,
|
|
4306
|
+
propertyPath: _options.propertyPath,
|
|
4307
|
+
resource: _options.resource,
|
|
4240
4308
|
}))
|
|
4241
|
-
.altLazy(() => PropertyShape.$
|
|
4242
|
-
|
|
4309
|
+
.altLazy(() => PropertyShape.$fromRdfResourceValues(valueAsValues, {
|
|
4310
|
+
context: _options.context,
|
|
4311
|
+
graph: _options.graph,
|
|
4243
4312
|
ignoreRdfType: false,
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4313
|
+
objectSet: _options.objectSet,
|
|
4314
|
+
preferredLanguages: _options.preferredLanguages,
|
|
4315
|
+
propertyPath: _options.propertyPath,
|
|
4316
|
+
resource: _options.resource,
|
|
4317
|
+
}))
|
|
4318
|
+
.chain((values) => values.head());
|
|
4319
|
+
})));
|
|
4320
|
+
let $Identifier;
|
|
4321
|
+
(function ($Identifier) {
|
|
4322
|
+
$Identifier.fromString = $identifierFromString; // biome-ignore lint/suspicious/noShadowRestrictedNames: allow toString
|
|
4323
|
+
$Identifier.toString = Resource.Identifier.toString;
|
|
4324
|
+
})($Identifier = $Object.$Identifier || ($Object.$Identifier = {}));
|
|
4247
4325
|
$Object.$schema = {
|
|
4326
|
+
kind: "NamedObjectUnion",
|
|
4327
|
+
members: {
|
|
4328
|
+
NodeShape: { discriminantValues: ["NodeShape"], type: NodeShape.$schema },
|
|
4329
|
+
Ontology: { discriminantValues: ["Ontology"], type: Ontology.$schema },
|
|
4330
|
+
PropertyGroup: {
|
|
4331
|
+
discriminantValues: ["PropertyGroup"],
|
|
4332
|
+
type: PropertyGroup.$schema,
|
|
4333
|
+
},
|
|
4334
|
+
PropertyShape: {
|
|
4335
|
+
discriminantValues: ["PropertyShape"],
|
|
4336
|
+
type: PropertyShape.$schema,
|
|
4337
|
+
},
|
|
4338
|
+
},
|
|
4248
4339
|
properties: {
|
|
4249
4340
|
labels: {
|
|
4250
4341
|
kind: "Shacl",
|
|
@@ -4256,22 +4347,41 @@ export var $Object;
|
|
|
4256
4347
|
},
|
|
4257
4348
|
},
|
|
4258
4349
|
};
|
|
4259
|
-
|
|
4260
|
-
if (NodeShape.isNodeShape(
|
|
4261
|
-
return
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4350
|
+
$Object.$toRdfResourceValues = ((value, _options) => {
|
|
4351
|
+
if (NodeShape.isNodeShape(value)) {
|
|
4352
|
+
return [
|
|
4353
|
+
NodeShape.$toRdfResource(value, {
|
|
4354
|
+
graph: _options.graph,
|
|
4355
|
+
resourceSet: _options.resourceSet,
|
|
4356
|
+
}).identifier,
|
|
4357
|
+
];
|
|
4358
|
+
}
|
|
4359
|
+
if (Ontology.isOntology(value)) {
|
|
4360
|
+
return [
|
|
4361
|
+
Ontology.$toRdfResource(value, {
|
|
4362
|
+
graph: _options.graph,
|
|
4363
|
+
resourceSet: _options.resourceSet,
|
|
4364
|
+
}).identifier,
|
|
4365
|
+
];
|
|
4366
|
+
}
|
|
4367
|
+
if (PropertyGroup.isPropertyGroup(value)) {
|
|
4368
|
+
return [
|
|
4369
|
+
PropertyGroup.$toRdfResource(value, {
|
|
4370
|
+
graph: _options.graph,
|
|
4371
|
+
resourceSet: _options.resourceSet,
|
|
4372
|
+
}).identifier,
|
|
4373
|
+
];
|
|
4374
|
+
}
|
|
4375
|
+
if (PropertyShape.isPropertyShape(value)) {
|
|
4376
|
+
return [
|
|
4377
|
+
PropertyShape.$toRdfResource(value, {
|
|
4378
|
+
graph: _options.graph,
|
|
4379
|
+
resourceSet: _options.resourceSet,
|
|
4380
|
+
}).identifier,
|
|
4381
|
+
];
|
|
4382
|
+
}
|
|
4383
|
+
throw new Error("unable to serialize to RDF");
|
|
4384
|
+
});
|
|
4275
4385
|
})($Object || ($Object = {}));
|
|
4276
4386
|
export class $RdfjsDatasetObjectSet {
|
|
4277
4387
|
$graph;
|
|
@@ -4316,7 +4426,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4316
4426
|
nodeShapesSync(query) {
|
|
4317
4427
|
return this.$objectsSync({
|
|
4318
4428
|
$filter: NodeShape.$filter,
|
|
4319
|
-
$
|
|
4429
|
+
$fromRdfResource: NodeShape.$fromRdfResource,
|
|
4320
4430
|
$fromRdfTypes: [NodeShape.$fromRdfType],
|
|
4321
4431
|
}, query);
|
|
4322
4432
|
}
|
|
@@ -4347,7 +4457,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4347
4457
|
ontologiesSync(query) {
|
|
4348
4458
|
return this.$objectsSync({
|
|
4349
4459
|
$filter: Ontology.$filter,
|
|
4350
|
-
$
|
|
4460
|
+
$fromRdfResource: Ontology.$fromRdfResource,
|
|
4351
4461
|
$fromRdfTypes: [Ontology.$fromRdfType],
|
|
4352
4462
|
}, query);
|
|
4353
4463
|
}
|
|
@@ -4378,7 +4488,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4378
4488
|
propertyGroupsSync(query) {
|
|
4379
4489
|
return this.$objectsSync({
|
|
4380
4490
|
$filter: PropertyGroup.$filter,
|
|
4381
|
-
$
|
|
4491
|
+
$fromRdfResource: PropertyGroup.$fromRdfResource,
|
|
4382
4492
|
$fromRdfTypes: [PropertyGroup.$fromRdfType],
|
|
4383
4493
|
}, query);
|
|
4384
4494
|
}
|
|
@@ -4409,7 +4519,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4409
4519
|
propertyShapesSync(query) {
|
|
4410
4520
|
return this.$objectsSync({
|
|
4411
4521
|
$filter: PropertyShape.$filter,
|
|
4412
|
-
$
|
|
4522
|
+
$fromRdfResource: PropertyShape.$fromRdfResource,
|
|
4413
4523
|
$fromRdfTypes: [PropertyShape.$fromRdfType],
|
|
4414
4524
|
}, query);
|
|
4415
4525
|
}
|
|
@@ -4441,12 +4551,12 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4441
4551
|
return this.$objectUnionsSync([
|
|
4442
4552
|
{
|
|
4443
4553
|
$filter: Shape.$filter,
|
|
4444
|
-
$
|
|
4554
|
+
$fromRdfResource: NodeShape.$fromRdfResource,
|
|
4445
4555
|
$fromRdfTypes: [NodeShape.$fromRdfType],
|
|
4446
4556
|
},
|
|
4447
4557
|
{
|
|
4448
4558
|
$filter: Shape.$filter,
|
|
4449
|
-
$
|
|
4559
|
+
$fromRdfResource: PropertyShape.$fromRdfResource,
|
|
4450
4560
|
$fromRdfTypes: [PropertyShape.$fromRdfType],
|
|
4451
4561
|
},
|
|
4452
4562
|
], query);
|
|
@@ -4479,22 +4589,22 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4479
4589
|
return this.$objectUnionsSync([
|
|
4480
4590
|
{
|
|
4481
4591
|
$filter: $Object.$filter,
|
|
4482
|
-
$
|
|
4592
|
+
$fromRdfResource: NodeShape.$fromRdfResource,
|
|
4483
4593
|
$fromRdfTypes: [NodeShape.$fromRdfType],
|
|
4484
4594
|
},
|
|
4485
4595
|
{
|
|
4486
4596
|
$filter: $Object.$filter,
|
|
4487
|
-
$
|
|
4597
|
+
$fromRdfResource: Ontology.$fromRdfResource,
|
|
4488
4598
|
$fromRdfTypes: [Ontology.$fromRdfType],
|
|
4489
4599
|
},
|
|
4490
4600
|
{
|
|
4491
4601
|
$filter: $Object.$filter,
|
|
4492
|
-
$
|
|
4602
|
+
$fromRdfResource: PropertyGroup.$fromRdfResource,
|
|
4493
4603
|
$fromRdfTypes: [PropertyGroup.$fromRdfType],
|
|
4494
4604
|
},
|
|
4495
4605
|
{
|
|
4496
4606
|
$filter: $Object.$filter,
|
|
4497
|
-
$
|
|
4607
|
+
$fromRdfResource: PropertyShape.$fromRdfResource,
|
|
4498
4608
|
$fromRdfTypes: [PropertyShape.$fromRdfType],
|
|
4499
4609
|
},
|
|
4500
4610
|
], query);
|
|
@@ -4509,7 +4619,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4509
4619
|
if (offset < 0) {
|
|
4510
4620
|
offset = 0;
|
|
4511
4621
|
}
|
|
4512
|
-
const
|
|
4622
|
+
const fromRdfResourceOptions = {
|
|
4513
4623
|
graph,
|
|
4514
4624
|
objectSet: this,
|
|
4515
4625
|
preferredLanguages: query?.preferredLanguages,
|
|
@@ -4559,7 +4669,9 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4559
4669
|
identifierSet.add(quad.subject);
|
|
4560
4670
|
const resource = resourceSet.resource(quad.subject);
|
|
4561
4671
|
// Eagerly eliminate the majority of resources that won't match the object type
|
|
4562
|
-
objectType
|
|
4672
|
+
objectType
|
|
4673
|
+
.$fromRdfResource(resource, fromRdfResourceOptions)
|
|
4674
|
+
.ifRight((object) => {
|
|
4563
4675
|
resources.push({ object, resource });
|
|
4564
4676
|
});
|
|
4565
4677
|
}
|
|
@@ -4572,7 +4684,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4572
4684
|
const objects = [];
|
|
4573
4685
|
for (let { object, resource } of resources) {
|
|
4574
4686
|
if (!object) {
|
|
4575
|
-
const objectEither = objectType.$
|
|
4687
|
+
const objectEither = objectType.$fromRdfResource(resource, fromRdfResourceOptions);
|
|
4576
4688
|
if (objectEither.isLeft()) {
|
|
4577
4689
|
return objectEither;
|
|
4578
4690
|
}
|
|
@@ -4600,7 +4712,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4600
4712
|
if (offset < 0) {
|
|
4601
4713
|
offset = 0;
|
|
4602
4714
|
}
|
|
4603
|
-
const
|
|
4715
|
+
const fromRdfResourceOptions = {
|
|
4604
4716
|
graph,
|
|
4605
4717
|
objectSet: this,
|
|
4606
4718
|
preferredLanguages: query?.preferredLanguages,
|
|
@@ -4654,7 +4766,7 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4654
4766
|
const resource = resourceSet.resource(quad.subject);
|
|
4655
4767
|
for (const objectType of objectTypes) {
|
|
4656
4768
|
if (objectType
|
|
4657
|
-
.$
|
|
4769
|
+
.$fromRdfResource(resource, fromRdfResourceOptions)
|
|
4658
4770
|
.ifRight((object) => {
|
|
4659
4771
|
resources.push({ object, objectType, resource });
|
|
4660
4772
|
})
|
|
@@ -4674,12 +4786,12 @@ export class $RdfjsDatasetObjectSet {
|
|
|
4674
4786
|
if (!object) {
|
|
4675
4787
|
let objectEither;
|
|
4676
4788
|
if (objectType) {
|
|
4677
|
-
objectEither = objectType.$
|
|
4789
|
+
objectEither = objectType.$fromRdfResource(resource, fromRdfResourceOptions);
|
|
4678
4790
|
}
|
|
4679
4791
|
else {
|
|
4680
4792
|
objectEither = Left(new Error("no object types"));
|
|
4681
4793
|
for (const tryObjectType of objectTypes) {
|
|
4682
|
-
objectEither = tryObjectType.$
|
|
4794
|
+
objectEither = tryObjectType.$fromRdfResource(resource, fromRdfResourceOptions);
|
|
4683
4795
|
if (objectEither.isRight()) {
|
|
4684
4796
|
objectType = tryObjectType;
|
|
4685
4797
|
break;
|