summaryrefslogtreecommitdiff
path: root/docs/manpages
diff options
context:
space:
mode:
authorMartyn Russell <martyn@imendio.com>2009-07-05 13:24:15 +0100
committerMartyn Russell <martyn@imendio.com>2009-07-05 13:24:15 +0100
commit7fa558d3fb44e18a24306b5aa2328d6824ee4ba1 (patch)
treece7426b686772ac041619a6134241a651e558ed3 /docs/manpages
parente77a6ae9b60f3212233af1618ad2ecba8937fd4e (diff)
downloadtracker-7fa558d3fb44e18a24306b5aa2328d6824ee4ba1.tar.gz
Added tracker-sparql man page
Diffstat (limited to 'docs/manpages')
-rw-r--r--docs/manpages/Makefile.am1
-rw-r--r--docs/manpages/tracker-sparql.1124
2 files changed, 125 insertions, 0 deletions
diff --git a/docs/manpages/Makefile.am b/docs/manpages/Makefile.am
index 498963b07..2dbe4ddeb 100644
--- a/docs/manpages/Makefile.am
+++ b/docs/manpages/Makefile.am
@@ -17,6 +17,7 @@ man_MANS = \
tracker-search.1 \
tracker-stats.1 \
tracker-store.1 \
+ tracker-sparql.1 \
tracker-tag.1 \
tracker-status.1 \
tracker.cfg.5 \
diff --git a/docs/manpages/tracker-sparql.1 b/docs/manpages/tracker-sparql.1
new file mode 100644
index 000000000..f62db4c02
--- /dev/null
+++ b/docs/manpages/tracker-sparql.1
@@ -0,0 +1,124 @@
+.TH tracker-sparql 1 "July 2009" GNU "User Commands"
+
+.SH NAME
+tracker-sparql \- Use SparQL to query the Tracker databases.
+
+.SH SYNOPSYS
+.B tracker-sparql [-p <path> | -q <query>]
+
+.SH DESCRIPTION
+.B tracker-sparql
+Allows the caller to run an RDF SparQL query on the Tracker database.
+This can be done two ways. Either by providing a path to a file with
+the query or by providing a string with the query on the command line.
+
+.SH EXAMPLES
+.TP
+List all classes
+
+.BR
+$ tracker-sparql -q "SELECT ?cl WHERE { ?cl a rdfs:Class }"
+
+.TP
+List all properties for the Resources class
+
+.BR
+.NF
+$ tracker-sparql -q "SELECT ?prop WHERE {
+ ?prop a rdf:Property ;
+ rdfs:domain <http://www.w3.org/2000/01/rdf-schema#Resource>
+ }"
+.FI
+
+.TP
+List all class namespace prefixes
+
+.BR
+.NF
+$ tracker-sparql -q "SELECT ?prefix ?ns WHERE {
+ ?ns a tracker:Namespace ;
+ tracker:prefix ?prefix
+ }"
+.FI
+
+.TP
+List all music files
+
+.BR
+$ tracker-sparql -q "SELECT ?song WHERE { ?song a nmm:MusicPiece }"
+
+.TP
+List all music albums
+
+.BR
+.NF
+$ tracker-sparql -q "SELECT ?album ?title COUNT(?song)
+ AS songs
+ SUM(?length) AS totallength
+ WHERE {
+ ?album a nmm:MusicAlbum ;
+ nie:title ?title .
+ ?song nmm:musicAlbum ?album ;
+ nmm:length ?length
+ } GROUP BY ?album"
+.FI
+
+.TP
+List all music from a particular artist
+
+.BR
+.NF
+$ tracker-sparql -q "SELECT ?song ?title WHERE {
+ ?song nmm:performer [ nmm:artistName 'Artist Name' ] ;
+ nie:title ?title
+ }"
+.FI
+
+.TP
+Set the played count for a song
+
+.BR
+.NF
+$ tracker-sparql -u -q "DELETE {
+ <file:///home/user/Music/song.mp3> nie:usageCounter ?count
+ } WHERE {
+ <file:///home/user/Music/song.mp3> nie:usageCounter ?count
+ } INSERT {
+ <file:///home/user/Music/song.mp3> nie:usageCounter 42
+ }"
+.FI
+
+.TP
+List all image files
+
+.BR
+$ tracker-sparql -q "SELECT ?image WHERE { ?image a nfo:Image }"
+
+.TP
+List all image files with a specific tag
+
+.BR
+.NF
+$ tracker-sparql -q "SELECT ?image WHERE {
+ ?image a nfo:Image ;
+ nao:hasTag [ nao:prefLabel 'tag' ]
+ }"
+.FI
+
+.TP
+List all image files created on a specific month and order by date
+
+.BR
+.NF
+$ tracker-sparql -q "SELECT ?image ?date WHERE {
+ ?image a nfo:Image ;
+ nie:contentCreated ?date .
+ FILTER (?date >= '2008-07-01T00:00:00' &&
+ ?date < '2008-08-01T00:00:00')
+ } ORDER BY ?date"
+.FI
+
+.SH SEE ALSO
+.BR tracker-store (1)
+.TP
+.BR http://www.w3.org/TR/rdf-sparql-query/