芝麻:如何在查询过程中删除推理? [英] Sesame : how to remove the inference during queries?
问题描述
我正在寻找一种解决方案,以便在Sesame上启动的查询过程中删除"推理.我必须使用本地Java存储RDF架构"存储库,并且我有以下查询: 我有一个实例NamedIndividual,我想要实例的类的uri:
I'm looking for a solution in order to "remove" the inference during a query launched on Sesame. I must use a "Native Java Store RDF Schema" repository and I have this query : I have an instance, a NamedIndividual, and I want the uri of the class whose instance it is :
SELECT DISTINCT ?uri WHERE {
<http://www.semanticweb.org/ontotest#myInstance> rdf:type ?uri .
FILTER (?uri rdf:type owl:Class)
}
问题是由于推理,我得到了几个URI(好URI),而不是一个.我得到了本体的超类,那么实例的类没有链接. 如何在不更改存储库的情况下获得正确的结果?
The problem is that I get severals URI (whom the good URI) instead of one because of the inference. I get the superclasses of the ontology then there is no link with the class of the instance. How to obtain the right result without change the repository ?
推荐答案
设置查询对象,然后再通过API执行该对象,以避免使用推断的语句.
Set the setIncludeInferred(false) on your Query object before executing it through the API to avoid using inferred statements.
这篇关于芝麻:如何在查询过程中删除推理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!