Do Dataview queries replace your MOCs?

it takes some time to generate MOCs manually. I was looking a the Dataview plugin and the first thing that came to my mind was that this plugin could replace the creation of MOCs.

What’s your take on this?

1 Like

I agree that Dataview would automate creation of MOC, but I guess there’s few things to note.

  1. I believe Obsidian Publish still hasn’t supported 3rd party plugin, so your MOC is not valid for that. Same goes if you publish digital garden using other alternatives.
  2. Some people create MOC with some thoughts, “pruning” it to only show the right and relevant links – I believe this provide a benefit, helping with your thinking and thoughts structuring

Anyway, just for sharing (if anyone find it useful) I do use dataview in similar fashion but for daily notes.

  • Instead of using templater to create links to my daily notes inside my weekly (or monthly) note, I use dataview to aggregate.
  • I find this is more relevant to me as I don’t actually write daily (so if I use templater, there will be links only for some of the days)

image

3 Likes

What queries did you use in your screenshot and how did you get the results to display that way? Nifty!

You can, with some Javascript, Templater, and up-to-date dataviewjs “print” the results of a dataview query out to static Markdown for use with Obsidian Publish: @Lise showed how to for an example table! You would have to delete the table and re-insert the template (“Templater: Insert Template” or something like that, do not have to make a new file) in order to update the “printed” results, but worth experimenting with!

1 Like

