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 {"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},
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"},
64 {"kMDItemComposer", ssmt_str, "nmm:composer"},
65 {"kMDItemMusicalGenre", ssmt_str, "nfo:genre"},
67 {NULL, ssmt_str, NULL}
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}