Protege中的SPARQL查询结果无法识别传递属性 [英] SPARQL query results in Protege does not recognize transitive property
问题描述
在这个问题中我表达了几乎相同的要求:获取所有节点传递关系
I have almost the same requirement expresed in this question: Get all nodes in a transitive relation
我正在使用Protege 3.4.8.这是一个Owl-Lite项目. 我有一个传递属性"contains",它定义为Node类型的对象属性 节点的后代类型为A,B和C
I am using Protege 3.4.8. This is an Owl-Lite project. I have a transitive property "contains", which is defined as an object property of type Node Node has descendants of type A, B and C
我有一些个人通过包含以下内容的属性相互链接:
I have individuals that link to each other through contains property like this:
A包含B包含C
当我运行以下SPARQL查询时:
When I run the following SPARQL query:
SELECT ?A ?B
WHERE
{
?A :contains ?B
}
我明白了:
A1 B1
B1 C1
由于包含的传递性,我希望得到
Due to transitive nature of contains, I'd expect to get
A1 C1
也是. 我在这里做错了什么?我链接到的问题包括答案中的耶拿(Jena),在耶拿(Jena)模型上执行此操作会有所不同吗?
too. What am I doing wrong here? The question I've linked to includes Jena in the answer, would it make a difference to do this on a Jena model?
推荐答案
好,
进一步的搜索将我带到了此页面: http://opentox.org/data/documents/development/RDF%20files/JavaOnly/query-reasoning-with-jena-and-sparql
Further searches led me to this page: http://opentox.org/data/documents/development/RDF%20files/JavaOnly/query-reasoning-with-jena-and-sparql
此页面的以下引用(可能)解释了我所看到的行为背后的原因:
The following quote from this page (probably) explains the reasons behind the behaviour I'm seeing:
出于我们的目的,可以直接执行SPARQL查询 通过Protege中的SPARQL查询面板或从JAVA内部 应用程序使用专用的Jena库方法.两个都 方法能够处理有关显式对象的查询,并且 财产关系,但耶拿图书馆的优势是使用 推理机.因此,使用Jena库方法执行的查询可以返回 结果还考虑了传递关系和推断关系."
"For our purposes SPARQL queries could be executed either directly through the SPARQL query panel in Protege or from inside a JAVA application using the specialised Jena library methods. Both approaches are able to handle queries concerning explicit object and property relations but Jena libraries have the advantage of using a reasoner. Thus queries executed using Jena library methods can return results taking in account also the transitive and inferred relations."
这篇关于Protege中的SPARQL查询结果无法识别传递属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!