[elephant-devel] Querying Advice [w/code example]

Ian Eslick eslick at csail.mit.edu
Mon Nov 13 15:00:40 UTC 2006


Daniel,

I think GBBopen would be an application-oriented approach to indexing
rather than an infrastructure that one might use to build a query engine
for elephant; from what I can tell you have to buy into their model of
objects, spaces and dimensions, etc.  You could mix it with DCM, perhaps
- but I think that's alot of hair to take on to do what I think you're
talking about.  A facility to support dynamic indexing and sorting
should be fairly cheap (a few files of a few 100 lines each max).

Here's an example of class indexing:

(defpclass person ()
   ((name :accessor name :initarg :name :index t)
    (age :accessor age :initarg :age :index t)
    (occupation :accessor occupation :initarg :occupation :index t)))

;; defpclass is a macro that adds :metaclass persistent-metaclass to the
class options

(make-instance 'person :name "Ian" :age 33 :occupation "student")
(make-instance 'person :name "Alyssa" :age 40 :occupation "hacker")

(defmethod print-object ((obj person) stream)
    (format stream "<PERSON ~A>" (name obj)))

(get-instances-by-class 'person)
=> (<PERSON "Ian"> <PERSON "Alyssa">)

(get-instances-by-value 'person 'name "Ian")
=> (<PERSON "Ian">)

(get-instances-by-range 'person 'age 30 45)
=> (<PERSON "Ian"> <PERSON "Alyssa">)

Ian

Daniel Salama wrote:
> I'm not familiar with GBBopen and will read up on it. Would anyone
> care to comment on it? For the purpose of trying to "develop" a
> querying facility for Elephant, will it be useful/needed?
>
> Thanks,
> Daniel
>
> On Nov 13, 2006, at 9:16 AM, Venkat Manakkal wrote:
>
>> Daniel Salama wrote:
>>> 1) The nature of dynamic queries as presented in my original email:
>>> your
>>
>> Just briefly coming out of lurk mode, when designing your application
>> you might want to use something like GBBopen from gbbopen.org that
>> implements a main memory blackboard for dynamic queries to in memory
>> objects.
>>
>> It also provides for dynamic re-ordering of execution of what are called
>> knowledge-sources, as well as events and event triggers that can be used
>> along with a control shell mechanism.
>>
>> If you write your application in such a way that persistence is handled
>> by Berkley db and dynamic queries are in memory, you can develop an
>> application specific language that will rock.
>>
>> Best regards,
>>
>> ---Venkat.
> _______________________________________________
> 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