]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/spotlight_SPARQL_map.c
Set Tracker environment
[netatalk.git] / etc / afpd / spotlight_SPARQL_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 "spotlight_SPARQL_map.h"
22
23 #define NOTSUPPORTED NULL
24 #define SPECIAL      NULL
25
26 struct spotlight_sparql_map spotlight_sparql_map[] = {
27     /* ssm_spotlight_attr               ssm_type,   ssm_sparql_attr */
28     {"*",                               ssmt_fts,   "fts:match"},
29
30     /* Filesystem metadata */
31     {"kMDItemFSLabel",                  ssmt_num,   NOTSUPPORTED},
32     {"kMDItemDisplayName",              ssmt_str,   "nfo:fileName"},
33     {"kMDItemFSName",                   ssmt_str,   "nfo:fileName"},
34     {"kMDItemFSContentChangeDate",      ssmt_date,  "nfo:fileLastModified"},
35
36     /* Common metadata */
37     {"kMDItemTextContent",              ssmt_fts,   "fts:match"},
38     {"kMDItemContentCreationDate",      ssmt_date,  "nie:contentCreated"},
39     {"kMDItemContentModificationDate",  ssmt_date,  "nfo:fileLastModified"},
40     {"kMDItemAttributeChangeDate",      ssmt_date,  "nfo:fileLastModified"},
41     {"kMDItemAuthors",                  ssmt_str,   "dc:creator"},
42     {"kMDItemCopyright",                ssmt_str,   "nie:copyright"},
43     {"kMDItemCountry",                  ssmt_str,   "nco:country"},
44     {"kMDItemCreator",                  ssmt_str,   "dc:creator"},
45     {"kMDItemDurationSeconds",          ssmt_num,   "nfo:duration"},
46     {"kMDItemNumberOfPages",            ssmt_num,   "nfo:pageCount"},
47     {"kMDItemTitle",                    ssmt_str,   "nie:title"},
48     {"_kMDItemGroupId",                 ssmt_type,  SPECIAL},
49     {"kMDItemContentTypeTree",          ssmt_type,  SPECIAL},
50
51     /* Image metadata */
52     {"kMDItemPixelWidth",               ssmt_num,   "nfo:width"},
53     {"kMDItemPixelHeight",              ssmt_num,   "nfo:height"},
54     {"kMDItemColorSpace",               ssmt_str,   "nexif:colorSpace"},
55     {"kMDItemBitsPerSample",            ssmt_num,   "nfo:colorDepth"},
56     {"kMDItemFocalLength",              ssmt_num,   "nmm:focalLength"},
57     {"kMDItemISOSpeed",                 ssmt_num,   "nmm:isoSpeed"},
58     {"kMDItemOrientation",              ssmt_bool,  "nfo:orientation"},
59     {"kMDItemResolutionWidthDPI",       ssmt_num,   "nfo:horizontalResolution"},
60     {"kMDItemResolutionHeightDPI",      ssmt_num,   "nfo:verticalResolution"},
61     {"kMDItemExposureTimeSeconds",      ssmt_num,   "nmm:exposureTime"},
62
63     /* Audio metadata */
64     {"kMDItemComposer",                 ssmt_str,   "nmm:composer"},
65     {"kMDItemMusicalGenre",             ssmt_str,   "nfo:genre"},
66
67     {NULL, ssmt_str, NULL}
68 };
69
70 struct MDTypeMap MDTypeMap[] = {
71     {"1",                       kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Email"},
72     {"2",                       kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact"},
73     {"3",                       kMDTypeMapNotSup,   NULL}, /* PrefPane */
74     {"4",                       kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Font"},
75     {"5",                       kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Bookmark"},
76     {"6",                       kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact"},
77     {"7",                       kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Video"},
78     {"8",                       kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Executable"},
79     {"9",                       kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Folder"},
80     {"10",                      kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio"},
81     {"11",                      kMDTypeMapMime,     "application/pdf"},
82     {"12",                      kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Presentation"},
83     {"13",                      kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Image"},
84     {"public.jpeg",             kMDTypeMapMime,     "image/jpeg"},
85     {"public.tiff",             kMDTypeMapMime,     "image/tiff"},
86     {"com.compuserve.gif",      kMDTypeMapMime,     "image/gif"},
87     {"public.png",              kMDTypeMapMime,     "image/png"},
88     {"com.microsoft.bmp",       kMDTypeMapMime,     "image/bmp"},
89     {"public.content",          kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document"},
90     {"public.mp3",              kMDTypeMapMime,     "audio/mpeg"},
91     {"public.mpeg-4-audio",     kMDTypeMapMime,     "audio/x-aac"},
92     {"com.apple.application",   kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Software"},
93     {"public.text",             kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#TextDocument"},
94     {"public.plain-text",       kMDTypeMapMime,     "text/plain"},
95     {"public.rtf",              kMDTypeMapMime,     "text/rtf"},
96     {"public.html",             kMDTypeMapMime,     "text/html"},
97     {"public.xml",              kMDTypeMapMime,     "text/xml"},
98     {"public.source-code",      kMDTypeMapRDF,      "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SourceCode"},
99     {NULL,                      kMDTypeMapNotSup,   NULL}
100 };