我注意到在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查询中遗漏了一些重要的东西吗?在
在调用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
相关问题 更多 >
编程相关推荐