Knowledge Management dataview examples

name Add Topic
type note(New Topic) template
action Knowledge Topic Template
class dataview-button

table importance, file.mtime as Last_Modified__, pillars as Pillars__________________, habitsRoutines as Habits_and_Routines___, courses-and-training
from #knowledgeTopic
sort file.mtime desc

#knowledgeTopic

Status:: Active
Importance::
Goals::
Pillars::
Habits and Routines::
Courses and Training::

Relevant Resources

Notes & Ideas

table file.mtime
from ""
where contains(knowledge-topic, this.file.link)
sort file.mtime asc

Media

table file.mtime
from #media or #articles or #books or #podcasts or #tweets or #videos 
where contains(knowledge-topic, this.file.link)
sort file.mtime asc

Source

table file.mtime
from #source 
where contains(knowledge-topic, this.file.link)
sort file.mtime asc

Resources

table file.mtime
from #resources
where contains(knowledge-topic, this.file.link)
sort file.mtime asc

Tools + Apps

table file.mtime
from #tools or #apps 
where contains(knowledge-topic, this.file.link)
sort file.mtime asc

Courses

table file.mtime
from #courses or #coursesTraining 
where contains(knowledge-topic, this.file.link)
sort file.mtime asc

In the Productivity example above I would have Knowledge Topic:: [[Productivity]] somewhere in the note for whatever course, media, note etc.

Related:

20 Likes

This looks awesome!! I have some questions about implementation because Iā€™m still pretty unfamiliar with dataview.

  1. Is your metadata actually YAML metadata or is it just regular text with links?
  2. Why do you used double colons in your metadata? Is it an aesthetic preference or does it interact with dataview in some way?
2 Likes

I write almost all of my metadata in field:: value syntax within the page body as dataview will recognize that format the same as it would yaml frontmatter.

Iā€™ve written this elsewhere but here are some reasons I prefer inline metadata to yaml:

  1. A link in yaml doesnā€™t show as a backlink.
  2. If you rename a page you have linked in yaml the link doesnā€™t auto update like it will in the page.
  3. yaml doesnā€™t allow for linking something like [[@person]] and this is how all of my people pages are titled.
  4. I like to write inline as I find it much more natural and can give me more context.
  5. Fields inline seem to be much more forgiving as far as syntax goes vs yaml. You can use normal lists, format with markdown, etc. yaml seems fragile to me.

Hope that helps!

12 Likes

This helps a lot, thank you! Iā€™ve been dying for an alternative to YAML and wondered if the double colon was such an alternative, but I apparently didnā€™t search for the right thing to figure it out. Time to go change my templates!

First of all, what you are sharing is very useful so thank you.
Second, I have a quick question that I am hoping you can answer since you seem to know a lot about this plugin. I generally prefer to use fields inline as well, but it seems that it does not accept bull list values as in YAML. For example:
field::

  • value 1
  • value 2
  • etc

Here, the values are not recognized by Dataview! I know that I can write it as a list in one line separated by columns, but this reduce legibility of the values if they are long sentences rather than just simple words.
A workaround Iā€™ve found is to repeat the field multiple times, ex:
field:: value 1
field:: value 2
field:: etcā€¦
but this is quite far from being an elegant solution.
Do you by any chance know of a way to get this to work?

3 Likes

@arminta - This is awesome!

Iā€™ve tried to demo this with a new Knowledge Topic called ā€˜Mappingā€™ using the Knowledge Topic template, but the ā€˜Notes and Ideasā€™ codeblock keeps pulling in all my vault files even though none contain the knowledge topic

table file.mtime 
from "" 
where contains(knowledge-topic, this.file.link) 
sort file.mtime asc

Do you have any suggestions here? Thanks!

You Need to put the quotation marks around ā€œthis.file.linkā€.

1 Like

Oh thanks! Do I have to wrap all the other code blocks this.file.link with double quotes as well?

Try this:

table file.mtime 
from "" 
where contains(knowledge-topic, "this.file.link") 
sort file.mtime asc

Hope it works.

1 Like

Works great. Thanks!

1 Like

@arminta Hi Sarah,
For your date fields, 1) can you show how you are entering in your create/ due/defer/recurrence dates into a task?
2) how do you compute these in DV?
Ideally, I wanted to have:
CreateDate:: [[20210910]]
for example, but this doesnā€™t seem to fall into the DV. Tried:->
CreateDate:: date([[20210910]]) among others.

Ideally, I wanted to not need to create a new file for each task, and have the ability to add a number of variables to a single line.