这是我正在使用的代码和查询..
SparqlRemoteEndpoint endpointeds = new SparqlRemoteEndpoint(new Uri("http://dbpedia.org/sparql"), "http://dbpedia.org");
SparqlResultSet resultss = endpointeds.QueryWithResultSet("
PREFIX dbp-ont: <http://dbpedia.org/ontology/>
SELECT ?location, str(?label)
{ ?location dbp-ont:country <http://dbpedia.org/resource/Italy> .
?location a ?type filter ( ?type = dbp-ont:ArchitecturalStructure ||
?type=dbp-ont:Place || ?type=dbp-ont:NaturalPlace || ?type=dbp-ont:Mountain ||
?type=dbp-ont:Volcano || ?type=dbp-ont:Village || ?type=dbp-ont:AdministrativeRegion
|| ?type=dbp-ont:Island || ?type=dbp-ont:Continent) .
?location foaf:name ?label filter (lang(?label)=" + "en" + ").} order by ?location limit 10");
我知道查询运行良好,因为我已经在 Virtuoso 中尝试过,我不知道为什么它给了我这个错误,感谢 Visual Studio 2012。