}
public void checkOBODoc(@Nonnull OBODoc obodoc) {
// OBODoc tests
// test ECA between named classes is persisted using correct tag
Frame tf = obodoc.getTermFrame("X:1");
Collection<Clause> cs = tf.getClauses(OboFormatTag.TAG_EQUIVALENT_TO);
assertEquals(1, cs.size());
Object v = cs.iterator().next().getValue();
assertEquals("X:2", v);
// test ECA between named class and anon class is persisted as
// genus-differentia intersection_of tags
tf = obodoc.getTermFrame("X:1");
cs = tf.getClauses(OboFormatTag.TAG_INTERSECTION_OF);
assertEquals(2, cs.size());
boolean okGenus = false;
boolean okDifferentia = false;
for (Clause c : cs) {
Collection<Object> vs = c.getValues();
if (vs.size() == 2) {
if (c.getValue().equals("R:1") && c.getValue2().equals("Z:1")) {
okDifferentia = true;
}
} else if (vs.size() == 1) {
if (c.getValue().equals("Y:1")) {
okGenus = true;
}
} else {
fail();
}
}
assertTrue(okGenus);
assertTrue(okDifferentia);
// check reciprocal direction
Frame tf2 = obodoc.getTermFrame("X:2");
Collection<Clause> cs2 = tf2.getClauses(OboFormatTag.TAG_EQUIVALENT_TO);
Frame tf1 = obodoc.getTermFrame("X:1");
Collection<Clause> cs1 = tf1.getClauses(OboFormatTag.TAG_EQUIVALENT_TO);
boolean ok = false;
if (cs2.size() == 1) {
if (cs2.iterator().next().getValue(String.class).equals("X:1")) {
ok = true;
}