title: Redundant superclass in ontology after reasoning (owlready)
body: <p>I try to understand the <a href="https://douroucouli.wordpress.com/2019/06/29/ontotip-learn-the-rector-normalization-technique/" rel="nofollow noreferrer">rector-normalization-technique</a> for ontologies in detail. I use <a href="https://owlready2.readthedocs.io/en/latest/index.html" rel="nofollow noreferrer">owlready</a> to implement the examples.</p>
  <p>The article recommends to have a asserted single inheritance structure and introduce multiple inheritance by inference. As example it uses classes as <code>Protein</code>, <code>Insulin</code>, and <code>Protein_Hormone</code>, <code>Hormone_Role</code>.</p>
  <p>Asserted facts:</p>
  <ul>
  <li><code>Insulin</code> <code>is_subclass_of</code> <code>Protein</code></li>
  <li><code>Insulin</code> <code>plays_role</code> <code>Hormone_Role</code></li>
  <li><code>Protein_Hormone</code> is equivalent to (<code>Protein</code> <code>and</code> <code>plays_role</code> <code>owl:someValuesFrom</code> <code>Hormone_Role</code>) (defined class)</li>
  </ul>
  <p>After the reasoner ran, <code>Insulin</code> is correctly recognized as subclass of <code>Protein_Hormone</code>    (expected result).</p>
  <p><strong>However</strong>, it is <em>still</em> classified as <em>direct</em> subclass of protein. This relation I deem redundant because every instance of <code>Protein_Hormone</code> must be a <code>Protein</code> by definition. Also, if I apply Protegé, the inferred class structure does not contain this redundant relation, as shown here:</p>
  <p><a href="https://i.stack.imgur.com/nPZZ8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nPZZ8.png" alt="protegé export" /></a></p>
  <p>Is there a (canonical) way to get rid of this superfluous subclass relation?</p>
  <p>Alternatively, why is my suspicion of superfluousness wrong?</p>
  <p>Code for this problem (see also <a href="https://nbviewer.ipython.org/github/cknoll/demo-material/blob/main/expertise_system/rector-normalization-minimal.ipynb" rel="nofollow noreferrer">this notebook</a> for outputs):</p>
  <pre class="lang-py prettyprint-override"><code>import owlready2 as owl2
  
  # rme: rector-modularization-example
  onto = owl2.get_ontology(&quot;https://w3id.org/yet/undefined/rme#&quot;)
  
  with onto:
  
      class Protein(owl2.Thing):
          pass
  
      class Insulin(Protein):
          pass
  
      class Hormone_Role(owl2.Thing):
          pass
  
      class plays_role(owl2.ObjectProperty):
          pass
  
  
      class Protein_Hormone(owl2.Thing):
          equivalent_to = [Protein &amp; plays_role.some(Hormone_Role)]
  
  Insulin.is_a.append(plays_role.some(Hormone_Role))
  
  # before reasoning
  print(list(Protein.subclasses()))
  
  owl2.sync_reasoner_hermit(infer_property_values=True, debug=1)
  
  # after reasoning
  print(list(Protein.subclasses()))
  </code></pre>