You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Gunaratna, Dalkandura Arachchige Kalpa Shashika Silva" <gu...@wright.edu> on 2012/04/17 08:36:06 UTC

rdf file processing error using Jena

Hi,
   I got the following error when I was processing a rdf file in DBpedia. The URL is http://dbpedia.org/resource/California for the resource. I use Jena package and OntModel by creating ModelFactory.createOntologyModel(OntModelSpec.RDFS_MEM). I do not understand why I get the following error because the rdf file is incorrect or something wrong with the jena processing of the rdf file. I read every statement in the rdf file and then extract property names and object values in the rdf file. Following is the error I get and if anybody could reply with a possible cause would be great.

ERROR [main] (RDFDefaultErrorHandler.java:44) - http://dbpedia.org/resource/California(line 25564 column 8): Element or attribute do not match QName production: QName::=(NCName':')?NCName.
Error in reading model at URI:http://dbpedia.org/resource/California
com.hp.hpl.jena.shared.JenaException: org.xml.sax.SAXParseException; systemId: http://dbpedia.org/resource/California; lineNumber: 25564; columnNumber: 8; Element or attribute do not match QName production: QName::=(NCName':')?NCName.
    at com.hp.hpl.jena.rdf.model.impl.RDFDefaultErrorHandler.fatalError(RDFDefaultErrorHandler.java:45)
    at com.hp.hpl.jena.rdf.arp.impl.ARPSaxErrorHandler.fatalError(ARPSaxErrorHandler.java:35)
    at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.warning(XMLHandler.java:225)
    at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.fatalError(XMLHandler.java:255)
    at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLEntityScanner.scanQName(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:107)
    at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:158)
    at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:145)
    at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:215)
    at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:84)
    at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:187)
    at com.hp.hpl.jena.ontology.impl.OntModelImpl.readDelegate(OntModelImpl.java:3022)
    at com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2098)
    at com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2022)

Re: rdf file processing error using Jena

Posted by Andy Seaborne <an...@apache.org>.
On 17/04/12 07:36, Gunaratna, Dalkandura Arachchige Kalpa Shashika Silva 
wrote:
> (line  25564 column 8)

Check the RDF/XML returned from this resource at or near that line/col. 
It's an illegal qname (no local name - empty local names are not legal 
in XML).  The server returned bad XML.  You may need to download it 
yourself, fix it up and read the fixed file.

	Andy