Mercurial > repos > mikel-egana-aranguren > oppl
annotate OPPL/Tool.java @ 3:5255f1333cc4
Version 1.0.1
Added output choice: OBO or OWL(RDF/XML)
author | Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu> |
---|---|
date | Wed, 07 Sep 2011 10:46:29 +0200 |
parents | |
children | 4f60202c58d9 |
rev | line source |
---|---|
3
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
1 /** |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
2 * Copyright (C) 2011, Mikel Egaña Aranguren |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
3 * |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
4 * This program is free software: you can redistribute it and/or modify |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
6 * the Free Software Foundation, either version 3 of the License, or |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
7 * (at your option) any later version. |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
8 * |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
9 * This program is distributed in the hope that it will be useful, |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
12 * GNU General Public License for more details. |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
13 * |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
14 * You should have received a copy of the GNU General Public License |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
16 */ |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
17 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
18 package es.upm.fi.dia.oeg.oppl.galaxy; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
19 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
20 import java.io.BufferedOutputStream; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
21 import java.io.BufferedWriter; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
22 import java.io.File; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
23 import java.io.FileNotFoundException; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
24 import java.io.FilterOutputStream; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
25 import java.io.OutputStream; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
26 import java.io.PipedOutputStream; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
27 import java.io.PrintStream; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
28 import java.util.List; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
29 import java.util.Scanner; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
30 import java.util.logging.Level; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
31 import java.util.logging.Logger; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
32 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
33 import org.coode.oppl.ChangeExtractor; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
34 import org.coode.oppl.OPPLParser; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
35 import org.coode.oppl.OPPLScript; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
36 import org.coode.oppl.ParserFactory; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
37 import org.coode.oppl.exceptions.QuickFailRuntimeExceptionHandler; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
38 import org.coode.oppl.log.Logging; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
39 import org.coode.owlapi.obo.parser.OBOOntologyFormat; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
40 import org.coode.parsers.ErrorListener; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
41 import org.coode.parsers.LoggerErrorListener; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
42 import org.semanticweb.owlapi.apibinding.OWLManager; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
43 import org.semanticweb.owlapi.io.OWLOntologyDocumentTarget; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
44 import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
45 import org.semanticweb.owlapi.io.SystemOutDocumentTarget; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
46 import org.semanticweb.owlapi.model.IRI; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
47 import org.semanticweb.owlapi.model.OWLAxiomChange; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
48 import org.semanticweb.owlapi.model.OWLOntology; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
49 import org.semanticweb.owlapi.model.OWLOntologyCreationException; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
50 import org.semanticweb.owlapi.model.OWLOntologyManager; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
51 import org.semanticweb.owlapi.model.OWLOntologyStorageException; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
52 import org.semanticweb.owlapi.reasoner.OWLReasoner; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
53 import org.semanticweb.owlapi.reasoner.OWLReasonerFactory; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
54 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
55 import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
56 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
57 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
58 /** |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
59 * @author Mikel Egaña Aranguren |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
60 * |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
61 */ |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
62 public class Tool { |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
63 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
64 /** |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
65 * @param OWL file |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
66 * @param OPPL script |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
67 * @throws FileNotFoundException |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
68 * @throws OWLOntologyCreationException |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
69 * @throws OWLOntologyStorageException |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
70 */ |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
71 public static void main(String[] args) throws FileNotFoundException, OWLOntologyCreationException, OWLOntologyStorageException { |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
72 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
73 // Get the arguments from command-line |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
74 String OWLFilePath = args [0]; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
75 String OPPL_script_file = args [1]; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
76 String Output_format = args [2]; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
77 String OPPL_script_source = ""; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
78 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
79 // Load the flat file with script in memory |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
80 File file = new File(OPPL_script_file); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
81 Scanner input = new Scanner(file); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
82 while(input.hasNext()) { |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
83 String nextToken = input.next(); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
84 OPPL_script_source = OPPL_script_source + " " + nextToken; |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
85 } |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
86 input.close(); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
87 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
88 // Load the OWL ontology |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
89 File owl_file = new File(OWLFilePath); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
90 OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
91 OWLOntology OWL_ontology = manager.loadOntologyFromOntologyDocument(owl_file); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
92 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
93 // Sync reasoner and check consistency |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
94 OWLReasonerFactory reasonerFactory = new PelletReasonerFactory(); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
95 OWLReasoner reasoner = reasonerFactory.createReasoner(OWL_ontology); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
96 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
97 // Parse the OPPL script |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
98 ParserFactory parserFactory = new ParserFactory(manager, OWL_ontology, reasoner); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
99 Logger logger = Logger.getLogger(Tool.class.getName()); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
100 Logging.getQueryLogger().setLevel(Level.OFF); // The normal messages are errors for galaxy |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
101 ErrorListener errorListener = (ErrorListener)new LoggerErrorListener(logger); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
102 OPPLParser opplparser = parserFactory.build(errorListener); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
103 OPPLScript OPPLscript = opplparser.parse(OPPL_script_source); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
104 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
105 // Execute the script |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
106 ChangeExtractor extractor = new ChangeExtractor(new QuickFailRuntimeExceptionHandler(), true); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
107 List<OWLAxiomChange> changes = extractor.visit(OPPLscript); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
108 manager.applyChanges(changes); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
109 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
110 // Print the ontology to the standard output so other galaxy tools can operate on the output |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
111 OWLOntologyDocumentTarget documentTarget = new SystemOutDocumentTarget(); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
112 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
113 if(Output_format.equals("OBO")){ |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
114 manager.saveOntology(OWL_ontology, new OBOOntologyFormat(), new SystemOutDocumentTarget()); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
115 } |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
116 else{ |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
117 manager.saveOntology(OWL_ontology, new RDFXMLOntologyFormat(), new SystemOutDocumentTarget()); |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
118 } |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
119 |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
120 } |
5255f1333cc4
Version 1.0.1
Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
parents:
diff
changeset
|
121 } |