Documentation
This page is to direct developers to documentation that they would find helpful when developing their application to make use of Tracker technologies. This page is still being written, so some of this information is not yet available. This page is for Tracker > 0.6 only (a lot of the principles and documentation here do not apply to 0.6.x).
What can I do?
APIs
There are two approaches to Tracker:
- Application developers interested on querying the data in the store (and maybe updating few bits there)
- Platform developers interested on extending tracker adding new sources of information (miners) or supporting for new file formats (extractors)
Everything in tracker is built around a common well-defined schema called ontology so in both cases is worthy to take a look to this schema.
For data querying and updating see:
libtracker-sparql: GObject-oriented library to access tracker data.
libtracker-client (deprecated in 0.9): Mostly a wrapper of the dbus API. Not up-to-date.
Tracker is a daemon running in DBus and can be used directly from there (not recommended):
Tracker DBus API: Description of objects/interfaces/methods in DBus
To write new miners take a look to:
libtracker-common: Common basic functions abstracting the platform (date conversions and so on)
libtracker-miner: Base classes with the basic functionality for miners and other common code. Write a miner inheriting from those classes and implementing just the specific functionality.
If the miner wants to access an online source (e.g. Twitter), it needs to be associated with an account:
To add support new file types (for files in the filesystem), write an extractor plugin for it:
libtracker-extract: Library with the basic extractor module API and other common code for extractors like string escaping or XMP manipulation.
For the ontology which describes how the data is related see (common for all the previous components):
API and ontology changes between major releases
Ontologies
SPARQL
Tracker uses the W3C standard query language SPARQL for Queries and Updates. To run queries in SPARQL you need to know the query language itself and the ontology. In both cases it is fairly easy to get the idea following examples.
Supported SPARQL Features and Extensions: Tracker specific functions that can be used in the SPARQL queries.
Examples
Contributing
Related projects: other projects interacting or extending tracker
How Do Things Work?
Client Side
How to write a very simple client from scratch (deprecated, use libtracker-sparql instead)
How to write a client using D-Bus (deprecated, use libtracker-sparql instead)
Inserting data: how transactions are handled and how to do it sync/asynchronously
Inserting data using the replace extension: how to use Tracker's INSERT OR REPLACE extension to its SPARQL Update support
Busy handling (for the Store, i.e. while replying a journal)
Server Side
Write-back capability (writing data back to files)