After some time spent adding tags to your repository, you'll soon notice that the store/ and tags/ directories will get filled by a long flat list of tags which is difficult to manage. Simple tags are quick to write but will often collide (the same tag has different meanings in different contexts) or will loose their intuitiveness. How would you represent the year 2000? With the number 2000? As 'year_2000'? The second one is better, but implies the creation of a 'year_2001' tag and 'year_1999' tag too. Numbers are infinite, I don't need to explain why this is not the proper approach.
Tagsistant offers a second form of tags called machine tags, sometimes called also triple tags (because of their form) which better organize your tags in a more structured and clearer way. A machine tag is composed by three elements:
- a namespace
- a key
- a value
The namespace describes the semantic context the tag belongs to. In the example of the year 2000, the context clearly is the measurement of time, so we could choose time as namespace. The choice of the namespace is up to you and you can use the one that better suites your taste.
The key describes which aspect of the semantic context the tag refers to. In this case the number 2000 is a year, so our key will undoubtedly be year.
The value is of course 2000 and I don't think I need to add anything else.
There is a fourth element which is a comparison operator, meaningful when the tag is included in a search query, which goes between the key and the value. This operator can be one from:
- eq (equals to)
- inc (includes)
- gt (greater than)
- lt (less than)
Knowing this, the complete syntax of a machine tag becomes:
Please note the colon at the end of the namespace. This tells tagsistant that the first element starts a machine tag and must not be interpreted as a simple tag. For example a tag representing the year 2000 could be written as:
Now you know how to properly tag your last summer photos:
$ cp ~/summer_photos/*.jpeg ~/myfiles/store/time:/year/eq/2000/time:/month/eq/August/@@/
If you're thinking that tagging by date your photos this way is extremely boring, feel relieved: I agree. Tagsistant will do that for you with another feature: the autotagging plugins. You will not be forced to add yourself dates (or other numeric informations) to files that already contain them, like JPEG files do in their EXIF section. A dedicated plugin will scan your files looking for metadata in the very moment you copy your files under store/. More on this later.
Machine tags and simple tags can be mixed in any way you like:
$ mkdir -p ~/myfiles/store/time:/year/eq/1981/
$ mkdir -p ~/myfiles/store/iron_maiden/
$ mkdir -p ~/myfiles/store/music:/album/eq/killers/
$ cp ~/music/iron_maiden/killers/*.mp3 ~/myfiles/store/iron_maiden/time:/year/eq/1981/music:/album/eq/killers/@@/
Here we tag (copy) all the MP3 files from Iron Maiden' Killers album as 'iron_maiden', 'music:/album/eq/killers/' and 'time:/year/eq/1981/' at the same time.