TRACKER3-SPARQL(1) | Tracker manual | TRACKER3-SPARQL(1) |
NAME¶
tracker3-sparql - Use SparQL to query the Tracker databases.
SYNOPSIS¶
tracker3 sparql [(-d |--database) <file> | (-b | --dbus-service) <busname> | (-r | --remote-service) <url>]
[(-q | --query) <sparql> | (-f | --file) <file>] [(-u | --update)] [-a <parameter>:<value>]... tracker3 sparql [(-d |--database) <file> | (-b | --dbus-service) <busname> | (-r | --remote-service) <url>]
[(-t | --tree)] [(-t | --tree) <class>] [(-p | --list-properties)] [(-s | --search) <needle>] tracker3 sparql [(-d |--database) <file> | (-b | --dbus-service) <busname> | (-r | --remote-service) <url>] [(-c | --list-classes)] tracker3 sparql [(-d |--database) <file> | (-b | --dbus-service) <busname> | (-r | --remote-service) <url>] [(-p | --list-properties)] tracker3 sparql [(-d |--database) <file> | (-b | --dbus-service) <busname> | (-r | --remote-service) <url>] [(-i | --list-indexes)] tracker3 sparql [(-d |--database) <file> | (-b | --dbus-service) <busname> | (-r | --remote-service) <url>] [(-n | --list-notifies)] tracker3 sparql [(-d |--database) <file> | (-b | --dbus-service) <busname> | (-r | --remote-service) <url>] [(-g | --list-graphs)] tracker3 sparql [(-d |--database) <file> | (-b | --dbus-service) <busname> | (-r | --remote-service) <url>] [--get-longhand <class>] [--get-shorthand <class>]
DESCRIPTION¶
This command allows probing of the current database schema (also known as ontology) and running low level queries or updates on the data set. In terms of the database ontology, it’s easy to find out what properties are indexed for speed, or notified on changes, what classes are available and the properties belonging to those classes. There are also visual tools to display an ascii tree layout of the classes and their relationships to each other.
When the caller runs a query, the query is in RDF and SPARQL. This can be done two ways. Either by providing a file with the query or by providing a string with the sparql query.
The file argument can be either a local path or a URI. It also does not have to be an absolute path.
OPTIONS¶
-b, --dbus-service=<service_name>
-d, --database-path=<database_path>
-r, --remote-service=<url>
-f, --file=<file>
-q, --query=<sparql>
-u, --update
-a, --arg=<parameter>:<value>
-c, --list-classes
-x, --list-class-prefixes
-p, --list-properties=[class]
-n, --list-notifies=[class]
-i, --list-indexes=[property]
-g, --list-graphs
-t, --tree=[class]
If no class is given, the entire tree is shown.
The --search command line option can be used to highlight parts of the tree you’re looking for. The search is case insensitive.
The --properties command line option can be used to show properties for each class displayed
-s, --search=<needle>
--get-shorthand=<class>
--get-longhand=<class>
EXAMPLES¶
Querying a D-Bus endpoint
$ tracker3 sparql --dbus-service org.example.Endpoint -q "SELECT ('Hello World' AS ?str) {}"
Updating a database directly from a query in a file
$ tracker3 sparql --database /tmp/db/ --update --file ./update.rq
Using --arg to provide a arguments to query parameters
$ tracker3 sparql -b org.example.Endpoint \
-q "SELECT (~name AS ?name) (~age AS ?age) (~available AS ?avail) { }" \
-a name:s:"John" -a age:i:42 -a available:b:true
Introspecting details of a D-Bus endpoint
$ tracker3 sparql -b org.example.Endpoint -tree --list-properties
SEE ALSO¶
10/29/2024 | 3.7.3 |