Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLRuntimeException


        return false;
    }

    @Override
    public IRI getDocumentIRI() {
        throw new OWLRuntimeException(
                "IRI not available.  getDocumentIRI() should not be called if isDocumentIRIAvailable() returns false.");
    }
View Full Code Here


    public static OWLOntology Ontology(@Nonnull OWLOntologyManager man,
            @Nonnull OWLAxiom... axioms) {
        try {
            return man.createOntology(CollectionFactory.createSet(axioms));
        } catch (OWLOntologyCreationException e) {
            throw new OWLRuntimeException(e);
        }
    }
View Full Code Here

    public OutputStream getOutputStream() {
        if (zippedStream == null) {
            try {
                zippedStream = new GZIPOutputStream(outputStream);
            } catch (FileNotFoundException e) {
                throw new OWLRuntimeException(e);
            } catch (IOException e) {
                throw new OWLRuntimeException(e);
            }
        }
        return verifyNotNull(zippedStream);
    }
View Full Code Here

        }
        currentPos += s.length();
        try {
            writer.write(s);
        } catch (IOException e) {
            throw new OWLRuntimeException(e);
        }
    }
View Full Code Here

                InputStream is = OWLOntologyDocumentSourceBase.wrap(delegate);) {
            currentFile = file;
            SAXParser parser = SAXParsers.initFactory().newSAXParser();
            parser.parse(is, this);
        } catch (ParserConfigurationException e) {
            throw new OWLRuntimeException(e);
        } catch (Exception e) {
            // if we can't parse a file, then we can't map it
        }
    }
View Full Code Here

                    } else {
                        throw new NoSuchElementException(
                                "No more statements in this iterator");
                    }
                } catch (OpenRDFException e) {
                    throw new OWLRuntimeException(
                            "Found exception while iterating", e);
                } finally {
                    if (nextStatement == null) {
                        try {
                            statements.close();
                        } catch (OpenRDFException e) {
                            throw new OWLRuntimeException(e);
                        }
                    }
                }
            }

            @Override
            public boolean hasNext() {
                boolean result = false;
                try {
                    result = statements.hasNext();
                    return result;
                } catch (OpenRDFException e) {
                    throw new OWLRuntimeException(
                            "Found exception while iterating", e);
                } finally {
                    if (!result) {
                        try {
                            statements.close();
                        } catch (OpenRDFException e) {
                            throw new OWLRuntimeException(e);
                        }
                    }
                }
            }
        };
View Full Code Here

     *         if an exception is raised during render
     */
    protected void render(@Nonnull OWLOntologyDocumentSource source)
            throws IOException {
        if (ontologyManagerFactories.isEmpty()) {
            throw new OWLRuntimeException(
                    "No ontology manager factories available, parsing is impossible");
        }
        // it is expected that only one implementation of
        // OWLOntologyManagerFactory will be available, but if there is more
        // than one, no harm done
        try {
            for (OWLOntologyManagerFactory f : ontologyManagerFactories) {
                OWLOntology ontology = f.get()
                        .loadOntologyFromOntologyDocument(source);
                new RioRenderer(ontology, getRDFHandler(), getRDFFormat()
                        .getOWLFormat()).render();
                return;
            }
        } catch (OWLOntologyCreationException e) {
            throw new OWLRuntimeException(e);
        }
    }
View Full Code Here

    /** @return current axiom from walker */
    @Nonnull
    public OWLAxiom getCurrentAxiom() {
        OWLAxiom axiom = walker.getAxiom();
        if (axiom == null) {
            throw new OWLRuntimeException(
                    "No current axiom; is the walker being used outside of an ontology visit?");
        }
        return axiom;
    }
View Full Code Here

    /** @return current ontology from walker */
    @Nonnull
    public OWLOntology getCurrentOntology() {
        OWLOntology ontology = walker.getOntology();
        if (ontology == null) {
            throw new OWLRuntimeException(
                    "No current ontology; is the walker being used outside of an ontology visit?");
        }
        return ontology;
    }
View Full Code Here

            factory.setFeature(
                    "http://apache.org/xml/features/nonvalidating/load-external-dtd",
                    false);
            factory.setFeature("http://xml.org/sax/features/validation", false);
        } catch (Exception e) {
            throw new OWLRuntimeException(e);
        }
        factory.setNamespaceAware(true);
        return factory;
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLRuntimeException

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.