On 15/01/2008, Gabriel Burt <[EMAIL PROTECTED]> wrote: > 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? > > <lessThan> > <field name="lastplayed" /> > <date relative="-7200">now</date> > </lessThan>
It was very briefly discussed a good while ago (perhaps only on IRC) if we should have predefined time values ie $now, $yesterday, etc, but it was turned down as needles complication at the current point. This does not mean that we will never have it, but we should keep focus on getting a clean core spec to start out with. > 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: > > http://svn.gnome.org/viewvc/banshee/trunk/banshee/src/Core/Hyena/Hyena.Data.Query/ > > 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: > > http://banshee-project.org/OnePointEx/Search Uh, super sweet! I actually think it is a nice idea to extend the user search language because it has been designed to be as simple as possible. If people experiment a bit we can have a better foundation to make decisions on if we ever want to expand the core Xesam user search language. When you say that you support the XML query language does that mean that I can somehow send Xesam queries to Banshee (fx via a Xesam dbus interface or other) or that you use it for stored searches..? There seem to be a lot of C# Xesam integration going on these days; Beagle, Nemo, and Banshee. I wonder if they are coordinated in any way. Feel free to use the Xesam list to do so if you guys want. And as I say to everyone, if you have any comments on any other parts of the spec, be sure to chime in. 1.0 is closer every day. Cheers and gongrats, Mikkel _______________________________________________ Xesam mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/xesam
