Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing text in SHACL validation for MinCount constraints #345

Open
lazlop opened this issue Sep 11, 2024 · 1 comment
Open

Confusing text in SHACL validation for MinCount constraints #345

lazlop opened this issue Sep 11, 2024 · 1 comment

Comments

@lazlop
Copy link

lazlop commented Sep 11, 2024

For shapes that specify a minCount but no maxCount, shacl validation returns a confusing message.

For example with the shape:

s223:Boiler
  a s223:Class ;
  a sh:NodeShape ;
  rdfs:comment "A closed, pressure vessel that uses fuel or electricity for heating water or other fluids to supply steam or hot water for heating, humidification, or other applications." ;
  rdfs:label "Boiler" ;
  rdfs:subClassOf s223:Equipment ;
  sh:property [
      sh:path s223:hasConnectionPoint ;
      rdfs:comment "A Boiler shall have at least one inlet using the medium Water." ;
      sh:minCount 1 ;
      sh:qualifiedMinCount 1 ;
      sh:qualifiedValueShape [
          sh:class s223:InletConnectionPoint ;
          sh:node [
              sh:property [
                  sh:path s223:hasMedium ;
                  sh:class s223:Fluid-Water ;
                ] ;
            ] ;
        ] ;
    ] ;

The message that results from this is:

urn:ex/Boiler_Fulton_PHW1000 needs between 1 and None instances of http://data.ashrae.org/standard223#InletConnectionPoint on path http://data.ashrae.org/standard223#hasConnectionPoint

This may lead a user to believe there can be 1 or 0 instances of inlet connection point, when really it should be 1 and More. Not sure how easy of a fix this is, but making an issue before forgetting about it!

@lazlop
Copy link
Author

lazlop commented Sep 11, 2024

We are getting other confusing text. The below validation error was caused by the properties of a heat pump being defined incorrectly, without having the class s223:Property.

"urn:ex/Heat_Pump_1_6 needs to be a http://data.ashrae.org/standard223#Property"

The result indicates that the equipment related to the property by hasProperty should be a s223:Property, which is misleading, because really the property needs to have the class s223:Property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant