Package org.semanticweb.owlapi.io

Examples of org.semanticweb.owlapi.io.ReaderDocumentSource


    }

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


            }
            InputStream lumifyBaseOntologyIn = ((StreamingPropertyValue) ontologyFile.getValue()).getInputStream();
            try {
                Reader lumifyBaseOntologyReader = new InputStreamReader(lumifyBaseOntologyIn);
                LOGGER.info("Loading existing ontology: %s", ontologyFile.getKey());
                OWLOntologyDocumentSource lumifyBaseOntologySource = new ReaderDocumentSource(lumifyBaseOntologyReader, ontologyFileIRI);
                try {
                    OWLOntology o = m.loadOntologyFromOntologyDocument(lumifyBaseOntologySource, config);
                    loadedOntologies.add(o);
                } catch (UnloadableImportException ex) {
                    LOGGER.error("Could not load %s", ontologyFileIRI, ex);
View Full Code Here

        Reader inFileReader = new InputStreamReader(new ByteArrayInputStream(inFileData));

        OWLOntologyLoaderConfiguration config = new OWLOntologyLoaderConfiguration();
        OWLOntologyManager m = createOwlOntologyManager(config, documentIRI);

        OWLOntologyDocumentSource documentSource = new ReaderDocumentSource(inFileReader, documentIRI);
        OWLOntology o = m.loadOntologyFromOntologyDocument(documentSource, config);

        storeOntologyFile(new ByteArrayInputStream(inFileData), documentIRI);

        long totalStartTime = System.currentTimeMillis();
View Full Code Here

            }
            InputStream lumifyBaseOntologyIn = new ByteArrayInputStream(owlData.data);
            try {
                Reader lumifyBaseOntologyReader = new InputStreamReader(lumifyBaseOntologyIn);
                LOGGER.info("Loading existing ontology: %s", owlData.iri);
                OWLOntologyDocumentSource lumifyBaseOntologySource = new ReaderDocumentSource(lumifyBaseOntologyReader, lumifyBaseOntologyIRI);
                OWLOntology o = m.loadOntologyFromOntologyDocument(lumifyBaseOntologySource, config);
                loadedOntologies.add(o);
            } finally {
                lumifyBaseOntologyIn.close();
            }
View Full Code Here

    @Test
    public void testBOMError32bigReader() throws OWLOntologyCreationException,
            IOException {
        int[] b = new int[] { 0x00, 0x00, 0xFE, 0xFF };
        m1.loadOntologyFromOntologyDocument(new ReaderDocumentSource(
                new InputStreamReader(in(b, input))));
    }
View Full Code Here

    @Test
    public void testBOMError32Reader() throws OWLOntologyCreationException,
            IOException {
        int[] b = new int[] { 0xFF, 0xFE, 0x00, 0x00 };
        m1.loadOntologyFromOntologyDocument(new ReaderDocumentSource(
                new InputStreamReader(in(b, input))));
    }
View Full Code Here

    @Test
    public void testBOMError16Reader() throws OWLOntologyCreationException,
            IOException {
        int[] b = new int[] { 0xFF, 0xFE };
        m1.loadOntologyFromOntologyDocument(new ReaderDocumentSource(
                new InputStreamReader(in(b, input))));
    }
View Full Code Here

    @Test
    public void testBOMError16smallReader()
            throws OWLOntologyCreationException, IOException {
        int[] b = new int[] { 0xFF, 0xFE };
        m1.loadOntologyFromOntologyDocument(new ReaderDocumentSource(
                new InputStreamReader(in(b, input))));
    }
View Full Code Here

    @Test
    public void testBOMError8Reader() throws OWLOntologyCreationException,
            IOException {
        int[] b = new int[] { 0xEF, 0xBB, 0xBF };
        m1.loadOntologyFromOntologyDocument(new ReaderDocumentSource(
                new InputStreamReader(in(b, input))));
    }
View Full Code Here

TOP

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

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.