title: How to infer hasMandatoryHours property
body: <p>I'm working on an ontology in which I have that:</p>
  
  <p><code>Course isPartOf CourseGroup</code></p>
  
  <p>And a Course has a boolean property <code>isMandatory</code> and a numerical property <code>hasHours</code>.</p>
  
  <p>So a <code>CourseGroup</code> is made out of a group of courses some of which are mandatory, and all of the individuals of the <code>Course</code> class have a value on the hasHours property.</p>
  
  <p>Now I want to answer the question: <strong>How many hours of mandatory courses are teached on <code>CourseGroup</code> x?</strong> </p>
  
  <p>How would you do that? Would it be just a query of should I set a <code>hasMandatoryHours</code> property for <code>CourseGroup</code> that would be calculated as the sum of the <code>hasHours</code> of Courses where <code>isMandatory</code> is true?</p>
  
  <p>Any thoughts or examples on how this is done for other ontologies will be appreciated.</p>