i took Minimal’s card view (css snippet to change table to that look). here’s my query. btw in my monthly view, i pull key highlights from weekly (which i use summary:: {highlights/summary text}

dataview query
TABLE
	dateformat(file.day,"ccc, MMM dd") as Date
FROM
	"journals"
WHERE
	file.day.weekyear = number(split(this.file.name, "W")[1]) AND
	file.day.year = number(split(this.file.name, "W")[0])
SORT
	file.name ASC

thanks for sharing that workaround for static dataview output. surely will be useful for others

1 Like

I treat MOCs (I call them ‘elephant paths’) both as a creative output in itself as well as navigational aid. Creative output in itself as it is an annotated, evolving, and curated overview of material. It links to other notes, but it’s not just a bunch of links, I explain in the MOC why those links are shown together.
Dataview queries are ‘blind’ in the sense they just list a logically selected range of notes. That can be helpful when starting a MOC (what do I have about X?), and some of my MOCs have Dataview queries in them to list new potential material to be adopted in the MOC.

3 Likes

Thanks to all. Based on your input, it seems that dataview is not replacement, but it complimentary to creating MOCs.

I’ve been grappling with a similar issue lately; I’ll share my thinking in case it sparks something in a reader.

I would love to have some kind of automated MOC that found notes that are related to some subject. I tried to use Dataview to find notes on different subjects, but the results were … crude, I guess. They were missing a lot of notes that I would have considered relevant to the subject (but everything they did contain was generally spot-on).

I thought about this, and briefly tried editing the notes that I wanted in that MOC to have the right tag/metadata/whatever. But then I realized that I was essentially building the MOC myself—just in the individual notes instead of the MOC note. After that, I started just adding the notes to the list myself.

Dataview still had a purpose here, though. I wrote that the notes the queries found were almost all relevant (high precision)—they were just missing a lot (low recall). So I kept that query at the top, but modified it to exclude the notes that were linked from the MOC. It’s almost like a list of orphans on the subject—seeing something new in the results prompts me to either add it to my MOC or recategorize/reorganize it.

Not MOC, but Index in some way.

Index records every files related to a subject. I need to gather every files presenting my “contacts”, Dataview does the job and adds a “phone number” to my table for me. It has to be exhaustive.

MOC are maps I do with conscience. I need this process to be deliberate, as I want to give sens to a very closed number of notes. MOC prepares futur articles in some way, futur important worldbuilding parts, futur parts of my novels. I need to annotate and articulate ideas. Dataview can’t do that for me.

Correct me if I am wrong, but I thought Dataview queries do not appear in Graphview, so I use Dataview queries for indexing eg. Daily Notes, Tasks etc and MOCs for knowledge.

As effective as Dataview is, Moc’s, or Structured notes, or whatever you call them, appear in Graphview (@Carriolan ) and display backlinks. What a search query doesn’t.

You can use this combination of plugins to do it : folder notes and waypoint

there’s a folder note option in the File Tree Alternate View plugin that i use with waypoint and sometimes Auto MoC; zootlekeeper is worth a look too, i have to very narrowly scope it’s influence though ymmv

I coincidentally wrote a post about how I do this: Automated MOCs - My (slightly whimsical) automated-ish setup (I hate how bloated the backlinks function is)

Basically I often have an inkling that a certain topic will eventually become a full-blown MOC, so I have a template for these so-called “proto-MOCs” that will automatically pull related pages out for you. Then you can either choose to incorporate them into your MOC (thereby creating a real connection that will be seen by backlinks and graph view) or you can chose to exclude them with a bit of metadata handling. I think it’s pretty effective at getting the best of both worlds.

But no, dataview can’t replace MOCs.

1 Like

I like to use a dataview query as an inbox for MOCs. I use a basic query to pull in all files that link to said MOC, then I pull links out of that inbox and organize them later. I don’t like to think about organization while I’m working on ideas, this helps with that.

For example:

It’s the quickest way I’ve found to generate a MOC from scratch. It requires no thought and doesn’t distract from the idea I’m working on, but ensures that I eventually organize everything.

I wrote about all the details here, if that process sounds interesting to anyone: Quick Tip: Quickly Organize Notes in Obsidian - Obsidian Rocks

2 Likes

Hey I really like the approach you have here. I’m guessing the query you shared goes in your monthly note, yes?

May you please share the one you use for the weekly one?

hey @Psypher1, you can refer the dataview code blocks below. it may seems complex at first (especially if you’re still new to DQL), but have a look first and just reply back if need to clarify.


On My Daily Notes

I have only single dataview block – to pull the related week and the “This Week” page

TABLE WITHOUT ID file.link
WHERE
	(number(split(file.name, "W")[1]) = this.file.day.weekyear AND
	  contains(split(this.file.folder,"/"),"journals") ) OR
	file.name = "Weekly Review"

On My Weekly Notes

I have two dataview – one to pull the dailies, another the related month and year

TABLE
	dateformat(file.day,"ccc, MMM dd") as Date
FROM
	"journals"
WHERE
	file.day.weekyear = number(split(this.file.name, "W")[1]) AND
	file.day.year = number(split(this.file.name, "W")[0])
SORT
	file.name ASC
TABLE WITHOUT ID file.link
FROM "journals"
WHERE
(
	number(split(file.name, "-")[0]) = this.start-date.year AND
	number(split(file.name, "-")[1]) = null
) OR (	
	number(split(file.name, "-")[1]) = this.start-date.month AND
	number(split(file.name, "-")[2]) = null AND
	!contains(split(file.name,"-"),"W")
)

On My Monthly Notes

I have two dataview – one to pull weekly, another the related year

TABLE
	dateformat(start-date, "MMM dd") + " - " + dateformat(end-date, "MMM dd") as Weekdate,
	subtitle,
	summary
FROM
	"journals"
WHERE
	number(split(file.name,"W")[1])  >= date(this.file.name).weekyear AND
	number(split(file.name,"W")[1])  <= (date(this.file.name) + dur(1month) - dur(1day)).weekyear AND
	contains(file.name,"-W")
SORT file.name DESC
TABLE WITHOUT ID file.link
FROM "journals"
WHERE
	number(split(file.name, "-")[0]) = number(split(this.file.name, "-")[0]) AND
	number(split(file.name, "-")[1]) = null
1 Like

Thank you for getting back. I struggle along with dataview.

I’m guessing now I should adjust my question after I tell you my note structure.

My daily notes seem to be the same format as yours: 2022-10-20
My weekly notes are: 2022-W42
My monthly notes are: 2022-M10

I would like it such that I have a list of all my daily notes in the weekly note.

My questions are:

  1. When do you generate your weekly notes? - i do mine on Sundays to review the previous week. Monthly I do on the first day of the month

What I don’t understand is this part

WHERE file.day.weekyear = number(split(this.file.name, "W")[1]) AND
	file.day.year = number(split(this.file.name, "W")[0])

this will vary based on the individual. for me, i treat weekly notes similar to gtd process, i create them on weekends to plan ahead and I also open the current week’s note to reflect and review. same goes for monthly notes.


i want to find all the daily notes that belong in the same weekyear (1-52) as the weekly note. since my daily notes are in the “YYYY-MM-DD” format, I can use dataview’s file.day (see Implicit Fields - Data Annotation - Dataview).

i find the W in the file name and split the file name into two strings (e.g. 2022-W42 become “2022” and “42”). for weeks i refer to [1] which is the second part, for year the [0]. i have they file.day.year as filter because i have been using obsidian for 2 years (so there’s two W42 already in my obsidian notes).

i supposed there could be a more elegant DQL code, but since that works for me, i’m all good :sweat_smile:

1 Like

Alright, I see …

So what I need is to find all daily notes that belong in the week before.

This sort of gets me what I want

WHERE file.day.weekyear = number(split(this.file.name, "W")[1]) -1 AND file.day.year = number(split(this.file.name, "W")[0])

I can’t be sure until I’ve made this week’s note. I’ll update you on

Thank you once again.

Now to see about that monthly note…