Here there are my understandings so far of data structures available on Logseq, feel free to comment and eventually correct me:
- More than the “pages are collections of blocks” I like “pages are blocks with a name”.
- We have indentation to create hierarchies between blocks.
- Indentation of blocks can create hierarchies between pages too, the trick is using blocks containing only a reference to a page:
- [[Parent]] - [[Child]] - [[Teddy]] - Some text (eventually)
- Every page mentioned (parent, child, teddy) will have a backlink to the others at the bottom, something like:
[[Parent]] > [[Child]] > [[Teddy]]
- And we can have as many hierarchies as we like mentioning the same page. Here there is an example with
[[Mathematics]]
page serving as an “index” of two different hierarchies:Mathematics - Branches - [[Algebra]] - [[Linear Algebra]] - [[Group Theory]] - ... - [[Geometry]] - [[Euclidean Geometry]] - [[Topology]] - ... - Resources - [[Theorems]] - [[Linear Algebra]] - [[Topology]] - ... - [[Definitions]] - [[Algebra]] - ...
- Pages names can create hierarchies with
[[parent/child/teddy]]
syntax and these are better described as “namespaces”.- In programming languages and informatics we use the concept of namespaces to avoid ambiguity.
- For example
[[Fruits/Apple]]
and[[Companies/Apple]]
, but a case like this, with almost only one element in common between[[Companies]]
and[[Fruits]]
doesn’t justify the introduction of these hierarchies that weighten the syntax. This particular example is better solved by two pages like these:[[Apple (Fruit)]]
and[[Apple (Company)]]
(Wikipedia uses this method). If one want to display just “apple” or in general replace the page name with something else when mentioning it, there is the[]()
syntax. - So what are use cases for namespaces? The cases with huge overlap of childs names between different parents, for example:
- Books’ chapters, lessons numbers:
[[My New Book Title/Chapter 1]]
[[Another Book/Chapter 1]]
[[An Online Course/Lesson 1]]
[[An Online Course/Lesson 2]]
- They can be more compact:
[[My New Book Title/1]]
[[Another Book/1]]
[[An Online Course/1]]
[[An Online Course/2]]
- The children names (in these case just the numbers 1, 2, …) makes sense only if associated with a parent page.
- But remember: the children are pages and it makes sense to create them only if you want to mention them using their names somewhere else (pages are blocks with a name…). Otherwise they can just be indented blocks:
and one can still browse them individually (by clicking on children’s bullet points), so no need to turn children into pages withParent (page title) - Child 1 - lorem ipsum dolor sit amet - ... - Child 2 - amet sit dolor ipsum lorem - ...
[[parent/child]]
syntax if one don’t need to use that syntax to reference them. - Another use case for namespaces could be (I’m still experimenting with it) a quick way to browse queries:
-
[[Theorems]]
contains a query listing all pages/blocks with a property liketype:: theorem
[[Geometry/Theorems]]
contains a query listing that does the same withtype:: theorem
andarea:: geometry
[[Theorems/Geometry]]
does exactly the same but this way I can use namespaces’ “hierarchy” section at the bottom of pages to quickly browse them:Hierarchy [[Geometry]] > [[Theorems]] [[Geometry]] > [[Definitions]] Hierarchy [[Theorems]] > [[Geometry]] [[Theorems]] > [[Algebra]]
- This use case is a almost workaround for the lacking UI/UX of queries though. If there was a quick way to toggle filters to queries this hack could be useless.
-
- Books’ chapters, lessons numbers: