@Override public OntologyLibrary retrieveBaseOntologyLibrary() { if (baseOntologyLibrary == null) { File baseOntologyFolder = new File(localDirectory, "Ontologies"); logger.info("Instantiating BaseOntologyLibrary from " + baseOntologyFolder.getAbsolutePath()); baseOntologyLibrary = new OntologyLibrary(this, null); findOntologies( baseOntologyFolder, FLEXO_ONTOLOGY_ROOT_URI, baseOntologyLibrary.getRootFolder()); // baseOntologyLibrary.init(); // Bug fix: compatibility with old versions: // If some of those ontologies were not found, try to copy default ontologies if (baseOntologyLibrary.getRDFSOntology() == null || baseOntologyLibrary.getRDFOntology() == null || baseOntologyLibrary.getOWLOntology() == null || baseOntologyLibrary.getFlexoConceptOntology() == null) { copyOntologies(localDirectory, CopyStrategy.REPLACE); findOntologies( baseOntologyFolder, FLEXO_ONTOLOGY_ROOT_URI, baseOntologyLibrary.getRootFolder()); } logger.fine("Instantiating BaseOntologyLibrary Done. Loading some ontologies..."); // baseOntologyLibrary.debug(); baseOntologyLibrary.getRDFSOntology().loadWhenUnloaded(); baseOntologyLibrary.getRDFOntology().loadWhenUnloaded(); baseOntologyLibrary.getOWLOntology().loadWhenUnloaded(); baseOntologyLibrary.getRDFSOntology().updateConceptsAndProperties(); baseOntologyLibrary.getRDFOntology().updateConceptsAndProperties(); baseOntologyLibrary.getOWLOntology().updateConceptsAndProperties(); baseOntologyLibrary.getFlexoConceptOntology().loadWhenUnloaded(); // baseOntologyLibrary.debug(); } return baseOntologyLibrary; }
@Override public OntologyLibrary retrieveBaseOntologyLibrary() { if (baseOntologyLibrary == null) { logger.fine("Instanciating BaseOntologyLibrary"); baseOntologyLibrary = new OntologyLibrary(this, null); findOntologies( new File(localDirectory, "Ontologies"), FLEXO_ONTOLOGY_ROOT_URI, baseOntologyLibrary.getRootFolder()); // baseOntologyLibrary.init(); logger.fine("Instanciating BaseOntologyLibrary Done. Loading some ontologies..."); // baseOntologyLibrary.debug(); baseOntologyLibrary.getRDFSOntology().loadWhenUnloaded(); baseOntologyLibrary.getRDFOntology().loadWhenUnloaded(); baseOntologyLibrary.getOWLOntology().loadWhenUnloaded(); baseOntologyLibrary.THING = baseOntologyLibrary.getClass(OntologyLibrary.OWL_THING_URI); baseOntologyLibrary.getRDFSOntology().updateConceptsAndProperties(); baseOntologyLibrary.getRDFOntology().updateConceptsAndProperties(); baseOntologyLibrary.getFlexoConceptOntology().loadWhenUnloaded(); // baseOntologyLibrary.debug(); } return baseOntologyLibrary; }