Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 21 additions & 14 deletions ontologizer/src/ontologizer/ontology/OBOParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ public Set<Term> getTermMap()
return this.terms;
}

public boolean ignoreObsoleteTerms()
{
return false;
}
/**
* This puts the results of the parse of a single OBO stanza into one Term
* object and stores that in the HashSet terms.
Expand All @@ -239,20 +243,23 @@ private void enterNewTerm()
return;

}

/* Create a Term object and put it in the HashMap terms. */
Term t = new Term(currentID, currentName, currentNamespace, currentParents);
t.setObsolete(currentObsolete);
t.setDefinition(currentDefintion);
t.setAlternatives(currentAlternatives);
t.setEquivalents(currentEquivalents);
t.setSubsets(currentSubsets);
t.setSynonyms(currentSynonyms);
t.setXrefs(currentXrefs);
terms.add(t);

/* Statistics */
numberOfRelations += currentParents.size();
//Ignore term if both obsolete and we are ignoring obsoletes
if (!(ignoreObsoleteTerms() && this.currentObsolete))
{
/* Create a Term object and put it in the HashMap terms. */
Term t = new Term(currentID, currentName, currentNamespace, currentParents);
t.setObsolete(currentObsolete);
t.setDefinition(currentDefintion);
t.setAlternatives(currentAlternatives);
t.setEquivalents(currentEquivalents);
t.setSubsets(currentSubsets);
t.setSynonyms(currentSynonyms);
t.setXrefs(currentXrefs);
terms.add(t);

/* Statistics */
numberOfRelations += currentParents.size();
}
}

resetCurrentStanza();
Expand Down