cli: Standardise output formats
Different commands have different format options in Tracker 3, for example...
-
tracker3 search
uses a custom, coloured format optimised for human readability -
tracker3 export
uses TriG or Turtle, optimised for fast output -
tracker3 extract
offers Turtle, JSON-LD or a SPARQL update query, using-o
/--output-format
flag - ...
We should allow user to choose the output format for all CLI commands, and should support Turtle and JSON-LD at minimum. Others (e.g. tracker search
) may also keep the existing format.
We may want to add APIs in Tracker itself to make this simpler. A function to render a TrackerSparqlCursor as Turtle would go a long way. https://gitlab.com/drobilla/serd is one option to implement this.