Hello,
I have a problem when I want to load the Turtle file
http://dbpedia.semanticmultimedia.org/dbpedia2015/en/pagerank_scores_en_2015.ttl.bz2
with Jena 3.0.0 with this simple piece of code:
import org.apache.jena.tdb.TDBFactory;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.util.FileManager;
import org.apache.jena.query.Dataset;
public class Test {
public static void main(String[] args) {
Dataset dataset = TDBFactory.createDataset("storage");
Model tdb = dataset.getDefaultModel();
FileManager.get().readModel(tdb, "pagerank_scores_en_2015.ttl");
tdb.close();
dataset.close();
}
}
I build an executable jar with Maven and run it with the command line:
java -jar test.jar
And I get the following exception:
log4j:WARN No appenders could be found for logger (org.apache.jena.info).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info.
Exception in thread "main" org.apache.jena.riot.RiotException: [line: 7146,
col: 32] Illegal character in IRI (codepoint 0x22, '"'): <
http://dbpedia.org/resource/7["]...>
at
org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:136)
at org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:165)
at org.apache.jena.riot.lang.LangEngine.nextToken(LangEngine.java:108)
at org.apache.jena.riot.lang.LangEngine.expect(LangEngine.java:145)
at org.apache.jena.riot.lang.LangEngine.expectOrEOF(LangEngine.java:130)
at
org.apache.jena.riot.lang.LangTurtleBase.expectEndOfTriplesTurtle(LangTurtleBase.java:264)
at
org.apache.jena.riot.lang.LangTurtle.expectEndOfTriples(LangTurtle.java:51)
at org.apache.jena.riot.lang.LangTurtleBase.triples(LangTurtleBase.java:250)
at
org.apache.jena.riot.lang.LangTurtleBase.triplesSameSubject(LangTurtleBase.java:190)
at
org.apache.jena.riot.lang.LangTurtle.oneTopLevelElement(LangTurtle.java:46)
at
org.apache.jena.riot.lang.LangTurtleBase.runParser(LangTurtleBase.java:89)
at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
at
org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:175)
at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:905)
at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:686)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:209)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:142)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:131)
at
org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:282)
at org.apache.jena.util.FileManager.readModel(FileManager.java:341)
at org.apache.jena.util.FileManager.readModel(FileManager.java:325)
at Test.main(Test.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
The triple that make happen this exception is:
<http://dbpedia.org/resource/7"_single> <
http://dbpedia.org/ontology/wikiPageRank> "7.67739403130115E-6"^^<
http://www.w3.org/2001/XMLSchema#float> .
But if I load the same file with Virtuoso or Sesame I have no problem and
all the triples are correctly loaded.
There is a specific way how to solve this?
Thanks in advance.
--
Julien Plu
PhD Student at Eurecom.
Personal webpage: http://jplu.developpez.com
FOAF file : http://jplu.developpez.com/julien
Email address : [email protected] && *[email protected]
<[email protected]>*
Phone : +33493008103
Twitter : @julienplu