Re: [Tracker] Basic Reasoning
- From: Martyn Russell <martyn lanedo com>
- To: Ivan Frade <ivan frade gmail com>
- Cc: Tracker mailing list <tracker-list gnome org>
- Subject: Re: [Tracker] Basic Reasoning
- Date: Thu, 13 Jun 2013 11:02:08 +0100
On 13/06/13 01:13, Ivan Frade wrote:
Hi,
Hi,
To be more precise, Tracker can solve queries much more complicated than
those... but you need to be specific on the properties.
For example "Give me the title property of all instances of class Music,
that have an artist [property linking to an artist instance] with name
"Metallica".
Indeed, if you want to see an example of this, from the console, run
tracker-needle:
$ export TRACKER_VERBOSITY=3
$ export G_MESSAGES_DEBUG=all
$ tracker-needle
...
You will see queries like this for music (which can be reasonably complex):
"""
SELECT ?urn nie:url(?urn) tracker:coalesce(nie:title(?urn),
nfo:fileName(?urn)) fn:string-join((?performer, ?album), " - ")
nfo:duration(?urn) nie:url(?urn) WHERE {
{
?urn nmm:musicAlbum ?match
} UNION {
?urn nmm:performer ?match
} UNION {
?urn a nfo:Audio .
?match a nfo:Audio
FILTER (?urn = ?match)
}
{
?match fts:match "love"
} UNION {
?match nao:hasTag ?tag .
FILTER (fn:contains (fn:lower-case
(nao:prefLabel(?tag)), "love"))
} .
?urn nmm:performer [ nmm:artistName ?performer ] ;
nmm:musicAlbum [ nie:title ?album ] ;
nie:url ?tooltip .
} ORDER BY DESC(nfo:fileLastModified(?urn)) ASC(nie:title(?urn)) OFFSET
0 LIMIT 500
"""
--
Regards,
Martyn
Founder and CEO of Lanedo GmbH.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]