Commandline reference
You can control tracker using the tracker3
commandline tool. The various
commands are documented below.
This documentation is also available on your computer using the man
command.
Note
This documentation is for the latest in-development version of Tracker.
tracker miner-fs-3
Name
tracker-miner-fs-3 — Used to crawl the file system to mine data.
DESCRIPTION
tracker-miner-fs-3 is not supposed to be run by the user since it is started by its .desktop file when the user logs in. It can also be started manually of course for debugging purposes. You can not run more than one instance of this at the same time.
tracker-miner-fs-3 mines information about applications and files only.
OPTIONS
- -?, --help
- Show summary of options.
- -V, --version
- Returns the version of this binary.
- -s, --initial-sleep=SECONDS
- Sets the initial sleep time before crawling the file system is started. If the --no-daemon option is used, this option is ignored.
- -n, --no-daemon
- Tells the miner to exit once all indexing has finished and the database is up to date. This is not the default mode of operation for the miner, usually it stays around acting like a daemon to monitor file updates which may occur over time. This option renders the --initial-sleep option moot.
- -e, --eligible=FILE
- Checks if FILE is eligible for being mined based on the current configuration rules. In addition to this, it will check if FILE would be monitored for changes. This works with non-existing FILE arguments as well as existing FILE arguments.
ENVIRONMENT
- G_MESSAGES_DEBUG
-
Controls verbose log output from GLib-based code. Use
G_MESSAGES_DEBUG=Tracker
to see only Tracker-related logs, orG_MESSAGES_DEBUG=all
to see everything. - TRACKER_DEBUG
Enables more specialized debug output. Pass a comma-separated list of one or more keywords:
- config
- miner configuration
- miner-fs-events
- internal processing of tracker-miner-fs
- monitors
- change events from filesystem monitors
- statistics
- show statistics about how many files were processed
- status
- log the status messages that are published over D-Bus
tracker miner-rss-3
Name
tracker-miner-rss-3 — Used to populate Tracker with RSS feed data.
DESCRIPTION
tracker-miner-rss is not supposed to be run by the user since it is started by its .desktop file when the user logs in. It can also be started manually of course for debugging purposes. You can not run more than one instance of this at the same time.
tracker-miner-rss mines information about RSS feeds only.
OPTIONS
- -?, --help
- Show summary of options.
- -V, --version
- Returns the version of this binary.
- -a, --add-feed=URL
- Adds a feed to be indexed. This must be used with --title option. An examples of such a URL would be:
http://planet.gnome.org/atom.xml
http://newsrss.bbc.co.uk/rss/sportplayer_uk_edition/motorsport/rss.xml
…
You can use tracker-search --feeds to get the latest feed information.
- -t, --title=STRING
- The title to use when adding a feed (see the --add-feed option).
tracker writeback-3
Name
tracker-writeback-3 — Used to write metadata set in Tracker back to physical files.
DESCRIPTION
tracker-writeback is not supposed to be run by the user since it is started by its .desktop file when the user logs in. It can also be started manually of course for debugging purposes. You can not run more than one instance of this at the same time.
tracker-writeback writes metadata from the Tracker database back into files only. Currently support is limited to XMP metadata (which covers PNG, JPEG, TIFF, MP4 and 3GPP formats), play lists (which covers MPEGURL, SCPLS and IRIVER formats) and taglib supported mime types (which covers MP3, MP4, OGG, WAV, FLAC and some Windows media formats).
Data is only written back if write-back is enabled in the tracker-miner-fs configuration.
tracker xdg-portal-3
Name
tracker-xdg-portal-3 — Portal to Tracker endpoints
DESCRIPTION
This daemon allows access to Tracker endpoints in a controlled manner. By default access to every service is disallowed, services may be whitelisted through additional policy in the .flatpak-info file.
When whitelisting services, the policy may define specific graph names to allow access to, the default keyword to allow access to the default unnamed graph, or * keyword to allow access to all graphs.
CONFIGURATION
When interacting with sandboxed clients, the service expects the following format in the .flatpak-info file:
[Policy Tracker3] dbus:org.example.SparqlEndpoint1=graphA;graphB;default dbus:org.example.SparqlEndpoint2=*
This will allow access to the endpoints behind the org.example.SparqlEndpoint1 and org.example.SparqlEndpoint2 bus names. Only to the graphA and graphB graph IRIs and the default unnamed graph on the first endpoint, and to all graphs in the second.
This policy can be set when building or running the sandboxed application through the --add-policy option. This can be set via finish-args in the flatpak manifest, specified along the build chain in flatpak-build-finish(1), or modified at start time with flatpak-run(1). For example:
$ flatpak run \ --add-policy=Tracker3.dbus:org.example.SparqlEndpoint1=graphA \ --add-policy=Tracker3.dbus:org.example.SparqlEndpoint1=graphB \ --add-policy=Tracker3.dbus:org.example.SparqlEndpoint1=default \ --add-policy=Tracker3.dbus:org.example.SparqlEndpoint2=* \ org.freedesktop.TrackerSandbox
tracker3-daemon
Name
tracker3-daemon — Start, stop, restart and list daemons responsible for indexing content
Synopsis
tracker3 daemon [options...] tracker3 daemon -s | -t [daemons] | -k [daemons] | -l tracker3 daemon -f | -w [ontology] tracker3 daemon --miner <miner> --pause[-for-process] <reason> tracker3 daemon --miner <miner> --resume <cookie>
DESCRIPTION
Tracker indexes content with daemon processes that run in the background. The tracker3 daemon command allows for control of these components. This ranges from starting, stopping and killing processes to pausing and resuming them.
In addition to all this, there are ways to follow or watch what is happening in real time from a top level and right down where the SPARQL commits are happening too.
If no arguments are provided this command will show the current status of all Tracker data miners.
The data miners can be paused or resumed using this command and you can also list miners running and available.
OPTIONS
- -p, --list-processes
- This lists all Tracker processes in the system.
- *-k, --kill
- This uses SIGKILL to stop all Tracker processes found matching the parameter, if no extra parameter is passed, "all" will be assumed. This is not advised unless you are having problems stopping Tracker in the first place. This GUARANTEES death.
- *-t, --terminate=
- This uses SIGTERM to stop all Tracker processes. This is recommended over --kill because it gives the processes time to shutdown cleanly.
- -s, --start
- Starts all miners.
- -f, --follow
- Follow status changes to daemons as they happen. This is a top level view of what is happening. You will see the name for each daemon and a state with the progress in that state.
This requires Ctrl+C to stop and return to the command line. Each new status is put on a new line.
- -w, --watch=[ontology]
- Watch changes that happen to the database in real time. This requires Ctrl+C to stop and return to the command line.
If ontology is unspecified, all updates are shown. The ontology can be a comma separated list of shorthand or long hand ontology properties. For example:
$ tracker3 daemon -w nie:url,nie:mimeType,nfo:fileSize,nie:dataSource Now listening for resource updates to the database All nie:plainTextContent properties are omitted Press Ctrl+C to stop 'nfo:Document' 'nfo:fileSize' = '1770' 'nie:dataSource' = 'http://tracker.api.gnome.org/ontology/v3/tracker#extractor-data-source' 'nie:mimeType' = 'text/plain' 'nie:url' = 'file:///home/martyn/.bash_aliases' 'nfo:Document' 'nie:dataSource' = 'http://tracker.api.gnome.org/ontology/v3/tracker#extractor-data-source' ...
- --list-common-statuses
- This will list statuses most commonly produced by miners and the store. These statuses are not translated when sent over D-Bus and should be translated by each application. These are not considered static and are subject to change at any point.
Additionally, these statuses are not the only ones which may be reported by a miner. There may be other states pertaining to the specific roles of the miner in question.
- --list-miners-running
- This will list all miners which have responded to a D-Bus call. Sometimes it is helpful to use this command with --list-miners-available.
- --list-miners-available
- This will list all miners which are available even if they are not running at the moment.
- --pause-details
- For listing all miners which are paused and the reasons for being paused, you can use this. It will also display the application that requested the pause too.
- --miner=<miner>
- This argument is used with --pause or --resume to say which miner you want to pause or resume. You can use the full D-Bus name, e.g. "org.freedesktop.Tracker3.Miner.Files" OR you can use the suffix, e.g. "Files".
- --pause=<reason>
- The reason here is useful to know WHY the miner should be paused. A miner can be paused many times by multiple applications. Only when all pauses have been resumed will it continue. If successful, a cookie will be given to uniquely identify the request. This cookie is used to resume the pause at a later stage.
- --pause-for-process=<reason>
- This works exactly the same way as --pause with the exception that it only keeps the pause active while the calling process is alive. As soon as you press Ctrl+C the pause is resumed automatically.
- --resume=<cookie>
- The cookie is given by a successful --pause command. It is a number which identifies each pause request. When all pauses have been resumed, the miner will resume working.
tracker3-endpoint
Name
tracker3-endpoint — Create a SPARQL endpoint
Synopsis
tracker3 endpoint [--dbus-service | -b] <service_name> [--database-path | -d] <database_path> [[--ontology | -o] <ontology_name> | [--ontology-path | -p] <ontology_path>] [--http-port] <port> [--loopback] [[--system | --session]]
DESCRIPTION
This command allows creating SPARQL endpoints. The endpoint will be able to handle SPARQL select and update queries, and notify about changes in it.
The endpoint is exported via DBus, accessible through the given service_name, either using it in a SERVICE clause, or by creating a dedicated bus-based SPARQL connection.
When creating a database, the ontology_name (or alternatively, a ontology_path) must be provided in order to generate the database. If ontology_name is used, the ontology must exist in $datadir/tracker/ontologies
Users should be careful about the --http-port option, consider using it only combined with the --loopback option.
The database itself will be stored according to database_path.
OPTIONS
- -b, --dbus-service=<service_name>
- Service name to use on the endpoint.
- -d, --database-path=<database_path>
- The path where the database will be stored.
- -o, --ontology
- The name of an ontology in $datadir/tracker/ontologies to use on the constructed database.
- -p, --ontology-path
- Full path to an ontology to use on the constructed database.
- --session
- Use the session bus. This is the default.
- --system
- Use the system bus.
- -l, --list
- List all SPARQL endpoints available in DBus
- --http-port
- Creates a HTTP endpoint that listens in the specified port
- --loopback
- Allows only HTTP connections in the loopback device. Only effective with HTTP endpoints.
EXAMPLES
Export a Nepomuk endpoint with the org.example.Example1 bus name.
$ tracker3 endpoint -b org.example.Example1 -o nepomuk -d /tmp/example1
Access this endpoint with the tracker3-sparql(1) subcommand.
$ tracker3 sparql --dbus-service org.example.Example1 -q " SELECT ?s ?o WHERE { ?u a ?o }"
Export a Nepomuk endpoint via HTTP.
$ tracker3 endpoint --http-port 8080 -o nepomuk --loopback
Access this endpoint via HTTP.
$ tracker3 sparql --remote-service http://127.0.0.1:8080/sparql -q " SELECT ?u { ?u a rdfs:Resource }"
tracker3-export
Name
tracker3-export — Export all data from a Tracker database.
DESCRIPTION
tracker3 export exports data stored in a Tracker database, in Turtle format. By default all data is exported, if any IRI, only those resources will be printed.
The output is intended to be machine-readable, not human readable. Use a tool such as rapper(1) to convert the data to different formats.
OPTIONS
- -o, --output-format=<RDF_FORMAT>
- Choose which RDF format to use to output results. Supported formats are turtle, trig and json-ld.
- -g, --show-graphs
- Deprecated. Does the same than --output-format trig.
- --2to3
- Helper for migrating data from Tracker 2.x databases. This option takes an argument specifying the scope. Only the “files-starred” argument is available so far.
- --keyfile
- Outputs the data in a key file format. Only may be used with --2to3
tracker3-extract
Name
tracker3-extract — Extract metadata from a file.
DESCRIPTION
tracker3 extract reads the file provided and extracts any metadata it can from this file, then displays the metadata on standard output.
The metadata is displayed as a SPARQL update command, that can be run against a SPARQL endpoint to update its copy of the metadata.
The actual extraction is done by a separate process. This is done to isolate the calling process from any memory leaks or crashes in the libraries Tracker uses to extract metadata.
For more information see the libtracker-extract reference documentation.
OPTIONS
- -o, --output-format=<FORMAT>
- Choose which format to use to output results. Supported formats are sparql, turtle and json-ld.
EXAMPLES
- Using command line to extract metadata from a file
- $ tracker3 extract /path/to/some/file.mp3
ENVIRONMENT
- G_MESSAGES_DEBUG
-
Controls verbose log output from GLib-based code. Use
G_MESSAGES_DEBUG=Tracker
to see only Tracker-related logs, orG_MESSAGES_DEBUG=all
to see everything. - TRACKER_DEBUG
Enables more specialized debug output. Pass a comma-separated list of one or more keywords:
- config
- extractor configuration
- statistics
- show statistics about how many files were processed
- status
- log the status messages that are published over D-Bus
tracker3-import
Name
tracker3-import — Import data into a Tracker database.
tracker3-index
Name
tracker3-index — Index content using the Tracker filesystem miner
Synopsis
tracker3 index tracker3 index --add [--recursive] <dir> [[dir] ...] tracker3 index --remove <path> [[dir] ...]
tracker3-info
Name
tracker3-info — Retrieve all information available for a certain file.
DESCRIPTION
tracker3 info asks for all the known metadata available for the given file.
Multiple file arguments can be provided to retrieve information about multiple files.
The file argument can be either a local path or a URI. It also does not have to be an absolute path.
OPTIONS
- -f, --full-namespaces
- By default, all keys and values reported about any given file are returned in shortened form, for example, nie:title is shown instead of http://tracker.api.gnome.org/ontology/v3/nie#title. This makes things much easier to see generally and the output is less cluttered. This option reverses that so FULL namespaces are shown instead.
- -c, --plain-text-content
- If the resource being displayed has nie:PlainTextContent (i.e. information about the content of the resource, which could be the contents of a file on the disk), then this option displays that in the output.
- -i, --resource-is-iri
- In most cases, the file argument supplied points to a URL or PATH which is queried for according to the resource associated with it by nie:url. However, in cases where the file specified turns out to be the actual URN itself, this argument is required to tell "tracker3 info" not to do the extra step of looking up the URN related by nie:url.
For example, consider that you store URNs by the actual URL itself and use the unique nie:url in another resource (which is quite reasonable when using containers and multi-resource conditions), you would need this argument to tell "tracker3 info" that the file supplied is actually a URN not URL.
- -t, --turtle
- Output results as Turtle RDF. If -f is enabled, full URIs are shown for subjects, predicates and objects; otherwise, shortened URIs are used, and all the prefixes Tracker knows about are printed at the top of the output.
tracker3-reset
Name
tracker3-reset — Reset the index and configuration
DESCRIPTION
The reset command will change either your configuration or index irreversibly and should be used with care. Other than tags, actual data (e.g. files) should not be affected by this command.
The "index" is a link between your content (either locally or remotely) and how it can be found quickly using a number of different queries. Under the hood, this is done using a database.
Removing all data and starting again from the beginning with an empty data set (which is a common use of this command) is done by using the hard reset option. This behaves as if Tracker was just installed.
OPTIONS
- -s, --filesystem
- Removes data stored by tracker-miner-fs(1). The miner will automatically recreate its cache from the filesystem when it restarts.
- -r, --rss
- Removes data stored by tracker-miner-rss(1).
- -f, --file FILE
- Resets all indexed information about FILE, works recursively for directories. Nothing will be done if FILE is not currently indexed. After deletion, a request to reindex this data will be immediately issued.
tracker3-search
Name
tracker3-search — Search for content by type or across all types
DESCRIPTION
tracker3 search searches all indexed content for expression. The resource in which expression matches must exist (see --all for more information). All results are returned in ascending order. In all cases, if no expression is given for an argument (like --folders for example) then ALL items in that category are returned instead.
- expression
- One or more terms to search. The default operation is a logical AND. For logical OR operations, see -r.
OPTIONS
- -f, --files
- Search for files of any type matching expression (optional).
- -s, --folders
- Search for folders matching expression (optional).
- -m, --music
- Search for music files matching expression (optional).
- --music-albums
- Search for music albums matching expression (optional).
- --music-artists
- Search for music artists matching expression (optional).
- -i, --images
- Search for images matching expression (optional).
- -v, --videos
- Search for videos matching expression (optional).
- -t, --documents
- Search for documents matching expression (optional).
- -e, --emails
- Search for emails matching expression (optional). Returns a list of subjects for emails found.
- -c, --contacts
- Search for contacts matching expression (optional). Returns a list of names and email addresses found.
- --software
- Search for software installed matching expression (optional). Returns a list of desktop files and application titles found.
- --software-categories
- Search for software categories matching expression (optional). Returns a list of urns and their categories (e.g. Settings, Video, Utility, etc).
- --feeds
- Search through RSS feed information matching expression (optional). Returns a list of those found.
- -b, --bookmarks
- Search through bookmarks matching expression (optional). Returns a list titles and links for each bookmark found.
- -l, --limit=<limit>
- Limit search to limit results. The default is 10 or 512 with --disable-snippets.
- -o, --offset=<offset>
- Offset the search results by offset. For example, start at item number 10 in the results. The default is 0.
- -r, --or-operator
- Use OR for search terms instead of AND (the default)
- -d, --detailed
- Show the unique URN associated with each search result. This does not apply to --music-albums and --music-artists.
- -a, --all
- Show results which might not be available. This might bebecause a removable media is not mounted for example. Without this option, resources are only shown if they exist. This option applies to all command line switches except
- --disable-snippets
- Results are shown with snippets. Snippets are context around the word that was searched for in the first place. This gives some idea of if the resource found is the right one. Snippets require Full Text Search to be compile time enabled AND to not be disabled with --disable-fts. Using --disable-snippets only shows the resources which matched, no context is provided about where the match occurred.
- --disable-fts
- If Full Text Search (FTS) is available, this option allows it to be disabled for one off searches. This returns results slightly using particular properties to match the search terms (like "nie:title") instead of looking for the search terms amongst ALL properties. It is more limiting to do this, but sometimes searching without FTS can yield better results if the FTS ranking is off.
- --disable-color
- This disables any ANSI color use on the command line. By default this is enabled to make it easier to see results.
tracker3-sparql
Name
tracker3-sparql — Use SparQL to query the Tracker databases.
Synopsis
tracker3 sparql -q <sparql> [-u] | -f <file> tracker3 sparql -t [class] [-s <needle>] [-p] tracker3 sparql [-c] [-p] [-x] [-n [class]] [-i [property]] [-s <needle>] tracker3 sparql [--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
- -f, --file=<file>
- Use a file with SPARQL content to query or update.
- -q, --query=<sparql>
- Use a sparql string to query the database with.
- -u, --update
- This has to be used with --query. This tells "tracker3 sparql" to use the SPARQL update extensions so it knows it isn’t a regular data lookup request. So if your query is intended to change data in the database, this option is needed.
- -c, --list-classes
- Returns a list of classes which describe the ontology used for storing data. These classes are also used in queries. For example, http://www.w3.org/2000/01/rdf-schema#Resource is one of many classes which should be returned here.
- -x, --list-class-prefixes
- Returns a list of classes and their related prefixes. Prefixes are used to make querying a lot simpler and are much like an alias. For example, http://www.w3.org/2000/01/rdf-schema#Resource has the prefix rdfs so queries can be cut down to:
"SELECT ?u WHERE { ?u a rdfs:Resource }"
- -p, --list-properties=[class]
- Returns a list of properties which pertain to a class. You can use both formats here for the class, either the full name http://tracker.api.gnome.org/ontology/v3/nfo#Video or the shortened prefix name nfo:Video.
This gives the following result:
$ tracker3 sparql -p nfo:Video Properties: 2 http://tracker.api.gnome.org/ontology/v3/nfo#frameRate http://tracker.api.gnome.org/ontology/v3/nfo#frameCount
These properties nfo:frameRate and nfo:frameCount can then be used in queries.
See also --tree and --query.
- -n, --list-notifies=[class]
- Returns a list of classes which are notified over D-Bus about any changes that occur in the database. The class does not have to be supplied here. This is optional and filters the results according to any argument supplied. With no class, all classes are listed.
- -i, --list-indexes=[property]
Returns a list of properties which are indexed in the database. Indexes improves query speed but also add an indexing penalty. The property does not have to be supplied here. This is optional and filters the results according to any argument supplied. With no property, all properties are listed.
- -g, --list-graphs:: List all the named graphs in the database. These are used by the filesystem miner to separate metadata so that apps can only see the information relevant to them.
- -t, --tree=[class]
- Prints a tree showing all parent classes of class in the ontology. The class can be provided in shorthand or longhand (see --get-shorthand and --get-longhand for details). For example:
$ tracker3 sparql -t nmo:MMSMessage ROOT +-- rdfs:Resource (C) | +-- nie:InformationElement (C) | | +-- nfo:Document (C) | | | +-- nfo:TextDocument (C) | | | | `-- nmo:Message (C) | | | | | +-- nmo:PhoneMessage (C) | | | | | | `-- nmo:MMSMessage (C)
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, for example:
$ tracker3 sparql -t nfo:FileDataObject -p ROOT +-- rdfs:Resource (C) | --> http://purl.org/dc/elements/1.1/contributor (P) | --> http://purl.org/dc/elements/1.1/coverage (P) | --> http://purl.org/dc/elements/1.1/creator (P) | --> http://purl.org/dc/elements/1.1/date (P) | --> http://purl.org/dc/elements/1.1/description (P) | --> http://purl.org/dc/elements/1.1/format (P) | --> http://purl.org/dc/elements/1.1/identifier (P) | --> http://purl.org/dc/elements/1.1/language (P) | --> http://purl.org/dc/elements/1.1/publisher (P) | --> http://purl.org/dc/elements/1.1/relation (P) | --> http://purl.org/dc/elements/1.1/rights (P) | --> http://purl.org/dc/elements/1.1/source (P) | --> http://purl.org/dc/elements/1.1/subject (P) | --> http://purl.org/dc/elements/1.1/title (P) | --> http://purl.org/dc/elements/1.1/type (P) | --> nao:deprecated (P) | --> nao:hasTag (P) | --> nao:identifier (P) | --> nao:isRelated (P) | --> nao:lastModified (P) | --> nao:numericRating (P) | --> rdf:type (P) | --> rdfs:comment (P) | --> rdfs:label (P) | --> nrl:added (P) | --> nrl:damaged (P) | --> nrl:modified (P) | +-- nie:DataObject (C) | | --> nfo:belongsToContainer (P) | | --> nie:byteSize (P) | | --> nie:created (P) | | --> nie:dataSource (P) | | --> nie:interpretedAs (P) | | --> nie:isPartOf (P) | | --> nie:lastRefreshed (P) | | --> nie:url (P) | | --> tracker:available (P) | | +-- nfo:FileDataObject (C) | | | --> nfo:fileCreated (P) | | | --> nfo:fileLastAccessed (P) | | | --> nfo:fileLastModified (P) | | | --> nfo:fileName (P) | | | --> nfo:fileOwner (P) | | | --> nfo:fileSize (P) | | | --> nfo:hasHash (P) | | | --> nfo:permissions (P)
- -s, --search=<needle>
- Returns a list of classes and properties which partially match needle in the ontology. This is a case insensitive match, for example:
$ tracker3 sparql -s text Classes: 4 http://tracker.api.gnome.org/ontology/v3/nfo#TextDocument http://tracker.api.gnome.org/ontology/v3/nfo#PlainTextDocument http://tracker.api.gnome.org/ontology/v3/nfo#PaginatedTextDocument http://tracker.api.gnome.org/ontology/v3/nmm#SynchronizedText Properties: 4 http://tracker.api.gnome.org/ontology/v3/tracker#fulltextIndexed http://tracker.api.gnome.org/ontology/v3/nie#plainTextContent http://tracker.api.gnome.org/ontology/v3/nmo#plainTextMessageContent http://tracker.api.gnome.org/ontology/v3/scal#textLocation
See also --tree.
- --get-shorthand=<class>
- Returns the shorthand for a class given by a URL. For example:
$ tracker3 sparql --get-shorthand http://tracker.api.gnome.org/ontology/v3/nmo#plainTextMessageContent nmo:plainTextMessageContent
- --get-longhand=<class>
- Returns the longhand for a class given in the form of CLASS:PROPERTY. For example:
$ tracker3 sparql --get-longhand nmm:MusicPiece http://tracker.api.gnome.org/ontology/v3/nmm#MusicPiece
EXAMPLES
- List all classes
$ tracker3 sparql -q "SELECT ?cl WHERE { ?cl a rdfs:Class }"
- List all properties for the Resources class (see --list-properties)
$ tracker3 sparql -q "SELECT ?prop WHERE { ?prop a rdf:Property ; rdfs:domain <http://www.w3.org/2000/01/rdf-schema#Resource> }"
- List all class namespace prefixes
$ tracker3 sparql -q "SELECT ?prefix ?ns WHERE { ?ns a nrl:Namespace ; nrl:prefix ?prefix }"
- List all music files
$ tracker3 sparql -q "SELECT ?song WHERE { ?song a nmm:MusicPiece }"
- List all music albums, showing title, track count, and length in seconds.
$ tracker3 sparql -q "SELECT ?title COUNT(?song) AS songs SUM(?length) AS totallength WHERE { ?album a nmm:MusicAlbum ; nie:title ?title . ?song nmm:musicAlbum ?album ; nfo:duration ?length } GROUP BY ?album"
- List all music from a particular artist
$ tracker3 sparql -q "SELECT ?song ?title WHERE { ?song nmm:performer [ nmm:artistName 'Artist Name' ] ; nie:title ?title }"
- Set the played count for a song
$ tracker3 sparql -u -q "DELETE { <file:///home/user/Music/song.mp3> nie:usageCounter ?count } WHERE { <file:///home/user/Music/song.mp3> nie:usageCounter ?count } INSERT { <file:///home/user/Music/song.mp3> nie:usageCounter 42 }"
- List all image files
$ tracker3 sparql -q "SELECT ?image WHERE { ?image a nfo:Image }"
- List all image files with a specific tag
$ tracker3 sparql -q "SELECT ?image WHERE { ?image a nfo:Image ; nao:hasTag [ nao:prefLabel 'tag' ] }"
- List all image files created on a specific month and order by date
$ tracker3 sparql -q "SELECT ?image ?date WHERE { ?image a nfo:Image ; nie:contentCreated ?date . FILTER (?date >= '2008-07-01T00:00:00' && ?date < '2008-08-01T00:00:00') } ORDER BY ?date"
tracker3-sql
Name
tracker3-sql — Use SQL to query the Tracker databases.
DESCRIPTION
This command allows probing of the current database. When using commands like tracker3 sparql, the SPARQL used is translated into SQL before being run on the database. This allows direct use of the database using SQL avoiding the SPARQL engine entirely.
The caller can run a query two ways, either by providing a file with the query or by providing a string with the sql query.
The file argument can be either a local path or a URI. It also does not have to be an absolute path.
OPTIONS
- -f, --file=<file>
- Use a file with SPARQL content to query. Don’t forget to end all queries with a semicolon (;) and also to use quotes around table names. The quotes are important because most tables are named after ontology classes like "nfo:Document" and queries will fail without the quotes.
- -q, --query=<sql>
- Use a sql string to query the database with.
tracker3-status
Name
tracker3-status — Provide status and statistics on the data indexed
Synopsis
tracker3 status tracker3 status [[expression1]...] tracker3 status --stat [-a] [[expression1]...]
DESCRIPTION
Display the status of the current index and data set. A summary of recorded failures during file metadata indexing is also displayed.
Providing a search expression will list the full details of the recorded failures matching the filename.
With the --stat option, displays statistics about the RDF classes and how many of each exist for data set that has been indexed. For example, "10 Folders".
OPTIONS
- --stat[=expression]
- By default, only common and useful classes are shown, e.g. "nfo:Document" or "nfo:Folder", for a full set of statistics, see the --all option.
If one or more expression arguments is given, the statistics returned are filtered to only show information those RDF types matching expression (case folded and matching accented variants). The RDF classes are detailed by the Nepomuk otology specification. A list of possible classes matching expression, see tracker3 sparql -c.
- -a, --all
- Display statistics about ALL RDF classes that exist in the database. Without this option only the common RDF classes will be shown, for example "nfo:Document" and "nfo:FileDataObject".
This option is implied if search terms are provided to filter ALL possible statistics.
tracker3-tag
Name
tracker3-tag — Add, remove and list tags.
Synopsis
tracker3 tag FILE1 [FILE2 ...] [-l <limit>] [-o <offset>] [-r] tracker3 tag -t [[TAG1] [TAG2] ...] [-s] [-r] tracker3 tag -a <TAG> [-e <description>] tracker3 tag -d <TAG>
DESCRIPTION
List tags for local files or by the tag labels themselves if -t is used.
It’s also possible to manage tags with the -a and and -d options.
The FILE argument can be either a local path or a URI. It also does not have to be an absolute path.
OPTIONS
- -t, --list
- List all tags. Results include the number of files associated with that tag and the tag’s unique identifier. You can show the files associated with each tag by using --show-files.
The TAG arguments are optional. If no TAG argument is specified, all tags are listed. If one or more TAGs are given, either matching tags are listed (OR condition). For example, this will match any tags named either foo, bar or baz:
$ tracker3-tag -t foo bar baz
- -s, --show-files
- Show the files associated with each tag. This option is ONLY available WITH the --list option.
- -a, --add=TAG
- Add a tag with the name TAG. If no FILE arguments are specified, the tag is simply created (if it didn’talready exist) and no files are associated with it. Multiple FILE arguments can be specified.
- -d, --delete=TAG
- Delete a tag with the name TAG. If no FILE arguments are specified, the tag is deleted for ALL files. If FILE arguments are specified, only those files have the TAG deleted.
- -e, --description=STRING
- This option ONLY applies when using --add and provides a description to go with the tag label according to STRING.
- -l, --limit=N
- Limit search to N results. The default is 512.
- -o, --offset=N
- Offset the search results by N. For example, start at item number 10 in the results. The default is 0.
- -r, --and-operator
- Use AND operator for search terms instead of OR (the default). For example:
$ tracker3-tag -s -t sliff sloff
Should show files in the database that have both the sliff and sloff tags.