summaryrefslogtreecommitdiff
path: root/src/libtracker-sparql
Commit message (Collapse)AuthorAgeFilesLines
...
* meson: Fix all hardcoded references to 1.0Sam Thursfield2017-09-221-3/+3
| | | | | In some places I had hardcoded '1.0' instead of honouring tracker_api_version variable. This is now fixed.
* libtracker-sparql: Document further new APICarlos Garnacho2017-08-071-2/+79
|
* build: Cleanup TRACKER_COMPILATION defines from c_argsCarlos Garnacho2017-07-191-3/+0
| | | | It is now defined globally, so can removed from specific targets.
* build: Unbreak meson buildCarlos Garnacho2017-07-191-1/+2
| | | | | | | | | | | | | The change in 1b31260292 added somewhat clumsy meson support. The C-side vapi is now required by the Vala-side vapi, but only the latter is included when building the rest of the libraries. Since we can't tell the build to ditch the vala vapi and include our merged/spiced up tracker-sparql-2.0.vapi file, add a dependency on the C vapi that we can add on the selected places. A side effect of including the unfixed vapis is that includes point to internal files, so make sure everything gets TRACKER_COMPILATION when building to circumvent it.
* libtracker-sparql: Fix tracker-sparql-2.0.vapi generationCarlos Garnacho2017-07-192-4/+10
| | | | | | It would be left partly including headers that must not be accessed directly. Also, ensure that we look for the C vapi file in srcdir for both meson and autotools.
* build: Add generated enumeration files to BUILT_SOURCESEmmanuele Bassi2017-07-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Dependency tracking in Automake is a side effect of compilation. This means two things: * headers are ignored when it comes to building dependencies, even when listed inside sources for a binary target * generated headers included inside source files are not used as a dependency until compilation of the source file completes successfully If binary target L depends on a source file C, and that source file includes a generated header H, there is no guarantee that the header H will be available by the time source file C is built, because the dependency is extracted from C itself, not from the list of sources. Additionally, any header H does not count towards the dependency resolution because headers are only used for ancillary features, like extracting tags. For this reason, Automake has `BUILT_SOURCES`. This is a bit of obscure corner of Automake that trips up many who are not practitioners of the Dark Arts. More information is available here: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Built-Sources-Example
* libtracker-sparql: Implement tracker_sparql_connection_get_namespace_manager()Carlos Garnacho2017-07-111-0/+17
| | | | | | This is implemented on direct connections and the generic backend. The TrackerNamespaceManager will be filled in from the internal ontologies, as read by the TrackerDataManager.
* libtracker-sparql: Add vapi file for the C portionsCarlos Garnacho2017-07-113-4/+113
| | | | | | Just like we do with girs, merge together the vapi for the C portions and the generated vapi for the vala bits. This allows using TrackerNamespaceManager and TrackerResource from vala code.
* libtracker-sparql: Deprecate TrackerSparqlBuilderCarlos Garnacho2017-07-111-0/+59
| | | | | It has been superseded by TrackerResource, it is encouraged for new development.
* libtracker-sparql: Fix horrible confusion with G_GINT64_FORMATCarlos Garnacho2017-07-111-5/+5
| | | | | The "d" is already implied there, not for us to add. Let's pretend this never happened...
* libtracker-sparql: Add tracker_resource_[add|set]_take_relation()Carlos Garnacho2017-07-112-0/+33
| | | | | These are C helper functions, so users may create trees of TrackerResources without having to manually unref all non-root ones.
* libtracker-sparql: Remove get_direct(_async|_finish)Carlos Garnacho2017-07-111-59/+0
| | | | | | Those functions have been deprecated for years and are being removed for 2.0. Use tracker_sparql_connection_get() and async variants instead, that will smartly use the direct connection underneath.
* meson: Rearrange dependencies until things compileSam Thursfield2017-07-031-1/+0
| | | | | | | | | | | | | | Targets far down the dependency chain were failing due to mysteriously missing symbols. The use of -Wl,--as-needed seemed to be triggering the issue. This only occured with new versions of Meson. Previously circular dependencies would be added recursively but this was removed with <https://github.com/mesonbuild/meson/pull/1545>. I'm not 100% sure how this fixes things, but I think that removing or at least reshuffling circular dependencies of libtracker-sparql means that libraries are passed to the linker in "correct" order.
* libtracker-sparql: Make TrackerNotifier check GraphUpdated from the domainCarlos Garnacho2017-06-291-1/+13
| | | | It must listen to the signal from the right tracker-store instance.
* libtracker-sparql: Use TrackerDomainOntology on tracker_sparql_connection_get()Carlos Garnacho2017-06-291-4/+7
| | | | | | | Add a global tracker_sparql_connection_set_domain() call that allows setting domain ontology that the client shall use. This only affects the connection obtained through tracker_sparql_connection_get(), other constructors may have different settings.
* libtracker-sparql: Add tracker_sparql_connection_local_new(_async) methodsCarlos Garnacho2017-06-291-0/+27
| | | | These calls make private sparql databases available to applications.
* autotools: Build and merge C/Vala girs in libtracker-sparqlCarlos Garnacho2017-06-281-29/+13
| | | | | | | | Following the meson changes, build 2 separate static libs, generate introspection stuff for those, and put them together in src/libtracker-sparql-backend. https://bugzilla.gnome.org/show_bug.cgi?id=782091
* libtracker-sparql: Drop needless typedefCarlos Garnacho2017-06-281-5/+0
| | | | | | | We don't need defining TrackerSparqlBuilder here, and it causes it to get picked up twice in C and Vala girs. https://bugzilla.gnome.org/show_bug.cgi?id=782091
* Fix missing introspection data for libtracker-sparql (when using Meson)Sam Thursfield2017-06-281-35/+36
| | | | | | | | | | | | | | | | | Up til now only the Tracker.SparqlConnection and Tracker.SparqlBuilder resources were introspectable. This is because we only used the introspection output from `valac`, but other bits of libtracker-sparql have since been added that are written in C. There seems to be no way to generate a single .gir for a combined C and Vala codebase, so instead I have written a simple `g-ir-merge` script which can combine two different namespaces into a single .gir. This is currently tested and working with the Meson build instructions. It would be possible to implement this for the Autotools build instructions as well. https://bugzilla.gnome.org/show_bug.cgi?id=782091
* Fixes to Meson build systemSam Thursfield2017-06-241-1/+1
| | | | | | | | | | First, instead of using add_global_arguments() we now use a variable to set global compiler args. It turns out that add_global_arguments() is broken if you ever want to include your project as a subproject of something else. Second, dependencies weren't being specified correctly. These are hopefully now fixed to avoid any more random build failures.
* distcheck fixesCarlos Garnacho2017-05-231-0/+1
| | | | Hopefully among the last ones!
* Distribute meson.build files in tarballs generated by AutotoolsSam Thursfield2017-05-221-1/+2
| | | | | | | This is useful for people who are not building from Git but still want to avoid Autotools. See: https://mail.gnome.org/archives/desktop-devel-list/2017-April/msg00091.html
* Meson build instructions for TrackerSam Thursfield2017-05-222-0/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See <http://mesonbuild.com/> for information about Meson. Remaining issues: * There's no `make dist` equivalent. We currently produce release tarballs containing the output files of the Vala compiler. We need to think through whether we can stop doing that. Shipping the generated .c files does make the Vala preprocessor useless so it would be good if we can stop. * The Firefox, Thunderbird, Evolution and Nautilus plugins are not built * https://github.com/mesonbuild/meson/issues/671 -- means we can't depend on tracker_common_dep in most places and have to manually set link_with, include_directories and sources instead. * https://github.com/mesonbuild/meson/issues/1469 -- without this we have to install generated Vala headers using a script * https://github.com/mesonbuild/meson/issues/1229 -- means adding the #include guard to libtracker-sparql/tracker-generated-no-checks.h is a pain * The test suite has some spurious failures. Here's a rough speed comparison. Meson: time sh -c 'meson .. --prefix=/opt/tracker-meson -D bash_completion=/opt/tracker-meson/share/bash-completion -Dsystemd_user_services=/opt/tracker-meson/lib/systemd/user -Ddbus_services=/opt/tracker-meson/share/dbus-1/services && ninja-build -j 4 && ninja-build install' real 1m8.194s user 2m16.962s sys 0m20.532s Autotools: time sh -c './configure --prefix=/opt/tracker-autotools --with-bash-completion-dir=/opt/tracker-autotools/share/bash-completion --with-session-bus-services-dir=/opt/tracker-autotools/share/dbus-1/services --disable-nautilus-extension && make -j 4 && make install' real 2m37.750s user 4m37.214s sys 0m54.806s Plus 30+ seconds of ./autogen.sh first. Note that Meson builds may fail if your source tree has generated files from an Autotools build in there. If you see errors about duplicate definitions, first try cleaning your source tree (use `git clean -dfx`, but make sure you commit any work first!!)
* libtracker-sparql: Fix further introspection mistakesSam Thursfield2017-05-033-5/+6
| | | | | 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-122-4/+4
| | | | | The gir-scanner doesn't actually run for these files at the moment, so the mistakes didn't get caught until now.
* libtracker-sparql: Add osinfo ontology to the default TrackerNamespaceCarlos Garnacho2017-04-062-0/+2
| | | | | | Otherwise namespace lookups will come out NULL. https://bugzilla.gnome.org/show_bug.cgi?id=780968
* Remove unused Vala depSam Thursfield2017-03-301-1/+1
|
* libtracker-sparql: Use correct printf format specifiers for gint64Sam Thursfield2017-03-211-6/+7
| | | | | Sadly the correct format is different on 32bit and 64bit systems so we have to use the unweildy G_GINT64_FORMAT macro.
* 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: Plug TrackerNotifier leakCarlos Garnacho2016-11-281-0/+2
| | | | The GString used to build the query is being leaked.
* libtracker-sparql: Distcheck fixCarlos Garnacho2016-11-211-0/+2
|
* libtracker-sparql: Use internal headersCarlos Garnacho2016-11-202-2/+1
| | | | | That's not guaranteed to be there yet at compile time, so it randomly breaks build.
* libtracker-sparql: Add TrackerNotifier to subscribe to change notificationsCarlos Garnacho2016-11-206-2/+1167
| | | | | | | | | | | | | | | This object abstracts GraphUpdated, and is now the recommended method to receive notifications upon changes in Tracker data. After creation, the caller may connect to the ::events signal. This signal packs all events received in one go, so as to avoid signal emission overhead on mass changes. The TrackerNotifier behavior can be slightly modified through the flags passed during instantiation. Eg. it can be requested to query some data (urn, location) upfront, although the API is tracker:id centric otherwise. https://bugzilla.gnome.org/show_bug.cgi?id=773028
* Add libtracker-remoteCarlos Garnacho2016-11-201-0/+10
| | | | | | | | | | | | | | | This is yet another libtracker-sparql backend to connect to remote HTTP SPARQL endpoints. Connections are made explicitly through the tracker_sparql_connection_remote_new() API call, passing a server to connect to. This commit introduces support for application/sparql-results+json as specified in https://www.w3.org/TR/sparql11-results-json/. XML format will be handled next. Just readonly queries are supported, and provided there's no authentication schemes. https://bugzilla.gnome.org/show_bug.cgi?id=773031
* tracker-extract: Use date as album uri identifierMarinus Schraal2016-11-152-2/+25
| | | | | | | | | Use the album creation date as part of the album uri identifier if available. This should make the separation of similar named albums even better. Also port mp3 & gstreamer to use the resource helper functon for exctracting album disc data. https://bugzilla.gnome.org/show_bug.cgi?id=773697
* libtracker-sparql: Avoid C++ keyword in variableCarlos Garnacho2016-10-161-1/+1
| | | | | | | "namespace" is a C++ keyword, better to avoid in public headers, spotted by Christoph Cullmann <cullmann@kde.org>. https://bugzilla.gnome.org/show_bug.cgi?id=772979
* tracker-sparql: Drop use of 'Deprecated'Zeeshan Ali2016-10-101-2/+2
| | | | | | Otherwise, valac spits warnings for each 'Deprecated' line when building tracker-sparql and any Vala code that uses tracker-sparql.
* Override Sparql.Connection.update_array_async() with correct return-typeMatthias Berndt2016-10-041-1/+1
| | | | | | | | | "Error" is an unqualified identifier and can thus refer to different types in different contexts. In the context of tracker-connection.vala it refers to Tracker.Sparql.Error, in the context of tracker-bus.vala it refers to GLib.Error. https://bugzilla.gnome.org/show_bug.cgi?id=772381
* libtracker-sparql: Make tracker URI GType privateCarlos Garnacho2016-07-172-2/+0
| | | | | We don't expose it anywhere in API, may be hidden as an implementation detail.
* libtracker-sparql: Add TrackerResource/NamespaceManager to docsCarlos Garnacho2016-07-162-3/+254
| | | | And document the missing functions.
* libtracker-sparql: Fix small typoCarlos Garnacho2016-07-161-1/+1
| | | | Quite harmless, but triggers gtk-doc warnings.
* 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-144-0/+1277
| | | | | | | | | | | 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
* libtracker-sparql: Add TrackerNamespaceManagerSam Thursfield2016-07-143-0/+384
| | | | | | | | | | This will keep track of a set of namespaces and their prefixes. Then, when we are serializing a resource, we can use it. This is separate from the Namespace and Ontologies classes in libtracker-data. They may be able to make use of it though. https://bugzilla.gnome.org/show_bug.cgi?id=767472