我正在尝试根据 SHACL 图验证 RDF 文件。我无法在此处发布这些文件,因为它们太大,但我粘贴了示例部分。 辐射分布函数:
ex:GUID_5ACC3D0F-28A1-4E83-A0F1-930748BCB013_9_4 a sf:Polygon, citygml:WallSurfaceType ; geo:asWKT "POLYGON Z ((78864.787 457866.289 10.244, 78866.931 457863.129 10.244, 78865.859 457864.71 12.256, 78864.787 457866.289 10.244))"^^geo:wktLiteral ; citygml:parent ex:GUID_5ACC3D0F-28A1-4E83-A0F1-930748BCB013_9 ; brep:directionNormalX -8.275105e-01 ; brep:directionNormalY -5.614502e-01 ; brep:directionNormalZ 2.790508e-04 ; valid:consecutiveSamePoints false ; valid:hasDuplicatedRings false ; valid:hasHoleOutside false ; valid:hasInnerNestedRings false ; valid:hasInteriorDisconnected false ; valid:hasIntersectedRings false ; valid:isCcwise true ; valid:isClosed false ; valid:isCollapsedtoLine false ; valid:isCoplanar false ; valid:isNormalsDeviated false ; valid:noSelfIntersection true ; valid:tooFewPoints false ; valid:wallSurfaceNormals true
SHACL:
<http://www.opengis.net/ont/sf#Polygon-isNormalsDeviated> a sh:PropertyShape ; sh:hasValue false ; sh:path <http://www.semanticweb.org/alper/ontologies/2024/3/8/untitled-ontology-32#isNormalsDeviated>
问题:在RDF大小上,相关节点的值为“valid:isNormalsDeviated false;”,SHACL也有“sh:hasValue false”约束,但pyshacl引擎无法匹配它们,引发以下错误:
验证报告:
Constraint Violation in HasValueConstraintComponent (http://www.w3.org/ns/shacl#HasValueConstraintComponent): Severity: sh:Violation Source Shape: <http://www.opengis.net/ont/sf#Polygon-isNormalsDeviated> Focus Node: ex:GUID_5ACC3D0F-28A1-4E83-A0F1-930748BCB013_9_4 Result Path: <http://www.semanticweb.org/alper/ontologies/2024/3/8/untitled-ontology-32#isNormalsDeviated> Message: Node ex:GUID_5ACC3D0F-28A1-4E83-A0F1-930748BCB013_9_4-><http://www.semanticweb.org/alper/ontologies/2024/3/8/untitled-ontology-32#isNormalsDeviated> does not contain a value in the set: ['Literal("false" = False, datatype=xsd:boolean)']
我缺少什么部分?感谢您的帮助。
我还尝试在 RDF 转换器中将 Python 布尔值转换为“str(True).lower(), datatype=XSD.boolean”,但没有任何改变。