monarch-initiative / owlsim-v3

Ontology Based Profile Matching
16 stars 5 forks source link

57 loader refactor #70

Closed julesjacobsen closed 7 years ago

julesjacobsen commented 7 years ago

Added a bunch of code/deprecated OWLLoader towards #57

Code is hopefully self-documenting, using a fluid API. For example, in the KnowldegBaseModule:

    //The OwlKnowledgeBase.Loader uses the ELKReasonerFactory and Concurrency.CONCURRENT as defaults. 
    this.bmKnowledgeBase = OwlKnowledgeBase.loader()
        .loadOntologies(ontologyUris) 
        .loadDataFromOntologies(ontologyDataUris)
        .loadDataFromTsv(dataTsvs) 
        .loadCuries(curies)
        .createKnowledgeBase(); 

    logger.info("Created BMKnowledgebase"); 

There is one possible issue though - the server didn't start. I'm not sure if I screwed up some Guice magic or not, but getting rid of the injector.getAllBindings() logger statement allowed the server to start and superficially appears to work.

julesjacobsen commented 7 years ago

Umm, yeah. Not sure why I made it abstract exactly. I think I wanted to add the OwlKnowledgeBase functionality directly to the BMKnowledgeBase interface. I could reduce its visibility so the only way to make a BMKnowledgeBase would be off the interface itself like this:

BMKnowledgeBase knowledgebase = BMKnowledgeBase.owlLoader()...createKnowledgeBase();

Would this make a bit more sense?

As for the OwlKnowledgeBase not being a knowledge base - I called it that because being uninstantiable you could only call OwlKnowledgeBase.loader(). I though this read better than OwlKnowledgeBaseLoader.loader() which suffered from too many 'loaders' in the name.