allegrographpythonapi Prolog查询中的OWL推理

2024-05-18 23:07:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我注意到在allegrographpythonapi教程here中,每当他们想使用OWL推理时,他们使用conn.getStatements方法,而不是发出Prolog或SPARQL查询。是否可以通过发出Prolog或SPARQL查询而不是使用conn.getStatements方法来获得从OWL reasoner推断的三元组吗?我尝试了一个序言查询:

(select (?x ?y) (q ?x !ex:owned-by ?y))

在那里,我将owned-by定义为owl:inverseOf ex:owns,并在我的商店中有三个ex:someone ex:owns ex:something,但没有得到结果。我确实从使用conn.getStatements得到了结果,那么我在Prolog查询中遗漏了一些重要的东西吗?在


Tags: 方法byhere教程connowlsparqlprolog
1条回答
网友
1楼 · 发布于 2024-05-18 23:07:47

在调用evaluate之前,是否对prepareTupleQuery返回的查询对象调用setIncludeInferred?在

http://www.franz.com/agraph/support/documentation/v4/python-tutorial/python-API-40.html#Query%20Class

默认情况下,IncludeInferred为False。我相信有效值是false(无推理)、“rdfs++”或True和“restriction”,如inferhttpquery参数的httprest文档中所述。Python实现只传递值。在

http://www.franz.com/agraph/support/documentation/v4/http-protocol.html#header2-364

相关问题 更多 >

    热门问题