NREL / BuildingMOTIF

Building Metadata OnTology Interoperability Framework (BuildingMOTIF). For models, see https://models.open223.info/
https://buildingmotif.readthedocs.io/
Other
48 stars 7 forks source link

Confusing text in SHACL validation for MinCount constraints #345

Open lazlop opened 2 weeks ago

lazlop commented 2 weeks ago

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 commented 2 weeks ago

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.