The ResourceManager::generateUniqueUri uses a complicated query with a number of unions to make sure the uri it generated does not already exist. Instead of that complicated query, one can use a simpler virtuoso specific command to check.
Relevant code: nepoomuk-core/services/storage/datamanagementmodel.cpp (createUri)
Git commit 6a066d2fbe2df85a2d8893a7d1f1bcf2ecd8515e by Gabriel Poesia.
Committed on 10/12/2012 at 21:38.
Pushed by poesia into branch 'master'.
Optimize ResourceManager::generateUniqueUri by not using SPARQL unions
generateUniqueUri used a SPARQL query using unions to determine if a
generted URI already existed. This can be done more efficiently using
the iri_to_id command, like DataManagementModel::createUri does it.
M +14 -12 libnepomukcore/resource/resourcemanager.cpp