Re: [PATCH 2/2] tracker: Allow partial SPARQL queries in query()
- From: Lionel Landwerlin <lionel g landwerlin linux intel com>
- To: grilo-list gnome org
- Subject: Re: [PATCH 2/2] tracker: Allow partial SPARQL queries in query()
- Date: Fri, 21 Jan 2011 18:43:01 +0000
On Fri, 2011-01-21 at 17:03 +0100, Juan A. Suarez Romero wrote:
> Besides using a full query SPARQL sentence in the query() function, now
> users can also use a partial query, specifying only the sentence that
> will be used in the "WHERE" clause.
>
> Plugin will build the complete full query using the metadata keys, count
> and offset.
>
> Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
> ---
> src/tracker/grl-tracker.c | 41 ++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 40 insertions(+), 1 deletions(-)
>
> diff --git a/src/tracker/grl-tracker.c b/src/tracker/grl-tracker.c
> index 186bafd..f8fc44d 100644
> --- a/src/tracker/grl-tracker.c
> +++ b/src/tracker/grl-tracker.c
> @@ -69,6 +69,13 @@ enum {
>
> /* --- Other --- */
>
> +#define TRACKER_QUERY_REQUEST \
> + "SELECT rdf:type(?urn) %s " \
> + "WHERE { %s } " \
> + "ORDER BY DESC(nfo:fileLastModified(?urn)) " \
> + "OFFSET %i " \
> + "LIMIT %i"
> +
> #define TRACKER_SEARCH_REQUEST \
> "SELECT rdf:type(?urn) %s " \
> "WHERE " \
> @@ -778,13 +785,30 @@ grl_tracker_source_supported_keys (GrlMetadataSource *source)
> * WHERE { ?song a nmm:MusicPiece }
> * </programlisting>
> * </informalexample>
> + *
> + * Alternatively, we can use a partial SPARQL query: just specify the sentence
> + * in the WHERE part. In this case, "?urn" is the ontology concept to be used in
> + * the clause.
Really use only ?urn and nothing else !
Otherwise it's looks good.
Regards,
--
Lionel Landwerlin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]