Reputation: 1262
The question seems to be slight open-ended. I am in the process of handling rules (mostly production rules) with arithmetic operators. I also have an ontology which defines relationships between elements of these rules (This is atleast the inital setup). E.g.
Trivial Example
Facts
NoOfItems('100')
BaseRental('300')
Production Rule
Profit = (NoOfUnits * ProductionCostPerUnit) + TransportationCost - (NoOfUnits * SellingPricePerUnit)
TransportationCost = (FuelCost/Litre * FuelUsedInLitre) + DriverCost
Ontology:
Profit owl:sameAs ProfitPerQuarter
NoOfUnits owl:sameAs NoOfItems
I have handled these independently before i.e. Used Prolog (SWI-Prolog) for handling production type of rules or Even a Drools to handle them on a different occasion. To query RDF/OWL, I have used Apache Jena. including writing rules on the Triple Store.
But, can you guys suggest a framework which can handle both, like in this situation. I have heard of Prova, which can handle these. But, can Jena or Drools have reasoner which can handle both.
Upvotes: 0
Views: 269
Reputation: 41
I am also new to Apache Jena/ Reasoners etc. I have done similar arithmetic operations using Apache Jena reasoners. There are many built-in functions available in Jena inferencing model.
As you have not mentioned how the RDF triples look like I am assuming the following format.
:production :hasunits "100"^^xsd:int
:production :costperunit "20"^^xsd:int
:production :sellingprice "25"^^xsd:int
:production :fuelcostlitre "20"^^xsd:int
:production :fuelused "10"^^xsd:int
:production :drivercost "100"^^xsd:int
Rules for the above mentioned RDF looks like
[r1: (?p :fuelcostlitre ?f)
(?p :fuelused ?l) (?p :drivercost ?d) product(?f ?l ?m) sum(?m ?d ?s)
-> (?p :transportation ?s)]
[r2: (?p :hasunits ?n) (?p :costperunit ?c) (?p :sellingprice ?m)
(?p :transportation ?t) product(?n ?c ?a) product(?n ?m ?b)
sum(?a ?t ?e) difference(?e ?b ?d)
-> (?p :profit ?d)
]
More about Jena built-in you can refer here. https://jena.apache.org/documentation/inference/#RULEbuiltins
Upvotes: 0