Examples of IOntologyException


Examples of edu.pitt.ontology.IOntologyException

  public void importOntology(IOntology ont) throws IOntologyException {
    File file = new File(ontologyDirectory,ont.getName());
    try {
      ont.write(new FileOutputStream(file),IOntology.OWL_FORMAT);
    } catch (FileNotFoundException e) {
      throw new IOntologyException("Unable to save file in the local cache at "+file.getAbsolutePath(),e);
    }
    // reload from cache
    ont.dispose();
    ont = OOntology.loadOntology(file);
    addOntology(ont);
View Full Code Here

Examples of edu.pitt.ontology.IOntologyException

        data = manager.getOWLDataFactory();
        setOntology(this);
        prefixManager = manager.getOntologyFormat(ontology).asPrefixOWLOntologyFormat();
       
      } catch (OWLOntologyCreationException e) {
        throw new IOntologyException("Unable to create ontology "+location,e);
      }
    }
  }
View Full Code Here

Examples of edu.pitt.ontology.IOntologyException

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

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

Examples of edu.pitt.ontology.IOntologyException

  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

Examples of edu.pitt.ontology.IOntologyException

    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

Examples of edu.pitt.ontology.IOntologyException

    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
Copyright © 2018 www.massapi.com. 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.