|
@@ -3,6 +3,7 @@
|
|
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
|
+@prefix vim4: <http://bipm.org/jcgm/vim4#> .
|
|
|
|
|
|
@prefix comp: <http://ua.com.be/sdo2l/vocabulary/component#> .
|
|
|
@prefix base: <http://ua.com.be/sdo2l/vocabulary/base#> .
|
|
@@ -25,6 +26,10 @@ comp-shapes:
|
|
|
sh:declare [
|
|
|
sh:prefix "rdf" ;
|
|
|
sh:namespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#"^^xsd:anyURI ;
|
|
|
+ ] ;
|
|
|
+ sh:declare [
|
|
|
+ sh:prefix "vim4" ;
|
|
|
+ sh:namespace "http://bipm.org/jcgm/vim4#"^^xsd:anyURI ;
|
|
|
] .
|
|
|
|
|
|
comp-shapes:Car_contains_4_Wheels_shacl
|
|
@@ -34,7 +39,61 @@ comp-shapes:Car_contains_4_Wheels_shacl
|
|
|
sh:path base:contains ;
|
|
|
sh:class comp:WheelComponent ;
|
|
|
sh:nodeKind sh:IRI ;
|
|
|
- sh:minCount 3 ;
|
|
|
- sh:maxCount 3 ;
|
|
|
+ sh:minCount 4 ;
|
|
|
+ sh:maxCount 4 ;
|
|
|
] ;
|
|
|
- sh:closed false .
|
|
|
+ sh:property [
|
|
|
+ sh:path base:contains ;
|
|
|
+ sh:severity sh:Warning ;
|
|
|
+ sh:sparql [
|
|
|
+ a sh:SPARQLConstraint ;
|
|
|
+ sh:message "Wheel mass difference from the average should be less than 5%" ;
|
|
|
+ sh:prefixes [
|
|
|
+ sh:declare [
|
|
|
+ sh:prefix "comp" ;
|
|
|
+ sh:namespace "http://ua.com.be/sdo2l/vocabulary/component#"^^xsd:anyURI ;
|
|
|
+ ] ] ,
|
|
|
+ [ sh:declare [
|
|
|
+ sh:prefix "base" ;
|
|
|
+ sh:namespace "http://ua.com.be/sdo2l/vocabulary/base#"^^xsd:anyURI ;
|
|
|
+ ] ] ,
|
|
|
+ [ sh:declare [
|
|
|
+ sh:prefix "rdf" ;
|
|
|
+ sh:namespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#"^^xsd:anyURI ;
|
|
|
+ ] ] ,
|
|
|
+ [ sh:declare [
|
|
|
+ sh:prefix "vim4" ;
|
|
|
+ sh:namespace "http://bipm.org/jcgm/vim4#"^^xsd:anyURI ;
|
|
|
+ ] ];
|
|
|
+ sh:select """
|
|
|
+ SELECT $this ?wheel ?attMass ?avg
|
|
|
+ WHERE {
|
|
|
+ $this rdf:type comp:CarComponent .
|
|
|
+ ?wheel rdf:type comp:WheelComponent .
|
|
|
+ $this $PATH ?wheel .
|
|
|
+ ?attribute rdf:type comp:Attribute .
|
|
|
+ ?attribute vim4:characterizes ?wheel .
|
|
|
+ ?attribute base:hasIdentifier ?attID .
|
|
|
+ FILTER regex(?attID, "w[0-9]-mass") .
|
|
|
+ ?attribute vim4:hasDoubleNumber ?attMass .
|
|
|
+ {
|
|
|
+ SELECT $this (avg(?attMass2) as ?avg)
|
|
|
+ WHERE {
|
|
|
+ $this rdf:type comp:CarComponent .
|
|
|
+ ?wheel2 rdf:type comp:WheelComponent .
|
|
|
+ $this $PATH ?wheel2 .
|
|
|
+ ?attribute2 rdf:type comp:Attribute .
|
|
|
+ ?attribute2 vim4:characterizes ?wheel2 .
|
|
|
+ ?attribute2 base:hasIdentifier ?attID2 .
|
|
|
+ FILTER regex(?attID2, "w[0-9]-mass") .
|
|
|
+ ?attribute2 vim4:hasDoubleNumber ?attMass2 .
|
|
|
+ }
|
|
|
+ GROUP BY $this
|
|
|
+ }
|
|
|
+ }
|
|
|
+ HAVING (abs(?attMass-?avg) >= (?avg*0.05) )
|
|
|
+ """
|
|
|
+ ]
|
|
|
+ ] ;
|
|
|
+ sh:closed false .
|
|
|
+
|