OOPKM - Taking inspiration from programming

I recently came across a very interesting connection (thanks to Obsidian) between computer science and knowledge management, which I’m sure anyone here can appreciate. I’ll start with a quote:

“Managing complexity is the most important technical topic in software development”. – Code Complete: Design in Construction

Developers deal with managing a huge amount of information, across a huge number of files, with a huge number of interconnections between them. The point is whatever systems they use have to be maintainable and efficient, so there has been a lot of work in that direction. PKM may not have a one-to-one connection with managing complex software, but there is enough overlap that it is worth drawing connections.

OOPKM

As you may know, Object-Oriented Programming (OOP) is one of the most popular tools for managing this complexity. It is a way of framing information to make it easier to write, read, manage, reuse, etc. (which are all valuable qualities in note taking as well). It is definitely worth knowing about.

Note: The goal here is not to turn notes into code, it’s to contrast the two to see what ideas can be transfered.

Note: All of this is much easier to apply to notes on topics that are more formal and exact (anything close to science). It will take some imagination but maybe personal notes can benefit too.

Note: Assume there is no object state and any computation is described in words

Here are some connections that are not complete yet to start a discussion:

Classes and Instances

  • Let’s call every note a class and when it used in another note an instance
  • Classes have properties, constructors, and functions

Inheritance

  • A note can be a subclass of another if it has a “is-a” relationship
  • A cat is an animal. A function is a set. An electron is a particle
  • If it’s particularly important then expand it: A cat is a feline is an animal
  • Using an Interface for different relationships

Encapsulation

  • I would say the lesson from encapsulation is to define a good public interface for your note. In other words: have a note outline at the top of things you expect to use elsewhere, and not internal “private” functions.

Hierarchy

I’ve tried to connect these with the IMF system by @nickmilo . I agree that categories and heirarchies are not bad, they just need to be flexible.

  • Package: A collection of namespaces (similar to an Index)
  • Namespace: A collection of related classes (redifined as a MOC)
  • Class: An abstract data type (a note that is abstract)
  • Instance: A specific instance (a concrete instance of a class)

A quick example of a note:
(It was at this point I realised why this isn’t talked about more)

[[SquareMatrix]]

Package: [[Algebra]]
Namespace: [[Algebra-LinearAlgebra-MatrixTheory]]
Base: [[Matrix]]


1.Properties:

Invertible

Whether the matrix is invertible

Symmetric

Whether the matrix is Symmetric


2.Functions:

SquareMatrix(N)

N: size of matrix
Returns a square matrix

EigenDecompose()

Returns the eigen decomposition

EigenValues()

Returns of list of eigen values


(Separate outline from implementation for encapsulation / header references)

3.Function implementations:

SquareMatrix(N):
Specific details

EigenDecompose()
Specific details

EigenValues()
Specific details

14 Likes

brilliant idea. I am a computer programmer of Python which is a language born with OOP. I will think about your theory and do some tests. wait my article.

2 Likes

this is very awesome idea if i see myself as a programmer taking notes, but it will make a steep learning curve for newbies using this note. But, i guess, this can be like switched off as default and can be turned on for people who has expertise in doing it

After all, note taking is an art which is very personal to everyone

I could say this because I’m in a theoretical physicist with knowledge in C, C++, Python, FORTRAN, CUDA, Matlab and many more!!

Yes, normal users do not think in OOP terms. There are issue with OOP such as the classic diamond multiple inheritance issue. Most users think more in term of labels and groups.

Even if we think about formal topics, the problem of defining appropriate interfaces and classes is very difficult. In my experience, the relationships between classes must be very well crafted in order to facilitate desirable behaviors in a maintainable way.

It’s not clear to me what the equivalent of these two goals in Knowledge Management, so we would have a basis of applying the principles designed to solve them into another domain.

Interesting idea though !

It sounds like Knowledge modeling and knowledge graph.

Maybe this would be the standard PKM pattern in the future, in which case people and computers could understand each other.

1 Like

Sounds like the semantic web and its protocol – which is hard for us humans to understand…

2 Likes

That’s great to hear, looking forward to it. It’s my hope that it develops and turns into a formalized note taking system.

Definitely agree, I wouldn’t expect anyone who doesn’t program to use this as it is. I just hope it opens discussions on how to formalize notes, which I’m sure you could imagine the benefit

That’s really interesting, I had no idea. Thanks a lot for pointing to it

The reason I say it’s easier for more formal topics is that the appropriate classes and interfaces are actually already pretty well defined if you spend enough time searching and sorting them out. But if they’re not then I agree, the hardest part is defining them.

This is pretty much where my head is at too. I am an engineer by trade and have done a fair amount of programming, although never became an expert in it.

Do you have ideas on how to create class template that is unique and does not cross contaminate. This is where I am currently stuck.

I want to start with myself/mind at center starting point, but use a common class template to inherit from.

But I’m having the issue that the only way to make file structure unique that I am aware of to is to create new vaults. I want everything to stay in the same vault.

I imaging each file being essentially an object

My simple example

me → .friends → Mike, Ben, Alex, Sam

Mike -->.friends → Eric, me, Tom, Mitch

when you invoke the file “Friends”, which returns the note containing the list of friends for the instance of “me” class

Can we make .friends unique to different people within the note structure? Or do I have to create a unique file every time, and then the reusability, OOP kind of goes away? .friends-Mike to get Mike’s friends. Then I can no longer easily inherit the class template across friends

Allowing multiple inheritance makes the rules about function overloads and virtual dispatch decidedly more tricky, as well as the language implementation around object layouts. These impact language designers/implementors quite a bit, and raise the already high bar to get a language done, stable and adopted.

It is simple to think this way, if class A inherits from multiple classes, then the class A will have the same grandparent class multiple times, this means the code will be complicated and a series of bugs will go unacknowledged. Personally, I think multiple inheritance has a bad rap, and that a well done system of trait style composition would be really powerful/useful… but there are a lot of ways that it can be implemented badly, and a lot of reasons it’s not a good idea in a language like C++.

Wow, this is brilliant. I’m not a programmer by trade, but work in IT and think much in systems, interfaces, contexts etc. Even my own remix of different note taking systems has gravitated towards something like you describe:

I have a base template that I inherit from in others. Most of my templates (and hence, notes) have some encapsulation. They try to resemble an (imperfect, admittedly) data model, with inheritance and all.

This has given me loads to think and potentially the impetus to finally move my system forwards after I have felt stuck for a while. <3

Good Morning gang,

this didn’t leave me alone, and I went ahead and started drawing out a part of my templating system (and improve upon it along the way).

Proposal

I’ve twisted UML to my purpose, see a template of how I mean things at the top left “note-class”. The rest is a wishfull-thinking approach that I haven’t implemented fully in Templater. Also there’s a beginning of what my “Domain” MOC-system could be like. Also not perfectly encapsulated (see “auto-tech-note”, that could inherit from a generalized “systems” note, just don’t want to overcomplicate).

source: obsidian-meeting-workflow/OOPKM_Class-Diag_rovi_v1.drawio at main · jaltgen/obsidian-meeting-workflow · GitHub

Questions

What parts of OOP have I overlooked? Do you like this approach?

Conclusions

I haven’t implemented good “domain” / MOC notes yet. I vibe with the concept of MOCs, but somehow they just rarely happen in the post-factum way as prescribed. I think I need some preset ones, like “CAR”, “HEALTH”, “CLOUD COMPUTING”, “SMART HOME” etc, just things I generally take notes on and then link back when creating notes in these domains. Again, forward-designing structure rather than relying on emergence. I’ve lived with emergent properties for 10 months in my PKM and am pretty upset with the mess it is rn.

