Hi everyone
I’m stuck with an advanced-query problem:
My page header
subject:: #Medicine
specialty:: [[Rheumatology]]
Note-type:: [[Disease Profile]]
test:: rheumatology ;; ← plain string value
What works
{{query (page-property test "rheumatology")}}
→ shows all pages with that property (so the page property itself is recognised).{{query (tag treatment)}}
etc. → tag queries work as expected.
What fails
I cannot get an advanced query that lists all blocks whose parent page has
test:: rheumatology
.
#+BEGIN_QUERY
{:title "Blocks on pages with test:: rheumatology"
:query [:find (pull ?b [* ])
:where
[?b :block/page ?p]
[?p :block/properties ?prop]
[(= (get ?prop :test) "rheumatology")]]
:view :table}
#+END_QUERY
Running that returns an empty table.
I tried the “entity” pattern as well (assuming the value needed to be a page link) and still got nothing.
What I’m trying to achieve
Return every block (including descendants) that belongs to any page whose page-property line is
test:: rheumatology
.
If I later want to add :block/path-refs treatment
I can—but for now I just need a minimal working example.
Any ideas what I’m missing?
Thanks a lot!