| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Things like rdfs:label and rdfs:comment that are not tracker through the
TrackerOntology and are single-valued may result in errors if there's
changes on those.
Handle those better by replacing the value instead of trying to insert
over it.
|
|
|
|
|
| |
We rely on those being casted by the upper layers, it seems better
to work with the correct types all through.
|
|
|
|
|
|
|
| |
It's better not to rely on internal casts to/from strings working (may
be troublesome with e.g. rounding with certain doubles). Transfer the
types obtained to the internal statement, so those reach the external
service.
|
|
|
|
|
| |
Otherwise we may potentially overwrite the GError on the next
iteration, besides it's a broken state already.
|
|
|
|
|
|
|
|
|
|
|
| |
Look up the parameters used within the service graph pattern, and
ensure those are proxied to the tracker_services virtual table via
their valuename/value column pairs.
This pieces everything together in supporting ~var bindings within
SERVICE{} clauses.
Fixes: https://gitlab.gnome.org/GNOME/tracker/-/issues/200
|
|
|
|
|
|
|
|
|
|
| |
Support a total of 50 parameters (in name/value column pairs), we
use those as input parameters to the virtual table. With this
proxying, the upper SQL query may then do likewise via these
hidden columns.
This will allow ~var parameters to work within SERVICE{} graph
patterns.
|
|
|
|
| |
Move it to a separate function.
|
|
|
|
| |
So it's easier to extend with extra columns
|
|
|
|
|
|
|
|
|
| |
We must escape the correct ' or " character for SQL strings, mismatches
results in the character being doubly printed. Pass the escape character
as an argument to the escaping function, and use " in all places, as it
is the convention.
Fixes: https://gitlab.gnome.org/GNOME/tracker/-/issues/198
|
|
|
|
|
| |
This is needed so we continue to get notifications for
data created by the miner-fs.
|
|\
| |
| |
| |
| | |
libtracker-sparql: Map GError codes to DBus error codes
See merge request GNOME/tracker!235
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
DBus errors before:
gi.repository.GLib.GError: tracker-sparql-error-quark: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._tracker_2dsparql_2derror_2dquark.Code0: Parser error at byte 0: Expected Query (0)
DBus errors now:
gi.repository.GLib.GError: tracker-sparql-error-quark: GDBus.Error:org.freedesktop.Tracker.Error.Parse: Parser error at byte 0: Expected Query (0)
|
|/
|
|
|
|
|
|
| |
Queries weren't being printed as I added the trace in the wrong place.
It's intentional that even queries with syntax errors are logged, this
is useful because the error sent back to the client doesn't contain
the original query.
|
|\
| |
| |
| |
| | |
Remove unused ontologies and utils/ontology tools
See merge request GNOME/tracker!218
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
All of these are unused within tracker-miners, and as far as we know
they are also unused in GNOME.
Each ontology has a cost on database size and on time to create a
new database, so it's good to limit these as much as we can.
Alternatives:
- nid3: use nmm ontology
- ncal, scal: use evolution-data-server as GNOME Calendar does
- mlo: use slo ontology
|
|\ \
| | |
| | |
| | |
| | | |
Raise an error if no ontology path is given
See merge request GNOME/tracker!232
|
| | |
| | |
| | |
| | |
| | |
| | | |
Since a0efd1972b122d0a2 it was possible to crash by passing a NULL
ontology path to tracker_sparql_connection_new(). Now we raise an
error instead.
|
| | |
| | |
| | |
| | |
| | |
| | | |
The libtracker-data error domain is internal so we need to translate
any errors to the libtracker-sparql domain before returning them to the
user.
|
|\ \ \
| |_|/
|/| |
| | |
| | | |
Logging and test cleanups
See merge request GNOME/tracker!225
|
| | |
| | |
| | |
| | | |
This outputs all queries to the console.
|
| | | |
|
| | | |
|
| | | |
|
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Getting a NULL subject in TriplesSameSubject handling is possible
in queries like:
DELETE {
?b a rdfs:Resource
} WHERE {
OPTIONAL { ?a nie:isStoredAs ?b }
}
If ?b didn't happen to get resolved to anything. In those cases,
the SPARQL update definition says:
If any solution produces a triple containing an unbound variable
or an illegal RDF construct, such as a literal in a subject or
predicate position, then that triple is not included when processing
the operation: INSERT will not instantiate new data in the output
graph, and DELETE will not remove anything.
So we shouldn't assert here, and we should let the operation be
optimized away. The latter is already handled, so remove the asserts.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When printing to SPARQL we would only accept graph URIs in their full
form. Allow expanding prefixes, so it is possible to pass graphs with
a prefix (as long as it is covered by the namespace manager).
This allows the use of eg. "tracker:Documents", instead of
"https://tracker.api.gnome.org/.../Documents".
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When expanding a prefixed form (e.g. nie:url) into a full blown URL,
the anchor point would be set around the colon character, but we on
one hand were 1 char short when using the prefix for comparisons
(e.g. "ni" instead of "nie"), and still paste the colon character
when expanding the URI.
Move this around so the prefix has one char more, and the suffix one
char less.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If different relations are set on different TrackerResources with
the same uri, only the first would be found at the same of printing
the resulting sparql/json/ttl output. This may miss properties being
set on the other resources that are skipped.
This is a case happening in the nie:DataObject/nie:InformationElement
split, as tracker-extract will receive a TrackerResource to be used
for the nie:InformationElement, but nie:hasHash and nie:dataSource
need to be set on the nie:DataObject at places isolated from each
other.
The solution to that is have those places create an intermediate
TrackerResource for the nie:DataObject each, and set the desired
properties.
In order to have all those properties properly printed, we don't
need to skip resources based on their identifier URI, detecting
cycles is still necessary. This may break if several of these
resources where to do tracker_resource_set_*() on the very same
property, and all expected the property to be cleared. Let's deem
this much of a corner case to justify larger refactors.
|
| |
| |
| |
| |
| | |
That should be equivalent to poking an empty graph, but we instead
trust the table exists and make the query fail.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It is already known that FTS5 external content tables are extremely
picky about their index consistenty. It seems another situation to
avoid is clearing of FTS rows that are already empty, that seems
enough to have the FTS table deem the index inconsistent.
Found via tracker-miner tests along the DataObject/InformationElement
split.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Our TrackerNotifier machinery informs of changes per rdf:type, the
logic is as follows:
- If the property being added is "<x> rdf:type <class>" and the
class matches the one being notified, this is a CREATE event
- Anything else (incl rdf:type additions of other classes) is just
an "update" to the class being notified.
We were looking the class from the wrong property, thus failed to
find a class, thus everything were updates. It is the object holding
the class, not the predicate.
The functional test seemed to just follow along, fix the expected
results, as we now do get CREATE events as expected.
|
|/
|
|
|
|
|
|
|
|
| |
Commit 542e1254e4f changed datetime storage so we don't resort to
tricks with doubles to store sub-second precision. The code retrieving
old values for INSERT/UPDATE handling was missed, leading to warnings
trying to cast the contained string to a double.
Dates are either unix timestamps (ints) or iso8601 dates (strings),
deal properly with the latter.
|
|\
| |
| |
| |
| | |
Various cleanups and improvements to tracker-data-update.c
See merge request GNOME/tracker!230
|
| |
| |
| |
| |
| | |
Some of these are being called from different places, add separate functions
for this.
|
| |
| |
| |
| | |
This was missed in the parallel-installable branch.
|
| | |
|
| |
| |
| |
| | |
If no database path is passed, create an in-memory database.
|
| |
| |
| |
| |
| |
| | |
It seems we can rely better on our own ontology definition, than the
RDF we are being fed. Also makes it unnecessary to expose some
tracker-data-update.c guts.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Converting it to a GValue at the top of our updates handling may
slightly break for properties that have superproperties of different
types.
A practical case, nmm:performer can store nmm:Artist resources, but
is a subproperty of dc:contributor, which can store strings.
Converting to a GValue with the "resource" type will look up a
resource ID, so the superproperty would contain an integer matching
the ID of the resource, instead of its URI.
To behave better in these situations, pass the GBytes as is further
down, and convert it to a GValue according to the (super)property
being currently handled. This results URIs being properly casted to
strings in this case.
|
| |
| |
| |
| |
| | |
Instead of fetching all values, and deleting those one by one, we can flag
the operation so that all values are deleted at once.
|
| |
| |
| |
| |
| |
| | |
This is a remaining of the extra "*:graph" columns in 2.x databases.
The bound value was set to an index that is unused, so this is dead
code.
|
| |
| |
| |
| |
| |
| |
| | |
It's saves little time to do a "direct delete" when the queue is
actually empty and ready for processing it directly too. Now that
the fallback here are fixed, just queue the operation like
everywhere else.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If we enter the paths where a delete is queued together with other
updates. The GValue being passed was trusted to exist, although it
is implicitly deleted early in value_set_remove_value().
Keep a copy of the GValue and use it to pass it along to
superproperties handling.
|
| |
| |
| |
| |
| |
| |
| | |
The SPARQL specs don't define "update" operations, we only have
this for our INSERT OR REPLACE syntax extension. Make it less
of a full blown operation, and more ad-hoc to fit its single
usecase.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
| |
According to https://www.w3.org/TR/sparql11-query/#grammarBNodes:
Blank node labels are scoped to the SPARQL Request String in which
they occur. Different uses of the same blank node label in a request
string refer to the same blank node.
Scope correctly blank node labels to the full update string, instead
of each InsertClause within.
|
|\
| |
| |
| |
| |
| |
| | |
Rework debug logging for 3.0
Closes #178
See merge request GNOME/tracker!219
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Users should now use G_MESSAGES_DEBUG=Tracker to see debug messages
on the console.
The TRACKER_VERBOSITY only worked if tracker_log_init() had been called,
which can't be done when libtracker-sparql is being used from an
application outside of Tracker.
|
| | |
|