Improve implementation of aliases

At first, I must confess that I was a bit surprised by Logseq’s aliases, like @cobblepot

My main use for aliases was to hide my file naming convention (in obsidian), so that [[director.Steven Spielberg]] is displayed as [[Steven Spielberg]] and [[vg.1stperson.Quake]] looks like [[Quake]], while I can still search for director. or 1stperson as a substitute for filtering. (this workflow is kind of broken in logseq currently, see below).
For this specific use-case, I’m all for 1-to-1 alias=page…

BUT after a while, I also see interesting use-cases and nice perspectives for the “logseq” way, so here’s some thoughts:

similarities with obsidian’s aliases:

currently, the core features of obsidian’s aliases (in line with @cobblepot’s vision) are retained :

  • we can link to a source [[page]] using either [[page]] or [[aliaspage]]
  • we can see the same content in [[page]] and in [[aliaspage]], BUT we need to read both the page content AND the linked reference (there is no need to go back and forth between source page and alias page to check for missing content as everything is on both pages, but split into different sections)
    This could be improved by :
    • putting the alias blocks at the top of the linked references
    • adding a label (or any visual indicator such as an icon or color) to separate normal linked refs from aliases’ linked refs

current limitations

  • afaik, aliases are not immediately available in search or autocompletion (the alias page should have content so that the file is created and added to the autocompletion/search list) : this limitation renders my filename obfuscating workflow useless (trying to use aliases to hide my file naming convention)
    → maybe, aliases should be immediately available as autocompletion suggestions (even if the [[aliaspage]] file has not been physically created or is still empty) as soon as they are mentioned, as opposed to a standard page link ?

  • a couple of bugs/issues, like GH issue #1006 make it difficult to have a global view of the whole content split between page content and alias linked ref (the bug is that source page’s sub-bullets appear as top-level blocks and thus, we see duplicated content inside the linked references section)

  • as @tienson suggested, an option to disable the clickable link to [[aliaspage]] from the source page could streamline the workflow if aliases-as-pure-synonyms are all you need.
    However, once created, the alias page would still be accessible via direct search or page link, so the user could inadvertently create separate contents between alias/source ?
    -> in this case, maybe disable writing in the alias ? or provide a WARNING when the page is opened and the option is activated

differences with obsidian’s aliases:

we can add different content in [[aliaspage]] and [[page]], like contextual information relevant to a specific language or topic. some use-cases:

  • it could enable umbrella concepts or hypernyms/hyponyms workflows, that could be super useful in a project/task context like: [[clients]] has aliases [[mrBoo]], [[missJune]] or [[tools]] aliases [[hammer]] [[saw]] so that:

    • on [[20201227]] I need to buy [[tools]]
    • if I go to [[hammer]], I will see the backlink to [[20201227]] I need to buy [[tools]] without the need to write is part of [[tools]] inside the [[hammer page]]
    • this is probably out of the scope of normal alias-ing, but I can see it becoming very useful in some projects as it’s faster to create categories this way
  • or for instance : movies can have multiple titles (depending on the country) or editions [[star wars]] / [[La Guerre des etoiles]] / [[star wars IV : a new hope]] . I will generally refer to [[star wars]] in most of my pages but I can still add specific infos regarding [[star wars IV: a new hope]] like han solo should be shooting first. or Star Wars was retroactively titled Star Wars: Episode IV – A New Hope in 1981 in this specific alias page.
    I could add everything in [[star wars]], but the flexibility to have different content in alias pages is actually a way to be more accurate, as I can split content relevant to a specific version into a specific alias page.

  • [[someone]] alias [[someone.personal]] [[someone.tasks]] [[someone.quotes]] [[someone.games]] would enable different pages relevant to specific aspects of a person in different contexts. (again , everything could be bullets inside a single page, but until we get the everything is a block paradigm, this may be a useful workflow in some situations)

I realize this may sound more like categories: or topics: rather than alias: , but in real-life usage, this seems to be efficient and to work.

That being said, I’m actually very open to hear/see other opinions on this.

I can see the current aliases being useful in a number of different workflows : to help contextualize, to highlight specificities (after all synonyms have nuances, else ,there would be little interest in usings synonyms) , also later on, hopefully I will be able to turn my file naming convention into readable titles in Logseq…

If one wants to limit the feature to behave like obsidian’s aliases, then it’s already possible to have a similar result (albeit, with a slightly different display for content)

so to sum up my view:
once again, I’m delighted to see Logseq trying to find its own way instead of blindly copying features… to the point where I almost regret that we can’t direct link to [[alias]] and [[page]] separately, as it was previously the case.
Maybe an optionnal config setting to restore the previous behavior so that we can experiment further before making a definite opinion (or a branch) ?

1 Like

I just read this whole thread on “aliases”. Not quite understanding the nuances I had to test it.

Logseq v0.0.4.8-9 with Computer set as alias for Computers


Logseq does display both information about both Computer and Computers in either of their respective pages. But they are certainly separate pages.

I then compared against a big wiki such as Wikipedia …
Wikipedia have Computer set as alias/redirect from Computers
Computer - Wikipedia - is the main Computer page
Computer - Wikipedia - is Computers page aliased/redirected to Computer page
When redirected the Computer page has a header with link back to Computers page at
Computers - Wikipedia - where you can see the source with “#REDIRECT [[Computer]]” command and any additional info about the redirect.

Our current Logseq scheme can be closer to Wikipedia alias/redirect method, if when Computers page content is empty, Logseq automatically redirects and show Computer page, that already have a link back to Computers page, if user really wanted to edit that.

4 Likes

