Examples of IOntologyException


Examples of edu.pitt.ontology.IOntologyException

    load();
    model.flushCache();
    ArrayList list = new ArrayList();
    model.getProject().save(list);
    if(!list.isEmpty()){
      throw new IOntologyException("Problem saving "+getURI(),getException(list));
    }
    pcs.firePropertyChange(ONTOLOGY_SAVED_EVENT,null,null);
  }
View Full Code Here

Examples of edu.pitt.ontology.IOntologyException

     
      // load new KB
      KnowledgeBaseFactory factory = new MyOWLDatabaseKnowledgeBaseFactory();
      Project project = Project.createBuildProject(factory, errors);
      if(!errors.isEmpty())
        throw new IOntologyException(""+errors);
      loadNewSources(project, factory);
     
      // load data
      project.createDomainKnowledgeBase(factory, errors, true);
          if(!errors.isEmpty())
        throw new IOntologyException(""+errors);
             
        model = (OWLModel) project.getKnowledgeBase();      
     
          // make sure it is named correctly
          model.getNamespaceManager().setDefaultNamespace(path+"#");
      OWLUtil.renameOntology(model,model.getDefaultOWLOntology(),""+path);
     }else{
      // load regular ontology
      String u = ""+info.get("location");
      File f = new File(u);
      URI path = (f.exists())?f.toURI():URI.create(u);
     
      // check URI path, if doesn't exist simply use URI as location
      if("file".equals(path.getScheme()) && !(new File(path)).exists())
        path = getURI();
     
      if(path.toString().endsWith(".pprj")){
        Project project = Project.loadProjectFromURI(path,errors);
        if(!errors.isEmpty()){
          throw new IOntologyException("Problem loading PPRJ file "+path+"\n",getException(errors));
        }
        model = (OWLModel) project.getKnowledgeBase();
      }else {
        try{
          model = ProtegeOWL.createJenaOWLModelFromURI(""+path);
        }catch(Exception ex){
          throw new IOntologyException("Problem loading OWL file "+path,ex);
        }
      }
     
      // set saved location if available
      if(info.containsKey("project.file.path"))
View Full Code Here

Examples of edu.pitt.ontology.IOntologyException

        if (currentProject.hasCompleteSources()) {
          ArrayList errors = new ArrayList();
            currentProject.setIsReadonly(false);
            currentProject.save(errors);
            if(!errors.isEmpty())
              throw new IOntologyException("problem saving "+getURI(),getException(errors));      
        }
       
        // save included projects
        /*
    IOntology [] onts = getImportedOntologies();
View Full Code Here

Examples of edu.pitt.ontology.IOntologyException

  public void removePropertyChangeListener(PropertyChangeListener listener){
    pcs.removePropertyChangeListener(listener);
  }
 
  public void addImportedOntology(IOntology o) throws IOntologyException {
    throw new IOntologyException("BioPortal is read-only");
  }
View Full Code Here

Examples of edu.pitt.ontology.IOntologyException

  public void flush() {
    // no-op
  }

  public void save() throws IOntologyException {
    throw new IOntologyException("BioPortal is read-only");
  }
View Full Code Here

Examples of edu.pitt.ontology.IOntologyException

  public void setRepository(IRepository r) {
    repository = (BioPortalRepository) r;
  }

  public void write(OutputStream out, int format) throws IOntologyException {
    throw new IOntologyException("writing BioPortal is not supported yet");
  }
View Full Code Here

Examples of edu.pitt.ontology.IOntologyException

     
      //System.out.println(repository);
     
      // now parse each individual resource
    }catch(Exception ex){
      throw new IOntologyException("Could not connect to Protege Database Repository "+url,ex);
      //ex.printStackTrace();
    }
  }
View Full Code Here

Examples of edu.pitt.ontology.IOntologyException

    // load ontology
    try{
      ont = POntology.loadOntology(path);
      importOntology(ont);
    }catch(Exception ex){
      throw new IOntologyException("problem loading "+path,ex);
    }
    return ont;
  }
View Full Code Here

Examples of edu.pitt.ontology.IOntologyException

          importOntology(o);
        }
      }
    }catch(Exception ex){
      ex.printStackTrace();
      throw new IOntologyException("problem importing "+ont.getURI(),ex);
    }
  }
View Full Code Here

Examples of edu.pitt.ontology.IOntologyException

  public IOntology importOntology(URI path) throws IOntologyException {
    URL url = null;
    try {
      url = path.toURL();
    } catch (MalformedURLException e) {
      throw new IOntologyException("Invalid URI supplied: "+path,e);
    }
    IOntology ont = OOntology.loadOntology(url);
    importOntology(ont);
    return getOntology(ont.getURI());
   
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.