summaryrefslogtreecommitdiff
path: root/src/libtracker-sparql/tracker-resource.c
Commit message (Collapse)AuthorAgeFilesLines
* libtracker-sparql: delete TrackerResource elements one by onewip/carlosg/resource-deletesCarlos Garnacho2018-08-031-28/+17
| | | | | | | | | | | | | | | | | | Creating a single query for all values to delete can only work if all values have a match. As soon as a value is already missing, the query would just bail out as there's no real match. We want to delete every value individually regardless of other properties, so decompose the single delete into multiple individual deletes. Fixes "Unable to insert multiple values for subject..." warnings as the insertion queries would rely on single-valued properties being cleared beforehand. https://gitlab.gnome.org/GNOME/tracker/issues/28 Closes: #28
* Add support to TrackerResource for outputting metadata as JSON-LDsam/resource-jsonldSam Thursfield2018-07-151-0/+175
| | | | | This also adds `tracker extract -o json` to dump resources in JSON-LD, in anticipation of corresponding updates in tracker-miners.git.
* libtracker-sparql: Add tracker_resource_[add|set]_take_relation()Carlos Garnacho2017-07-111-0/+31
| | | | | These are C helper functions, so users may create trees of TrackerResources without having to manually unref all non-root ones.
* libtracker-sparql: Fix further introspection mistakesSam Thursfield2017-05-031-3/+4
| | | | | The gir-scanner doesn't actually run for these files at the moment (see bug#782091) which is why the mistakes didn't get caught until now.
* libtracker-sparql: Fix introspection mistakesSam Thursfield2017-04-121-1/+1
| | | | | The gir-scanner doesn't actually run for these files at the moment, so the mistakes didn't get caught until now.
* libtracker-sparql: Fix bad serialization of date/time valuesSam Thursfield2017-01-201-1/+1
| | | | | | | | | | | | | TrackerResource was creating bad SPARQL & Turtle from GDateTime values. If you saw this... GDBus.Error:org.freedesktop.Tracker1.SparqlError.Type: Not a ISO 8601 date string. Allowed form is [-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm] ...it's because in the arguments for g_date_time_format() I confused %S (seconds since the last minute) with %s (seconds since 1st January 1970). That's a lot of extra seconds.
* libtracker-sparql: Remove some unused variables from tracker-resource.cSam Thursfield2017-01-201-5/+0
|
* libtracker-sparql: Print resources referenced in cardinality>1 propertiesCarlos Garnacho2017-01-161-0/+26
| | | | | | | Those were not being printed, just referenced in the parent resource. Fixes properties like slo:location being lost on newly indexed photos. https://bugzilla.gnome.org/show_bug.cgi?id=776723
* libtracker-sparql: Fix sparql/turtle generation of builtin classesCarlos Garnacho2017-01-161-0/+25
| | | | | | | We don't need to generate sparql/turtle for builtin classes (eg. nmm:flash-on). https://bugzilla.gnome.org/show_bug.cgi?id=776723
* libtracker-sparql: Remove commentCarlos Garnacho2016-12-081-7/+0
| | | | | | | | It doesn't really apply. The DELETE DATA { pattern } query requires the exact given triples, and won't work on variables. As it's not nice or possible to query the current values just to perform a better looking DELETE DATA {} query, just stick to the DELETE {} WHERE {} one, and don't insinuate that we have a better option.
* libtracker-sparql: Add some braces around statementCarlos Garnacho2016-11-281-1/+2
| | | | Multiline statements get braces around.
* libtracker-sparql: Plug TrackerResource leaksCarlos Garnacho2016-11-281-0/+5
| | | | | The context is reused, so the list must be freed again after the second use.
* libtracker-sparql: Add TrackerResource/NamespaceManager to docsCarlos Garnacho2016-07-161-1/+252
| | | | And document the missing functions.
* Use TrackerResource instead of TrackerSparqlBuilder in all extractorswip/sam/resource-rebase-6Sam Thursfield2016-07-141-213/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a long time, all the Tracker extractors have manually constructed a SPARQL update command using TrackerSparqlBuilder to represent their output. This commit changes all of them to use the TrackerResource class instead, which makes the code a lot more concise and readable. This introduces some API breaks in the internal libtracker-extract library. This has been a private library since Tracker 0.16 or earlier, so it's fine. If the extractors only output SPARQL then they are only useful to people who are using a SPARQL store. Now we can output a serialization format like Turtle as well. This will hopefully make the extract modules useful outside of Tracker itself. I've tried to preserve the behaviour of the extractors as much as possible, but there are two things that are now handled differently: * nao:Tag resources are given a fixed URI based on the tag label, such as <urn:tag:My_Tag>. Previously they were inserted as blank nodes, so tracker-store would give them unique IDs like <urn:uuid:1234...> * All extractors created nco:Contact resources for content publishers, but previously some would assign fixed URIs based on the name <urn:contact:James%20Joyce>, while others would insert them as blank nodes so they would be assigned unique IDs like <urn:uuid:1234...>. Now, all extractors create nco:Contact resources with fixed URIs based on the content creator's name. https://bugzilla.gnome.org/show_bug.cgi?id=767472
* libtracker-sparql: Add TrackerResource classSam Thursfield2016-07-141-0/+1191
This provides a "resource-oriented" API for inserting and updating the database. Rather than having to generate SPARQL queries, you can use the TrackerResource abstraction to prepare information about a set of resources, then generate a SPARQL query automatically. TrackerResource can also serialize to Turtle directly. https://bugzilla.gnome.org/show_bug.cgi?id=767472