Could use double negation:
(not ; and there is no
[?parent :block/refs ?t2] ; reference in the parent
(not [?b :block/path-refs ?t2]) ; that does not also exist in the TODO
)
…and get:
Could use double negation:
(not ; and there is no
[?parent :block/refs ?t2] ; reference in the parent
(not [?b :block/path-refs ?t2]) ; that does not also exist in the TODO
)
…and get:
@mentaloid @Siferiax
thanks both.
I will try both solutions
In my case i have 3 references
[[Meeting]] with [[Siferiax]] and [[Fede]]
In the query I add the code
(not [?t1 :block/name "meeting"])
not to consider the page meeting.
How to get the TODO in common between Siferiax and Fede?
I tried this but it is not working
#+BEGIN_QUERY
{ :title [:h6 [:mark "QUERY"]]
:query [:find (pull ?b [*])
:in $ ?parent
:where
[?parent :block/refs ?t1]
[?parent :block/refs ?t2]
[?parent :block/refs ?t3]
[(!= ?t1 ?t2 ?t3)]
(not [?t1 :block/name "@meeting"])
(not [?t2 :block/name "@meeting"])
(or-join [?b ?t1]
[?b :block/path-refs ?t1]
(and [?t1 :block/alias ?a]
[?b :block/path-refs ?a]))
(or-join [?b ?t2]
[?b :block/path-refs ?t2]
(and [?t2 :block/alias ?a]
[?b :block/path-refs ?a]))
[?b :block/marker ?marker]
[(contains? #{"LATER" "NOW"} ?marker)]
(not [?var :block/refs ?b]
[?var :block/parent ?parent])
]
:inputs [:parent-block]
:table-view? false
:result-transform (fn [result]
(sort-by (fn [m]
(get m :block/marker)) > result))
:breadcrumb-show? false
:collapsed? false
}
#+END_QUERY
Hi @mentaloid
If I add your code nothing happened.
Probably I need to add somehting more?
@meeting
?var
#+BEGIN_QUERY
{:title [:h6 [:mark "QUERY"]]
:query [:find (pull ?b [*])
:in $ ?parent
:where
[?parent :block/refs ?t1]
(or-join [?b ?t1]
[?b :block/path-refs ?t1]
(and
[?t1 :block/alias ?a]
[?b :block/path-refs ?a]
)
)
(not
[?b :block/path-refs ?meeting]
[?meeting :block/name "meeting"]
)
(not ; and there is no
[?parent :block/refs ?t2] ; reference in the parent
(not [?t2 :block/name "meeting"]) ; excluding its reference to meeting
(not [?b :block/path-refs ?t2]) ; that does not also exist in the found block
)
[?b :block/marker ?marker]
[(contains? #{"LATER" "NOW"} ?marker)]
(not
[?var :block/refs ?b]
[?var :block/parent ?parent]
)
]
:inputs [:parent-block]
:table-view? false
:result-transform (fn [result]
(sort-by (fn [m]
(get m :block/marker)) > result
)
)
:breadcrumb-show? false
:collapsed? false
}
#+END_QUERY
Hi @mentaloid
I tried to use your Query and this is the results
As you see “My Query” provides all the tasks for Leadership and Wellbeing individually and together, but “Your Query” does not provide anything to me, why?
This is the code of “My Query”
#+BEGIN_QUERY
{ :title [:h6 [:mark "My QUERY"]]
:query [:find (pull ?b [*])
:in $ ?parent
:where
[?parent :block/refs ?t1]
(not [?t1 :block/name "@meeting"])
(or-join [?b ?t1]
[?b :block/refs ?t1]
(and [?t1 :block/alias ?a]
[?b :block/refs ?a]))
[?b :block/marker ?marker]
[(contains? #{"LATER" "NOW"} ?marker)]
]
:inputs [:parent-block]
:table-view? false
:result-transform (fn [result]
(sort-by (fn [m]
(get m :block/marker)) > result))
:breadcrumb-show? false
:collapsed? false
}
#+END_QUERY
This is the code of “Your Query”
#+BEGIN_QUERY
{:title [:h6 [:mark "Your QUERY"]]
:query [:find (pull ?b [*])
:in $ ?parent
:where
[?parent :block/refs ?t1]
(or-join [?b ?t1]
[?b :block/refs ?t1]
(and
[?t1 :block/alias ?a]
[?b :block/refs ?a]
)
)
(not
[?b :block/path-refs ?meeting]
[?meeting :block/name "@meeting"]
)
(not ; and there is no
[?parent :block/refs ?t2] ; reference in the parent
(not [?t2 :block/name "@meeting"]) ; excluding its reference to meeting
(not [?b :block/path-refs ?t2]) ; that does not also exist in the found block
)
[?b :block/marker ?marker]
[(contains? #{"LATER" "NOW"} ?marker)]
]
:inputs [:parent-block]
:table-view? false
:result-transform (fn [result]
(sort-by (fn [m]
(get m :block/marker)) > result
)
)
:breadcrumb-show? false
:collapsed? false
}
#+END_QUERY
Any help to understand why this is happening in my graph?
thanks a lot for the time you spend on this.
As I said:
In that case, the assumption was that the only excluded reference was that to @meeting
. But in your example there is one more reference, that to @meeting/follow-up
. Missing that returned no block at all. And we had no way to guess that by your previous posts. Therefore, should replace this:
(not [?t2 :block/name "@meeting"]) ; excluding its reference to meeting
…with this:
(not [?t2 :block/name "@meeting"]) ; excluding its reference to @meeting
(not [?t2 :block/name "@meeting/follow-up"]) ; and to @meeting/follow-up
@mentaloid Thanks for taking the time to explaining to me.
It does work.
Most elegant solution will have to keep this in mind.