Search code examples
semantic-webowlontologyreasoningswrl

Write in SWRL a mathematical expression to calculate probability distributions


I am new on Semantic Web Rules Language and I am writing some rules in order to calculate the probability of - discrete and continuous - distributions.

I know that with SWRL I can do subtractions, addition, multiplication and divisions. But what about exponentiation, summation, calculation of mathematical functions? Is there a way to do this in SWRL?

Just an example to place my question : You know, for example, for Triangular distribution, we need basic mathematical calculus (subtractions and divisions), but for Beta Distribution we need exponentiation and calculus of the beta function..

Is there a way to do this in SWRL? Thanks


Solution

  • The standard describes what math functions should be available, and these include exponentiation:

    8.2. Math Built-Ins

    • swrlb:pow
      Satisfied iff the first argument is equal to the result of the second argument raised to the third argument power.

    There's no built in for the Beta function, though. You'd need to look into the reasoner that you're using and see whether you can implement additional mathematical builtins.

    summation, calculation of mathematical functions

    For summations, you may find the aggregate functions in SPARQL useful, but only if the terms you need to sum are available individually. You won't easily be able to express arbitrary sums like ∑i=1…n i2. You might find support for extension functions in SPARQL implementations, too.