/**
   * <b>Motivation</b>: OWL reasoners do not return superclass expressions If we want to find all
   * class expressions that may hold for a class then we must pre-coordinate all possible
   * expressions within the subset of OWL we care about. <br>
   * This class generates all satisfiable class expressions of the form r some c (for the
   * cross-product of R x C), as well as all class expressions that have been used (which may
   * include nested expressions)
   *
   * <p>The results are stored in queryClassMap
   *
   * @param precomputePropertyClassCombinations
   */
  @Deprecated
  private void generateQueryOntology(boolean precomputePropertyClassCombinations) {
    queryClassMap = new HashMap<OWLClass, OWLClassExpression>();

    getReasoner().flush();

    if (precomputePropertyClassCombinations) {
      LOG.debug("Precomputing all OP x Class combos");
      // cross-product of P x C
      // TODO - reflexivity and local reflexivity?
      for (OWLObjectProperty p : tboxOntology.getObjectPropertiesInSignature(true)) {
        LOG.debug(" materializing P some C for P=:" + p);
        for (OWLClass c : tboxOntology.getClassesInSignature(true)) {
          OWLObjectSomeValuesFrom r = getOWLDataFactory().getOWLObjectSomeValuesFrom(p, c);
          // LOG.debug(" QMAP:"+r);
          addClassExpressionToQueryMap(r);
        }
      }
    }

    // all expressions used in ontology
    for (OWLOntology ont : tboxOntology.getImportsClosure()) {
      LOG.debug("Finding all nested anonymous expressions");
      for (OWLAxiom ax : ont.getAxioms()) {
        // TODO - check if this is the nest closure. ie (r some (r2 some (r3 some ...)))
        for (OWLClassExpression x : ax.getNestedClassExpressions()) {
          if (x.isAnonymous()) {
            // LOG.debug(" QMAP+:"+x);
            addClassExpressionToQueryMap(x);
          }
        }
      }
    }
    if (LOG.isDebugEnabled()) {
      for (OWLOntology ont : collectedAxioms.keySet()) {
        LOG.debug("TOTAL axioms in QMAP: " + collectedAxioms.get(ont).size());
      }
    }
    LOG.debug("Adding collected axioms");
    addCollectedAxioms();
    LOG.debug("Flushing reasoner...");
    reasoner.flush();
    LOG.debug("Flushed reasoner");
  }