Skip to content

Commit

Permalink
Second Fix for localhost issue
Browse files Browse the repository at this point in the history
  • Loading branch information
IKCAP committed Jan 4, 2023
1 parent 9e6839c commit 7a4cc25
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public class ResourceKB extends TransactionsJena implements ResourceAPI {

public String onturl, liburl;
private String tdbRepository;
private static boolean initializeLibrary = false;

private static HashMap<String, Boolean> initializedLibrary = new HashMap<String, Boolean>();

private KBAPI ontkb, libkb;

Expand Down Expand Up @@ -80,8 +81,12 @@ protected void initializeAPI() {
this.libkb = this.ontologyFactory.getKB(liburl, OntSpec.PLAIN);

this.initializeMaps();
if(!initializeLibrary && this.tdbRepository != null)

String libkey = onturl + this.tdbRepository;
if(!initializedLibrary.containsKey(libkey)) {
this.initializeLibrary();
initializedLibrary.put(libkey, true);
}
}
catch (Exception e) {
e.printStackTrace();
Expand Down Expand Up @@ -128,7 +133,6 @@ else if(!m.isHealthy()) {
if(ok)
this.save();
this.end();
initializeLibrary = true;
}

private ArrayList<KBObject> getInstancesOfClass(KBObject cls, KBAPI kb) {
Expand Down

0 comments on commit 7a4cc25

Please sign in to comment.