这是我正在使用的代码和查询..
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合作谢谢。
答案 0 :(得分:2)