Skip to content

Commit

Permalink
Remove use of ModelWriterHelper to eliminate unneccessary Tbox axioms…
Browse files Browse the repository at this point in the history
… in model graphs. Related to #185.
  • Loading branch information
balhoff committed May 13, 2018
1 parent 508663f commit 843e5d6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 291 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@
import org.semanticweb.owlapi.model.RemoveAxiom;
import org.semanticweb.owlapi.model.RemoveOntologyAnnotation;

/**
* The axioms tagged with the lego:derived property are removed upon reading in the model.
* This system is not really used anymore, but this class should still be active while
* some models still contain these annotated axioms.
*/
public class ModelReaderHelper implements PostLoadOntologyFilter {

public static final ModelReaderHelper INSTANCE = new ModelReaderHelper();
public static final IRI DERIVED_IRI = IRI.create("http://geneontology.org/lego/derived");
public static final String DERIVED_VALUE = "true";

private ModelReaderHelper() {
// no public constructor, use instance
Expand All @@ -31,7 +38,7 @@ private ModelReaderHelper() {
public OWLOntology filter(OWLOntology model) {
final OWLOntologyManager m = model.getOWLOntologyManager();
final OWLDataFactory f = m.getOWLDataFactory();
final OWLAnnotationProperty derivedProperty = f.getOWLAnnotationProperty(ModelWriterHelper.DERIVED_IRI);
final OWLAnnotationProperty derivedProperty = f.getOWLAnnotationProperty(DERIVED_IRI);

List<OWLOntologyChange> allChanges = new ArrayList<OWLOntologyChange>();

Expand Down Expand Up @@ -81,7 +88,7 @@ public String visit(OWLLiteral literal) {
return literal.getLiteral();
}
});
if (value != null && ModelWriterHelper.DERIVED_VALUE.equalsIgnoreCase(value)) {
if (value != null && DERIVED_VALUE.equalsIgnoreCase(value)) {
return true;
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.geneontology.minerva.ModelReaderHelper;
import org.geneontology.minerva.ModelWriterHelper;
import org.geneontology.minerva.UndoAwareMolecularModelManager;
import org.geneontology.minerva.curie.CurieHandler;
import org.geneontology.minerva.curie.CurieMappings;
Expand Down Expand Up @@ -331,7 +330,6 @@ public static Server startUp(final MinervaStartUpConfig conf)
conf.curieHandler, conf.modelIdPrefix, conf.journalFile, conf.exportFolder);
// set pre and post file handlers
models.addPostLoadOntologyFilter(ModelReaderHelper.INSTANCE);
models.addPreFileSaveHandler(new ModelWriterHelper(conf.curieHandler, conf.lookupService));

// start server
Server server = startUp(models, conf);
Expand Down

This file was deleted.

0 comments on commit 843e5d6

Please sign in to comment.