jplattel / obsidian-query-language

An Obsidian plugin allowing you to query your notes
176 stars 6 forks source link

Inconsistent output from same query #31

Open patowod opened 3 years ago

patowod commented 3 years ago

Hi, I absolutely love OQL but am having some issues with consistency. Maybe you can give me a hint as to why this is or if it is maybe a bug? The overall idea is to be able to use e.g. mentions in daily notes and when viewing an author directly, getting a running list of all daily notes. My folder setup:

|--- Vault root (Containing the majority of notes)
|          |--- @ (Folder containing notes on events, people and so on)
|          |--- Other folders
|          |--- …
|          |--- …
|--- workbench.md
|--- other notes
|--- …

Within the "@" folder I have a test setup with three notes

|--- John Doe
|        |--- Contains OQL Block as shown below
|        |--- Mentions [[@/Jane Doe]]
|--- Jane Doe
|        |--- Contains OQL Block as shown below
|        |--- Mentions [[@/John Doe]]
|--- Jeff Doe
|        |--- Mentions [[@/John Doe]]
|        |--- Mentions [[@/Jane Doe]]

Within workbench.md I also have the same content as in Jeff Doe but at the top of the note, so essentially: [[@/John Doe]] [[@/Jane Doe]]

name: Unique name
query: "'@/Jane Doe" (obviously @/John Doe, within the John note)
template: "list"
format: "{name}: {count}"

Now for the results:

Observation

Within Jane note: If I take the mention of John and move it out of the list the mention was originally in and move it to the top first line of the note it suddenly appears as a result in the note of John – same goes for the Jane note. As soon as I move the mention into the content it disappears from results (So far I tried using "content" within the query but had no luck with this). After this observation I opened workbench.md and moved John from the top to a list within the note, or inline with some text. In both cases John note still lists the workbench.md as a result (persistent even if I quit and restart obsidian).

I’m totally puzzled: If I am missing something I really can't see it and would appreciate any help or pointer to a solution. Thanks in advance :)

patowod commented 2 years ago

Anyone out there? This issue persists.


Edit: For anyone else interested. With Dataview this is a one-liner:

LIST FROM <source>

Source: https://blacksmithgu.github.io/obsidian-dataview/query/queries/