Advanced query to find a word in a child block

Hi, I don’t know if anyone can help me with this. All the articles that I have read contain the child block called “Abstract” - now I am trying to create an advanced query to find specific words in those blocks but so far I got stuck here

{:title “Articles with the word FALSE in Abstract”
:query [:find (pull ?child [*])
[?parent :block/name “Abstract”]
[?child :block/parent ?parent]
[?child :block/content ?content]
[(clojure.string/includes? ?content “false”)]]}

Any idea would be appreaciated! Thank you!

What does this mean? Could you provide some example blocks?

This assumes the name "Abstract" to the ?parent block. But there are some issues:

  • You just said that “Abstract” is how the child block is called.
  • :block/name is the name of a page.
    • Common blocks don’t have names.
  • :block/name is always in lower case. Either:
    • replace "Abstract" with "abstract"
    • use :block/original-name

This is and example of children block Abstract (The main page is called Library, each letter is a block, then the name of the article and then the Abstract with the content)

Thank you for the suggestions! I gonna try them. I am very new with this

Here are some options:

  • Check the content of the parent:
    [?parent :block/content ?parent-content]
    [(= ?parent-content "Abstract")]
    • That is for the exact name.
      • Otherwise use [(clojure.string/includes? ?parent-content "Abstract")]]}
  • Check against a tag:
    • Turn the word Abstract into a tag (i.e. #abstract or [[abstract]])
      [?parent :block/refs ?parent-ref]
      [?parent-ref :block/name "abstract"]
      • That is if you can easily replace them without side-effects.
    • Use the existing tag #CW-Abstract
      [?child :block/refs ?child-ref]
      [?child-ref :block/name "cw-abstract"]
      • That is if it is present in all or most abstracts.

Okay, the option of turning Abstract in to a tag was my next step and I think I am gonna choose that.

Thank you for your time and wisdom!