Examples of OBODoc


Examples of org.obolibrary.oboformat.model.OBODoc

        Set<OWLSubClassOfAxiom> scas = ontology
                .getAxioms(AxiomType.SUBCLASS_OF);
        boolean ok = !scas.isEmpty();
        assertTrue(ok);
        // CONVERT BACK TO OBO
        OBODoc obodoc = convert(ontology);
        // test that relation IDs are converted back to symbolic form
        Frame tf = obodoc.getTermFrame("X:1");
        Collection<Clause> clauses = tf
                .getClauses(OboFormatTag.TAG_RELATIONSHIP);
        assertEquals(2, clauses.size());
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

                }
            }
        }
        assertTrue(ok);
        // CONVERT BACK TO OBO
        OBODoc obodoc = convert(ontology);
        // test that relation IDs are converted back to symbolic form
        Frame tf = obodoc.getTermFrame("GO:0000050");
        Clause c = tf.getClause(OboFormatTag.TAG_RELATIONSHIP);
        Object v = c.getValue();
        // should be converted back to symbolic form
        assertEquals("has_part", v);
        tf = obodoc.getTermFrame("GO:0004055");
        c = tf.getClause(OboFormatTag.TAG_RELATIONSHIP);
        v = c.getValue();
        // should be converted back to symbolic form
        assertEquals("part_of", v);
        tf = obodoc.getTypedefFrame("has_part");
        Collection<Clause> cs = tf.getClauses(OboFormatTag.TAG_XREF);
        assertEquals(1, cs.size());
        v = cs.iterator().next().getValue(Xref.class).getIdref();
        // should be converted back to symbolic form
        assertEquals("BFO:0000051", v);
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

@SuppressWarnings("javadoc")
public class RoundTripTest extends OboFormatTestBasics {

    public List<Diff> roundTripOBOURL(String fn, boolean isExpectRoundtrip)
            throws Exception {
        OBODoc obodoc = parseOBOURL(fn);
        return roundTripOBODoc(obodoc, isExpectRoundtrip);
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

        return roundTripOBODoc(obodoc, isExpectRoundtrip);
    }

    public List<Diff> roundTripOBOFile(String fn, boolean isExpectRoundtrip)
            throws Exception {
        OBODoc obodoc = parseOBOFile(fn);
        return roundTripOBODoc(obodoc, isExpectRoundtrip);
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

    }

    public List<Diff> roundTripOBODoc(@Nonnull OBODoc obodoc,
            boolean isExpectRoundtrip) throws Exception {
        OWLOntology oo = convert(obodoc);
        OBODoc obodoc2 = convert(oo);
        obodoc2.check();
        writeOBO(obodoc2);
        List<Diff> diffs = OBODocDiffer.getDiffs(obodoc, obodoc2);
        if (isExpectRoundtrip) {
            assertEquals("Expected no diffs but " + diffs, 0, diffs.size());
        }
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

    public boolean roundTripOWLOOntology(@Nonnull OWLOntology oo,
            boolean isExpectRoundtrip) throws IOException {
        OWLAPIOwl2Obo bridge = new OWLAPIOwl2Obo(
                OWLManager.createOWLOntologyManager());
        OBODoc obodoc = bridge.convert(oo);
        writeOBO(obodoc);
        obodoc.check();
        OWLOntology oo2 = convert(obodoc);
        writeOWL(oo2);
        boolean ok = compareOWLOntologiesPartial(oo, oo2, isExpectRoundtrip,
                bridge.getUntranslatableAxioms());
        return ok || !isExpectRoundtrip;
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

        roundTripOBOFile(file, true);
    }

    @Test
    public void shouldContainExpectedAnnotation() {
        OBODoc oboFile = parseOBOFile(file);
        OWLOntology o = convert(oboFile);
        IRI expected = IRI
                .create("http://purl.obolibrary.org/obo/GO_0042062%3A");
        assertEquals(18, o.getAnnotationAssertionAxioms(expected).size());
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

@SuppressWarnings("javadoc")
public class TypeDefCommentsTest extends OboFormatTestBasics {

    @Test
    public void writeTypeDefComments() throws Exception {
        OBODoc doc = parseOBOFile("typedef_comments.obo", true);
        String original = readResource("typedef_comments.obo");
        String written = renderOboToString(doc);
        assertEquals(original, written);
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

     * before the differentia, instead of the default case-insensitive
     * alphabetical ordering.
     */
    @Test
    public void testSortTermClausesIntersectionOf() {
        OBODoc oboDoc = parseOBOFile("equivtest.obo");
        Frame frame = oboDoc.getTermFrame("X:1");
        List<Clause> clauses = new ArrayList<>(
                frame.getClauses(OboFormatTag.TAG_INTERSECTION_OF));
        OBOFormatWriter.sortTermClauses(clauses);
        assertEquals("Y:1", clauses.get(0).getValue());
        assertEquals("R:1", clauses.get(1).getValue());
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

     * Test that the OBO format writer only writes one new-line at the end of
     * the file.
     */
    @Test
    public void testWriteEndOfFile() throws Exception {
        OBODoc oboDoc = parseOBOFile("caro.obo");
        String oboString = renderOboToString(oboDoc);
        int length = oboString.length();
        assertTrue(length > 0);
        int newLineCount = 0;
        for (int i = length - 1; i >= 0; i--) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.