diff OPPL/src/OPPLGalaxy.java @ 18:d3616fac4ca5 draft

Elk support added
author Mikel Egana Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
date Thu, 20 Sep 2012 12:46:36 +0200
parents 7e6604a5ee55
children
line wrap: on
line diff
--- a/OPPL/src/OPPLGalaxy.java	Mon Aug 20 11:39:56 2012 +0200
+++ b/OPPL/src/OPPLGalaxy.java	Thu Sep 20 12:46:36 2012 +0200
@@ -7,13 +7,16 @@
 import java.io.IOException;
 import java.util.List;
 import java.util.Scanner;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
+//import org.apache.log4j.Level;
 import org.coode.oppl.ChangeExtractor;
 import org.coode.oppl.OPPLParser;
 import org.coode.oppl.OPPLScript;
 import org.coode.oppl.ParserFactory;
 import org.coode.oppl.exceptions.QuickFailRuntimeExceptionHandler;
+import org.coode.oppl.log.Logging;
 import org.coode.parsers.ErrorListener;
 import org.coode.parsers.LoggerErrorListener;
 import org.semanticweb.owlapi.model.OWLAxiomChange;
@@ -25,8 +28,9 @@
 
 
 
+
 /**
- * @author Mikel Egaña Aranguren
+ * @author Mikel Ega��a Aranguren
  *
  */
 public class OPPLGalaxy {
@@ -40,7 +44,7 @@
 	public static void main(String[] args) throws OWLOntologyCreationException, OWLOntologyStorageException, IOException {
 		// Get the arguments from command-line
 		String OWLFilePath = args [0];
-		String reasoner_type = args [1]; // Pellet|FaCTPlusPlus|HermiT
+		String reasoner_type = args [1]; // Pellet|FaCTPlusPlus|Elk|HermiT
 		
 		String OPPL_script_file = args [2];
 		String OWL = args [3]; // OWL|OBO
@@ -61,6 +65,10 @@
 		else if (reasoner_type.equals("FaCTPlusPlus")){
 			galaxyowlapi.setReasonerFaCT();
 		}
+		// Elk
+		else if (reasoner_type.equals("Elk")){
+			galaxyowlapi.setReasonerElk();
+		}
 		// HermiT
 		else{
 			galaxyowlapi.setReasonerHermit();
@@ -83,18 +91,20 @@
 		// Parse the OPPL script
 		ParserFactory parserFactory = new ParserFactory(manager, ontology, reasoner); 
 		Logger logger = Logger.getLogger(OPPLGalaxy.class.getName());
+//		logger.setLevel(Level.OFF);
 //		Logging.getQueryLogger().setLevel(Level.OFF); // The normal messages are errors for galaxy (Fixed in Galaxy by 2 > /dev/null)
+		
 		ErrorListener errorListener = (ErrorListener)new LoggerErrorListener(logger);
 		OPPLParser opplparser = parserFactory.build(errorListener);
 		OPPLScript OPPLscript = opplparser.parse(OPPL_script_source);
-		
-		
 			
 		// Execute the script
 		ChangeExtractor extractor = new ChangeExtractor(new QuickFailRuntimeExceptionHandler(), true);
 		List<OWLAxiomChange> changes = extractor.visit(OPPLscript);
 		manager.applyChanges(changes);
 		
+		galaxyowlapi.disposeReasoner();
+		
 		// Merge imported ontologies if requested
 //		if(merge.equals("Merge")){
 //			galaxyowlapi.merge();