Package edu.pitt.ontology

Examples of edu.pitt.ontology.IOntologyException


    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    //manager.addOntologyStorer(new OWLXMLOntologyStorer());
    try{
      return new OOntology(manager.createOntology(IRI.create(uri)));
    } catch (OWLOntologyCreationException e) {
      throw new IOntologyException("Unable to create ontology "+uri,e);
    }
  }
View Full Code Here


  public static OOntology loadOntology(URL file) throws IOntologyException {
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    try {
      return new OOntology(manager.loadOntologyFromOntologyDocument(IRI.create(file)));
    } catch (OWLOntologyCreationException e) {
      throw new IOntologyException("Unable to create ontology "+file,e);
    } catch (URISyntaxException e) {
      throw new IOntologyException("Unable to create ontology "+file,e);
    }
  }
View Full Code Here

    modified = false;
    try {
      manager.saveOntology(ontology, getIRI());
    } catch (OWLOntologyStorageException e) {
      if(e.getCause() instanceof ProtocolException)
        throw new IOntologyException("Unable to save ontology opened from URL "+getIRI()+". You should use IOntology.write() to save it as a file first.",e);
      throw new IOntologyException("Unable to save ontology "+getIRI(),e);
    }
  }
View Full Code Here

    case OWL_FORMAT:
      ontologyFormat = new OWLXMLOntologyFormat();break;
    case RDF_FORMAT:
      ontologyFormat = new RDFXMLOntologyFormat();break;
    case NTRIPLE_FORMAT:
      throw new IOntologyException("Unsupported export format");
    case OBO_FORMAT:
      ontologyFormat = new OBOOntologyFormat();break;
    case TURTLE_FORMAT:
      ontologyFormat = new TurtleOntologyFormat();break;
    }
   
   
    try {
      manager.saveOntology(ontology, ontologyFormat, out);
    } catch (OWLOntologyStorageException e) {
      if(e.getCause() instanceof ProtocolException)
        throw new IOntologyException("Unable to save ontology opened from URL "+getIRI()+". You should use IOntology.write() to save it as a file first.",e);
      throw new IOntologyException("Unable to save ontology "+getIRI(),e);
    }
   
  }
View Full Code Here

TOP

Related Classes of edu.pitt.ontology.IOntologyException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.