我尝试在我的本地机器上访问 DBpedia (de) 数据。下载并解压缩了一些 ttl 文件后,我尝试测试一个非常简单的 SPARQL 查询。
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?s
WHERE
{
?s rdf:type skos:Concept .
?s rdfs:label ?label .
}
LIMIT 100
使用此 ARQ 命令(在 Windows 上):
arq --data dewiki-20140813-article-categories.ttl --query dbpedia_cat.rq
我确实希望不会出错,但相反,我遇到了一堆这样的错误:
19:29:02 WARN riot :: [line: 2860693, col: 1 ] Bad IRI: <http:/
/de.dbpedia.org/resource/à_Baby_One_More_Time> Code: 47/NOT_NFKC in PATH: The IR
I is not in Unicode Normal Form KC.
19:29:02 WARN riot :: [line: 2860693, col: 1 ] Bad IRI: <http:/
/de.dbpedia.org/resource/à_Baby_One_More_Time> Code: 56/COMPATIBILITY_CHARACTER
in PATH: TODO
19:29:02 WARN riot :: [line: 2860694, col: 1 ] Bad IRI: <http:/
/de.dbpedia.org/resource/à_Baby_One_More_Time> Code: 47/NOT_NFKC in PATH: The IR
I is not in Unicode Normal Form KC.
19:29:02 WARN riot :: [line: 2860694, col: 1 ] Bad IRI: <http:/
/de.dbpedia.org/resource/à_Baby_One_More_Time> Code: 56/COMPATIBILITY_CHARACTER
in PATH: TODO
在这些错误之后,ARQ 添加了以下内容:
Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceede
d
at org.apache.jena.riot.tokens.TokenizerText.parseToken(TokenizerText.ja
va: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:99)
at org.apache.jena.riot.lang.LangTurtleBase.predicateObjectItem(LangTurt
leBase.java:287)
at org.apache.jena.riot.lang.LangTurtleBase.predicateObjectList(LangTurt
leBase.java:269)
at org.apache.jena.riot.lang.LangTurtleBase.triples(LangTurtleBase.java:
250)
at org.apache.jena.riot.lang.LangTurtleBase.triplesSameSubject(LangTurtl
eBase.java:191)
at org.apache.jena.riot.lang.LangTurtle.oneTopLevelElement(LangTurtle.ja
va:44)
at org.apache.jena.riot.lang.LangTurtleBase.runParser(LangTurtleBase.jav
a:90)
at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
at org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserR
egistry.java:182)
at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:906)
at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:687)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:534)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:501)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:454)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:432)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:422)
at arq.cmdline.ModDatasetGeneral.addGraphs(ModDatasetGeneral.java:101)
at arq.cmdline.ModDatasetGeneral.createDataset(ModDatasetGeneral.java:90
)
at arq.cmdline.ModDatasetGeneralAssembler.createDataset(ModDatasetGenera
lAssembler.java:35)
at arq.cmdline.ModDataset.getDataset(ModDataset.java:34)
at arq.query.getDataset(query.java:176)
at arq.query.queryExec(query.java:198)
at arq.query.exec(query.java:159)
at arq.cmdline.CmdMain.mainMethod(CmdMain.java:102)
at arq.cmdline.CmdMain.mainRun(CmdMain.java:63)
at arq.cmdline.CmdMain.mainRun(CmdMain.java:50)
at arq.arq.main(arq.java:28)
测试了两个解压缩实用程序(Linux 上的 Ark 和 Windows 上的 Winrar),我很确定解压缩不是这里的问题。
我还用 Notepad++ 查看了 ttl 文件,所有字符对我来说都是正确的,即使是 Ä、Ö、Ü 等有问题的字符。
所以,我不知道如何处理这些错误,并希望得到任何帮助!
(为提出与 100% 编程无关的问题而道歉。但我不知道 JENA 或 DBPedia 是否是这里的问题,因此,哪个邮件列表是合适的。但是,无论如何,这是一个初学者的问题。所以,我希望这里有人可以提供帮助。)