Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarijo committed Dec 31, 2023
1 parent e2049e8 commit 71ce4fc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
10 changes: 2 additions & 8 deletions src/main/java/lode/LODEGeneration.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/widoco/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
1 change: 1 addition & 0 deletions src/main/java/widoco/LoadOntologyInThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/widoco/gui/GuiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 71ce4fc

Please sign in to comment.