如何将SPARQL发布到Virtuoso? [英] How to POST SPARQL to Virtuoso?

查看:95
本文介绍了如何将SPARQL发布到Virtuoso?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用两种不同的HTTP POST实用程序(海报以及Firefox和Python 请求 API)发布一个简单的SPARQL插入到Virtuoso.

I am using two different HTTP POST utilities (poster out of Firefox as well as Python requests API) to post a simple SPARQL insert to Virtuoso.

我的网址是:http://localhost:8890/sparql

我的请求参数是:

default-graph-uri: <MY_GRAPH>
should-sponge: soft
debug: on
timeout: 
format: application/xml
save: display
fname: 

我在消息内容中放入了实际的SPARQL(INSERT DATA { GRAPH...).

I put the actual SPARQL (INSERT DATA { GRAPH...) in the content of the message.

我尝试了不同的内容类型,但没有一种有效.我确实得到了200,但是即使上述参数集指定了application/xml,响应还是以HTML格式显示,但是没有插入任何数据.尝试使用text/turtle的内容类型时,我得到409无效路径,该路径也在

I tried different content types, none of which worked. I do get 200 but the response is in HTML even though the above parameter set specifies application/xml, however, no data is inserted. When I try content type of text/turtle, I get 409 Invalid Path, which is also referenced in this post.

我可以成功地完成HTTP GET,但是由于性能原因,我希望超过有效载荷长度限制.与GET的唯一区别是SPARQL放在URL中的query参数下,而POST 应该在消息内容中启用更大的有效负载,方法是在同一请求中包括多个三元组,而不是只有一个(我有几千个插入物中的100个).我试图遵循此文档页面.

I can successfully do HTTP GET, however, that has a payload length limitation which I would like to exceed for performance reasons. The only difference with the GET is that the SPARQL goes in the URL under query parameter and the POST should enable a much larger payload in the message content, by including multiple triples in the same request, not just one (I have 100s of 1000s of inserts). I was trying to follow this documentation page.

推荐答案

此问题"涉及很多方面,因此很难提供适合该站点的简单答案.这是我建议使用邮件列表的原因之一,该列表更适合进行会话和/或多方面的帮助.

There are many aspects to this "question" making it difficult to provide a simple answer, suitable to this site. This is one of the reasons I suggested the mailing list, which is better suited to conversational and/or multi-facet assistance.

  • 您是否像大多数示例一样尝试使用curl?

查看Mozilla上的海报页加载项,我发现您可能需要手动将?添加到目标URI的末尾-因此http://localhost:8890/sparql?而不是http://localhost:8890/sparql –目前尚不清楚您是否在测试中完成了此操作.在项目页面上,我还注意到其

Looking at the Poster page on Mozilla Add-Ons, I see that you may need to manually add a ? to the end of your target URI -- so http://localhost:8890/sparql? rather than http://localhost:8890/sparql -- and it's not clear whether you've done that in your testing. On the project page, I also note its last commit was in 2012, and there are a great many open issues.

我对Python一点都不熟悉,所以我没有在那儿挖过.

I'm not at all familiar with Python, so I've not dug in there.

您是否尝试过设置Accept:标头?这可能会对服务器返回的内容产生重大影响.

Have you tried setting an Accept: header? This can have significant impact on the content returned by the server.

如果我正确理解了您描述的工作,则您的format:查询参数应为output-format:,其值不应为application/xml,而是受支持的格式之一

If I understand your described efforts correctly, your format: query parameter should be output-format:, and its value should not be application/xml but one of the supported formats listed in the documentation.

virtuoso-users均不您所引用的,这个问题也没有足够的详细信息来分析409 Invalid Path错误的原因.允许我们重现此结果的显式细节可能会有所帮助,最好在不同的线程中使用.

Neither the virtuoso-users post you referenced nor this question have enough detail to analyze the cause of the 409 Invalid Path error. Explicit details that allow us to reproduce this result would be helpful, optimally in a distinct thread.

这篇关于如何将SPARQL发布到Virtuoso?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