HajoRijgersberg / OM

Ontology of units of Measure
88 stars 23 forks source link

Robot verification raises issues with the current draft #59

Closed rpgoldman closed 2 years ago

rpgoldman commented 2 years ago

I checked OM-2 against the OWL DL profile using robot, as follows:

robot validate-profile --profile DL --input OM/om-2.0.rdf --output OM/validation.txt

Then, because there were a bunch of bibliography info constraints, I did the following filtering:

cat OM/validation.txt | fgrep -v bibo | fgrep -v foaf | fgrep -v purl.org | fgrep -v bibliography > OM/filtered-validation.txt

This gave me the attached file, which mentions 16 issues. filtered-validation.txt

Trying to track this down, I see the following:

  1. I don't think robot likes the following, because it applies the Union operator to a collection with only one element:
  <owl:Class rdf:about="&om;FahrenheitTemperatureUnit">
    <rdfs:label xml:lang="en">Fahrenheit temperature unit</rdfs:label>
    <rdfs:subClassOf rdf:resource="&om;TemperatureUnit"/>
    <owl:equivalentClass>
      <owl:Class>
        <owl:unionOf rdf:parseType="Collection">
          <owl:Class>
            <owl:oneOf rdf:parseType="Collection">
              <om:Unit rdf:about="&om;degreeFahrenheit"/>
            </owl:oneOf>
          </owl:Class>
        </owl:unionOf>
      </owl:Class>
    </owl:equivalentClass>
  </owl:Class>        

There are a number of similar cases like this, in om:FixedPoint, om:FahrenheitTemperatureUnit, om:gramPerSquareMetre, and om:ReaumurTemperatureUnit.

To be quite honest, it doesn't seem to me that having some degenerate Union's is actually bad, but it looks like they could be removed.

  1. There are a few "Use of undeclared class:" in the report, too, for: om:FahrenheitScale, om:CelsiusScale, om:RankineScale, om:ReaumurScale, om:KelvinScale.
HajoRijgersberg commented 2 years ago

Thanx for your action! :)

  1. I'll put this on my to-do list. Hope to solve this soon. I'll keep you updated. P.S.: I agree with you that these Unions actually is not bad. But I'm certainly willing to remove them.
  2. That's strange. These definitions are simply present in OM. For instance, om:CelsiusScale:
  <om:IntervalScale rdf:about="&om;CelsiusScale">
    <rdfs:label xml:lang="en">Celsius scale</rdfs:label>
    <rdfs:label xml:lang="nl">Celsiusschaal</rdfs:label>
    <rdfs:label xml:lang="zh">摄氏温标</rdfs:label>
    <om:alternativeLabel xml:lang="en">International Celsius Temperature scale of 1990</om:alternativeLabel>
    <om:hasDimension rdf:resource="&om;thermodynamicTemperature-Dimension"/>
  </om:IntervalScale>
rpgoldman commented 2 years ago

Actually, I think I see the problem with these items. Robot seems to be saying that it expects these to be classes, but in OM-2 they are individuals.

I can't really read OWL RDF, so I am working from a translation into Manchester form. What I see is this:

Class: <http://www.ontology-of-units-of-measure.org/resource/om-2/FahrenheitScale>

    Annotations: 
        rdfs:label "Fahrenheit scale"@en,
        rdfs:label "Fahrenheitschaal"@nl,
        rdfs:label "华氏温标"@zh

    EquivalentTo: 
        <http://www.ontology-of-units-of-measure.org/resource/om-2/FahrenheitTemperatureScale>

and I see this:

Individual: <http://www.ontology-of-units-of-measure.org/resource/om-2/FahrenheitScale>

    Annotations: 
        rdfs:label "Fahrenheit scale"@en,
        rdfs:label "Fahrenheitschaal"@nl,
        rdfs:label "华氏温标"@zh

    Types: 
        <http://www.ontology-of-units-of-measure.org/resource/om-2/IntervalScale>

    Facts:  
     <http://www.ontology-of-units-of-measure.org/resource/om-2/hasDimension>  <http://www.ontology-of-units-of-measure.org/resource/om-2/thermodynamicTemperature-Dimension>,
     <http://www.ontology-of-units-of-measure.org/resource/om-2/hasScale>  <http://www.ontology-of-units-of-measure.org/resource/om-2/KelvinScale>,
     <http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit>  <http://www.ontology-of-units-of-measure.org/resource/om-2/degreeFahrenheit>,
     <http://www.ontology-of-units-of-measure.org/resource/om-2/hasFactor>  1.8f,
     <http://www.ontology-of-units-of-measure.org/resource/om-2/hasOff-Set>  -459.67f

