Examples of OBOFormatWriter


Examples of org.obolibrary.oboformat.writer.OBOFormatWriter

                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

Examples of org.obolibrary.oboformat.writer.OBOFormatWriter

    }

    @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

Examples of org.obolibrary.oboformat.writer.OBOFormatWriter

    }

    @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

Examples of org.obolibrary.oboformat.writer.OBOFormatWriter

        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

Examples of org.obolibrary.oboformat.writer.OBOFormatWriter

        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

Examples of org.obolibrary.oboformat.writer.OBOFormatWriter

        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

Examples of org.obolibrary.oboformat.writer.OBOFormatWriter

                    }
                };
            } 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
Copyright © 2018 www.massapi.com. 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.