Bug 311061

Summary: Optimize ResourceManager::generateUniqueUri
Product: [Unmaintained] nepomuk Reporter: Vishesh Handa <me>
Component: libnepomukcoreAssignee: Nepomuk Bugs Coordination <nepomuk-bugs>
Status: RESOLVED FIXED    
Severity: task Keywords: junior-jobs
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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