Building a knowledge graph in Logseq
This is a generalized knowledge graph proposal based off of the work on Discourse Graph by Joel Chan and David Vargas, so thank you to them. Other inspiration is listed in: # Resources
Support the following syntax for aspects (term to describe a “subject - relationship - object” phrase)
I haven’t finished converting these to Logseq queries yet. Can see my work in progress here: Knowledge graph queries.
Keep the grammar non-restrictive and let users create relationships between any two notes by default. The plugin can still make it possible to create a more restrictive grammar as well, and you can see in this section how I suggest doing so: # How and when to add restrictive grammar
For one, a non-restrictive grammar allows users to not have to create prefix links in the front of every linked note like in Discourse Graph. This will be beneficial for use cases that want to connect a large volume of notes in their knowledge graph but don’t want to be restricted to a specific note naming system.
Users may prefer to use semantic complements like in
Discourse Graph (supports
and supported by
)
This could be done by creating a special reserved relationship called complements
, and allowing a user to create a complement as follows
I suggest continuing to use the existing simple syntax convention for relationships to add any grammar. This feels more in line with the outliner DNA of Logseq, as it uses the block hierarchies to encode information, and keeps everything visible in the markdown (rather than in an extra layer of data that only exists within the plugin).
Use the existing syntax and create a new relationship (calling them whatever they want, here I use type
)
Then to actually restrict relationships, the plugin could reserve a special relationship (e.g. grammar
) for declaring the grammar of a relationship:
In order to translate your knowledge graph to be integrated into someone else’s, the more detail around how your relationships work, the better.
Some of these proposals might be impractical for a plugin to implement, as I’ve approached most of this thinking from a theoretical side more than a software practical side. However, assuming the queries can be made reasonably fast (either in place or through caching), I don’t think anything here is unfeasible.
This has some similarities to the already richly supported properties in Logseq. I would suggest that making it possible to create rich relationships in line in one’s writing makes a huge difference (when I tried to use properties to do this, I ended up writing a lot of my notes in the properties, making my notes look more like a database table than an outliner or writing tool). I’m happy to discuss this more as I think the difference between this proposed functionality and properties is a subtle but important one.
I’m not sure how Logseq is planning to build their stated World Knowledge Graph, but this seems like a reasonable way to begin letting users add structure to their personal knowledge graphs that could eventually be integrated with other knowledge graphs.
↑ 10 References
These notes are written in Logseq and published using my custom built system for converting Logseq notes to a Hugo website. It’s an experimental system and it has some bugs. But it’s a good space to publish notes exactly the way I write them locally on my system, and experiment with Building a knowledge graph in Logseq.
In my mind, this is a more formal and categorical version of Building a knowledge graph in Logseq.
I’m not sure how Logseq is planning to build their stated World Knowledge Graph, but this seems like a reasonable way to begin letting users add structure to their personal knowledge graphs that could eventually be integrated with other knowledge graphs.
Receive (occasional) updates on my work