耶拿; listDeclaredProperties语义 [英] Jena; listDeclaredProperties semantics

查看:96
本文介绍了耶拿; listDeclaredProperties语义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们考虑一个

(1) P Domain CSuper
(2) CSub subClassOf CSuper

使用耶拿(Jena),我试图列出CSub的声明属性.我认为不能将P列为CSub的声明属性.我的理由是:PCSub的声明属性, iff CSubP的域,而(1)CSuperP的域并不暗示CSub也是一个域; (1)表示如果(x, y)P,那么xCSuper,显然x可能(不是)CSub.

Using Jena, I'm trying to list the declared properties for CSub. What I believe is that P mustn't be listed as a declared property for CSub. My justification: P is a declared property for CSub, iff CSub is a domain for P, from (1) CSuper is a domain for P which doesn't imply that CSub is also a domain; (1) means that if (x, y) is P, then x is CSuper, clearly x may (not) be CSub.

令人惊讶的是,即使使用OntModelSpec.OWL_DL_MEM_RULE_INF或Pellet,使用listDeclaredProperties方法时,耶拿仍将P列为CSub的声明属性! 我想念什么吗?

The surprising thing is that Jena is listing P as a declared property for CSub when using listDeclaredProperties method even using OntModelSpec.OWL_DL_MEM_RULE_INF or Pellet! Am I missing something?

更新: 某个类的声明属性是什么意思?这是否意味着该类是该属性的类!

Update: What does a declared property for some class mean? Does it mean the classes that the property is a domain of them!

推荐答案

您要:

theClass.listDeclaredProperties(false);

来自文档:

listDeclaredProperties()等效于使用默认值direct = false调用listDeclaredProperties(boolean).

listDeclaredProperties() Equivalent to calling listDeclaredProperties(boolean) with default value direct = false.

direct-如果为true,则将返回的属性限制为直接与此类关联的属性.如果为false,则不会在此类的已声明属性中列出此类的超类的属性.

direct - If true, restrict the properties returned to those directly associated with this class. If false, the properties of super-classes of this class will not be listed among the declared properties of this class.

我认为您误解了声明的属性.这将返回类可能(或必须)具有的属性.假设我们有一个类层次结构:

I think you've misunderstood declared properties. This returns properties that a class may (or must) have. Suppose we have a class hierarchy:

A > B > C

还有:

P domain B

所有BsCs可能都具有属性P-那里没有矛盾.但是,并非所有As都可能具有属性P -问题是not-Bs.

All Bs and Cs may have property P -- no contradiction there. However it's not true that all As may have property P -- the not-Bs are the problem.

这篇关于耶拿; listDeclaredProperties语义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