obsidian-simple-note-review icon indicating copy to clipboard operation
obsidian-simple-note-review copied to clipboard

Note sets created with other metadata

Open ontrou opened this issue 2 years ago • 9 comments

I don't use tags or folders in my vault (call me crazy), but I use plenty of other metadata. It's not clear to me how to structure the DataviewJS query to create a note set using metadata that is not tags or folders. Is it possible? Can you give an example? Thank you so much for your plugin. It fills a crucial niche.

ontrou avatar Jan 28 '23 20:01 ontrou

@ontrou sure! Dataview allows to access note's metadata as a property. For example, to get all pages where 'type' metadata property equals 'observation', use this query: dv.pages().where(p => p.type === 'observation)`. This should work!

dartungar avatar Jan 29 '23 05:01 dartungar

@dartungar I am so glad to hear this!. But I got this parsing error with this query: dv.pages().where(p => p.sub === '[[Resource]]') I reinstalled the plugin, tried different metadata, and got the same error:

`plugin:simple-note-review:173 Simple Note Review - dataview API error: Failed to parse query in 'pagePaths': Error: -- PARSING FAILED --------------------------------------------------

1 | dv.pages().where(p => p.sub === "[[Resource]]") | ^

Expected one of the following:

'!', '(', '-', 'csv(', 'outgoing(', file link, string, tag ('#hello/stuff')

eval @ plugin:simple-note-review:173 plugin:simple-note-review:573 Error while trying to get next note in noteset "dv.pages().where(p => p.sub === "[[Resource]]")" via Dataview API. Please check noteset settings and/or disabling and enabling Simple Note Review plugin again. eval @ plugin:simple-note-review:573`

ontrou avatar Jan 29 '23 06:01 ontrou

@ontrou this may be some internal plugin error, as dataview syntax seems to be correct. will look into it hopefully soon.

dartungar avatar Feb 03 '23 09:02 dartungar

@ontrou new 1.2.0 version should help with Dataview validation. Please report if you still see any errors!

dartungar avatar Dec 06 '23 16:12 dartungar

Thank you for keeping this issue on your radar. I stopped using Simple Note Revew because of this issue, but re-installed it (v1.2.1) when I saw this post. I still can't get the DataviewJS query to work. The message is: notset review queue is empty. I refreshed, reinstalled, restarted… still no go. Really like your approach to doing a note review. Will definitely keep your plugin on my radar too.

ontrou avatar Feb 05 '24 23:02 ontrou

@ontrou does this dataviewJS query match notes if used without SNR? Could you provide the full query?

dartungar avatar Feb 17 '24 08:02 dartungar

Yes, the dataviewJS query outside of SNR does match notes. My query is: dv.pages().where(p => p.fileClass === 'Source')

ontrou avatar Feb 17 '24 23:02 ontrou

@ontrou I see what might be the problem here. SNR accepts only what you'd put into dv.pages() as an argument, e.g what you'd put into FROM clause, but not what you'd put into WHERE clause. This is because there's no way to execute full dataviewJS code and get the results as list of note paths, at least none that I know of.

Any help with that would be appreciated.

dartungar avatar Feb 18 '24 12:02 dartungar

@dartungar Oh, I see. I vaguely wondered if that was the issue. My problem is that I don't use folders or tags, but I do use a other metadata. Thanks for explaining. I'll think on it and get back to you.

ontrou avatar Feb 19 '24 02:02 ontrou