Zettelkasten Forum


Grakn network visualization

Found this via @achamess's Google Group: http://grakn.ai/

At first glance, it looks like a pretty nice graph/visualization language (called "Graql"). But the "engine" can also deal with logical expressions (when X then Y) and infer information.

This is build for big data and genome analysis. But why shouldn't it produce some useful output when you feed it an analysis of your Zettelkasten?

I imagine this should work:

  • Traverse all notes;
  • collect all links ("forward" links) of the note and produce entity relations in Graql format;
  • produce a graph with Grakn.

You could vary the entity types and distinguish regular notes and structure notes to make the latter look different in the graph. You could also add all your tags to the graph, similar to the example below, as another entity (like "city") or as attributes (like "name"):

Maybe one can get fancy and add rules like "when a note is not connected to another note then it gets the "orphan" attribute". I bet you can do even more interesting things to group notes by similarity and proximity of tags, and see where one tag cluster crosses its boundaries and links to another cluster's note, or whatever.

Or maybe not! :) I don't have a clue, yet, but since I cannot play with this for quite some time, I thought you folks might want to.

Author at Zettelkasten.de • http://christiantietze.de/

Comments

  • I briefly played with making a visualization like this using dot language, but this looks much more extensible than my probably-never-actually-realized idea.

  • edited February 20

    Not too hard to make a gephi-file as well to play with graphs. If you just make a script that searches all files for IDs and make a new line for each hit you can easily convert to many formats.

    Dot example:
    201712180005 -> 201801241152

    Gephi example:
    <edge id="606" source="201712180005" target="201801241152" />

    Also @EFLS use in Zetteldeft
    https://efls.github.io/zetteldeft/#orgdc68570

  • Oh right! I always forget that he put that in there.

  • I read this post over lunch and thought it'd be fun to visualize @ctietze 's ba-zettelkasten-justice-for-hedgehogs notes.

    I wrote a Python script to scan the notes folder, parse the zettel IDs, titles, and links, and build the network using the Python graphviz package. The results looks like this:

    I've also attached a PDF version, if you'd like to zoom in, as well as the script itself. You'll need to change the extension to .py, and to install Graphviz (the tool) and graphviz (the Python package). It's not super flexible but it has some options:

    $ python zk_network_viz.py --help
    usage: zk_network_viz.py [-h] [--notes-dir NOTES_DIR] [--output OUTPUT]
                             [--style {record,plaintext}] [--pattern PATTERN]
                             [--layout {circo,dot,fdp,neato,osage,patchwork,sfdp,twopi}]
    
    Visualize the notes network of a Zettelkasten. Each arrow represents a link
    from one zettel to another. The script assumes that zettels have filenames of
    the form "YYYYMMDDHHMM This is a title" and that links have the form
    [[YYYYMMDDHHMM]]
    
    optional arguments:
      -h, --help            show this help message and exit
      --notes-dir NOTES_DIR
                            path to folder containin notes. [default: .]
      --output OUTPUT       name of output file. [default: zettel-network]
      --style {record,plaintext}
                            style of each node. [default: record]
      --pattern PATTERN     pattern to match notes. [default: *.md]
      --layout {circo,dot,fdp,neato,osage,patchwork,sfdp,twopi}
                            layout engine used by graphviz. [default: sfdp]
    

    If there's some interest, I could turn this into a pip-installable package.

  • Really cool! I like it!
    Now, it would be cool to find a way to label and specify those relations. But the visualization is very interesting. Thanks for doing this!

    @alexchabot said:
    I read this post over lunch and thought it'd be fun to visualize @ctietze 's ba-zettelkasten-justice-for-hedgehogs notes.

    I wrote a Python script to scan the notes folder, parse the zettel IDs, titles, and links, and build the network using the Python graphviz package. The results looks like this:

    I've also attached a PDF version, if you'd like to zoom in, as well as the script itself. You'll need to change the extension to .py, and to install Graphviz (the tool) and graphviz (the Python package). It's not super flexible but it has some options:

    $ python zk_network_viz.py --help
    usage: zk_network_viz.py [-h] [--notes-dir NOTES_DIR] [--output OUTPUT]
                             [--style {record,plaintext}] [--pattern PATTERN]
                             [--layout {circo,dot,fdp,neato,osage,patchwork,sfdp,twopi}]
    
    Visualize the notes network of a Zettelkasten. Each arrow represents a link
    from one zettel to another. The script assumes that zettels have filenames of
    the form "YYYYMMDDHHMM This is a title" and that links have the form
    [[YYYYMMDDHHMM]]
    
    optional arguments:
      -h, --help            show this help message and exit
      --notes-dir NOTES_DIR
                            path to folder containin notes. [default: .]
      --output OUTPUT       name of output file. [default: zettel-network]
      --style {record,plaintext}
                            style of each node. [default: record]
      --pattern PATTERN     pattern to match notes. [default: *.md]
      --layout {circo,dot,fdp,neato,osage,patchwork,sfdp,twopi}
                            layout engine used by graphviz. [default: sfdp]
    

    If there's some interest, I could turn this into a pip-installable package.

  • @achamess What would you label the links with? With markdown links, I could use the link’s text, but there’s no other info in the wiki links. Maybe something taken from the source file?

  • This looks very interesting, thanks @alexchabot for trying and posting this! I would love to have the opportunity to create such a graph from a selected set of notes. Ideally this would be possible with the selection of notes that shows in the sidebar of The Archive after I've searched for something – that makes it easier to get an overview over existing notes on something and to find existing and missing connections between a set of notes.
    What would I need to do in order to make that happen? How do I use the script you posted? Could it for example be a macro in Keyboard Maestro, activated by a keyboard shortcut?
    As far as I understand, I need to install Homebrew or MacPorts to install Graphviz. I guess I also need to download Python. Is there an easier way to get this visualisation without your script and having to download all these things (that I don't have any other use for at the moment)? Any (free) app that does this maybe?

Sign In or Register to comment.