sparql - 芝麻 : how to remove the inference during queries?

标签 sparql ontology sesame

我正在寻找一种解决方案,以便在 Sesame 上启动查询期间“删除”推理。我必须使用“Native Java Store RDF Schema”存储库,并且我有以下查询: 我有一个实例,一个 NamedIndividual,我想要它的实例所在类的 uri:

    SELECT DISTINCT ?uri WHERE  {   
        <http://www.semanticweb.org/ontotest#myInstance> rdf:type ?uri .
        FILTER (?uri rdf:type owl:Class)         
    }

问题是,由于推断,我得到了几个 URI(哪个是好 URI),而不是一个。我得到本体的父类(super class),然后与实例的类没有链接。 如何在不更改存储库的情况下获得正确的结果?

最佳答案

设置setIncludeInferred(false)在您的Query上对象之前通过 API 执行它以避免使用推断语句。

关于sparql - 芝麻 : how to remove the inference during queries?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24609951/

相关文章:

java - 触发 Stardog 规则的 SPARQL 查询

mysql - 门徒数据大师 : Table records cannot be shown or imported

performance - 本体,OWL,Sparql : Modelling that "something is not there" and performance considerations

java - 创建芝麻存储库

sparql - 关于云+GraphDB的问题

sparql - 如何使用SPARQL访问永久删除的页面?

java - 如何使用java检查本体一致性

java - Java 中的 BufferedReader 和枚举多行

rdf - 使用SPARQL查询DBPedia公司信息