Blocks with a tag property

I’m struggling with this query idea, but I’m not sure if it is possible to be done. I have some pages with the property type:: Person. I want to query all blocks with a TODO task status and a page reference to a page with the type Person.
I tried to write

{{query (and (task TODO) (page-property type Person)  }}

but this returns only blocks written IN the page, and not a general block with the tag. I want to write in journals some TODOs and tagging people, and i want to query al todos with people tagged.
If I have to use an advanced query can you suggest an example?

Welcome. Try something like this:

#+BEGIN_QUERY
{:query [:find (pull ?b [*])
   :where
     (page-property ?p :type "Person")
     [?b :block/refs ?p]
     [?b :block/marker ?m]
 ]
}
#+END_QUERY
3 Likes