Package org.obolibrary.oboformat.writer

Examples of org.obolibrary.oboformat.writer.OBOFormatWriter$XrefComparator


                OWLManager.createOWLOntologyManager());
        OBODoc d2 = revbridge.convert(owlOnt);
        Frame f = d2.getTermFrame("UBERON:0000020");
        Clause rc = f.getClause(OboFormatTag.TAG_NAME);
        assertEquals("sense organ", rc.getValue());
        OBOFormatWriter w = new OBOFormatWriter();
        w.setCheckStructure(true);
        w.write(d2, "/tmp/z.obo");
    }
View Full Code Here


    }

    @Nonnull
    protected String writeOBO(@Nonnull OBODoc obodoc) throws IOException {
        StringWriter target = new StringWriter();
        OBOFormatWriter oboWriter = new OBOFormatWriter();
        BufferedWriter bw = new BufferedWriter(target);
        oboWriter.setCheckStructure(true);
        oboWriter.write(obodoc, bw);
        bw.flush();
        return target.toString();
    }
View Full Code Here

    }

    @Nonnull
    protected static String renderOboToString(@Nonnull OBODoc oboDoc)
            throws IOException {
        OBOFormatWriter writer = new OBOFormatWriter();
        StringWriter out = new StringWriter();
        BufferedWriter stream = new BufferedWriter(out);
        writer.setCheckStructure(true);
        writer.write(oboDoc, stream);
        stream.close();
        return out.getBuffer().toString();
    }
View Full Code Here

        reader.close();
        return parsedOboDoc;
    }

    protected static void renderOBO(@Nonnull OBODoc oboDoc) throws IOException {
        OBOFormatWriter writer = new OBOFormatWriter();
        writer.setCheckStructure(true);
        BufferedWriter stream = new BufferedWriter(new StringWriter());
        writer.setCheckStructure(true);
        writer.write(oboDoc, stream);
        stream.close();
    }
View Full Code Here

        Frame frame = obo.getTermFrame("GO:0009579");
        assertNotNull(frame);
        // write frame
        StringWriter stringWriter = new StringWriter();
        BufferedWriter bufferedWriter = new BufferedWriter(stringWriter);
        OBOFormatWriter oboWriter = new OBOFormatWriter();
        oboWriter.write(frame, bufferedWriter, null);
        bufferedWriter.flush();
        // get written frame
        String line = stringWriter.getBuffer().toString();
        // check that written frame has line:
        // synonym: "photosynthetic membrane" RELATED []
View Full Code Here

        OWLAPIOwl2Obo owl2obo = new OWLAPIOwl2Obo(
                OWLManager.createOWLOntologyManager());
        OBODoc obodoc = owl2obo.convert(ontology);
        checkOBODoc(obodoc);
        // ROUNDTRIP AND TEST AGAIN
        OBOFormatWriter w = new OBOFormatWriter();
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8");
        BufferedWriter bw = new BufferedWriter(osw);
        w.setCheckStructure(true);
        w.write(obodoc, bw);
        bw.close();
        OBOFormatParser p = new OBOFormatParser();
        obodoc = p.parse(new BufferedReader(new InputStreamReader(
                new ByteArrayInputStream(os.toByteArray()))));
        checkOBODoc(obodoc);
View Full Code Here

                    }
                };
            } else {
                nameProvider = new OBODocNameProvider(result);
            }
            OBOFormatWriter oboFormatWriter = new OBOFormatWriter();
            oboFormatWriter.setCheckStructure((Boolean) format.getParameter(
                    OBODocumentFormat.VALIDATION, Boolean.TRUE));
            oboFormatWriter.write(result, new BufferedWriter(writer),
                    nameProvider);
        } catch (IOException e) {
            throw new OWLOntologyStorageException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.obolibrary.oboformat.writer.OBOFormatWriter$XrefComparator

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.