Tagsistant


Tagsistant is a semantic file system for the Linux kernel, written in C and based on FUSE. Unlike traditional file systems that use hierarchies of directories to locate objects, Tagsistant introduces the concept of tags.

Design and differences with hierarchical file systems

In computing, a file system is a type of data store which could be used to store, retrieve and update files. Each file can be uniquely located by its path. The user must know the path in advance to access a file and the path does not necessarily include any information about the content of the file.
Tagsistant uses a complementary approach based on tags. The user can create a set of tags and apply those tags to files, directories and other objects. The user can then search all the objects that match a subset of tags, called a query. This kind of approach is well suited for managing user contents like pictures, audio recordings, movies and text documents but is incompatible with system files where the univocity of the path is a security requirement to prevent the access to a wrong content.

The tags/ directory

A Tagsistant file system features four main directories:
Tags are created as sub directories of the tags/ directory and can be used in queries complying to this syntax:
where a subquery is an arbitrarily long list of tags, concatenated as directories:
The portion of a path delimited by tags/ and @/ is the actual query. The +/ operator joins the results of different sub-queries in one single list. The @/ operator ends the query.
To be returned as a result of the following query:
an object must be tagged as both t1/ and t2/ or as both t1/ and t4/. Any object tagged as t2/ or t4/, but not as t1/ will not be retrieved.
The query syntax deliberately violates the POSIX file system semantics by allowing a path token to be a descendant of itself, like in tags/t1/t2/+/t1/t4/@ where t1/ appears twice. As a consequence a recursive scan of a Tagsistant file system will exit with an error or endlessly loop, as done by UNIX find:

~/tagsistant_mountpoint$ find tags/
tags/
tags/document
tags/document/+
tags/document/+/document
tags/document/+/document/+
tags/document/+/document/+/document
tags/document/+/document/+/document/+

This drawback is balanced by the possibility to list the tags inside a query in any order. The query tags/t1/t2/@/ is completely equivalent to tags/t2/t1/@/ and tags/t1/+/t2/t3/@/ is equivalent to tags/t2/t3/+/t1/@/.
The @/ element has the precise purpose of restoring the POSIX semantics: the path tags/t1/@/directory/ refers to a traditional directory and a recursive scan of this path will properly perform.

The reasoner and the relations/ directory

Tagsistant features a simple reasoner which expands the results of a query by including objects tagged with related tags. A relation between two tags can be established inside the relations/ directory following a three level pattern:
The rel element can be includes or is_equivalent. To include the rock tag in the music tag, the UNIX command mkdir can be used:
The reasoner can recursively resolve relations, allowing the creation of complex structures:
The web of relations created inside the relations/ directory constitutes a basic form of ontology.

Autotagging plugins

Tagsistant features an autotagging plugin stack which gets called when a file or a symlink is written. Each plugin is called if its declared MIME type matches
The list of working plugins released with Tagsistant 0.6 is limited to: