2 Copyright (c) 2012 Frank Lahm <franklahm@gmail.com>
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.
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.
17 #endif /* HAVE_CONFIG_H */
21 #include "slmod_sparql_map.h"
23 #define NOTSUPPORTED NULL
26 struct spotlight_sparql_map spotlight_sparql_map[] = {
27 /* ssm_spotlight_attr ssm_type, ssm_sparql_attr */
28 {"*", ssmt_fts, "fts:match"},
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"},
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 {"kMDItemLastUsedDate", ssmt_date, "nfo:fileLastAccessed"},
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},
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"},
65 {"kMDItemComposer", ssmt_str, "nmm:composer"},
66 {"kMDItemMusicalGenre", ssmt_str, "nfo:genre"},
68 {NULL, ssmt_str, NULL}
71 struct MDTypeMap MDTypeMap[] = {
72 {"1", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Email"},
73 {"2", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact"},
74 {"3", kMDTypeMapNotSup, NULL}, /* PrefPane */
75 {"4", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Font"},
76 {"5", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Bookmark"},
77 {"6", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact"},
78 {"7", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Video"},
79 {"8", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Executable"},
80 {"9", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Folder"},
81 {"10", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio"},
82 {"11", kMDTypeMapMime, "application/pdf"},
83 {"12", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Presentation"},
84 {"13", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Image"},
85 {"public.jpeg", kMDTypeMapMime, "image/jpeg"},
86 {"public.tiff", kMDTypeMapMime, "image/tiff"},
87 {"com.compuserve.gif", kMDTypeMapMime, "image/gif"},
88 {"public.png", kMDTypeMapMime, "image/png"},
89 {"com.microsoft.bmp", kMDTypeMapMime, "image/bmp"},
90 {"public.content", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document"},
91 {"public.mp3", kMDTypeMapMime, "audio/mpeg"},
92 {"public.mpeg-4-audio", kMDTypeMapMime, "audio/x-aac"},
93 {"com.apple.application", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Software"},
94 {"public.text", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#TextDocument"},
95 {"public.plain-text", kMDTypeMapMime, "text/plain"},
96 {"public.rtf", kMDTypeMapMime, "text/rtf"},
97 {"public.html", kMDTypeMapMime, "text/html"},
98 {"public.xml", kMDTypeMapMime, "text/xml"},
99 {"public.source-code", kMDTypeMapRDF, "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SourceCode"},
100 {NULL, kMDTypeMapNotSup, NULL}