title: Toggle Jena Reasoner
body: <p>I have a Jena ontology model (<a href="http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/ontology/OntModel.html" rel="noreferrer">OntModel</a>) which I'm modifying programatically.  This model was initially created using the <a href="http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/model/ModelFactory.html#createOntologyModel()" rel="noreferrer">default ModelFactory method to create an Ontology model (with no parameters)</a>.  The problem was, as the program ran and the model was changed, the default Jena Reasoner would run (and run and run and run).  The process was entirely too slow for what I need and would run out of memory on large data sets.</p>
  
  <p>I changed the program to use <a href="http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/model/ModelFactory.html#createOntologyModel(com.hp.hpl.jena.ontology.OntModelSpec)" rel="noreferrer">a different ontology model factory method</a> to create a model with no reasoner.  This ran extremely fast and exhibited none of the memory problems I saw earlier (even for very large data sets).  The problem with this approach is that I can only access the data by directly using it's direct class type (I can not gain access to objects using it's parent class).</p>
  
  <p>For example, imagine I had two class resources, "flower" and "seed".  These inherit from a common parent, "plant material".  My program takes all the "seeds", runs a method called "grow" which transforms the "seed" object into a "flower" object.  The "grow" method runs too slow and runs out of memory when using a Reasoner (even the micro Reasoner).  If I turn off the Reasoner, then I can't access all the "flowers" and "seeds" using the "plant material" class.</p>
  
  <p>Is there a preferred way (a happy medium) to doing this... allowing the ability to access objects using their superclass while also being fast and not a memory hog?</p>
  
  <p>I've been looking for a way to "turn off the reasoner" while I run my "grow" method and then turn it back one once the method completes.  Is this possible somehow?</p>