tracker r1399 - in branches/xesam-support: . data data/services src/trackerd



Author: pvanhoof
Date: Tue May 13 10:11:59 2008
New Revision: 1399
URL: http://svn.gnome.org/viewvc/tracker?rev=1399&view=rev

Log:
2008-05-13  Ottela Mikael <mikael ottela ixonos com>

        * Initial patch for Xesam queries
        * Committed by Philip Van Hoof

2008-05-13  Philip Van Hoof  <pvanhoof gnome org>

        * First removed xesam-support branch
        * Branchpoint from indexer-split to xesam-support



Added:
   branches/xesam-support/data/services/xesam-convenience.metadata
   branches/xesam-support/data/services/xesam-convenience.service
   branches/xesam-support/data/services/xesam-metadata.mmapping
   branches/xesam-support/data/services/xesam-service.smapping
   branches/xesam-support/data/services/xesam-virtual.metadata
   branches/xesam-support/data/services/xesam.metadata
   branches/xesam-support/data/services/xesam.service
   branches/xesam-support/data/sqlite-xesam.sql
   branches/xesam-support/src/trackerd/tracker-xesam-query.c
   branches/xesam-support/src/trackerd/tracker-xesam-query.h
Modified:
   branches/xesam-support/ChangeLog
   branches/xesam-support/INSTALL
   branches/xesam-support/data/Makefile.am
   branches/xesam-support/data/services/Makefile.am
   branches/xesam-support/data/sqlite-stored-procs.sql
   branches/xesam-support/src/trackerd/Makefile.am
   branches/xesam-support/src/trackerd/tracker-db-sqlite.c
   branches/xesam-support/src/trackerd/tracker-db-sqlite.h
   branches/xesam-support/src/trackerd/tracker-xesam-live-search.c
   branches/xesam-support/src/trackerd/tracker-xesam-live-search.h
   branches/xesam-support/src/trackerd/tracker-xesam-session.c
   branches/xesam-support/src/trackerd/tracker-xesam.h

Modified: branches/xesam-support/INSTALL
==============================================================================
--- branches/xesam-support/INSTALL	(original)
+++ branches/xesam-support/INSTALL	Tue May 13 10:11:59 2008
@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
-Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006 Free Software Foundation, Inc.
 
 This file is free documentation; the Free Software Foundation gives
 unlimited permission to copy, distribute and modify it.
@@ -10,7 +10,10 @@
 Basic Installation
 ==================
 
-These are generic installation instructions.
+Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
 
    The `configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
@@ -23,9 +26,9 @@
 
    It can also use an optional file (typically called `config.cache'
 and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  (Caching is
+the results of its tests to speed up reconfiguring.  Caching is
 disabled by default to prevent problems with accidental use of stale
-cache files.)
+cache files.
 
    If you need to do unusual things to compile the package, please try
 to figure out how `configure' could check whether to do them, and mail
@@ -35,20 +38,17 @@
 may remove or edit it.
 
    The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
 
 The simplest way to compile this package is:
 
   1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.  If you're
-     using `csh' on an old version of System V, you might need to type
-     `sh ./configure' instead to prevent `csh' from trying to execute
-     `configure' itself.
+     `./configure' to configure the package for your system.
 
-     Running `configure' takes awhile.  While running, it prints some
-     messages telling which features it is checking for.
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
 
   2. Type `make' to compile the package.
 
@@ -78,7 +78,7 @@
 by setting variables in the command line or in the environment.  Here
 is an example:
 
-     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
 
    *Note Defining Variables::, for more details.
 
@@ -87,17 +87,15 @@
 
 You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
-own directory.  To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+own directory.  To do this, you can use GNU `make'.  `cd' to the
 directory where you want the object files and executables to go and run
 the `configure' script.  `configure' automatically checks for the
 source code in the directory that `configure' is in and in `..'.
 
-   If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory.  After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
 
 Installation Names
 ==================
@@ -190,12 +188,12 @@
      ./configure CC=/usr/local2/bin/gcc
 
 causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).  Here is a another example:
+overridden in the site shell script).
 
-     /bin/bash ./configure CONFIG_SHELL=/bin/bash
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
 
-Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
-configuration-related scripts to be executed by `/bin/bash'.
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
 
 `configure' Invocation
 ======================

Modified: branches/xesam-support/data/Makefile.am
==============================================================================
--- branches/xesam-support/data/Makefile.am	(original)
+++ branches/xesam-support/data/Makefile.am	Tue May 13 10:11:59 2008
@@ -19,7 +19,8 @@
 	sqlite-stored-procs.sql 		\
 	sqlite-service.sql			\
 	sqlite-service-types.sql 		\
-	sqlite-metadata.sql 			
+	sqlite-metadata.sql 			\
+	sqlite-xesam.sql
 
 servicedir       = $(DBUS_SERVICES_DIR)
 service_in_files = tracker.service.in

Modified: branches/xesam-support/data/services/Makefile.am
==============================================================================
--- branches/xesam-support/data/services/Makefile.am	(original)
+++ branches/xesam-support/data/services/Makefile.am	Tue May 13 10:11:59 2008
@@ -8,6 +8,13 @@
 		file.metadata \
 		image.metadata \
 		video.metadata \
-		default.service
+		default.service \
+		xesam-convenience.metadata \
+		xesam-convenience.service \
+		xesam.metadata \
+		xesam.service \
+		xesam-virtual.metadata \
+		xesam-service.smapping \
+		xesam-metadata.mmapping
 
 EXTRA_DIST = $(config_DATA)

Added: branches/xesam-support/data/services/xesam-convenience.metadata
==============================================================================
--- (empty file)
+++ branches/xesam-support/data/services/xesam-convenience.metadata	Tue May 13 10:11:59 2008
@@ -0,0 +1,301 @@
+
+[xesam:actionAccessClassification]
+Parents=
+Categories=xesam:Event;xesam:Journal;xesam:Task
+ValueType=List of strings
+Description=PIM entry access classification
+
+
+[xesam:actionContact]
+Parents=
+Categories=xesam:Event;xesam:FreeBusy;xesam:Journal;xesam:Task
+ValueType=List of strings
+Description=PIM entry contact
+
+
+[xesam:actionDuration]
+Parents=
+Categories=xesam:Alarm;xesam:Event;xesam:FreeBusy;xesam:Task
+ValueType=List of strings
+Description=PIM entry action duration
+
+
+[xesam:actionEnd]
+Parents=
+Categories=xesam:Event;xesam:FreeBusy
+ValueType=List of strings
+Description=PIM entry action end
+
+
+[xesam:actionExceptionDate]
+Parents=
+Categories=xesam:Event;xesam:Journal;xesam:Task
+ValueType=List of strings
+Description=PIM entry exception date
+
+
+[xesam:actionExceptionRule]
+Parents=
+Categories=xesam:Event;xesam:Journal;xesam:Task
+ValueType=List of strings
+Description=PIM entry exception rule
+
+
+[xesam:actionLocation]
+Parents=
+Categories=xesam:Event;xesam:Task
+ValueType=List of strings
+Description=PIM entry location
+
+
+[xesam:actionOrganizer]
+Parents=
+Categories=xesam:Event;xesam:FreeBusy;xesam:Journal;xesam:Task
+ValueType=List of strings
+Description=PIM entry organizer
+
+
+[xesam:actionPriority]
+Parents=
+Categories=xesam:Event;xesam:Task
+ValueType=List of strings
+Description=PIM entry priority
+
+
+[xesam:actionRecurrenceDate]
+Parents=
+Categories=xesam:Event;xesam:Journal;xesam:Task
+ValueType=List of strings
+Description=PIM entry recurrence date
+
+
+[xesam:actionRecurrenceID]
+Parents=
+Categories=xesam:Event;xesam:Journal;xesam:Task
+ValueType=List of strings
+Description=PIM entry recurrence ID
+
+
+[xesam:actionRecurrenceRule]
+Parents=
+Categories=xesam:Event;xesam:Journal;xesam:Task
+ValueType=List of strings
+Description=PIM entry recurrence rule
+
+
+[xesam:actionResources]
+Parents=
+Categories=xesam:Event;xesam:Task
+ValueType=List of strings
+Description=PIM activity has alarm
+
+
+[xesam:actionStart]
+Parents=
+Categories=xesam:Event;xesam:FreeBusy;xesam:Task
+ValueType=List of strings
+Description=PIM entry action start
+
+
+[xesam:actionStatus]
+Parents=
+Categories=xesam:Event;xesam:Journal;xesam:Task
+ValueType=List of strings
+Description=PIM entry status
+
+
+[xesam:actionTrigger]
+Parents=
+Categories=xesam:Alarm;xesam:Event;xesam:Task
+ValueType=List of strings
+Description=PIM entry action trigger
+
+
+[xesam:actionURL]
+Parents=
+Categories=xesam:Event;xesam:FreeBusy;xesam:Journal;xesam:Task
+ValueType=List of Urls
+Description=PIM entry URL
+
+
+[xesam:aimContactMedium]
+Parents=xesam:imContactMedium
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact AIM ID
+
+
+[xesam:alarmAction]
+Parents=
+Categories=xesam:Alarm
+ValueType=List of strings
+Description=Alarm action
+
+
+[xesam:alarmRepeat]
+Parents=
+Categories=xesam:Alarm
+ValueType=List of strings
+Description=Alarm repeat
+
+
+[xesam:applicationDesktopEntryExec]
+Parents=
+Categories=xesam:ApplicationDesktopEntry
+ValueType=string
+Description=Command to execute, possibly with arguments
+
+
+[xesam:attendee]
+Parents=
+Categories=xesam:Alarm;xesam:Event;xesam:FreeBusy;xesam:Journal;xesam:Task
+ValueType=List of strings
+Description=PIM entry attendee
+
+
+[xesam:desktopEntryIcon]
+Parents=
+Categories=xesam:DesktopEntry
+ValueType=string
+Description=Desktop entry Icon field value conforming to http://freedesktop.org/wiki/Standards/icon-theme-spec
+
+
+[xesam:desktopMenuCategory]
+Parents=
+Categories=xesam:DesktopEntry
+ValueType=List of strings
+Description=Category in which the entry should be shown in the desktop menu. http://www.freedesktop.org/Standards/menu-spec
+
+
+[xesam:eventEnd]
+Parents=
+Categories=xesam:Event
+ValueType=List of strings
+Description=Event end time
+
+
+[xesam:eventLocation]
+Parents=
+Categories=xesam:Event
+ValueType=List of strings
+Description=Event location
+
+
+[xesam:eventStart]
+Parents=
+Categories=xesam:Event
+ValueType=List of strings
+Description=Event start time
+
+
+[xesam:eventTransparrent]
+Parents=
+Categories=xesam:Event
+ValueType=List of strings
+Description=Is event transparrent(makes person busy)
+
+
+[xesam:icqContactMedium]
+Parents=xesam:imContactMedium
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact ICQ ID
+
+
+[xesam:imdbId]
+Parents=xesam:id
+Categories=xesam:Video
+ValueType=Abstract field. Contains no data.
+Description=IMDB.com video ID
+
+
+[xesam:isrc]
+Parents=xesam:id
+Categories=xesam:Media
+ValueType=Abstract field. Contains no data.
+Description=International Standard Recording Code
+
+
+[xesam:msnContactMedium]
+Parents=xesam:imContactMedium
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact MSN ID
+
+
+[xesam:musicBrainzAlbumArtistID]
+Parents=xesam:id
+Categories=xesam:Audio
+ValueType=List of strings
+Description=MusicBrainz album artist ID in UUID format
+
+
+[xesam:musicBrainzAlbumID]
+Parents=xesam:id
+Categories=xesam:Audio
+ValueType=List of strings
+Description=MusicBrainz album ID in UUID format
+
+
+[xesam:musicBrainzArtistID]
+Parents=xesam:id
+Categories=xesam:Audio
+ValueType=List of strings
+Description=MusicBrainz artist ID in UUID format
+
+
+[xesam:musicBrainzFingerprint]
+Parents=xesam:fingerprint
+Categories=xesam:Audio
+ValueType=Abstract field. Contains no data.
+Description=MusicBrainz track fingerprint
+
+
+[xesam:musicBrainzTrackID]
+Parents=xesam:id
+Categories=xesam:Audio
+ValueType=List of strings
+Description=MusicBrainz track ID in UUID format
+
+
+[xesam:skypeContactMedium]
+Parents=xesam:imContactMedium
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact Skype ID
+
+
+[xesam:supportedMimeType]
+Parents=
+Categories=xesam:ApplicationDesktopEntry
+ValueType=List of strings
+Description=The MIME type supported by this application
+
+
+[xesam:taskCompleted]
+Parents=
+Categories=xesam:Task
+ValueType=List of booleans
+Description=Is task completed?
+
+
+[xesam:taskDue]
+Parents=
+Categories=xesam:Task
+ValueType=List of dateTimes
+Description=Task due date/time
+
+
+[xesam:taskPercentComplete]
+Parents=
+Categories=xesam:Task
+ValueType=List of integers
+Description=Task completeness
+
+
+[xesam:yahooContactMedium]
+Parents=xesam:imContactMedium
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact Yahoo ID
+

Added: branches/xesam-support/data/services/xesam-convenience.service
==============================================================================
--- (empty file)
+++ branches/xesam-support/data/services/xesam-convenience.service	Tue May 13 10:11:59 2008
@@ -0,0 +1,32 @@
+
+[xesam:Alarm]
+Parents=xesam:PIM
+Description=Alarm
+
+[xesam:ApplicationDesktopEntry]
+Parents=xesam:DesktopEntry
+Description=Application Desktop Entry
+
+[xesam:DesktopEntry]
+Parents=xesam:Content
+Description=Desktop Entry(typically a .desktop file)
+
+[xesam:Event]
+Parents=xesam:PIM
+Description=Event
+
+[xesam:FreeBusy]
+Parents=xesam:PIM
+Description=FreeBusy
+
+[xesam:Journal]
+Parents=xesam:PIM
+Description=Journal
+
+[xesam:PIM]
+Parents=xesam:Content
+Description=Generic PIM
+
+[xesam:Task]
+Parents=xesam:PIM
+Description=Task

