title: Jena Rule for Validation af a Ontology
body: <p>I want to validate an ontology and throw an error if anything is incorrect.</p>
  
  <p>The most validation I have to do looks like this:
  I have a class like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>   &lt;owl:Class rdf:about="&amp;schema;ExampleClass"&gt;
          &lt;rdfs:subClassOf rdf:resource="&amp;schema;SuperClass"/&gt;
          &lt;rdfs:subClassOf&gt;
              &lt;owl:Restriction&gt;
                  &lt;owl:onProperty rdf:resource="&amp;schema;myProperty"/&gt;
                  &lt;owl:onClass rdf:resource="&amp;schema;OtherClass"/&gt;
                  &lt;owl:qualifiedCardinality rdf:datatype="&amp;xsd;nonNegativeInteger"&gt;1&lt;/owl:qualifiedCardinality&gt;
              &lt;/owl:Restriction&gt;
          &lt;/rdfs:subClassOf&gt;
      &lt;/owl:Class&gt;
  </code></pre>
  
  <p>(The interesting part is the 2nd subClassOf.)
  In Protege this means <code>ExampleClass is subClass of myProperty exactly 1 OtherClass</code>.</p>
  
  <p>So I want to validate that there is exactly one myProperty with value: an individual of type OtherClass.</p>
  
  <p>Is it possible to validate rules like this? Perfect would be if there would be a rule to do this for all classes with this modeling (and maybe with also at least 1, exactly 2, ...)</p>
  
  <p>Another question is: Is there a ready closed world reasoner that is doing exactly that for me?</p>