Package org.obolibrary.oboformat.model

Examples of org.obolibrary.oboformat.model.Frame


public class DbXrefCommentsTest extends OboFormatTestBasics {

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


    public void write(@Nonnull OBODoc doc, @Nonnull BufferedWriter writer,
            NameProvider nameProvider) throws IOException {
        if (isCheckStructure) {
            doc.check();
        }
        Frame headerFrame = doc.getHeaderFrame();
        writeHeader(headerFrame, writer, nameProvider);
        List<Frame> termFrames = new ArrayList<>();
        termFrames.addAll(doc.getTermFrames());
        Collections.sort(termFrames, FramesComparator.INSTANCE);
        List<Frame> typeDefFrames = new ArrayList<>();
View Full Code Here

        for (Frame f : fl2) {
            fm2.put(f.getId(), f);
        }
        for (Frame f1 : fl1) {
            if (fm2.containsKey(f1.getId())) {
                Frame f2 = fm2.get(f1.getId());
                if (isCheckFrame) {
                    // we only need to do this once
                    diffs.addAll(getDiffs(ftype, f1, f2));
                }
            } else {
View Full Code Here

         * @param oboDoc
         *        the obo doc
         */
        public OBODocNameProvider(@Nonnull OBODoc oboDoc) {
            this.oboDoc = oboDoc;
            Frame headerFrame = oboDoc.getHeaderFrame();
            if (headerFrame != null) {
                defaultOboNamespace = headerFrame.getTagValue(
                        OboFormatTag.TAG_DEFAULT_NAMESPACE, String.class);
            } else {
                defaultOboNamespace = null;
            }
        }
View Full Code Here

        @Nullable
        @Override
        public String getName(String id) {
            String name = null;
            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.Frame

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.