简体   繁体   English

使用Protege中两个数据属性之间的关系定义类限制

[英]Defining a class restriction using relationship between two data properties in Protege

I am working on building a simple software ontology in Protege v5.2 and I am trying to classify pieces of software (using a reasoner plugin) as CPU intensive if their CPU time is larger than 80% of their physical execution time. 我正在Protege v5.2中构建一个简单的软件本体,并且尝试将使用CPU的时间大于其物理执行时间的80%的软件(使用推理程序插件)归类为CPU密集型。 For this reason, each individual has the following data properties filled with float values: 因此,每个人的以下数据属性都填充有浮点值:

a) hasCPUTime a)hasCPUTime

b) hasPhysicalExecutionTime b)具有PhysicalExecutionTime

I have created a class CPUIntensive and I want to add a restriction that individuals which have hasCPUTime > 0.8 * hasPhysicalExecutionTime belong in this class. 我已经创建了一个CPUIntensive类,并且我想添加一个限制,即hasCPUTime> 0.8 * hasPhysicalExecutionTime的个人属于该类。 Can this be done in Protege? 可以在Protege中完成吗?

OWL 2 doesn't allow arithmetic computations, eg multiplication (though some kind of comparison is possible using data ranges). OWL 2不允许进行算术运算,例如乘法(尽管可以使用数据范围进行某种比较)。

You need SWRL with builtins: 您需要内置SWRL:

hasCPUTime (?ind, ?cpu) ^
hasPhysicalTime (?ind, ?phy) ^
swrlb:greaterThan (?cpu, ?mul) ^
swrlb:multiply (?mul, 0.8, ?phy)
 -> CPUIntensive(?ind)

The swrlb:multiply builtin is satisfied iff the first argument is equal to the arithmetic product of the second argument through the last argument, and if the first argument is unbound, binds it to the arithmetic product of them, much like Mul is 0.8*Phy. 如果第一个自变量等于第二个自变量到最后一个自变量的算术乘积,则满足swrlb:multiply内置函数,并且如果第一个自变量未绑定,则将其绑定到它们的算术乘积,就像Mul is 0.8*Phy. works in Prolog. 在Prolog中工作。

Pellet does support those builtins: Pellet支持这些内置函数:

个人观点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM