[elephant-devel] indexing in elephant

Arjun Mullick arjunmullick at gmail.com
Wed Dec 23 08:13:11 UTC 2009


Thanks a lot , we really got what we want.

On Wed, Dec 23, 2009 at 4:53 AM, Alex Mizrahi <killerstorm at newmail.ru>wrote:

> > 2. What we have decided is to make separate persistent class for each
> > predicate.
>
> So, class is a predicate, right?
>
> >3. (defpclass dependson ()
> >             ((subject :accessor subject)
> >             (predicate :accessor predicate)
> >             (object :accessor object)))
>
> Why do you need a predicate slot then? Predicate for dependson class is
> dependson.
>
> > 4. How do I index a slot so that later if I have a query where I have
> been
> provided with two slot values I should be able to get the third slot value.
> For example: Force-dependson-? should return "mass" and "acceleration".
>
> Elephant implements (on a low level) key-value pair store rather than a
> triple store.
> If you want a triple store, there are basically two way to do it -- either
> use
> compound keys, e.g. (subject, predicate)->object.
> Or use nested key-value stores, something like
> subject->(predicate->object).
>
> Class-per-predicate essentially implements later approach with nested
> key-value stores -- because each class in Elephant has its own btrees
> for indices.
>
> So, just use get-instances-by-value.  Like
>
> (ele:get-instances-by-value 'dependson 'object value)
>
> or
>
> (ele:get-instances-by-value 'dependson 'subject value)
>
> Pretty obvious, no?
> Either you've got confused by your own constructs, or I've misunderstood
> something.
>
>
>
>
>
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20091223/4f8bba2d/attachment.html>


More information about the elephant-devel mailing list