BasilPH / vizel

Zettelkasten visualization and stats🤩🗒
GNU General Public License v3.0
59 stars 5 forks source link

Supporting markdown links for connections #11

Closed TheCedarPrince closed 4 years ago

TheCedarPrince commented 4 years ago

@BasilPH -- this is a great project!

I just tried using vizel (0.1.4) and was not able to get it working on my own list of Markdown files.

I have a repository of all my zettelkasten files written in Markdown and ran vizel. All the files were checked, but none of the relations were detected that I have made. Any thoughts as to why?

Here is an example note I wrote in my Zettelkasten:

---
bibliography: zettel.bib
csl: ieee.csl
nocite: |

---

# Niklas Luhmann's Card Index: The Fabrication of Serendipity

> **Date:** Sun 03 May 2020 12:58:40 AM UTC
> 
> **Summary:** A more in-depth examination of the Zettelkasten method
>
> **Keywords:** ##zettel #database #computer #niklasluhmann #zettelkasten 

## Bibliography Reference:

J. F. K. Schmidt, “Niklas Luhmann’s Card Index: The Fabrication of Serendipity,” Sociologica, vol. Vol 12, pp. 53-60 Pages, Jul. 2018, doi: 10.6092/ISSN.1971-8853/8350.

---

<br>

> "As early as in the 1950s to 1960s, Luhmann simulated a modern computer-based database system [...]." (pg. 59)

I actually think that the Zettelkasten method by Luhmann is distinctly different from a computer database. The reason being, is that this is far more overlapping and far reaching than a discrete system like a simple computer database. One could argue that relations could be made analogous to relational databases but here, the relations are far more abstract than they are in the traditional relational database. If anything, Luhmann's Zettelkasten is more similar to a graph-type system - such as a knowledge graph - than a database 

> "Luhmann's card index allows the production of new and often unexpected knowledge by relating concepts and thoughts that do not have much in common at first sight [...] [I]t makes [...] serendipity possible in a systemically and theoretically informed way." (pg. 54)

The power of the Zettelkasten comes from these accidental connections. Very similar to how one may spread out pieces of paper on a table and make a new connection, so does this method simulate it in very much the same way.

Luhmann employed ambiguity and indecisiveness into the development of the Zettelkasten approach whenever he added a new piece of information to the Zettelkasten. Rather than assigning the piece of information to one discrete category, he enabled that piece of info to naturally attach itself to other pieces of information as [knowledge falls across a spectrum.](03092020022908-education-spectrum.md) (pg. 56)

<br>

---
---

### **References:**

Lemme know how I can help to give you more information!

BasilPH commented 4 years ago

Hi @TheCedarPrince, thank you for giving it a try and putting in the effort to create this issue.

Currently vizel only supports links that use the [[ZETTEL_ID]] notation, like The Archive does.

It could of course also support Markdown style links, but then the issue would be to distinguish something like [knowledge falls across a spectrum.](03092020022908-education-spectrum.md) from [knowledge falls across a spectrum.](https://en.wikipedia.org/wiki/Knowledge): For the first example, we would like to generate a connection, for the second one not.

I could of course filter, and only look at links that point to other .md files in your directory. This is not trivial, so before I start implementing this, I would love to know if all your links to other Zettel point to existing .md files? Ideally, you could send me 2-3 notes that I can test on.

TheCedarPrince commented 4 years ago

Hey @BasilPH,

Good news! It might not be entirely non-trivial! On another project I was working on, I was working on determining when there is a markdown link present and how to extract that; here is the code:

import re
from os import path

replace_strings = {}
with open([FILE_OF_INTEREST]) as mkd_file:
    for num, line in enumerate(mkd_file, 0):
        line = line.strip()
        filenames = re.findall('\((.*?)\)', line)
        for idx, item in enumerate(filenames, 0):
            if path.exists(item):
                continue
            elif path.exists(item + ".md"):
                continue
            else:
                filenames.remove(item)
        if filenames:
            for name in filenames:
                with open(name) as linked_file:
                    for line in linked_file.readlines():
                        if "#" in line:
                            line = re.sub(r'#', ' ', line)
                            line = line.strip()
                            line = re.sub(" ", "-", line)
                            line = "#" + line
                            line = line.lower()
                            replace_strings[name] = line
                            break

This piece of code above does the job of finding everything between a pair of parentheses given a line of a file and then determines:

  1. If there is a markdown file in it
  2. If that file exists

Once these are extracted, you have a list of linked md files given a file.

TheCedarPrince commented 4 years ago

Also, here are additional notes for your testing routine:

Note 1

---
bibliography: zettel.bib
csl: ieee.csl
nocite: |

---

# Electrodermal Activity 

> **Date:** Mon 23 Mar 2020 11:51:54 PM UTC
> 
> **Summary:** A summary of what electrodermal activity is and its use as a biomarker and use in signal processing.
> 
> **Keywords:** ##summary ##signalprocessing ##healthcare #informatics #health #signalprocessing #signal #biomarker 

## **Note Linked From:**

## Overview

### [What Is Electrodermal Activity?](03242020003215-eda-explained.md)
- **Summary:** What electrodermal activity is and its pros and cons as a biomarker

### [Common Causes of Artifact in EDA Signals](03272020061037-eda-artifacts.md)
- **Summary:** An overview of common artifacts in EDA signals

## Handling Signal

### [Simple, Transparent, and Flexible Automated Quality Assessment Procedures for Ambulatory Electrodermal Activity](04092020195141-transparent-eda-data.md)
- **Summary:** A simple, transparent, flexible, and automated quality assessment procedure for ambulatory EDA data
- **Rationale:** FANTASTIC implementation on how to parse through EDA artifact -- very useful with a straight-forward algorithm to use

### [Artifact Removal Methods](03272020062857-artifact-removal.md)
- **Summary:** An overview on commonly used signal processing methods to remove artifacts from signals.
- **Rationale:** Moving average filters seem to hold the most promise in processing EDA.

### [Call Center Stress Recognition with Person-Specific Models](03272020083421-call-center.md)
- **Summary:** Assessment of stress in call center employees using skin conductance sensors to measure SCR/EDA.
- **Rationale:** Showed useful methods on how to process EDA data of a small cohort

<!-- ## **Note Linked To:**

### [Note](LINK)
- **Summary:** -->

---
---

### **References:**

Note 2

---
bibliography: zettel.bib
csl: ieee.csl
nocite: |

---

# Global Programming Paradigm

> **Date:** Sat 18 Apr 2020 04:21:23 PM UTC
> 
> **Summary:** A thought on a global overlapping paradigm for developing useful and just-in-time software
>
> **Keywords:** ##zettel #paradigms #models #writing #programming ##metascience #smart #blank #page #poet

---

<br>

I read a Q&A article on Barbara Liskov [@dagostinoArchitectModernAlgorithms] and the author made a very interesting comparison between Liskov's work of designing paradigms for creating well structured and crafted code with that of a Poet or Novelist. I have heard of comparisons like this before but I was quite intrigued by the latter -- a programmer being compared to a writer. What piqued my interest the most about the article was the following statement,

    "As a computer scientist thinking about code, Liskov had no physical objects to work with. Like a novelist or a poet, *she was staring at a blank page*." (emphasis added)

The end of that statement, "*blank page*", reminded me of the book *How to Take Smart Notes* [@ahrensHowTakeSmart2017] and my note on the book where Ahrens essentially believes that starting with a [blank page is the wrong idea in writing](03292020180520-smart-notes.md). I wonder if the same could be true about programming. In effect, does a global approach to building software make more sense than to artificially package each and every piece of software separately? Could an approach like the [Zettelkasten method](03092020031549-zettelkasten.md) where, according to its [principles](03092020031618-zettelkasten-principles.md), each thought is kept to itself and then linked to different associated pieces of knowledge, map to software development?

<br>

---
---

### **References:**
BasilPH commented 4 years ago

Cool stuff @TheCedarPrince, much appreciated!

TheCedarPrince commented 4 years ago

Any time! If you want me to test anything out, just let me know -- and if you need more information.

BasilPH commented 4 years ago

@TheCedarPrince the latest release supports markdown links. You can install it with pip install --force-reinstall vizel==0.2.0rc1. Please give it a try, and let me know if everything works as expected.