Rdf SHACL union形状

Rdf SHACL union形状,rdf,semantic-web,shacl,Rdf,Semantic Web,Shacl,我为以下用例构建了一个SPARQL查询:如果IfcWallStandardCase有一个属性“FireRating”,那么与之关联的门也应该有一个属性“FireRating” 数据图 @prefix inst1: <https://someHost.com/PROJ1001#> . @prefix : <http://test.com/#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @pr

我为以下用例构建了一个SPARQL查询:如果IfcWallStandardCase有一个属性“FireRating”,那么与之关联的门也应该有一个属性“FireRating”

数据图

@prefix inst1: <https://someHost.com/PROJ1001#> .
@prefix :      <http://test.com/#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ifcowl: <https://www.buildingsmart-tech.org/ifcOWL/IFC4_ADD1#> .
@prefix s4bldg: <https://saref.etsi.org/saref4bldg/> .
@prefix bot:   <https://w3id.org/bot#> .

inst1:Wall1  a  ifcowl:IfcWallStandardCase ;
    s4bldg:FireRating "2" ;
    bot:containsSubElement  inst1:Door1, inst1:Door2.
inst1:Door1 a ifcowl:IfcDoor ;
    s4bldg:FireRating  "2" .
inst1:Door2 a ifcowl:IfcDoor .
我想为同样的东西框一个沙克尔形状。从SHACL高级功能中,最接近的选项是使用sh:union。下面是我的形状

bot:BuildingShape
    a sh:NodeShape ;
    sh:targetClass ifcowl:IfcWallStandardCase;
    sh:rule [
        sh:subject sh:this;
        sh:predicate s4bldg:FireRating;
        sh:object ifcowl:IfcWallStandardCase;
        sh:union(
            [sh:path ifcowl:IfcDoor]
            [sh:path s4bldg:FireRating]
        )
    ].

但是,它没有给出SPARQL查询给出的结果。我哪里做错了?任何帮助都将不胜感激。

SPARQL查询看起来很奇怪,是否正确?为什么
?墙机器人:集装箱组件?val.?墙s4bldg:防火等级?val.
-只有在共享
?val
的情况下,元件和防火等级相同时,该功能才起作用。这符合数据模型吗?还有,你能说什么不起作用吗?还有,您是否错过了
a sh:TripleRule零件?那么,是否应该将该联合放入一个?如果可以获取希望通过SPARQL查询推断的值,为什么不简单地将该查询转换为SPARQL构造并使用基于SPARQL的sh:rule?此外,sh:union与任何东西都断开连接。您可以将其用作sh:object的值,也可以将其用作sh:condition。
bot:BuildingShape
    a sh:NodeShape ;
    sh:targetClass ifcowl:IfcWallStandardCase;
    sh:rule [
        sh:subject sh:this;
        sh:predicate s4bldg:FireRating;
        sh:object ifcowl:IfcWallStandardCase;
        sh:union(
            [sh:path ifcowl:IfcDoor]
            [sh:path s4bldg:FireRating]
        )
    ].