SPARQLRule 未构建

问题描述

我有一个带有 sh:SPARQLTargetsh:SPARQLRule 的 Nodeshape。我尝试将 Target 和 Rule 作为查询运行并且都提供结果,但是当我使用 Apache Jena SHACL 处理器执行形状时,它不会构造任何三元组。我做错什么了吗?我没有想法了。 这是我的节点形状:

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。 IRI iep:isExternaliep:isLoadbearing 在之前的步骤中被推断出来。我错过了什么吗?

解决方法

不看细节,sh:Target 需要是小写的 t 的 sh:target。所有属性名称通常都是小写的。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...