Re: [Tracker] datatype management in TrackerSparqlBuilder



On Thu, 2009-11-26 at 21:34 +0100, Roberto -MadBob- Guido wrote:
Little time ago
(
http://mail.gnome.org/archives/tracker-list/2009-November/msg00090.htm
l ) someone already moved some observation about limitations in
TrackerSparqlBuilder, and I'd like to revamp discussion and understand
how this interface to Tracker may be improved.

At the actual stage queries are built token by token, with specific
functions to append strings, numbers, dates and other datatypes
depending on the predicate. This is quite tedious since for each
statement a different (a priori known) function must be called, and the
task may be impossible to achieve if the query is dinamically built by
some external configuration (so: developer doesn't know which predicates
will be required, so no which datatype is the correct one to be used).

You can use the object_string method for all non-IRI literals such as
integers, date/time, booleans, and obviously strings. The methods
object_boolean, object_int64, object_date, and object_double are only
convenience methods, you don't need to use them if you don't want to.

For URIs/IRIs you need to use the object_iri method, however, I don't
think that this causes any issues.

JÃrg




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]