Package org.semanticweb.owlapi.io

Examples of org.semanticweb.owlapi.io.OWLParserException


            return format;
        } catch (ParserConfigurationException e) {
            throw new OWLRuntimeException(e);
        } catch (SAXException e) {
            // General exception
            throw new OWLParserException(e);
        } finally {
            if (isrc != null && isrc.getByteStream() != null) {
                isrc.getByteStream().close();
            } else if (isrc != null && isrc.getCharacterStream() != null) {
                isrc.getCharacterStream().close();
View Full Code Here


                }
                iriMap.put(iriStr, iri);
            }
            return iri;
        } catch (URISyntaxException e) {
            throw new OWLParserException(e, getLineNumber(), getColumnNumber());
        }
    }
View Full Code Here

            } catch (OWLParserException e) {
                // Record this attempts and continue trying to parse.
                exceptions.put(parser, e);
            } catch (RuntimeException e) {
                // Clean up and rethrow
                exceptions.put(parser, new OWLParserException(e));
                manager.removeOntology(ont);
                throw e;
            }
        }
        if (existingOntology == null) {
View Full Code Here

            }
            Token currentToken = e.currentToken;
            if (currentToken != null) {
                int beginLine = currentToken.beginLine;
                int beginColumn = currentToken.beginColumn;
                throw new OWLParserException(e, beginLine, beginColumn);
            } else {
                throw new OWLParserException(e);
            }
        } catch (TokenMgrError e) {
            throw new OWLParserException(e);
        } finally {
            if (is != null) {
                is.close();
            } else if (reader != null) {
                reader.close();
View Full Code Here

                    ++column;
                buffer[bufpos] = c = (char) (hexval(c) << 12
                        | hexval(ReadByte()) << 8 | hexval(ReadByte()) << 4 | hexval(ReadByte()));
                column += 4;
            } catch (java.io.IOException e) {
                throw new OWLParserException(
                        "Invalid escape character at line " + line + " column "
                                + column + ".");
            }
            if (backSlashCnt == 1)
                return c;
View Full Code Here

    public OWLDocumentFormat parse(IRI documentIRI,
            @Nonnull OWLOntology ontology) throws IOException {
        try {
            parse(documentIRI, null, ontology);
        } catch (OBOFormatParserException e) {
            throw new OWLParserException(e);
        } catch (OWLOntologyCreationException e) {
            throw new OWLParserException(e);
        }
        return new OBODocumentFormat();
    }
View Full Code Here

            OWLOntologyLoaderConfiguration configuration) throws IOException {
        // XXX configuration is not used
        try {
            parse(null, documentSource, ontology);
        } catch (OBOFormatParserException e) {
            throw new OWLParserException(e);
        } catch (OWLOntologyCreationException e) {
            throw new OWLParserException(e);
        }
        return new OBODocumentFormat();
    }
View Full Code Here

        parser.setHandler(new OBOConsumer(getOWLOntologyManager(), ontology));
        try {
            parser.parse();
        }
        catch (ParseException e) {
            throw new OWLParserException(e, e.currentToken.beginLine, e.currentToken.beginColumn);
        }
        catch(TokenMgrError e) {
            throw new OWLParserException(e);
        }
        return new OBOOntologyFormat();
    }
View Full Code Here

            }
            parser.setUp(getOWLOntologyManager(), ontology);
            return parser.parse();
        }
        catch (ParseException e) {
            throw new OWLParserException(e.getMessage(), e.currentToken.beginLine, e.currentToken.beginColumn);
        }
    }
View Full Code Here

          }
            Token currentToken = e.currentToken;
            if (currentToken != null) {
                int beginLine = currentToken.beginLine;
                int beginColumn = currentToken.beginColumn;
                throw new OWLParserException(e, beginLine, beginColumn);
            }
            else {
                throw new OWLParserException(e);
            }
        }
        catch(TokenMgrError e) {
            throw new OWLParserException(e);
    } finally {
      if (is != null) {
        is.close();
      } else if (reader != null) {
        reader.close();
View Full Code Here

TOP

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

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.