Is this intended punning? And, if so, is it robot's problem that it doesn't accept it?

HajoRijgersberg commented 2 years ago

Sorry for my late reply, busy times. Thanks for checking. It's strange: FahrenheitScale is never defined as a class in OM. It is simply defined as an instance, just like CelsiusScale:

  <om:IntervalScale rdf:about="&om;FahrenheitScale">
    <rdfs:label xml:lang="en">Fahrenheit scale</rdfs:label>
    <rdfs:label xml:lang="nl">Fahrenheitschaal</rdfs:label>
    <rdfs:label xml:lang="zh">华氏温标</rdfs:label>
    <om:hasFactor rdf:datatype="&xsd;float">1.8</om:hasFactor>
    <om:hasOff-Set rdf:datatype="&xsd;float">-459.67</om:hasOff-Set>
    <om:hasScale rdf:resource="&om;KelvinScale"/>
    <om:hasUnit rdf:resource="&om;degreeFahrenheit"/>
    <om:hasDimension rdf:resource="&om;thermodynamicTemperature-Dimension"/>
  </om:IntervalScale>

Does that help? It's no intended punning or anything. Do you know how/why these scales become classes for the robot?

HajoRijgersberg commented 2 years ago

With respect to the second item, maybe I should report this to the Robot folks as a possible bug.

Strange, I don't see this message anymore in the GitHub. Is that correct or is something wrong?

rpgoldman commented 2 years ago

With respect to the second item, maybe I should report this to the Robot folks as a possible bug.

Strange, I don't see this message anymore in the GitHub. Is that correct or is something wrong?

I'm not sure, to be honest.

rpgoldman commented 2 years ago

Sorry for my late reply, busy times. Thanks for checking. It's strange: FahrenheitScale is never defined as a class in OM. It is simply defined as an instance, just like CelsiusScale:

  <om:IntervalScale rdf:about="&om;FahrenheitScale">
    <rdfs:label xml:lang="en">Fahrenheit scale</rdfs:label>
    <rdfs:label xml:lang="nl">Fahrenheitschaal</rdfs:label>
    <rdfs:label xml:lang="zh">华氏温标</rdfs:label>
    <om:hasFactor rdf:datatype="&xsd;float">1.8</om:hasFactor>
    <om:hasOff-Set rdf:datatype="&xsd;float">-459.67</om:hasOff-Set>
    <om:hasScale rdf:resource="&om;KelvinScale"/>
    <om:hasUnit rdf:resource="&om;degreeFahrenheit"/>
    <om:hasDimension rdf:resource="&om;thermodynamicTemperature-Dimension"/>
  </om:IntervalScale>

Does that help? It's no intended punning or anything. Do you know how/why these scales become classes for the robot?

If that is right, does that imply that Robot has actually created the definition of FahrenheitScale as a class in the process of translating RDF to Manchester notation? I will check!

rpgoldman commented 2 years ago

I think I see the problem:

  <owl:Class rdf:about="&om;FahrenheitTemperatureScale">
    <rdfs:label xml:lang="en">Fahrenheit temperature scale</rdfs:label>
    <rdfs:subClassOf rdf:resource="&om;Scale"/> 
    <owl:equivalentClass>
      <om:IntervalScale rdf:about="&om;FahrenheitScale"/>
    </owl:equivalentClass>
  </owl:Class>        

I believe that this should be:

  <owl:Class rdf:about="&om;FahrenheitTemperatureScale">
    <rdfs:label xml:lang="en">Fahrenheit temperature scale</rdfs:label>
    <rdfs:subClassOf rdf:resource="&om;Scale"/> 
    <owl:equivalentClass>
      <owl:Class>  <!-- Equivalent to the class whose only member is FahrenheitScale -->
         <owl:oneOf rdf:parseType="Collection">
            <om:IntervalScale rdf:about="&om;FahrenheitScale"/>
         </owl:oneOf>
      </owl:Class>
    </owl:equivalentClass>
  </owl:Class>        

Warning! That's just hand-written XML. No guarantee it will even parse!

HajoRijgersberg commented 2 years ago

Thanx, that was a very stupid mistake of mine. I'm going to look at your pull request right now!