Repository 'oppl'
hg clone https://toolshed.g2.bx.psu.edu/repos/mikel-egana-aranguren/oppl

Changeset 5:68935f90c2db (2011-09-17)
Previous changeset 4:4f60202c58d9 (2011-09-14) Next changeset 6:3740505b579c (2011-09-18)
Commit message:
Added OWL imports closure
modified:
OPPL/README
OPPL/Tool.java
OPPL/oppl.xml
OPPL/oppl_galaxy_tool.jar
added:
OPPL/cell.owl
OPPL/chebi.owl
OPPL/gene_ontology_ext.owl
OPPL/test_URI_mappings
b
diff -r 4f60202c58d9 -r 68935f90c2db OPPL/README
--- a/OPPL/README Wed Sep 14 19:52:06 2011 +0200
+++ b/OPPL/README Sat Sep 17 13:41:28 2011 +0200
b
@@ -49,11 +49,10 @@
  >> Execute an OPPL file against an OWL file 
 
 
+
 FORESEEN FEATURES
 =================
 
-OWL import closure.
-
 Choose which inferred axioms to add to the output ontology (Right now 
 only subsumption is available).
 
b
diff -r 4f60202c58d9 -r 68935f90c2db OPPL/Tool.java
--- a/OPPL/Tool.java Wed Sep 14 19:52:06 2011 +0200
+++ b/OPPL/Tool.java Sat Sep 17 13:41:28 2011 +0200
[
@@ -47,8 +47,10 @@
 import org.semanticweb.owlapi.model.IRI;
 import org.semanticweb.owlapi.model.OWLAxiom;
 import org.semanticweb.owlapi.model.OWLAxiomChange;
+import org.semanticweb.owlapi.model.OWLDataFactory;
 import org.semanticweb.owlapi.model.OWLOntology;
 import org.semanticweb.owlapi.model.OWLOntologyCreationException;
+import org.semanticweb.owlapi.model.OWLOntologyIRIMapper;
 import org.semanticweb.owlapi.model.OWLOntologyManager;
 import org.semanticweb.owlapi.model.OWLOntologyStorageException;
 import org.semanticweb.owlapi.reasoner.InferenceType;
@@ -57,33 +59,62 @@
 import org.semanticweb.owlapi.util.InferredAxiomGenerator;
 import org.semanticweb.owlapi.util.InferredOntologyGenerator;
 import org.semanticweb.owlapi.util.InferredSubClassAxiomGenerator;
+import org.semanticweb.owlapi.util.SimpleIRIMapper;
 
 import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory;
 
-
 /**
  * @author Mikel EgaƱa Aranguren
- *
  */
 public class Tool {
 
  /**
-  * @param OWL file 
-  * @param OPPL script 
   * @throws FileNotFoundException 
   * @throws OWLOntologyCreationException 
   * @throws OWLOntologyStorageException 
   */
- public static void main(String[] args) throws FileNotFoundException, OWLOntologyCreationException, OWLOntologyStorageException {
-  
+ public static void main(String[] args) throws FileNotFoundException, OWLOntologyCreationException, OWLOntologyStorageException {
  // Get the arguments from command-line
  String OWLFilePath = args [0]; 
  String OPPL_script_file = args [1];
- String Output_format = args [2];
- String Add_inferred = args [3];
- String OPPL_script_source = "";
+ String Output_format = args [2]; // OWL|OBO
+ String Add_inferred = args [3]; // Add_inferred|Whatever
+ String imports_file_path = args [4]; // Flat tab delimited file: URI Document URI
+
+ // Load the main ontology
+ File owl_file = new File(OWLFilePath);
+ OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); 
+
+ // Load the imports if any
+ if(!imports_file_path.equals("NoImports")){
+ File imports_file = new File(imports_file_path);
+ Scanner imports_input = new Scanner(imports_file);
+ while(imports_input.hasNext()){
+     String nextLine = imports_input.nextLine();
+     if(!nextLine.startsWith("#")){
+     String [] URI_documentURI = nextLine.split("\t");
+ //     System.out.println(URI_documentURI[0]);
+ //     System.out.println(URI_documentURI[1]);
+ // IRI ontology_IRI = IRI.create("http://purl.obolibrary.org/obo/CHEBI_ONTOLOGY_chebi_ontology");
+ // IRI document_IRI = IRI.create("file://" + "/home/pik/UPM/OPPL_galaxy/SWAT4LS_2011/GONG/chebi.owl");
+     IRI ontology_IRI = IRI.create(URI_documentURI[0]);
+ IRI document_IRI = IRI.create("file://" + URI_documentURI[1]);
+ OWLOntologyIRIMapper iriMapper = new SimpleIRIMapper(ontology_IRI,document_IRI);
+ manager.addIRIMapper(iriMapper);
+ }
+ }
+ imports_input.close();
+ }
+ OWLDataFactory factory = manager.getOWLDataFactory();
+ OWLOntology OWL_ontology = manager.loadOntologyFromOntologyDocument(owl_file);
+
+ // Reasoner
+ OWLReasonerFactory reasonerFactory = new PelletReasonerFactory(); 
+ OWLReasoner reasoner = reasonerFactory.createReasoner(OWL_ontology);
+ reasoner.isConsistent();
 
  // Load the flat file with script in memory
+ String OPPL_script_source = "";
  File file = new File(OPPL_script_file);
  Scanner input = new Scanner(file);
  while(input.hasNext()) {
@@ -91,15 +122,6 @@
      OPPL_script_source = OPPL_script_source + " " + nextToken;
  }
  input.close();
-
- // Load the OWL ontology
- File owl_file = new File(OWLFilePath);
- OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); 
- OWLOntology OWL_ontology = manager.loadOntologyFromOntologyDocument(owl_file);
-
- // Sync reasoner and check consistency
- OWLReasonerFactory reasonerFactory = new PelletReasonerFactory(); 
- OWLReasoner reasoner = reasonerFactory.createReasoner(OWL_ontology);
 
  // Parse the OPPL script
  ParserFactory parserFactory = new ParserFactory(manager, OWL_ontology, reasoner); 
b
diff -r 4f60202c58d9 -r 68935f90c2db OPPL/cell.owl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/OPPL/cell.owl Sat Sep 17 13:41:28 2011 +0200
[
b'@@ -0,0 +1,39919 @@\n+<?xml version="1.0"?>\n+\n+\n+<!DOCTYPE rdf:RDF [\n+    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >\n+    <!ENTITY obo "http://purl.obolibrary.org/obo/" >\n+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >\n+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >\n+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >\n+]>\n+\n+\n+<rdf:RDF xmlns="&obo;UBERON_uberon#"\n+     xml:base="&obo;UBERON_uberon"\n+     xmlns:obo="http://purl.obolibrary.org/obo/"\n+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"\n+     xmlns:owl="http://www.w3.org/2002/07/owl#"\n+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"\n+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n+    <owl:Ontology rdf:about="&obo;UBERON_uberon">\n+        <obo:remark rdf:datatype="&xsd;string">$Revision: 1.52 $  See PMID:15693950, PMID:12799354, PMID:20123131, Contact Alexander Diehl, addiehl@buffalo.edu, University of Buffalo.</obo:remark>\n+        <obo:format-version rdf:datatype="&xsd;string">1.2</obo:format-version>\n+        <obo:data-version rdf:datatype="&xsd;string">2011-06-03</obo:data-version>\n+        <obo:date rdf:datatype="&xsd;string">24:08:2011 09:07</obo:date>\n+        <obo:treat-xrefs-as-genus-differentia rdf:datatype="&xsd;string">AAO part_of NCBITaxon:8292</obo:treat-xrefs-as-genus-differentia>\n+        <obo:synonymtypedef rdf:datatype="&xsd;string">ATTRIBUTION_REQUIRED &quot;expert consultation and attribution required&quot;</obo:synonymtypedef>\n+        <obo:treat-xrefs-as-equivalent rdf:datatype="&xsd;string">BILA</obo:treat-xrefs-as-equivalent>\n+        <obo:synonymtypedef rdf:datatype="&xsd;string">BRAND_NAME &quot;BRAND NAME&quot;</obo:synonymtypedef>\n+        <obo:treat-xrefs-as-equivalent rdf:datatype="&xsd;string">BSPO</obo:treat-xrefs-as-equivalent>\n+        <obo:treat-xrefs-as-equivalent rdf:datatype="&xsd;string">CARO</obo:treat-xrefs-as-equivalent>\n+        <obo:synonymtypedef rdf:datatype="&xsd;string">DUBIOUS &quot;dubious or contested synonym&quot;</obo:synonymtypedef>\n+        <obo:treat-xrefs-as-has-subclass rdf:datatype="&xsd;string">EHDAA</obo:treat-xrefs-as-has-subclass>\n+        <obo:treat-xrefs-as-has-subclass rdf:datatype="&xsd;string">EHDAA2</obo:treat-xrefs-as-has-subclass>\n+        <obo:treat-xrefs-as-has-subclass rdf:datatype="&xsd;string">EMAPA</obo:treat-xrefs-as-has-subclass>\n+        <obo:treat-xrefs-as-genus-differentia rdf:datatype="&xsd;string">FBbt part_of NCBITaxon:7227</obo:treat-xrefs-as-genus-differentia>\n+        <obo:treat-xrefs-as-genus-differentia rdf:datatype="&xsd;string">FMA part_of NCBITaxon:9606</obo:treat-xrefs-as-genus-differentia>\n+        <obo:synonymtypedef rdf:datatype="&xsd;string">FORMULA &quot;FORMULA&quot;</obo:synonymtypedef>\n+        <obo:treat-xrefs-as-equivalent rdf:datatype="&xsd;string">GO</obo:treat-xrefs-as-equivalent>\n+        <obo:treat-xrefs-as-genus-differentia rdf:datatype="&xsd;string">HAO part_of NCBITaxon:7399</obo:treat-xrefs-as-genus-differentia>\n+        <obo:synonymtypedef rdf:datatype="&xsd;string">HOMOLOGY &quot;a synonym made on the basis of a possibly homologous structure in another species&quot;</obo:synonymtypedef>\n+        <obo:synonymtypedef rdf:datatype="&xsd;string">INCONSISTENT &quot;indicates that a synonym is used in an inconsistent or confusing way, typically between species&quot;</obo:synonymtypedef>\n+        <obo:synonymtypedef rdf:datatype="&xsd;string">INN &quot;INN&quot;</obo:synonymtypedef>\n+        <obo:synonymtypedef rdf:datatype="&xsd;string">IUPAC_NAME &quot;IUPAC NAME&quot;</obo:synonymtypedef>\n+        <obo:synonymtypedef rdf:datatype="&xsd;string">InChI &quot;InChI&quot;</obo:synonymtypedef>\n+        <obo:synonymtypedef rdf:datatype="&xsd;string">InChIKey &quot;InChIKey&quot;</obo:synonymtypedef>\n+        <obo:treat-xrefs-as-genus-differentia rdf:datatype="&xsd;string">KUPO part_of NCBITaxon:9606</obo:treat-xrefs-as-genus-differentia>\n+        <obo:treat-xrefs-as-genus-differentia rdf:datatype="&xsd'..b'bo;UBERON_located_in">\n+        <rdfs:label rdf:datatype="&xsd;string">located_in</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_exists_during">\n+        <rdfs:label rdf:datatype="&xsd;string">exists_during</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_has_not_completed">\n+        <rdfs:label rdf:datatype="&xsd;string">has_not_completed</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_has_parent_hydride">\n+        <rdfs:label rdf:datatype="&xsd;string">has parent hydride</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_similar_in_magnitude_relative_to">\n+        <rdfs:label rdf:datatype="&xsd;string">similar_in_magnitude_relative_to</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_has_modification">\n+        <rdfs:label rdf:datatype="&xsd;string">has_modification</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_derives_from">\n+        <rdfs:label rdf:datatype="&xsd;string">derives_from</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_singly_occurring_form_of">\n+        <rdfs:label rdf:datatype="&xsd;string">singly_occurring_form_of</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_existence_starts_with">\n+        <rdfs:label rdf:datatype="&xsd;string">existence_starts_with</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_branch_of">\n+        <rdfs:label rdf:datatype="&xsd;string">branch_of</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_precedes">\n+        <rdfs:label rdf:datatype="&xsd;string">precedes</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_has_ratio_quality">\n+        <rdfs:label rdf:datatype="&xsd;string">has_ratio_quality</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_participates_in">\n+        <rdfs:label rdf:datatype="&xsd;string">participates in</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_deep_to">\n+        <rdfs:label rdf:datatype="&xsd;string">deep_to</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_inheres_in_progenitor_of">\n+        <rdfs:label rdf:datatype="&xsd;string">inheres_in_progenitor_of</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_never_in_taxon">\n+        <rdfs:label rdf:datatype="&xsd;string">never_in_taxon</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_output_of">\n+        <rdfs:label rdf:datatype="&xsd;string">output_of</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_has_part">\n+        <rdfs:label rdf:datatype="&xsd;string">has part</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_has_divisor_entity">\n+        <rdfs:label rdf:datatype="&xsd;string">has_divisor_entity</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_is_unit_of">\n+        <rdfs:label rdf:datatype="&xsd;string">is_unit_of</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_has_function_in">\n+        <rdfs:label rdf:datatype="&xsd;string">has_function_in</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_existence_ends_during">\n+        <rdfs:label rdf:datatype="&xsd;string">existence_ends_during</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_lacks_part">\n+        <rdfs:label rdf:datatype="&xsd;string">lacks_part</rdfs:label>\n+    </rdf:Description>\n+    <rdf:Description rdf:about="&obo;UBERON_finishes">\n+        <rdfs:label rdf:datatype="&xsd;string">finishes</rdfs:label>\n+    </rdf:Description>\n+</rdf:RDF>\n+\n+\n+\n+<!-- Generated by the OWL API (version 3.2.2.1782) http://owlapi.sourceforge.net -->\n+\n'
b
diff -r 4f60202c58d9 -r 68935f90c2db OPPL/chebi.owl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/OPPL/chebi.owl Sat Sep 17 13:41:28 2011 +0200
[
b'@@ -0,0 +1,1078327 @@\n+<?xml version="1.0"?>\n+\n+\n+<!DOCTYPE rdf:RDF [\n+    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >\n+    <!ENTITY obo "http://purl.obolibrary.org/obo/" >\n+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >\n+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >\n+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >\n+]>\n+\n+\n+<rdf:RDF xmlns="&obo;CHEBI_ONTOLOGY_chebi_ontology#"\n+     xml:base="&obo;CHEBI_ONTOLOGY_chebi_ontology"\n+     xmlns:obo="http://purl.obolibrary.org/obo/"\n+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"\n+     xmlns:owl="http://www.w3.org/2002/07/owl#"\n+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"\n+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n+    <owl:Ontology rdf:about="&obo;CHEBI_ONTOLOGY_chebi_ontology"/>\n+    \n+\n+\n+    <!-- \n+    ///////////////////////////////////////////////////////////////////////////////////////\n+    //\n+    // Annotation properties\n+    //\n+    ///////////////////////////////////////////////////////////////////////////////////////\n+     -->\n+\n+    <owl:AnnotationProperty rdf:about="&obo;synonymtype"/>\n+    <owl:AnnotationProperty rdf:about="&obo;xref"/>\n+    <owl:AnnotationProperty rdf:about="&obo;def"/>\n+    <owl:AnnotationProperty rdf:about="&obo;is_obsolete"/>\n+    <owl:AnnotationProperty rdf:about="&obo;synonym"/>\n+    <owl:AnnotationProperty rdf:about="&obo;is_cyclic"/>\n+    <owl:AnnotationProperty rdf:about="&obo;alt_id"/>\n+    \n+\n+\n+    <!-- \n+    ///////////////////////////////////////////////////////////////////////////////////////\n+    //\n+    // Datatypes\n+    //\n+    ///////////////////////////////////////////////////////////////////////////////////////\n+     -->\n+\n+    \n+\n+\n+    <!-- \n+    ///////////////////////////////////////////////////////////////////////////////////////\n+    //\n+    // Object Properties\n+    //\n+    ///////////////////////////////////////////////////////////////////////////////////////\n+     -->\n+\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/CHEBI_ONTOLOGY_has_functional_parent -->\n+\n+    <owl:ObjectProperty rdf:about="&obo;CHEBI_ONTOLOGY_has_functional_parent">\n+        <rdfs:label rdf:datatype="&xsd;string">has functional parent</rdfs:label>\n+    </owl:ObjectProperty>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/CHEBI_ONTOLOGY_has_parent_hydride -->\n+\n+    <owl:ObjectProperty rdf:about="&obo;CHEBI_ONTOLOGY_has_parent_hydride">\n+        <rdfs:label rdf:datatype="&xsd;string">has parent hydride</rdfs:label>\n+    </owl:ObjectProperty>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/CHEBI_ONTOLOGY_has_part -->\n+\n+    <owl:ObjectProperty rdf:about="&obo;CHEBI_ONTOLOGY_has_part">\n+        <rdf:type rdf:resource="&owl;TransitiveProperty"/>\n+        <rdfs:label rdf:datatype="&xsd;string">has part</rdfs:label>\n+    </owl:ObjectProperty>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/CHEBI_ONTOLOGY_has_role -->\n+\n+    <owl:ObjectProperty rdf:about="&obo;CHEBI_ONTOLOGY_has_role">\n+        <rdfs:label rdf:datatype="&xsd;string">has role</rdfs:label>\n+    </owl:ObjectProperty>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/CHEBI_ONTOLOGY_is_conjugate_acid_of -->\n+\n+    <owl:ObjectProperty rdf:about="&obo;CHEBI_ONTOLOGY_is_conjugate_acid_of">\n+        <rdfs:label rdf:datatype="&xsd;string">is conjugate acid of</rdfs:label>\n+    </owl:ObjectProperty>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/CHEBI_ONTOLOGY_is_conjugate_base_of -->\n+\n+    <owl:ObjectProperty rdf:about="&obo;CHEBI_ONTOLOGY_is_conjugate_base_of">\n+        <rdfs:label rdf:datatype="&xsd;string">is conjugate base of</rdfs:label>\n+    </owl:ObjectProperty>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/CHEBI_ONTOLOGY_is_enantiomer_of -->\n+\n+    <owl:ObjectProperty rdf:about="&obo;CHEBI_ONTOLOGY_is_enantiomer_of">\n+        <rdfs:label rdf:datatype="&xsd;string">is enantiomer of</rdfs:label>\n+    </owl:ObjectProperty>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/CHEBI_ONTOLOGY_is_subs'..b'd;string">RELATED</obo:synonymtype>\n+        <owl:annotatedTarget>Velban (TN)</owl:annotatedTarget>\n+        <owl:annotatedSource rdf:resource="&obo;CHEBI_9984"/>\n+        <obo:xref rdf:resource="&obo;KEGG%20DRUG:"/>\n+        <owl:annotatedProperty rdf:resource="&obo;synonym"/>\n+    </owl:Axiom>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/CHEBI_9985 -->\n+\n+    <owl:Class rdf:about="&obo;CHEBI_9985">\n+        <rdfs:label rdf:datatype="&xsd;string">vincamine</rdfs:label>\n+        <rdfs:subClassOf rdf:resource="&obo;CHEBI_27288"/>\n+        <rdfs:subClassOf rdf:resource="&obo;CHEBI_38481"/>\n+        <rdfs:subClassOf>\n+            <owl:Restriction>\n+                <owl:onProperty rdf:resource="&obo;CHEBI_ONTOLOGY_has_role"/>\n+                <owl:someValuesFrom rdf:resource="&obo;CHEBI_35620"/>\n+            </owl:Restriction>\n+        </rdfs:subClassOf>\n+        <rdfs:subClassOf>\n+            <owl:Restriction>\n+                <owl:onProperty rdf:resource="&obo;CHEBI_ONTOLOGY_has_role"/>\n+                <owl:someValuesFrom rdf:resource="&obo;CHEBI_35674"/>\n+            </owl:Restriction>\n+        </rdfs:subClassOf>\n+        <rdfs:subClassOf>\n+            <owl:Restriction>\n+                <owl:onProperty rdf:resource="&obo;CHEBI_ONTOLOGY_has_functional_parent"/>\n+                <owl:someValuesFrom rdf:resource="&obo;CHEBI_35644"/>\n+            </owl:Restriction>\n+        </rdfs:subClassOf>\n+        <obo:xref>KEGG COMPOUND:1617-90-9 &quot;CAS Registry Number&quot;</obo:xref>\n+        <obo:synonym>(+)-Vincamine</obo:synonym>\n+        <obo:xref>Beilstein:52767 &quot;Beilstein Registry Number&quot;</obo:xref>\n+        <obo:synonym>Pervincamine</obo:synonym>\n+        <obo:synonym>Methyl vincaminate</obo:synonym>\n+        <obo:def>&quot;An alkaloid ester that has formula C21H26N2O3.&quot; []</obo:def>\n+        <obo:synonym>Vincamidol</obo:synonym>\n+        <obo:xref>ChemIDplus:1617-90-9 &quot;CAS Registry Number&quot;</obo:xref>\n+        <obo:synonym>Vincamine</obo:synonym>\n+        <obo:xref>KEGG COMPOUND:C09251 &quot;KEGG COMPOUND&quot;</obo:xref>\n+    </owl:Class>\n+    <owl:Axiom>\n+        <obo:synonymtype rdf:datatype="&xsd;string">RELATED</obo:synonymtype>\n+        <owl:annotatedTarget>(+)-Vincamine</owl:annotatedTarget>\n+        <owl:annotatedSource rdf:resource="&obo;CHEBI_9985"/>\n+        <obo:xref rdf:resource="&obo;ChemIDplus:"/>\n+        <owl:annotatedProperty rdf:resource="&obo;synonym"/>\n+    </owl:Axiom>\n+    <owl:Axiom>\n+        <obo:synonymtype rdf:datatype="&xsd;string">RELATED</obo:synonymtype>\n+        <owl:annotatedTarget>Methyl vincaminate</owl:annotatedTarget>\n+        <owl:annotatedSource rdf:resource="&obo;CHEBI_9985"/>\n+        <obo:xref rdf:resource="&obo;ChemIDplus:"/>\n+        <owl:annotatedProperty rdf:resource="&obo;synonym"/>\n+    </owl:Axiom>\n+    <owl:Axiom>\n+        <obo:synonymtype rdf:datatype="&xsd;string">RELATED</obo:synonymtype>\n+        <owl:annotatedTarget>Vincamidol</owl:annotatedTarget>\n+        <owl:annotatedSource rdf:resource="&obo;CHEBI_9985"/>\n+        <obo:xref rdf:resource="&obo;ChemIDplus:"/>\n+        <owl:annotatedProperty rdf:resource="&obo;synonym"/>\n+    </owl:Axiom>\n+    <owl:Axiom>\n+        <obo:synonymtype rdf:datatype="&xsd;string">RELATED</obo:synonymtype>\n+        <owl:annotatedTarget>Pervincamine</owl:annotatedTarget>\n+        <owl:annotatedSource rdf:resource="&obo;CHEBI_9985"/>\n+        <obo:xref rdf:resource="&obo;ChemIDplus:"/>\n+        <owl:annotatedProperty rdf:resource="&obo;synonym"/>\n+    </owl:Axiom>\n+    <owl:Axiom>\n+        <obo:synonymtype rdf:datatype="&xsd;string">EXACT</obo:synonymtype>\n+        <owl:annotatedTarget>Vincamine</owl:annotatedTarget>\n+        <owl:annotatedSource rdf:resource="&obo;CHEBI_9985"/>\n+        <obo:xref rdf:resource="&obo;KEGG%20COMPOUND:"/>\n+        <owl:annotatedProperty rdf:resource="&obo;synonym"/>\n+    </owl:Axiom>\n+</rdf:RDF>\n+\n+\n+\n+<!-- Generated by the OWL API (version 3.2.2.1782) http://owlapi.sourceforge.net -->\n+\n'
b
diff -r 4f60202c58d9 -r 68935f90c2db OPPL/gene_ontology_ext.owl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/OPPL/gene_ontology_ext.owl Sat Sep 17 13:41:28 2011 +0200
[
b'@@ -0,0 +1,1139966 @@\n+<?xml version="1.0"?>\n+\n+\n+<!DOCTYPE rdf:RDF [\n+    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >\n+    <!ENTITY obo "http://purl.obolibrary.org/obo/" >\n+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >\n+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >\n+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >\n+]>\n+\n+\n+<rdf:RDF xmlns="&obo;go#"\n+     xml:base="&obo;go"\n+     xmlns:obo="http://purl.obolibrary.org/obo/"\n+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"\n+     xmlns:owl="http://www.w3.org/2002/07/owl#"\n+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"\n+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n+    <owl:Ontology rdf:about="&obo;go">\n+        <owl:imports rdf:resource="&obo;CHEBI_ONTOLOGY_chebi_ontology"/>\n+        <owl:imports rdf:resource="&obo;UBERON_uberon"/>\n+    </owl:Ontology>\n+    \n+\n+\n+    <!-- \n+    ///////////////////////////////////////////////////////////////////////////////////////\n+    //\n+    // Annotation properties\n+    //\n+    ///////////////////////////////////////////////////////////////////////////////////////\n+     -->\n+\n+    <owl:AnnotationProperty rdf:about="&obo;consider"/>\n+    <owl:AnnotationProperty rdf:about="&obo;synonymtype"/>\n+    <owl:AnnotationProperty rdf:about="&obo;def"/>\n+    <owl:AnnotationProperty rdf:about="&obo;subset"/>\n+    <owl:AnnotationProperty rdf:about="&obo;comment"/>\n+    <owl:AnnotationProperty rdf:about="&obo;alt_id"/>\n+    <owl:AnnotationProperty rdf:about="&obo;replaced_by"/>\n+    <owl:AnnotationProperty rdf:about="&obo;transitive_over"/>\n+    <owl:AnnotationProperty rdf:about="&obo;namespace"/>\n+    <owl:AnnotationProperty rdf:about="&obo;xref"/>\n+    <owl:AnnotationProperty rdf:about="&obo;is_obsolete"/>\n+    <owl:AnnotationProperty rdf:about="&obo;synonym"/>\n+    <owl:AnnotationProperty rdf:about="&obo;created_by"/>\n+    <owl:AnnotationProperty rdf:about="&obo;creation_date"/>\n+    \n+\n+\n+    <!-- \n+    ///////////////////////////////////////////////////////////////////////////////////////\n+    //\n+    // Datatypes\n+    //\n+    ///////////////////////////////////////////////////////////////////////////////////////\n+     -->\n+\n+    \n+\n+\n+    <!-- \n+    ///////////////////////////////////////////////////////////////////////////////////////\n+    //\n+    // Object Properties\n+    //\n+    ///////////////////////////////////////////////////////////////////////////////////////\n+     -->\n+\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/GENE_ONTOLOGY_has_part -->\n+\n+    <owl:ObjectProperty rdf:about="&obo;GENE_ONTOLOGY_has_part">\n+        <rdf:type rdf:resource="&owl;TransitiveProperty"/>\n+        <rdfs:label rdf:datatype="&xsd;string">has_part</rdfs:label>\n+    </owl:ObjectProperty>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/GENE_ONTOLOGY_negatively_regulates -->\n+\n+    <owl:ObjectProperty rdf:about="&obo;GENE_ONTOLOGY_negatively_regulates">\n+        <rdfs:label rdf:datatype="&xsd;string">negatively_regulates</rdfs:label>\n+        <rdfs:subPropertyOf rdf:resource="&obo;GENE_ONTOLOGY_regulates"/>\n+    </owl:ObjectProperty>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/GENE_ONTOLOGY_occurs_in -->\n+\n+    <owl:ObjectProperty rdf:about="&obo;GENE_ONTOLOGY_occurs_in">\n+        <rdfs:label rdf:datatype="&xsd;string">occurs in</rdfs:label>\n+    </owl:ObjectProperty>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/GENE_ONTOLOGY_part_of -->\n+\n+    <owl:ObjectProperty rdf:about="&obo;GENE_ONTOLOGY_part_of">\n+        <rdf:type rdf:resource="&owl;TransitiveProperty"/>\n+        <rdfs:label rdf:datatype="&xsd;string">part_of</rdfs:label>\n+    </owl:ObjectProperty>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/GENE_ONTOLOGY_positively_regulates -->\n+\n+    <owl:ObjectProperty rdf:about="&obo;GENE_ONTOLOGY_positively_regulates">\n+        <rdfs:label rdf:datatype="&xsd;string">positively_regulates</rdfs:label>\n+        <rdfs:subPropertyOf rdf:resource="&obo;GENE_ONTOLOGY_regulates"/>'..b'    <obo:creation_date>2011-09-14T12:01:06Z</obo:creation_date>\n+    </owl:Class>\n+    <owl:Axiom>\n+        <obo:synonymtype rdf:datatype="&xsd;string">RELATED</obo:synonymtype>\n+        <owl:annotatedTarget>animal starch binding</owl:annotatedTarget>\n+        <obo:xref rdf:resource="&obo;GOC_obol"/>\n+        <owl:annotatedSource rdf:resource="&obo;GO_2001069"/>\n+        <owl:annotatedProperty rdf:resource="&obo;synonym"/>\n+    </owl:Axiom>\n+    <owl:Axiom>\n+        <obo:synonymtype rdf:datatype="&xsd;string">RELATED</obo:synonymtype>\n+        <owl:annotatedTarget>liver starch binding</owl:annotatedTarget>\n+        <obo:xref rdf:resource="&obo;GOC_obol"/>\n+        <owl:annotatedSource rdf:resource="&obo;GO_2001069"/>\n+        <owl:annotatedProperty rdf:resource="&obo;synonym"/>\n+    </owl:Axiom>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/GO_2001070 -->\n+\n+    <owl:Class rdf:about="&obo;GO_2001070">\n+        <rdfs:label rdf:datatype="&xsd;string">starch binding</rdfs:label>\n+        <rdfs:subClassOf rdf:resource="&obo;GO_0030247"/>\n+        <obo:synonym>amidon binding</obo:synonym>\n+        <obo:created_by>jane</obo:created_by>\n+        <obo:namespace>molecular_function</obo:namespace>\n+        <obo:def>&quot;Interacting selectively and non-covalently with starch.&quot; [GOC:mengo_curators]</obo:def>\n+        <obo:creation_date>2011-09-14T12:02:50Z</obo:creation_date>\n+        <obo:synonym>amylum binding</obo:synonym>\n+    </owl:Class>\n+    <owl:Axiom>\n+        <obo:synonymtype rdf:datatype="&xsd;string">RELATED</obo:synonymtype>\n+        <owl:annotatedTarget>amylum binding</owl:annotatedTarget>\n+        <obo:xref rdf:resource="&obo;GOC_obol"/>\n+        <owl:annotatedSource rdf:resource="&obo;GO_2001070"/>\n+        <owl:annotatedProperty rdf:resource="&obo;synonym"/>\n+    </owl:Axiom>\n+    <owl:Axiom>\n+        <obo:synonymtype rdf:datatype="&xsd;string">RELATED</obo:synonymtype>\n+        <owl:annotatedTarget>amidon binding</owl:annotatedTarget>\n+        <obo:xref rdf:resource="&obo;GOC_obol"/>\n+        <owl:annotatedSource rdf:resource="&obo;GO_2001070"/>\n+        <owl:annotatedProperty rdf:resource="&obo;synonym"/>\n+    </owl:Axiom>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/GO_2001071 -->\n+\n+    <owl:Class rdf:about="&obo;GO_2001071">\n+        <rdfs:label rdf:datatype="&xsd;string">maltoheptaose binding</rdfs:label>\n+        <rdfs:subClassOf rdf:resource="&obo;GO_0070492"/>\n+        <obo:def>&quot;Interacting selectively and non-covalently with maltoheptaose.&quot; [GOC:mengo_curators]</obo:def>\n+        <obo:namespace>molecular_function</obo:namespace>\n+        <obo:created_by>jane</obo:created_by>\n+        <obo:creation_date>2011-09-14T12:04:30Z</obo:creation_date>\n+    </owl:Class>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/GO_2001072 -->\n+\n+    <owl:Class rdf:about="&obo;GO_2001072">\n+        <rdfs:label rdf:datatype="&xsd;string">galactomannan binding</rdfs:label>\n+        <rdfs:subClassOf rdf:resource="&obo;GO_0010297"/>\n+        <obo:namespace>molecular_function</obo:namespace>\n+        <obo:creation_date>2011-09-14T12:12:02Z</obo:creation_date>\n+        <obo:def>&quot;Interacting selectively and non-covalently with galactomannan.&quot; [GOC:mengo_curators]</obo:def>\n+        <obo:created_by>jane</obo:created_by>\n+    </owl:Class>\n+    \n+\n+\n+    <!-- http://purl.obolibrary.org/obo/GO_2001073 -->\n+\n+    <owl:Class rdf:about="&obo;GO_2001073">\n+        <rdfs:label rdf:datatype="&xsd;string">cyclodextrin binding</rdfs:label>\n+        <rdfs:subClassOf rdf:resource="&obo;GO_0030247"/>\n+        <obo:created_by>jane</obo:created_by>\n+        <obo:namespace>molecular_function</obo:namespace>\n+        <obo:creation_date>2011-09-14T12:24:30Z</obo:creation_date>\n+        <obo:def>&quot;Interacting selectively and non-covalently with cyclodextrin.&quot; [GOC:mengo_curators]</obo:def>\n+    </owl:Class>\n+</rdf:RDF>\n+\n+\n+\n+<!-- Generated by the OWL API (version 3.2.2.1782) http://owlapi.sourceforge.net -->\n+\n'
b
diff -r 4f60202c58d9 -r 68935f90c2db OPPL/oppl.xml
--- a/OPPL/oppl.xml Wed Sep 14 19:52:06 2011 +0200
+++ b/OPPL/oppl.xml Sat Sep 17 13:41:28 2011 +0200
b
@@ -1,31 +1,50 @@
-<tool id="oppl" name="Execute an OPPL file against an ontology" version="1.0.2">
-  <description>It executes an OPPL script against the input ontology and generates a new ontology with the changes described in the OPPL script</description>
-  <command>java -jar ${__tool_data_path__}/shared/jars/oppl_galaxy_tool.jar $input $OPPL $format $inferred > $output </command>
-  <!--<command>java -Xmx7000M -Xms250M -DentityExpansionLimit=1000000000 -jar ${__tool_data_path__}/shared/jars/oppl_galaxy_tool.jar $input $OPPL $format > $output </command>-->
-  <inputs>
-    <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="Add_inferred" falsevalue="Gora_ni" label="Add inferred subsumption axioms to output ontology"/>
-  </inputs>
-  <outputs>
-    <data format="text" name="output" />
-  </outputs>
+<tool id="oppl" name="Execute an OPPL file against an ontology" version="1.0.3">
+ <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 conditional is tacky, I think, but it works! -->
+
+ <command>
+ #if $import_opts.imports_select==False #java -Xmx7000M -Xms250M -DentityExpansionLimit=1000000000 -jar ${__tool_data_path__}/shared/jars/oppl_galaxy_tool.jar $input $OPPL $format $inferred NoImports > $output 2>/dev/null
+ #else #java -Xmx7000M -Xms250M -DentityExpansionLimit=1000000000 -jar ${__tool_data_path__}/shared/jars/oppl_galaxy_tool.jar $input $OPPL $format $inferred $imports > $output 2>/dev/null
+ #end if
+ </command>
+
+ <!--<command>java -Xmx7000M -Xms250M -DentityExpansionLimit=1000000000 -jar ${__tool_data_path__}/shared/jars/oppl_galaxy_tool.jar $input $OPPL $format $inferred $imports > $output 2>/dev/null</command>-->
 
-  <tests>
-    <test>
-      <param name="input" value="test.owl"/>
-      <param name="OPPL" value="test.oppl"/>
-      <param name="format" value="OWL"/>
-      <param name="inferred" value="False"/>
-      <output name="out_file" file="test_new.owl"/>
-    </test>
-  </tests>
+ <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"/>
+ <when value="imports_no"/>
+ <!--<when value="imports_no">
+ <param type="hidden" name="imports" value="NoImports"/>
+      </when>-->
+ <when value="imports_yes">
+                 <param format="text" name="imports" type="data" label="OWL imports URI mapping file"/>
+             </when>
+ </conditional>
+ <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="Add_inferred" falsevalue="Gora_ni" label="Add inferred subsumption axioms to output ontology"/>
 
-  <help>
+ </inputs>
+ <outputs>
+ <data format="text" name="output" />
+ </outputs>
+ <tests>
+ <test>
+ <param name="input" value="test.owl"/>
+ <param name="OPPL" value="test.oppl"/>
+ <param name="format" value="OWL"/>
+ <param name="inferred" value="False"/>
+ <param name="imports" value="NoImports"/>
+ <output name="out_file" file="test_new.owl"/>
+ </test>
+ </tests>
+ <help>
 
 **About OPPL-Galaxy**
 
@@ -37,19 +56,19 @@
 
 **Usage**
 
-  An ontology and an OPPL file are needed (test.owl and test.oppl can be used as samples). Load both with Get Data >> Upload File from your computer. 
+  An ontology and an OPPL file are needed (test.owl and test.oppl can be used as samples, both available in the bundle). Load both with Get Data >> Upload File from your computer. 
 
-  Then execute the OPPL file against the OWL file with Ontology Pre Processor Language >> Execute an OPPL file against an OWL file.
-
-  This is the OPPL script provided in the bundle, test.oppl (Variables start with ?): 
+  Then execute the OPPL file against the OWL file with Ontology Pre Processor Language >> Execute an OPPL file against an OWL file. A new output ontology will be generated.
 
-  ?whole:CLASS,
-  ?part:CLASS
-  SELECT
-  ?part SubClassOf part_of some ?whole WHERE ?part != Nothing
-  BEGIN
-  ADD ?part SubClassOf part_of only ?whole
-  END;
+  In case the loaded ontology includes OWL imports, a file that maps the imported ontologies' URIs to actual physical URIs is needed. The file (See the file test_URI_mappings provided in the bundle) follows the convention URI-tab-physical URI:
+  
+  http://purl.obolibrary.org/obo/CHEBI_ONTOLOGY_chebi_ontology /home/pik/UPM/OPPL_galaxy/oppl/OPPL/chebi.owl
+
+  http://purl.obolibrary.org/obo/UBERON_uberon /home/pik/UPM/OPPL_galaxy/oppl/OPPL/cell.owl
+
+  The output ontology can be OBO or OWL (RDF/XML).

+  The inferred subsumption axioms can be added to the output ontology as asserted axioms. 
 
 **More information**
 
@@ -65,6 +84,6 @@
 
   Please send any request or comment to mikel.egana.aranguren@gmail.com.
 
-  </help>
+ </help>
 
 </tool>
b
diff -r 4f60202c58d9 -r 68935f90c2db OPPL/oppl_galaxy_tool.jar
b
Binary file OPPL/oppl_galaxy_tool.jar has changed
b
diff -r 4f60202c58d9 -r 68935f90c2db OPPL/test_URI_mappings
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/OPPL/test_URI_mappings Sat Sep 17 13:41:28 2011 +0200
b
@@ -0,0 +1,4 @@
+http://purl.obolibrary.org/obo/CHEBI_ONTOLOGY_chebi_ontology /home/pik/UPM/OPPL_galaxy/oppl/OPPL/chebi.owl
+http://purl.obolibrary.org/obo/UBERON_uberon /home/pik/UPM/OPPL_galaxy/oppl/OPPL/cell.owl
+# Comments can be added with #
+