[elephant-devel] Major elephant upgrade

Ian Eslick eslick at media.mit.edu
Tue Mar 11 16:05:46 UTC 2008


Daniel,

I just promoted a simple sketch of a query interpreter and syntax on  
the unstable branch that handles queries like:

(query-select #'(lambda (person school) (format t "Person named: ~A at  
~A~%" (name person) (name school)))
	'(select ((?p person) (?s school))
		  (where (and (> (age ?p) 10) (< (age ?p) 25))
		         (= ?s (school ?p))
		         (string> (name ?s) "Foo")))))

This calls the provided function for all pairs of people and schools  
for ages between 10 and 25 where the school name is alphabetically  
greater than "Foo"

If you load and evaluate src/elephant/query-example.lisp you can play  
with this little hack.

There are absolutely no performance considerations.  It essentially  
does the search through lisp objects that Robert alluded to.  It maps  
all instances of person and uses constraints like (= ?s (school ?p))  
to create the connection between objects via slot values.  You have to  
make sure that it can figure out what ?s is before you can use ?s in  
another expression, so it's pretty restrictive.

Anyway, hopefully this will give you some ideas on how to get started!

Ian


On Mar 6, 2008, at 8:23 AM, lists at infoway.net wrote:

>
> On Mar 4, 2008, at 10:38 PM, Ian Eslick wrote:
>
>> = A little query interpreter (Waldo?, Daniel?)
>> Read sets of oids from indices, implement an efficient in-memory  
>> sort&merge over oids, and deserialize after the query.  I've  
>> specified a bunch of this so could provide a set of pointers to  
>> start.  Looking at some other object query languages and proposing  
>> a syntax would be a good place to start
>
> Will definitely like to pick up on this again. Been doing some more  
> reading and think should have some time to invest on this.
>
> - Daniel
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel




More information about the elephant-devel mailing list