Comments (13)
Where can I find the mentioned SQLite database? I want to take a look at the schema. From my current understanding it should not be too challenging (complexity wise). So I might actually give it a shot if you welcome the abstraction change.
from supertag.
Sure! So here is the schema. You can access the db here, or on your normal file system directly through (on linux) ~/.config/supertag/collections/<collection>/<collection>.db
Let me know if you run into blockers
from supertag.
The tests are pretty comprehensive, so if you can make them pass with your proposed changes, then I think you're on the right track.
from supertag.
Would the tag groups stop at 1 level deep? For example, suppose there exists Wallpapers/art/munch/1890
. Would both munch
and 1890
be tags inside of the tag group art+
?. Related, how could supertag be told that art+
is the tag group you want to create, and not Wallpapers+
?
from supertag.
Yes IMO it should only be 1 level deep. So Wallpapers/art/munch/1890
would result in only munch+
being part of art+
and 1890+
being part of munch+
. So recursive 1 level deep group membership.
That would be solved by not using the current working directory as a tag group. So if you cd Wallpapers
and then invoke tag ln import .
only art/munch/1890 would be added as tag groups as described above.
from supertag.
So Wallpapers/art/munch/1890 would result in only munch+ being part of art+ and 1890+ being part of munch+. So recursive 1 level deep group membership.
This isn't possible with supertag currently. A tag group can only contain tags, and a tag cannot also be a tag group. So you could make munch
be a part of art+
, but 1890
couldn't be a part of munch
(only tag groups have the +
suffix).
It's an interesting idea, but I think this issue is more in line with something I would support, specifically:
treat all path components as tags
Tag groups are sort of a necessary kludge that I haven't designed to be built on top of, so I'm not as interested in expanding them as I am expanding the more things you can do with tags themselves.
from supertag.
Ok that sounds like an abstraction issue. Why not unify tag groups and tags into a single entity? So a tag may contain files or other tags (to represent the necessary hierarchy). What do you think?
from supertag.
It's a big undertaking. Not saying it is impossible, but it would probably necessitate using a graph database (instead of sqlite) because we've introduced complicated relationships that could be cyclical and challenging to traverse. Making something like this performant would also be a challenge. For example, to see all of the other tags that should be listed under a tag's directory, it is no longer enough to just find the files that share the tags' intersection. You would also need to traverse all children tags, their children, etc, breaking cycles along the way. It is a big overhaul.
You are welcome to try for it, but learning Rust and redesigning the architecture would be a big challenge :)
from supertag.
Thanks for the pointers!
So after taking a look, I would suggest following schema update:
keep files, tags, file_tag
add tag_tag
remove tag_group_tag, tag_groups
tag_tag
would represent tags that contain tags with the columns parent_tag_id, children_tag_id
.
When querying members for a single tag or an intersection of tags, we query first file_tag
to retrieve associated files and than proceed to retrieve contained tags by querying tag_tag
. By only looking ahead 1 level, we prevent any bad cycles causing havoc as far as I can tell.
This should provide my earlier described behavior. What do you think?
from supertag.
Alright, I kicked off the development by trying to remove all tag groups related code. See my fork: https://github.com/SeanPedersen/supertag/tree/tag_generalization
I believe to have succeeded with cutting out all tag groups related code but I think I might cut a little bit too much, since 6 tests fail right now. It would be cool if you could take a look and see where I messed up, as I am not too familiar with Rust and the code base yet.
After all tests pass again, I will continue by adding the tag_tag
table to SQLite DB and than add the code that will allow to associate tags as children of existing tags (parents).
from supertag.
Glad to hear you are getting started on it. Unfortunately I don't have the bandwidth to help work on the re-architecture right now. I am working on sh v2.0.0 for the next month or so. I can answer specific questions though when you get really stuck.
from supertag.
Alright, thanks for the heads up. Hope you will quickly make progress on sh!
Alright thanks for the offer, will get back to you when I get stuck.
from supertag.
Ok I changed my plans. I will start working on my own implementation of a tag based file manager using Python as I am more familiar with Python and it offering a generally better development velocity to try out new ideas. Maybe you will get around to implementing this feature yourself, I still think supertag would benefit greatly from it.
from supertag.
Related Issues (20)
- Sorting folders? HOT 3
- Provide a comparison with TMSU HOT 1
- Problem tagging multiple files with glob expansion HOT 15
- Error when tagging a file with spaces in filename (NotFound) HOT 1
- Unable to compile or install supertag with macFUSE 4.0.5 HOT 5
- Do not hardcode /mnt as base path for mounting. HOT 4
- Publish fuse-sys on crates.io HOT 2
- Mac build broken with latest macfuse: switch to fuser to fix mac build HOT 1
- chaining exclusions results in no files being excluded HOT 1
- Feature suggestion: default to tagging files into current collection when tag binary cwd is within that collection HOT 1
- Complement tags HOT 2
- `pdf/-plt/-math/⋂` shows pdf files with the `plt` tag
- documentation typo?
- spaces in file names
- Lints in clippy::restriction group are meant to be picked one by one HOT 1
- Consider adding SQL indexes HOT 4
- Unsure how to import a large number of files HOT 1
- Just wanna say thank you! I was looking for something like that for years, but wasn't brave enough to write it in C! HOT 1
- Does not work on arch linux HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supertag.