File: filter.h

package info (click to toggle)
4store 1.1.6+20151109-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid, stretch
  • size: 82,388 kB
  • sloc: ansic: 65,689; sh: 2,916; perl: 2,245; makefile: 281; python: 213
file content (99 lines) | stat: -rw-r--r-- 4,013 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef FILTER_H
#define FILTER_H

#include "query-datatypes.h"
#include "filter-datatypes.h"

/* utility functions to handle bit array */
unsigned char *fs_new_bit_array(long n);
void fs_bit_array_set(unsigned char *p,long i,int value);
short fs_bit_array_get(unsigned char *p,long i);
void fs_bit_array_destroy(unsigned char *p);

/* unary operators */
fs_value fn_plus(fs_query *q, fs_value a);
fs_value fn_minus(fs_query *q, fs_value a);

/* binary generic operators */
fs_value fn_equal(fs_query *q, fs_value a, fs_value b);
fs_value fn_not_equal(fs_query *q, fs_value a, fs_value b);
fs_value fn_less_than(fs_query *q, fs_value a, fs_value b);
fs_value fn_greater_than(fs_query *q, fs_value a, fs_value b);
fs_value fn_less_than_equal(fs_query *q, fs_value a, fs_value b);
fs_value fn_greater_than_equal(fs_query *q, fs_value a, fs_value b);

/* unary maths operators */
fs_value fn_numeric_abs(fs_query *q, fs_value a);
fs_value fn_numeric_round(fs_query *q, fs_value a);
fs_value fn_numeric_ceil(fs_query *q, fs_value a);
fs_value fn_numeric_floor(fs_query *q, fs_value a);

/* binary maths operators */
fs_value fn_numeric_add(fs_query *q, fs_value a, fs_value b);
fs_value fn_numeric_subtract(fs_query *q, fs_value a, fs_value b);
fs_value fn_numeric_multiply(fs_query *q, fs_value a, fs_value b);
fs_value fn_numeric_divide(fs_query *q, fs_value a, fs_value b);

fs_value fn_numeric_equal(fs_query *q, fs_value a, fs_value b);
fs_value fn_numeric_less_than(fs_query *q, fs_value a, fs_value b);
fs_value fn_numeric_greater_than(fs_query *q, fs_value a, fs_value b);

fs_value fn_datetime_equal(fs_query *q, fs_value a, fs_value b);
fs_value fn_datetime_less_than(fs_query *q, fs_value a, fs_value b);
fs_value fn_datetime_greater_than(fs_query *q, fs_value a, fs_value b);
fs_value fn_rdfterm_equal(fs_query *q, fs_value a, fs_value b);

fs_value fn_compare(fs_query *q, fs_value a, fs_value b);
fs_value fn_matches(fs_query *q, fs_value str, fs_value pat, fs_value flags);
fs_value fn_lang_matches(fs_query *q, fs_value a, fs_value l);

fs_value fn_logical_and(fs_query *q, fs_value a, fs_value b);
fs_value fn_logical_or(fs_query *q, fs_value a, fs_value b);
fs_value fn_not(fs_query *q, fs_value a);

fs_value fn_bound(fs_query *q, fs_value a);
fs_value fn_is_iri(fs_query *q, fs_value a);
fs_value fn_is_blank(fs_query *q, fs_value a);
fs_value fn_is_literal(fs_query *q, fs_value a);
fs_value fn_str(fs_query *q, fs_value a);
fs_value fn_uri(fs_query *q, fs_value a);
fs_value fn_bnode(fs_query *q, fs_value a);
fs_value fn_lang(fs_query *q, fs_value a);
fs_value fn_datatype(fs_query *q, fs_value a);

/* SPARQL 1.1 functions */

fs_value fn_substring(fs_query *q, fs_value str, fs_value start, fs_value length);
fs_value fn_ucase(fs_query *q, fs_value v);
fs_value fn_lcase(fs_query *q, fs_value v);
fs_value fn_encode_for_uri(fs_query *q, fs_value v);
fs_value fn_year(fs_query *q, fs_value v);
fs_value fn_month(fs_query *q, fs_value v);
fs_value fn_day(fs_query *q, fs_value v);
fs_value fn_hours(fs_query *q, fs_value v);
fs_value fn_minutes(fs_query *q, fs_value v);
fs_value fn_seconds(fs_query *q, fs_value v);
fs_value fn_timezone(fs_query *q, fs_value v);
fs_value fn_strstarts(fs_query *q, fs_value arg1, fs_value arg2);
fs_value fn_strends(fs_query *q, fs_value arg1, fs_value arg2);
fs_value fn_contains(fs_query *q, fs_value arg1, fs_value arg2);
fs_value fn_strbefore(fs_query *q, fs_value arg1, fs_value arg2);
fs_value fn_strafter(fs_query *q, fs_value arg1, fs_value arg2);
fs_value fn_rand(fs_query *q);
fs_value fn_md5(fs_query *q, fs_value arg);
fs_value fn_sha1(fs_query *q, fs_value arg);
fs_value fn_sha256(fs_query *q, fs_value arg);
fs_value fn_uuid(fs_query *q);
fs_value fn_struuid(fs_query *q);

/* casts and similar */
fs_value fn_cast(fs_query *q, fs_value v, fs_value d);
fs_value fn_cast_intl(fs_query *q, fs_value v, fs_rid dt);
fs_value fn_ebv(fs_value a);

#ifndef HAVE_UUID_STRING_T
#define HAVE_UUID_STRING_T 1
typedef char uuid_string_t[37];
#endif

#endif