- %title.%type must be considered as composed
of three parts: %artist, then (%year) album and
finally %track - %title.%type. In this simple
example the whole first level is just a keyword:
%artist, then implicitly the user is asking for all
the artist names belonging to the database. The sys-
tem then will perform a query such as “SELECT
artist name FROM . . . ;” where “artist name” is the
table corresponding to the keyword “%artist”, fig-
ure 1.c. The sublevels will be calculated in a sim-
ilar way, but using the WHERE clause too, impos-
ing stronger restriction going deeper in the tree. Each
couple “database column”, “value” corresponds to the
variable terms found inside the hierarchy at that time.
Then, to have the enumeration of files presents in the
directory - let’s say “U2” - will be performed a query
such as “SELECT year, album FROM . . . WHERE
(artista = “U2”);” and so on.
4 MUSICMESHFS
ARCHITECTURE
The modular architecture of the system can be seen
mainly as formed by a dæmon and a client. Mu-
sicmeshfsd is the process that aims to ensure consis-
tency among real data (information inside monitored
files and directory) and the internal database. More
in detail, it has to monitor local files but it can be ex-
tended to intercommunicate with other instances of
musicmeshfsd in other hosts so to work over remote
files.
Musicmeshfsc is the process that makes possible to
show informations like in a file system tree according
to a user defined schema. Then the tree will be popu-
lated with the information stored by musicmeshfsd.
The file system is implemented in quasi-read-only
mode, as it won’t be possible to create or to move ex-
ternal multimedia files, and the only reasonable mod-
ification consists of renaming. This because seman-
tically it doesn’t make sense deleting or creating a
virtual file. The reason why renaming is allowed is
that it can be useful to change the file, in the sense
of renaming its tag. Obviously, it’s not possible to
move a file inside a virtual file system because there
is not any physical place (source directory) where to
move the file. Remind that the file collection can be
established just adding files to the monitored direc-
tory and then modifying the database. A nonsense
case is the one of creating an empty file. In this case
the user will create just a name in the database not
associated to any real file. The role of renaming is
important for enabling the end user to correct tag-
ging mistakes or eventually to add missing informa-
tion. So rename acts only on the tag and is imple-
mented in such a tricky way that is possible to move
directories and files without limitation, but the new
file name must contain the same information with the
original file. Obviously, the destination file will fol-
low the user schema and, even more, the depth level
between old and new name must be the same to avoid
ambiguity between the tag types or having an incon-
sistent database. In figure 2 the general architecture
is showed. The two main components intercommu-
nicate by a shared relational database. Musicmeshfsc
implements the previously analyzed FUSE functions,
that correspond to a realization of the Linux Virtual
File system Switch.
The usage of a database to manage information, ap-
pears as a solution that makes our file system able to
manage any kind of information that includes meta-
data. Currently the db fuse library manages data once
they are stored inside the database. The same ap-
proach has been used as well to arrange in a file sys-
tem fashion metadata retrieved from emails (data, ob-
ject, subject, sender, receiver and so on).
Figure 2: Architecture.
In the project’s architecture there is a compo-
nent included in the musicmeshfsc, that represents
a reusable and extendable library that can be used
for general purpose application to create a virtual file
system for any kind of data stored inside a sqlite3
database.
Musicmeshfsc has been divided in two well separated
logical parts: one database content dependent, the
other not.
First part accomplishes generation of the file system
hierarchy, starting from a generic database and a con-
figuration schema; the second part accomplishes man-
agement of insert, update and remove operations ref-
ered to single tuples inside database tables, as well
as the interpretation of keywords choosed by the end
user.
The user must define the database table names, the
keywords to use inside the schema to arrange the file
system and the related table column name and finally
in case of JOIN the tables that is possible to merge
and the constraints to impose in the WHERE state-
ments (T1.externKey == T2.referencedValue). Once
SIGMAP 2008 - International Conference on Signal Processing and Multimedia Applications
382