Added: branches/xesam-support/data/services/xesam-metadata.mmapping
==============================================================================
--- (empty file)
+++ branches/xesam-support/data/services/xesam-metadata.mmapping	Tue May 13 10:11:59 2008
@@ -0,0 +1,1021 @@
+
+[xesam:35mmEquivalent]
+MetaName=
+
+[xesam:acl]
+MetaName=
+
+
+[xesam:album]
+MetaName=Audio:Album
+
+
+[xesam:albumArtist]
+MetaName=Audio:Artist
+
+[xesam:albumGain]
+MetaName=
+
+[xesam:albumPeakGain]
+MetaName=
+
+
+[xesam:albumTrackCount]
+MetaName=
+
+[xesam:aperture]
+MetaName=
+
+[xesam:artist]
+MetaName=
+
+
+[xesam:asText]
+MetaName=
+
+
+[xesam:aspectRatio]
+MetaName=
+
+[xesam:attachmentEncoding]
+MetaName=
+
+[xesam:audioBPM]
+MetaName=
+
+
+[xesam:audioBitrate]
+MetaName=
+
+
+[xesam:audioChannels]
+MetaName=
+
+
+[xesam:audioCodec]
+MetaName=
+
+
+[xesam:audioCodecType]
+MetaName=
+
+
+[xesam:audioSampleBitDepth]
+MetaName=
+
+
+[xesam:audioSampleCount]
+MetaName=
+
+
+[xesam:audioSampleDataType]
+MetaName=
+
+
+[xesam:audioSampleRate]
+MetaName=
+
+
+[xesam:author]
+MetaName=
+
+
+[xesam:autoRating]
+MetaName=
+
+
+[xesam:baseRevisionID]
+MetaName=
+
+
+[xesam:bcc]
+MetaName=
+
+
+[xesam:birthDate]
+MetaName=
+
+
+[xesam:blogContactURL]
+MetaName=
+
+
+[xesam:cameraManufacturer]
+MetaName=
+
+
+[xesam:cameraModel]
+MetaName=
+
+
+[xesam:cc]
+MetaName=
+
+
+[xesam:ccdWidth]
+MetaName=
+
+
+[xesam:cellPhoneNumber]
+MetaName=
+
+
+[xesam:changeCommitTime]
+MetaName=
+
+
+[xesam:changeCommitter]
+MetaName=
+
+
+[xesam:characterCount]
+MetaName=
+
+
+[xesam:charset]
+MetaName=
+
+
+[xesam:chatRoom]
+MetaName=
+
+
+[xesam:colorCount]
+MetaName=
+
+
+[xesam:colorSpace]
+MetaName=
+
+
+[xesam:columnCount]
+MetaName=
+
+
+[xesam:comment]
+MetaName=
+
+
+[xesam:commentCharacterCount]
+MetaName=
+
+
+[xesam:commitDiff]
+MetaName=
+
+
+[xesam:communicationChannel]
+MetaName=
+
+
+[xesam:composer]
+MetaName=
+
+
+[xesam:compressionAlgorithm]
+MetaName=
+
+
+[xesam:compressionLevel]
+MetaName=
+
+
+[xesam:conflicts]
+MetaName=
+
+
+[xesam:contactMedium]
+MetaName=
+
+
+[xesam:contactNick]
+MetaName=
+
+
+[xesam:contactURL]
+MetaName=
+
+
+[xesam:contains]
+MetaName=
+
+
+[xesam:contentComment]
+MetaName=
+
+
+[xesam:contentCreated]
+MetaName=
+
+
+[xesam:contentKeyword]
+MetaName=
+
+
+[xesam:contentModified]
+MetaName=
+
+
+[xesam:contentType]
+MetaName=
+
+
+[xesam:contributor]
+MetaName=
+
+
+[xesam:copyright]
+MetaName=
+
+
+[xesam:creator]
+MetaName=
+
+
+[xesam:definesClass]
+MetaName=
+
+
+[xesam:definesFunction]
+MetaName=
+
+
+[xesam:definesGlobalVariable]
+MetaName=
+
+
+[xesam:deletionTime]
+MetaName=
+
+
+[xesam:depends]
+MetaName=
+
+
+[xesam:derivedFrom]
+MetaName=
+
+
+[xesam:description]
+MetaName=
+
+
+[xesam:discNumber]
+MetaName=
+
+
+[xesam:disclaimer]
+MetaName=
+
+
+[xesam:documentCategory]
+MetaName=
+
+
+[xesam:emailAddress]
+MetaName=
+
+
+[xesam:exposureBias]
+MetaName=
+
+
+[xesam:exposureProgram]
+MetaName=
+
+
+[xesam:exposureTime]
+MetaName=
+
+
+[xesam:familyName]
+MetaName=
+
+
+[xesam:faxPhoneNumber]
+MetaName=
+
+
+[xesam:fileExtension]
+MetaName=
+
+
+[xesam:fileSystemType]
+MetaName=
+
+
+[xesam:fingerprint]
+MetaName=
+
+
+[xesam:firstUsed]
+MetaName=
+
+
+[xesam:flashUsed]
+MetaName=
+
+
+[xesam:focalLength]
+MetaName=
+
+
+[xesam:focusDistance]
+MetaName=
+
+
+[xesam:formatSubtype]
+MetaName=
+
+
+[xesam:frameCount]
+MetaName=
+
+
+[xesam:frameRate]
+MetaName=
+
+
+[xesam:freeSpace]
+MetaName=
+
+
+[xesam:gender]
+MetaName=
+
+
+[xesam:generator]
+MetaName=
+
+
+[xesam:generatorOptions]
+MetaName=
+
+
+[xesam:genre]
+MetaName=Audio:Genre
+
+
+[xesam:givenName]
+MetaName=
+
+
+[xesam:group]
+MetaName=
+
+
+[xesam:height]
+MetaName=
+
+
+[xesam:homeEmailAddress]
+MetaName=
+
+
+[xesam:homePhoneNumber]
+MetaName=
+
+
+[xesam:homePostalAddress]
+MetaName=
+
+
+[xesam:homepageContactURL]
+MetaName=
+
+
+[xesam:honorificPrefix]
+MetaName=
+
+
+[xesam:honorificSuffix]
+MetaName=
+
+
+[xesam:horizontalResolution]
+MetaName=
+
+
+[xesam:id]
+MetaName=
+
+
+[xesam:imContactMedium]
+MetaName=
+
+
+[xesam:inReplyTo]
+MetaName=
+
+
+[xesam:interest]
+MetaName=
+
+
+[xesam:interlaceMode]
+MetaName=
+
+
+[xesam:ircContactMedium]
+MetaName=
+
+
+[xesam:isContentEncrypted]
+MetaName=
+
+
+[xesam:isEncrypted]
+MetaName=
+
+
+[xesam:isImportant]
+MetaName=
+
+
+[xesam:isInProgress]
+MetaName=
+
+
+[xesam:isPublicChannel]
+MetaName=
+
+
+[xesam:isRead]
+MetaName=
+
+
+[xesam:isSourceEncrypted]
+MetaName=
+
+
+[xesam:isoEquivalent]
+MetaName=
+
+
+[xesam:jabberContactMedium]
+MetaName=
+
+
+[xesam:keyword]
+MetaName=
+
+
+[xesam:knows]
+MetaName=
+
+
+[xesam:language]
+MetaName=
+
+
+[xesam:lastRefreshed]
+MetaName=
+
+
+[xesam:lastUsed]
+MetaName=
+
+
+[xesam:legal]
+MetaName=
+
+
+[xesam:license]
+MetaName=
+
+
+[xesam:licenseType]
+MetaName=
+
+
+[xesam:lineCount]
+MetaName=
+
+
+[xesam:links]
+MetaName=
+
+
+[xesam:localRevision]
+MetaName=
+
+
+[xesam:lyricist]
+MetaName=
+
+
+[xesam:mailingList]
+MetaName=
+
+
+[xesam:mailingPostalAddress]
+MetaName=
+
+
+[xesam:maintainer]
+MetaName=
+
+
+[xesam:markupCharacterCount]
+MetaName=
+
+
+[xesam:md5Hash]
+MetaName=
+
+
+[xesam:mediaBitrate]
+MetaName=
+
+
+[xesam:mediaCodec]
+MetaName=
+
+
+[xesam:mediaCodecType]
+MetaName=
+
+
+[xesam:mediaDuration]
+MetaName=
+
+
+[xesam:mergeConflict]
+MetaName=
+
+
+[xesam:meteringMode]
+MetaName=
+
+
+[xesam:mimeType]
+MetaName=
+
+
+[xesam:mountPoint]
+MetaName=
+
+
+[xesam:name]
+MetaName=
+
+
+[xesam:newsGroup]
+MetaName=
+
+
+[xesam:occupiedSpace]
+MetaName=
+
+
+[xesam:orientation]
+MetaName=
+
+
+[xesam:originURL]
+MetaName=
+
+
+[xesam:originalLocation]
+MetaName=
+
+
+[xesam:otherName]
+MetaName=
+
+
+[xesam:owner]
+MetaName=
+
+
+[xesam:pageCount]
+MetaName=
+
+
+[xesam:paragrapCount]
+MetaName=
+
+
+[xesam:performer]
+MetaName=
+
+
+[xesam:permissions]
+MetaName=
+
+
+[xesam:personPhoto]
+MetaName=
+
+
+[xesam:phoneNumber]
+MetaName=
+
+
+[xesam:physicalAddress]
+MetaName=
+
+
+[xesam:pixelDataBitDepth]
+MetaName=
+
+
+[xesam:pixelDataType]
+MetaName=
+
+
+[xesam:primaryRecipient]
+MetaName=
+
+
+[xesam:programmingLanguage]
+MetaName=
+
+
+[xesam:receptionTime]
+MetaName=
+
+
+[xesam:recipient]
+MetaName=
+
+
+[xesam:related]
+MetaName=
+
+
+[xesam:remotePassword]
+MetaName=
+
+
+[xesam:remotePort]
+MetaName=
+
+
+[xesam:remoteServer]
+MetaName=
+
+
+[xesam:remoteUser]
+MetaName=
+
+
+[xesam:replyTo]
+MetaName=
+
+
+[xesam:rowCount]
+MetaName=
+
+
+[xesam:rssFeed]
+MetaName=
+
+
+[xesam:sampleBitDepth]
+MetaName=
+
+
+[xesam:sampleConfiguration]
+MetaName=
+
+
+[xesam:sampleDataType]
+MetaName=
+
+
+[xesam:secondaryRecipient]
+MetaName=
+
+
+[xesam:seenAttachedAs]
+MetaName=
+
+
+[xesam:setCount]
+MetaName=
+
+
+[xesam:setRate]
+MetaName=
+
+
+[xesam:sha1Hash]
+MetaName=
+
+
+[xesam:size]
+MetaName=
+
+
+[xesam:sourceCreated]
+MetaName=
+
+
+[xesam:sourceModified]
+MetaName=
+
+
+[xesam:storedSize]
+MetaName=
+
+
+[xesam:subject]
+MetaName=
+
+
+[xesam:summary]
+MetaName=
+
+
+[xesam:supercedes]
+MetaName=
+
+
+[xesam:targetQuality]
+MetaName=
+
+
+[xesam:title]
+MetaName=Audio:Title;Doc:Title;Video:Title
+
+
+[xesam:to]
+MetaName=
+
+
+[xesam:totalSpace]
+MetaName=
+
+
+[xesam:totalUncompressedSize]
+MetaName=
+
+
+[xesam:trackGain]
+MetaName=
+
+
+[xesam:trackNumber]
+MetaName=Audio:TrackNo
+
+
+[xesam:trackPeakGain]
+MetaName=
+
+
+[xesam:url]
+MetaName=
+
+
+[xesam:useCount]
+MetaName=
+
+
+[xesam:userComment]
+MetaName=
+
+
+[xesam:userKeyword]
+MetaName=
+
+
+[xesam:userRating]
+MetaName=
+
+
+[xesam:usesNamespace]
+MetaName=
+
+
+[xesam:version]
+MetaName=
+
+
+
+[xesam:verticalResolution]
+MetaName=
+
+
+[xesam:videoBitrate]
+MetaName=
+
+
+[xesam:videoCodec]
+MetaName=
+
+
+[xesam:videoCodecType]
+MetaName=
+
+
+[xesam:whiteBalance]
+MetaName=
+
+
+[xesam:width]
+MetaName=
+
+
+[xesam:wordCount]
+MetaName=
+
+
+[xesam:workEmailAddress]
+MetaName=
+
+
+[xesam:workPhoneNumber]
+MetaName=
+
+
+[xesam:workPostalAddress]
+MetaName=
+
+
+[xesam:actionAccessClassification]
+MetaName=
+
+
+[xesam:actionContact]
+MetaName=
+
+
+[xesam:actionDuration]
+MetaName=
+
+
+[xesam:actionEnd]
+MetaName=
+
+
+[xesam:actionExceptionDate]
+MetaName=
+
+
+[xesam:actionExceptionRule]
+MetaName=
+
+
+[xesam:actionLocation]
+MetaName=
+
+
+[xesam:actionOrganizer]
+MetaName=
+
+
+[xesam:actionPriority]
+MetaName=
+
+
+[xesam:actionRecurrenceDate]
+MetaName=
+
+
+[xesam:actionRecurrenceID]
+MetaName=
+
+
+[xesam:actionRecurrenceRule]
+MetaName=
+
+
+[xesam:actionResources]
+MetaName=
+
+
+[xesam:actionStart]
+MetaName=
+
+
+[xesam:actionStatus]
+MetaName=
+
+
+[xesam:actionTrigger]
+MetaName=
+
+
+[xesam:actionURL]
+MetaName=
+
+
+[xesam:aimContactMedium]
+MetaName=
+
+
+[xesam:alarmAction]
+MetaName=
+
+
+[xesam:alarmRepeat]
+MetaName=
+
+
+[xesam:applicationDesktopEntryExec]
+MetaName=
+
+
+[xesam:attendee]
+MetaName=
+
+
+[xesam:desktopEntryIcon]
+MetaName=
+
+
+[xesam:desktopMenuCategory]
+MetaName=
+
+
+[xesam:eventEnd]
+MetaName=
+
+
+[xesam:eventLocation]
+MetaName=
+
+
+[xesam:eventStart]
+MetaName=
+
+
+[xesam:eventTransparrent]
+MetaName=
+
+
+[xesam:icqContactMedium]
+MetaName=
+
+
+[xesam:imdbId]
+MetaName=
+
+
+[xesam:isrc]
+MetaName=
+
+
+[xesam:msnContactMedium]
+MetaName=
+
+
+[xesam:musicBrainzAlbumArtistID]
+MetaName=
+
+
+[xesam:musicBrainzAlbumID]
+MetaName=
+
+
+[xesam:musicBrainzArtistID]
+MetaName=
+
+
+[xesam:musicBrainzFingerprint]
+MetaName=
+
+
+[xesam:musicBrainzTrackID]
+MetaName=
+
+
+[xesam:skypeContactMedium]
+MetaName=
+
+
+[xesam:supportedMimeType]
+MetaName=
+
+
+[xesam:taskCompleted]
+MetaName=
+
+
+[xesam:taskDue]
+MetaName=
+
+
+[xesam:taskPercentComplete]
+MetaName=
+
+
+[xesam:yahooContactMedium]
+MetaName=
+
+
+[xesam:contentCategory]
+MetaName=
+
+
+[xesam:sourceCategory]
+MetaName=
+
+
+[xesam:relevancyRating]
+MetaName=
+
+
+[xesam:snippet]
+MetaName=

Added: branches/xesam-support/data/services/xesam-service.smapping
==============================================================================
--- (empty file)
+++ branches/xesam-support/data/services/xesam-service.smapping	Tue May 13 10:11:59 2008
@@ -0,0 +1,207 @@
+
+[xesam:Annotation]
+TypeName=
+
+[xesam:Archive]
+TypeName=
+
+[xesam:ArchivedFile]
+TypeName=
+
+[xesam:Audio]
+TypeName=Audio
+
+[xesam:AudioList]
+TypeName=
+
+[xesam:BlockDevice]
+TypeName=
+
+[xesam:Bookmark]
+TypeName=
+
+[xesam:CommunicationChannel]
+TypeName=
+
+[xesam:Contact]
+TypeName=
+
+[xesam:ContactGroup]
+TypeName=
+
+[xesam:Content]
+TypeName=
+
+[xesam:DataObject]
+TypeName=
+
+[xesam:DeletedFile]
+TypeName=
+
+[xesam:Document]
+TypeName=Documents
+
+[xesam:Documentation]
+TypeName=Documents
+
+[xesam:Email]
+TypeName=Email
+
+[xesam:EmailAttachment]
+TypeName=EmailAttachment
+
+[xesam:EmbeddedObject]
+TypeName=
+
+[xesam:File]
+TypeName=File
+
+[xesam:FileSystem]
+TypeName=
+
+[xesam:Filelike]
+TypeName=
+
+[xesam:Folder]
+TypeName=Folder
+
+[xesam:IMAP4Message]
+TypeName=
+
+[xesam:IMMessage]
+TypeName=
+
+[xesam:Image]
+TypeName=Image
+
+[xesam:MailingList]
+TypeName=
+
+[xesam:MailingListEmail]
+TypeName=
+
+[xesam:Media]
+TypeName=
+
+[xesam:MediaList]
+TypeName=
+
+[xesam:Message]
+TypeName=
+
+[xesam:MessageboxMessage]
+TypeName=
+
+[xesam:Music]
+TypeName=Audio
+
+[xesam:NewsGroup]
+TypeName=
+
+[xesam:NewsGroupEmail]
+TypeName=
+
+[xesam:OfflineMedia]
+TypeName=
+
+[xesam:Organization]
+TypeName=
+
+[xesam:POP3Message]
+TypeName=
+
+[xesam:Person]
+TypeName=
+
+[xesam:PersonalEmail]
+TypeName=Email
+
+[xesam:Photo]
+TypeName=
+
+[xesam:Presentation]
+TypeName=
+
+[xesam:Project]
+TypeName=
+
+[xesam:RSSFeed]
+TypeName=
+
+[xesam:RSSMessage]
+TypeName=
+
+[xesam:RemoteFile]
+TypeName=
+
+[xesam:RemoteMessageboxMessage]
+TypeName=
+
+[xesam:RemoteResource]
+TypeName=
+
+[xesam:RevisionControlledFile]
+TypeName=
+
+[xesam:RevisionControlledRepository]
+TypeName=
+
+[xesam:SoftwarePackage]
+TypeName=
+
+[xesam:Source]
+TypeName=
+
+[xesam:SourceCode]
+TypeName=
+
+[xesam:Spreadsheet]
+TypeName=
+
+[xesam:SystemResource]
+TypeName=
+
+[xesam:Tag]
+TypeName=
+
+[xesam:Text]
+TypeName=
+
+[xesam:TextDocument]
+TypeName=
+
+[xesam:UncategorizedText]
+TypeName=Text
+
+[xesam:Video]
+TypeName=Video
+
+[xesam:Visual]
+TypeName=
+
+[xesam:XML]
+TypeName=
+
+[xesam:Alarm]
+TypeName=
+
+[xesam:ApplicationDesktopEntry]
+TypeName=
+
+[xesam:DesktopEntry]
+TypeName=
+
+[xesam:Event]
+TypeName=
+
+[xesam:FreeBusy]
+TypeName=
+
+[xesam:Journal]
+TypeName=
+
+[xesam:PIM]
+TypeName=
+
+[xesam:Task]
+TypeName=
\ No newline at end of file

Added: branches/xesam-support/data/services/xesam-virtual.metadata
==============================================================================
--- (empty file)
+++ branches/xesam-support/data/services/xesam-virtual.metadata	Tue May 13 10:11:59 2008
@@ -0,0 +1,23 @@
+[xesam:contentCategory]
+Parents=
+Categories=xesam:DataObject
+ValueType=string
+Description=Identifier of content category
+
+[xesam:sourceCategory]
+Parents=
+Categories=xesam:DataObject
+ValueType=List of strings
+Description=Identifier of source category
+
+[xesam:relevancyRating]
+Parents=
+Categories=xesam:DataObject
+ValueType=float
+Description=Query relevancy rating of the object 
+
+[xesam:snippet]
+Parents=
+Categories=xesam:DataObject
+ValueType=string
+Description=Data snippet relevant to the search query 

