But because current-page or query-page lower cases the page title, I have to assign tasks to “@john” instead of “@John”, which does not look great, and is easy to forget, which would result in missing results.
Is there a way to lower case the assigned value in the query so it matches the current-page?
is equivalent to (property ?b :assigned ?current-page) except that it puts the property value in a variable instead of matching it against ?current-page.
Yes. But we will need a slight change. ?assigned is now no longer a string, but instead is a set. (because it is a link to a page)
When we change [?b :block/properties ?prop] to [?b :block/properties-text-values ?prop]
The output for a property as assigned:: [[John-Al Doe]] changes from #{"John-Al Doe"}, which is not a string, to [[John-Al Doe]] which is the literal value of the property as a string.
Probably also need to remove the "$" from [(str "(?i)" ?current-page "$") ?regex_s] as the end of the string is now ]]