SimmerChan / KG-demo-for-movie

从无到有构建一个电影知识图谱,并基于该KG,开发一个简易的KBQA程序。
https://zhuanlan.zhihu.com/knowledgegraph
1.28k stars 424 forks source link

Exception in thread "main" java.lang.ExceptionInInitializerError #33

Closed DeepGeGe closed 2 years ago

DeepGeGe commented 2 years ago

大佬,您好,请问在执行.\dump-rdf.bat -o tlkg.nt .\tlkg_mapping.ttl时候出现错误:

Exception in thread "main" java.lang.ExceptionInInitializerError
        at com.ibm.icu.impl.UPropertyAliases.<clinit>(UPropertyAliases.java:87)
        at com.ibm.icu.lang.UCharacter.<clinit>(UCharacter.java:5680)
        at com.hp.hpl.jena.iri.impl.AbsLexer.difficultCodePoint(AbsLexer.java:139)
        at com.hp.hpl.jena.iri.impl.AbsLexer.difficultChar(AbsLexer.java:224)
        at com.hp.hpl.jena.iri.impl.LexerQuery.yylex(LexerQuery.java:603)
        at com.hp.hpl.jena.iri.impl.AbsLexer.analyse(AbsLexer.java:53)
        at com.hp.hpl.jena.iri.impl.Parser.<init>(Parser.java:112)
        at com.hp.hpl.jena.iri.impl.IRIImpl.<init>(IRIImpl.java:65)
        at com.hp.hpl.jena.iri.impl.AbsIRIImpl.create(AbsIRIImpl.java:702)
        at com.hp.hpl.jena.iri.IRI.resolve(IRI.java:431)
        at org.openjena.riot.system.IRIResolver$IRIResolverNormal.resolveSilent(IRIResolver.java:433)
        at org.openjena.riot.system.ParserProfileChecker.makeIRI(ParserProfileChecker.java:51)
        at org.openjena.riot.system.ParserProfileChecker.resolveIRI(ParserProfileChecker.java:45)
        at org.openjena.riot.system.ParserProfileChecker.createURI(ParserProfileChecker.java:103)
        at org.openjena.riot.system.ParserProfileBase.create(ParserProfileBase.java:165)
        at org.openjena.riot.lang.LangTurtleBase.tokenAsNode(LangTurtleBase.java:529)
        at org.openjena.riot.lang.LangTurtleBase.node(LangTurtleBase.java:366)
        at org.openjena.riot.lang.LangTurtleBase.triplesNode(LangTurtleBase.java:395)
        at org.openjena.riot.lang.LangTurtleBase.objectList(LangTurtleBase.java:376)
        at org.openjena.riot.lang.LangTurtleBase.predicateObjectItem(LangTurtleBase.java:309)
        at org.openjena.riot.lang.LangTurtleBase.predicateObjectList(LangTurtleBase.java:301)
        at org.openjena.riot.lang.LangTurtleBase.triples(LangTurtleBase.java:281)
        at org.openjena.riot.lang.LangTurtleBase.triplesSameSubject(LangTurtleBase.java:220)
        at org.openjena.riot.lang.LangTurtle.oneTopLevelElement(LangTurtle.java:46)
        at org.openjena.riot.lang.LangTurtleBase.runParser(LangTurtleBase.java:145)
        at org.openjena.riot.lang.LangBase.parse(LangBase.java:43)
        at org.openjena.riot.system.JenaReaderTurtle2.readWorker(JenaReaderTurtle2.java:45)
        at org.openjena.riot.system.JenaReaderRIOT.readImpl(JenaReaderRIOT.java:138)
        at org.openjena.riot.system.JenaReaderRIOT.read(JenaReaderRIOT.java:95)
        at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:268)
        at com.hp.hpl.jena.util.FileManager.readModelWorker(FileManager.java:408)
        at com.hp.hpl.jena.util.FileManager.loadModelWorker(FileManager.java:312)
        at com.hp.hpl.jena.util.FileManager.loadModel(FileManager.java:298)
        at de.fuberlin.wiwiss.d2rq.SystemLoader.getMappingModel(SystemLoader.java:266)
        at de.fuberlin.wiwiss.d2rq.SystemLoader.getMapping(SystemLoader.java:300)
        at d2rq.dump_rdf.run(dump_rdf.java:97)
        at de.fuberlin.wiwiss.d2rq.CommandLineTool.process(CommandLineTool.java:158)
        at d2rq.dump_rdf.main(dump_rdf.java:40)
Caused by: java.lang.IllegalArgumentException: Invalid version number: Version number may be negative or greater than 255
        at com.ibm.icu.util.VersionInfo.getInstance(VersionInfo.java:188)
        at com.ibm.icu.impl.ICUDebug.getInstanceLenient(ICUDebug.java:65)
        at com.ibm.icu.impl.ICUDebug.<clinit>(ICUDebug.java:69)
        ... 38 more

有什么办法解决吗?

SimmerChan commented 2 years ago

我已收到您的邮件,祝您生活愉快!

DeepGeGe commented 2 years ago

解决了,开始查了很久没找到解决方法。后来我想这个是d2rq工具的报错,就去GitHub的d2rq仓库查询了下相关错误,看到有人说也遇到了这个错误,将java版本从java8升级到java11可以解决,亲测可行,参考链接:https://github.com/d2rq/d2rq/issues/322