Added: branches/xesam-support/data/services/xesam.metadata
==============================================================================
--- (empty file)
+++ branches/xesam-support/data/services/xesam.metadata	Tue May 13 10:11:59 2008
@@ -0,0 +1,1470 @@
+
+[xesam:35mmEquivalent]
+Parents=
+Categories=xesam:Photo
+ValueType=float
+Description=Photo metering mode
+
+
+[xesam:acl]
+Parents=
+Categories=xesam:Filelike
+ValueType=List of strings
+Description=File access control list
+
+
+[xesam:album]
+Parents=
+Categories=xesam:Media
+ValueType=string
+Description=Media album
+
+
+[xesam:albumArtist]
+Parents=xesam:author
+Categories=xesam:Audio
+ValueType=List of strings
+Description=Music album artist
+
+
+[xesam:albumGain]
+Parents=
+Categories=xesam:Audio
+ValueType=float
+Description=Gain adjustment of album
+
+
+[xesam:albumPeakGain]
+Parents=
+Categories=xesam:Audio
+ValueType=float
+Description=Peak gain adjustment of album
+
+
+[xesam:albumTrackCount]
+Parents=
+Categories=xesam:Audio
+ValueType=integer
+Description=Album track count
+
+
+[xesam:aperture]
+Parents=
+Categories=xesam:Photo
+ValueType=float
+Description=Photo aperture
+
+
+[xesam:artist]
+Parents=xesam:author
+Categories=xesam:Audio
+ValueType=List of strings
+Description=Music artist
+
+
+[xesam:asText]
+Parents=
+Categories=xesam:Content
+ValueType=string
+Description=Content plain-text representation for indexing purposes
+
+
+[xesam:aspectRatio]
+Parents=
+Categories=xesam:Visual
+ValueType=string
+Description=Visual content aspect ratio
+
+
+[xesam:attachmentEncoding]
+Parents=
+Categories=xesam:EmailAttachment
+ValueType=string
+Description=Email attachment encoding(base64,utf-7, etc)
+
+
+[xesam:audioBPM]
+Parents=
+Categories=xesam:Audio
+ValueType=integer
+Description=Beats per minute
+
+
+[xesam:audioBitrate]
+Parents=xesam:mediaBitrate
+Categories=xesam:Audio
+ValueType=integer
+Description=Audio Bitrate
+
+
+[xesam:audioChannels]
+Parents=xesam:sampleConfiguration
+Categories=xesam:Audio
+ValueType=string
+Description=Audio channels
+
+
+[xesam:audioCodec]
+Parents=xesam:mediaCodec
+Categories=xesam:Audio
+ValueType=string
+Description=Audio codec
+
+
+[xesam:audioCodecType]
+Parents=xesam:mediaCodecType
+Categories=xesam:Audio
+ValueType=string
+Description=Audio codec type
+
+
+[xesam:audioSampleBitDepth]
+Parents=xesam:sampleBitDepth
+Categories=xesam:Audio
+ValueType=integer
+Description=Audio sample data bit depth
+
+
+[xesam:audioSampleCount]
+Parents=xesam:setCount
+Categories=xesam:Audio
+ValueType=integer
+Description=Audio sample count
+
+
+[xesam:audioSampleDataType]
+Parents=xesam:sampleDataType
+Categories=xesam:Audio
+ValueType=string
+Description=Audio sample data type
+
+
+[xesam:audioSampleRate]
+Parents=xesam:setRate
+Categories=xesam:Audio
+ValueType=float
+Description=Audio sample rate
+
+
+[xesam:author]
+Parents=xesam:creator
+Categories=xesam:Content
+ValueType=List of strings
+Description=Content author. Primary contributor.
+
+
+[xesam:autoRating]
+Parents=
+Categories=xesam:Source
+ValueType=Abstract field. Contains no data.
+Description=Rating of the object provided automatically by software, inferred from user behavior or other indirect indicators.
+
+
+[xesam:baseRevisionID]
+Parents=
+Categories=xesam:RevisionControlledFile
+ValueType=string
+Description=RevisionID on which a revision-controlled file is based
+
+
+[xesam:bcc]
+Parents=xesam:secondaryRecipient
+Categories=xesam:Email
+ValueType=List of strings
+Description=BCC:
+
+
+[xesam:birthDate]
+Parents=
+Categories=xesam:Person
+ValueType=dateTime
+Description=Contact birthDate
+
+
+[xesam:blogContactURL]
+Parents=xesam:contactURL
+Categories=xesam:Contact
+ValueType=List of Urls
+Description=Contact blog URL
+
+
+[xesam:cameraManufacturer]
+Parents=
+Categories=xesam:Photo
+ValueType=string
+Description=Photo camera manufacturer
+
+
+[xesam:cameraModel]
+Parents=
+Categories=xesam:Photo
+ValueType=string
+Description=Photo camera model
+
+
+[xesam:cc]
+Parents=xesam:secondaryRecipient
+Categories=xesam:Email
+ValueType=List of strings
+Description=CC:
+
+
+[xesam:ccdWidth]
+Parents=
+Categories=xesam:Photo
+ValueType=float
+Description=Photo CCD Width
+
+
+[xesam:cellPhoneNumber]
+Parents=xesam:phoneNumber
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact cell phone number
+
+
+[xesam:changeCommitTime]
+Parents=
+Categories=xesam:RevisionControlledFile
+ValueType=dateTime
+Description=Time of the last change to the base file in the repository(preceding the baseRevisionID?)
+
+
+[xesam:changeCommitter]
+Parents=
+Categories=xesam:RevisionControlledFile
+ValueType=string
+Description=Who made the last change to the base file in the repository(preceding the baseRevisionID?)
+
+
+[xesam:characterCount]
+Parents=
+Categories=xesam:Text
+ValueType=integer
+Description=Text character count
+
+
+[xesam:charset]
+Parents=
+Categories=xesam:Content
+ValueType=string
+Description=Content charset encoding
+
+
+[xesam:chatRoom]
+Parents=xesam:communicationChannel
+Categories=xesam:IMMessage
+ValueType=List of strings
+Description=Chatroom this message belongs to
+
+
+[xesam:colorCount]
+Parents=
+Categories=xesam:Visual
+ValueType=integer
+Description=Visual content color count for palettes
+
+
+[xesam:colorSpace]
+Parents=xesam:sampleConfiguration
+Categories=xesam:Visual
+ValueType=string
+Description=Visual content color space(RGB, CMYK etc)
+
+
+[xesam:columnCount]
+Parents=
+Categories=xesam:Spreadsheet
+ValueType=integer
+Description=Spreadsheet column count
+
+
+[xesam:comment]
+Parents=
+Categories=xesam:DataObject
+ValueType=List of strings
+Description=Object comment
+
+
+[xesam:commentCharacterCount]
+Parents=
+Categories=xesam:SourceCode
+ValueType=integer
+Description=Source code comment character count
+
+
+[xesam:commitDiff]
+Parents=
+Categories=xesam:RevisionControlledFile
+ValueType=Abstract field. Contains no data.
+Description=The diff of the content and the base file
+
+
+[xesam:communicationChannel]
+Parents=
+Categories=xesam:Message
+ValueType=List of strings
+Description=Message communication channel like chatroom name or mailing list
+
+
+[xesam:composer]
+Parents=xesam:author
+Categories=xesam:Audio
+ValueType=List of strings
+Description=Music composer
+
+
+[xesam:compressionAlgorithm]
+Parents=
+Categories=xesam:ArchivedFile
+ValueType=string
+Description=Compression algorithm for archivers which support several
+
+
+[xesam:compressionLevel]
+Parents=
+Categories=xesam:ArchivedFile;xesam:Media
+ValueType=string
+Description=Level of compression. How much effort was spent towards achieving maximal compression ratio.
+
+
+[xesam:conflicts]
+Parents=xesam:related
+Categories=xesam:SoftwarePackage
+ValueType=List of Uris
+Description=Software conflicts with
+
+
+[xesam:contactMedium]
+Parents=
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Generic contact medium
+
+
+[xesam:contactNick]
+Parents=
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact nick
+
+
+[xesam:contactURL]
+Parents=xesam:contactMedium
+Categories=xesam:Contact
+ValueType=List of Urls
+Description=Contact URL
+
+
+[xesam:contains]
+Parents=xesam:depends
+Categories=xesam:Content
+ValueType=List of Uris
+Description=Containment relation
+
+
+[xesam:contentComment]
+Parents=xesam:comment
+Categories=xesam:Content
+ValueType=string
+Description=Content comment
+
+
+[xesam:contentCreated]
+Parents=
+Categories=xesam:Content
+ValueType=dateTime
+Description=Content creation time
+
+
+[xesam:contentKeyword]
+Parents=xesam:keyword
+Categories=xesam:Content
+ValueType=List of strings
+Description=Content keyword/tag
+
+
+[xesam:contentModified]
+Parents=
+Categories=xesam:Content
+ValueType=dateTime
+Description=Content last modification time
+
+
+[xesam:contentType]
+Parents=
+Categories=xesam:Email
+ValueType=string
+Description=Email content mime type/charset
+
+
+[xesam:contributor]
+Parents=xesam:creator
+Categories=xesam:Content
+ValueType=List of strings
+Description=Content contributor. Secondary contributor.
+
+
+[xesam:copyright]
+Parents=xesam:legal
+Categories=xesam:Content
+ValueType=List of strings
+Description=Content copyright
+
+
+[xesam:creator]
+Parents=
+Categories=xesam:Content
+ValueType=Abstract field. Contains no data.
+Description=Abstract content creator. Use children
+
+
+[xesam:definesClass]
+Parents=
+Categories=xesam:SourceCode
+ValueType=List of strings
+Description=Source code defines class
+
+
+[xesam:definesFunction]
+Parents=
+Categories=xesam:SourceCode
+ValueType=List of strings
+Description=Source code defines function
+
+
+[xesam:definesGlobalVariable]
+Parents=
+Categories=xesam:SourceCode
+ValueType=List of strings
+Description=Source code defines global variable
+
+
+[xesam:deletionTime]
+Parents=
+Categories=xesam:DeletedFile
+ValueType=dateTime
+Description=File deletion time
+
+
+[xesam:depends]
+Parents=xesam:related
+Categories=xesam:Content
+ValueType=List of Uris
+Description=Dependency relation
+
+
+[xesam:derivedFrom]
+Parents=xesam:links
+Categories=xesam:Content
+ValueType=List of Uris
+Description=Links to the original content from which this content is derived
+
+
+[xesam:description]
+Parents=
+Categories=xesam:Content
+ValueType=string
+Description=Content description. Description of content an order of magnitude more elaborate than Title
+
+
+[xesam:discNumber]
+Parents=
+Categories=xesam:Audio
+ValueType=integer
+Description=Audio cd number
+
+
+[xesam:disclaimer]
+Parents=xesam:legal
+Categories=xesam:Content
+ValueType=List of strings
+Description=Content disclaimer
+
+
+[xesam:documentCategory]
+Parents=
+Categories=xesam:Document
+ValueType=List of strings
+Description=Document category: book, article, flyer, pamphlet whatever
+
+
+[xesam:emailAddress]
+Parents=xesam:contactMedium
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact email address
+
+
+[xesam:exposureBias]
+Parents=
+Categories=xesam:Photo
+ValueType=string
+Description=Photo exposure bias
+
+
+[xesam:exposureProgram]
+Parents=
+Categories=xesam:Photo
+ValueType=string
+Description=Photo exposure program
+
+
+[xesam:exposureTime]
+Parents=
+Categories=xesam:Photo
+ValueType=dateTime
+Description=Photo exposure time
+
+
+[xesam:familyName]
+Parents=
+Categories=xesam:Person
+ValueType=List of strings
+Description=Person family name
+
+
+[xesam:faxPhoneNumber]
+Parents=xesam:phoneNumber
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact fax phone number
+
+
+[xesam:fileExtension]
+Parents=
+Categories=xesam:Filelike
+ValueType=string
+Description=File extension
+
+
+[xesam:fileSystemType]
+Parents=
+Categories=xesam:FileSystem
+ValueType=string
+Description=File system type e.g. ext3
+
+
+[xesam:fingerprint]
+Parents=
+Categories=xesam:Content
+ValueType=Abstract field. Contains no data.
+Description=Content fingerprint: a small ID calculated from content byte stream, aimed at uniquely identifying the content. Abstract.
+
+
+[xesam:firstUsed]
+Parents=
+Categories=xesam:Source
+ValueType=dateTime
+Description=When the content was used for the first time
+
+
+[xesam:flashUsed]
+Parents=
+Categories=xesam:Photo
+ValueType=string
+Description=Photo flash used
+
+
+[xesam:focalLength]
+Parents=
+Categories=xesam:Photo
+ValueType=float
+Description=Photo focal length
+
+
+[xesam:focusDistance]
+Parents=
+Categories=xesam:Photo
+ValueType=float
+Description=Photo focus distance
+
+
+[xesam:formatSubtype]
+Parents=
+Categories=xesam:Content
+ValueType=List of strings
+Description=Format subtype. Use to indicate format extensions/specifics
+
+
+[xesam:frameCount]
+Parents=xesam:setCount
+Categories=xesam:Visual
+ValueType=integer
+Description=Visual content frame count
+
+
+[xesam:frameRate]
+Parents=xesam:setRate
+Categories=xesam:Visual
+ValueType=float
+Description=Visual content frame rate
+
+
+[xesam:freeSpace]
+Parents=
+Categories=xesam:FileSystem
+ValueType=integer
+Description=File system free space
+
+
+[xesam:gender]
+Parents=
+Categories=xesam:Person
+ValueType=string
+Description=Contact gender
+
+
+[xesam:generator]
+Parents=
+Categories=xesam:Content
+ValueType=List of strings
+Description=Software used to generate the content byte stream
+
+
+[xesam:generatorOptions]
+Parents=
+Categories=xesam:Content
+ValueType=List of strings
+Description=Generator software options
+
+
+[xesam:genre]
+Parents=
+Categories=xesam:Media
+ValueType=List of strings
+Description=Media genre
+
+
+[xesam:givenName]
+Parents=
+Categories=xesam:Person
+ValueType=List of strings
+Description=Person given name
+
+
+[xesam:group]
+Parents=
+Categories=xesam:Filelike
+ValueType=List of strings
+Description=File group
+
+
+[xesam:height]
+Parents=
+Categories=xesam:Visual
+ValueType=integer
+Description=Visual content height
+
+
+[xesam:homeEmailAddress]
+Parents=xesam:emailAddress
+Categories=xesam:Person
+ValueType=List of strings
+Description=Contact home email address
+
+
+[xesam:homePhoneNumber]
+Parents=xesam:phoneNumber
+Categories=xesam:Person
+ValueType=List of strings
+Description=Contact home phone number
+
+
+[xesam:homePostalAddress]
+Parents=xesam:physicalAddress
+Categories=xesam:Person
+ValueType=List of strings
+Description=Contact home address
+
+
+[xesam:homepageContactURL]
+Parents=xesam:contactURL
+Categories=xesam:Contact
+ValueType=List of Urls
+Description=Contact homepage URL
+
+
+[xesam:honorificPrefix]
+Parents=
+Categories=xesam:Person
+ValueType=List of strings
+Description=Person honorific name prefix
+
+
+[xesam:honorificSuffix]
+Parents=
+Categories=xesam:Person
+ValueType=List of strings
+Description=Person honorific name suffix
+
+
+[xesam:horizontalResolution]
+Parents=
+Categories=xesam:Visual
+ValueType=integer
+Description=Visual content horizontal resolution
+
+
+[xesam:id]
+Parents=
+Categories=xesam:Content
+ValueType=List of strings
+Description=Content ID
+
+
+[xesam:imContactMedium]
+Parents=xesam:contactMedium
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Generic IM contact medium
+
+
+[xesam:inReplyTo]
+Parents=xesam:derivedFrom
+Categories=xesam:Email
+ValueType=List of strings
+Description=In-Reply-To:
+
+
+[xesam:interest]
+Parents=
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact interests/hobbies
+
+
+[xesam:interlaceMode]
+Parents=
+Categories=xesam:Visual
+ValueType=string
+Description=Visual content interlace mode
+
+
+[xesam:ircContactMedium]
+Parents=xesam:imContactMedium
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact IRC ID server
+
+
+[xesam:isContentEncrypted]
+Parents=
+Categories=xesam:Content
+ValueType=boolean
+Description=Is some portion of content encrypted? Setting this field doesn't imply that all data is encrypted.
+
+
+[xesam:isEncrypted]
+Parents=
+Categories=xesam:DataObject
+ValueType=List of booleans
+Description=Is Object or part of it encrypted?
+
+
+[xesam:isImportant]
+Parents=
+Categories=xesam:MessageboxMessage
+ValueType=boolean
+Description=Is the message important
+
+
+[xesam:isInProgress]
+Parents=
+Categories=xesam:MessageboxMessage
+ValueType=boolean
+Description=Is the message in progress
+
+
+[xesam:isPublicChannel]
+Parents=
+Categories=xesam:CommunicationChannel
+ValueType=boolean
+Description=Is channel public?
+
+
+[xesam:isRead]
+Parents=
+Categories=xesam:MessageboxMessage
+ValueType=boolean
+Description=Is the message read
+
+
+[xesam:isSourceEncrypted]
+Parents=xesam:isEncrypted
+Categories=xesam:ArchivedFile
+ValueType=boolean
+Description=Is archived file password-protected?
+
+
+[xesam:isoEquivalent]
+Parents=
+Categories=xesam:Photo
+ValueType=string
+Description=Photo ISO equivalent
+
+
+[xesam:jabberContactMedium]
+Parents=xesam:imContactMedium
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact Jabber ID
+
+
+[xesam:keyword]
+Parents=
+Categories=xesam:DataObject
+ValueType=List of strings
+Description=Object keyword/tag
+
+
+[xesam:knows]
+Parents=xesam:related
+Categories=xesam:Contact
+ValueType=List of Uris
+Description=FOAF:knows relation. Points to a contact known by this contact.
+
+
+[xesam:language]
+Parents=
+Categories=xesam:Content
+ValueType=List of strings
+Description=Content language
+
+
+[xesam:lastRefreshed]
+Parents=
+Categories=xesam:RemoteResource
+ValueType=dateTime
+Description=Last time the resource info was refreshed
+
+
+[xesam:lastUsed]
+Parents=
+Categories=xesam:Source
+ValueType=dateTime
+Description=When the content was last used. Different from last access as this only accounts usage by the user e.g. playing a song as opposed to apps scanning the HD
+
+
+[xesam:legal]
+Parents=
+Categories=xesam:Content
+ValueType=List of strings
+Description=Abstract content legal notice.
+
+
+[xesam:license]
+Parents=xesam:legal
+Categories=xesam:Content
+ValueType=List of strings
+Description=Content license
+
+
+[xesam:licenseType]
+Parents=xesam:legal
+Categories=xesam:Content
+ValueType=List of strings
+Description=Content license type
+
+
+[xesam:lineCount]
+Parents=
+Categories=xesam:Text
+ValueType=integer
+Description=Text line count
+
+
+[xesam:links]
+Parents=xesam:related
+Categories=xesam:Content
+ValueType=List of Uris
+Description=Linking/mention relation
+
+
+[xesam:localRevision]
+Parents=
+Categories=xesam:Source
+ValueType=string
+Description=Local revision number. An automatically generated ID that is changed everytime the generator software/revisioning system deems the content has changed.
+
+
+[xesam:lyricist]
+Parents=xesam:author
+Categories=xesam:Audio
+ValueType=List of strings
+Description=Music lyricist
+
+
+[xesam:mailingList]
+Parents=xesam:communicationChannel
+Categories=xesam:MailingListEmail
+ValueType=List of strings
+Description=Mailing list this message belongs to
+
+
+[xesam:mailingPostalAddress]
+Parents=xesam:physicalAddress
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact mailing address
+
+
+[xesam:maintainer]
+Parents=xesam:creator
+Categories=xesam:Content
+ValueType=List of strings
+Description=Content maintainer.
+
+
+[xesam:markupCharacterCount]
+Parents=
+Categories=xesam:XML
+ValueType=integer
+Description=XML markup character count
+
+
+[xesam:md5Hash]
+Parents=xesam:fingerprint
+Categories=xesam:Content
+ValueType=Abstract field. Contains no data.
+Description=MD5 hash
+
+
+[xesam:mediaBitrate]
+Parents=
+Categories=xesam:Media
+ValueType=List of integers
+Description=Media bitrate
+
+
+[xesam:mediaCodec]
+Parents=
+Categories=xesam:Media
+ValueType=List of strings
+Description=Media codec
+
+
+[xesam:mediaCodecType]
+Parents=
+Categories=xesam:Media
+ValueType=List of strings
+Description=Media codec type: lossless, CBR, ABR, VBR
+
+
+[xesam:mediaDuration]
+Parents=
+Categories=xesam:Media
+ValueType=List of dateTimes
+Description=Media duration
+
+
+[xesam:mergeConflict]
+Parents=
+Categories=xesam:RevisionControlledFile
+ValueType=boolean
+Description=If true, the file has a merge conflict(can't be cleanly merged into the repository)
+
+
+[xesam:meteringMode]
+Parents=
+Categories=xesam:Photo
+ValueType=string
+Description=Photo metering mode
+
+
+[xesam:mimeType]
+Parents=
+Categories=xesam:Content
+ValueType=string
+Description=Content mime-type
+
+
+[xesam:mountPoint]
+Parents=
+Categories=xesam:FileSystem
+ValueType=List of strings
+Description=File system mount point
+
+
+[xesam:name]
+Parents=
+Categories=xesam:Source
+ValueType=string
+Description=Name provided by container
+
+
+[xesam:newsGroup]
+Parents=xesam:communicationChannel
+Categories=xesam:NewsGroupEmail
+ValueType=List of strings
+Description=News group this message belongs to
+
+
+[xesam:occupiedSpace]
+Parents=
+Categories=xesam:FileSystem
+ValueType=integer
+Description=File system occupied space
+
+
+[xesam:orientation]
+Parents=
+Categories=xesam:Photo
+ValueType=string
+Description=Photo orientation
+
+
+[xesam:originURL]
+Parents=
+Categories=xesam:Source
+ValueType=Url
+Description=Origin URL, e.g. where the file had been downloaded from
+
+
+[xesam:originalLocation]
+Parents=
+Categories=xesam:DeletedFile
+ValueType=string
+Description=Deleted file original location
+
+
+[xesam:otherName]
+Parents=
+Categories=xesam:Person
+ValueType=List of strings
+Description=Person other name
+
+
+[xesam:owner]
+Parents=
+Categories=xesam:Filelike
+ValueType=string
+Description=File owner
+
+
+[xesam:pageCount]
+Parents=
+Categories=xesam:Document
+ValueType=integer
+Description=Document page count. Slide count for presentations
+
+
+[xesam:paragrapCount]
+Parents=
+Categories=xesam:Document
+ValueType=integer
+Description=Document paragraph count
+
+
+[xesam:performer]
+Parents=xesam:author
+Categories=xesam:Audio
+ValueType=List of strings
+Description=Music performer
+
+
+[xesam:permissions]
+Parents=
+Categories=xesam:Filelike
+ValueType=string
+Description=File permissions
+
+
+[xesam:personPhoto]
+Parents=
+Categories=xesam:Person
+ValueType=List of Uris
+Description=Contact photo/avatar
+
+
+[xesam:phoneNumber]
+Parents=xesam:contactMedium
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact phone number
+
+
+[xesam:physicalAddress]
+Parents=xesam:contactMedium
+Categories=xesam:Contact
+ValueType=List of strings
+Description=Contact postal address
+
+
+[xesam:pixelDataBitDepth]
+Parents=xesam:sampleBitDepth
+Categories=xesam:Visual
+ValueType=integer
+Description=Visual content pixel data bit depth
+
+
+[xesam:pixelDataType]
+Parents=xesam:sampleDataType
+Categories=xesam:Visual
+ValueType=string
+Description=Visual content pixel data type
+
+
+[xesam:primaryRecipient]
+Parents=xesam:recipient
+Categories=xesam:Message
+ValueType=List of strings
+Description=Message primary recipient
+
+
+[xesam:programmingLanguage]
+Parents=
+Categories=xesam:SourceCode
+ValueType=string
+Description=Source code programming language
+
+
+[xesam:receptionTime]
+Parents=
+Categories=xesam:Message
+ValueType=dateTime
+Description=Message reception time
+
+
+[xesam:recipient]
+Parents=
+Categories=xesam:Message
+ValueType=List of strings
+Description=Message recipient
+
+
+[xesam:related]
+Parents=
+Categories=xesam:Content
+ValueType=List of Uris
+Description=Abstract content relation. Use children
+
+
+[xesam:remotePassword]
+Parents=
+Categories=xesam:RemoteResource
+ValueType=string
+Description=Remote resource user password
+
+
+[xesam:remotePort]
+Parents=
+Categories=xesam:RemoteResource
+ValueType=integer
+Description=Server port
+
+
+[xesam:remoteServer]
+Parents=
+Categories=xesam:RemoteResource
+ValueType=string
+Description=The server hosting the remote resource
+
+
+[xesam:remoteUser]
+Parents=
+Categories=xesam:RemoteResource
+ValueType=string
+Description=Remote resource user name
+
+
+[xesam:replyTo]
+Parents=
+Categories=xesam:Email
+ValueType=string
+Description=ReplyTo:
+
+
+[xesam:rowCount]
+Parents=xesam:lineCount
+Categories=xesam:Spreadsheet
+ValueType=integer
+Description=Spreadsheet row count
+
+
+[xesam:rssFeed]
+Parents=xesam:communicationChannel
+Categories=xesam:RSSMessage
+ValueType=List of strings
+Description=RSS feed that provided the message
+
+
+[xesam:sampleBitDepth]
+Parents=
+Categories=xesam:Media
+ValueType=List of integers
+Description=Media sample data bit depth: 8, 16, 24, 32 etc
+
+
+[xesam:sampleConfiguration]
+Parents=
+Categories=xesam:Media
+ValueType=Abstract field. Contains no data.
+Description=Media sample configuration/arrangement of components
+
+
+[xesam:sampleDataType]
+Parents=
+Categories=xesam:Media
+ValueType=List of strings
+Description=Media sample data type: int, float
+
+
+[xesam:secondaryRecipient]
+Parents=xesam:recipient
+Categories=xesam:Message
+ValueType=List of strings
+Description=Message secondary recipient
+
+
+[xesam:seenAttachedAs]
+Parents=xesam:name
+Categories=xesam:OfflineMedia
+ValueType=List of strings
+Description=Name of block device seen to contain the Content when it was online.
+
+
+[xesam:setCount]
+Parents=
+Categories=xesam:Media
+ValueType=List of integers
+Description=Media set count. Sample count for audio(set=one sample per channel), frame count for video
+
+
+[xesam:setRate]
+Parents=
+Categories=xesam:Media
+ValueType=List of floats
+Description=Media set rate. Sample rate for audio(set=one sample per channel), FPS for video
+
+
+[xesam:sha1Hash]
+Parents=xesam:fingerprint
+Categories=xesam:Content
+ValueType=Abstract field. Contains no data.
+Description=SHA1 hash
+
+
+[xesam:size]
+Parents=
+Categories=xesam:Content
+ValueType=integer
+Description=Content/data size in bytes. See also storageSize
+
+
+[xesam:sourceCreated]
+Parents=
+Categories=xesam:Source
+ValueType=dateTime
+Description=Local copy creation time
+
+
+[xesam:sourceModified]
+Parents=
+Categories=xesam:Source
+ValueType=dateTime
+Description=Local copy modification time
+
+
+[xesam:storedSize]
+Parents=
+Categories=xesam:Source
+ValueType=integer
+Description=Actual space occupied by the object in the source storage. e.g. compressed file size in archive
+
+
+[xesam:subject]
+Parents=
+Categories=xesam:Content
+ValueType=string
+Description=Content subject. The shortest possible description of content
+
+
+[xesam:summary]
+Parents=
+Categories=xesam:Content
+ValueType=string
+Description=Content summary. Description of content an order of magnitude more elaborate than Description
+
+
+[xesam:supercedes]
+Parents=xesam:related
+Categories=xesam:SoftwarePackage
+ValueType=List of Uris
+Description=Software supercedes
+
+
+[xesam:targetQuality]
+Parents=
+Categories=xesam:Media
+ValueType=List of strings
+Description=The desired level of quality loss of lossy compression
+
+
+[xesam:title]
+Parents=
+Categories=xesam:Content
+ValueType=string
+Description=Content title. Description of content an order of magnitude more elaborate than Subject
+
+
+[xesam:to]
+Parents=xesam:primaryRecipient
+Categories=xesam:Email
+ValueType=List of strings
+Description=To:
+
+
+[xesam:totalSpace]
+Parents=
+Categories=xesam:FileSystem
+ValueType=integer
+Description=File system total usable space, unlike size, which is the byte size of the entire filesystem including overhead.
+
+
+[xesam:totalUncompressedSize]
+Parents=
+Categories=xesam:Archive
+ValueType=integer
+Description=Archive total uncompressed size
+
+
+[xesam:trackGain]
+Parents=
+Categories=xesam:Audio
+ValueType=float
+Description=Gain adjustment of track
+
+
+[xesam:trackNumber]
+Parents=
+Categories=xesam:Audio
+ValueType=integer
+Description=Audio track number
+
+
+[xesam:trackPeakGain]
+Parents=
+Categories=xesam:Audio
+ValueType=float
+Description=Peak gain adjustment of track
+
+
+[xesam:url]
+Parents=
+Categories=xesam:Source
+ValueType=List of Urls
+Description=URL to access the content
+
+
+[xesam:useCount]
+Parents=
+Categories=xesam:Source
+ValueType=integer
+Description=How many times the content was used. Only usage by the user(not general software access) counts.
+
+
+[xesam:userComment]
+Parents=xesam:comment
+Categories=xesam:Source
+ValueType=List of strings
+Description=User-provided comment
+
+
+[xesam:userKeyword]
+Parents=xesam:keyword
+Categories=xesam:Source
+ValueType=List of strings
+Description=User-provided keywords
+
+
+[xesam:userRating]
+Parents=
+Categories=xesam:Source
+ValueType=Abstract field. Contains no data.
+Description=User-provided rating of the object
+
+
+[xesam:usesNamespace]
+Parents=
+Categories=xesam:XML
+ValueType=List of strings
+Description=Namespace referenced by the XML
+
+
+[xesam:version]
+Parents=
+Categories=xesam:Content
+ValueType=string
+Description=Content version
+
+
+[xesam:verticalResolution]
+Parents=
+Categories=xesam:Visual
+ValueType=integer
+Description=Visual content vertical resolution
+
+
+[xesam:videoBitrate]
+Parents=xesam:mediaBitrate
+Categories=xesam:Video
+ValueType=integer
+Description=Video Bitrate
+
+
+[xesam:videoCodec]
+Parents=xesam:mediaCodec
+Categories=xesam:Video
+ValueType=string
+Description=Video codec
+
+
+[xesam:videoCodecType]
+Parents=xesam:mediaCodecType
+Categories=xesam:Video
+ValueType=string
+Description=Video codec type
+
+
+[xesam:whiteBalance]
+Parents=
+Categories=xesam:Photo
+ValueType=string
+Description=Photo white balance
+
+
+[xesam:width]
+Parents=
+Categories=xesam:Visual
+ValueType=integer
+Description=Visual content width
+
+
+[xesam:wordCount]
+Parents=
+Categories=xesam:Text
+ValueType=integer
+Description=Text word count
+
+
+[xesam:workEmailAddress]
+Parents=xesam:emailAddress
+Categories=xesam:Person
+ValueType=List of strings
+Description=Contact work email address
+
+
+[xesam:workPhoneNumber]
+Parents=xesam:phoneNumber
+Categories=xesam:Person
+ValueType=List of strings
+Description=Contact work phone number
+
+
+[xesam:workPostalAddress]
+Parents=xesam:physicalAddress
+Categories=xesam:Person
+ValueType=List of strings
+Description=Contact work address
+

Added: branches/xesam-support/data/services/xesam.service
==============================================================================
--- (empty file)
+++ branches/xesam-support/data/services/xesam.service	Tue May 13 10:11:59 2008
@@ -0,0 +1,244 @@
+
+[xesam:Annotation]
+Parents=xesam:Content
+Description=Generic annotation. Annotation provides a set of document description properties(like subject, title, description) for a list of objects it links to. It can link to other annotations, however interpretation of this may differ between specific annotation classes..
+
+[xesam:Archive]
+Parents=xesam:Content
+Description=Generic archive
+
+[xesam:ArchivedFile]
+Parents=xesam:Filelike
+Description=File stored in an archive
+
+[xesam:Audio]
+Parents=xesam:Media
+Description=Defines audio aspect of content. The content itself may have other aspects.
+
+[xesam:AudioList]
+Parents=xesam:MediaList
+Description=Generic audio list(playlist). Linking to other content types is forbidden
+
+[xesam:BlockDevice]
+Parents=xesam:Source
+Description=Generic block device. Typically contains partitions/filesystems
+
+[xesam:Bookmark]
+Parents=xesam:Annotation
+Description=Bookmark. Currently there's nothing that would distinguish bookmarks and tags
+
+[xesam:CommunicationChannel]
+Parents=xesam:Content
+Description=Communication channel
+
+[xesam:Contact]
+Parents=xesam:Content
+Description=Contact
+
+[xesam:ContactGroup]
+Parents=xesam:Content
+Description=ContactGroup
+
+[xesam:Content]
+Parents=xesam:DataObject
+Description=Generic content
+
+[xesam:DataObject]
+Parents=
+Description=Generic data object. Unites form and essense aspects represented by Content and Source. Used to aggreate properties that may be extracted from both content and source.
+
+[xesam:DeletedFile]
+Parents=xesam:Filelike
+Description=File deleted to trash
+
+[xesam:Document]
+Parents=xesam:Text
+Description=Document is an arrangement of various atomic data types with text being the primary data type.
+
+[xesam:Documentation]
+Parents=xesam:Document
+Description=Documentation is a document containing help, manuals, guides.
+
+[xesam:Email]
+Parents=xesam:Message
+Description=Email message
+
+[xesam:EmailAttachment]
+Parents=xesam:EmbeddedObject
+Description=Generic storage
+
+[xesam:EmbeddedObject]
+Parents=xesam:Source
+Description=Generic embedded/inlined object: attachment, inlined SVG, script etc.
+
+[xesam:File]
+Parents=xesam:Filelike
+Description=Regular file stored in a filesystem
+
+[xesam:FileSystem]
+Parents=xesam:Content
+Description=Filesystem differs from other containers in that it has total/free/occupied space(though DBs too have similar properties), has volume(content.title), UUID for *ix(content.ID), mount point(if mounted)
+
+[xesam:Filelike]
+Parents=xesam:Source
+Description=File-like object
+
+[xesam:Folder]
+Parents=xesam:Annotation
+Description=Generic folder. In general, folders represent a tree-like structure(taxonomy), however on occasion this rule may violated in cases like symlinks.
+
+[xesam:IMAP4Message]
+Parents=xesam:RemoteMessageboxMessage
+Description=IMAP4 mailbox message
+
+[xesam:IMMessage]
+Parents=xesam:Message
+Description=Generic Instant Messaging message
+
+[xesam:Image]
+Parents=xesam:Visual
+Description=Visual content
+
+[xesam:MailingList]
+Parents=xesam:ContactGroup;xesam:CommunicationChannel
+Description=Mailing list
+
+[xesam:MailingListEmail]
+Parents=xesam:Email
+Description=Email message addressed at/received from a mailing list
+
+[xesam:Media]
+Parents=xesam:Content
+Description=Generic raster/sampled media is considered consisting of Sets of Samples being reproduced(played/shown) at once. We describe: sample data type(int/float), data bit depth,configuration(color space for images, channel count for audio); set configuration(pixel dimensions for image); set count and rate.
+
+[xesam:MediaList]
+Parents=xesam:Annotation
+Description=Generic media content list(playlist). Linking to other content types is forbidden
+
+[xesam:Message]
+Parents=xesam:Content
+Description=Generic message
+
+[xesam:MessageboxMessage]
+Parents=xesam:Source
+Description=Message stored in a message box
+
+[xesam:Music]
+Parents=xesam:Audio
+Description=Music content
+
+[xesam:NewsGroup]
+Parents=xesam:CommunicationChannel
+Description=News group
+
+[xesam:NewsGroupEmail]
+Parents=xesam:Email
+Description=Email message addressed at/received from a news group
+
+[xesam:OfflineMedia]
+Parents=xesam:Source
+Description=Generic offline media. e.g. USB drive not attached at this moment.
+
+[xesam:Organization]
+Parents=xesam:Contact
+Description=Organization
+
+[xesam:POP3Message]
+Parents=xesam:RemoteMessageboxMessage
+Description=POP3 mailbox message
+
+[xesam:Person]
+Parents=xesam:Contact
+Description=Person
+
+[xesam:PersonalEmail]
+Parents=xesam:Email
+Description=Personal email message(not related to a mailing list or discussion group)
+
+[xesam:Photo]
+Parents=xesam:Image
+Description=An image with EXIF tags(photo)
+
+[xesam:Presentation]
+Parents=xesam:Document
+Description=Presentation document
+
+[xesam:Project]
+Parents=xesam:Annotation
+Description=Generic project
+
+[xesam:RSSFeed]
+Parents=xesam:CommunicationChannel
+Description=RSS feed
+
+[xesam:RSSMessage]
+Parents=xesam:Message
+Description=RSS message(RSS feed item)
+
+[xesam:RemoteFile]
+Parents=xesam:RemoteResource;xesam:Filelike
+Description=Remote file
+
+[xesam:RemoteMessageboxMessage]
+Parents=xesam:RemoteResource;xesam:MessageboxMessage
+Description=Remote messagebox message
+
+[xesam:RemoteResource]
+Parents=xesam:Source
+Description=Generic remote resource
+
+[xesam:RevisionControlledFile]
+Parents=xesam:File
+Description=File managed by a revision control system
+
+[xesam:RevisionControlledRepository]
+Parents=xesam:Content
+Description=Revision-controlled repository. In case of distributed repositories, those must be linked with derivation relations.
+
+[xesam:SoftwarePackage]
+Parents=xesam:Content
+Description=Software distribution package
+
+[xesam:Source]
+Parents=xesam:DataObject
+Description=Generic source
+
+[xesam:SourceCode]
+Parents=xesam:Text
+Description=Source Code
+
+[xesam:Spreadsheet]
+Parents=xesam:Document
+Description=Spreadsheet document
+
+[xesam:SystemResource]
+Parents=xesam:Source
+Description=Generic system resource like man documentation
+
+[xesam:Tag]
+Parents=xesam:Annotation
+Description=Tag/keyword. As opposed to folders, there are no limitations on the structure of tags and arbitrary overlaps are possible.
+
+[xesam:Text]
+Parents=xesam:Content
+Description=Defines a textual aspect of content. Properties represent only actual content intended for the user, not markup. Other parts of content like markup should be described using other clsses. Abstract class.
+
+[xesam:TextDocument]
+Parents=xesam:Document
+Description=Text document. For word processing apps.
+
+[xesam:UncategorizedText]
+Parents=xesam:Text
+Description=Text content which doesn't fit any other text-based classes. Corresponds to Tracker's Text category.
+
+[xesam:Video]
+Parents=xesam:Audio;xesam:Visual
+Description=Video content
+
+[xesam:Visual]
+Parents=xesam:Media
+Description=Visual content
+
+[xesam:XML]
+Parents=xesam:Text
+Description=XML content

Modified: branches/xesam-support/data/sqlite-stored-procs.sql
==============================================================================
--- branches/xesam-support/data/sqlite-stored-procs.sql	(original)
+++ branches/xesam-support/data/sqlite-stored-procs.sql	Tue May 13 10:11:59 2008
@@ -29,7 +29,7 @@
 GetEvents SELECT ID, ServiceID, EventType FROM Events WHERE BeingHandled = 1;
 SetEventsBeingHandled UPDATE Events SET BeingHandled = 1;
 
-GetLiveSearchModifiedIDs SELECT E.ServiceID FROM Events as E, LiveSearches as X WHERE E.ServiceID = X.ServiceID AND X.SearchID = ? AND E.EventType IS NOT 'Create';
+GetLiveSearchModifiedIDs SELECT E.ServiceID FROM Events as E, LiveSearches as X WHERE E.ServiceID = X.ServiceID AND X.SearchID = ? AND NOT E.EventType='Create';
 GetLiveSearchHitCount SELECT count(*) FROM LiveSearches WHERE SearchID = ?;
 
 GetNewEventID SELECT OptionValue FROM Options WHERE OptionKey = 'EventSequence';
@@ -190,3 +190,20 @@
 UpdateHitDetails Update HitIndex set HitCount = ?, HitArraySize = ? where ROWID = ?;
 ResizeHitDetails Update HitIndex set HitCount = ?, HitArraySize = ?, HitArray = Zeroblob(?) where ROWID = ?;
 
+InsertXesamMetadataType INSERT INTO XesamMetaDataTypes (MetaName) Values (?);
+InsertXesamServiceType INSERT INTO XesamServiceTypes (TypeName) Values (?);
+InsertXesamMetaDataMapping INSERT INTO XesamMetaDataMapping (XesamMetaName, MetaName) Values (?, ?);
+InsertXesamServiceMapping INSERT INTO XesamServiceMapping (XesamTypeName, TypeName) Values (?, ?);
+InsertXesamServiceLookup REPLACE INTO XesamServiceLookup (XesamTypeName, TypeName) Values (?, ?);
+InsertXesamMetaDataLookup REPLACE INTO XesamMetaDataLookup (XesamMetaName, MetaName) Values (?, ?);
+
+GetXesamServiceTypes SELECT TypeName, Parents FROM XesamServiceTypes;
+GetXesamServiceChildren SELECT Child FROM XesamServiceChildren WHERE Parent = ?;
+GetXesamServiceMappings SELECT TypeName FROM XesamServiceMapping WHERE XesamTypeName = ?;
+GetXesamServiceLookups SELECT DISTINCT TypeName FROM XesamServiceLookup WHERE XesamTypeName = ?;
+
+
+GetXesamMetaDataTypes SELECT MetaName, Parents FROM XesamMetaDataTypes;
+GetXesamMetaDataChildren SELECT Child FROM XesamMetaDataChildren WHERE Parent = ?;
+GetXesamMetaDataMappings SELECT MetaName FROM XesamMetaDataMapping WHERE XesamMetaName = ?;
+GetXesamMetaDataLookups SELECT DISTINCT MetaName FROM XesamMetaDataLookup WHERE XesamMetaName = ?;
\ No newline at end of file

Added: branches/xesam-support/data/sqlite-xesam.sql
==============================================================================
--- (empty file)
+++ branches/xesam-support/data/sqlite-xesam.sql	Tue May 13 10:11:59 2008
@@ -0,0 +1,74 @@
+
+CREATE TABLE  XesamMetaDataTypes 
+(
+	ID	 		Integer primary key AUTOINCREMENT not null,
+	MetaName		Text not null  COLLATE NOCASE, 
+	DataTypeID		Integer default 0,    /* 0=string, 1=float, 2=integer, 3=boolean, 4=dateTime, 5=List of strings, 8=List of Uris, 9=List of Urls */
+	Description		text default ' ',
+	Categories		text default ' ',
+	Parents			text default ' ',
+
+	Unique (MetaName)
+);
+
+CREATE TABLE  XesamServiceTypes
+(
+	TypeID 			Integer primary key AUTOINCREMENT not null,
+	TypeName		Text COLLATE NOCASE not null,
+	Description		Text default ' ',
+	Parents			text default ' ',
+
+	unique (TypeName)
+);
+
+CREATE TABLE  XesamServiceMapping
+(
+	ID			Integer primary key AUTOINCREMENT not null,
+	XesamTypeName		Text,
+	TypeName		Text,
+
+	unique (XesamTypeName, TypeName)
+);
+
+CREATE TABLE XesamMetaDataMapping
+(
+	ID			Integer primary key AUTOINCREMENT not null,
+	XesamMetaName		Text,
+	MetaName		Text,
+
+	unique (XesamMetaName, MetaName)
+);
+
+CREATE TABLE XesamServiceChildren
+(
+	Parent			Text,
+	Child			Text,
+
+	unique (Parent, Child)
+);
+
+CREATE TABLE XesamMetaDataChildren
+(
+	Parent			Text,
+	Child			Text,
+
+	unique (Parent, Child)
+);
+
+CREATE TABLE XesamServiceLookup
+(	
+	ID			Integer primary key AUTOINCREMENT not null,
+	XesamTypeName		Text,
+	TypeName		Text,
+
+	unique (XesamTypeName, TypeName)
+);
+
+CREATE TABLE XesamMetaDataLookup
+(	
+	ID			Integer primary key AUTOINCREMENT not null,
+	XesamMetaName		Text,
+	MetaName		Text,
+
+	unique (XesamMetaName, MetaName)
+);
\ No newline at end of file

Modified: branches/xesam-support/src/trackerd/Makefile.am
==============================================================================
--- branches/xesam-support/src/trackerd/Makefile.am	(original)
+++ branches/xesam-support/src/trackerd/Makefile.am	Tue May 13 10:11:59 2008
@@ -133,6 +133,8 @@
 	tracker-status.h						\
 	tracker-xesam.h							\
 	tracker-xesam.c							\
+	tracker-xesam-query.c						\
+	tracker-xesam-query.h						\
 	tracker-xesam-session.c						\
 	tracker-xesam-session.h						\
 	tracker-xesam-live-search.c					\

Modified: branches/xesam-support/src/trackerd/tracker-db-sqlite.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db-sqlite.c	(original)
+++ branches/xesam-support/src/trackerd/tracker-db-sqlite.c	Tue May 13 10:11:59 2008
@@ -445,7 +445,7 @@
 	gchar                  **groups, **keys;
 	gchar                  **group, **key;
 	TrackerService          *service;
-	gint                     id;
+	gint                    id;
 
 	service_file = tracker_db_manager_get_service_file (filename);
 
@@ -1149,7 +1149,19 @@
 		load_service_description_file (db_con, "email.metadata");
 		load_service_description_file (db_con, "image.metadata");	
 		load_service_description_file (db_con, "video.metadata");	
-	
+
+		load_sql_file (db_con, "sqlite-xesam.sql");
+
+		tracker_db_load_xesam_service_file (db_con, "xesam.metadata");
+		tracker_db_load_xesam_service_file (db_con, "xesam-convenience.metadata");
+		tracker_db_load_xesam_service_file (db_con, "xesam-virtual.metadata");
+		tracker_db_load_xesam_service_file (db_con, "xesam.service");
+		tracker_db_load_xesam_service_file (db_con, "xesam-convenience.service");
+		tracker_db_load_xesam_service_file (db_con, "xesam-service.smapping");
+		tracker_db_load_xesam_service_file (db_con, "xesam-metadata.mmapping");
+
+		tracker_db_create_xesam_lookup(db_con);
+
 		tracker_db_exec_no_reply (db_con->db, "ANALYZE");
 	}
 
@@ -1466,6 +1478,18 @@
 
 	load_service_description_file (db_con, "default.service");
 
+	load_sql_file (db_con, "sqlite-xesam.sql");
+
+	tracker_db_load_xesam_service_file (db_con, "xesam.metadata");
+	tracker_db_load_xesam_service_file (db_con, "xesam-convenience.metadata");
+	tracker_db_load_xesam_service_file (db_con, "xesam-virtual.metadata");
+	tracker_db_load_xesam_service_file (db_con, "xesam.service");
+	tracker_db_load_xesam_service_file (db_con, "xesam-convenience.service");
+	tracker_db_load_xesam_service_file (db_con, "xesam-service.smapping");
+	tracker_db_load_xesam_service_file (db_con, "xesam-metadata.mmapping");
+
+	tracker_db_create_xesam_lookup(db_con);	
+
 	tracker_db_exec_no_reply (db_con->db, "ANALYZE");
 	
 	tracker_db_close (db_con->db);
@@ -2259,6 +2283,28 @@
 	return NULL;
 }
 
+
+TrackerDBResultSet *
+tracker_get_xesam_metadata_names (DBConnection *db_con, const char *name)
+{
+	TrackerDBResultSet  *result_set;
+
+	result_set = tracker_exec_proc (db_con, "GetXesamMetaDataLookups", name, NULL);
+
+	return result_set;
+}
+
+TrackerDBResultSet *
+tracker_get_xesam_service_names (DBConnection *db_con, const char *name)
+{
+	TrackerDBResultSet  *result_set;
+
+	result_set = tracker_exec_proc (db_con, "GetXesamServiceLookups", name, NULL);
+
+	return result_set;
+}
+
+
 char *
 tracker_get_metadata_table (DataTypes type)
 {
@@ -4850,6 +4896,362 @@
 
 }
 
+// FIXME Do this in a non-retarded way
+
+gboolean
+get_service_mapping(DBConnection *db_con, const char *type, GList **list)
+{
+	TrackerDBResultSet *result_set;
+	gboolean valid = TRUE;
+
+	result_set = tracker_exec_proc (db_con, "GetXesamServiceMappings", type, NULL);
+
+	if (result_set) {
+		while (valid) {
+			gchar *st;
+			
+			tracker_db_result_set_get (result_set, 0, &st, -1);
+			if (strcmp(st, " ") != 0) {			
+				*list = g_list_append (*list,g_strdup (st));
+			}
+			
+			valid = tracker_db_result_set_iter_next (result_set);
+			g_free (st);
+		}
+		
+		g_object_unref (result_set);
+	}
+
+	result_set = tracker_exec_proc (db_con, "GetXesamServiceChildren", type, NULL);
+	valid = TRUE;
+
+	if (result_set) {
+		while (valid) {
+			gchar *st;
+			
+			tracker_db_result_set_get (result_set, 0, &st, -1);
+			get_service_mapping(db_con, st ,list);
+			
+			valid = tracker_db_result_set_iter_next (result_set);
+			g_free (st);
+		}
+		
+		g_object_unref (result_set);
+	}
+
+	return TRUE;
+}
+
+gboolean
+get_metadata_mapping(DBConnection *db_con, const char *type, GList **list)
+{
+	TrackerDBResultSet *result_set;
+	gboolean valid = TRUE;
+
+	result_set = tracker_exec_proc (db_con, "GetXesamMetaDataMappings", type, NULL);
+
+	if (result_set) {
+		while (valid) {
+			gchar *st;
+			
+			tracker_db_result_set_get (result_set, 0, &st, -1);
+			if (strcmp(st, " ") != 0) {			
+				*list = g_list_append (*list,g_strdup (st));
+			}
+			
+			valid = tracker_db_result_set_iter_next (result_set);
+			g_free (st);
+		}
+
+		g_object_unref (result_set);
+	}
+
+	result_set = tracker_exec_proc (db_con, "GetXesamMetaDataChildren", type, NULL);
+	valid = TRUE;
+
+	if (result_set) {
+		while (valid) {
+			gchar *st;
+			
+			tracker_db_result_set_get (result_set, 0, &st, -1);
+			get_service_mapping(db_con, st ,list);
+			
+			valid = tracker_db_result_set_iter_next (result_set);
+			g_free (st);
+		}
+		
+		g_object_unref (result_set);
+	}
+
+	return TRUE;
+}
+
+
+gboolean
+tracker_db_create_xesam_lookup (DBConnection *db_con)
+{
+	TrackerDBResultSet   *result_set;
+	gboolean              valid = TRUE;
+
+	result_set = tracker_exec_proc (db_con, "GetXesamServiceTypes", NULL);
+	
+	if (result_set) {
+		while (valid) {
+				gchar *st;
+				GList *list = NULL;
+				GList *iter = NULL;
+				
+				tracker_db_result_set_get (result_set, 0, &st, -1);
+				get_service_mapping(db_con, st, &list);
+				
+				iter = g_list_first(list);
+				while (iter) {
+					tracker_exec_proc (db_con, "InsertXesamServiceLookup", st, iter->data, NULL);
+					g_free(iter->data);
+					
+					iter = g_list_next (iter);
+				}			
+				
+				g_list_free (list);
+				
+				valid = tracker_db_result_set_iter_next (result_set);
+				g_free (st);
+		}
+	}
+
+	g_object_unref (result_set);	
+	valid = TRUE;
+
+	result_set = tracker_exec_proc (db_con, "GetXesamMetaDataTypes", NULL);
+
+	if (result_set) {
+		while (valid) {
+				gchar *st;
+				GList *list = NULL;
+				GList *iter = NULL;	
+
+				tracker_db_result_set_get (result_set, 0, &st, -1);
+				get_metadata_mapping(db_con, st, &list);
+				
+				iter = g_list_first(list);
+				while (iter) {
+					tracker_exec_proc (db_con, "InsertXesamMetaDataLookup", st, iter->data, NULL);
+					g_free(iter->data);
+					
+					iter = g_list_next (iter);
+				}			
+				
+				g_list_free (list);
+				
+				valid = tracker_db_result_set_iter_next (result_set);
+				g_free (st);
+		}
+	}
+	
+	g_object_unref (result_set);	
+
+	return TRUE;
+}
+
+gboolean
+tracker_db_load_xesam_service_file (DBConnection *db_con, const char *filename)
+{
+	GKeyFile 		*key_file = NULL;
+	const char * const 	*locale_array;
+	char 			*service_file, *sql;
+	gboolean		is_metadata = FALSE, is_service = FALSE, is_metadata_mapping = FALSE, is_service_mapping = FALSE;
+	int			id;
+
+	char *DataTypeArray[11] = {"string", "float", "integer", "boolean", "dateTime", "List of strings", "List of Uris", "List of Urls", NULL};
+
+	service_file = tracker_db_manager_get_service_file (filename);
+
+	locale_array = g_get_language_names ();
+
+	key_file = g_key_file_new ();
+
+	if (g_key_file_load_from_file (key_file, service_file, G_KEY_FILE_NONE, NULL)) {
+		
+		if (g_str_has_suffix (filename, ".metadata")) {
+			is_metadata = TRUE;
+		} else if (g_str_has_suffix (filename, ".service")) {
+			is_service = TRUE;
+		} else if (g_str_has_suffix (filename, ".mmapping")) {
+			is_metadata_mapping = TRUE;
+		} else if (g_str_has_suffix (filename, ".smapping")) {
+			is_service_mapping = TRUE;
+		} else {
+			g_key_file_free (key_file);
+			g_free (service_file);		
+			return FALSE;
+		} 
+
+
+		char **groups = g_key_file_get_groups (key_file, NULL);
+		char **array;
+
+		for (array = groups; *array; array++) {
+                        if (is_metadata) {
+
+		                tracker_exec_proc (db_con, "InsertXesamMetadataType", *array, NULL);
+				id = tracker_db_interface_sqlite_get_last_insert_id (TRACKER_DB_INTERFACE_SQLITE (db_con->db));
+
+
+		        } else if (is_service) {
+				
+		                tracker_exec_proc (db_con, "InsertXesamServiceType", *array, NULL);
+				id = tracker_db_interface_sqlite_get_last_insert_id (TRACKER_DB_INTERFACE_SQLITE (db_con->db));
+
+			} else {
+				/* Nothing required */
+			}
+
+			/* get inserted ID */
+			
+			char *str_id = tracker_uint_to_string (id);
+
+			char **keys = g_key_file_get_keys (key_file, *array, NULL, NULL);
+			char **array2;
+	
+			for (array2 = keys; *array2; array2++) {
+	
+				char *value = g_key_file_get_locale_string (key_file, *array, *array2, locale_array[0], NULL);
+
+				if (value) {
+
+					if (strcasecmp (value, "true") == 0) {
+
+						g_free (value);
+						value = g_strdup ("1");
+
+					} else if  (strcasecmp (value, "false") == 0) {
+
+						g_free (value);
+						value = g_strdup ("0");
+					}
+
+					if (is_metadata) {
+						
+						if (strcasecmp (*array2, "Parents") == 0) {
+							
+							char **parents, **parents_p ;
+
+							parents = g_strsplit_set (value, ";", -1);
+							
+							if (parents) {
+								for (parents_p = parents; *parents_p; parents_p++) {
+									sql = g_strdup_printf ("INSERT INTO XesamMetadataChildren (Parent, Child) VALUES ('%s', '%s')", *parents_p, *array);
+									tracker_db_exec_no_reply (db_con->db, sql);
+									
+									g_free(sql);
+								}
+							}
+
+						} else if (strcasecmp (*array2, "ValueType") == 0) {
+							
+							int data_id =  tracker_string_in_string_list (value, DataTypeArray);
+							
+							if (data_id != -1) {
+								sql = g_strdup_printf ("update XesamMetadataTypes set DataTypeID = %d where ID = %s", data_id, str_id);
+								tracker_db_exec_no_reply (db_con->db, sql);
+								g_free (sql);
+								
+							}
+							
+							
+						} else {
+							char *esc_value = tracker_escape_string (value);
+							
+							sql = g_strdup_printf ("update XesamMetadataTypes set  %s = '%s' where ID = %s", *array2, esc_value, str_id);
+								
+							tracker_db_exec_no_reply (db_con->db, sql);
+							g_free (sql);
+							g_free (esc_value);
+						}
+	
+					} else 	if (is_service) {
+						if (strcasecmp (*array2, "Parents") == 0) {
+							
+							char **parents, **parents_p ;
+
+							parents = g_strsplit_set (value, ";", -1);
+							
+							if (parents) {
+								for (parents_p = parents; *parents_p; parents_p++) {
+									sql = g_strdup_printf ("INSERT INTO XesamServiceChildren (Parent, Child) VALUES ('%s', '%s')", *parents_p, *array);
+									tracker_db_exec_no_reply (db_con->db, sql);
+									
+									g_free(sql);
+								}
+							}
+						} else {
+							char *esc_value = tracker_escape_string (value);
+							sql = g_strdup_printf ("update XesamServiceTypes set  %s = '%s' where typeID = %s", *array2, esc_value, str_id);
+							tracker_db_exec_no_reply (db_con->db, sql);
+							g_free (sql);
+							g_free (esc_value);
+						}
+	
+					} else 	if (is_metadata_mapping) {
+						char **mappings, **mappings_p ;
+						
+						mappings = g_strsplit_set (value, ";", -1);
+						
+						if (mappings) {
+							for (mappings_p = mappings; *mappings_p; mappings_p++) {
+								char *esc_value = tracker_escape_string (*mappings_p);
+								tracker_exec_proc (db_con, "InsertXesamMetaDataMapping", *array, esc_value, NULL);
+								g_free (esc_value);
+							}
+						}
+							
+					} else {
+						char **mappings, **mappings_p ;
+						
+						mappings = g_strsplit_set (value, ";", -1);
+						
+						if (mappings) {
+							for (mappings_p = mappings; *mappings_p; mappings_p++) {
+								char *esc_value = tracker_escape_string (*mappings_p);
+								tracker_exec_proc (db_con, "InsertXesamServiceMapping", *array, esc_value, NULL);
+								g_free (esc_value);
+							}
+						}
+						
+					}
+					
+					g_free (value);
+					
+				}
+			}
+
+			if (keys) {
+				g_strfreev (keys);
+			}
+
+			g_free (str_id);
+
+		}
+
+
+		if (groups) {
+			g_strfreev (groups);
+		}
+			
+
+		g_key_file_free (key_file);
+
+	} else {
+		g_key_file_free (key_file);
+		return FALSE;
+	}
+		       
+	g_free (service_file);		
+
+	return TRUE;
+}
+
+
 FieldData *
 tracker_db_get_metadata_field (DBConnection *db_con, const char *service, const char *field_name, int field_count, gboolean is_select, gboolean is_condition)
 {

Modified: branches/xesam-support/src/trackerd/tracker-db-sqlite.h
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db-sqlite.h	(original)
+++ branches/xesam-support/src/trackerd/tracker-db-sqlite.h	Tue May 13 10:11:59 2008
@@ -361,6 +361,12 @@
 
 void                tracker_free_metadata_field                (FieldData *field_data);
 
+TrackerDBResultSet *tracker_get_xesam_metadata_names 	       (DBConnection *db_con, const char *name);
+TrackerDBResultSet *tracker_get_xesam_service_names 	       (DBConnection *db_con, const char *name);
+
+gboolean	    tracker_db_load_xesam_service_file 	       (DBConnection *db_con, const char *filename);
+gboolean            tracker_db_create_xesam_lookup             (DBConnection *db_con);
+
 G_END_DECLS
 
 #endif /* __TRACKERD_DB_SQLITE_H__ */

Modified: branches/xesam-support/src/trackerd/tracker-xesam-live-search.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam-live-search.c	(original)
+++ branches/xesam-support/src/trackerd/tracker-xesam-live-search.c	Tue May 13 10:11:59 2008
@@ -15,8 +15,7 @@
  *
  * You should have received a copy of the GNU General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA  02110-1301, USA.
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA  02110-1301, USA.
  */
 
 #include "tracker-xesam-live-search.h"
@@ -24,13 +23,16 @@
 #include "tracker-dbus.h"
 #include "tracker-xesam.h"
 
+#include "tracker-xesam-query.h"
+
 
 struct _TrackerXesamLiveSearchPriv {
-	TrackerXesamSession *session;
 	gchar *search_id;
+	TrackerXesamSession *session;
 	gboolean active;
 	gboolean closed;
 	gchar *query;
+	gchar *sql;
 };
 
 enum {
@@ -40,7 +42,7 @@
 
 G_DEFINE_TYPE (TrackerXesamLiveSearch, tracker_xesam_live_search, G_TYPE_OBJECT)
 
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_XESAM_LIVE_SEARCH, TrackerXesamLiveSearch))
+#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_XESAM_LIVE_SEARCH, struct _TrackerXesamLiveSearchPriv))
 
 static void
 tracker_xesam_live_search_finalize (GObject *object)
@@ -51,6 +53,10 @@
 		g_object_unref (priv->session);
 	g_free (priv->search_id);
 	g_free (priv->query);
+	g_free (priv->sql);
+
+	if (priv->session)
+		g_object_unref (priv->session);
 }
 
 void
@@ -68,16 +74,11 @@
 {
 	TrackerXesamLiveSearchPriv *priv = self->priv;
 
-	g_free (priv->query);
-
-	// ottela, look!
-	// TODO: parse XML query into SQL query here
-
 	priv->query = g_strdup (query);
 }
 
 static void
-xexam_search_set_property (GObject      *object,
+xesam_search_set_property (GObject      *object,
 			   guint 	param_id,
 			   const GValue *value,
 			   GParamSpec   *pspec)
@@ -99,7 +100,7 @@
 {
 	GObjectClass *object_class;
 	object_class = G_OBJECT_CLASS (klass);
-	object_class->set_property = xexam_search_set_property;
+	object_class->set_property = xesam_search_set_property;
 
 	g_object_class_install_property (object_class,
 					 PROP_XMLQUERY,
@@ -109,17 +110,26 @@
 							       G_PARAM_WRITABLE));
 
 	object_class->finalize = tracker_xesam_live_search_finalize;
+	g_type_class_add_private( klass, sizeof(struct _TrackerXesamLiveSearchPriv) );
+
 }
 
 static void 
 tracker_xesam_live_search_init (TrackerXesamLiveSearch *self) 
 {
-	TrackerXesamLiveSearchPriv *priv = self->priv;
+	TrackerXesamLiveSearchPriv *priv;
+
+	priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,TRACKER_TYPE_XESAM_LIVE_SEARCH,struct _TrackerXesamLiveSearchPriv);
+
 	priv->session = NULL;
 	priv->search_id = NULL;
+	priv->session = NULL;
+
 	priv->active = FALSE;
 	priv->closed = FALSE;
 	priv->query = g_strdup ("1=1");
+	
+	priv->sql = g_strdup ("");
 }
 
 /**
@@ -422,7 +432,7 @@
 	gboolean valid = TRUE;
 	gint hitfields_columns = 0, column;
 	GPtrArray *result = g_ptr_array_new ();
-
+	
 	while (valid) {
 		GPtrArray *row = g_ptr_array_new ();
 
@@ -632,7 +642,7 @@
  * @returns: a read-only string with the query
  **/
 const gchar* 
-tracker_xesam_live_search_get_query (TrackerXesamLiveSearch *self)
+tracker_xesam_live_search_get_xml_query (TrackerXesamLiveSearch *self)
 {
 	TrackerXesamLiveSearchPriv *priv = self->priv;
 	return (const gchar *) priv->query;
@@ -673,6 +683,58 @@
 }
 
 /**
+ * tracker_xesam_live_search_get_query:
+ * @self: a #TrackerXesamLiveSearch
+ *
+ * * API will change *
+ *
+ * Parses the current xml query and sets the sql
+ *
+ * @returns: a read-only string with the query
+ **/
+const gchar*
+tracker_xesam_live_search_parse_query (TrackerXesamLiveSearch  *self,
+				       GError                 **error)
+{
+	TrackerXesamLiveSearchPriv *priv = self->priv;	
+	TrackerDBusXesam           *proxy = TRACKER_DBUS_XESAM (tracker_dbus_get_object (TRACKER_TYPE_DBUS_XESAM));
+	DBConnection               *db_con = NULL;
+	GError                     *parse_error;
+
+	g_object_get (proxy, "db-connection", &db_con, NULL);
+	if (priv->sql)
+		g_free (priv->sql);
+	priv->sql = tracker_xesam_query_to_sql (db_con, priv->query, parse_error);
+
+	if (parse_error) {
+		// FIXME Send the actual parse error.
+			g_set_error (error, TRACKER_XESAM_ERROR, 
+				     TRACKER_XESAM_ERROR_PARSING_FAILED,
+				     "Parsing failed");
+			g_free (parse_error);
+	}
+
+	return priv->sql;
+}
+
+/**
+ * tracker_xesam_live_search_get_query:
+ * @self: a #TrackerXesamLiveSearch
+ *
+ * * API will change *
+ *
+ * Gets the parsed sql for the query
+ *
+ * @returns: a read-only string with the query
+ **/
+const gchar* 
+tracker_xesam_live_search_get_query (TrackerXesamLiveSearch *self)
+{
+	TrackerXesamLiveSearchPriv *priv = self->priv;
+	return (const gchar *) priv->sql;
+}
+
+/**
  * tracker_xesam_live_search_new:
  *
  * Create a new #TrackerXesamLiveSearch

Modified: branches/xesam-support/src/trackerd/tracker-xesam-live-search.h
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam-live-search.h	(original)
+++ branches/xesam-support/src/trackerd/tracker-xesam-live-search.h	Tue May 13 10:11:59 2008
@@ -53,14 +53,20 @@
 void         tracker_xesam_live_search_set_id             (TrackerXesamLiveSearch  *self,
 							   const gchar             *search_id);
 const gchar* tracker_xesam_live_search_get_id             (TrackerXesamLiveSearch  *self);
+
 const gchar* tracker_xesam_live_search_get_query          (TrackerXesamLiveSearch  *self);
-void         tracker_xesam_live_search_set_xml_query      (TrackerXesamLiveSearch *self, 
-							   const gchar *xml_query);
+const gchar* tracker_xesam_live_search_get_xml_query      (TrackerXesamLiveSearch  *self);
+void         tracker_xesam_live_search_set_xml_query      (TrackerXesamLiveSearch  *self, 
+							   const gchar             *xml_query);
+void         tracker_xesam_live_search_set_session        (TrackerXesamLiveSearch *self, 
+							   gpointer                 session);
 void         tracker_xesam_live_search_set_session        (TrackerXesamLiveSearch *self, 
 							   gpointer session);
 void         tracker_xesam_live_search_activate           (TrackerXesamLiveSearch  *self,
 							   GError                 **error);
 gboolean     tracker_xesam_live_search_is_active          (TrackerXesamLiveSearch  *self);
+const gchar* tracker_xesam_live_search_parse_query        (TrackerXesamLiveSearch  *self,
+							   GError                 **error);
 void         tracker_xesam_live_search_get_hit_data       (TrackerXesamLiveSearch  *self,
 							   GArray                  *hit_ids,
 							   GStrv                    fields,

Added: branches/xesam-support/src/trackerd/tracker-xesam-query.c
==============================================================================
--- (empty file)
+++ branches/xesam-support/src/trackerd/tracker-xesam-query.c	Tue May 13 10:11:59 2008
@@ -0,0 +1,1263 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/* Tracker - indexer and metadata database engine
+ * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ */
+
+#include <string.h>
+
+#include <libtracker-common/tracker-log.h>
+#include <libtracker-common/tracker-type-utils.h>
+#include <libtracker-common/tracker-utils.h>
+
+#include "tracker-xesam-query.h"
+
+
+/* XESAM Query Condition
+<query>
+	<and>
+        	<greaterThan>
+            		<field name="File:Size" />
+            		<integer>1000000<integer>
+          	</greaterThan>
+          	<equals>
+             		<field name="File:Path" />
+             		<string>/home/jamie<string>
+           	</equals>
+	</and>
+</Condition>
+*/
+
+
+/* main elements */
+#define ELEMENT_XESAM_QUERY 	        "query"
+#define ELEMENT_XESAM_USER_QUERY        "userQuery"
+#define ELEMENT_XESAM_FIELD 		"field"
+
+/* operators */
+#define ELEMENT_XESAM_AND 		"and"
+#define ELEMENT_XESAM_OR	 	"or"
+#define ELEMENT_XESAM_EQUALS 		"equals"
+#define ELEMENT_XESAM_GREATER_THAN	"greaterThan"
+#define ELEMENT_XESAM_GREATER_OR_EQUAL	"greaterOrEqual"
+#define ELEMENT_XESAM_LESS_THAN 	"lessThan"
+#define ELEMENT_XESAM_LESS_OR_EQUAL	"lessOrEqual"
+
+/* extension operators - "contains" does a substring or full text match, "in_Set" does string in list match */
+#define ELEMENT_XESAM_CONTAINS 		"contains"
+#define ELEMENT_XESAM_REGEX        	"regex"
+#define ELEMENT_XESAM_STARTS_WITH 	"startsWith"
+#define ELEMENT_XESAM_IN_SET		"inSet"
+
+/* types */
+#define ELEMENT_XESAM_INTEGER 		"integer"
+#define ELEMENT_XESAM_DATE 		"date"
+#define ELEMENT_XESAM_STRING 		"string"
+#define ELEMENT_XESAM_FLOAT 		"float"
+#define ELEMENT_XESAM_BOOLEAN           "boolean"
+
+#define ELEMENT_IS(name) (strcmp (element_name, (name)) == 0)
+
+
+enum {
+	NO_ERROR,
+	PARSE_ERROR,
+};
+
+
+typedef enum {
+	STATE_START,
+	STATE_QUERY,
+	STATE_END_QUERY,
+	STATE_USER_QUERY,
+	STATE_END_USER_QUERY,
+	STATE_FIELD,
+	STATE_AND,
+	STATE_END_AND,
+	STATE_OR,
+	STATE_END_OR,
+	STATE_EQUALS,
+	STATE_END_EQUALS,
+	STATE_GREATER_THAN,
+	STATE_END_GREATER_THAN,
+	STATE_GREATER_OR_EQUAL,
+	STATE_END_GREATER_OR_EQUAL,
+	STATE_LESS_THAN,
+	STATE_END_LESS_THAN,
+	STATE_LESS_OR_EQUAL,
+	STATE_END_LESS_OR_EQUAL,
+	STATE_CONTAINS,
+	STATE_END_CONTAINS,
+	STATE_REGEX,
+	STATE_END_REGEX,
+	STATE_STARTS_WITH,
+	STATE_END_STARTS_WITH,
+	STATE_IN_SET,
+	STATE_END_IN_SET,
+	STATE_INTEGER,
+	STATE_END_INTEGER,
+	STATE_STRING,
+	STATE_END_STRING,
+	STATE_FLOAT,
+	STATE_END_FLOAT,
+	STATE_DATE,
+	STATE_END_DATE,
+	STATE_BOOLEAN,
+	STATE_END_BOOLEAN
+} ParseState;
+
+
+typedef enum {
+	OP_NONE,
+	OP_EQUALS,
+	OP_GREATER,
+	OP_GREATER_EQUAL,
+	OP_LESS,
+	OP_LESS_EQUAL,
+	OP_CONTAINS,
+	OP_REGEX,
+	OP_SET,
+	OP_STARTS
+} Operators;
+
+
+typedef enum {
+	LOP_NONE,
+	LOP_AND,
+	LOP_OR
+} LogicOperators;
+
+
+typedef struct {
+	GMarkupParseContext 	*context;
+	GMarkupParser       	*parser;
+	GSList 			*stack;
+	GSList 			*fields;
+	gboolean		query_okay;
+	int			statement_count;
+	LogicOperators		current_logic_operator;
+	Operators		current_operator;
+	char 			*current_field;
+	char			*current_value;
+	DBConnection	        *db_con;
+	GString			*sql_from;
+	GString			*sql_where;
+	char			*service;
+} ParserData;
+
+static GQuark error_quark;
+
+static void start_element_handler (GMarkupParseContext *context,
+				   const gchar *element_name,
+				   const gchar **attribute_names,
+				   const gchar **attribute_values,
+				   gpointer user_data,
+				   GError **error);
+
+static void end_element_handler (GMarkupParseContext *context,
+				 const gchar *element_name,
+				 gpointer user_data,
+				 GError **error);
+
+static void text_handler (GMarkupParseContext *context,
+		     const gchar *text,
+		     gsize text_len,
+		     gpointer user_data,
+		     GError **error);
+
+static void error_handler (GMarkupParseContext *context,
+		      GError *error,
+		      gpointer user_data);
+
+
+static gboolean
+is_operator (ParseState state)
+{
+	return state == STATE_EQUALS || state == STATE_GREATER_THAN || state == STATE_LESS_THAN ||
+			state == STATE_CONTAINS || state == STATE_IN_SET || STATE_LESS_OR_EQUAL ||
+			STATE_GREATER_OR_EQUAL || state == STATE_STARTS_WITH || state == STATE_REGEX;
+
+}
+
+
+static gboolean
+is_end_operator (ParseState state)
+{
+	return state == STATE_END_EQUALS || state == STATE_END_GREATER_THAN || state == STATE_END_LESS_THAN ||
+		        state == STATE_END_CONTAINS || state == STATE_END_IN_SET || STATE_END_LESS_OR_EQUAL ||
+			STATE_END_GREATER_OR_EQUAL || state == STATE_END_STARTS_WITH || state == STATE_END_REGEX;
+
+}
+
+
+static gboolean
+is_logic (ParseState state)
+{
+	return state == STATE_AND || state == STATE_OR;
+}
+
+
+static gboolean
+is_end_logic (ParseState state)
+{
+	return state == STATE_END_AND || state == STATE_END_OR;
+}
+
+
+static void
+set_error (GError              **err,
+           GMarkupParseContext  *context,
+           int                   error_code,
+           const char           *format,
+           ...)
+{
+	int	line, ch;
+	va_list args;
+	char    *str;
+
+	g_markup_parse_context_get_position (context, &line, &ch);
+
+	va_start (args, format);
+	str = g_strdup_vprintf (format, args);
+	va_end (args);
+
+	g_set_error (err, error_quark, error_code, "Line %d character %d: %s", line, ch, str);
+
+	g_free (str);
+}
+
+
+static gboolean
+set_error_on_fail (gboolean condition, GMarkupParseContext *context, const char *msg, GError **err)
+{
+	if (!condition) {
+		set_error (err, context, 1, msg);
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+
+static const char *
+get_attribute_value (const char *name,
+		     const char **names,
+		     const char **values)
+{
+	int i;
+
+	i = 0;
+
+	while (names[i]) {
+		if (strcmp (name, names[i]) == 0) {
+			return values[i];
+		}
+		i++;
+	}
+
+	return NULL;
+}
+
+
+static const char *
+get_attribute_value_required (GMarkupParseContext *context,
+			      const char          *tag,
+			      const char          *name,
+			      const char          **names,
+			      const char          **values,
+			      GError              **error)
+{
+	const char *value;
+
+	value = get_attribute_value (name, names, values);
+
+	if (!value) {
+		set_error (error, context, PARSE_ERROR,
+			   "%s must have \"%s\" attribute",
+			   tag, name);
+	}
+
+	return value;
+}
+
+
+static void
+push_stack (ParserData *data, ParseState  state)
+{
+	data->stack = g_slist_prepend (data->stack, GINT_TO_POINTER (state));
+}
+
+
+static void
+pop_stack (ParserData *data)
+{
+	g_return_if_fail (data->stack != NULL);
+
+	data->stack = g_slist_remove (data->stack, data->stack->data);
+}
+
+
+static ParseState
+peek_state (ParserData *data)
+{
+	g_return_val_if_fail (data->stack != NULL, STATE_START);
+
+	return GPOINTER_TO_INT (data->stack->data);
+}
+
+
+static void
+pop_stack_until (ParserData *data, ParseState state)
+{
+	while (data->stack != NULL) {
+
+		if (state == peek_state (data)) {
+			pop_stack (data);
+			break;
+		}
+
+		pop_stack (data);
+	}
+}
+
+
+
+static GList *
+add_metadata_field (ParserData *data, const char *xesam_name, gboolean is_select, gboolean is_condition)
+{
+	gboolean           field_exists;
+	FieldData          *field_data;
+	const GSList       *tmp;
+	GList              *reply=NULL;
+	TrackerDBResultSet *result_set;
+	gboolean valid = TRUE;
+
+	field_exists = FALSE;
+	field_data = NULL;
+
+	// Do the xesam mapping
+	
+	result_set = tracker_get_xesam_metadata_names (data->db_con, xesam_name);
+	if (!result_set) {
+		return NULL;
+	}
+
+	while (valid) {
+		gchar *field_name;
+		
+		tracker_db_result_set_get (result_set, 0, &field_name, -1);
+
+		// check if field is already in list
+		for (tmp = data->fields; tmp; tmp = tmp->next) {
+			FieldData *tmp_field;
+			
+			tmp_field = tmp->data;
+			
+			if (tmp_field && tmp_field->field_name) {
+				if (strcasecmp (tmp_field->field_name, field_name) == 0) {
+					
+					field_data = tmp_field;
+					
+					field_exists = TRUE;
+					
+					if (is_condition) {
+						field_data->is_condition = TRUE;
+					} 
+					
+					if (is_select) {
+						if (!field_data->is_select) {
+							
+							field_data->is_select = TRUE;
+							//g_string_append_printf (data->sql_select, ", %s", field_data->select_field);
+						}
+						
+					}
+					
+					break;
+					
+				}
+			}
+		}
+		
+		
+		
+		if (!field_exists) {
+			
+			field_data = tracker_db_get_metadata_field (data->db_con, data->service, field_name, g_slist_length (data->fields), is_select, is_condition);
+			if (field_data) {
+				data->fields = g_slist_prepend (data->fields, field_data);
+				if (is_select) {
+					//					g_string_append_printf (data->sql_select, ", %s", field_data->select_field);
+				}
+				
+			} 
+		} 
+		
+		reply = g_list_append(reply, field_data);
+
+		valid = tracker_db_result_set_iter_next (result_set);
+		g_free (field_name);
+	}
+	
+	return reply;
+}
+
+
+static void
+start_element_handler (GMarkupParseContext *context,
+		       const gchar	   *element_name,
+		       const gchar	   **attribute_names,
+		       const gchar	   **attribute_values,
+		       gpointer		   user_data,
+		       GError		   **error)
+{
+	ParserData *data;
+	ParseState state;
+
+	data = user_data;
+	state = peek_state (data);
+
+	if (ELEMENT_IS (ELEMENT_XESAM_QUERY)) {
+		const char *content;
+		const char *source;
+
+		if (set_error_on_fail ((state == STATE_START), context, "Query element not expected here", error)) {
+			return;
+		}
+
+		content = get_attribute_value ("content", attribute_names, attribute_values);
+		source = get_attribute_value ("source", attribute_names, attribute_values);
+
+		/* FIXME This is a bit clumsy, check that OK and get the defaults (all) from somewhere. CHECK MEMORY LEAKS! */
+		if(content) {
+			TrackerDBResultSet  *result_set;
+			gboolean            valid = TRUE;
+			result_set = tracker_get_xesam_service_names (data->db_con, content);
+		 
+			if (result_set) {
+				
+				while (valid) {
+
+				}
+
+			}
+			
+			content = strdup(content);
+		} else {
+			content = strdup("Files");
+		}
+		
+		// FIXME Fix the service problems.
+		data->service = strdup("Files");
+
+		if(source) {
+
+		} else {
+			// FIXME
+			source = "Files";
+		}
+
+		g_string_append_printf (data->sql_where, "\n WHERE (S.ServiceTypeID in (select TypeId from ServiceTypes where TypeName = '%s' or Parent = '%s')) AND ", content, source);
+
+		push_stack (data, STATE_QUERY);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_FIELD)) {
+		const char *name;
+
+		if (set_error_on_fail ( is_operator (state), context,  "Field element not expected here", error)) {
+			return;
+		}
+
+		name = get_attribute_value_required (context, "<field>", "name",
+						     attribute_names, attribute_values,
+						     error);
+
+		if (!name) {
+			return;
+		} else {
+
+			if (data->current_operator == OP_NONE ) {
+				set_error (error, context, PARSE_ERROR, "no operator found for field \"%s\"", name);
+				return;
+			}
+
+			data->current_field =  g_strdup (name);
+
+			push_stack (data, STATE_FIELD);
+		}
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_AND)) {
+                const char *negate;
+
+		if (set_error_on_fail ((state == STATE_QUERY || is_logic (state) || is_end_logic (state) || is_end_operator (state)),
+				       context, "AND element not expected here", error)) {
+			return;
+		}
+
+		if (data->statement_count > 1) {
+		  if (data->current_logic_operator == LOP_AND) {
+		    data->sql_where = g_string_append (data->sql_where, " AND ");
+		  } else {
+		    if (data->current_logic_operator == LOP_OR) {
+		      data->sql_where = g_string_append (data->sql_where, " OR ");
+		    }
+		  }
+		}
+
+		negate = get_attribute_value ("negate", attribute_names, attribute_values);
+		if (negate&&(!strcmp(negate,"true")))
+		{
+		  data->sql_where = g_string_append (data->sql_where, " NOT "); 
+		}
+
+		data->statement_count = 0;
+		data->sql_where = g_string_append (data->sql_where, " ( ");
+		data->current_logic_operator = LOP_AND;
+		push_stack (data, STATE_AND);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_OR)) {
+                const char *negate;
+
+		if (set_error_on_fail ((state == STATE_QUERY || is_logic (state) || is_end_logic (state) || is_end_operator (state)),
+				       context, "OR element not expected here", error)) {
+			return;
+		}
+
+		if (data->statement_count > 1) {
+			if (data->current_logic_operator == LOP_AND) {
+				data->sql_where = g_string_append (data->sql_where, " AND ");
+			} else {
+				if (data->current_logic_operator == LOP_OR) {
+					data->sql_where = g_string_append (data->sql_where, " OR ");
+				}
+			}
+		}
+
+		negate = get_attribute_value ("negate", attribute_names, attribute_values);
+		if (negate&&(!strcmp(negate,"true")))
+		{
+		  data->sql_where = g_string_append (data->sql_where, " NOT "); 
+		}
+
+		data->statement_count = 0;
+		data->sql_where = g_string_append (data->sql_where, " ( ");
+		data->current_logic_operator = LOP_OR;
+		push_stack (data, STATE_OR);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_EQUALS)) {
+                const char *negate;
+
+		if (set_error_on_fail ( state == STATE_QUERY || is_logic (state) ||
+					((data->current_logic_operator == LOP_AND || data->current_logic_operator == LOP_OR)
+					 && is_end_operator (state)),
+					context, "EQUALS element not expected here", error)) {
+			return;
+		}
+
+		negate = get_attribute_value ("negate", attribute_names, attribute_values);
+		if (negate&&(!strcmp(negate,"true")))
+		{
+		  data->sql_where = g_string_append (data->sql_where, " NOT "); 
+		}
+
+		data->current_operator = OP_EQUALS;
+		push_stack (data, STATE_EQUALS);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_GREATER_THAN)) {
+                const char *negate;
+
+		if (set_error_on_fail ( state == STATE_QUERY || is_logic (state) ||
+					((data->current_logic_operator == LOP_AND || data->current_logic_operator == LOP_OR)
+					 && is_end_operator (state)),
+					context,  "GREATERTHAN element not expected here", error)) {
+			return;
+		}
+
+		negate = get_attribute_value ("negate", attribute_names, attribute_values);
+		if (negate&&(!strcmp(negate,"true")))
+		{
+		  data->sql_where = g_string_append (data->sql_where, " NOT "); 
+		}
+
+		data->current_operator = OP_GREATER;
+		push_stack (data, STATE_GREATER_THAN);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_GREATER_OR_EQUAL)) {
+                const char *negate;
+
+		if (set_error_on_fail ( state == STATE_QUERY || is_logic (state) ||
+					((data->current_logic_operator == LOP_AND || data->current_logic_operator == LOP_OR)
+					 && is_end_operator (state)),
+					context, "GREATEROREQUAL element not expected here", error)) {
+			return;
+		}
+
+		negate = get_attribute_value ("negate", attribute_names, attribute_values);
+		if (negate&&(!strcmp(negate,"true")))
+		{
+		  data->sql_where = g_string_append (data->sql_where, " NOT "); 
+		}
+
+		data->current_operator = OP_GREATER_EQUAL;
+		push_stack (data, STATE_GREATER_OR_EQUAL);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_LESS_THAN )) {
+                const char *negate;
+
+		if (set_error_on_fail ( state == STATE_QUERY || is_logic (state) ||
+					((data->current_logic_operator == LOP_AND || data->current_logic_operator == LOP_OR)
+					 && is_end_operator (state)),
+					context, "LESSTHAN element not expected here", error)) {
+			return;
+		}
+
+		negate = get_attribute_value ("negate", attribute_names, attribute_values);
+		if (negate&&(!strcmp(negate,"true")))
+		{
+		  data->sql_where = g_string_append (data->sql_where, " NOT "); 
+		}
+
+		data->current_operator = OP_LESS;
+		push_stack (data, STATE_LESS_THAN);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_LESS_OR_EQUAL )) {
+                const char *negate;
+
+
+		if (set_error_on_fail ( state == STATE_QUERY || is_logic (state) ||
+					((data->current_logic_operator == LOP_AND || data->current_logic_operator == LOP_OR)
+					 && is_end_operator (state)),
+					context, "LESSOREQUAL element not expected here", error)) {
+			return;
+		}
+
+		negate = get_attribute_value ("negate", attribute_names, attribute_values);
+		if (negate&&(!strcmp(negate,"true")))
+		{
+		  data->sql_where = g_string_append (data->sql_where, " NOT "); 
+		}
+
+		data->current_operator = OP_LESS_EQUAL;
+		push_stack (data, STATE_LESS_OR_EQUAL);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_CONTAINS)) {
+                const char *negate;
+
+		if (set_error_on_fail ( state == STATE_QUERY || is_logic (state) ||
+					((data->current_logic_operator == LOP_AND || data->current_logic_operator == LOP_OR)
+					 && is_end_operator (state)),
+					context, "CONTAINS element not expected here", error)) {
+			return;
+		}
+
+		negate = get_attribute_value ("negate", attribute_names, attribute_values);
+		if (negate&&(!strcmp(negate,"true")))
+		{
+		  data->sql_where = g_string_append (data->sql_where, " NOT "); 
+		}
+
+		data->current_operator = OP_CONTAINS;
+		push_stack (data, STATE_CONTAINS);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_REGEX)) {
+                const char *negate;
+
+		if (set_error_on_fail ( state == STATE_QUERY || is_logic (state) ||
+					((data->current_logic_operator == LOP_AND || data->current_logic_operator == LOP_OR)
+					 && is_end_operator (state)),
+					context, "REGEX element not expected here", error)) {
+			return;
+		}
+
+		negate = get_attribute_value ("negate", attribute_names, attribute_values);
+		if (negate&&(!strcmp(negate,"true")))
+		{
+		  data->sql_where = g_string_append (data->sql_where, " NOT "); 
+		}
+
+		data->current_operator = OP_REGEX;
+		push_stack (data, STATE_REGEX);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_STARTS_WITH)) {
+                const char *negate;
+
+		if (set_error_on_fail ( state == STATE_QUERY || is_logic (state) ||
+					((data->current_logic_operator == LOP_AND || data->current_logic_operator == LOP_OR)
+					 && is_end_operator (state)),
+					context, "STARTSWITH element not expected here", error)) {
+			return;
+		}
+
+		negate = get_attribute_value ("negate", attribute_names, attribute_values);
+		if (negate&&(!strcmp(negate,"true")))
+		{
+		  data->sql_where = g_string_append (data->sql_where, " NOT "); 
+		}
+
+		data->current_operator = OP_STARTS;
+		push_stack (data, STATE_STARTS_WITH);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_IN_SET)) {
+                const char *negate;
+
+		if (set_error_on_fail ( state == STATE_QUERY || is_logic (state) ||
+					((data->current_logic_operator == LOP_AND || data->current_logic_operator == LOP_OR)
+					 && is_end_operator (state)),
+					context, "IN SET element not expected here", error)) {
+			return;
+		}
+
+		negate = get_attribute_value ("negate", attribute_names, attribute_values);
+		if (negate&&(!strcmp(negate,"true")))
+		{
+		  data->sql_where = g_string_append (data->sql_where, " NOT "); 
+		}
+
+		data->current_operator = OP_SET;
+		push_stack (data, STATE_IN_SET);
+
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_INTEGER)) {
+
+		if (set_error_on_fail (state == STATE_FIELD, context, "INTEGER element not expected here", error)) {
+			return;
+		}
+
+		push_stack (data, STATE_INTEGER);
+
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_DATE)) {
+
+		if (set_error_on_fail (state == STATE_FIELD, context, "DATE element not expected here", error)) {
+			return;
+		}
+
+		push_stack (data, STATE_DATE);
+
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_STRING)) {
+
+		if (set_error_on_fail (state == STATE_FIELD, context, "STRING element not expected here", error)) {
+			return;
+		}
+
+		push_stack (data, STATE_STRING);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_FLOAT)) {
+
+		if (set_error_on_fail (state == STATE_FIELD, context, "FLOAT element not expected here", error)) {
+			return;
+		}
+
+		push_stack (data, STATE_FLOAT);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_BOOLEAN)) {
+
+		if (set_error_on_fail (state == STATE_FIELD, context, "BOOLEAN element not expected here", error)) {
+			return;
+		}
+
+		push_stack (data, STATE_BOOLEAN);
+	}
+}
+
+
+static char *
+get_value (const char *value, gboolean quote)
+{
+	if (quote) {
+		return g_strconcat (" '", value, "' ", NULL);
+	} else {
+		return g_strdup (value);
+	}
+}
+
+
+static gboolean
+build_sql (ParserData *data)
+{
+	ParseState state;
+	char 	   *avalue, *value, *sub;
+	GList      *field_data = NULL;
+	GList      *field_data_list = NULL;
+	GString    *str;
+	int        i=0;
+
+	g_return_val_if_fail (data->current_field && data->current_operator != OP_NONE && data->current_value, FALSE);
+
+	data->statement_count++;
+
+	state = peek_state (data);
+
+	avalue = get_value (data->current_value, (state != STATE_END_DATE && state != STATE_END_INTEGER && state != STATE_END_FLOAT && state != STATE_END_BOOLEAN));
+
+	field_data_list = add_metadata_field (data, data->current_field, FALSE, TRUE);
+
+	if (!field_data_list) {
+		g_free (avalue);
+		g_free (data->current_field);
+		g_free (data->current_value);
+		return FALSE;
+	}
+
+	data->sql_where = g_string_append (data->sql_where, " ( ");
+
+	field_data = g_list_first (field_data_list);
+
+	while (field_data) {
+		i++;
+		str = g_string_new ("");
+	
+		if (i>1) {
+			g_string_append (str, " OR ");	
+		}
+
+		if (((FieldData *)field_data->data)->data_type ==  DATA_DATE) {
+			char *bvalue;
+			int cvalue;
+			
+			bvalue = tracker_date_format (avalue);
+			tracker_debug (bvalue);
+			cvalue = tracker_string_to_date (bvalue);
+			tracker_debug ("%d", cvalue);
+			value = tracker_int_to_string (cvalue);
+			g_free (bvalue);
+		} else if (state == STATE_END_BOOLEAN) { /* FIXME We do a state check here, because DATA_BOOLEAN is not in db */
+			if (!strcmp(avalue,"true")) {
+				value = g_strdup("1");
+			} else if(!strcmp(avalue,"false")) {
+				value = g_strdup("0");
+			} else {
+				return FALSE; /* TODO Add error message */
+			}				         
+		} else {
+			value = g_strdup (avalue);
+		}
+				
+		if (data->statement_count > 1) {
+			if (data->current_logic_operator == LOP_AND) {
+				data->sql_where = g_string_append (data->sql_where, "\n AND ");
+			} else {
+				if (data->current_logic_operator == LOP_OR) {
+					data->sql_where = g_string_append (data->sql_where, "\n OR ");
+				}
+			}
+		}
+
+		char **s;
+		
+		switch (data->current_operator) {
+			
+		case OP_EQUALS:
+			
+			sub = strchr (data->current_value, '*');
+			if (sub) {
+				g_string_append_printf (str, " (%s glob '%s') ", ((FieldData *)field_data->data)->where_field, data->current_value);
+			} else {
+				if (((FieldData *)field_data->data)->data_type == DATA_DATE || ((FieldData *)field_data->data)->data_type == DATA_INTEGER || ((FieldData *)field_data->data)->data_type == DATA_DOUBLE) {
+					g_string_append_printf (str, " (%s = %s) ", ((FieldData *)field_data->data)->where_field, value);
+				} else {
+					g_string_append_printf (str, " (%s = '%s') ", ((FieldData *)field_data->data)->where_field, value);
+				}
+			}
+			
+			break;
+			
+		case OP_GREATER:
+			
+			g_string_append_printf (str, " (%s > %s) ", ((FieldData *)field_data->data)->where_field, value);
+
+			break;
+
+		case OP_GREATER_EQUAL:
+
+			g_string_append_printf (str, " (%s >= %s) ", ((FieldData *)field_data->data)->where_field, value);
+
+			break;
+
+		case OP_LESS:
+
+			g_string_append_printf (str, " (%s < %s) ", ((FieldData *)field_data->data)->where_field, value);
+
+			break;
+
+		case OP_LESS_EQUAL:
+
+			g_string_append_printf (str, " (%s <= %s) ", ((FieldData *)field_data->data)->where_field, value);
+
+			break;
+
+		case OP_CONTAINS:
+
+			sub = strchr (data->current_value, '*');
+
+			if (sub) {
+				g_string_append_printf (str, " (%s like '%s%s%s') ", ((FieldData *)field_data->data)->where_field, "%", data->current_value, "%");
+			} else {
+				g_string_append_printf (str, " (%s like '%s%s%s') ", ((FieldData *)field_data->data)->where_field, "%", data->current_value, "%");
+			}
+
+			break;
+
+		case OP_STARTS:
+			
+			sub = strchr (data->current_value, '*');
+
+			if (sub) {
+				g_string_append_printf (str, " (%s like '%s') ", ((FieldData *)field_data->data)->where_field, data->current_value);
+			} else {
+				g_string_append_printf (str, " (%s like '%s%s') ", ((FieldData *)field_data->data)->where_field, data->current_value, "%");
+			}
+			
+			break;
+
+		case OP_REGEX:
+
+			g_string_append_printf (str, " (%s REGEXP '%s') ", ((FieldData *)field_data->data)->where_field, data->current_value);
+
+			break;
+
+		case OP_SET:
+
+			s = g_strsplit (data->current_value, ",", 0);
+			
+			if (s && s[0]) {
+
+				g_string_append_printf (str, " (%s in ('%s'", ((FieldData *)field_data->data)->where_field, s[0]);
+
+				char **p;
+				for (p = s+1; *p; p++) {
+					g_string_append_printf (str, ",'%s'", *p); 					
+				}
+				g_string_append_printf (str, ") ) " ); 					
+					
+			}
+
+			break;
+
+		default:
+			
+			break;
+		}
+		
+		data->sql_where = g_string_append (data->sql_where, str->str);
+		g_string_free (str, TRUE);
+		field_data = g_list_next (field_data);
+
+	}
+
+	data->sql_where = g_string_append (data->sql_where, " ) ");
+
+	g_free (avalue);
+
+	g_free (data->current_field);
+	data->current_field = NULL;
+
+	g_free (data->current_value);
+	data->current_value = NULL;
+
+	g_free (value);
+
+	return TRUE;
+}
+
+
+static void
+end_element_handler (GMarkupParseContext *context,
+		     const gchar	 *element_name,
+		     gpointer		 user_data,
+		     GError		 **error)
+{
+	ParserData *data;
+
+	data = user_data;
+
+	if (ELEMENT_IS (ELEMENT_XESAM_QUERY)) {
+
+		push_stack (data, STATE_END_QUERY);
+		data->query_okay = TRUE;
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_AND)) {
+
+		data->sql_where = g_string_append (data->sql_where, " ) ");
+
+		pop_stack_until (data, STATE_AND);
+
+		if (peek_state (data) != STATE_AND) {
+			if (peek_state (data) == STATE_OR) {
+				data->current_logic_operator = LOP_OR;
+			} else {
+				data->current_logic_operator = LOP_NONE;
+			}
+		}
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_OR)) {
+
+		data->sql_where = g_string_append (data->sql_where, " ) ");
+
+		pop_stack_until (data, STATE_OR);
+
+		if (peek_state (data) != STATE_OR) {
+			if (peek_state (data) == STATE_AND) {
+				data->current_logic_operator = LOP_AND;
+			} else {
+				data->current_logic_operator = LOP_NONE;
+			}
+		}
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_EQUALS)) {
+
+		if (!build_sql (data)) {
+			set_error (error, context, 1, "parse error");
+			return;
+		}
+		push_stack (data, STATE_END_EQUALS);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_GREATER_THAN)) {
+
+		if (!build_sql (data)) {
+			set_error (error, context, 1, "parse error");
+			return;
+		}
+
+		push_stack (data, STATE_END_GREATER_THAN);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_GREATER_OR_EQUAL)) {
+
+		if (!build_sql (data)) {
+			set_error (error, context, 1, "parse error");
+			return;
+		}
+
+		push_stack (data, STATE_END_GREATER_OR_EQUAL);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_LESS_THAN )) {
+
+		if (!build_sql (data)) {
+			set_error (error, context, 1, "parse error");
+			return;
+		}
+
+		push_stack (data, STATE_END_LESS_THAN );
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_LESS_OR_EQUAL )) {
+
+		if (!build_sql (data)) {
+			set_error (error, context, 1, "parse error");
+			return;
+		}
+
+		push_stack (data, STATE_END_LESS_OR_EQUAL );
+
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_CONTAINS)) {
+
+		if (!build_sql (data)) {
+			set_error (error, context, 1, "parse error");
+			return;
+		}
+
+		push_stack (data, STATE_END_CONTAINS);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_REGEX)) {
+
+		if (!build_sql (data)) {
+			set_error (error, context, 1, "parse error");
+			return;
+		}
+
+		push_stack (data, STATE_END_REGEX);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_STARTS_WITH)) {
+
+		if (!build_sql (data)) {
+			set_error (error, context, 1, "parse error");
+			return;
+		}
+
+		push_stack (data, STATE_END_STARTS_WITH);
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_IN_SET)) {
+
+		if (!build_sql (data)) {
+			set_error (error, context, 1, "parse error");
+			return;
+		}
+
+		push_stack (data, STATE_END_IN_SET);
+
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_INTEGER)) {
+
+		push_stack (data, STATE_END_INTEGER);
+
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_DATE)) {
+
+		push_stack (data, STATE_END_DATE);
+
+
+	} else if (ELEMENT_IS (ELEMENT_XESAM_STRING)) {
+
+		push_stack (data, STATE_END_STRING);
+
+
+	}  else if (ELEMENT_IS (ELEMENT_XESAM_FLOAT)) {
+
+		push_stack (data, STATE_END_FLOAT);
+
+
+	}  else if (ELEMENT_IS (ELEMENT_XESAM_BOOLEAN)) {
+
+		push_stack (data, STATE_END_BOOLEAN);
+	}
+}
+
+
+static void
+text_handler (GMarkupParseContext *context,
+	      const gchar	  *text,
+	      gsize		  text_len,
+	      gpointer		  user_data,
+	      GError		  **error)
+{
+	ParserData *data;
+	ParseState state;
+
+	data = user_data;
+	state = peek_state (data);
+
+	switch (state) {
+
+		case STATE_INTEGER:
+		case STATE_STRING:
+		case STATE_DATE:
+		case STATE_FLOAT:
+          	case STATE_BOOLEAN:
+
+			data->current_value = g_strstrip (g_strndup (text, text_len));
+			break;
+
+		default :
+			break;
+	}
+}
+
+
+static void
+error_handler (GMarkupParseContext *context,
+	       GError		   *error,
+	       gpointer		   user_data)
+{
+	tracker_error ("ERROR: in rdf query parse: %s", error->message);
+}
+
+
+char *
+tracker_xesam_query_to_sql (DBConnection *db_con, const char *query, GError *error)
+{
+	static     gboolean inited = FALSE;
+	ParserData data;
+	char       *result;
+
+	g_return_val_if_fail (query != NULL, NULL);
+
+	if (!inited) {
+		error_quark = g_quark_from_static_string ("XESAM-parser-error-quark");
+		inited = TRUE;
+	}
+
+	memset (&data, 0, sizeof (data));
+	data.db_con = db_con;
+	data.statement_count = 0;
+
+	char *table_name;
+
+	table_name = "Services";
+
+	data.sql_from = g_string_new ("");
+
+	g_string_append_printf (data.sql_from, "\n FROM %s S ", table_name);
+	
+	data.sql_where = g_string_new ("");
+
+	data.parser = g_new0 (GMarkupParser, 1);
+	data.parser->start_element = start_element_handler;
+	data.parser->text = text_handler;
+	data.parser->end_element = end_element_handler;
+	data.parser->error = error_handler;
+
+	data.current_operator = OP_NONE;
+	data.current_logic_operator = LOP_NONE;
+	data.query_okay = FALSE;
+
+	data.context = g_markup_parse_context_new (data.parser, 0, &data, NULL);
+
+	push_stack (&data, STATE_START);
+
+	result = NULL;
+
+	if (!g_markup_parse_context_parse (data.context, query, -1, &error)) {
+
+		g_string_free (data.sql_from, TRUE);
+		g_string_free (data.sql_where, TRUE);
+
+	} else {
+		const GSList *tmp;
+		FieldData    *tmp_field;
+
+		for (tmp = data.fields; tmp; tmp = tmp->next) {
+			tmp_field = tmp->data;
+
+			if (!tmp_field->is_condition) {
+				if (tmp_field->needs_join) {
+					g_string_append_printf (data.sql_from, "\n LEFT OUTER JOIN %s %s ON (S.ID = %s.ServiceID and %s.MetaDataID = %s) ", tmp_field->table_name, tmp_field->alias, tmp_field->alias, tmp_field->alias, tmp_field->id_field);
+				}
+			} else {
+				char *related_metadata = tracker_get_related_metadata_names (db_con, tmp_field->field_name);
+				g_string_append_printf (data.sql_from, "\n INNER JOIN %s %s ON (S.ID = %s.ServiceID and %s.MetaDataID in (%s)) ", tmp_field->table_name, tmp_field->alias, tmp_field->alias, tmp_field->alias, related_metadata);
+				g_free (related_metadata);
+			}
+		}
+
+		result = g_strconcat (data.sql_from->str, " ", data.sql_where->str, NULL);
+		
+		g_string_free (data.sql_from, TRUE);
+		g_string_free (data.sql_where, TRUE);
+	}
+
+	g_slist_foreach (data.fields, (GFunc) tracker_free_metadata_field, NULL);
+	g_slist_free (data.fields);
+
+	g_slist_free (data.stack);
+	g_markup_parse_context_free (data.context);
+
+	if (data.current_field) {
+		g_free (data.current_field);
+	}
+
+	if (data.current_value) {
+		g_free (data.current_value);
+	}
+
+	g_free (data.parser);
+
+	return result;
+}
+
+

