Package org.obolibrary.oboformat.model

Examples of org.obolibrary.oboformat.model.Clause


    }

    private static void checkIdSpace(@Nonnull OBODoc doc) {
        Frame headerFrame = doc.getHeaderFrame();
        assertNotNull(headerFrame);
        Clause clause = headerFrame.getClause(OboFormatTag.TAG_IDSPACE);
        Collection<Object> values = clause.getValues();
        assertNotNull(values);
        assertEquals(3, values.size());
        Iterator<Object> it = values.iterator();
        assertEquals("GO", it.next());
        assertEquals("urn:lsid:bioontology.org:GO:", it.next());
View Full Code Here


        for (OBODoc tdoc : obodoc.getImportedOBODocs()) {
            Frame hf = tdoc.getHeaderFrame();
            if (hf == null) {
                continue;
            }
            Clause impClause = hf.getClause(OboFormatTag.TAG_ONTOLOGY);
            // if (impClause == null) {
            // continue;
            // }
            String tid = impClause.getValue(String.class)
                    .replace("bridge-", "");
            if (tid.equals("zfa")) {
                assertEquals(
                        2,
                        tdoc.getTermFrame("ZFA:0001689")
View Full Code Here

        OBODoc oboDoc = parseOBOFile("annotated_import.obo");
        Frame headerFrame = oboDoc.getHeaderFrame();
        Collection<Clause> imports = headerFrame
                .getClauses(OboFormatTag.TAG_IMPORT);
        assertEquals(1, imports.size());
        Clause clause = imports.iterator().next();
        Collection<QualifierValue> qualifierValues = clause
                .getQualifierValues();
        assertTrue(qualifierValues.isEmpty());
    }
View Full Code Here

    public void testEscapeChars() {
        OBODoc obodoc = parseOBOFile("escape_chars_test.obo");
        assertEquals(3, obodoc.getTermFrames().size());
        Frame f1 = obodoc.getTermFrame("GO:0033942");
        assertEquals("GO:0033942", f1.getId());
        Clause nameClause = f1.getClause(OboFormatTag.TAG_NAME);
        assertEquals(
                "4-alpha-D-{(1->4)-alpha-D-glucano}trehalose trehalohydrolase activity",
                nameClause.getValue());
        Frame f2 = obodoc.getTermFrame("CL:0000096");
        assertEquals("CL:0000096", f2.getId());
        Clause defClause = f2.getClause(OboFormatTag.TAG_DEF);
        assertEquals("bla bla .\"", defClause.getValue());
        Clause commentClause = f2.getClause(OboFormatTag.TAG_COMMENT);
        assertEquals("bla bla bla.\nbla bla (bla).", commentClause.getValue());
    }
View Full Code Here

    @Test
    public void testDbXrefCommentsRoundtrip() throws Exception {
        OBODoc obodoc = parseOBOFile("db_xref_comments.obo");
        Frame frame = obodoc.getTermFrame("MOD:00516");
        assertNotNull(frame);
        Clause defClause = frame.getClause(OboFormatTag.TAG_DEF);
        assertNotNull(defClause);
        Collection<Xref> xrefs = defClause.getXrefs();
        assertEquals(2, xrefs.size());
        Iterator<Xref> iterator = xrefs.iterator();
        Xref xref1 = iterator.next();
        assertEquals("RESID:AA0151", xref1.getIdref());
        String annotation = xref1.getAnnotation();
View Full Code Here

        Frame cc = obodoc.getTermFrame("CARO:0000014");
        assert cc != null;
        assertEquals("cell component", cc.getTagValue(OboFormatTag.TAG_NAME));
        assertEquals("Anatomical structure that is a direct part of the cell.",
                cc.getTagValue(OboFormatTag.TAG_DEF));
        Clause dc = cc.getClause(OboFormatTag.TAG_DEF);
        assert dc != null;
        Collection<Xref> dcxs = dc.getXrefs();
        assertEquals("CARO:MAH", dcxs.iterator().next().getIdref());
        /*
         * Collection<Xref> defxrefs = cc.getTagXrefs("def");
         * System.out.println("def xrefs = "+defxrefs);
         * assertTrue(defxrefs.iterator().next().getIdref().equals("CARO:MAH"));
 
View Full Code Here

    public void writeHeader(@Nonnull Frame frame,
            @Nonnull BufferedWriter writer, NameProvider nameProvider)
            throws IOException {
        List<String> tags = duplicateTags(frame.getTags());
        Collections.sort(tags, HeaderTagsComparator.INSTANCE);
        write(new Clause(OboFormatTag.TAG_FORMAT_VERSION.getTag(), "1.2"),
                writer, nameProvider);
        for (String tag : tags) {
            if (tag.equals(OboFormatTag.TAG_FORMAT_VERSION.getTag())) {
                continue;
            }
View Full Code Here

            Frame frame = oboDoc.getTermFrame(id);
            if (frame == null) {
                frame = oboDoc.getTypedefFrame(id);
            }
            if (frame != null) {
                Clause cl = frame.getClause(OboFormatTag.TAG_NAME);
                if (cl != null) {
                    name = cl.getValue(String.class);
                }
            }
            return name;
        }
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.