SPARQLRule未构造
我有一个带有SPARQLRule未构造,sparql,jena,shacl,Sparql,Jena,Shacl,我有一个带有sh:SPARQLTarget和sh:SPARQLRule的Nodeshape。我尝试以查询的形式运行Target和Rule,并且两者都提供结果,但是当我使用apachejena-SHACL处理器执行形状时,它不会构造任何三元组。我做错什么了吗?我没有主意了。 这是我的头像: iep:hasKG331 a rdf:Property, sh:NodeShape ; sh:Target [ a sh:SPARQLTarget ; sh:select "
sh:SPARQLTarget
和sh:SPARQLRule
的Nodeshape。我尝试以查询的形式运行Target和Rule,并且两者都提供结果,但是当我使用apachejena-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 .
}
""" ;
] .
iep:hasKG331
a rdf:Property,sh:NodeShape;
sh:目标[
sh:SPARQLTarget;
sh:选择“”
前缀express:
前缀ifcowl:
前缀rdf:
前缀iep:
选择这个
在哪里{
?此rdf:ifcowl型:IFCWALLLStandardCase。
?如果Cowl:relatedObjects\u如果Creldefines?这是一个。
?根据属性定义关系如果COWL:RelatingProperty定义\u如果CreldFinesByProperties?pset。
}
""" ;
] ;
sh:规则[
a sh:SPARQLRule;
sh:构造“”
前缀express:
前缀ifcowl:
前缀iep:
构造{
$this iep:hasKG iep:hasKG331。
}
在哪里{
?relDBP ifcowl:relatedObjects\u IfcRelDefines$this。
?relDBP ifcowl:相关属性定义\u IFCRELDEFINES子属性?属性集。
?propSet ifcowl:hasProperties\u IfcPropertySet?psv1。
?propSet ifcowl:hasProperties\u IfcPropertySet?psv2。
?psv1 iep:isExternal true。
?psv2 iep:ISLOADWARNING true。
}
""" ;
] .
正如我提到的,当我以单个查询的形式执行目标或规则时,我确实会得到结果,并且目标的焦点节点在规则中显示为
$this
。虹膜iep:isExternal
和iep:isLoadBearing
在之前的一步中被推断出来。我遗漏了什么吗?不看细节,sh:Target需要是sh:Target,小写为t。所有的财产名称通常都是小写。哈哈,是的,当然是这样的。非常感谢你指出这一点。