File: endpoint-example.js

package info (click to toggle)
tinysparql 3.10.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,468 kB
  • sloc: ansic: 118,310; python: 6,139; javascript: 719; sh: 121; perl: 106; xml: 67; makefile: 31; sql: 1
file content (23 lines) | stat: -rwxr-xr-x 589 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/gjs

const { GLib, Gio, Tsparql } = imports.gi

try {
    let connection = Tsparql.SparqlConnection.new(
        Tsparql.SparqlConnectionFlags.NONE,
        null, // Database location, None creates it in-memory
        Tsparql.sparql_get_ontology_nepomuk(), // Ontology location
        null);

    let bus = Gio.bus_get_sync(Gio.BusType.SESSION, null)

    let endpoint = Tsparql.EndpointDBus.new(
        connection, bus, null, null);

    let loop = GLib.MainLoop.new(null, false);
    loop.run();

    connection.close();
} catch (e) {
    printerr(`Error: ${e.message}`)
}