title: Get Inferred Object Property Assertions Hermit Reasoner
body: <p>Say that I have some ontology created in Protege and there is an instance of a class with some object property, and a list of object properties, has shown in the following pictures:</p>
  
  <p><a href="https://i.stack.imgur.com/Z7An3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z7An3.png" alt="An individual of the class Device, &quot;Email_Server&quot;, with the object property &quot;realizes&quot;"></a></p>
  
  <p>The hierarchy of object properties is as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/26JRO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/26JRO.png" alt="Object Property Hierarchy"></a></p>
  
  <p>Now, when I turn the Reasoner on (Hermit), I get the following assert object properties for this same individual:</p>
  
  <p><a href="https://i.stack.imgur.com/BCou8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BCou8.png" alt="Inferred Object Properties for the individual Email_server"></a></p>
  
  <p>When I click in the explanations for the inferred object property "dependsUp" customer, I get:</p>
  
  <p><a href="https://i.stack.imgur.com/Ewogd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ewogd.png" alt="Explanation for the inferred Object Property &quot;dependsUp&quot; customer"></a></p>
  
  <p>My question is how can I generate this using Java? I can already get the inferred object properties for some individual with the following (incomplete here for abreviety, but it works as I have tested):</p>
  
  <pre><code>for (OWLNamedIndividual namedIndividual : this.ontology.getIndividualsInSignature()) {
              if (subjectName.equals(namedIndividual.getIRI().getFragment())) {
                  OWLObjectProperty objectProperty = fac.getOWLObjectProperty(IRI.create(propertyIRI));
                  NodeSet&lt;OWLNamedIndividual&gt; namedIndividualSet = reasoner.getObjectPropertyValues(namedIndividual ,objectProperty);
  
                  for (Node&lt;OWLNamedIndividual&gt; namedIndividualsInObjectPropertySet : namedIndividualSet) {
                      for (OWLNamedIndividual namedIndividualForObjectPropertySet : namedIndividualsInObjectPropertySet) {
                          for (OWLClassExpression owlClass : namedIndividualForObjectPropertySet.getTypes(this.ontology)){
                              if (owlClass.toString().split("#")[1].replace("&gt;", "").equals(archiClass)) {
                                  result.add(OWLOntologyUtils.getHumanInstanceName(this.ontology, namedIndividualForObjectPropertySet.getIRI().getFragment()));
  // Result contains all the inferred object properties shown in the above pictures, so this code works. How can I access the explanation for one of the inferred object properties by the reasoner here?
                              }
                          }
                      }
                  }
  
              }
          }
  </code></pre>