Hi,

I want to find the cheapest book from some book sellers, so I write one
rule to compare the price of the same book that is sold by different
sellers.

For example, there are three sellers. The price for the book "Intro to
Semantic web" of each seller is 19 , 23 and 17. To find the cheapest one I
compare them as follows:

First step: min(19,23) ->19 (19 is the current minimum value)
Second step: min(19, 17) -> 17 (Here we find the cheapest value 17)

The problem I faced is how to pass the variable ?currentmin(19 in the above
example) to the following rule:

[cheapestbook: (?b rdf:type ex:cheapestbook)
       <-
        (?b rdf:type ex:book)
 (?b ex:hasPrice ?p)
        lessThan(?p, ?currentmin)]

Best Regards,

Wei Bai

Reply via email to