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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
/*
* Copyright (C) 2017 - Red Hat Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
namespace Tracker {
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public errordomain Sparql.Error {
PARSE,
UNKNOWN_CLASS,
UNKNOWN_PROPERTY,
TYPE,
CONSTRAINT,
NO_SPACE,
INTERNAL,
UNSUPPORTED,
UNKNOWN_GRAPH
}
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public enum Sparql.ConnectionFlags {
NONE = 0,
READONLY = 1 << 0,
FTS_ENABLE_STEMMER = 1 << 1,
FTS_ENABLE_UNACCENT = 1 << 2,
FTS_ENABLE_STOP_WORDS = 1 << 3,
FTS_IGNORE_NUMBERS = 1 << 4,
}
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public enum Sparql.ValueType {
UNBOUND,
URI,
STRING,
INTEGER,
DOUBLE,
DATETIME,
BLANK_NODE,
BOOLEAN
}
[CCode (cheader_filename = "libtracker-sparql/tracker-connection.h")]
public enum RdfFormat {
TURTLE,
TRIG,
}
[CCode (cheader_filename = "libtracker-sparql/tracker-connection.h")]
public enum SerializeFlags {
NONE = 0,
}
namespace Sparql {
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public static string escape_string (string literal);
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public static string escape_uri (string uri);
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public static string escape_uri_printf (string format, ...);
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public static string escape_uri_vprintf (string format, va_list args);
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public static string get_uuid_urn ();
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public static GLib.File get_ontology_nepomuk ();
}
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public abstract class Sparql.Connection : GLib.Object {
public extern static new Connection remote_new (string uri_base);
public extern static new Connection new (Sparql.ConnectionFlags flags, GLib.File? store, GLib.File? ontology, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.IOError;
public extern async static new Connection new_async (Sparql.ConnectionFlags flags, GLib.File? store, GLib.File? ontology, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.IOError;
public extern static new Connection bus_new (string service_name, string? object_path, GLib.DBusConnection? dbus_connection = null) throws Sparql.Error, GLib.IOError, GLib.DBusError, GLib.Error;
public extern async static new Connection bus_new_async (string service_name, string? object_path, GLib.DBusConnection? dbus_connection = null, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.IOError, GLib.DBusError, GLib.Error;
public abstract Cursor query (string sparql, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
public async abstract Cursor query_async (string sparql, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
public virtual void update (string sparql, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
public async virtual void update_async (string sparql, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
public async virtual bool update_array_async (string[] sparql, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
public virtual GLib.Variant? update_blank (string sparql, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
public async virtual GLib.Variant? update_blank_async (string sparql, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
public virtual bool update_resource (string? graph, Resource resource, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
public async virtual bool update_resource_async (string? graph, Resource resource, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
public virtual NamespaceManager? get_namespace_manager ();
public extern static void set_domain (string? domain);
public extern static string? get_domain ();
public extern static void set_dbus_connection (GLib.DBusConnection dbus_connection);
public extern static GLib.DBusConnection? get_dbus_connection ();
public virtual Statement? query_statement (string sparql, GLib.Cancellable? cancellable = null) throws Sparql.Error;
public virtual Batch? create_batch ();
public virtual Notifier? create_notifier ();
public virtual void close ();
public async virtual bool close_async () throws GLib.IOError;
public async virtual GLib.InputStream serialize_async (SerializeFlags flags, RdfFormat format, string sparql, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
public virtual void map_connection (string handle_name, Sparql.Connection service_connection);
}
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public abstract class Sparql.Statement : GLib.Object {
public string sparql { get; construct set; }
public Connection connection { get; construct set; }
public abstract void bind_int (string name, int64 value);
public abstract void bind_boolean (string name, bool value);
public abstract void bind_string (string name, string value);
public abstract void bind_double (string name, double value);
public abstract void bind_datetime (string name, GLib.DateTime value);
public abstract void clear_bindings ();
public abstract Cursor execute (GLib.Cancellable? cancellable) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
public async abstract Cursor execute_async (GLib.Cancellable? cancellable) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
public async abstract GLib.InputStream serialize_async (SerializeFlags flags, RdfFormat format, GLib.Cancellable? cancellable) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
}
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public abstract class Sparql.Cursor : GLib.Object {
public Connection connection {
get;
set;
}
public abstract int n_columns {
get;
}
public abstract Sparql.ValueType get_value_type (int column);
public abstract unowned string? get_variable_name (int column);
public abstract unowned string? get_string (int column, out long length = null);
public abstract bool next (GLib.Cancellable? cancellable = null) throws GLib.Error;
public async abstract bool next_async (GLib.Cancellable? cancellable = null) throws GLib.Error;
public abstract void rewind ();
public virtual void close ();
public virtual int64 get_integer (int column);
public virtual double get_double (int column);
public virtual bool get_boolean (int column);
public virtual GLib.DateTime get_datetime (int column);
public virtual bool is_bound (int column);
}
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public class NamespaceManager : GLib.Object {
public NamespaceManager ();
public void add_prefix (string prefix, string namespace);
public bool has_prefix (string prefix);
public string? lookup_prefix (string prefix);
public string expand_uri (string compact_uri);
public static NamespaceManager get_default ();
}
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public class Resource : GLib.Object {
public Resource (string? identifier);
public void set_value (string predicate, GLib.Value value);
public void set_boolean (string predicate, bool object);
public void set_double (string predicate, double object);
public void set_int (string predicate, int object);
public void set_int64 (string predicate, int64 object);
public void set_relation (string predicate, Resource object);
public void set_string (string predicate, string object);
public void set_uri (string predicate, string object);
public void add_value (string predicate, GLib.Value value);
public void add_boolean (string predicate, bool object);
public void add_double (string predicate, double object);
public void add_int (string predicate, int object);
public void add_int64 (string predicate, int64 object);
public void add_relation (string predicate, Resource object);
public void add_string (string predicate, string object);
public void add_uri (string predicate, string object);
public GLib.List<GLib.Value?> get_values (string predicate);
public bool get_first_boolean (string predicate);
public double get_first_double (string predicate);
public int get_first_int (string predicate);
public int64 get_first_int64 (string predicate);
public unowned Resource get_first_relation (string predicate);
public string get_first_string (string predicate);
public string get_first_uri (string predicate);
public string get_identifier ();
public void set_identifier (string identifier);
public int identifier_compare_func (string identifier);
public string print_turtle (NamespaceManager? namespaces);
public string print_sparql_update (NamespaceManager? namespaces, string? graph_id);
public string print_jsonld (NamespaceManager? namespaces);
}
[CCode (cprefix = "TRACKER_NOTIFIER_FLAG_", cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public enum NotifierFlags {
QUERY_URN,
QUERY_LOCATION,
NOTIFY_UNEXTRACTED
}
public enum NotifierEventType {
QUERY_URN,
QUERY_LOCATION,
NOTIFY_UNEXTRACTED
}
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public class Notifier : GLib.Object {
public class NotifierEvent {
public enum Type {
CREATE,
DELETE,
UPDATE
}
public int64 get_id ();
public string get_type ();
public string get_urn ();
public string get_location ();
}
public uint signal_subscribe (GLib.DBusConnection dbus_conn, string dbus_name, string? object_path, string? graph);
public void signal_unsubscribe (uint handler_id);
}
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public abstract class Batch : GLib.Object {
public Sparql.Connection connection { get; construct set; }
public abstract void add_sparql (string sparql);
public abstract void add_resource (string? graph, Resource resource);
public abstract bool execute (GLib.Cancellable? cancellable) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
public async abstract bool execute_async (GLib.Cancellable? cancellable) throws Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
}
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public class Endpoint : GLib.Object {
Sparql.Connection get_sparql_connection ();
}
[CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
public class EndpointDBus : GLib.Object, GLib.Initable {
public EndpointDBus (Sparql.Connection sparql_conn, GLib.DBusConnection? dbus_conn, string object_path, GLib.Cancellable? cancellable) throws GLib.Error;
}
}
|