Maybe I need to figure out aggregates properly, and this will go away. I'm using core logic as a query engine, so I'm doing a sort of "get this relationship or else return nothing", all centred around a main entity.
you should look at the string contains constraint in jiralog
when writing a core.logic connector to some datastore, what I recommend starting with, which is the simplest thing, is to not have much of a query optimizer. just pull everything out of the datastore, feed it through to-stream
the way to write that is as a relation like (edge a b)
, the simple implementation being something that takes a and looks in your datastore for the edges, then does the to-stream magic to generate a stream of results where b is bound to each edge
but at some point you will want to write a logic program where a is not ground at the point where the search reaches that goal
and you can't send a logic variable to your datastore for searching
instead of a normal relation goal you can write a constraint, which can sort of delay its actions until a and b are both ground, constraints can't generate possible solutions in the search tree, they only prune it
(I could be misremembering that, but I don't think I am)
depending on what exactly you are doing, you may be better off writing your own datalog, which would feel similar to core.logic but give you more control over the guts
is it possible to define ordering in the results of a run*
call?
i'm using core.logic
to query data structures that are basically vectors of maps
and right now i'm doing it from the outside, using sort-by
for example
considering run*
accepts lvars and expressions to constrain the result it doesn't really make sense i suppose, but i'd like to confirm