Projects/Nepomuk: Difference between revisions

    From KDE TechBase
    (A Backup system based on Nepomuk)
    (Marked this version for translation)
    (104 intermediate revisions by 13 users not shown)
    Line 1: Line 1:
    <languages />
    <translate>
    <!--T:1-->
    [[Image:Nepomuk_logo_big.png|center|300px]]
    [[Image:Nepomuk_logo_big.png|center|300px]]


    == About Nepomuk ==
    == About Nepomuk == <!--T:2-->
     
    This page is dedicated to Nepomuk development ideas, progress, experiments, and is a general starting point for new developers.
     
    For general information about the Nepomuk project see the [http://nepomuk.kde.org/ dedicated Nepomuk homepage].
     
     
    == Developer Coordination ==
     
    The Nepomuk project is maintained by [mailto:[email protected] Sebastian Trueg] of Mandriva.
     
     
    == Documentation ==
     
    The following links provide good reads for getting used to the Nepomuk system and its APIs.
     
    * [[Development/Tutorials/Metadata/Nepomuk|Development Tutorials]]
    * [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk/html/index.html Nepomuk API Documentation]
    * [http://soprano.sourceforge.net/apidox/trunk/index.html Soprano (RDF storage) API]
     
     
    == ToDo ==
     
    Nepomuk is a rather young project with a notorious shortage in developers. There are many tasks and subprojects to get ones hands dirty on. Unlike other projects like Plasma, however, developing for Nepomuk is not easy. One has to read up on a lot of things and fight some day-to-day annoyances. But: helping with the development will improve the situation in any case.
     
    If you are interested in working on a task in this list, please contact [mailto:[email protected] Sebastian Trueg].
     
    === Low level Nepomuk Development Tasks ===
     
    The low-level development tasks are those that are not directly reflected in the GUI or even in the API used by most developers. However, they are important in terms of performance, scalability, and compatibility.
     
    ==== Soprano Transaction Support ====
     
    [http://soprano.sf.net/ Soprano] is the RDF database framework used in Nepomuk. Currently Soprano does not support transactions, i.e. sets of commands that can be rolled back. An [http://websvn.kde.org/branches/soprano/experimental experimental development] branch exists which already contains new API for transaction support (while keeping BC).
     
    It still misses an implementation of the transaction support in Soprano backends (Sesame2 and Virtuoso) and in the client/server architecture.
     
    === General Nepomuk ===


    ==== Catching all file moves ====
    <!--T:3-->
    '''Nepomuk''' serves as a cross application semantic storage backend. It aims at collecting data from various sources - file indexing, the web, applications, etc, and linking them all together to form a cohesive map of data.


    Nepomuk uses an RDF database for all data. This includes file metadata. Files are referenced by URL. The problem with this is that when a file is moved or renamed we have to realize this and update the metadata accordingly (update the URL in the database).
    <!--T:4-->
    This page is dedicated to third party documentation for '''Nepomuk'''. To know more about '''Nepomuk''' from a user's point of view, head over to the [http://userbase.kde.org/Special:myLanguage/Nepomuk Nepomuk page on UserBase]. Or to know more about the Nepomuk community and getting involved in '''Nepomuk''', head over to the [http://community.kde.org/Projects/Nepomuk Nepomuk Community Page].


    For KIO this is fairly simple since we have {{class|KDirNotify}}. The [http://techbase.kde.org/Development/Tutorials/Metadata/Nepomuk/FileWatchService Nepomuk filewatch service] takes care of this and updates the metadata whenever KIO moves or deletes a file.
    == Documentation == <!--T:5-->


    However, if a file is moved by a non-KDE application (typical example: the shell via the mv command) the filewatch service does not notice it and the file -> metadata link is gone. This is a bad situation which sadly cannot be solved easily. Systems like inotify are too restricted.
    <!--T:6-->
    Any new project is intimidating and jumping right into the [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk-core/html/index.html API Documentation] can be scary. So, we have prepared some articles which explain the different aspects of '''Nepomuk''' and even touch on some advanced features.


    Thus, while having a more powerful replacement for inotify would be great, in the meantime we should work with what we got.
    <!--T:7-->
    The documentation of any project is always in progress as the code base is always evolving. If you feel that the documentation is lacking in some regard, please come talk to us. We'd love to hear your feedback, and the documentation might just get improved in the process.


    The idea is to create a [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk/html/classNepomuk_1_1Service.html Nepomuk service] that tries very hard to find file moves. It would regularly check the database for dangling metadata and then try to find the file using all kinds of evidence:
    <!--T:8-->
    '''Nepomuk Mailing List: ''' nepomuk@kde.org <br/>
    '''IRC Channel:''' #nepomuk-kde on freenode


    * file name matching
    === Introductory Material === <!--T:9-->
    * xattrs if available (this would mean that Nepomuk::Resource also needs to set the xattrs at some point)
    * checksums, maybe the checksum of the first N bytes or something like that to speed the process up
    * compare metadata extracted by strigi
    * etc.


    All this information should be used to generate a score which indicates the certainty of the file matching. Then the final decision would have to be made by the user.
    <!--T:10-->
    If you're just getting started with '''Nepomuk''' and want to know a quick way to fetch some data.


    '''''Hints:'''''
    <!--T:11-->
    * Try to detect if a complete folder has been moved (or deleted) and do not ask the user for every single file.
    * [[Special:myLanguage/Projects/Nepomuk/QuickStart| Quick Start]]
    * [[Special:myLanguage/Projects/Nepomuk/OntologyBasics| Basic Ontology concepts]]
    * [[Special:myLanguage/Projects/Nepomuk/Uris| Questions about URIs]]


    ==== Handling of external storage ====
    === Managing Data === <!--T:12-->


    A typical problem with the way Nepomuk handles files and file metadata are removable storage devices. They can be mounted at different paths on different systems. But still one wants to keep the metadata stored in Nepomuk.
    <!--T:13-->
    If possible one would even want to be able to search for files saved on an USB stick even if it is not plugged in.
    This section includes more in-depth articles on how manage the data in '''Nepomuk'''. As a starting point you should probably open up the [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk-core/html/index.html Nepomuk API Documentation]. It is generally more up to date than the articles mentioned below.


    The [http://trueg.wordpress.com/2009/04/15/portable-meta-information-yet-again-only-this-time-there-is-code/ blog entry about removable storage in Nepomuk] already discusses this problem and shows some existing code in KDE's [http://websvn.kde.org/trunk/playground/base/removablestorageservice/ playground] which tries to tackle this problem.
    <!--T:14-->
    * [[Special:myLanguage/Projects/Nepomuk/Resources| Using Resources]]
    * [[Special:myLanguage/Projects/Nepomuk/ResourceWatcher| Monitoring Changes]]
    * [[Special:myLanguage/Projects/Nepomuk/BulkChanges| Bulk Changes]]
    * [[Special:myLanguage/Projects/Nepomuk/DataFeeders| Data Feeders]]


    However, one actually needs more. The system would have to be embedded into KIO to make sure the metadata cache on the removable storage device is always up-to-date. Also it is directly related to the problem of relative vs. absolute file URLs.
    === File Indexing === <!--T:15-->


    ==== Relative vs. Absolute File URLs ====
    <!--T:16-->
    With 4.10, the file indexing architecture has substantially changed. We no longer rely on strigi, and have our own plugin based interface.


    Currently Nepomuk uses the absolute file URLs as URI identifiers for the resources representing the files in the Nepomuk RDF store. The file ''~/test.png'' for example has the resource URI ''file:///home/<username>/test.png''. This is nice in many situations since one can simply use the file URL to query file metadata but on the other hand we need to change a lot of triples whenever the file is moved (not to mention the removable storage problem above).
    <!--T:17-->
    * [[Special:myLanguage/Projects/Nepomuk/IndexingPlugin| Writing an Indexing Plugin]]


    Thus, the idea is to use random URI identifiers for new file resources and store the file path relative to the mount point. This would solve the above problem with removable devices and make updates after file moves simpler (only update the path).
    === Querying === <!--T:18-->


    This problem should probably be tackled by introducing a class Nepomuk::File as a subclass to ''[http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk/html/classNepomuk_1_1Resource.html Nepomuk::Resource]'' which handles all these special file stuff like making sure we have a correct nao:filePath property and so on (currently all that is done with an ''if'' clause in ''Nepomuk::Resource''.
    <!--T:19-->
    As you advance into '''Nepomuk''', you'll want to move beyond just fetching and pushing data and will want to query '''Nepomuk''' for specialized data. One can query '''Nepomuk''' in many different ways, the important part is to optimize your queries and make sure they run well on production systems where the database sizes may way very large.


    === GUI ===
    <!--T:20-->
    * [[Special:myLanguage/Projects/Nepomuk/QueryingMethods| Different ways to Query Nepomuk]]
    * [[Special:myLanguage/Projects/Nepomuk/QueryLibrary| Nepomuk Query Library]]
    * [[Special:myLanguage/Projects/Nepomuk/SparqlQueries| Sparql Queries]]


    ==== Better tagging widget ====
    === Architectural Overview === <!--T:21-->


    Currently there is a [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk/html/classNepomuk_1_1TagWidget.html tagging widget in kdelibs] which is pretty ugly and not even used. Then there is the tag cloud used in Dolphin. The latter was already criticized for not being appropriate in that situation.
    <!--T:22-->
    If you're looking to get more involved with '''Nepomuk''' development process, you should probably need to need to figure out our basic architecture and where you can find all the relevant code.


    Thus, it would be great to make [http://api.kde.org/4.x-api/kdelibs-apidocs/nepomuk/html/classNepomuk_1_1TagWidget.html Nepomuk::TagWidget] a nice and usable (maybe talk to the usability people) widget that can then be used in Dolphin, Gwenview, and pretty much any application that wants to tag resources.
    <!--T:23-->
    * [[Special:myLanguage/Projects/Nepomuk/Repositories| Nepomuk Repositories]]
    * [[Special:myLanguage/Projects/Nepomuk/ComponentOverview| Nepomuk Architectural Overview]]
    * [[Special:myLanguage/Projects/Nepomuk/kioslaves| Nepomuk KIO Slaves]]


    == Ideas ==
    === Nepomuk Internals === <!--T:24-->


    There are many ideas on how to improve the Nepomuk system or on how to use it. This is the place to list them all.
    <!--T:25-->
    When you decide to dig even deeper.


    Feel free to add your own ideas. Please leave your name in case someone wants to contact you for details or a discussion of the idea.
    <!--T:26-->
    * [[Special:myLanguage/Projects/Nepomuk/GraphConcepts| Graph handling]]
    * [[Special:myLanguage/Projects/Nepomuk/VirtuosoInternal| Virtuoso Internals]]
    * [[Special:myLanguage/Projects/Nepomuk/OntologyExtention| Extending the Ontologies]]


    === Remember download locations ===
    === Miscellaneous === <!--T:27-->


    As [http://www.kdedevelopers.org/node/3843 blogged before] remembering the download location and the referrer web page is a pretty good idea. The most pressing problem at the moment is finishing [http://dev.nepomuk.semanticdesktop.org/wiki/NdoOntology the download ontology].
    <!--T:28-->
    * [[Special:myLanguage/Projects/Nepomuk/Nepomuk2Port| Porting to Nepomuk2]]
    * [[Special:myLanguage/Projects/Nepomuk/ManagingNepomukProcesses| Managing Nepomuk Processes]]
    * [[Special:myLanguage/Projects/Nepomuk/TestEnvironment| Nepomuk Test Environment]]
    * [[Special:myLanguage/Development/Tutorials/Metadata/Nepomuk/TipsAndTricks| Nepomuk Tips and Tricks]]
    * [[Special:myLanguage/Projects/Nepomuk/NepomukShow| Debugging Nepomuk Data]]


    Giving the user the option to tag either at the download dialogue and/or the kuiserver download notification would make it easier to tag instantly rather than waiting for the file to download and then rmembering to come back when it's finished and tag then. When bookmarking in Firefox, FF adds some suggested tags (fairly accurately too!) which the user can delet / add to. I suggest the same for downloaded files. This way, the web pages meta tags / title can be used for suggestions if the user doesn't feel like tagging , doesn't know about it, or just to speed the process up.
    ==== Outdated links ==== <!--T:29-->
    === FIXME: add ideas ===


    ==== Potential Idea: Standalone Search Application ====
    <!--T:30-->
    *could a developer please confirm this and move it up?
    The following links provide good reads for getting used to the '''Nepomuk''' system and its APIs. <br\>
    Create a standalone search application using Nepomuk. Currently, the KDE desktop does not have a clear application that will search the user's entire hard drive for a file. One application that implements this well is Beagle in Gnome.  Krunner already has much of the code implemented, but only searches a certain amount of directories deep (2?). This standalone application would provide the full search.  This application could also be the place for implementing the tagging idea above.
    They are slightly outdated, but still has some useful material.
    * [[Special:myLanguage/Development/Tutorials/Metadata/Nepomuk|Development Tutorials]]
    * [[Special:myLanguage/Projects/Nepomuk/Ideas|Random Ideas]]
    * [[Special:myLanguage/Projects/Nepomuk/Qualified_Relations_Idea| Qualified Relations Idea]]
    * [[Special:myLanguage/Projects/Nepomuk/ScenarioExamples| Scenario Examples]]


    ==== Potential Idea: Nepomuk based backup system ====
    <!--T:31-->
    I know the support for external storage is still at its first steps but i think it has a huge potential for an intelligent backup system. The point here is that Nepomuk could "know" that a certain file on a certain device is the backup of a local file. Then, when the device is available it would trigger an automatic update of the backup. The user could, for example, just tag a folder with "Backup" and the system would ask where to back it up and perform all the necessary tasks. Backup history and recovery could then be done inside the Nepomuk resource. The key point here is really the fact that the system would "know" what a backup is, recognize one when it sees it and know what to do with it.
    [[Category:Documentation]]
    </translate>

    Revision as of 17:07, 10 December 2012


    About Nepomuk

    Nepomuk serves as a cross application semantic storage backend. It aims at collecting data from various sources - file indexing, the web, applications, etc, and linking them all together to form a cohesive map of data.

    This page is dedicated to third party documentation for Nepomuk. To know more about Nepomuk from a user's point of view, head over to the Nepomuk page on UserBase. Or to know more about the Nepomuk community and getting involved in Nepomuk, head over to the Nepomuk Community Page.

    Documentation

    Any new project is intimidating and jumping right into the API Documentation can be scary. So, we have prepared some articles which explain the different aspects of Nepomuk and even touch on some advanced features.

    The documentation of any project is always in progress as the code base is always evolving. If you feel that the documentation is lacking in some regard, please come talk to us. We'd love to hear your feedback, and the documentation might just get improved in the process.

    Nepomuk Mailing List: [email protected]
    IRC Channel: #nepomuk-kde on freenode

    Introductory Material

    If you're just getting started with Nepomuk and want to know a quick way to fetch some data.

    Managing Data

    This section includes more in-depth articles on how manage the data in Nepomuk. As a starting point you should probably open up the Nepomuk API Documentation. It is generally more up to date than the articles mentioned below.

    File Indexing

    With 4.10, the file indexing architecture has substantially changed. We no longer rely on strigi, and have our own plugin based interface.

    Querying

    As you advance into Nepomuk, you'll want to move beyond just fetching and pushing data and will want to query Nepomuk for specialized data. One can query Nepomuk in many different ways, the important part is to optimize your queries and make sure they run well on production systems where the database sizes may way very large.

    Architectural Overview

    If you're looking to get more involved with Nepomuk development process, you should probably need to need to figure out our basic architecture and where you can find all the relevant code.

    Nepomuk Internals

    When you decide to dig even deeper.

    Miscellaneous

    Outdated links

    The following links provide good reads for getting used to the Nepomuk system and its APIs. <br\> They are slightly outdated, but still has some useful material.