Remembering downloads via Nepomuk


This is a quick one, mostly introducing a little piece of API that hit KDE’s trunk recently: Nepomuk::Utils::createCopyEvent and Nepomuk::Utils::finishCopyEvent. The idea is simple and has been mentioned many times: when downloading a file we want to know where it came from. In Nepomuk this is done via exactly that method. This has already been integrated in KParts, meaning that files downloaded from Konqueror will have metadata describing the source.

So if your application downloads files from the internet and saves them locally please call the appropriate Nepomuk methods. And to avoid any linkage probems beforehand: you need to link your app to nepomukutils.

If you are not interested in Nepomuk internals you may stop reading now because here comes an example of some RDF data created by the mentioned methods:

<nepomuk:/res/961ed23a-1417-412d-b7c0-94f736ec28bf> a nfo:FileDataObject ;
   nie:url <file:///home/trueg/The-Simpsons-the-simpsons-35449_800_600.jpg> ;
   ndo:copiedFrom <nepomuk:/res/2e1b7b8e-cf0d-4c35-9ab8-171bf835d142> .

<nepomuk:/res/2e1b7b8e-cf0d-4c35-9ab8-171bf835d142> a nfo:RemoteDataObject ;
   nie:url <http://images.fanpop.com/images/image_uploads/The-Simpsons....jpg> .

<nepomuk:/res/5d9e8a27-764a-4ecf-b7ab-002b09ebc803> a ndo:DownloadEvent ;
   nuao:involves <nepomuk:/res/961ed23a-1417-412d-b7c0-94f736ec28bf> ;
   nuao:start "2010-09-21T09:25:52.07Z"^^xsd:dateTime ;
   ndo:referrer <nepomuk:/res/167d2d88-db6a-449e-8024-4be6328a707e> .

<nepomuk:/res/167d2d88-db6a-449e-8024-4be6328a707e> a nfo:Website ;
   nie:url <http://www.google.com/imgres?imgurl=http://images.fanpop.com/...> .

And since posts with images are way more intriguing…

10 thoughts on “Remembering downloads via Nepomuk

    • No, I actually meant KParts. We (as in David Faure and me) did not find a way to put that into KIO in a generic way. The only generic place we found was KParts. That at least takes care of Konqueror.

      • How hard is this method to also integrate a virus scanner call? e.g. calling clam for a quick scan?

        The idea being that the file is indexed, it might as well be virus-scanned as well (why has no one thought of linux virus scanners integration?). Does Nepomuk provide a scope for security audits / last known virus scan, or is a more professional software package needed for a paper-trail?

        • To be honest I never thought of virus scanning and it is completely out of the scope of Nepomuk. If someone wants to integrate that – fine by me. Although I cannot see a reason to scan for viruses on a linux desktop.

          • The reasoning behind bringing up virus scanning is that the file has been moved, no doubt. With fanotify in-kernel there is a block before the file shows up in its new destination while it is virus-scanned. It seems that the infrastructure you describe is actually a first. A software hook in kde itself, can also cleanly deal with a virus scanner hook in usefully imaginable ways, without a scanning application pulled up or a daemon running and actually providing a mental model as opposed to what’s been used, seen (and forced via courts) elsewhere. The point being that it’s doing something else in the meantime, as an unrelated action, why not just virus scan for good measure?

            I agree on your comment that virus scanning for Linux is pretty much unneccesary from the point of view of most every Linux user, though when dealing with files that may or may not contain malicious elements, and may easily find their way to a platform where they can pose a threat.

            The file has still been moved and thus still should be considered unsafe. How well doesn’t a virus-scanner fit into a Nepomuk API? Considering that Nepomuk is primarily meant for indexing and not about the content of the files themselves:

            indexing != signature comparing != sorting != allocation according to worth i.e. “moving”

            The consideration does not indicate that viruses are easily had while moving; though while not moving, one can pick up a virus? Comparing Apples and Oranges. Why quarantine a.k.a. file (or index) to begin with? Why not consider a quarantined file useful as indexed also?

  1. This. Is. Awesome.

    I’ve long thought this would be something of a ‘killer app’ for the semantic desktop technologies (or, at least, for me it certainly is). Guess I finally have a good reason to figure out how the heck to get Nepomuk working on my setup. (And to switch to a browser which integrates with it…)

  2. I have absolutely no clue about kde internals, so probably this will not make much sense, but intuetively I would have had expected kget (as a generic downloading app) to do this kind of tagging…

  3. Pingback: Rehashing Download Metadata | Trueg's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s