Added: branches/xesam-support/src/trackerd/tracker-xesam-query.h
==============================================================================
--- (empty file)
+++ branches/xesam-support/src/trackerd/tracker-xesam-query.h	Tue May 13 10:11:59 2008
@@ -0,0 +1,32 @@
+/* Tracker - indexer and metadata database engine
+ * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ */
+
+
+
+#ifndef _TRACKER_XESAM_QUERY_H_
+#define _TRACKER_XESAM_QUERY_H_
+
+#include <glib.h>
+
+#include "tracker-db.h"
+
+
+char *	tracker_xesam_query_to_sql (DBConnection *db_con, const char *query, GError *error);
+
+#endif

Modified: branches/xesam-support/src/trackerd/tracker-xesam-session.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam-session.c	(original)
+++ branches/xesam-support/src/trackerd/tracker-xesam-session.c	Tue May 13 10:11:59 2008
@@ -21,7 +21,6 @@
 
 #include "tracker-xesam.h"
 
-
 struct _TrackerXesamSessionPriv {
 	GHashTable *searches;
 	gchar *session_id;
@@ -30,6 +29,9 @@
 
 G_DEFINE_TYPE (TrackerXesamSession, tracker_xesam_session, G_TYPE_OBJECT)
 
+#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_XESAM_SESSION, struct _TrackerXesamSessionPriv))
+
+
 static void
 tracker_xesam_session_g_value_free (GValue *value)
 {
@@ -59,7 +61,7 @@
 static void
 tracker_xesam_session_init (TrackerXesamSession *self)
 {
-	TrackerXesamSessionPriv *priv = self->priv;
+	TrackerXesamSessionPriv *priv;
 	GValue *value;
 	const gchar *hit_fields[2] = {"xesam:url", NULL};
 	const gchar *hit_fields_extended[1] = {NULL};
@@ -69,9 +71,13 @@
 	const gchar *exts[1] = {NULL};
 	const gchar *dummy_onto[4] = {"dummy-onto","0.1","/usr/share/xesam/ontologies/dummy-onto-0.1", NULL};
 	GPtrArray *ontos = g_ptr_array_new ();
-	g_ptr_array_add (ontos, dummy_onto);
+	
+	priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,TRACKER_TYPE_XESAM_SESSION,struct _TrackerXesamSessionPriv);
 
+	g_ptr_array_add (ontos, dummy_onto);
+	
 	priv->session_id = NULL;
+
 	priv->searches = g_hash_table_new_full (g_str_hash, g_str_equal, 
 				(GDestroyNotify) g_free,
 				(GDestroyNotify) g_object_unref);
@@ -188,6 +194,8 @@
 	GObjectClass *object_class;
 	object_class = G_OBJECT_CLASS (klass);
 	object_class->finalize = tracker_xesam_session_finalize;
+
+	g_type_class_add_private( klass, sizeof(struct _TrackerXesamSessionPriv) );
 }
 
 /**
@@ -367,22 +375,25 @@
 				     gchar               **search_id, 
 				     GError              **error) 
 {
-	TrackerXesamLiveSearch *search;
+	TrackerXesamLiveSearch  *search;
 	TrackerXesamSessionPriv *priv = self->priv;
-
-	// ottela!
-	// todo: parse the query and pass the parsed query or throw an error
+	const gchar             *query = NULL;
 
 	search = tracker_xesam_live_search_new (query_xml);
+	tracker_xesam_live_search_set_session (search, self);
 	tracker_xesam_live_search_set_id (search, tracker_xesam_generate_unique_key ());
+	if (search_id) 
+		*search_id = g_strdup (tracker_xesam_live_search_get_id (search));
+
 	tracker_xesam_live_search_set_session (search, self);
 
 	g_hash_table_insert (priv->searches, 
 		g_strdup (tracker_xesam_live_search_get_id (search)),
 		g_object_ref (search));
 
-	if (search_id) 
-		*search_id = g_strdup (tracker_xesam_live_search_get_id (search));
+	query = tracker_xesam_live_search_parse_query (search, error);
+
+	g_print ("Created new Xesam search \n %s \n Translated to \n %s", query_xml, query);
 
 	return search;
 }

Modified: branches/xesam-support/src/trackerd/tracker-xesam.h
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam.h	(original)
+++ branches/xesam-support/src/trackerd/tracker-xesam.h	Tue May 13 10:11:59 2008
@@ -42,6 +42,7 @@
 	TRACKER_XESAM_ERROR_SEARCH_CLOSED = 3,
 	TRACKER_XESAM_ERROR_SEARCH_NOT_ACTIVE = 4,
 	TRACKER_XESAM_ERROR_PROPERTY_NOT_SUPPORTED = 5,
+	TRACKER_XESAM_ERROR_PARSING_FAILED = 6,
 } TrackerXesamError;
 
 TrackerXesamSession*    tracker_xesam_get_session            (const gchar             *session_id,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]