2 Replies Latest reply on Feb 11, 2010 1:14 PM by Alberto Carmona

    Rules that perform calculations?

    Alberto Carmona
      Hello everyone,

      I wonder how I can create rules that perform calculations.

      For example: I need a rule to let me know the number of triples that satisfy a pattern.

      Suppose I have in my model RDF triples that indicate:

      - Mary knows John.
      - Peter knows John.
      - Ana knows John.

      and would like to have a rule that would express something like:

      IF count( ?y knows ?x) >= 3
      THEN ?x rdf:type PopularPerson .

      Thank you very much.
        • 1. Re: Rules that perform calculations?

          The builtin OWLPrime rules do not handle this kind of calculations. In general, it is also very hard to implement this kind of calculations using user defined rules.
          Having said that, it is totally feasible to take a hybrid approach. We can write a small query to implement the semantics defined in your rule and
          insert the query result (which is bindings for ?x) together with "rdf:type PopularPerson" as a triple back into Oracle's semantic model. Oracle's OWLPrime engine can
          perform further inference with the new information captured by "?x rdf:type PopularPerson" triples.


          Zhe Wu
          • 2. Re: Rules that perform calculations?
            Alberto Carmona
            Thank you very much,

            I had this idea in mind but wanted to make sure there were no other alternative.