smbd: Simplify an if-condition
[Samba.git] / source3 / rpc_server / mdssvc / sparql_mapping.h
blob14fab67403269d8b101696705003c5849be2230b
1 /*
2 Copyright (c) 2012 Ralph Boehme
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.
15 #ifndef SPOTLIGHT_SPARQL_MAP_H
16 #define SPOTLIGHT_SPARQL_MAP_H
18 enum ssm_type {
19 ssmt_bool, /* a boolean value that doesn't requires a SPARQL FILTER */
20 ssmt_num, /* a numeric value that requires a SPARQL FILTER */
21 ssmt_str, /* a string value that requires a SPARQL FILTER */
22 ssmt_fts, /* a string value that will be queried with SPARQL 'fts:match' */
23 ssmt_date, /* date values are handled in a special map function map_daterange() */
24 ssmt_type /* kMDItemContentType, requires special mapping */
27 struct sl_attr_map {
28 const char *spotlight_attr;
29 enum ssm_type type;
30 const char *sparql_attr;
33 enum kMDTypeMap {
34 kMDTypeMapNotSup, /* not supported */
35 kMDTypeMapRDF, /* query with rdf:type */
36 kMDTypeMapMime /* query with nie:mimeType */
39 struct sl_type_map {
41 * MD query value of attributes '_kMDItemGroupId' and
42 * 'kMDItemContentTypeTree
44 const char *spotlight_type;
47 * Whether SPARQL query must search attribute rdf:type or
48 * nie:mime_Type
50 enum kMDTypeMap type;
52 /* the SPARQL query match string */
53 const char *sparql_type;
56 const struct sl_attr_map *sl_attr_map_by_spotlight(const char *sl_attr);
57 const struct sl_type_map *sl_type_map_by_spotlight(const char *sl_type);
58 #endif