How to find all the possible combinations by SPARQL based on numeric values

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to find all the possible combinations by SPARQL based on numeric values

JerryZheng
I'm wondering if the SPARQL can solve the following problem. And how the
SPARQL query should be written for such a problem (similar to knapsack
problem).

I have 50 dollars in the pocket that I want to buy some books, here is the
price list of books in triples:

:book1 :hasPrice :15 .
:book2 :hasPrice :20 .
:book3 :hasPrice :25 .

I want to know all the possible combinations of books that I can buy. It's
obvious that the possible combinations here are:

book1
book2
book3
book1 book2
book2 book3
book1 book3

But how I can query for these combinations by using SPARQL? Thank you in
advance!



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user