我使用 tdbload2 (在jena3.2.0中)从 freebase-rdf-latest 构建数据库。
发生错误,
[cc @ localhost dir] $ ../apache-jena-3.2.0/bin/tdbloader2 --loc =。/ d-freebase / ./freebase-rdf-latest
21:33:22 INFO - TDB Bulk Loader Start
21:33:22 INFO数据加载阶段
21:33:22 INFO要加载1个数据文件
21:33:22 INFO数据文件1:freebase-rdf-latest
INFO载入:freebase-rdf-latest - 2017/04/06 21:33:23 CST
org.apache.jena.riot。 RiotException :无法确定内容类型:(URI = freebase-rdf-latest:stream = null)
at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:854)
at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:667)
at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:637)
at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:626)
at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:617)
at org.apache.jena.tdb.store.bulkloader2.ProcNodeTableBuilder.exec(ProcNodeTableBuilder.java:78)
at tdb.bulkloader2.CmdNodeTableBuilder.exec(CmdNodeTableBuilder.java:113)
at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
at tdb.bulkloader2.CmdNodeTableBuilder.main(CmdNodeTableBuilder.java:61)
21:33:23错误在数据阶段失败
但是当我在 jena 2.12.1 中使用tdbload2时,没有发生错误!
所以,我想知道为什么在jena 3.2.0中使用tdbload2时会引发RiotException?
freebase-rdf-latest的格式,
<http://rdf.freebase.com/ns/american_football.football_player.footballdb_id> <http://rdf.freebase.com/ns/type.object.type> <http://rdf.freebase.com/ns/type.property> .
<http://rdf.freebase.com/ns/american_football.football_player.footballdb_id> <http://rdf.freebase.com/ns/type.object.name> "footballdb ID"@en .
<http://rdf.freebase.com/ns/american_football.football_player.footballdb_id> <http://rdf.freebase.com/ns/type.property.unique> "true" .
&#13;
答案 0 :(得分:1)
我不确定Jena版本2.12.1,但我在Jena版本3.2.0中找到了,我需要使用文件扩展名指定内容类型。
尝试重命名输入文件来自&#34; ./ freebase-rdf-latest&#34; to&#34; ./ freebase-rdf-latest.nt&#34;。