无法读取大型RDF文件

时间:2015-12-23 09:15:50

标签: java rdf jena

我有RDF格式的大型30GB .nt文件。当我通过jena库解析该文件时,我得到了这个例外:

Exception in thread "main" java.lang.reflect.InvocationTargetException
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:497)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)Caused by: java.lang.OutOfMemoryError: Java heap space
at org.apache.jena.riot.tokens.TokenizerText.parseToken(TokenizerText.java:170)
at org.apache.jena.riot.tokens.TokenizerText.hasNext(TokenizerText.java:86)
at org.apache.jena.atlas.iterator.PeekIterator.fill(PeekIterator.java:50)
at org.apache.jena.atlas.iterator.PeekIterator.next(PeekIterator.java:92)
at org.apache.jena.riot.lang.LangEngine.nextToken(LangEngine.java:101)
at org.apache.jena.riot.lang.LangNTriples.parseOne(LangNTriples.java:75)
at org.apache.jena.riot.lang.LangNTriples.runParser(LangNTriples.java:58)
at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
at org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:176)
at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:862)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:260)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:246)
at org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:69)
at org.apache.jena.rdf.model.impl.ModelCom.read(ModelCom.java:281)
at rdfRead.RdfDataRead.main(RdfDataRead.java:77)
... 5 more

我通过Xmx命令给了20GB的内存。我有最大25GB的内存。 那有没有办法读取文件的GB?因此它不会将所有数据加载到内存中。

由于

0 个答案:

没有答案