changeset 9:14bfd77f8520

Interface improved (Imports first) and proper handling of import/merge options added
author Mikel Egaña Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
date Tue, 18 Oct 2011 10:30:16 +0200
parents 40adbcb2a7cc
children 3f31c0eb7539
files OPPL/Disjoint_localisation.oppl OPPL/README OPPL/Tool.java OPPL/oppl.xml OPPL/oppl_galaxy_tool.jar
diffstat 5 files changed, 34 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OPPL/Disjoint_localisation.oppl	Tue Oct 18 10:30:16 2011 +0200
@@ -0,0 +1,7 @@
+?localisation_sibling:CLASS
+SELECT 
+ASSERTED ?localisation_sibling SubClassOf GO_0008150
+WHERE ?localisation_sibling != GO_0051179
+BEGIN 
+ADD ?localisation_sibling DisjointWith GO_0051179
+END;
--- a/OPPL/README	Tue Oct 11 11:09:52 2011 +0200
+++ b/OPPL/README	Tue Oct 18 10:30:16 2011 +0200
@@ -13,11 +13,11 @@
 1.- Stop galaxy.
 
 2.- Copy oppl_galaxy_tool.jar, FaCT++-linux-v1.5.2/ FaCT++-OSX-v1.5.2/ 
-and oppl_galaxy_tool_lib/ to /galaxy-dist/tool-data/shared/jars/.
+and oppl_galaxy_tool_lib/ to /galaxy-dist/tool-data/shared/jars/
 
-3.- Create directory /galaxy-dist/tools/OPPL/.
+3.- Create directory /galaxy-dist/tools/OPPL/
 
-4.- Copy oppl.xml to /galaxy-dist/tools/OPPL/.
+4.- Copy oppl.xml to /galaxy-dist/tools/OPPL/
 
 5.- Add the following lines to /galaxy-dist/tool_conf.xml:
 
@@ -43,7 +43,12 @@
 Ontology Pre Processor Language
 	>> Execute an OPPL file against an OWL file 
 
-An ontology produced by another galaxy tools can also be used
+An ontology produced by another galaxy tools can also be used.
+
+Test.oppl and test.owl can be used as examples. More OPPL-Galaxy 
+examples can be obtained at http://miuras.inf.um.es/OPPL-Galaxy/, and 
+general OPPL script that may be useful to use with OPPL-Galaxy can be 
+obtained at http://oppl2.sourceforge.net/taggedexamples/.
 
 
 
@@ -68,9 +73,6 @@
 
 http://wiki.g2.bx.psu.edu/Future/Job%20Failure%20When%20stderr
 
-OBO rendering does not work properly if the URIs lack the fragment or
-if an object property lacks an rdfs:label.
-
 
 
 TESTS
