Package org.semanticweb.owlapi.io

Examples of org.semanticweb.owlapi.io.OWLParserException


     */
    @Nonnull
    public IRI oboIdToIRI(@Nonnull String id) {
        if (id.contains(" ")) {
            LOG.error("id contains space: \"{}\"", id);
            throw new OWLParserException("spaces not allowed: '" + id + '\'');
        }
        // No conversion is required if this is already an IRI (ID-as-URI rule)
        if (id.startsWith("http:")) {
            // TODO - roundtrip from other schemes
            return IRI.create(id);
View Full Code Here


                        new InputStreamReader(is, "UTF-8")));
            }
            parser.setUp(ontology, configuration);
            return parser.parse();
        } catch (ParseException e) {
            throw new OWLParserException(e.getMessage(), e, 0, 0);
        } catch (TokenMgrError e) {
            throw new OWLParserException(e);
        } finally {
            if (is != null) {
                is.close();
            }
            if (reader != null) {
View Full Code Here

            } else {
                parseDocumentSource(documentSource, baseUri, handler);
            }
            return consumer.getOntologyFormat();
        } catch (final RDFParseException e) {
            throw new OWLParserException(e);
        } catch (final RDFHandlerException e) {
            // See sourceforge bug 3566820 for more information about this
            // branch
            if (e.getCause() != null
                    && e.getCause().getCause() != null
                    && e.getCause().getCause() instanceof UnloadableImportException) {
                throw (UnloadableImportException) e.getCause().getCause();
            } else {
                throw new OWLParserException(e);
            }
        } catch (final UnsupportedRDFormatException e) {
            throw new OWLParserException(e);
        } catch (final MalformedURLException e) {
            throw new OWLParserException(e);
        }
    }
View Full Code Here

        public void startRDF() {
            owlParseStart = System.currentTimeMillis();
            try {
                consumer.startRDF();
            } catch (RDFHandlerException e) {
                throw new OWLParserException(e);
            }
        }
View Full Code Here

                if (LOG.isDebugEnabled()) {
                    LOG.debug("owlParse: timing={}", System.currentTimeMillis()
                            - owlParseStart);
                }
            } catch (RDFHandlerException e) {
                throw new OWLParserException(e);
            }
        }
View Full Code Here

        @Override
        public void handleNamespace(String prefix, String uri) {
            try {
                consumer.handleNamespace(prefix, uri);
            } catch (RDFHandlerException e) {
                throw new OWLParserException(e);
            }
        }
View Full Code Here

                    typedLists.add(nextStatement.getSubject());
                    try {
                        consumer.handleStatement(vf.createStatement(
                                nextStatement.getSubject(), RDF.TYPE, RDF.LIST));
                    } catch (RDFHandlerException e) {
                        throw new OWLParserException(e);
                    }
                    LOG.debug("Implicitly typing list={}", nextStatement);
                }
            } else if (nextStatement.getPredicate().equals(RDF.TYPE)
                    && nextStatement.getObject().equals(RDF.LIST)) {
                if (!typedLists.contains(nextStatement.getSubject())) {
                    LOG.debug("Explicit list type found={}", nextStatement);
                    typedLists.add(nextStatement.getSubject());
                } else {
                    LOG.debug(
                            "duplicate rdf:type rdf:List statements found={}",
                            nextStatement);
                }
            }
            try {
                consumer.handleStatement(nextStatement);
            } catch (RDFHandlerException e) {
                throw new OWLParserException(e);
            }
        }
View Full Code Here

        int seenUpto;
        input_stream.backup(seenUpto = curPos + 1);
        try {
            curChar = input_stream.readChar();
        } catch (java.io.IOException e) {
            throw new OWLParserException("Internal Error", e);
        }
        curPos = 0;
        int startsAt = 0;
        jjnewStateCnt = 51;
        int i = 1;
View Full Code Here

    private final int[] jjstateSet = new int[102];
    protected char curChar;

    KRSS2ParserTokenManager(JavaCharStream stream) {
        if (JavaCharStream.staticFlag) {
            throw new OWLParserException(
                    "ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
        }
        input_stream = stream;
    }
View Full Code Here

            }
            Set<OWLAxiom> set = parser.parseAxioms();
            ontology.getOWLOntologyManager().addAxioms(ontology, set);
            return new DLSyntaxHTMLDocumentFormat();
        } catch (ParseException e) {
            throw new OWLParserException(e.getMessage(), e,
                    e.currentToken.beginLine, e.currentToken.beginColumn);
        } finally {
            if (is != null) {
                is.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.