Skip to content

Commit

Permalink
refactor: remove warning about valid qudt:hasUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Mar 28, 2024
1 parent 7b5e204 commit d3c091b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ _:report a sh:ValidationReport ;
rdf:type sh:ValidationResult ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
sh:sourceShape _:b675 ;
sh:sourceShape _:b678 ;
sh:focusNode _:b6 ;
sh:resultPath rdf:rest ;
sh:resultMessage "list node needs exactly one rdf:rest" ;
Expand Down Expand Up @@ -50,39 +50,39 @@ _:report a sh:ValidationReport ;
rdf:type sh:ValidationResult ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
sh:sourceShape _:b636 ;
sh:sourceShape _:b639 ;
sh:focusNode _:b1 ;
sh:resultPath schema:name ;
sh:resultMessage "Less than 1 values" ;
], [
rdf:type sh:ValidationResult ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
sh:sourceShape _:b636 ;
sh:sourceShape _:b639 ;
sh:focusNode _:b3 ;
sh:resultPath schema:name ;
sh:resultMessage "Less than 1 values" ;
], [
rdf:type sh:ValidationResult ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
sh:sourceShape _:b647 ;
sh:sourceShape _:b650 ;
sh:focusNode _:b1 ;
sh:resultPath sh:datatype ;
sh:resultMessage "Less than 1 values" ;
], [
rdf:type sh:ValidationResult ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
sh:sourceShape _:b647 ;
sh:sourceShape _:b650 ;
sh:focusNode _:b3 ;
sh:resultPath sh:datatype ;
sh:resultMessage "Less than 1 values" ;
], [
rdf:type sh:ValidationResult ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
sh:sourceShape _:b675 ;
sh:sourceShape _:b678 ;
sh:focusNode _:b6 ;
sh:resultPath rdf:rest ;
sh:resultMessage "list node needs exactly one rdf:rest" ;
Expand All @@ -91,13 +91,13 @@ _:report a sh:ValidationReport ;
] ;
sh:conforms false .

_:b675 sh:path rdf:rest ;
_:b678 sh:path rdf:rest ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:message "list node needs exactly one rdf:rest" .

_:b636 sh:path schema:name ;
_:b639 sh:path schema:name ;
sh:minCount 1 .

_:b647 sh:path sh:datatype ;
_:b650 sh:path sh:datatype ;
sh:minCount 1 .
9 changes: 9 additions & 0 deletions test/standalone-constraint-constraint/warning-qudt-unit.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,13 @@ PREFIX qudt: <http://qudt.org/schema/qudt/>
sh:maxCount 1 ;
qudt:unit unit:KiloGM ;
] ;
sh:property
[
sh:datatype xsd:decimal ;
sh:path <dimension2> ;
schema:name "some Quantity" ;
sh:minCount 1 ;
sh:maxCount 1 ;
qudt:hasUnit unit:KiloGM ;
] ;
.
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,25 @@ _:report a sh:ValidationReport ;
sh:result [
rdf:type sh:ValidationResult ;
sh:resultSeverity sh:Warning ;
sh:sourceConstraintComponent sh:NodeConstraintComponent ;
sh:sourceConstraintComponent sh:OrConstraintComponent ;
sh:sourceShape [
sh:path sh:property ;
sh:node _:b631 ;
sh:or (
[
sh:path <http://qudt.org/schema/qudt/unit> ;
sh:equals <http://qudt.org/schema/qudt/hasUnit> ;
]
[
sh:path <http://qudt.org/schema/qudt/unit> ;
sh:maxCount 0 ;
]
) ;
sh:message "The use of qudt:unit is deprecated, please use qudt:hasUnit instead" ;
sh:severity sh:Warning ;
] ;
sh:focusNode <https://example.org/shape> ;
sh:resultPath sh:property ;
sh:value _:b3 ;
sh:resultMessage "The use of qudt:unit is deprecated, please use qudt:hasUnit instead" ;
sh:detail [
rdf:type sh:ValidationResult ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:EqualsConstraintComponent ;
sh:sourceShape _:b631 ;
sh:focusNode _:b3 ;
sh:resultPath <http://qudt.org/schema/qudt/unit> ;
sh:value <http://qudt.org/vocab/unit/KiloGM> ;
sh:resultMessage "Must have same values as <http://qudt.org/schema/qudt/hasUnit>" ;
] ;
] ;
sh:conforms false .

_:b631 sh:path <http://qudt.org/schema/qudt/unit> ;
sh:equals <http://qudt.org/schema/qudt/hasUnit> .
14 changes: 10 additions & 4 deletions validation/standalone-constraint-constraint.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,16 @@
] ,
[
sh:path sh:property ;
sh:node [
sh:path qudt:unit ;
sh:equals qudt:hasUnit ;
] ;
sh:or (
[
sh:path qudt:unit ;
sh:equals qudt:hasUnit ;
]
[
sh:path qudt:unit ;
sh:maxCount 0 ;
]
) ;
sh:severity sh:Warning ;
sh:message "The use of qudt:unit is deprecated, please use qudt:hasUnit instead" ;
] ;
Expand Down

0 comments on commit d3c091b

Please sign in to comment.