Package org.semanticweb.owlapi.io

Examples of org.semanticweb.owlapi.io.StreamDocumentSource


    }

    @Override
    public void parse(InputStream in, String baseURI) throws IOException {
        OWLDocumentFormat nextFormat = getRDFFormat().getOWLFormat();
        StreamDocumentSource source = new StreamDocumentSource(checkNotNull(in,
                "in cannot be null"), IRI.create(checkNotNull(baseURI,
                "baseURI cannot be null")), nextFormat, getRDFFormat()
                .getDefaultMIMEType());
        render(source);
    }
View Full Code Here


    @Override
    public OWLOntology
            loadOntologyFromOntologyDocument(InputStream inputStream)
                    throws OWLOntologyCreationException {
        return loadOntologyFromOntologyDocument(new StreamDocumentSource(
                inputStream));
    }
View Full Code Here

                .setStrict(false);
        @SuppressWarnings("resource")
        InputStream in = getClass().getResourceAsStream(CIDOC_FILE);
        assertNotNull("can't find CIDOC_FILE", in);
        cidocOntology = manager.loadOntologyFromOntologyDocument(
                new StreamDocumentSource(in), config);
        assertNotNull(cidocOntology);
        OWLDocumentFormat format = manager.getOntologyFormat(cidocOntology);
        assertNotNull(format);
        assertTrue(format.isPrefixOWLOntologyFormat());
        prefixOWLOntologyFormat = format.asPrefixOWLOntologyFormat();
View Full Code Here

                + "</rdf:RDF>";
        ByteArrayInputStream in = new ByteArrayInputStream(
                onto.getBytes(Charset.forName("ISO-8859-1")));
        OWLXMLParser parser = new OWLXMLParser();
        try {
            parser.parse(new StreamDocumentSource(in), m.createOntology(),
                    config);
            fail("parsing should have failed, invalid input");
        } catch (Exception ex) {
            // expected to fail, but actual exception depends on the parsers in
            // the classpath
View Full Code Here

        initialParser.parse(initialDocumentSource, initialOntology, config);
    }

    @Nonnull
    private OWLOntologyDocumentSource getDocumentSource() {
        return new StreamDocumentSource(getClass().getResourceAsStream(
                "/owlapi/multipleOntologyLoadsTest.rdf"));
    }
View Full Code Here

        }
    }

    @Nonnull
    private OWLOntologyDocumentSource getDocument() {
        return new StreamDocumentSource(getClass().getResourceAsStream(
                "/owlapi/multipleOntologyLoadsTest.rdf"));
    }
View Full Code Here

    @Test
    public void shouldParse() throws OWLOntologyCreationException {
        OWLOntologyManager m = OWLManager.createOWLOntologyManager();
        assertEquals(19, m.getOntologyParsers().size());
        @SuppressWarnings("null")
        OWLOntologyDocumentSource source = new StreamDocumentSource(getClass()
                .getResourceAsStream("/celltype.obo"),
                OWLOntologyDocumentSourceBase.getNextDocumentIRI("obo"),
                new OBO12DocumentFormat(), null);
        m.loadOntologyFromOntologyDocument(source);
    }
View Full Code Here

    @Test
    public void shouldParseOBO12() throws OWLOntologyCreationException {
        OWLOntologyManager m = OWLManager.createOWLOntologyManager();
        assertEquals(19, m.getOntologyParsers().size());
        @SuppressWarnings("null")
        OWLOntologyDocumentSource source = new StreamDocumentSource(getClass()
                .getResourceAsStream("/behavior.obo"),
                OWLOntologyDocumentSourceBase.getNextDocumentIRI("obo"),
                new OBO12DocumentFormat(), null);
        m.loadOntologyFromOntologyDocument(source);
    }
View Full Code Here

    @SuppressWarnings("null")
    @Test
    public void shouldParseGenericOBO() throws OWLOntologyCreationException {
        OWLOntologyManager m = OWLManager.createOWLOntologyManager();
        assertEquals(19, m.getOntologyParsers().size());
        OWLOntologyDocumentSource source = new StreamDocumentSource(getClass()
                .getResourceAsStream("/behavior.obo"));
        m.loadOntologyFromOntologyDocument(source);
    }
View Full Code Here

    /**
     * @return stream
     */
    @Nonnull
    StreamDocumentSource getStream(String name) {
        return new StreamDocumentSource(getClass().getResourceAsStream(name));
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.io.StreamDocumentSource

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.