我有一个带有 ash:SPARQLTarget
和 a的 Nodeshape sh:SPARQLRule
。我尝试将 Target 和 Rule 作为查询运行并且都提供结果,但是当我使用 Apache Jena SHACL 处理器执行 Shapes 时,它不会构造任何三元组。我做错什么了吗?我没主意了。这是我的节点形状:
iep:hasKG331
a rdf:Property, sh:NodeShape ;
sh:Target [
a sh:SPARQLTarget ;
sh:select """
PREFIX express: <https://w3id.org/express#>
PREFIX ifcowl: <http://standards.buildingsmart.org/IFC/DEV/IFC4/ADD1/OWL#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX iep: <https://www.inf.bi.rub.de/semweb/ns/ifc-enrichment-procedure/iep#>
SELECT ?this
WHERE {
?this rdf:type ifcowl:IfcWallStandardCase .
?relDefinesByProperties ifcowl:relatedObjects_IfcRelDefines ?this .
?relDefinesByProperties ifcowl:relatingPropertyDefinition_IfcRelDefinesByProperties ?pset .
}
""" ;
] ;
sh:rule [
a sh:SPARQLRule ;
sh:construct """
PREFIX express: <https://w3id.org/express#>
PREFIX ifcowl: <http://standards.buildingsmart.org/IFC/DEV/IFC4/ADD1/OWL#>
PREFIX iep: <xxx/ifc-enrichment-procedure/iep#>
CONSTRUCT {
$this iep:hasKG iep:hasKG331 .
}
WHERE {
?relDBP ifcowl:relatedObjects_IfcRelDefines $this .
?relDBP ifcowl:relatingPropertyDefinition_IfcRelDefinesByProperties ?propSet .
?propSet ifcowl:hasProperties_IfcPropertySet ?psv1 .
?propSet ifcowl:hasProperties_IfcPropertySet ?psv2 .
?psv1 iep:isExternal true .
?psv2 iep:isLoadBearing true .
}
""" ;
] .
正如我所提到的,当我将目标或规则作为单个查询执行时,我确实得到了结果,并且目标中的焦点节点确实像$this
规则中一样出现。IRIiep:isExternal
并iep:isLoadBearing
在之前的步骤中得到了推断。我错过了什么吗?