Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Ask about Calculating Sum Using swrl Rules

Martin O'Connor 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 [1] to make queries of this 
form.

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) .
 sqwrl:size(?n, ?b)
 -> sqwrl:select(?n)

As always, the results of SQWRL queries can not be used in rules.

Martin

[1] http://protege.cim3.net/cgi-bin/wiki.pl?CollectionsSQWRL

Zhaoyuan Zhang wrote:
> Hi,
>
> 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.
>
> Regards,
>
> Zhaoyuan Zhang
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>   




More information about the protege-owl mailing list