On Sep 12, 9:53 pm, Robert Luo <robort...@gmail.com> wrote:
> Thank you Josh for your answer.

Thank you for being interested in the datalog library. :)

> I have read the sources of datalog, however, literal.clj and the ideas
> of the query language behind it is unknown for me, thus I can not
> understand it quite well. The same thing happens when I saw magic.clj,
> in which file I saw "magic transformation".

Much of the semantics of the query language is based on Prolog.  I
would say that
you'd be better served by looking at the example.clj and trying to
understand that before
moving into the magic.clj and others (some of that code is likely
pretty dense for someone
new to the language).

I would also recommend reading a good prolog tutorial (like
http://www.amzi.com/AdventureInProlog/ ),
which can help a lot in understanding what the datalog code is doing.
There is also a great book
called 'The Reasoned Schemer' which describes and teaches a logic
system in Scheme.

> I ran the example you posted on github, which seems return 2 records
> because same room-id merged. However, if I want the result set look
> like this: {room-id: 1 :seat-number [1 2], :players ["joe" "smith"]},
> is it possible? Another question, there are many aggregate function in
> SQL, can it be used in the conjunctive query?

I've updated the gist so that it outputs how would like it to look.
Is there a reason
you need the seat number separate from the players? Since the seat
number is already in the database,
it would make more sense to me to add a rule to deal with it (if that
makes sense).

-jbs



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to