summaryrefslogtreecommitdiff
path: root/src/libtracker-sparql/tracker-serializer.c
Commit message (Collapse)AuthorAgeFilesLines
* libtracker-sparql: Integrate JSON-LD serializers and deserializers in APICarlos Garnacho2023-01-101-0/+4
| | | | | | Add a new TRACKER_RDF_FORMAT_JSON_LD TrackerRdfFormat enum value, and use the serializer/deserializer objects for those, so that this new value is accepted in all API that takes this enum.
* libtracker-sparql: Pass namespace manager explicitly to TrackerSerializerCarlos Garnacho2022-07-111-1/+34
| | | | | | | | Implementations of this object poked the given cursor's connection in order to get a TrackerNamespaceManager. This usually works with cursors from queries, but we want to use serializers with data not necessarily coming from a connection, so pass explicitly the TrackerNamespaceManager to use during serialization.
* Revert "libtracker-sparql: Ensure to register a single instance of serializers"Carlos Garnacho2022-04-241-12/+4
| | | | | | | | Since all internal tracker library interaction stays within library code and is no longer done on modules for the HTTP connection/endpoint, we no longer need these hacks to ensure single registration of types. This reverts commit 787c4ff6e2132559545475b9dae31eebbe49ff7a.
* libtracker-sparql: Support serialization to Trig formatCarlos Garnacho2022-02-041-0/+6
| | | | | | This format is similar to turtle, but allows keeping graph information. It might be more convenient for exporting/importing sometimes, so support serializing to this format.
* libtracker-sparql: Fix refcount management of a serializer's cursorCarlos Garnacho2022-02-041-1/+1
| | | | | | The serializer is not taking a ref on the related cursor, but dropping one on finalize. Make it take a ref during its lifetime on the cursor, and change the only user so it doesn't account for this oddity.
* libtracker-sparql: Add internal Turtle format TrackerSerializerCarlos Garnacho2022-02-041-0/+6
| | | | | | This serializer takes a TrackerSparqlCursor with 3 columns (subject, predicate, object) and serializes it into Turtle format. Unused at the moment.
* libtracker-sparql: Ensure to register a single instance of serializersCarlos Garnacho2022-01-101-2/+6
| | | | | | | | | | | | | | | | | | | For now, the private TrackerSerializer API was only used in the TrackerEndpointHttp object, which is compiled as a loadable module since we support linking with soup 2.x and 3.x simultaneously. Now that we are introducing usage of this private API from other places in code, we risk getting the dreaded "type already registered" errors from GType, since each of libtracker-sparql and the soup modules will try to register their own. Make creation of serializers more lenient wrt the GType lookup, so there's no double registration of the same type, and ensure these GTypes are initialized from libtracker-sparql so there's no confusion about who comes first. This is yet another braindead hack about libsoup loadable modules that can be removed when we can pick one of them at build time.
* libtracker-sparql: Hook XML/JSON serializers to constructorCarlos Garnacho2020-12-131-1/+19
| | | | So they can be used just giving the expected TrackerSerializerFormat.
* libtracker-sparql: Add private/abstract TrackerSerializer objectCarlos Garnacho2020-12-131-0/+140
This object is a subclass of GInputStream that takes a SPARQL cursor on construction. It is meant to handle serialization of SPARQL results into text formats.