Tagsistant

{{short description|Semantic file system for the Linux kernel}}

{{Infobox software

| name = Tagsistant

| logo = Tagsistant logo.png

| logo size = 300px

| developer = Tx0

| latest release version = 0.6

| programming language = C

| operating system = Linux kernel

| language = English

| genre = Semantic file system

| license = GNU GPL

| website = http://www.tagsistant.net/

}}

{{Infobox filesystem

| name = Tagsistant

| developer = Tx0

| full_name =

| introduction_date =

| introduction_os =

| partition_id =

| directory_struct =

| file_struct =

| bad_blocks_struct =

| max_file_size =

| max_files_no =

| max_filename_size =

| max_volume_size =

| dates_recorded =

| date_range =

| date_resolution =

| forks_streams =

| attributes =

| file_system_permissions =

| compression =

| encryption =

| OS =

}}

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 (devices, pipes, ...). 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 (like libraries, commands and configurations) 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:

:archive/

:relations/

:stats/

:tags/

Tags are created as sub directories of the tags/ directory and can be used in queries complying to this syntax:

:tags/subquery/[+/subquery/[+/subquery/]]/@/{{cite web|title=tags/ and relations/ directories|url=http://www.tagsistant.net/documents-about-tagsistant/0-6-howto?showall=&start=3}}

where a subquery is an unlimited list of tags, concatenated as directories:

:tag1/tag2/tag3/.../tagN/

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:

:tags/t1/t2/+/t1/t4/@/

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:

:relations/tag1/rel/tag2/

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:

:mkdir -p relations/music/includes/rock

The reasoner can recursively resolve relations, allowing the creation of complex structures:

:mkdir -p relations/music/includes/rock

:mkdir -p relations/rock/includes/hard_rock

:mkdir -p relations/rock/includes/grunge

:mkdir -p relations/rock/includes/heavy_metal

:mkdir -p relations/heavy_metal/includes/speed_metal

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.{{cite web|title=How to write a plugin for Tagsistant?|url=http://www.tagsistant.net/documents-about-tagsistant/coding-and-debugging/7-how-to-write-a-plugin-for-tagsistant}} Each plugin is called if its declared MIME type matches

The list of working plugins released with Tagsistant 0.6 is limited to:

  • text/html: tags the file with each word in </code> and <code><keywords></code> elements and with <em>document</em>, <em>webpage</em> and <em>html</em> too</li> <li>image/jpeg: tags the file with each <a href='?title=Exchangeable_image_file_format'>Exif</a> tag</li> </ul></div></section><section class='wiki-section collapsible' id='section--he-repository'><h2 class='section-toggle'>The repository</h2><div class='wiki-body'><p>Each Tagsistant file system has a corresponding repository containing an <code>archive/</code> directory where the objects are actually saved and a <code>tags.sql</code> file holding tagging information as an <a href='?title=SQLite'>SQLite</a> database. If the <a href='?title=MySQL'>MySQL</a> database engine was specified with the <code>--db</code> argument, the <code>tags.sql</code> file will be empty. Another file named <code>repository.ini</code> is a <a href='?title=GLib'>GLib</a> ini store with the repository configuration.<ref>{{cite web|title=Key-value file parser|url=https://developer.gnome.org/glib/2.32/glib-Key-value-file-parser.html}}</ref></p> <p>Tagsistant 0.6 is compatible with the MySQL and Sqlite dialects of SQL for tag reasoning and tagging resolution. While porting its logic to other SQL dialects is possible, differences in basic constructs (especially the INTERSECT SQL keyword) must be considered.</p></div></section><section class='wiki-section collapsible' id='section--he-archive-and-stats-directories'><h2 class='section-toggle'>The archive/ and stats/ directories</h2><div class='wiki-body'><p>The <code>archive/</code> directory has been introduced to provide a quick way to access objects without using tags. Objects are listed with their inode number prefixed.<ref>{{cite web|title=Tagsistant 0.6 howto - Inodes|url=http://www.tagsistant.net/documents-about-tagsistant/0-6-howto?showall=&start=6}}</ref></p> <p>The <code>stats/</code> directory features some read-only files containing usage statistics. A file <code>configuration</code> holds both compile time information and current repository configuration.</p></div></section><section class='wiki-section collapsible' id='section--ain-criticisms'><h2 class='section-toggle'>Main criticisms</h2><div class='wiki-body'><p>It has been highlighted that relying on an external database to store tags and tagging information could cause the complete loss of metadata if the database gets corrupted.<ref>{{cite web|title=Extended attributes and tag file systems|url=http://www.lesbonscomptes.com/pages/tagfs.html}}</ref></p> <p>It has been highlighted that using a flat namespace tends to overcrowd the <code>tags/</code> directory.<ref>{{cite web|title=The major problem with this approach is scalability|website=news.ycombinator.com |url=https://news.ycombinator.com/item?id=2573318}}</ref> This could be mitigated introducing <a href='?title=Tag_%28metadata%29%23Triple_tags'>triple tags</a>.</p></div></section><section class='wiki-section collapsible' id='section--ee-also'><h2 class='section-toggle'>See also</h2><div class='wiki-body'><p>{{Portal|Free and open-source software}}</p> <ul> <li><a href='?title=Semantic_file_system'>Semantic file system</a></li> </ul></div></section><section class='wiki-section collapsible' id='section--eferences'><h2 class='section-toggle'>References</h2><div class='wiki-body'><p>{{Reflist}}</p></div></section><section class='wiki-section collapsible' id='section--xternal-links'><h2 class='section-toggle'>External links</h2><div class='wiki-body'><ul> <li>{{Official website|http://www.tagsistant.net/}}</li> <li>[https://aur.archlinux.org/packages/tagsistant/ Arch Linux package]</li> <li>[https://news.ycombinator.com/item?id=2573318 Discussion on Hacker News]</li> <li>[http://www.lesbonscomptes.com/pages/tagfs.html Extended attributes and tag file systems]</li> <li>[http://lakm.us/logit/2010/03/tagsistant-on-production-2/ Tagsistant On Production]</li> </ul> <p><a href='?title=Category%3AComputer_file_systems'>Category:Computer file systems</a></p> <p><a href='?title=Category%3AData_management'>Category:Data management</a></p> <p><a href='?title=Category%3ASemantic_file_systems'>Category:Semantic file systems</a></p></div></section></div></main> <footer class="site-footer"> <div class="footer-container"> <div class="footer-links"> <a href="/about.php">About</a> <a href="/help.php">Help</a> <a href="/updates.php">Updates</a> <a href="/contact.php">Contact</a> <a href="/privacy.php">Privacy</a> <a href="/terms.php">Terms</a> <a href="https://github.com/yourusername/friendly-wiki" target="_blank" rel="noopener">GitHub</a> </div> <div class="footer-copy"> © 2025 Friendly Wiki. All rights reserved. </div> </div> </footer> <script> const toggle = document.getElementById('mobileMenuToggle'); const menu = document.getElementById('mobileMenu'); toggle.addEventListener('click', () => { menu.classList.toggle('active'); }); </script> <!-- Collapsible toggle --> <script> document.addEventListener("DOMContentLoaded", function () { const toggles = document.querySelectorAll('.section-toggle'); toggles.forEach(toggle => { toggle.addEventListener('click', function () { const section = toggle.closest('.collapsible'); const body = section.querySelector('.wiki-body'); body.classList.toggle('collapsed'); }); }); }); </script>