Example #1
0
 /**
  * Generate QuestPreferences from a config file
  *
  * @param configFileName - the path to the config file
  * @return the read QuestPreferences object
  * @throws FileNotFoundException
  * @throws IOException
  */
 private QuestPreferences getPreferencesFromFile(String configFileName)
     throws FileNotFoundException, IOException {
   QuestPreferences pref = new QuestPreferences();
   if (!configFileName.isEmpty()) {
     File configFile = new File(URI.create(configFileName));
     pref.readDefaultPropertiesFile(new FileInputStream(configFile));
   } else {
     pref.readDefaultPropertiesFile();
   }
   return pref;
 }
Example #2
0
 /**
  * Generate a QuestPreferences object from some passed arguments as settings
  *
  * @param existential - boolean to turn existential reasoning on or off (default=false)
  * @param rewriting - String to indicate rewriting technique to be used (default=TreeWitness)
  * @return the QuestPreferences object
  */
 private QuestPreferences getPreferencesFromSettings(boolean existential, String rewriting) {
   QuestPreferences pref = new QuestPreferences();
   pref.setCurrentValueOf(QuestPreferences.ABOX_MODE, QuestConstants.VIRTUAL);
   if (existential) pref.setCurrentValueOf(QuestPreferences.REWRITE, "true");
   else pref.setCurrentValueOf(QuestPreferences.REWRITE, "false");
   if (rewriting.equals("TreeWitness"))
     pref.setCurrentValueOf(QuestPreferences.REFORMULATION_TECHNIQUE, QuestConstants.TW);
   else if (rewriting.equals("Default"))
     pref.setCurrentValueOf(QuestPreferences.REFORMULATION_TECHNIQUE, QuestConstants.UCQBASED);
   return pref;
 }
  public ClassicABoxAssertionTestPositiveNoRangeTest() throws Exception {
    QuestPreferences pref = new QuestPreferences();
    pref.setCurrentValueOf(QuestPreferences.REFORMULATION_TECHNIQUE, QuestConstants.UCQBASED);
    pref.setCurrentValueOf(QuestPreferences.DBTYPE, QuestConstants.SEMANTIC_INDEX);
    pref.setCurrentValueOf(QuestPreferences.ABOX_MODE, QuestConstants.CLASSIC);
    pref.setCurrentValueOf(QuestPreferences.OPTIMIZE_EQUIVALENCES, "true");
    pref.setCurrentValueOf(QuestPreferences.OBTAIN_FROM_ONTOLOGY, "true");
    pref.setCurrentValueOf(QuestPreferences.OPTIMIZE_TBOX_SIGMA, "true");

    String owlfile = "src/test/resources/test/owl-types-simple-split.owl";

    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    OWLOntology ontology = manager.loadOntologyFromOntologyDocument(new File(owlfile));

    QuestOWLFactory fac = new QuestOWLFactory();
    fac.setPreferenceHolder(pref);

    reasoner = (QuestOWL) fac.createReasoner(ontology);
    reasoner.flush();

    conn = reasoner.getConnection();
    st = conn.createStatement();
  }
 static {
   prefs = new QuestPreferences();
   prefs.setCurrentValueOf(QuestPreferences.ABOX_MODE, QuestConstants.VIRTUAL);
   prefs.setCurrentValueOf(QuestPreferences.REWRITE, QuestConstants.TRUE);
 }