comparison OPPL/src/GalaxyOWLAPI.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 c9e01f86b07c
children
comparison
equal deleted inserted replaced
17:c9e01f86b07c 18:d3616fac4ca5
10 import java.util.ArrayList; 10 import java.util.ArrayList;
11 import java.util.List; 11 import java.util.List;
12 import java.util.Scanner; 12 import java.util.Scanner;
13 import java.util.Set; 13 import java.util.Set;
14 14
15 import org.apache.log4j.Level;
16 import org.apache.log4j.Logger;
15 import org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser; 17 import org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser;
16 import org.coode.owlapi.obo.parser.OBOOntologyFormat; 18 import org.coode.owlapi.obo.parser.OBOOntologyFormat;
17 import org.coode.parsers.BidirectionalShortFormProviderAdapter; 19 import org.coode.parsers.BidirectionalShortFormProviderAdapter;
18 import org.semanticweb.HermiT.Reasoner; 20 import org.semanticweb.HermiT.Reasoner;
21 import org.semanticweb.elk.owlapi.ElkReasonerFactory;
19 import org.semanticweb.owlapi.apibinding.OWLManager; 22 import org.semanticweb.owlapi.apibinding.OWLManager;
20 import org.semanticweb.owlapi.expression.OWLEntityChecker; 23 import org.semanticweb.owlapi.expression.OWLEntityChecker;
21 import org.semanticweb.owlapi.expression.ParserException; 24 import org.semanticweb.owlapi.expression.ParserException;
22 import org.semanticweb.owlapi.expression.ShortFormEntityChecker; 25 import org.semanticweb.owlapi.expression.ShortFormEntityChecker;
23 import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; 26 import org.semanticweb.owlapi.io.RDFXMLOntologyFormat;
107 reasoner = reasonerFactory.createReasoner(ontology); 110 reasoner = reasonerFactory.createReasoner(ontology);
108 } 111 }
109 public void setReasonerHermit (){ 112 public void setReasonerHermit (){
110 reasonerFactory = new Reasoner.ReasonerFactory(); 113 reasonerFactory = new Reasoner.ReasonerFactory();
111 reasoner = reasonerFactory.createReasoner(ontology); 114 reasoner = reasonerFactory.createReasoner(ontology);
115 }
116 public void setReasonerElk (){
117 reasonerFactory = new ElkReasonerFactory();
118 Logger.getLogger("org.semanticweb.elk").setLevel(Level.OFF);
119 reasoner = reasonerFactory.createReasoner(ontology);
120 }
121 public void disposeReasoner(){
122 reasoner.dispose();
112 } 123 }
113 public void merge (String ontologyIRI) throws OWLOntologyCreationException, OWLOntologyStorageException{ 124 public void merge (String ontologyIRI) throws OWLOntologyCreationException, OWLOntologyStorageException{
114 OWLOntologyMerger merger = new OWLOntologyMerger(manager); 125 OWLOntologyMerger merger = new OWLOntologyMerger(manager);
115 // OWLOntologyMerger merger = new OWLOntologyMerger(new OWLOntologyImportsClosureSetProvider(manager, ontology)); 126 // OWLOntologyMerger merger = new OWLOntologyMerger(new OWLOntologyImportsClosureSetProvider(manager, ontology));
116 IRI mergedOntologyIRI = IRI.create(ontologyIRI); 127 IRI mergedOntologyIRI = IRI.create(ontologyIRI);