@@ -122,11 +124,7 @@
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-OPPL API, OWL API, Pellet, HermiT, FaCT++ and OBOformat have their own 
-licenses.
-
-Galaxy is distributed as open source under the conditions of the 
-Academic Free License (http://www.opensource.org/licenses/academic.php).
+OPPL API, OWL API, Pellet, HermiT, and FaCT++ have their own licenses.
 
 
 
--- a/OPPL/Tool.java	Tue Oct 11 11:09:52 2011 +0200
+++ b/OPPL/Tool.java	Tue Oct 18 10:30:16 2011 +0200
@@ -182,17 +182,17 @@
 		
 		// Print the ontology to the standard output so other galaxy tools can operate on it
 		
-		// Do not merge ontologies
-		if(merge_URI.equals("NoMerge")){
-			saveOntology(manager, OWL_ontology, Output_format);
-		}
-		// Merge ontologies
-		else{	
+		// Merge ontologies (Only in case there are imports)
+		if(!merge_URI.equals("NoMerge") && !imports_file_path.equals("NoImports")){
 			OWLOntologyMerger merger = new OWLOntologyMerger(manager);
 			IRI mergedOntologyIRI = IRI.create(merge_URI);
 			OWLOntology merged = merger.createMergedOntology(manager, mergedOntologyIRI);
 			saveOntology(manager, merged, Output_format);
 		}
+		// Do not merge ontologies (Even in the case in which a URI is provided, if there are not imports do not merge)	
+		else{	
+			saveOntology(manager, OWL_ontology, Output_format);
+		}
 	}
 	
 	private static void saveOntology (OWLOntologyManager manager, OWLOntology ontology, String Format) throws OWLOntologyStorageException, IOException, URISyntaxException {
@@ -213,12 +213,12 @@
 				
 				// Keep rdfs:label
 				String class_name = null;
-				for (OWLAnnotation annotation : cls.getAnnotations(ontology, label)) {
-	                if (annotation.getValue() instanceof OWLLiteral) {
-	                    OWLLiteral val = (OWLLiteral) annotation.getValue();
-	                    class_name = val.getLiteral();
-	                }
-	            }
+				for (OWLAnnotation annotation : cls.getAnnotations(ontology, label)){
+					if (annotation.getValue() instanceof OWLLiteral) {
+						OWLLiteral val = (OWLLiteral) annotation.getValue();
+						class_name = val.getLiteral();
+					}
+				}
 							
 //				I have to remove all the annotations cause I don't know which ones are rendered properly
 				manager.removeAxioms(ontology,ontology.getAnnotationAssertionAxioms(cls.getIRI()));
--- a/OPPL/oppl.xml	Tue Oct 11 11:09:52 2011 +0200
+++ b/OPPL/oppl.xml	Tue Oct 18 10:30:16 2011 +0200
@@ -1,4 +1,4 @@
-<tool id="oppl" name="Execute an OPPL file against an ontology" version="1.0.5">
+<tool id="oppl" name="Execute an OPPL file against an ontology" version="1.0.6">
 	<description>It executes an OPPL script against the input ontology and generates a new ontology with the changes described in the OPPL script</description>
 
 	<!-- The command execution of the conditional is tacky, I think, but it works! -->
@@ -46,10 +46,8 @@
 	</command>-->
 
 	<inputs>
-		<param format="text" name="input" type="data" label="Input ontology file"/>
-		<param format="text" name="OPPL" type="data" label="OPPL file"/>
 		<conditional name="import_opts">
-			<param name="imports_select" type="boolean" value="False" truevalue="imports_yes" falsevalue="imports_no" label="Tick the box if the loaded ontology includes OWL imports"/>
+			<param name="imports_select" type="boolean" value="False" truevalue="imports_yes" falsevalue="imports_no" label="Tick the box if the input ontology includes OWL imports"/>
 
 			<!-- EXPERIMENTS AND HOUSE KEEPING-->
 			<!--<when value="imports_no"/> -->
@@ -72,12 +70,14 @@
 				
             		</when>
 		</conditional>
+		<param format="text" name="input" type="data" label="Input ontology file"/>
+		<param format="text" name="OPPL" type="data" label="OPPL file"/>
 		<param name="format" type="select" label="Choose ontology output format">
 			<option value="OWL" selected="true">OWL</option>
 			<option value="OBO">OBO</option>
 		</param>
 		<param name="inferred" type="boolean" value="False" truevalue="AddInferred" falsevalue="Gora_ni" label="Add inferred subsumption axioms to output ontology"/>
-		<param name="merged" type="text" size="100" value="NoMerge" label="To merge the ontologies, type an URI for the new ontology (Leave NoMerge for not merging)" />
+		<param name="merged" type="text" size="100" value="NoMerge" label="To merge ontologies (If there are imports), type an URI for the new ontology (Leave NoMerge for not merging)" />
 		<param name="reasoner" type="select" label="Choose reasoner">
 			<option value="Pellet" selected="true">Pellet</option>
 			<option value="HermiT">HermiT</option>
@@ -143,8 +143,6 @@
   http://hermit-reasoner.com/
   
   http://code.google.com/p/factplusplus/
-  
-  http://code.google.com/p/oboformat/
 
 **Contact**
 
Binary file OPPL/oppl_galaxy_tool.jar has changed