首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >扎马林与dotNetRdf

扎马林与dotNetRdf
EN

Stack Overflow用户
提问于 2016-06-23 15:55:45
回答 1查看 128关注 0票数 0

我试图使用DBpedia查询dotNetRdf

这是我的密码:

代码语言:javascript
复制
  SparqlRemoteEndpoint endpoint = new SparqlRemoteEndpoint(new Uri("http://dbpedia.org/sparql"), "http://dbpedia.org");

  //Make a SELECT query against the Endpoint
  SparqlResultSet results = endpoint.QueryWithResultSet("SELECT DISTINCT ?Concept WHERE {[] a ?Concept}");
  foreach (SparqlResult result in results)
  {
        Console.WriteLine(result.ToString());
  }

  //Make a DESCRIBE query against the Endpoint
  IGraph g = endpoint.QueryWithResultGraph("DESCRIBE ");
  foreach (Triple t in g.Triples)
  {
      Console.WriteLine(t.ToString());
  }

这段代码在C#项目中运行得很好,但在Xamarin内部,我在QueryWithResultSet上有以下错误

代码语言:javascript
复制
void SparqlRemoteEndpoint.QueryWithResultSet(string query, SparqlResultsCallback callback, object state)(+1 overload)
Makes a Query asynchronously where the expected Result is a SparqlResultSet i.e. SELECT and ASK Queries

我不明白我需要创建什么回调。

怎么了?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-06-24 09:25:51

并不是所有的平台都支持同步HTTP操作,所以所有不支持同步HTTP操作的平台都需要使用异步方法。

这是.Net平台的一个限制,他们选择在所有平台上不支持相同的APIs集。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37996479

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档