【发布时间】:2013-03-15 12:39:35
【问题描述】:
我想提取一些存在于DBPedia 中的信息。因此,我使用 .NET 的 System.Net.WebClient 编写了一个应用程序,它获取 url 并以 N-Triples 格式(纯文本)返回 url 的内容。
为url(与应用程序)提取数据的结果是:
<http://dbpedia.org/resource/AfghanistanCommunications> <http://dbpedia.org/ontology/wikiPageRedirects> <http://dbpedia.org/resource/Communications_in_Afghanistan> . <http://dbpedia.org/resource/AfghanistanCommunications> <http://www.w3.org/ns/prov#wasDerivedFrom> <http://en.wikipedia.org/wiki/AfghanistanCommunications?oldid=74466499> . <http://dbpedia.org/resource/AfghanistanCommunications> <http://xmlns.com/foaf/0.1/isPrimaryTopicOf> <http://en.wikipedia.org/wiki/AfghanistanCommunications> . <http://dbpedia.org/resource/AfghanistanCommunications> <http://www.w3.org/2000/01/rdf-schema#label> "AfghanistanCommunications"@en .
但是,当我在浏览器中看到the url 时,我得到的内容与我提取的内容截然不同。
我用 Fiddler 检查了请求,然后:
webClient.Headers.Add(HttpRequestHeader.UserAgent, "Mozilla/4.0 (兼容; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
DBPedia 是否将应用程序检测为机器人并返回比真实浏览器更少的数据,或者我错过了其他东西?!
【问题讨论】:
标签: .net c#-4.0 rdf sparql dbpedia