通过SPARQLwrapper查询推论时,如何告诉Stardog使用推论? [英] How can I tell Stardog to use inference when querying it through SPARQLwrapper?
问题描述
我有一个SPARQL查询,当启用推理时,它在Stardog查询面板中返回结果,但是在禁用推理时,它不返回结果.当我尝试使用SPARQLwrapper通过python查询时,没有任何结果.我尝试了不依赖推理的其他查询,并通过没有推理的Stardog查询面板和通过SPARQLwrapper获得了相同的结果.所以我怀疑通过python查询时没有应用推理,这就是为什么没有结果的原因.所以我的问题是在通过SPARQLwrapper查询时,如何告诉Stardog使用推理?
I have a SPARQL query that returns results in the Stardog query panel when inference is enabled, but not when it's disabled. When I try the query through python with SPARQLwrapper, I get no results. I tried with a different query, which doesn't rely on inference, and got the same results through the Stardog query panel without inference and through SPARQLwrapper. So I suspect reasoning is not being applied when I query through python, and that this is why there's no results. So my question is How can I tell Stardog to use inference when querying it through SPARQLwrapper?
推荐答案
Stardog的文档很好:
The documentation of Stardog is pretty good:
HTTP
对于HTTP,推理标志与其他HTTP一起指定 请求参数:
HTTP
For HTTP, the reasoning flag is specified with the other HTTP request parameters:
$ curl -u admin:admin -X GET "http://localhost:5822/myDB/query?reasoning=true&query=..."
这意味着只需将参数?reasoning=true
添加到远程URL字符串.
which means simply add the param ?reasoning=true
to the remote URL string.
这篇关于通过SPARQLwrapper查询推论时,如何告诉Stardog使用推论?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!