2017-10-17 82 views
0

我有一個龜文件,位於here。我使用this toolhttp://ttl.summerofcode.be/)驗證了它,並且它說烏龜文件是有效的。然而,隨着RDFDataMgr.loadModel("https://raw.githubusercontent.com/noorbakerally/ISWC2017Demo/master/ParisGeo.ttl");加載使用耶拿當我收到以下錯誤,Jena Riot加載有效的烏龜文件時出現異常

Exception in thread "main" org.apache.jena.riot.RiotException: [line: 1, col: 1 ] Expected BNode or IRI: Got: [DIRECTIVE:prefix] 
    at org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:136) 
    at org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:148) 
    at org.apache.jena.riot.lang.LangEngine.exceptionDirect(LangEngine.java:143) 
    at org.apache.jena.riot.lang.LangEngine.exception(LangEngine.java:137) 
    at org.apache.jena.riot.lang.LangNTuple.checkIRIOrBNode(LangNTuple.java:89) 
    at org.apache.jena.riot.lang.LangNTriples.parseOne(LangNTriples.java:74) 
    at org.apache.jena.riot.lang.LangNTriples.runParser(LangNTriples.java:53) 
    at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:41) 
    at org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:194) 
    at org.apache.jena.riot.RDFParser.read(RDFParser.java:293) 
    at org.apache.jena.riot.RDFParser.parseNotUri(RDFParser.java:283) 
    at org.apache.jena.riot.RDFParser.parse(RDFParser.java:233) 
    at org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:405) 
    at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:862) 
    at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:676) 
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:222) 
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:103) 
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:94) 
    at org.apache.jena.riot.RDFDataMgr.loadModel(RDFDataMgr.java:336) 
    at fr.emse.opensensingcity.main.main(main.java:41) 
    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:147) 
+0

你可以嘗試,並指定語言'RDFDataMgr.loadModel(「ParisGeo.ttl 「,Lang.TTL);' – durschtnase

+0

nopes,我試過但它沒有解決問題,我認爲TTL已經是默認的 – Noor

回答