comparison OPPL/src/MergeImportedOntologies.java @ 17:c9e01f86b07c draft

New tool added for merging imported ontologies (GalaxyOWLAPI and README changed and test ontologies added accordingly). Memory settings changed in all the tools XML files
author Mikel Egana Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
date Mon, 20 Aug 2012 11:39:56 +0200
parents
children
comparison
equal deleted inserted replaced
16:6c25e717c896 17:c9e01f86b07c
1 package es.upm.cbgp.opplquery.oppl.galaxy;
2
3 import java.io.IOException;
4
5 import org.semanticweb.owlapi.model.OWLOntologyCreationException;
6 import org.semanticweb.owlapi.model.OWLOntologyStorageException;
7
8 import es.upm.fi.dia.oeg.oppl.galaxy.GalaxyOWLAPI;
9
10 public class MergeImportedOntologies {
11
12 /**
13 * @param args
14 * @throws OWLOntologyCreationException
15 * @throws IOException
16 * @throws OWLOntologyStorageException
17 */
18 public static void main(String[] args) throws OWLOntologyCreationException, OWLOntologyStorageException, IOException {
19 String OWLFilePath = args [0];
20 String MergedOntologyNewURI = args [1];
21 // String OWLFilePath = "/home/mikel/UPM/OPPL_galaxy/OPPL/OPPL/test-data/ontology/imports/merge_test.owl";
22 // String MergedOntologyNewURI = "http://cbgp.upm.es/merged.owl";
23
24 // Create the manager
25 GalaxyOWLAPI galaxyowlapi = new GalaxyOWLAPI();
26
27 // Load the main ontology and hope for the imported URIs to be resolvable
28 galaxyowlapi.loadMainOntology(OWLFilePath);
29
30 // Merge and save
31
32 if(MergedOntologyNewURI.isEmpty()){
33 MergedOntologyNewURI = "http://cbgp.upm.es/BiologicalInformatics/OPPLGalaxy/merged.owl";
34 }
35
36 galaxyowlapi.merge(MergedOntologyNewURI);
37 galaxyowlapi.saveOntology(true);
38 }
39 }