Nepomuk is a very nice shared data repository. It is an easy way to make the data from your application available to others.
But, it is important to know that Nepomuk is not a general purpose database - everything is peachy until you start using it as such. And especially if you start treating it as a relational database.
There are a few things to keep in mind when developing Nepomuk-based programs.
Working on graphs
So, any query you make is not a restriction on a relation (a table) but rather a multi-join of a single subject-verb-object table (this is a bit simplistic view).
As you probably know, doing joins is not really a cheap operation however optimized it is (and Virtuoso is one of the fastest graph databases available).
The second thing is that while Nepomuk-internal connections are done via local sockets, your connection to Nepomuk goes through D-Bus which is not the fastest kid on the block. The more requests you make, the more time it will take.
There are some things you can make to make these issues less relevant to your applications.
One of the common ways people write queries is the following:
And then process the results one by one by doing stuff like:
Which means your program creates a lot of queries - one main, and a couple more for each result.
Instead of making a lot of queries, it is advisable (although initially not that intuitive) to create one big query like this:
It does transfer a lot of data at once, but at least it does so in a single request-response connection, and it doesn’t repeat the same query (parsing, optimizing, evaluating) multiple times for different parameters.
Consider storing some data locally
If you have data that don’t necessarily need to be shared, consider storing it in config files, embedded database like sqlite3 or similar.
This way, apart from skipping D-Bus, you can have faster queries in the cases like these (which are not at all rare):
This query does a number of joins, whereas its equivalent in SQL does only filtering:
So, whatever you do (be it Nepomuk or something else), first ask, experiment, test and learn the system before using it.