Problem of reading OWL/XML

Posted by Mikae Combarado on Stack Overflow See other posts from Stack Overflow or by Mikae Combarado
Published on 2010-06-12T14:49:23Z Indexed on 2010/06/12 14:52 UTC
Read the original article Hit count: 345

Filed under:
|
|
|

Hello, I have a problem reading OWL/XML files from Java using Jena.

I have no problem reading RDF/XML files, but whenever I create a OWL/XML file from Protege and try to read it, Java gives this error below : WARN [main] (RDFDefaultErrorHandler.java:36) Exception in thread "main" java.lang.NullPointerException at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.endElement(XMLHandler.java:143)

The code that I use to retrieve RDF/XML is below :

OntModel ontModel = ModelFactory.createOntologyModel();
InputStream in = FileManager.get().open(inputFileName);
    if (in == null) {
        throw new IllegalArgumentException( "File: " + inputFileName + " not found");
    }
    ontModel.read(in, "");

This code works with RDF/XML perfectly. However, I cannot read an OWL/XML. I looked at Internet and I couldn't find anything. I would really appreciate, if someone shows me a way. Many thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about Xml