Understanding Page and Block Relations in LogSeq (Part 3)

- 5 min read

In Part 2, we explored how to query basic relation types using advanced queries in LogSeq. This continuation delves into weighting these different types of relations.

Important Notes

During the development of the weighting system, I discovered several defects in the previous relationship listings. While I attempted to use new notation and Mermaid diagrams to cover all cases, this proved to be time-consuming. I’ve decided to focus on the main content for now, with updates to Parts 1 and 2, including new notations and diagrams, coming in the future.

First-Degree Relations

First-degree relations represent direct connections between elements in LogSeq. The new notation system is structured as follows:

Notation Format: {node} {relation}

First-degree relations include:

Second-Degree Relations

Second-degree relations represent indirect connections derived from combining two first-degree relations.

Notation Format: {link type}{node} {1st relation} {2nd relation}

Categories of second-degree relations:

Methodology and Research Notes

The evaluation methodology combines quantitative and qualitative factors:

  1. Primary Factors (Scale 1-3):

    • Usage frequency (quantitative, based on personal usage data)
    • Dereference complexity (qualitative, the less the better)
  2. Secondary Factors (Scale 1-5):

    • Relation specificity (quantitative, based on maintenance cost)
    • Lineal relation (qualitative, prefer parent relation type)

The final evaluation score uses the formula: primary^3 * secondary^1 to appropriately weight the factors while preventing edge cases where high secondary scores might overshadow primary importance.

Evaluation Result

noitemgroupprimarysecondaryevalrank
1=P MP MPOIR341081
2=B CP CPOIR23245
3=B CP CBOIR221610
4=B CB CBOIR21813
5~B CB BPDBE15517
6~B CB CPDBE14418
7~B CB CBDBE13320
8~B CB UBDBE12222
9~B CB DBDBE11127
10~B CP BPBDP14419
11~B CP MPBDP13321
12~B CP DPBDP12223
13~B CP PBBDP11128
14~P MP UPPDP24323
15~P MP DPPDP23246
16~P MP MPPDP221611
17~P MP PBPDP21814
18~P PB CB1BB23247
19=B CB DB1BB12224
20=B CB UB1BB11129
21~P PB CP1BP23248
22=B CP DB1BP12225
23=B CP UB1BP11130
24~P UP MP1PP23249
25=P UP MP1PP221612
26=P PB MP1PP11131
27=P DP DP2LD131274
28=B DB DB2LD121815
29~P UP UP2LD232542
30~B UB UB2LD221816
31~P DP PB2LPB12226
32~P UP PB2LPB11132

Sorted by rank

noitemgroupprimarysecondaryevalrank
1=P MP MPOIR341081
29~P UP UP2LD232542
14~P MP UPPDP24323
27=P DP DP2LD131274
2=B CP CPOIR23245
15~P MP DPPDP23246
18~P PB CB1BB23247
21~P PB CP1BP23248
24~P UP MP1PP23249
3=B CP CBOIR221610
16~P MP MPPDP221611
25=P UP MP1PP221612
4=B CB CBOIR21813
17~P MP PBPDP21814
28=B DB DB2LD121815
30~B UB UB2LD221816
5~B CB BPDBE15517
6~B CB CPDBE14418
10~B CP BPBDP14419
7~B CB CBDBE13320
11~B CP MPBDP13321
8~B CB UBDBE12222
12~B CP DPBDP12223
19=B CB DB1BB12224
22=B CP DB1BP12225
31~P DP PB2LPB12226
9~B CB DBDBE11127
13~B CP PBBDP11128
20=B CB UB1BB11129
23=B CP UB1BP11130
26=P PB MP1PP11131
32~P UP PB2LPB11132

Conclusion

This research establishes a foundational framework for evaluating second-degree relationships in LogSeq, offering several key contributions:

  1. A quantitative baseline for determining correlations between second-degree relationships, enabling more efficient discovery of indirectly related topics
  2. A unified, succinct notation system for describing complex relationships between pages and blocks, providing a solid foundation for future research
  3. A novel approach to relationship metrics that considers both direct and indirect connections, allowing for more comprehensive topic analysis

These advances open new possibilities for knowledge graph analysis and relationship-based content organization in LogSeq and similar tools.

Research Notes and Methodology Insights

This initial research effort presented several interesting challenges and learning opportunities:

Notation Development

Evaluation Framework Design The evaluation methodology was developed through a systematic approach:

  1. Relationship Grouping

    • Similar relations were clustered to establish coherent categories
    • Secondary factors were evaluated within group contexts (scale 1-5)
    • Primary factors were assessed globally (scale 1-3)
  2. Scoring System

    • Implemented the formula primary^3 * secondary^1
    • This approach successfully prevents edge cases where high secondary scores (e.g., 1 primary, 5 secondary) might inappropriately outweigh more significant relationships (e.g., 2 primary, 1 secondary)
    • Balances quantitative data with qualitative insights

Future Research Directions

This research represents a first step toward a more rigorous understanding of knowledge graph relationships, with significant potential for expansion and refinement in future work.