How to limit the loading of schema to a specific depth


#1

I am using cayley as a library.

I have an “Item” category

type Item struct {
ID quad.Value quad:"@id"
Children []Item quad:"childOf > *"
}

Let us say, we have added the following quads
E is “childOf” D , D is “childOf” C , C is “childOf” B and on.
This results in A<B<-C<-D<-E
Now, if I use the LoadTo to load the quads into the schema, how can I limit the loading to stop at depth 3 starting from E as source.
Is there a way to do this in cayley?


#2

There is no way to limit depth for now. But it’s trivial to implement, so please file an issue on Github to track this feature, and I will implement it in a near term.


#3

Thanks. I filed it here


#4

It’s (finally) implemented upstream :slight_smile: Sorry for delay.


#5

Hey, thanks a lot for sparing your precious time for this. It is very helpful.I really appreciate your efforts.
:slight_smile:


#6