Package edu.stanford.smi.protegex.owl.model.util

Examples of edu.stanford.smi.protegex.owl.model.util.ImportHelper


    try{
      load();
      // load ontology
      o.load();
      //model.getDefaultOWLOntology().addImports((OWLOntology)((POntology)o).getResource());
      ImportHelper importHelper = new ImportHelper((JenaOWLModel) model);
      // get repository from import ontology
      OWLModel imodel = ((POntology)o).getModel();
      //Repository rep = imodel.getRepositoryManager().getRepository(o.getURI());
      String path = getDescriptor(imodel.getOWLProject().getSettingsMap());
      // I am tired, for some reason this property may be reset and
      // instead of full path URI it stores file name, well in this case
      // lets return location instead
      if(!path.contains("/"))
        path = o.getLocation();
      Repository rep = RepositoryFactory.getInstance().createOntRepository(imodel,path);
      if (rep != null) {
        model.getRepositoryManager().addProjectRepository(rep);
          }
     
      /*
      for(Repository r : model.getRepositoryManager().getAllRepositories()){
        System.out.println(r.getRepositoryDescriptor()+" : "+r.getOntologies());
      }
      */   
     
      // create custom prefix
      model.getNamespaceManager().setPrefix(o.getNameSpace(),PUtils.createOntologyPrefix(o.getURI()));
     
      // import ontologies
      importHelper.addImport(o.getURI());
      importHelper.importOntologies();
      
      // don't know what is the function of this???
      //model.getNamespaceManager().setPrefix(ProtegeNames.NS, ProtegeNames.PROTEGE_PREFIX);
      if(imported == null)
        imported = new ArrayList<IOntology>();
View Full Code Here


    try{
      load();
      // load ontology
      o.load();
      //model.getDefaultOWLOntology().addImports((OWLOntology)((POntology)o).getResource());
      ImportHelper importHelper = new ImportHelper((JenaOWLModel) model);
      // get repository from import ontology
      OWLModel imodel = ((POntology)o).getModel();
      //Repository rep = imodel.getRepositoryManager().getRepository(o.getURI());
      String path = getDescriptor(imodel.getOWLProject().getSettingsMap());
      // I am tired, for some reason this property may be reset and
      // instead of full path URI it stores file name, well in this case
      // lets return location instead
      if(!path.contains("/"))
        path = o.getLocation();
      Repository rep = RepositoryFactory.getInstance().createOntRepository(imodel,path);
      if (rep != null) {
        model.getRepositoryManager().addProjectRepository(rep);
          }
     
      /*
      for(Repository r : model.getRepositoryManager().getAllRepositories()){
        System.out.println(r.getRepositoryDescriptor()+" : "+r.getOntologies());
      }
      */   
     
      // create custom prefix
      model.getNamespaceManager().setPrefix(o.getNameSpace(),PUtils.createOntologyPrefix(o.getURI()));
     
      // import ontologies
      importHelper.addImport(o.getURI());
      importHelper.importOntologies();
      
      // don't know what is the function of this???
      //model.getNamespaceManager().setPrefix(ProtegeNames.NS, ProtegeNames.PROTEGE_PREFIX);
      if(imported == null)
        imported = new ArrayList<IOntology>();
View Full Code Here

        if (uri != null) {
            LocalFolderRepository rep = new LocalFolderRepository(new File(uri));
            owlModel.getRepositoryManager().addProjectRepository(rep);
        }

        ImportHelper ih = new ImportHelper(owlModel);
        ih.addImport(CLAML_CM_ONTOLOGY_NAME);
        ih.importOntologies();
    }
View Full Code Here

TOP

Related Classes of edu.stanford.smi.protegex.owl.model.util.ImportHelper

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.