2 Likes

added some more complexity as represented in my notes. thinking about it this way actually helps clear out the structure.

1 Like

This is fantastic. Such ontological / OOThinking helps

  • inform the set of note " ::types" and thus

  • inform the structure of the the templates needed. Wherein the ::type is essentially ~ attributes + order. f

I’m curious, about two (and a half) things:

  1. If A’ → A → B(ase) , do you have the literal block / attribute elements of A in A’? Perhaps another way to ask is: “is A’ a proper subset of A”. For example, does your “meeting note” contain every textual element of a “project note”?

  2. How do you think about linking notes in this context? More specifically linking various instances between classes at same and equal depth and most importantly within a given class.

Since we are describing classes of notes we have only structure not content to go on. Rather content variety + attribute structure gives rise to uniqueness and this enables linking. I’ll notate a directed link as (A,B) meaning A~>B under some relation.

  • Trivially we have the natural “elaboration link” type on A,A’ induced by the subset relation Intersect(A,A’)=A’. Thus structural linking between classes can be natural under different relations. However this is less interesting than the case of …
  • How do you think about the instance level re linking: the common link (a’1,a’2) where both a’1 and a’2 are instances of a single A’, or (a’1, b’1) where A and B are leaves in the diagram and at the same depth from base_note.

Curiosity: lastly, for any functional programmers out there, how do you see modeling the structure of and between note types in a purely functional way?

Thanks for the feedback!

Can you roll out the ::types usage, I’m not following the shorthand at 11PM my time :open_mouth:

My 50p on inheritance and linking:

  1. I’d not include all textual content from A in A’. That would heavily duplicate data and not serve any purpose to me. So I guess that’s where I’m breaking with OOP, somewhat. Then again, if I want to gain access to the method (in programming parlance), I can essentially do

self.parent.METHOD_A

in Obsidian, this would be to me

CTRL+ALT+Left-Arrow to get to the previous note. And then I can just go to the heading I’m looking for.

  1. So in my Parent-Child Meeting Workflow, I am doing two things:
    a) a child has an up-link to its parent, following self.parent basically
    b) a parent, such as a Project, that has meeting-children, (which was my then-usecase), has a Dataview list, collecting all notes with type (ah there I’m already using types, here in this UML I’m intending to change this to class to stick with the OOP paradigm). So I’m asking for:

ALL notes WITH type = ‘meeting’ AND project = self.project

(not actual dataview, you can look it up in the code on my github if you’re keen.

With the new structure I’m designing around “Domains”, I haven’t yet decided, I’m thinking there should be as many useful links TO a Domain as necessary, so that I can follow all tracks pertaining to a domain if I need to think wide. So, say, a Project can link to a domain, and a Meeting too, also a tech note. Also an idea. Anything that is in an actual inheritance structure, like meetings, sources, etc. the links can be auto-generated.

Hope this makes sense. Please keep the feedback coming, my mind is going at 100 Miles thinking about this stuff :slight_smile:

Just to make sure we are speaking of the same level of note elaboration, I’ll note that when I say A’ subset of A, I mean the template (sections) that structure A are also in A’.

For example, I assume all notes X have the id, date, etc while having different “content“. My base note (call it B of type t) is similar
—-

id
Title
date
Aliases
Type
Tags
Keywords

title

summary / description

details / body

References

internal

[[ stuff]]

external

/ citations
—-

Each note type (::structure, ::index, ::concept etc ) add blocks to the above note B. I.e. any Note B’ of type t’ contains the base level structure (above) of B: {meta, title, summary, body, references}.

It was probably clear, but it was this notion of superset (structural) that I was curious re your fidelity at least practically.

Thought on the same thing - creating meta model that configurates the template for each class and example and then enforces it allows obsidian to be frontend for struncture with to do freadom to write anything in “comments” part for example. I am going to do python classes to mvp the idea - stay tuned