that’s indeed a simple and elegant solution ! great post @sabre23t !

if [[aliaspage]] is empty, redirect all links to [[sourcepage]]
if [[aliaspage]] has content, redirect links to the specified page and show the related content as a linked reference

2 Likes

Thank you very much for both the experiments and the explanation!
The example of movies with multiple titles or editions is great!
I’ll try to answer the current limitations:

afaik, aliases are not immediately available in search or autocompletion (the alias page should have content so that the file is created and added to the autocompletion/search list) : this limitation renders my filename obfuscating workflow useless (trying to use aliases to hide my file naming convention)
→ maybe, aliases should be immediately available as autocompletion suggestions (even if the [[aliaspage]] file has not been physically created or is still empty) as soon as they are mentioned, as opposed to a standard page link ?

Good suggestion! Will do!

a couple of bugs/issues, like GH issue #1006 make it difficult to have a global view of the whole content split between page content and alias linked ref (the bug is that source page’s sub-bullets appear as top-level blocks and thus, we see duplicated content inside the linked references section)

We will fix this soon, the plan is to separate the aliases references from the main linked references as what you suggested, again thank you :slight_smile:

as @tienson suggested, an option to disable the clickable link to [[aliaspage]] from the source page could streamline the workflow if aliases-as-pure-synonyms are all you need.
However, once created, the alias page would still be accessible via direct search or page link, so the user could inadvertently create separate contents between alias/source ?
-> in this case, maybe disable writing in the alias ? or provide a WARNING when the page is opened and the option is activated

@sabre23t has shown the Wikipedia way to handle the aliases/redirect situation, I’ll give it a try soon.

Maybe an optionnal config setting to restore the previous behavior so that we can experiment further before making a definite opinion (or a branch) ?

It’s probably a bit late to revert the changes, but we can definitely fix or tweak the behaviors if there’re better ways.

Again, @Cobblepot @cannibalox @sabre23t Thank you very much for the suggestions and insights, now i know it’s not fun to introduce some “half-baked” features and have no documentation at all :smiley:

This should be fixed in v0.0.4.9-8.

1 Like

it’s working great! thank you !

1 Like

I support @sabre23t 's suggestion!

Great! Will work on this soon!

I’ve updated the app to automatically redirects the empty alias page to its source page.
@Cobblepot @cannibalox lmk whether this works for you.

1 Like

It does, but it also redirects a non-empty alias page to its source page. It doesn’t do that for you?

I’ve only tested on a couple of pages but it works fine here : empty pages are redirected to the source page, while alias pages with content have their own link.
It’s indeed a nice solution to provide flexibility while retaining the standard aliasing workflow.

Actually, coupled with the displayedname, this is a great implementation of aliasing workflows, I guess it compares favorably to other pkms out there.

My only minor nitpick : now it’s more difficult to add content to new alias pages from the source page, since the links in ‘alias:’ immediately redirect to the source page.
The workaround is to use the ‘search&create new page’ input box, but it might be interesting to provide direct access to the (empty) aliases pages when we are on the source page to facilitate edits ?
(or maybe : ALT LMB on the alias link could momentarily disable the redirection to the source page).

1 Like

By “have their own link” do you mean “go to the alias page and do not redirect”?

Maybe I’m not understanding the proposed solution. I have page mouse with block mouse content. I have page mice with block mice content. mice is an alias of mouse. The alias page has unique content and is not empty.

When I click on links to mouse and mice, both go to page mouse. I thought that @tienson wanted cases like this (aliases with content) to direct to the alias page, mice, rather than the source page, mouse.

The current way is fine for me anyway because I don’t anticipate having aliases with content, but just trying to get everything clear all around.

Also, @tienson, is the plan to add alias functionality to unlinked references also? I created a page with a block that mentions mice. Since mice is an alias of mouse, I want that block to show up in the unlinked references for page mouse. Currently, it doesn’t. Can this be added?

When I click on links to mouse and mice , both go to page mouse .

Try to re-index your graph first, it might be a cache issue, but it’s possible a bug too.

Also, @tienson, is the plan to add alias functionality to unlinked references also? I created a page with a block that mentions mice . Since mice is an alias of mouse , I want that block to show up in the unlinked references for page mouse . Currently, it doesn’t. Can this be added?

Yes, it’ll be added later, we need to improve the search performance first.

(or maybe : ALT LMB on the alias link could momentarily disable the redirection to the source page).

Good suggestion! Will change it.

(or maybe : ALT LMB on the alias link could momentarily disable the redirection to the source page).

Just deployed the change.

1 Like

What you’re asking for is exactly what I’m looking for… I’m writing a paper about Life Cycle Assessment, which can be abbreviated as LCA, but because logseq treats the two terms as distinct, I’m obliged to use the long form in all of my notes; otherwise, the unlinked refrence will treat them as separate and won’t propose that they be linked.

In a nutshell, we need a mechanism to define the United Nations to be the UN, and for the UN to be regarded the United Nations wherever it is mentioned . or to equate the “7” with “seve” … whenever you search for one of them for both of them to appear in the search results or to be suggested to be linked via the unlinked reference

4 Likes

For me aliases are “synonyms” - additional names for one page. It is common and widely used approach to have several names for one thing.
So, it is vety confusing that in Logseq aliases produce additional pages with potentially different content. It makes everything very complex.

If we want to have additional functionality with aliases, maybe it would be better create another mechanism for that? Don’t overload aliases with comlex functionality.

Two simple solutions is better than one but hard to use and hard to understand.

So, my proposal is: let aliases to be just synonyms of one page. And nothing more.

5 Likes

Related issues: