[RFC] 7 Graph Rework #615
Replies: 10 comments 8 replies
-
Great work! I need to sit down and read it once more to give any meaningful feedback, but I just want to leave this paper I found the other day here that I find relevant to this discussion: Bahareh Sarrafzadeh, Adam Roegiest, and Edward Lank. 2020. Hierarchical Knowledge Graphs: A Novel |
Beta Was this translation helpful? Give feedback.
-
The most obvious thing I feel that's missing right now is inter-note links. Showing only a hierarchy tree doesn't really add much- a nested text list would do the same thing basically. Would love to see this implemented <3 !! |
Beta Was this translation helpful? Give feedback.
-
I am still in the process of importing my notes and refactoring them from my previous setup, and I'm noticing a few things that might be relevant for this discussion. First, I think that it may be beneficial to put more emphasis on defining and describing different kinds of relationships. Currently only one kind of structural relationship exists (child -- IS_A --> parent, i.e. cat --> mammal), and semantic values are known only to the user. This is fine for forming naive hierarchies, but may not be sufficient when drawing non-hierarchical relationships with semantic value. Relationships that cut across branches are generally applied as wiki links. However, these links lack defined semantic value. They are literally just a link and an implied inverse backlink, with nothing said about the relationships that they embody. Describing and specifying the parameters of various relationships that might exist within a vault might prove useful for navigating the web of notes in a targeted or question-driven manner. I think one possible way forward is to define relationship patterning in the schema yml files. For example, if notes under the specified branch link to notes under another specified branch, those notes have a particular relationship. So let's say I have a hierarchy containing a genealogical taxonomy as one of my branches (i.e. mammals, fish, reptiles on top level; cat, dog and whale under mammals; salmon and trout under fish; iguana under reptiles), a second branch contains physical attributes, a third contains aspects of environments, and a fourth contains behavioural attributes. I could specify that any note under the genealogical taxonomy branch that relates to any note under the physical attributes branch is related by the relationship HAS. Whereas any relationship between notes in the genealogical taxonomy and the environments hierarchy is defined by INHABITS, and any relationship between the genealogical taxonomy and the behavioural attributes is described as BEHAVES_LIKE. I could then query for all animals that live in water through a cypher query that looks something like1: MATCH [a] -- [INHABITS] --> [environments: water]
RETURN a And the result would be a list like salmon, trout and whale. I could further specify what kind of water through structural relationships under the environment hierarchy, which may look like water on the top level, with children sea, river, lake, etc. In the example above it may seem that a distinction is being made between what seems like a primary set of notes and sets of what could be described as attributes with lesser centrality. But this is simply a bias creeping in from the directionality of the relationships and my stated emphasis on the animals. If I were a behaviourist then I might emphasize the behaviours, and the relationship to animals might be something like EXHIBITED_BY. In all cases, there is a distinction between structural and semantic links. Structural links frame the ways in which semantic links may be created, especially in a batched manner, via rules defined in the schema. Semantic links are applied as wiki links, and perhaps there could be a better way of delimiting the section of text within a note to which the link applies -- possibly by using markdown-style links, which specify the text that masks the link in the square brackets immediately prior to the curved brackets (i.e. I would also suggest expanding the number of structural links available to the user. Currently only IS_A is available, but I could also imagine relationships denoting equivalency (aka LIKE), opposition (IS_NOT), or others that may require further imagination. This could lead to the ability to cascade relationships across a network, for example by relating note A to note B while note B has a structural relationship of equivalency to note C, thereby indirectly or automatically generating a carry-over relationship between A to C. Footnotes
|
Beta Was this translation helpful? Give feedback.
-
I think it is generally a bad idea to count headers as children, although I was tempted by that prospect earlier. They are not independent entities, they can not exist on their own, and they can not have their own YAML front matter to specify crucial metadata such as note-level UUIDs, date created, etc. But they may still be explicitly defined and related to the notes that they are a part of via a structural relationship (see my earlier post), which may makes them kind of like pseudo-children. I think that the approach taken by Obsidian might be worth emulating; essentially assign UUIDs to all elements within a note, such as headers, paragraphs and footnotes. Each of these internal UUIDs can be linked to the note's UUID via a structural relationship (perhaps CONTAINS or PART_OF], and may be prefixed by something that indicates that kind of element it is, for instance f123 is a footnotes, h456 is a header, p789 is a paragraph. This would be useful for assembling footnotes from throughout a hierarchy. I'm inspired by how some books assemble endnotes for each chapter, for each section, or for the entire book (and by some recent struggles getting pandoc/latex endnotes to work as I want, sigh). Of course, the scope of what constitutes each kind of element would have to be explicitly defined. For example, the scope of a header might be defined as the next n lines up to the next header of equal or higher status, i.e. an h2 contains all h3-h6 under it up to the next h2 or h1. Additionally, because headers are not restricted by issues derived from the file system (i.e. character length and uniqueness), they are really useful for templates. I could imagine a handy situation of querying all headers of the same character string, which appear in all notes under a hierarchy through prior implementation of a template. In this case, UUIDs would have to be derived based on the properties of the string, kind of like a hashing function (which I know basically nothing about). |
Beta Was this translation helpful? Give feedback.
-
SummaryAwesome work on the RFC and thanks for putting this together. I think there's a lot here so probably makes sense to break up the work in chunks. The first phase can be the graph backend + rendering. We can save embedding for a second phase (maybe do enough work to make sure that what we do in phase1 is compatible with embeddings). I put some of my high level thoughts below. I think the output for the first phase should be a graph renderer that is built into Dendron (instead of a separate extension as we have today). As part of that work, we should figure out the minimal feature set that rendering should support. Graph BackendI think it makes sense to do a db based approach. My main question is choice of local db. Do you know how GUN compares to pouchdb? https://github.com/pouchdb/pouchdb I'm asking because we're considering using pouch to help with caching, filtering and querying of local data. It's hard to predict the future but the current use cases for dendron are primarily document focused so I'm leaning a document focused db over a graph enabled one but open to changing my mind on this. Graph RenderingFor this, I'm guessing we'll use d3 or some higher level library built on top of d3. I know our friends at Foam have a graph implementation, I think its built on top of d3. Might be good to talk to them about it. For minimal feature set for the first version
Graph EmbeddingSimple solution is a svg. Obsidian has an interactive graph on published pages. Not sure yet if people would find that useful since you can achieve the same thing with a list of backlinks. OtherI like @zackbatist idea of adding additional metadata to the edges. This can result in rich querying capabilities down the line. I added it as a stretch goal of v1. In terms of having headers as children, I think it'll become messy. Rather, I would parse the body of a note as a tree instead of a blob of text which we can now run tree operations on. |
Beta Was this translation helpful? Give feedback.
-
this is a neat example of graph representation, that can proabably work with a sqlite backing store. Mode analytics demo, docs I like that it has different node sizes, different colorings of nodes for different cluster, the edges have different widths depending on weights. |
Beta Was this translation helpful? Give feedback.
-
Is a proper graph DB like OrientDB or Neo4j with a server even an option? Or should it run in node like pouchDB? |
Beta Was this translation helpful? Give feedback.
-
Hey everyone! I'm Henry, and I'm working on the graph redesign this summer. I've put together a design document with some notes on the current library recommendation as well as a tentative roadmap if you would like to take a look: https://wiki.dendron.so/notes/6e87249b-358f-4f4b-8049-dff6e6a8463b.html Look forward to any feedback you may have! |
Beta Was this translation helpful? Give feedback.
-
UX feedback on the release as of 6/08/21 (Exporting from the #feedback channel on discord) This is so exciting! I'm so happy to see this running smoothly and to have the power to reposition my nodes. Here is a first batch of UX challenges I encountered around dealing with a complex nodes layout, and some ideas for how to wrangle with them.
|
Beta Was this translation helpful? Give feedback.
-
Update to the RFC link: RFC 7 Graph Rework Some reference links provided by community members, in case they can help with the ongoing discussion of graph rework, improvements, and embed support:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This Discussion is meant as a Place to discuss the RFC 7 Graph Rework
Beta Was this translation helpful? Give feedback.
All reactions