[Nepomuk] Nepomuk Core - Questions & Patches

Vishesh Handa handa.vish at gmail.com
Fri May 7 13:15:48 CEST 2010


Hi.

I was going through the Nepomuk framework in my normal fashion, and I
happened to notice a couple of things.

1. The *Nepomuk::ResourceData::hasProperty( const QUrl& uri )* function
currently uses the MAINMODEL to answer. It think it should use the cache, as
it would be faster. The function *hasProperty( const QUrl& p, const Variant&
v ) *also uses the cache. A patch has been provided.

2. The *Nepomuk::ResourceData::removeProperty( const QUrl& uri )* function
doesn't update the cache. The setProperty function does. It should be
symmetrical. I think.

3. In *Nepomuk::ResourceFilterModel::updateProperty( const QUrl& resource,
const QUrl& property, const Node& value )* shouldn't the line if(
it.hasNext() ) be a while( it.hasNext() ) ? I haven't tested it out, but I
think this is what should happen -

Let's say I have a resource with a uri and certain properties.

uri a rdf:Resource .
uri a rxx:A .
uri a rxx:B .

and I call the function *updateProperty*( uri, rdf:type, rxx:C ). The
current implementation would get all the above 3 statements (I'm not sure in
what order) . Suppose it got *"uri a rdf:Resource*" first. It would then
proceed to remove the statement and add the *"uri a rxx:C" *statement. This
doesn't seem right.

IMO, it should either delete all matching statements and add the one
specified in the arguments or it should take an oldValue and newValue and
accordingly change. KDevelop says it isn't used anywhere, so this isn't
really that important. :-/

Thanks

- Vishesh Handa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/nepomuk/attachments/20100507/d3eb9203/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ResourceData::hasProperty.diff
Type: text/x-patch
Size: 672 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/nepomuk/attachments/20100507/d3eb9203/attachment.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ResourceData-removePropertyAddCache.diff
Type: text/x-patch
Size: 397 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/nepomuk/attachments/20100507/d3eb9203/attachment-0001.diff 


More information about the Nepomuk mailing list