Bug 311061 - Optimize ResourceManager::generateUniqueUri
Summary: Optimize ResourceManager::generateUniqueUri
Status: RESOLVED FIXED
Alias: None
Product: nepomuk
Classification: Miscellaneous
Component: libnepomukcore (show other bugs)
Version: git master
Platform: unspecified Linux
: NOR task
Target Milestone: ---
Assignee: Nepomuk Bugs Coordination
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
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:


Attachments

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)
                          nepomuk-core/libnepomukcore/resourcemanager.cpp
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

http://commits.kde.org/nepomuk-core/6a066d2fbe2df85a2d8893a7d1f1bcf2ecd8515e