解析N3文件时发生异常

时间:2013-03-23 19:30:18

标签: rdf dbpedia n3 semweb

我正在尝试使用SemWeb解析N3 DBpedia转储文件。这是我的简单代码:

Imports SemWeb
…
Dim store As New MemoryStore
Dim sr As New System.IO.StreamReader(chunkFile)
store.Import(New N3Reader(sr))

当我解析块文件(包括http://www.georss.org/georss/point谓词)时,我得到了这个例外:

System.OverflowException: Value was either too large or too small for an Int32.
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Xml.XmlConvert.ToInt32(String s)
   at SemWeb.Literal.ParseValue()
   at SemWeb.RdfReader.ValidateLiteral(Literal literal)
   at SemWeb.N3Reader.ReadToken(MyReader source, ParseContext context)
   at SemWeb.N3Reader.ReadResource2(ParseContext context, Boolean allowDirective, Boolean& reverse, Boolean& forgetBNode)
   at SemWeb.N3Reader.ReadResource(ParseContext context, Boolean allowDirective, Boolean& reverse, Boolean& forgetBNode)
   at SemWeb.N3Reader.ReadObject(Resource subject, Entity predicate, ParseContext context, Boolean reverse)
   at SemWeb.N3Reader.ReadPredicate(Resource subject, ParseContext context)
   at SemWeb.N3Reader.ReadPredicates(Resource subject, ParseContext context)
   at SemWeb.N3Reader.ReadStatement(ParseContext context)
   at SemWeb.N3Reader.Select(StatementSink store)
   at SemWeb.MemoryStore.StoreImpl.Import(StatementSource source)
   at SemWeb.Store.Import(StatementSource source)
   at ConsoleApplication2.Module1.SaveToDB(String chunkFilePath) in D:\ConsoleApplication2\ConsoleApplication2\Module1.vb:line 31

当我从DBPedia下载文件时,似乎它们没有任何异常(它们已被其他解析器多次使用)。不幸的是,SemWeb没有提供有关产生异常的行的更多细节,因此我找不到导致异常的确切行。有什么办法可以解决吗?

0 个答案:

没有答案