Commit 4fec9cd2 authored by Jamie McCracken's avatar Jamie McCracken

made changes for new metadata database integration

parent 06bf22bb
......@@ -84,6 +84,20 @@ if test "x$enable_warnings" = "xyes"; then
$CFLAGS"
fi
####################################################################
# Compiler generate debug code
####################################################################
AC_ARG_ENABLE(debug_code,
AC_HELP_STRING(
[--enable-debug-code],
[build with debug symbols]),[enable_debug_code=yes],[enable_debug_code=no])
if test "x$enable_debug_code" = "xyes"; then
CFLAGS="-g $CFLAGS"
fi
####################################################################
# gettext/intltool support
####################################################################
......@@ -296,10 +310,6 @@ if test "x$enable_file_monitoring" = "xauto"; then
inotify_header="sys/inotify.h"
fi
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-inotify-debug], [turn on inotify debugging]),
[AC_DEFINE(LIBINOTIFY_DEBUG,, [is debugging enabled?])],)
elif test "$fam_support" = "yes"; then
if test "$fam_type" = "gamin"; then
primary_backend="gamin"
......@@ -542,6 +552,7 @@ Tracker-$VERSION:
source code location: ${srcdir}
compiler: ${CC}
enable gcc warnings: $enable_warnings
build with debug symbols: $enable_debug_code
database engine: SQLite
file monitor backend to be used: $primary_backend
inotify header location: $inotify_header
......
......@@ -20,7 +20,7 @@ GetFileByID SELECT DISTINCT Path , Name, Mime FROM Services WHERE ID = ?;
GetFileByID2 SELECT DISTINCT (Path || '/' || Name) as uri, GetServiceName (ServiceTypeID), Mime FROM Services WHERE ID = ?;
GetFileMTime SELECT M.MetaDataValue FROM Services F inner join ServiceNumericMetaData M on F.ID = M.ServiceID WHERE F.Path = ? and F.Name = ? and M.MetaDataID = (select ID From MetaDataTypes where MetaName ='File.Modified');
GetFileMTime SELECT M.MetaDataValue FROM Services F inner join ServiceNumericMetaData M on F.ID = M.ServiceID WHERE F.Path = ? and F.Name = ? and M.MetaDataID = (select ID From MetaDataTypes where MetaName ='File:Modified');
GetServices SELECT TypeName, MetadataClass, Description FROM ServiceTypes WHERE MainService = ? ORDER BY TypeID;
......@@ -37,22 +37,22 @@ CreateService INSERT INTO Services (ID, Path, Name, ServiceTypeID, Mime, Size, I
DeleteService1 DELETE FROM Services WHERE ID = ?;
DeleteService2 DELETE FROM ServiceMetaData WHERE ServiceID = ?;
DeleteService3 DELETE FROM ServiceLinks WHERE (ServiceID = ? or LinkID = ?);
DeleteService4 DELETE FROM ServiceKeywords WHERE ServiceID = ?;
DeleteService5 DELETE FROM ServiceIndexMetaData WHERE ServiceID = ?;
DeleteService4 DELETE FROM ServiceKeywordMetaData WHERE ServiceID = ?;
DeleteService5 DELETE FROM ServiceMetaDataDisplay WHERE ServiceID = ?;
DeleteService6 DELETE FROM ServiceNumericMetaData WHERE ServiceID = ?;
DeleteService7 DELETE FROM ServiceBlobMetaData WHERE ServiceID = ?;
MarkEmbeddedServiceMetadata1 update ServiceMetaData set DeleteFlag = 1 where ServiceID = ? AND EmbeddedFlag = 1;
MarkEmbeddedServiceMetadata2 update ServiceNumericMetaData set DeleteFlag = 1 where ServiceID = ? AND EmbeddedFlag = 1;
MarkEmbeddedServiceMetadata3 update ServiceIndexMetaData set DeleteFlag = 1 where ServiceID = ? AND EmbeddedFlag = 1;
MarkEmbeddedServiceMetadata4 delete from ServiceKeywords where ServiceID = ? AND EmbeddedFlag = 1;
MarkEmbeddedServiceMetadata5 update ServiceBlobMetaData set DeleteFlag = 1 where ServiceID = ? AND EmbeddedFlag = 1;
MarkEmbeddedServiceMetadata3 update ServiceKeywordMetaData set DeleteFlag = 1 where ServiceID = ? AND EmbeddedFlag = 1;
MarkEmbeddedServiceMetadata4 update ServiceBlobMetaData set DeleteFlag = 1 where ServiceID = ? AND EmbeddedFlag = 1;
DeleteEmbeddedServiceMetadata1 DELETE FROM ServiceMetaData WHERE ServiceID = ? AND DeleteFlag = 1 AND EmbeddedFlag = 1;
DeleteEmbeddedServiceMetadata2 DELETE FROM ServiceIndexMetaData WHERE ServiceID = ? AND DeleteFlag = 1 AND EmbeddedFlag = 1;
DeleteEmbeddedServiceMetadata3 DELETE FROM ServiceNumericMetaData WHERE ServiceID = ? AND DeleteFlag = 1 AND EmbeddedFlag = 1;
DeleteEmbeddedServiceMetadata4 DELETE FROM ServiceBlobMetaData WHERE ServiceID = ? AND DeleteFlag = 1 AND EmbeddedFlag = 1;
DeleteEmbeddedServiceMetadata2 DELETE FROM ServiceNumericMetaData WHERE ServiceID = ? AND DeleteFlag = 1 AND EmbeddedFlag = 1;
DeleteEmbeddedServiceMetadata3 DELETE FROM ServiceBlobMetaData WHERE ServiceID = ? AND DeleteFlag = 1 AND EmbeddedFlag = 1;
DeleteEmbeddedServiceMetadata4 DELETE FROM ServiceKeywordMetaData WHERE ServiceID = ? AND DeleteFlag = 1 AND EmbeddedFlag = 1;
SelectFileChild SELECT ID, Path, Name FROM Services WHERE Path = ?;
SelectFileSubFolders SELECT ID, Path, Name, IsDirectory FROM Services WHERE (Path = ? or Path glob ?) And IsDirectory = 1;
......@@ -65,81 +65,81 @@ UpdateFileMove UPDATE Services SET Path = ?, Name = ?, IndexTime = ? WHERE ID =
UpdateFileMoveChild UPDATE Services SET Path = ? WHERE Path = ?;
UpdateFileMovePath UPDATE ServiceIndexMetaData set MetaDataValue = ? WHERE ServiceID in (select ID FROM Services where Path = ?) AND MetaDataID = (select ID FROM MetaDataTypes WHERE MetaName = 'File.Path');
UpdateFileMovePath UPDATE ServiceMetaData set MetaDataValue = ? WHERE ServiceID in (select ID FROM Services where Path = ?) AND MetaDataID = (select ID FROM MetaDataTypes WHERE MetaName = 'File:Path');
DeleteFile1 DELETE FROM Services WHERE ID = ?;
DeleteFile2 DELETE FROM ServiceMetaData WHERE ServiceID = ?;
DeleteFile3 DELETE FROM FilePending WHERE FileID = ?;
DeleteFile4 DELETE FROM ServiceLinks WHERE (ServiceID = ? or LinkID = ?);
DeleteFile5 DELETE FROM ServiceKeywords WHERE (ServiceID = ?);
DeleteFile6 DELETE FROM ServiceIndexMetaData WHERE ServiceID = ?;
DeleteFile5 DELETE FROM ServiceKeywordMetaData WHERE (ServiceID = ?);
DeleteFile6 DELETE FROM ServiceMetaDataDisplay WHERE ServiceID = ?;
DeleteFile7 DELETE FROM ServiceNumericMetaData WHERE ServiceID = ?;
DeleteFile8 DELETE FROM ServiceBlobMetaData WHERE ServiceID = ?;
DeleteFile9 DELETE FROM ServiceWords WHERE ServiceID = ?;
DeleteFile9 DELETE FROM ServiceMetaDataDisplay WHERE ServiceID = ?;
DeleteFile10 DELETE FROM ServiceWords WHERE ServiceID = ?;
DeleteDirectory1 DELETE FROM ServiceMetaData WHERE ServiceID in (select ID FROM Services F where (F.Path = ?) OR (F.Path glob ?));
DeleteDirectory2 DELETE FROM FilePending WHERE FileID in (select ID FROM Services F where (F.Path = ?) OR (F.Path glob ?));
DeleteDirectory3 DELETE FROM ServiceKeywords WHERE ServiceID in (select ID FROM Services F where (F.Path = ?) OR (F.Path glob ?));
DeleteDirectory3 DELETE FROM ServiceKeywordMetaData WHERE ServiceID in (select ID FROM Services F where (F.Path = ?) OR (F.Path glob ?));
DeleteDirectory4 DELETE FROM Services WHERE (Path = ?) OR (Path glob ?);
DeleteDirectory5 DELETE FROM ServiceIndexMetaData WHERE ServiceID in (select ID FROM Services F where (F.Path = ?) OR (F.Path glob ?));
DeleteDirectory5 DELETE FROM ServiceMetaDataDisplay WHERE ServiceID in (select ID FROM Services F where (F.Path = ?) OR (F.Path glob ?));
DeleteDirectory6 DELETE FROM ServiceNumericMetaData WHERE ServiceID in (select ID FROM Services F where (F.Path = ?) OR (F.Path glob ?));
DeleteDirectory7 DELETE FROM ServiceBlobMetaData WHERE ServiceID in (select ID FROM Services F where (F.Path = ?) OR (F.Path glob ?));
DeleteDirectory8 DELETE FROM ServiceWords WHERE ServiceID in (select ID FROM Services F where (F.Path = ?) OR (F.Path glob ?));
DeleteDirectory8 DELETE FROM ServiceMetaDataDisplay WHERE ServiceID in (select ID FROM Services F where (F.Path = ?) OR (F.Path glob ?));
DeleteDirectory9 DELETE FROM ServiceWords WHERE ServiceID in (select ID FROM Services F where (F.Path = ?) OR (F.Path glob ?));
SaveFileContents REPLACE into ServiceContents (ServiceID, Content, ContainsWordScores) values (?,?,?);
DeleteFileContents DELETE FROM ServiceContents where ServiceID = ?;
GetFileContents Select uncompress (Content), ContainsWordScores from ServiceContents where ServiceID = ? and Content is not null
GetKeywordList Select distinct K.Keyword, count(*) as totalcount from Services S, ServiceKeywords K where K.ServiceID = S.ID AND (S.ServiceTypeID between ? and ?) group by K.Keyword order by totalcount desc, K.keyword asc;
GetKeywords Select Keyword from ServiceKeywords where ServiceID = (select ID From Services where Path = ? and Name = ?);
AddKeyword insert into ServiceKeywords (ServiceID, Keyword) values ((select ID From Services where Path = ? and Name = ?), ?);
AddEmbeddedKeyword insert into ServiceKeywords (ServiceID, Keyword, EmbeddedFlag) values (?,?,1);
RemoveKeyword delete from ServiceKeywords where ServiceID = (select ID From Services where Path = ? and Name = ?) and Keyword = ?;
RemoveAllKeywords delete from ServiceKeywords where ServiceID = (select ID From Services where Path = ? and Name = ?);
SearchKeywords Select Distinct S.Path || '/' || S.Name as uri from Services S INNER JOIN ServiceKeywords K ON K.ServiceID = S.ID WHERE (S.ServiceTypeID between ? and ?) and K.Keyword = ? limit ?,?;
GetKeywordList Select distinct K.MetaDataValue, count(*) as totalcount from Services S, ServiceKeywordMetaData K where K.ServiceID = S.ID AND (S.ServiceTypeID between ? and ?) and K.MetaDataId in (select ID from MetadataTypes where MetaName in ('DC:Keywords', 'Image:Keywords', 'Doc:Keywords')) group by K.MetaDataValue order by totalcount desc, K.MetaDataValue asc;
GetKeywords Select MetaDataValue from ServiceKeywordMetaData where ServiceID = (select ID From Services where Path = ? and Name = ?) and MetaDataId in (select ID from MetadataTypes where MetaName in ('DC:Keywords', 'Image:Keywords', 'Doc:Keywords'));
AddKeyword insert into ServiceKeywordMetaData (ServiceID, MetaDataID, MetaDataValue) values ((select ID From Services where Path = ? and Name = ?), (select ID from MetadataTypes where MetaName = 'DC:Keywords') ,?);
AddEmbeddedKeyword insert into ServiceKeywordMetaData (ServiceID, MetaDataID, MetaDataValue, EmbeddedFlag) values (?,(select ID from MetadataTypes where MetaName = ?),?,1) ;
RemoveKeyword delete from ServiceKeywordMetaData where ServiceID = (select ID From Services where Path = ? and Name = ?) and MetaDataID = (select ID from MetadataTypes where MetaName = 'DC:Keywords') and MetaDataValue = ?;
RemoveAllKeywords delete from ServiceKeywordMetaData where ServiceID = (select ID From Services where Path = ? and Name = ?) and MetaDataID = (select ID from MetadataTypes where MetaName = 'DC:Keywords');
SearchKeywords Select Distinct S.Path || '/' || S.Name as uri from Services S INNER JOIN ServiceKeywordMetaData K ON K.ServiceID = S.ID WHERE (S.ServiceTypeID between ? and ?) and MetaDataID = (select ID from MetadataTypes where MetaName = 'DC:Keywords') and K.MetaDataValue = ? limit ?,?;
GetAllIndexable SELECT S.MetaDataValue, M.Weight FROM ServiceIndexMetaData S, MetaDataTypes M WHERE S.MetaDataID = M.ID AND S.ServiceID = ? And S.MetaDataValue is not null and M.DatatypeID = 0;
GetAllIndexableBlob SELECT S.MetaDataValue, M.Weight FROM ServiceBlobMetaData S, MetaDataTypes M WHERE S.MetaDataID = M.ID AND S.ServiceID = ? And S.MetaDataValue is not null and M.DatatypeID = 4;
GetMetadataBlob SELECT MetaDataValue FROM ServiceBlobMetaData WHERE ServiceID = ? AND MetaDataID = (select ID from MetaDataTypes where MetaName = ?);
GetMetadataIndex SELECT MetaDataValue FROM ServiceIndexMetaData WHERE ServiceID = ? AND MetaDataID = (select ID from MetaDataTypes where MetaName = ?);
GetAllIndexable SELECT S.MetaDataValue as MetaValue, M.Weight as MetaWeight FROM ServiceMetaData S, MetaDataTypes M WHERE S.MetaDataID = M.ID AND S.ServiceID = ? And S.MetaDataValue is not null and M.DatatypeID = 0;
GetAllIndexableKeywords SELECT K.MetaDataValue as MetaValue, M.Weight as MetaWeight FROM ServiceKeywordMetaData K, MetaDataTypes M WHERE K.MetaDataID = M.ID AND K.ServiceID = ? And K.MetaDataValue is not null and M.DatatypeID = 5;
GetMetadataBlob SELECT MetaDataValue, BlobLength FROM ServiceBlobMetaData WHERE ServiceID = ? AND MetaDataID = (select ID from MetaDataTypes where MetaName = ?);
GetMetadataKeyword SELECT MetaDataValue FROM ServiceKeywordMetaData WHERE ServiceID = ? AND MetaDataID = (select ID from MetaDataTypes where MetaName = ?);
GetMetadataString SELECT MetaDataValue FROM ServiceMetaData WHERE ServiceID = ? AND MetaDataID = (select ID from MetaDataTypes where MetaName = ?);
GetMetadataNumeric SELECT MetaDataValue FROM ServiceNumericMetaData WHERE ServiceID = ? AND MetaDataID = (select ID from MetaDataTypes where MetaName = ?);
GetMetadataDisplay SELECT MetaDataValue FROM ServiceMetaDataDisplay WHERE ServiceID = ? AND MetaDataID = (select ID from MetaDataTypes where MetaName = ?);
SetMetadataBlob REPLACE INTO ServiceBlobMetaData (ServiceID, MetaDataID, MetaDataValue, EmbeddedFlag, DeleteFlag) VALUES (?,?,?,?,0);
SetMetadataIndex REPLACE INTO ServiceIndexMetaData (ServiceID, MetaDataID, MetaDataValue, EmbeddedFlag, DeleteFlag) VALUES (?,?,?,?,0);
DeleteAllDisplayMetadata DELETE FROM ServiceMetaDataDisplay where ServiceID = ?;
GetAllDisplayMetadataTypes Select distinct S.MetaDataId, M.MetaName, M.DataTypeID from ServiceMetaData S, MetaDataTypes M where S.ServiceID = ? and S.MetaDataID = M.ID and M.MultipleValues=1 union Select distinct S.MetaDataId, M.MetaName, M.DataTypeID from ServiceKeywordMetaData S, MetaDataTypes M where S.ServiceID = ? and S.MetaDataID = M.ID and M.MultipleValues=1 union Select distinct S.MetaDataId, M.MetaName, M.DataTypeID from ServiceNumericMetaData S, MetaDataTypes M where S.ServiceID = ? and S.MetaDataID = M.ID and M.MultipleValues=1;
SetMetadataString REPLACE INTO ServiceMetaData (ServiceID, MetaDataID, MetaDataValue, EmbeddedFlag, DeleteFlag) VALUES (?,?,?,?,0);
SetMetadataBlob INSERT INTO ServiceBlobMetaData (ServiceID, MetaDataID, MetaDataValue, BlobLength, EmbeddedFlag, DeleteFlag) VALUES (?,?,?,?,?,0);
SetMetadataKeyword INSERT INTO ServiceKeywordMetaData (ServiceID, MetaDataID, MetaDataValue, EmbeddedFlag, DeleteFlag) VALUES (?,?,?,?,0);
SetMetadataString INSERT INTO ServiceMetaData (ServiceID, MetaDataID, MetaDataValue, EmbeddedFlag, DeleteFlag) VALUES (?,?,?,?,0);
SetMetadataNumeric INSERT INTO ServiceNumericMetaData (ServiceID, MetaDataID, MetaDataValue, EmbeddedFlag, DeleteFlag) VALUES (?,?,?,?,0);
SetMetadataDisplay INSERT INTO ServiceMetaDataDisplay (ServiceID, MetaDataID, MetaDataValue, EmbeddedFlag, DeleteFlag) VALUES (?,?,?,?,0);
SetMetadataNumeric REPLACE INTO ServiceNumericMetaData (ServiceID, MetaDataID, MetaDataValue, EmbeddedFlag, DeleteFlag) VALUES (?,?,?,?,0);
DeleteMetadataBlob DELETE FROM ServiceBlobMetaData where ServiceID = ? and MetaDataID=?;
DeleteMetadataKeyword DELETE FROM ServiceKeywordMetaData where ServiceID = ? and MetaDataID=?;
DeleteMetadataString DELETE FROM ServiceMetaData where ServiceID = ? and MetaDataID=?;
DeleteMetadataNumeric DELETE FROM ServiceNumericMetaData where ServiceID = ? and MetaDataID=?;
DeleteMetadataDisplay DELETE FROM ServiceMetaDataDisplay where ServiceID = ? and MetaDataID=?;
SearchMetadataIndex select Path, Name, ID from Services where ID in (select ServiceID from ServiceIndexMetaData where MetaDataID = ? and MetaDataValue = ?);
SearchMetadataString select Path, Name, ID from Services where ID in (select ServiceID from ServiceMetaData where MetaDataID = ? and MetaDataValue = ?);
SearchMetadataNumeric select Path, Name, ID from Services where ID in (select ServiceID from ServiceNUmericMetaData where MetaDataID = ? and MetaDataValue = ?);
DeleteMetadataBlobValue DELETE FROM ServiceBlobMetaData where ServiceID = ? and MetaDataID=? and MetaDataValue = ?;
DeleteMetadataKeywordValue DELETE FROM ServiceKeywordMetaData where ServiceID = ? and MetaDataID=? and MetaDataValue = ?;
DeleteMetadataStringValue DELETE FROM ServiceMetaData where ServiceID = ? and MetaDataID=? and MetaDataValue = ?;
DeleteMetadataNumericValue DELETE FROM ServiceNumericMetaData where ServiceID = ? and MetaDataID=? and MetaDataValue = ?;
GetMetadataTypeInfo SELECT ID, DataTypeID, Embedded, Writeable, Weight FROM MetaDataTypes where MetaName = ?;
GetMetadataTypeInfo SELECT ID, DataTypeID, MultipleValues, Weight FROM MetaDataTypes where MetaName = ?;
GetMetadataTypes SELECT MetaName, ID, DataTypeID, MultipleValues, Weight FROM MetaDataTypes;
GetMetadataTypesLike SELECT MetaName, ID, DataTypeID, MultipleValues, Weight FROM MetaDataTypes WHERE MetaName glob ?;
GetWriteableMetadataTypes SELECT MetaName, ID, DataTypeID, MultipleValues, Weight FROM MetaDataTypes where writeable = 1;
GetWriteableMetadataTypesLike SELECT MetaName, ID, DataTypeID, MultipleValues, Weight FROM MetaDataTypes WHERE MetaName glob ? and writeable = 1;
GetMetadataTypes SELECT MetaName, ID, DataTypeID, Embedded, Writeable, Weight FROM MetaDataTypes;
GetMetadataTypesLike SELECT MetaName, ID, DataTypeID, Embedded, Writeable, Weight FROM MetaDataTypes WHERE MetaName glob ?;
GetWriteableMetadataTypes SELECT MetaName, ID, DataTypeID, Embedded, Writeable, Weight FROM MetaDataTypes where writeable = 1;
GetWriteableMetadataTypesLike SELECT MetaName, ID, DataTypeID, Embedded, Writeable, Weight FROM MetaDataTypes WHERE MetaName glob ? and writeable = 1;
GetMetadataAliases SELECT distinct M.MetaName, M.ID from MetaDataTypes M, MetaDataChildren C where M.ID = C.ChildID and C.MetaDataID = ?;
GetMetadataAliasesForName SELECT distinct M.MetaName, M.ID from MetaDataTypes M, MetaDataChildren C where M.ID = C.ChildID and C.MetaDataID = (select ID from MetaDataTypes where MetaName = ?) union select M.MetaName, M.ID from MetaDataTypes M where M.MetaName = ?;
SelectMetadataClasses SELECT DISTINCT MetaName FROM MetaDataTypes;
InsertMetadataType INSERT INTO MetaDataTypes (MetaName, DataTypeID, Embedded, Writeable) VALUES (?,?,?,?);
InsertMetadataType INSERT INTO MetaDataTypes (MetaName, DataTypeID, MultipleValues, Weight) VALUES (?,?,?,?);
ExistsPendingFiles select count (*) from FilePending where Action <> 20;
......
This diff is collapsed.
......@@ -2,12 +2,12 @@
<rdfq:and>
<rdfq:greaterThan>
<rdfq:Property name="Audio.ReleaseDate" />
<rdfq:Property name="Audio:ReleaseDate" />
<rdf:Integer>1979</rdf:Integer>
</rdfq:greaterThan>
<rdfq:lessThan>
<rdfq:Property name="Audio.ReleaseDate" />
<rdfq:Property name="Audio:ReleaseDate" />
<rdf:Integer>1990</rdf:Integer>
</rdfq:lessThan>
......
......@@ -2,12 +2,12 @@
<rdfq:and>
<rdfq:greaterThan>
<rdfq:Property name="Audio.ReleaseDate" />
<rdfq:Property name="Audio:ReleaseDate" />
<rdf:Integer>1989</rdf:Integer>
</rdfq:greaterThan>
<rdfq:lessThan>
<rdfq:Property name="Audio.ReleaseDate" />
<rdfq:Property name="Audio:ReleaseDate" />
<rdf:Integer>2000</rdf:Integer>
</rdfq:lessThan>
......
<rdfq:Condition>
<rdfq:inSet>
<rdfq:Property name="File.Format" />
<rdfq:Property name="File:Mime" />
<rdf:String>application/msword,application/pdf,application/vnd.ms-excel,application/vnd.oasis.opendocument.text,application/vnd.sun.xml.writer</rdf:String>
</rdfq:inSet>
......
......@@ -2,12 +2,12 @@
<rdfq:and>
<rdfq:inSet>
<rdfq:Property name="File.Format" />
<rdfq:Property name="File:Mime" />
<rdf:String>application/msword,application/pdf,application/vnd.ms-excel,application/vnd.oasis.opendocument.text,application/vnd.sun.xml.writer</rdf:String>
</rdfq:inSet>
<rdfq:greaterThan>
<rdfq:Property name="Doc.PageCount" />
<rdfq:Property name="Doc:PageCount" />
<rdf:Integer>10</rdf:Integer>
</rdfq:greaterThan>
......
......@@ -2,12 +2,12 @@
<rdfq:and>
<rdfq:greaterThan>
<rdfq:Property name="Image.Width" />
<rdfq:Property name="Image:Width" />
<rdf:Integer>1023</rdf:Integer>
</rdfq:greaterThan>
<rdfq:greaterThan>
<rdfq:Property name="Image.Height" />
<rdfq:Property name="Image:Height" />
<rdf:Integer>767</rdf:Integer>
</rdfq:greaterThan>
......
......@@ -188,7 +188,7 @@ main (int argc, char **argv)
field_count = 1;
meta_fields[0] = g_strdup ("File.Format");
meta_fields[0] = g_strdup ("File:Mime");
meta_fields[1] = NULL;
g_strfreev (fields);
fields = meta_fields;
......
......@@ -40,23 +40,23 @@ void tracker_extract_abw (gchar *filename, GHashTable *metadata)
}
if (g_str_has_prefix (line, "<m key=\"dc.title\">")) {
g_hash_table_insert (metadata,
g_strdup ("Doc.Title"), g_strdup (line+18));
g_strdup ("Doc:Title"), g_strdup (line+18));
}
else if (g_str_has_prefix (line, "<m key=\"dc.subject\">")) {
g_hash_table_insert (metadata,
g_strdup ("Doc.Subject"), g_strdup (line+20));
g_strdup ("Doc:Subject"), g_strdup (line+20));
}
else if (g_str_has_prefix (line, "<m key=\"dc.creator\">")) {
g_hash_table_insert (metadata,
g_strdup ("Doc.Author"), g_strdup (line+20));
g_strdup ("Doc:Author"), g_strdup (line+20));
}
else if (g_str_has_prefix (line, "<m key=\"abiword.keywords\">")) {
g_hash_table_insert (metadata,
g_strdup ("Doc.Keywords"), g_strdup (line+26));
g_strdup ("Doc:Keywords"), g_strdup (line+26));
}
else if (g_str_has_prefix (line, "<m key=\"dc.description\">")) {
g_hash_table_insert (metadata,
g_strdup ("Doc.Comments"), g_strdup (line+24));
g_strdup ("Doc:Comments"), g_strdup (line+24));
}
g_free (line);
line = NULL;
......
......@@ -78,29 +78,29 @@ typedef struct {
} TagType;
TagType tags[] = {
{ EXIF_TAG_PIXEL_Y_DIMENSION, "Image.Height", NULL },
{ EXIF_TAG_PIXEL_X_DIMENSION, "Image.Width", NULL },
{ EXIF_TAG_RELATED_IMAGE_WIDTH, "Image.Width", NULL },
{ EXIF_TAG_DOCUMENT_NAME, "Image.Title", NULL },
/* { -1, "Image.Album", NULL }, */
{ EXIF_TAG_DATE_TIME, "Image.Date", NULL },
/* { -1, "Image.Keywords", NULL }, */
{ EXIF_TAG_ARTIST, "Image.Creator", NULL },
{ EXIF_TAG_USER_COMMENT, "Image.Comments", NULL },
{ EXIF_TAG_IMAGE_DESCRIPTION, "Image.Description", NULL },
{ EXIF_TAG_SOFTWARE, "Image.Software", NULL },
{ EXIF_TAG_MAKE, "Image.CameraMake", NULL },
{ EXIF_TAG_MODEL, "Image.CameraModel", NULL },
{ EXIF_TAG_ORIENTATION, "Image.Orientation", NULL },
{ EXIF_TAG_EXPOSURE_PROGRAM, "Image.ExposureProgram", NULL },
{ EXIF_TAG_EXPOSURE_TIME, "Image.ExposureTime", fix_exposure_time },
{ EXIF_TAG_FNUMBER, "Image.Fnumber", fix_fnumber },
{ EXIF_TAG_FLASH, "Image.Flash", fix_flash },
{ EXIF_TAG_FOCAL_LENGTH, "Image.FocalLength", fix_focal_length },
{ EXIF_TAG_ISO_SPEED_RATINGS, "Image.ISOSpeed", NULL },
{ EXIF_TAG_METERING_MODE, "Image.MeteringMode", NULL },
{ EXIF_TAG_WHITE_BALANCE, "Image.WhiteBalance", NULL },
{ EXIF_TAG_COPYRIGHT, "Image.Copyright", NULL },
{ EXIF_TAG_PIXEL_Y_DIMENSION, "Image:Height", NULL },
{ EXIF_TAG_PIXEL_X_DIMENSION, "Image:Width", NULL },
{ EXIF_TAG_RELATED_IMAGE_WIDTH, "Image:Width", NULL },
{ EXIF_TAG_DOCUMENT_NAME, "Image:Title", NULL },
/* { -1, "Image:Album", NULL }, */
{ EXIF_TAG_DATE_TIME, "Image:Date", NULL },
/* { -1, "Image:Keywords", NULL }, */
{ EXIF_TAG_ARTIST, "Image:Creator", NULL },
{ EXIF_TAG_USER_COMMENT, "Image:Comments", NULL },
{ EXIF_TAG_IMAGE_DESCRIPTION, "Image:Description", NULL },
{ EXIF_TAG_SOFTWARE, "Image:Software", NULL },
{ EXIF_TAG_MAKE, "Image:CameraMake", NULL },
{ EXIF_TAG_MODEL, "Image:CameraModel", NULL },
{ EXIF_TAG_ORIENTATION, "Image:Orientation", NULL },
{ EXIF_TAG_EXPOSURE_PROGRAM, "Image:ExposureProgram", NULL },
{ EXIF_TAG_EXPOSURE_TIME, "Image:ExposureTime", fix_exposure_time },
{ EXIF_TAG_FNUMBER, "Image:Fnumber", fix_fnumber },
{ EXIF_TAG_FLASH, "Image:Flash", fix_flash },
{ EXIF_TAG_FOCAL_LENGTH, "Image:FocalLength", fix_focal_length },
{ EXIF_TAG_ISO_SPEED_RATINGS, "Image:ISOSpeed", NULL },
{ EXIF_TAG_METERING_MODE, "Image:MeteringMode", NULL },
{ EXIF_TAG_WHITE_BALANCE, "Image:WhiteBalance", NULL },
{ EXIF_TAG_COPYRIGHT, "File:Copyright", NULL },
{ -1, NULL, NULL }
};
......
......@@ -457,23 +457,23 @@ extract_metadata (MetadataExtractor *extractor, GHashTable *metadata)
if (extractor->audio_channels >= 0) {
add_uint_info (metadata, g_strdup ("Audio.Channels"), (guint) extractor->audio_channels);
add_uint_info (metadata, g_strdup ("Audio:Channels"), (guint) extractor->audio_channels);
}
if (extractor->audio_samplerate >= 0) {
add_uint_info (metadata, g_strdup ("Audio.Samplerate"), (guint) extractor->audio_samplerate);
add_uint_info (metadata, g_strdup ("Audio:Samplerate"), (guint) extractor->audio_samplerate);
}
if (extractor->video_height >= 0) {
add_uint_info (metadata, g_strdup ("Video.Height"), (guint) extractor->video_height);
add_uint_info (metadata, g_strdup ("Video:Height"), (guint) extractor->video_height);
}
if (extractor->video_width >= 0) {
add_uint_info (metadata, g_strdup ("Video.Width"), (guint) extractor->video_width);
add_uint_info (metadata, g_strdup ("Video:Width"), (guint) extractor->video_width);
}
if (extractor->video_fps_n >= 0 && extractor->video_fps_d >= 0) {
add_uint_info (metadata, g_strdup ("Video.FrameRate"),
add_uint_info (metadata, g_strdup ("Video:FrameRate"),
(guint) ((extractor->video_fps_n + extractor->video_fps_d / 2) / extractor->video_fps_d));
}
......@@ -481,61 +481,60 @@ extract_metadata (MetadataExtractor *extractor, GHashTable *metadata)
gint64 duration;
/* audio */
add_string_gst_tag (metadata, "Audio.Album", extractor->tagcache, GST_TAG_ALBUM);
add_uint_gst_tag (metadata, "Audio.AlbumTrackCount", extractor->tagcache, GST_TAG_TRACK_COUNT);
add_uint_gst_tag (metadata, "Audio.TrackNo", extractor->tagcache, GST_TAG_TRACK_NUMBER);
add_uint_gst_tag (metadata, "Audio.DiscNo", extractor->tagcache, GST_TAG_ALBUM_VOLUME_NUMBER);
add_string_gst_tag (metadata, "Audio.Performer", extractor->tagcache, GST_TAG_PERFORMER);
add_double_gst_tag (metadata, "Audio.TrackGain", extractor->tagcache, GST_TAG_TRACK_GAIN);
add_double_gst_tag (metadata, "Audio.TrackPeakGain", extractor->tagcache, GST_TAG_TRACK_PEAK);
add_double_gst_tag (metadata, "Audio.AlbumGain", extractor->tagcache, GST_TAG_ALBUM_GAIN);
add_double_gst_tag (metadata, "Audio.AlbumPeakGain", extractor->tagcache, GST_TAG_ALBUM_PEAK);
add_year_of_gdate_gst_tag (metadata, "Audio.ReleaseDate", extractor->tagcache, GST_TAG_DATE);
add_string_gst_tag (metadata, "Audio.Genre", extractor->tagcache, GST_TAG_GENRE);
add_string_gst_tag (metadata, "Audio.Codec", extractor->tagcache, GST_TAG_AUDIO_CODEC);
add_string_gst_tag (metadata, "Audio:Album", extractor->tagcache, GST_TAG_ALBUM);
add_uint_gst_tag (metadata, "Audio:AlbumTrackCount", extractor->tagcache, GST_TAG_TRACK_COUNT);
add_uint_gst_tag (metadata, "Audio:TrackNo", extractor->tagcache, GST_TAG_TRACK_NUMBER);
add_uint_gst_tag (metadata, "Audio:DiscNo", extractor->tagcache, GST_TAG_ALBUM_VOLUME_NUMBER);
add_string_gst_tag (metadata, "Audio:Performer", extractor->tagcache, GST_TAG_PERFORMER);
add_double_gst_tag (metadata, "Audio:TrackGain", extractor->tagcache, GST_TAG_TRACK_GAIN);
add_double_gst_tag (metadata, "Audio:TrackPeakGain", extractor->tagcache, GST_TAG_TRACK_PEAK);
add_double_gst_tag (metadata, "Audio:AlbumGain", extractor->tagcache, GST_TAG_ALBUM_GAIN);
add_double_gst_tag (metadata, "Audio:AlbumPeakGain", extractor->tagcache, GST_TAG_ALBUM_PEAK);
add_year_of_gdate_gst_tag (metadata, "Audio:ReleaseDate", extractor->tagcache, GST_TAG_DATE);
add_string_gst_tag (metadata, "Audio:Genre", extractor->tagcache, GST_TAG_GENRE);
add_string_gst_tag (metadata, "Audio:Codec", extractor->tagcache, GST_TAG_AUDIO_CODEC);
/* video */
add_string_gst_tag (metadata, "Video.Codec", extractor->tagcache, GST_TAG_VIDEO_CODEC);
add_string_gst_tag (metadata, "Video:Codec", extractor->tagcache, GST_TAG_VIDEO_CODEC);
/* general */
add_string_gst_tag (metadata, "File.Copyright", extractor->tagcache, GST_TAG_COPYRIGHT);
add_string_gst_tag (metadata, "File.License", extractor->tagcache, GST_TAG_LICENSE);
add_string_gst_tag (metadata, "File.Organization", extractor->tagcache, GST_TAG_ORGANIZATION);
add_string_gst_tag (metadata, "File.Location", extractor->tagcache, GST_TAG_LOCATION);
add_string_gst_tag (metadata, "File:Copyright", extractor->tagcache, GST_TAG_COPYRIGHT);
add_string_gst_tag (metadata, "File:License", extractor->tagcache, GST_TAG_LICENSE);
add_string_gst_tag (metadata, "DC:Coverage", extractor->tagcache, GST_TAG_LOCATION);
duration = get_media_duration (extractor);
/* Sometimes it is unclear to what a tag belongs to! */
if (extractor->has_video) {
add_string_gst_tag (metadata, "Video.Title", extractor->tagcache, GST_TAG_TITLE);
add_string_gst_tag (metadata, "Video.Comment", extractor->tagcache, GST_TAG_COMMENT);
add_string_gst_tag (metadata, "Video:Title", extractor->tagcache, GST_TAG_TITLE);
add_string_gst_tag (metadata, "Video:Comments", extractor->tagcache, GST_TAG_COMMENT);
/* FIXME: is it a good idea to use GST_TAG_ARTIST as author?! */
add_string_gst_tag (metadata, "Video.Author", extractor->tagcache, GST_TAG_ARTIST);
add_string_gst_tag (metadata, "Video.Copyright", extractor->tagcache, GST_TAG_COPYRIGHT);
add_string_gst_tag (metadata, "Video:Author", extractor->tagcache, GST_TAG_ARTIST);
add_string_gst_tag (metadata, "File:Copyright", extractor->tagcache, GST_TAG_COPYRIGHT);
if (duration >= 0) {
add_int64_info (metadata, g_strdup ("Video.Duration"), duration);
add_int64_info (metadata, g_strdup ("Video:Duration"), duration);
}
} else if (extractor->has_audio) {
/* No video? So we assume we are treating a song */
add_string_gst_tag (metadata, "Audio.Title", extractor->tagcache, GST_TAG_TITLE);
add_string_gst_tag (metadata, "Audio.Artist", extractor->tagcache, GST_TAG_ARTIST);
add_string_gst_tag (metadata, "Audio.Comment", extractor->tagcache, GST_TAG_COMMENT);
add_string_gst_tag (metadata, "Audio:Title", extractor->tagcache, GST_TAG_TITLE);
add_string_gst_tag (metadata, "Audio:Artist", extractor->tagcache, GST_TAG_ARTIST);
add_string_gst_tag (metadata, "Audio:Comment", extractor->tagcache, GST_TAG_COMMENT);
if (duration >= 0) {
add_int64_info (metadata, g_strdup ("Audio.Duration"), duration);
add_int64_info (metadata, g_strdup ("Audio:Duration"), duration);
}
}
}
if (extractor->audiotags) {
add_uint_gst_tag (metadata, "Audio.Bitrate", extractor->tagcache, GST_TAG_BITRATE);
add_uint_gst_tag (metadata, "Audio:Bitrate", extractor->tagcache, GST_TAG_BITRATE);
}
if (extractor->videotags) {
add_uint_gst_tag (metadata, "Video.Bitrate", extractor->tagcache, GST_TAG_BITRATE);
add_uint_gst_tag (metadata, "Video:Bitrate", extractor->tagcache, GST_TAG_BITRATE);
}
}
......
......@@ -50,9 +50,9 @@ tracker_extract_imagemagick (gchar *filename, GHashTable *metadata)
NULL)) {
lines = g_strsplit (identify, ";\n", 4);
g_hash_table_insert (metadata, g_strdup ("Image.Width"), g_strdup (lines[0]));
g_hash_table_insert (metadata, g_strdup ("Image.Height"), g_strdup (lines[1]));
g_hash_table_insert (metadata, g_strdup ("Image.Comments"), g_strdup (g_strescape (lines[2], "")));
g_hash_table_insert (metadata, g_strdup ("Image:Width"), g_strdup (lines[0]));
g_hash_table_insert (metadata, g_strdup ("Image:Height"), g_strdup (lines[1]));
g_hash_table_insert (metadata, g_strdup ("Image:Comments"), g_strdup (g_strescape (lines[2], "")));
}
}
......@@ -91,31 +91,31 @@ metadata_cb (gpointer key, gpointer value, gpointer user_data)
val = gsf_doc_prop_get_val (property);
if (strcmp (name, "dc:title") == 0) {
add_gvalue_in_hash_table (metadata, "Doc.Title", val);
add_gvalue_in_hash_table (metadata, "Doc:Title", val);
}
else if (strcmp (name, "dc:subject") == 0) {
add_gvalue_in_hash_table (metadata, "Doc.Subject", val);
add_gvalue_in_hash_table (metadata, "Doc:Subject", val);
}
else if (strcmp (name, "dc:creator") == 0) {
add_gvalue_in_hash_table (metadata, "Doc.Author", val);
add_gvalue_in_hash_table (metadata, "Doc:Author", val);
}
else if (strcmp (name, "dc:keywords") == 0) {
add_gvalue_in_hash_table (metadata, "Doc.Keywords", val);
add_gvalue_in_hash_table (metadata, "Doc:Keywords", val);
}
else if (strcmp (name, "dc:description") == 0) {
add_gvalue_in_hash_table (metadata, "Doc.Comment", val);
add_gvalue_in_hash_table (metadata, "Doc:Comments", val);
}
else if (strcmp (name, "gsf:page-count") == 0) {
add_gvalue_in_hash_table (metadata, "Doc.PageCount", val);
add_gvalue_in_hash_table (metadata, "Doc:PageCount", val);
}
else if (strcmp (name, "gsf:word-count") == 0) {
add_gvalue_in_hash_table (metadata, "Doc.WordCount", val);
add_gvalue_in_hash_table (metadata, "Doc:WordCount", val);
}
else if (strcmp (name, "meta:creation-date") == 0) {
add_gvalue_in_hash_table (metadata, "Doc.Created", val);
add_gvalue_in_hash_table (metadata, "Doc:Created", val);
}
else if (strcmp (name, "meta:generator") == 0) {
add_gvalue_in_hash_table (metadata, "File.Other", val);
add_gvalue_in_hash_table (metadata, "File:Other", val);
}
}
......
......@@ -132,11 +132,11 @@ void start_element_handler (GMarkupParseContext *context,
for(a=attribute_names,v=attribute_values; *a; ++a,++v) {
if (strcmp (*a, "meta:word-count") == 0) {
g_hash_table_insert (metadata,
g_strdup("Doc.WordCount"), g_strdup (*v));
g_strdup("Doc:WordCount"), g_strdup (*v));
}
else if (strcmp (*a, "meta:page-count") == 0) {
g_hash_table_insert (metadata,
g_strdup("Doc.PageCount"), g_strdup (*v));
g_strdup("Doc:PageCount"), g_strdup (*v));
}
}
((ODTParseInfo *)user_data)->current = READ_STATS;
......@@ -170,33 +170,33 @@ void text_handler (GMarkupParseContext *context,
switch(((ODTParseInfo *)user_data)->current) {
case READ_TITLE:
g_hash_table_insert (metadata, g_strdup("Doc.Title"), g_strdup (text));
g_hash_table_insert (metadata, g_strdup("Doc:Title"), g_strdup (text));
break;
case READ_SUBJECT:
g_hash_table_insert (metadata, g_strdup("Doc.Subject"), g_strdup (text));
g_hash_table_insert (metadata, g_strdup("Doc:Subject"), g_strdup (text));
break;
case READ_AUTHOR:
g_hash_table_insert (metadata, g_strdup("Doc.Author"), g_strdup (text));
g_hash_table_insert (metadata, g_strdup("Doc:Author"), g_strdup (text));
break;
case READ_KEYWORDS: {
gchar *keywords;
if ((keywords = g_hash_table_lookup (metadata, "Doc.Keywords"))) {
g_hash_table_replace (metadata, "Doc.Keywords",
if ((keywords = g_hash_table_lookup (metadata, "Doc:Keywords"))) {
g_hash_table_replace (metadata, "Doc:Keywords",