RDF读取/解析错误 [英] RDF reading/parsing errors

查看:141
本文介绍了RDF读取/解析错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些RDF文件要导入到tripplestore(AllegroGraph)中,但是在第一个文件中,我收到了SAX解析器错误,指出有无法识别的字符.删除有问题的行后,一切都很好. 然后,我尝试使用W3C RDF验证器和RDF上的耶拿使用错误行,但是我得到的只是关于未定义语言的警告(错误行绝对没有). 您能否建议一种在RDF文件中查找错误的方法(如果可能的话,请使用Java)?

I have some RDF files which I want to import into a tripplestore(AllegroGraph), but at the first file I get a SAX parser error, stating there is an unrecognized character. After removing the line in question, everything is great. Then I have tried using the W3C RDF validator and Jena on the RDF with the error-line, but all I got was some warnings regarding undefined languages(absolutely nothing about the error-line). Could you please suggest a method(java if possible) to finding errors in RDF files?

有问题的行是:

<gn:alternateName xml:lang="got">&#66352;&#66374;&#66354;&#66352;&#66365;&#66361;&#66371;&#66372;&#66352;&#66365;</gn:alternateName>

推荐答案

您可以使用Sesame的此博客文章关于一般如何与Rio一起工作的信息.具体来说,验证的诀窍是创建并附加

You can use Sesame's Rio parser to do validation. There's instructions in this blogpost on how to work with Rio in general. For validation specifically, the trick is to create and attach a ParseErrorListener that receives detailed warning and errors from the parser.

但是,由于您提到遇到的问题是在SAX/XML级别上,因此您也可以仅使用通用XML验证器来查看问题所在.最可能的原因(但是如果没有更多细节很难说明)是您的某个地方编码错误.

However, since you mention that the problem you encounter is at the level of SAX / XML, you could also just use a generic XML validator to see what's wrong. The most likely cause (but it's hard to tell without more details) is that you have an incorrectly encoded character in there somewhere.

这篇关于RDF读取/解析错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