Bug 311061 - Optimize ResourceManager::generateUniqueUri
Summary: Optimize ResourceManager::generateUniqueUri
Alias: None
Product: nepomuk
Classification: Unclassified
Component: libnepomukcore (show other bugs)
Version: git master
Platform: unspecified Linux
: NOR task (vote)
Target Milestone: ---
Assignee: Nepomuk Bugs Coordination
Keywords: junior-jobs
Depends on:
Reported: 2012-12-03 08:46 UTC by Vishesh Handa
Modified: 2012-12-10 20:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Vishesh Handa 2012-12-03 08:46:55 UTC
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)
Comment 1 Gabriel Poesia 2012-12-10 20:51:42 UTC
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.
REVIEW: 107637

M  +14   -12   libnepomukcore/resource/resourcemanager.cpp