SemWeb - 如何获取 xml 格式的查询结果?

发布于 2024-09-07 13:46:41 字数 574 浏览 0 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

樱&纷飞 2024-09-14 13:46:41

感谢您尝试帮助我,

我找到了答案,只是我的端点地址错误,现在它正在工作,

我忘记在我的 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.

平生欢 2024-09-14 13:46:41

查看您的端点配置,端点可以通过多种方式决定提供什么输出。

或者,您可以序列化 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文