I’ve seen several orphan-finding and dynamic MOC / index dataviews, but still can’t create what I would need to stop relying on folders.
The typical auto-MOC shows “all inlinks to this files but no outlinks”. And orphan-finders show, “all files not linked to this file” , or “all files with no outlinks or inlinks”.
I’m trying to go one level deeper, to create “show all files that aren’t linked to this file’s outlinks”.
For example, Home MOC setup like:
Dataview: show all files that aren’t linked to any of the above (outlinks of this file).
I know how to set this up manually, adding each link to the DV code.
Is there a way to get it to work without having to update the dataview everytime I add a link to the Home MOC? That way I can keep adding to this Home MOC, and anything linked to whatever I add, I will consider “filed”. Anything not linked to whatever is on it, I want to surface, these are the orphans I’m looking for.
What I’ve tried many variations of:
List from ""
where !contains(this.file.outlinks, file.inlinks)
paging @mnvwvnm any advice would be much appreciated!
Sorry @mnvwvnm, I wasn’t more clear. I meant all files that are not linked to or from this file’s outlinks. Neither inlinks or outlinks.
Yes @Craig I think we’re talking about the same thing. Thank you for the suggestion! But it still surfaces this file’s outlinks for me, though I did add one line, to focus it on a folder. After the “TABLE” line, I added
Thank you! It seems like it’s doing exactly what I was asking for!
Though I prefer it into a simple list form with:
FROM "Δ" AND -outgoing([])
WHERE !filter(this.file.outlinks, (o) => contains(file.outlinks, o) OR contains(file.inlinks, o))
sort file.name asc
I hope more people will see this post. I’m surprised anyone interested in dataview MOCs isn’t looking for this solution. Its like using a single Dataview to emulate the functionality of folders. My biggest problem with using fewer folders is that notes get “lost”. I can’t tell what has already been “filed”. This solves that with a single Home.md note and a single dataview. It should be built-in!
Another helpful view, if you want this orphan dataview to be on a different note, but still referencing your “Home MOC” note, try:
FROM "" AND -outgoing([[Home MOC]]) AND -#tag_to_exclude
WHERE !filter([[Home MOC]].file.outlinks, (o) => contains(file.outlinks, o) OR contains(file.inlinks, o))
sort file.name asc