diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2022-03-14 01:46:32 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2022-04-03 18:47:17 +0000 |
commit | a26d19c44f806cd7e2c84f0804b34241dda3107c (patch) | |
tree | dbe45fc67f475068e9660d8f8177d326a7aab3dc /docs/reference/libtracker-sparql/examples.md | |
parent | 1e9f6fee869030474323b78eeccb3b04227f26a8 (diff) | |
download | tracker-a26d19c44f806cd7e2c84f0804b34241dda3107c.tar.gz |
docs: Add python examples
Diffstat (limited to 'docs/reference/libtracker-sparql/examples.md')
-rw-r--r-- | docs/reference/libtracker-sparql/examples.md | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/docs/reference/libtracker-sparql/examples.md b/docs/reference/libtracker-sparql/examples.md index d544838e5..710ad8702 100644 --- a/docs/reference/libtracker-sparql/examples.md +++ b/docs/reference/libtracker-sparql/examples.md @@ -34,11 +34,16 @@ main loop is not blocked while these operations are executed. Once you end up with the query, remember to call [](tracker_sparql_cursor_close). The same applies to [](tracker_sparql_connection_close) when no longer needed. -<div class="gi-lang-c gi-lang-python gi-lang-javascript"> +<div class="gi-lang-c gi-lang-javascript"> {{ examples/connection-example.c }} </div> +<div class="gi-lang-python"> + +{{ examples/connection-example.py }} + +</div> ## Creating a private database @@ -60,11 +65,16 @@ main loop is not blocked while these operations are executed. Once you no longer need the connection, remember to call [](tracker_sparql_connection_close) on the [](TrackerSparqlConnection). -<div class="gi-lang-c gi-lang-python gi-lang-javascript"> +<div class="gi-lang-c gi-lang-javascript"> {{ examples/private-store-example.c }} </div> +<div class="gi-lang-python"> + +{{ examples/private-store-example.py }} + +</div> ## Creating a SPARQL endpoint @@ -77,11 +87,16 @@ concretely the creation of a D-Bus endpoint, that other applications may query e.g. through a connection created with [](tracker_sparql_connection_bus_new). -<div class="gi-lang-c gi-lang-python gi-lang-javascript"> +<div class="gi-lang-c gi-lang-javascript"> {{ examples/endpoint-example.c }} </div> +<div class="gi-lang-python"> + +{{ examples/endpoint-example.py }} + +</div> ## Receiving notification on changes @@ -94,8 +109,13 @@ on changes of certain RDF classes (Those with the This example demonstrates the use of [](TrackerNotifier) to receive notifications on database updates. -<div class="gi-lang-c gi-lang-python gi-lang-javascript"> +<div class="gi-lang-c gi-lang-javascript"> {{ examples/notifier-example.c }} </div> +<div class="gi-lang-python"> + +{{ examples/notifier-example.py }} + +</div> |