diff --git a/src/main/java/lode/LODEGeneration.java b/src/main/java/lode/LODEGeneration.java index 5b4af5a..82ee47c 100644 --- a/src/main/java/lode/LODEGeneration.java +++ b/src/main/java/lode/LODEGeneration.java @@ -69,17 +69,11 @@ public static String getLODEhtml(Configuration c, File lodeResources) throws Exc c.getMainOntology().getOWLAPIModel()); content = applyXSLTTransformation(content, c.getOntologyURI(), lang, lodeResources); return (content); - } catch (OWLOntologyStorageException e) { - logger.error("Error while applying LODE. Error while applying the XLS file: " + e.getMessage()); - throw e; - } catch (TransformerException e) { - logger.error("Error while applying LODE. Error while applying the XLS file: " + e.getMessage()); - throw e; - } catch (UnsupportedEncodingException e) { + } catch (OWLOntologyStorageException | TransformerException | UnsupportedEncodingException e) { logger.error("Error while applying LODE. Error while applying the XLS file: " + e.getMessage()); throw e; } - } + } /** * Method that uses the loaded ontology and parses it in case there are imports diff --git a/src/main/java/widoco/Configuration.java b/src/main/java/widoco/Configuration.java index e8e0c0f..48255cf 100644 --- a/src/main/java/widoco/Configuration.java +++ b/src/main/java/widoco/Configuration.java @@ -513,6 +513,9 @@ public void loadPropertiesFromOntology(OWLOntology o) { mainOntologyMetadata.setCiteAs(cite.toString()); } + } + + public void loadNamespaceDeclarations(OWLOntology o){ //load all namespaces in the ontology document. this.namespaceDeclarations = new HashMap<>(); OWLOntologyXMLNamespaceManager nsManager = new OWLOntologyXMLNamespaceManager(o, o.getFormat()); diff --git a/src/main/java/widoco/LoadOntologyInThread.java b/src/main/java/widoco/LoadOntologyInThread.java index de2965a..a47d198 100644 --- a/src/main/java/widoco/LoadOntologyInThread.java +++ b/src/main/java/widoco/LoadOntologyInThread.java @@ -45,6 +45,7 @@ public void run() { try { WidocoUtils.loadModelToDocument(c); c.loadPropertiesFromOntology(c.getMainOntology().getOWLAPIModel()); + c.loadNamespaceDeclarations(c.getMainOntology().getOWLAPIModel()); if (showGui) { pointerToMain.switchState("finishedLoading"); } diff --git a/src/main/java/widoco/gui/GuiController.java b/src/main/java/widoco/gui/GuiController.java index 8b9fe29..d29eca7 100644 --- a/src/main/java/widoco/gui/GuiController.java +++ b/src/main/java/widoco/gui/GuiController.java @@ -210,12 +210,12 @@ public GuiController(String[] args) { } i++; } - // this creates the tmp files + // this creates tmp files for the conversion assets config = new Configuration(); try { this.config.reloadPropertyFile(confPath); } catch (Exception e) { - System.out.println("Configuration file could not be loaded: " + e.getMessage()); + logger.error("Configuration file could not be loaded: " + e.getMessage()); return; } @@ -291,6 +291,7 @@ public GuiController(String[] args) { // TO DO: improve this a little so language is passed on to load properties and generate doc. for (String l : config.getLanguagesToGenerateDoc()) { logger.info("Generating documentation for " + ontology + " in lang " + l); + config.loadNamespaceDeclarations(config.getMainOntology().getOWLAPIModel()); if (getOntoMetadata) { logger.info("Load properties from the ontology in lang " + l); config.loadPropertiesFromOntology(config.getMainOntology().getOWLAPIModel());