comparison OPPL/src/OPPLQueryGalaxy.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 6c25e717c896
children
comparison
equal deleted inserted replaced
17:c9e01f86b07c 18:d3616fac4ca5
40 * @throws FileNotFoundException 40 * @throws FileNotFoundException
41 */ 41 */
42 public static void main(String[] args) throws OWLOntologyCreationException, ParserException, FileNotFoundException { 42 public static void main(String[] args) throws OWLOntologyCreationException, ParserException, FileNotFoundException {
43 // Get the arguments from command-line 43 // Get the arguments from command-line
44 String OWLFilePath = args [0]; // /home/mikel/UPM/OPPL_galaxy/OPPL/OPPL/test-data/ontology/single/test.owl 44 String OWLFilePath = args [0]; // /home/mikel/UPM/OPPL_galaxy/OPPL/OPPL/test-data/ontology/single/test.owl
45 String reasoner_type = args [1]; // Pellet|FaCTPlusPlus|HermiT 45 String reasoner_type = args [1]; // Pellet|FaCTPlusPlus|HermiT|Elk
46 String Answer_render = args [2]; // URI|URIfragment|URIfragment2OBO 46 String Answer_render = args [2]; // URI|URIfragment|URIfragment2OBO
47 String OPPL_script_source = args [3]; 47 String OPPL_script_source = args [3];
48 48
49 // String OPPL_script_file = args [3]; 49 // String OPPL_script_file = args [3];
50 // File OPPL_script_file = new File("/home/mikel/UPM/OPPL_galaxy/OPPL/OPPL/test-data/oppl_script/test_oppl_query.oppl"); 50 // File OPPL_script_file = new File("/home/mikel/UPM/OPPL_galaxy/OPPL/OPPL/test-data/oppl_script/test_oppl_query.oppl");
73 } 73 }
74 // FaCTPlusPlus 74 // FaCTPlusPlus
75 else if (reasoner_type.equals("FaCTPlusPlus")){ 75 else if (reasoner_type.equals("FaCTPlusPlus")){
76 galaxyowlapi.setReasonerFaCT(); 76 galaxyowlapi.setReasonerFaCT();
77 } 77 }
78 // Elk
79 else if (reasoner_type.equals("Elk")){
80 galaxyowlapi.setReasonerElk();
81 }
78 // HermiT 82 // HermiT
79 else{ 83 else{
80 galaxyowlapi.setReasonerHermit(); 84 galaxyowlapi.setReasonerHermit();
81 } 85 }
82 86
91 RuntimeExceptionHandler exceptionhandler = new QuickFailRuntimeExceptionHandler(); 95 RuntimeExceptionHandler exceptionhandler = new QuickFailRuntimeExceptionHandler();
92 ChangeExtractor extractor = new ChangeExtractor(exceptionhandler, true); 96 ChangeExtractor extractor = new ChangeExtractor(exceptionhandler, true);
93 extractor.visit(OPPLscript); 97 extractor.visit(OPPLscript);
94 ConstraintSystem cs = OPPLscript.getConstraintSystem(); 98 ConstraintSystem cs = OPPLscript.getConstraintSystem();
95 Set<BindingNode> nodes = cs.getLeaves(); 99 Set<BindingNode> nodes = cs.getLeaves();
100
101 galaxyowlapi.disposeReasoner();
96 102
97 Iterator NodesIterator = nodes.iterator(); 103 Iterator NodesIterator = nodes.iterator();
98 while(NodesIterator.hasNext()){ 104 while(NodesIterator.hasNext()){
99 Set Assignments = ((BindingNode)NodesIterator.next()).getAssignments(); 105 Set Assignments = ((BindingNode)NodesIterator.next()).getAssignments();
100 Iterator AssignmentIterator = Assignments.iterator(); 106 Iterator AssignmentIterator = Assignments.iterator();