[Xesam] Relative date queries / Mono XESAM library

Gabriel Burt gabriel.burt at gmail.com
Mon Jan 14 20:51:33 PST 2008

Hello all,

First a question:

What is the best way to support relative date queries in XESAM?  For
example, in Banshee people will have smart playlists such as "songs
not played in the last 2 hours."  This is turned into a SQL query
similar to "LastPlayed < now() - 7200".  The user query language form
of this would ideally be "played < 2 hours ago", but what of the XML?
What do you think of an optional 'relative' attribute on the date
value specifying the seconds to add to the date, and allowing 'now' as
a valid date?

  <field name="lastplayed" />
  <date relative="-7200">now</date>

Now the announcement:

In Banshee we recently rewrote our query code and tried to make it
compatible with XESAM.  It includes two parsers (user query language
and XML) and methods to produce user query language, XML, and SQL.
The code is here:


It's in a namespace/assembly that is not specific to Banshee, so
Mono/.Net-based apps should be able to reuse it easily.  The user
query language is very similar to XESAM's, but also allows | and comma
for or, NOT for -, and ()'s for grouping/nesting.  We have some
preliminary documentation up at:




More information about the Xesam mailing list