oniony / TMSU

TMSU lets you tags your files and then access them through a nifty virtual filesystem from any other application.
Other
2.04k stars 119 forks source link

Tag and Value Aliases #73

Open xelxebar opened 8 years ago

xelxebar commented 8 years ago

Description

Sometimes it's nice to have both short and long names for a tag or value (e.g. pub:journal=classical-and-quantum-gravity and pub:journal=cqg), especially when searching around with the files command.

Naively, we might try to use a two-way imply to represent such an equivalence, but at the moment tmsu doesn't allow these with the following error:

... implication would create a cycle

Proposal

I'm imagining usage being something like this:

$ tmsu tags tmsu-is-awesome.pdf
tmsu journal-of-awesome-things

$ tmsu alias journal-of-awesome-things joat
tmsu: new tag 'joat'

$ tmsu alias
journal-of-awesome-things == joat
...

$ tmsu files joat
journal-of-awesome-things.pdf
...

It also would be nice to allow imply cycles as above, having them essentially collapse into an equivalence chain: e.g.

$ tmsu imply
a -> b
b -> c
c -> a

would correspond to the following and vice versa:

$ tmsu alias
a == b == c

Other Thoughts

If something like this were implemented, one minor annoyance might be having a bunch of equivalent tags show up when querying a files tags. In particular this would be the case if there were several spelling or translation variants for a specific tag (e.g. color == colour == 色 == couleur == farbe).

In such cases, it might be nice to have the ability to designate a canonical tag that is uniquely displayed instead of all of them, and/or have this be locale-dependent.

oniony commented 8 years ago

Thanks for filing this ticket. Indeed, many moons ago, TMSU supported aliases by way of implications...but it was kludgey and made cycle resolution complicated so we decided to outlaw it. Indeed there is no way now of aliasing a tag (or value for that matter). It would be handy to have so I'll pencil this in against 0.8.0.

notevenaperson commented 2 years ago

This would speed up typing

oniony commented 2 years ago

Yes, it's something I've thought about but makes it much harder to implement, hence cycles are disallowed. Straight aliases might be doable, but I'm not sure the utility warrants the extra complexity. I'm not even sure the whole implication system was worth the complexity tbh.

On Tue, 3 May 2016, 17:05 Brandon Wilson, @.***> wrote:

Description

Sometimes it's nice to have both short and long names for a tag or value ( e.g. pub:journal=classical-and-quantum-gravity and pub:journal=cqg), especially when searching around with the files command.

Naively, we might try to use a two-way imply to represent such an equivalence, but at the moment tmsu doesn't allow these with the following error:

... implication would create a cycle

Proposal

I'm imagining usage being something like this:

$ tmsu tags tmsu-is-awesome.pdf tmsu journal-of-awesome-things

$ tmsu alias journal-of-awesome-things joat tmsu: new tag 'joat'

$ tmsu alias journal-of-awesome-things == joat ...

$ tmsu files joat journal-of-awesome-things.pdf ...

It also would be nice to allow imply cycles as above, having them essentially collapse into an equivalence chain: e.g.

$ tmsu imply a -> b b -> c c -> a

would correspond to the following and vice versa:

$ tmsu alias a == b == c

Other Thoughts

If something like this were implemented, one minor annoyance might be having a bunch of equivalent tags show up when querying a files tags. In particular this would be the case if there were several spelling or translation variants for a specific tag (e.g. color == colour == 色 == couleur == farbe).

In such cases, it might be nice to have the ability to designate a canonical tag that is uniquely displayed instead of all of them, and/or have this be locale-dependent.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/oniony/TMSU/issues/73