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. For this reason, each individual has the following data properties filled with float values:
a) hasCPUTime
b) hasPhysicalExecutionTime
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. Can this be done in Protege?
OWL 2 doesn't allow arithmetic computations, e.g. multiplication (though some kind of comparison is possible using data ranges).
You need SWRL with builtins:
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.
works in Prolog.
Pellet does support those builtins: