Package org.obolibrary.oboformat.model

Examples of org.obolibrary.oboformat.model.Clause


        assertEquals("a b c", cl.getValue());
    }

    @Test
    public void testParseNamespaceTag() {
        Clause cl = parseLine("namespace: foo");
        assertEquals(cl.getTag(), OboFormatTag.TAG_NAMESPACE.getTag());
        assertEquals("foo", cl.getValue());
    }
View Full Code Here


        assertEquals("foo", cl.getValue());
    }

    @Test
    public void testParseIsATag() {
        Clause cl = parseLine("is_a: x ! foo");
        assertEquals(OboFormatTag.TAG_IS_A.getTag(), cl.getTag());
        assertEquals("x", cl.getValue());
    }
View Full Code Here

        // 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

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

    @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

        return oboDoc;
    }

    private static void addPropertyValue(@Nonnull Frame frame, String v1,
            String v2, @Nullable String v3) {
        Clause cl = new Clause(OboFormatTag.TAG_PROPERTY_VALUE);
        cl.addValue(v1);
        cl.addValue(v2);
        if (v3 != null) {
            cl.addValue(v3);
        }
        frame.addClause(cl);
    }
View Full Code Here

            }
        }
        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

        assert frame != null;
        hasQualifierClause(frame, OboFormatTag.TAG_IS_METADATA_TAG);
    }

    void hasQualifierClause(@Nonnull Frame frame, @Nonnull OboFormatTag tag) {
        Clause clause = frame.getClause(tag);
        assertNotNull("Expected a clause " + tag.getTag() + " in frame: "
                + frame, clause);
        hasQualifier(clause);
    }
View Full Code Here

    @Test
    public void testIDs() throws OWLOntologyCreationException {
        OBODoc doc = new OBODoc();
        Frame header = new Frame(FrameType.HEADER);
        Clause c = new Clause(OboFormatTag.TAG_ONTOLOGY.getTag());
        c.setValue("test");
        header.addClause(c);
        doc.setHeaderFrame(header);
        OWLAPIObo2Owl obo2owl = new OWLAPIObo2Owl(
                OWLManager.createOWLOntologyManager());
        OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(
View Full Code Here

    @Test
    public void writeCurlyBracesInComments() throws Exception {
        OBODoc doc = new OBODoc();
        Frame h = new Frame(FrameType.HEADER);
        h.addClause(new Clause(OboFormatTag.TAG_ONTOLOGY, "test"));
        doc.setHeaderFrame(h);
        Frame t = new Frame(FrameType.TERM);
        String id = "TEST:0001";
        t.setId(id);
        t.addClause(new Clause(OboFormatTag.TAG_ID, id));
        String comment = "Comment with a '{' curly braces '}'";
        t.addClause(new Clause(OboFormatTag.TAG_COMMENT, comment));
        doc.addFrame(t);
        String oboString = renderOboToString(doc);
        assertTrue(oboString
                .contains("comment: Comment with a '\\{' curly braces '}'"));
        OBODoc doc2 = parseOboToString(oboString);
View Full Code Here

TOP

Related Classes of org.obolibrary.oboformat.model.Clause

Copyright © 2018 www.massapicom. 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.