Package org.obolibrary.oboformat.model

Examples of org.obolibrary.oboformat.model.Clause


        Frame tf = obodoc.getTypedefFrame("regulates");
        assert tf != null;
        assertEquals(3, tf.getClauses().size());
        assertEquals("regulates", tf.getTagValue(OboFormatTag.TAG_ID));
        assertEquals("regulates", tf.getTagValue(OboFormatTag.TAG_NAME));
        Clause clause = tf.getClause(OboFormatTag.TAG_TRANSITIVE_OVER);
        assert clause != null;
        assertEquals(1, clause.getValues().size());
        assertEquals("part_of", clause.getValue());
        assertTrue(clause.getQualifierValues().isEmpty());
    }
View Full Code Here


        oboDocSource.addDefaultOntologyHeader("caro");
        // add source frame that contains at least one new line
        Frame sourceFrame = new Frame(FrameType.TERM);
        sourceFrame.setId("CARO:0000049");
        sourceFrame
                .addClause(new Clause(
                        OboFormatTag.TAG_DEF,
                        "Sequential hermaphroditic organism that produces\ngametes first of the male sex, and then later of the\nfemale sex."));
        oboDocSource.addTermFrame(sourceFrame);
        // convert to OWL and retrieve def
        OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(
View Full Code Here

        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());
View Full Code Here

    @Nonnull
    private static List<Clause> createSynonymClauses(@Nonnull String... labels) {
        List<Clause> clauses = new ArrayList<>(labels.length);
        for (String label : labels) {
            Clause clause = new Clause(OboFormatTag.TAG_SYNONYM, label);
            clauses.add(clause);
        }
        return clauses;
    }
View Full Code Here

                writeObsolete(Boolean.TRUE.toString()));
    }

    @Nonnull
    private static String writeObsolete(Object value) throws Exception {
        Clause cl = new Clause(OboFormatTag.TAG_IS_OBSELETE);
        cl.addValue(value);
        StringWriter out = new StringWriter();
        BufferedWriter bufferedWriter = new BufferedWriter(out);
        OBOFormatWriter.write(cl, bufferedWriter, null);
        bufferedWriter.close();
        return out.toString().trim();
View Full Code Here

        assertEquals("foo", frame.getTagValue(OboFormatTag.TAG_NAME));
    }

    @Test
    public void testParseDefTag() {
        Clause cl = parseLine("def: \"a b c\" [foo:1, bar:2]");
        assertEquals(OboFormatTag.TAG_DEF.getTag(), cl.getTag());
        assertEquals("a b c", cl.getValue());
        assertEquals(1, cl.getValues().size());
    }
View Full Code Here

        assertEquals(1, cl.getValues().size());
    }

    @Test
    public void testParseDefTag2() {
        Clause cl = parseLine("def: \"a b c\" [foo:1 \"blah blah\", bar:2]");
        assertEquals(OboFormatTag.TAG_DEF.getTag(), cl.getTag());
        assertEquals("a b c", cl.getValue());
    }
View Full Code Here

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

    @Test
    public void testParseCreationDateTag() {
        Clause cl = parseLine("creation_date: 2009-04-28T10:29:37Z");
        assertEquals(OboFormatTag.TAG_CREATION_DATE.getTag(), cl.getTag());
    }
View Full Code Here

        assertEquals(OboFormatTag.TAG_CREATION_DATE.getTag(), cl.getTag());
    }

    @Test
    public void testParseNameTag() {
        Clause cl = parseLine("name: a b c");
        assertEquals(cl.getTag(), OboFormatTag.TAG_NAME.getTag());
        assertEquals("a b c", cl.getValue());
    }
View Full Code Here

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

    @Test
    public void testParseNameTag2() {
        Clause cl = parseLine("name:    a b c");
        assertEquals(OboFormatTag.TAG_NAME.getTag(), cl.getTag());
        assertEquals("a b c", cl.getValue());
    }
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.