dotNetRDF 未解析 LinkedMovie.nt (VDS.RDF.Parsing.RdfParseException)

dotNetRDF not parsing LinkedMovie.nt (VDS.RDF.Parsing.RdfParseException)

我已经在 Java Apache Jena 上测试了 linkedmdb-18-05-2009-dump.nt,但在 dotNetRDF 上抛出异常

VDS.RDF.Parsing.RdfParseException
HResult=0x80131500
Message=Invalid URI encountered, see inner exception for details
Source=dotNetRDF
StackTrace:
  at VDS.RDF.Parsing.NTriplesParser.TryParseUri(TokenisingParserContext context, String uri)
  at VDS.RDF.Parsing.NTriplesParser.TryParseTriple(TokenisingParserContext context)
  at VDS.RDF.Parsing.NTriplesParser.Parse(TokenisingParserContext context)
  at VDS.RDF.Parsing.NTriplesParser.Load(IRdfHandler handler, TextReader input)
  at ConsoleApp2_RDFWALKTHROUGH.Program.Main(String[] args) in 

This exception was originally thrown at this call stack:
[External Code]

Inner Exception 1:
UriFormatException: Invalid URI: The hostname could not be parsed.

我的c#代码如下:

String inputFile = "D:/linkedmdb-18-05-2009-dump.nt";

IGraph g = new Graph();
NTriplesParser parser = new NTriplesParser(NTriplesSyntax.Original);

Console.WriteLine("RDF DS-1 Loading Started:");

parser.Load(g, new StreamReader(inputFile));

Console.WriteLine("RDF DS-1 Loading Finished:");

Console.WriteLine(new DateTime(loadingTime).ToShortTimeString());
Console.ReadLine();

请指导我哪里错了,因为同一文件在 Java 上可以,但在 dotNetRDF 上却不能解析,这非常令人困惑。

问题是转储包含无效的 IRI。在我从 https://www.cs.toronto.edu/~oktie/linkedmdb/ 下载的转储中的第 3104575 行有以下内容:

<http://data.linkedmdb.org/film/9995> <http://xmlns.com/foaf/0.1/page> <http://?> .

该行的最后一个 IRI 是导致解析器阻塞的 IRI,因为 ? 不是 IRI 中该位置的有效字符。