Comments (7)
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.
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.
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.
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.
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.
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.
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)
- Why save all permutations? HOT 5
- Tree Traversal & Querying HOT 3
- Assistance with query on a DAG HOT 1
- joins do not work if the values are different than the objects themselves HOT 1
- use on mobile? P2P? encryption? realtime?
- unreachable code after return statement :4758
- this.db.approximateSize is not a function HOT 2
- error with example stream search code HOT 2
- Uncaught TypeError: this.once is not a function
- Triple identifiers HOT 1
- Additional Documentation Needed
- Uncaught TypeError: this.db.approximateSize is not a function
- performance expectations for levelgraph
- Error using level-sublevel@6 HOT 2
- Levelgraph searches fail to resolve; wait indefinitely after finding solution(s)
- Version bump HOT 10
- getStream doesn't emit end event
- Sync local <> external database HOT 5
- does not work with persistent level db HOT 1
- offset behaviour changes depending on type of filter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from levelgraph.