SemWeb - 如何获取 xml 格式的查询结果?
我正在尝试使用 SemWeb 库在远程 SPARQL 端点上进行 SPARQL 查询。
附带的示例
这就是我正在使用的堡垒测试,因为这是 Semweb SparqlHttpSource source = new SparqlHttpSource("my_endpoint");
source.RunSparqlQuery("SELECT * WHERE {?entity dcterms:title 'someentity' }", new SparqlXmlQuerySink(Console.Out));
现在,我的查询没有返回 xml,而是返回 javascript,我怎么知道这一点? 使用这个更简单的示例:
SparqlHttpSource source = new SparqlHttpSource("my_endpoint");
source.RunSparqlQuery("SELECT * WHERE {?entity dcterms:title 'someentity' }", Console.Out);
所以我的问题是,我如何告诉 semweb 以 xml 格式获取结果?
谢谢
I'm trying to use SemWeb library to make my SPARQL queries on an remote SPARQL endpoint.
this is what i'm using fort testing, since this is an example that came with Semweb
SparqlHttpSource source = new SparqlHttpSource("my_endpoint");
source.RunSparqlQuery("SELECT * WHERE {?entity dcterms:title 'someentity' }", new SparqlXmlQuerySink(Console.Out));
Now, what happens is that my query isn't returning xml, but javascript, how do i know that?
using this simpler example:
SparqlHttpSource source = new SparqlHttpSource("my_endpoint");
source.RunSparqlQuery("SELECT * WHERE {?entity dcterms:title 'someentity' }", Console.Out);
So my question is, how do i tell semweb to get my results in xml format?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
感谢您尝试帮助我,
我找到了答案,只是我的端点地址错误,现在它正在工作,
我忘记在我的 URL 中提及 /sparql 。
Thanks for trying to help me
I found the answer, simply my endpoint address was wrong, now it's working
i forgot to mention /sparql at the of my URL.
查看您的端点配置,端点可以通过多种方式决定提供什么输出。
或者,您可以序列化 json 输出并使用它。
Have a look at your endpoint configuration, there are various ways that endpoints decide what output to give.
Alternitavly you could just serialize the json output and use that.