Search code examples
javardfjena

Exception when I want to load model with jena


I am working with jena library. When I want to open this address:

model = FileManager.get().loadModel("http://dbpedia.org/resource/Shlomo_Breznitz");

I got this exception:

http://dbpedia.org/resource/Shlomo_Breznitz(line 54 column 8): Element or attribute do not match QName production: QName::=(NCName':')?NCName.

It is a bug of jena, because this exception occurs just here (other rdf which I try to read are OK) or is there something wrong with this rdf file?


Solution

  • This means that the data being returned from DBPedia is malformed (which is unfortunately quite common) - putting the URL into the W3C RDF/XML Validator also shows this error

    The only workaround currently is to download the file and manually fix the error yourself prior to parsing it with Jena