Volumes

List all volumes

SELECT ?v tracker:isMounted(?v)
WHERE {
  ?v a tracker:Volume
}

List all volumes with mount point

SELECT ?v nie:url(?m) tracker:isMounted(?v)
WHERE {
  ?v a tracker:Volume ;
     tracker:mountPoint ?m
}

List all removable non-optical volumes

SELECT ?v nie:url(?m) tracker:isMounted(?v)
WHERE {
  ?v a tracker:Volume ;
     tracker:mountPoint ?m ;
     tracker:isRemovable true ;
     tracker:isOptical false
}

List all removable+optical volumes

SELECT ?v nie:url(?m) tracker:isMounted(?v)
WHERE {
  ?v a tracker:Volume ;
     tracker:mountPoint ?m ;
     tracker:isOptical true
}

List all non-removable non-optical volumes

SELECT ?v nie:url(?m) tracker:isMounted(?v)
WHERE {
  ?v a tracker:Volume ;
     tracker:mountPoint ?m ;
     tracker:isRemovable false
}

List currently mounted volumes

SELECT ?v nie:url(?m)
WHERE {
  ?v a tracker:Volume ;
     tracker:mountPoint ?m ;
     tracker:isMounted true
}

List volumes unmounted BEFORE a date

SELECT ?o nie:url(?m) ?z
WHERE {
  ?o a tracker:Volume ;
     tracker:mountPoint ?m ;
     tracker:isMounted false ;
     tracker:unmountDate ?z .
  FILTER (?z < "%Y-%m-%dT%H:%M:%S%z")
}

List all files and directories inside the volume mounted in a given path

SELECT nie:url(?u)
WHERE {
  ?v a tracker:Volume ;
     tracker:mountPoint ?m .
  ?m a nfo:Folder ;
     nie:url 'file:///media/volume' .
  ?u a nfo:FileDataObject ;
     nie:dataSource ?v .
}

Projects/Tracker/Documentation/Examples/SPARQL/Volumes (last edited 2013-11-25 12:54:22 by WilliamJonMcCann)