Examples of OBODoc


Examples of org.obolibrary.oboformat.model.OBODoc

        }
        assertTrue(okDeprecated);
        // CONVERT TO OWL FILE
        writeOWL(ontology, new RDFXMLDocumentFormat());
        // CONVERT BACK TO OBO
        OBODoc obodoc = convert(ontology);
        Frame tf = obodoc.getTermFrame("XX:0000034");
        Clause c = tf.getClause(OboFormatTag.TAG_IS_OBSELETE);
        Object v = c.getValue();
        assertEquals("true", v); // should this be a Boolean object? TODO
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

    @Test
    public void testConvert() throws Exception {
        OWLAPIOwl2Obo bridge = new OWLAPIOwl2Obo(
                OWLManager.createOWLOntologyManager());
        bridge.setMuteUntranslatableAxioms(true);
        OBODoc doc = bridge.convert(parseOWLFile("nesting.owl"));
        assertEquals("untranslatable axiom count", 1, bridge
                .getUntranslatableAxioms().size());
        OBODoc obodoc = doc;
        // checkOBODoc(obodoc);
        // ROUNDTRIP AND TEST AGAIN
        String file = writeOBO(obodoc);
        obodoc = parseOBOFile(new StringReader(file), false);
        checkOBODoc(obodoc);
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

@SuppressWarnings({ "javadoc", "null" })
public class PropertyValueTest extends OboFormatTestBasics {

    @Test
    public void testExpand() {
        OBODoc obodoc = parseOBOFile("property_value_test.obo");
        Clause propertyValue = obodoc.getTermFrame("UBERON:0004657").getClause(
                OboFormatTag.TAG_PROPERTY_VALUE);
        assertEquals("IAO:0000412", propertyValue.getValue());
        assertEquals("http://purl.obolibrary.org/obo/uberon.owl",
                propertyValue.getValue2());
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

                propertyValue.getValue2());
    }

    @Test
    public void testWriteReadValues() throws Exception {
        OBODoc doc = createPVDoc();
        String oboString = renderOboToString(doc);
        OBODoc doc2 = parseOboToString(oboString);
        List<Diff> diffs = OBODocDiffer.getDiffs(doc, doc2);
        assertEquals("Expected no diffs", 0, diffs.size());
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

        assertEquals("Expected no diffs", 0, diffs.size());
    }

    @Nonnull
    private static OBODoc createPVDoc() {
        OBODoc oboDoc = new OBODoc();
        Frame headerFrame = new Frame(FrameType.HEADER);
        headerFrame
                .addClause(new Clause(OboFormatTag.TAG_FORMAT_VERSION, "1.2"));
        headerFrame.addClause(new Clause(OboFormatTag.TAG_ONTOLOGY, "test"));
        addPropertyValue(headerFrame, "http://purl.org/dc/elements/1.1/title",
                "Ontology for Biomedical Investigation", "xsd:string");
        addPropertyValue(headerFrame, "defaultLanguage", "en", "xsd:string");
        oboDoc.setHeaderFrame(headerFrame);
        return oboDoc;
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

        aaas = owlOnt.getAnnotationAssertionAxioms(IRI
                .create("http://purl.obolibrary.org/obo/BAR_0000001"));
        assertTrue(!aaas.isEmpty());
        OWLAPIOwl2Obo revbridge = new OWLAPIOwl2Obo(
                OWLManager.createOWLOntologyManager());
        OBODoc d2 = revbridge.convert(owlOnt);
        Frame partOf = d2.getTypedefFrame("part_of");
        Collection<Clause> xrcs = partOf.getClauses(OboFormatTag.TAG_XREF);
        boolean okBfo = false;
        boolean okOboRel = false;
        for (Clause c : xrcs) {
            Xref value = c.getValue(Xref.class);
            if (value.getIdref().equals("BFO:0000050")) {
                okBfo = true;
            }
            if (value.getIdref().equals("OBO_REL:part_of")) {
                okOboRel = true;
            }
        }
        assertTrue(okBfo);
        assertTrue(okOboRel);
        Frame a = d2.getTermFrame("TEST:a");
        Clause rc = a.getClause(OboFormatTag.TAG_RELATIONSHIP);
        assertEquals("part_of", rc.getValue());
        assertEquals("TEST:b", rc.getValue2());
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

        roundTripOBOFile("synonym_test.obo", true);
    }

    @Test
    public void testRequireEmptyXrefList() throws Exception {
        OBODoc obo = parseOBOFile("synonym_test.obo");
        // Get synonym clause with an empty xref list
        Frame frame = obo.getTermFrame("GO:0009579");
        assertNotNull(frame);
        // write frame
        StringWriter stringWriter = new StringWriter();
        BufferedWriter bufferedWriter = new BufferedWriter(stringWriter);
        OBOFormatWriter oboWriter = new OBOFormatWriter();
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

            protected boolean handleDuplicateClause(Frame frame, Clause clause) {
                duplicates.add(clause);
                return super.handleDuplicateClause(frame, clause);
            }
        };
        OBODoc convert = owl2Obo.convert(owl);
        assertEquals(1, duplicates.size());
        // test that no exception is thrown during write.
        renderOboToString(convert);
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

public class Owl2OboTest extends OboFormatTestBasics {

    @Test
    public void testConversion() throws Exception {
        OWLOntology ontology = convert(parseOBOFile("caro.obo"));
        OBODoc doc = convert(ontology);
        writeOBO(doc);
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.OBODoc

     * into OBO, and also round-trip back into OWL.
     */
    @Test
    public void testRoundTrip() throws Exception {
        OWLOntology oo1 = parseOWLFile("ro.owl");
        OBODoc oboDoc1 = convert(oo1);
        // write OBO
        String oboString = renderOboToString(oboDoc1);
        // parse OBO
        OBOFormatParser p = new OBOFormatParser();
        OBODoc oboDoc2 = p
                .parse(new BufferedReader(new StringReader(oboString)));
        // check that the annotations are pre-served on the property values
        Frame typedefFrame = oboDoc2.getTypedefFrame("RO:0002224");
        @SuppressWarnings("null")
        Collection<Clause> propertyValues = typedefFrame
                .getClauses(OboFormatTag.TAG_PROPERTY_VALUE);
        boolean found = false;
        for (Clause clause : propertyValues) {
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.