Creating A Multi-Graph Workflow

With the upcoming release of multiplayer it seems like a good time to really flesh out a multi-graph workflow

With all the developments in nbb, lq and the graph parser, it seems easier than ever to stitch multiple graphs together, but I’m still trying to wrap my head around a good way to do it and I’m curious what the community has to say about it!

Inspirations

  • Roam Inter
  • GitHub File Getter plugin
  • Drummer

Graph References

Ideally it would be very easy to

  • Move a block from the graph I’m in to another without leaving the current graph
  • Sync a block between graphs or embed a block from one graph in another
  • Link to pages in other graphs and see backlinks from other graphs
  • Block reference across graphs

All of this should be possible with graphs either locally, public graphs on the internet or multiplayer graphs you have access to.

Approach

I can sort of think of several ways to achieve this but they all feel somewhat muddy. I’d love any thoughts or suggestions.

Built in

Obviously this would work best if it were functionality baked into Logseq itself. Are there plans within the team already to build out something like this?

Plugin

Upon loading a plug-in queries all other graphs and looks for:

  • blocks that are shared.
    • If the block is already in the graph it updates it, if not adds it to a dedicated page?
  • pages that are shared and synchronizes those???
    • On each page a page property specifies whether or not backlinks should be shared

I’m not sure about how to continue developing this idea… I’d love for it to get incorporated into logseq and would be interested in making a plugin but would love thoughts from folks who have also been thinking about this!

I’ve been working on a plug-in recently that aims to do this exact thing. The approach I’ve elected in live syncing through public NBB graph instances once they’re set up.

Essentially hookinv up to it as a backend. Still a little early in that.

That’s very exciting! When you say public NBB graph instances do you mean like @cldwalker wrote about over here with multiple databases? What steps would I need to take to set up a public nbb instance?

This definitely seems really exciting though I’m still not quite sure how to bring nbb and cljsback into logseq itself… What steps do you need to do to run a cljs script from a logseq plugin?

And does the graph parser now support writing to other databases and not just querying them? Is that whatt db-set-file-content! does over here?

Hi Zebark. I can answer some of these questions.

What steps would I need to take to set up a public nbb instance?

nbb-logseq/examples/fly-io at main · logseq/nbb-logseq · GitHub has an example.

This definitely seems really exciting though I’m still not quite sure how to bring nbb and cljsback into logseq itself… What steps do you need to do to run a cljs script from a logseq plugin?

Nbb scripts aren’t usually meant to brought back into logseq as nbb targets nodejs apps that compiles to esm which isn’t intended for the browser environment. Cljs libraries like the graph-parser can be made nbb compatible. If you’d like to write clojurescript for a logseq plugin, see GitHub - tiensonqin/logseq-cljs-playground for an example.

And does the graph parser now support writing to other databases and not just querying them?

Graph-parser supports writes to the in-memory datascript db but it doesn’t yet support writes to the logseq graph. The latter is far more interesting as markdown/org files is the ultimate source of truth and can be read almost anywhere thanks to the graph-parser.

I can’t speak to the plugin ideas you’ve mentioned as I haven’t experimented much in that direction. I think they are exciting ideas and am interested to see what direction you and others go with it.