Connecting from Flatpak: Tracker SPARQL Library Reference Manual

## Connecting from Flatpak

Tracker SPARQL provides a portal for the Flatpak application sandboxing system. This lets you control which parts of a database each app can query.

The app's Flatpak manifest needs to specify which graph(s) the app will access. See the example app and the portal documentation to see how. No code changes are needed in the app, as `tracker_sparql_connection_bus_new`. will automatically try connect via the portal if it can't talk to the given D-Bus name directly.

Tracker SPARQL is included in the GNOME Flatpak SDK and runtime. If the app uses a different runtime, you may need to build Tracker SPARQL in the app manifest.

The app might use the Tracker Miner FS search index. Ideally this is done via the portal, using the search index maintained on the host. Since not all OSes ship tracker-miner-fs-3, we recommend that apps bundle it inside the Flatpak and connect to the bundled version as a fallback. See GNOME Music for an example of how to do this.