澄清 Shacl sh:qualifiedValueShape
Clarifying Shacl sh:qualifiedValueShape
sh:qualifiedValueShape状态的定义:
The shape that the specified number of value nodes needs to conform to. The values of sh:qualifiedValueShape in a shape must be well-formed shapes. Node shapes cannot have any value for sh:qualifiedValueShape. This is a mandatory parameter of sh:QualifiedMinCountConstraintComponent and sh:QualifiedMaxCountConstraintComponent.
那么我们有下面的例子
ex:QualifiedValueShapeExampleShape
a sh:NodeShape ;
sh:targetNode ex:QualifiedValueShapeExampleValidResource ;
sh:property [
sh:path ex:parent ;
sh:minCount 2 ;
sh:maxCount 2 ;
sh:qualifiedValueShape [
sh:path ex:gender ;
sh:hasValue ex:female ;
] ;
sh:qualifiedMinCount 1 ;
] .
ex:HandShape
a sh:NodeShape ;
sh:targetClass ex:Hand ;
sh:property [
sh:path ex:digit ;
sh:maxCount 5 ;
] ;
sh:property [
sh:path ex:digit ;
sh:qualifiedValueShape [ sh:class ex:Thumb ] ;
sh:qualifiedValueShapesDisjoint true ;
sh:qualifiedMinCount 1 ;
sh:qualifiedMaxCount 1 ;
] ;
sh:property [
sh:path ex:digit ;
sh:qualifiedValueShape [ sh:class ex:Finger ] ;
sh:qualifiedValueShapesDisjoint true ;
sh:qualifiedMinCount 4 ;
sh:qualifiedMaxCount 4 ;
] .
虽然我很了解这两个示例,但我不明白的是,第二个示例在技术上如何符合规范。我更具体地指向
sh:qualifiedValueShape [ sh:class ex:Finger ]
也就是。在
sh:qualifiedValueShape [
sh:path ex:gender ;
sh:hasValue ex:female ;
] ;
我们可以看到空白节点是属性形状,我不知道
中的空白节点是什么形状
sh:qualifiedValueShape [ sh:class ex:Finger ]
确实代表。
有什么隐含的东西我在这里没有看到吗? sh:class用在了属性的形状里,那么这里的实际路径是什么?
[ sh:class ex:Finger ] 约束是一个隐含的节点形状(因为它没有 sh:path 三元组)。这意味着 ex:digit 的四个值必须符合指定的形状,即它们必须是 ex:Finger 的实例。节点形状直接根据节点进行评估,在那个阶段路径已经被周围的 属性 形状评估。
sh:qualifiedValueShape状态的定义:
The shape that the specified number of value nodes needs to conform to. The values of sh:qualifiedValueShape in a shape must be well-formed shapes. Node shapes cannot have any value for sh:qualifiedValueShape. This is a mandatory parameter of sh:QualifiedMinCountConstraintComponent and sh:QualifiedMaxCountConstraintComponent.
那么我们有下面的例子
ex:QualifiedValueShapeExampleShape
a sh:NodeShape ;
sh:targetNode ex:QualifiedValueShapeExampleValidResource ;
sh:property [
sh:path ex:parent ;
sh:minCount 2 ;
sh:maxCount 2 ;
sh:qualifiedValueShape [
sh:path ex:gender ;
sh:hasValue ex:female ;
] ;
sh:qualifiedMinCount 1 ;
] .
ex:HandShape
a sh:NodeShape ;
sh:targetClass ex:Hand ;
sh:property [
sh:path ex:digit ;
sh:maxCount 5 ;
] ;
sh:property [
sh:path ex:digit ;
sh:qualifiedValueShape [ sh:class ex:Thumb ] ;
sh:qualifiedValueShapesDisjoint true ;
sh:qualifiedMinCount 1 ;
sh:qualifiedMaxCount 1 ;
] ;
sh:property [
sh:path ex:digit ;
sh:qualifiedValueShape [ sh:class ex:Finger ] ;
sh:qualifiedValueShapesDisjoint true ;
sh:qualifiedMinCount 4 ;
sh:qualifiedMaxCount 4 ;
] .
虽然我很了解这两个示例,但我不明白的是,第二个示例在技术上如何符合规范。我更具体地指向
sh:qualifiedValueShape [ sh:class ex:Finger ]
也就是。在
sh:qualifiedValueShape [
sh:path ex:gender ;
sh:hasValue ex:female ;
] ;
我们可以看到空白节点是属性形状,我不知道
中的空白节点是什么形状sh:qualifiedValueShape [ sh:class ex:Finger ]
确实代表。
有什么隐含的东西我在这里没有看到吗? sh:class用在了属性的形状里,那么这里的实际路径是什么?
[ sh:class ex:Finger ] 约束是一个隐含的节点形状(因为它没有 sh:path 三元组)。这意味着 ex:digit 的四个值必须符合指定的形状,即它们必须是 ex:Finger 的实例。节点形状直接根据节点进行评估,在那个阶段路径已经被周围的 属性 形状评估。