I want to use Logseq to document meetings and other things with people. Therefore I link to people, where each person has a page. On said page I want also to include a section / block where connections of this person are listed / linked. The only relation is: person A knows person B, C,… so far so good. Now when I create the page for person B I need to enter the same information in that block of the page for person B: person B knows person A and more.
On the page of person B I do not want to enter in the same location, that person B knows person A, as I have to enter the same info twice. What is the best workflow for this?
This is easy with two people but multiple its difficult. if A knows B, C, D but B only A and D and D knows C and A
Is it possible to use a block on each persons page and under this list all related people pages. If another person page (B) has the current person (A) under its block, automatically add person B to persons A under the connections block. I’m also open if queries work somehow.
I don’t want to use the related links on the bottom, as there would events, meetings, etc. be located from links of other pages, and the connections/links to other people would get lost.
I don’t want to keep track of these soft associations on all other pages.
I create a page per person and on that person’s page I have a segment / block connections under which I manually link all persons they know.
Let’s say A knows B, I would put on page A: [[B]]. So I see that person A knows person B.
Currently I also have to add on page B: [[A]] under the section/block connections.
I know these appear under linked references on the bottom of the page but I want the connections under all under one block.
Is this possible?
Would I need a separate page to keep track of all pairs or people they know?
on the connection page I type a block for each connection pair, e.g. [[A]] [[B]]
I’ve tried queries on page [[A]] like this:
{{query (any (linked (page “connections”) (not (page this())) ) )}} → no result
{{query (any (linked (page “connections”) (not (page [[A]])) ) )}} → no result
{{query (any (backlink (page “connections”) (regex (.[[[this]]].) )) (not (page this())) )}}
and advanced queries like:
#+BEGIN_QUERY
{:title “People connected to this person”
:query [:find (pull ?other-person-page [:block/title])
:in $ ?person-page
:where
[?connection-page :block/multi-ref-pages ?person-page]
[?connection-page :block/multi-ref-pages ?other-person-page]
[(not= ?person-page ?other-person-page)]]
:inputs [:current-page-id]}
#+END_QUERY
Either I get all results or none. I struggle with removing the link/reference to the own current page. On page [[A]] it should not display [[A]] [[B]] but only [[B]]. On page B it should only display [[A]]. I also have problems with using something like “currentpage” so I won’t need to adjust the query to each sites name.
And here is an improved version of your advanced query:
#+BEGIN_QUERY
{:title "People connected to this person"
:query [:find (pull ?other-person-page [*])
:in $ ?person-page-name
:where
[?connections-page :block/name "connections"] ; in page named connections
[?connection :block/parent ?connections-page] ; find any of its blocks that
[?person-page :block/name ?person-page-name] ; the page of the current person
[?connection :block/refs ?person-page] ; is referred by
[?connection :block/refs ?other-person-page] ; and they also refer to another page (to be listed)
(not [(= ?person-page ?other-person-page)]) ; different than the current one
]
:inputs [:current-page]
}
#+END_QUERY
I’m coming back to that working query because I tried to adjust it to look through all pages (or at least all journal pages) instead of just looking through the page with the name “connections”.
Instead of [?connections-page :block/name "connections"] I tried it with [?connections-page :block/page ?page ] but the results are not correct and I cannot explain where they are coming from.
I’ve tried a workaround by making a query on the “connections” site which just lists all blocks, but it seems the query above is not able to look through results of other queries on the target pages.