Code Monkey home page Code Monkey logo

Comments (7)

mcollina avatar mcollina commented on June 27, 2024

The problem is that as join is implemented now, i.e. as a "pipeline" of filters/amplifiers of possible solutions, it support no recursion, as the steps in the pipeline are fixed: they are the conditions in our join.
However, we can implement a new RecursiveJoinStream, a special step that does the same step upon itself, by calling join recursively.
The performance of this query will be very bad for large dataset, if they are not filtered by previous conditions.

Another alternative is to "fork" the pipeline: one for each hop level.

from levelgraph.

mcollina avatar mcollina commented on June 27, 2024

A "black-box" approach is also feasible: you can do the first join, without the recursive part, and get the solutions. Then you can feed each solution to a new join statement: this is exactly what the RecursiveJoinStream will do.

Do you want to give it a go?

from levelgraph.

dominictarr avatar dominictarr commented on June 27, 2024

About to get on flight back to Europe, might hack on this on plane.

Also, had a crazy idea:
what if you described a traversal by describing the possible transitions from a given starting node with a regular (style) expression?

I wrote this thing a while ago:
https://github.com/dominictarr/regular-stream

for stream-parsing regular patterns.

from levelgraph.

mcollina avatar mcollina commented on June 27, 2024

Cool! I'm not so sure about the regexp thing, could you make an example?

Be careful on the query planner, after a traversal step it should avoid using a sort join stream. Look at the live branch for hints in how to deal with it.

from levelgraph.

mcollina avatar mcollina commented on June 27, 2024

Ok, I got the regular expression: it seems a much better way for implementing a navigator api.

One point: there is no 'OR' as a join condition at the moment.

from levelgraph.

mcollina avatar mcollina commented on June 27, 2024

Ok, I implemented breadth-first and deep-first here: https://github.com/mcollina/levelgraph-recursive

It is not merged in LevelGraph itself for experimenting purposes :).

from levelgraph.

silentrob avatar silentrob commented on June 27, 2024

That looks interesting. Not sure if anyone has seen this but expert.js supports this feature too. https://github.com/ithailevi/expert

from levelgraph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.