Re: Common music database?
- From: Jamie McCracken <jamiemcc blueyonder co uk>
- To: Milosz Derezynski <internalerror gmail com>
- Cc: Iain * <iaingnome gmail com>, gnome-multimedia gnome org
- Subject: Re: Common music database?
- Date: Fri, 31 Mar 2006 14:27:56 +0100
Milosz Derezynski wrote:
Just btw, in case this point isn't made strong enough: Our relation type
library is a _replacement_ for any kind of SQL based systems. You simply
deal with relations (http://en.wikipedia.org/wiki/Relational_model) as
data types instead of manipulating them trough SQL. It features
referential integrity and has all basic operations that are at least
needed for something like metadata storage for a media player. It's not
Oracle, and it's not Postgres, but it can replace sqlite3 anytime, and
it sure can take on MySQL if you don't excess (it's also extensible btw
the same way GTK+ is extensible as it's based on the Glib GObjet system).
This means, we have an entirely different way of dealing with relations
("tables") and tuples ("rows") that contain metadata for a file. And
yes, we can perform queries just like you would with SQL, just that we
don't use SQL. And yes, we can do JOINs and PROJECTs and INTERSECTs and
whatever else.
Tracker does not expose SQL, tables, joins or relations at all (you
cannot use any sql over the Dbus interface!). It uses RDF query which is
more high level than SQL and removes any need to know what tables, joins
and structures are present. It effectively insulates you completely from
the DB structure.
For example to get all 80's music the following query could be performed
in Tracker using the xml based rdf query:
<rdfq:rdfquery>
<rdfq:From eachResource="Files">
<rdfq:Select>
<rdfq:Condition>
<rdfq:and>
<rdfq:greaterThan>
<rdfq:Property name="Audio.Year" />
<rdf:Integer>1979</rdf:Integer>
</rdfq:greaterThan>
<rdfq:lessThan>
<rdfq:Property name="Audio.Year" />
<rdf:Integer>1990</rdf:Integer>
</rdfq:lessThan>
</rdfq:and>
</rdfq:Condition>
</rdfq:Select>
</rdfq:From>
</rdfq:rdfquery>
As you can see all you need to know is what metadata you want. The built
in metadata is published in the following spec:
http://freedesktop.org/wiki/Standards_2fshared_2dfilemetadata_2dspec
And of course you can add your own metadata and query it too likewise.
(I do need to spec out all the possible rdf syntax commands)
On a further note, I believe any system that exposes or expects devs to
use SQL is probably flawed due to the complexity and intimate knowledge
of the DB that would be required.
--
Mr Jamie McCracken
http://www.advogato.org/person/jamiemcc/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]