Search Mailing List Archives
[protege-owl] Ask about Calculating Sum Using swrl Rules
martin.oconnor at stanford.edu
Wed Feb 17 11:42:41 PST 2010
These types of calculations generally involve closed world reasoning so
are not possible in SWRL.
You can use SQWRL's new collection operators  to make queries of this
For example, you can calculate the total number of doses in an ontology
for the drug DDI as follows:
Patient(?p) ^ hasTreatment(?p,?t) ^ hasDrug(?t, DDI) ^ hasDose(?t,?dose) .
sqwrl:makeBag(?b, ?dose) .
As always, the results of SQWRL queries can not be used in rules.
Zhaoyuan Zhang wrote:
> I have some problems with calculating the sum in using swrl math build-ins. Acually, I want to calculate something like this:
> ∑P. P is a set of objects within the ontology that shares some common properties. I want to calcualte the sum of that property of all the individuals in that set. Is there any way to accomplish this? Please give me some hints.
> Zhaoyuan Zhang
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
More information about the protege-owl