]> arthur.barton.de Git - netatalk.git/blob - etc/spotlight/slmod_rdf_map.c
Basic Tracker RDF queries working
[netatalk.git] / etc / spotlight / slmod_rdf_map.c
1 /*
2   Copyright (c) 2012 Frank Lahm <franklahm@gmail.com>
3
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU General Public License as published by
6   the Free Software Foundation; either version 2 of the License, or
7   (at your option) any later version.
8
9   This program is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   GNU General Public License for more details.
13 */
14
15 #ifdef HAVE_CONFIG_H
16 #include "config.h"
17 #endif /* HAVE_CONFIG_H */
18
19 #include <unistd.h>
20
21 #include "slmod_rdf_map.h"
22
23 #define NOTSUPPORTED NULL
24 #define SPECIAL      NULL
25
26 struct spotlight_rdf_map spotlight_rdf_map[] = {
27     /* srm_spotlight_attr               srm_type,   srm_rdf_attr */
28     {"*",                               srmt_str,   "File:Name"},
29     {"kMDItemTextContent",              srmt_fts,   ""},
30
31     /* Filesystem metadata */
32     {"kMDItemFSLabel",                  srmt_num,   NOTSUPPORTED},
33     {"kMDItemDisplayName",              srmt_str,   "File:Name"},
34     {"kMDItemFSName",                   srmt_str,   "File:Name"},
35 #if 0
36     {"kMDItemFSContentChangeDate",      ssmt_date,  "nfo:fileLastModified"},
37
38     /* Common metadata */
39     {"kMDItemContentCreationDate",      ssmt_date,  "nie:contentCreated"},
40     {"kMDItemContentModificationDate",  ssmt_date,  "nfo:fileLastModified"},
41     {"kMDItemAttributeChangeDate",      ssmt_date,  "nfo:fileLastModified"},
42     {"kMDItemAuthors",                  ssmt_str,   "dc:creator"},
43     {"kMDItemCopyright",                ssmt_str,   "nie:copyright"},
44     {"kMDItemCountry",                  ssmt_str,   "nco:country"},
45     {"kMDItemCreator",                  ssmt_str,   "dc:creator"},
46     {"kMDItemDurationSeconds",          ssmt_num,   "nfo:duration"},
47     {"kMDItemNumberOfPages",            ssmt_num,   "nfo:pageCount"},
48     {"kMDItemTitle",                    ssmt_str,   "nie:title"},
49     {"_kMDItemGroupId",                 ssmt_type,  SPECIAL},
50     {"kMDItemContentTypeTree",          ssmt_type,  SPECIAL},
51
52     /* Image metadata */
53     {"kMDItemPixelWidth",               ssmt_num,   "nfo:width"},
54     {"kMDItemPixelHeight",              ssmt_num,   "nfo:height"},
55     {"kMDItemColorSpace",               ssmt_str,   "nexif:colorSpace"},
56     {"kMDItemBitsPerSample",            ssmt_num,   "nfo:colorDepth"},
57     {"kMDItemFocalLength",              ssmt_num,   "nmm:focalLength"},
58     {"kMDItemISOSpeed",                 ssmt_num,   "nmm:isoSpeed"},
59     {"kMDItemOrientation",              ssmt_bool,  "nfo:orientation"},
60     {"kMDItemResolutionWidthDPI",       ssmt_num,   "nfo:horizontalResolution"},
61     {"kMDItemResolutionHeightDPI",      ssmt_num,   "nfo:verticalResolution"},
62     {"kMDItemExposureTimeSeconds",      ssmt_num,   "nmm:exposureTime"},
63
64     /* Audio metadata */
65     {"kMDItemComposer",                 ssmt_str,   "nmm:composer"},
66     {"kMDItemMusicalGenre",             ssmt_str,   "nfo:genre"},
67 #endif
68     {NULL, srmt_str, NULL}
69 };
70
71 struct MDTypeMap MDTypeMap[] = {
72     {"1",                       "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Email"},
73     {"2",                       "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact"},
74     {"3",                       NULL}, /* PrefPane */
75     {"4",                       "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Font"},
76     {"5",                       "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Bookmark"},
77     {"6",                       "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact"},
78     {"7",                       "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Video"},
79     {"8",                       "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Executable"},
80     {"9",                       "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Folder"},
81     {"10",                      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio"},
82     {"11",                      "application/pdf"},
83     {"12",                      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Presentation"},
84     {"13",                      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Image"},
85     {"public.jpeg",             "image/jpeg"},
86     {"public.tiff",             "image/tiff"},
87     {"com.compuserve.gif",      "image/gif"},
88     {"public.png",              "image/png"},
89     {"com.microsoft.bmp",       "image/bmp"},
90     {"public.content",          "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document"},
91     {"public.mp3",              "audio/mpeg"},
92     {"public.mpeg-4-audio",     "audio/x-aac"},
93     {"com.apple.application",   "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Software"},
94     {"public.text",             "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#TextDocument"},
95     {"public.plain-text",       "text/plain"},
96     {"public.rtf",              "text/rtf"},
97     {"public.html",             "text/html"},
98     {"public.xml",              "text/xml"},
99     {"public.source-code",      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SourceCode"},
100     {NULL,                      NULL}
101 };