Bug 266968 - Nepomuk::Resource constructor does not set correct properties
Summary: Nepomuk::Resource constructor does not set correct properties
Status: RESOLVED LATER
Alias: None
Product: nepomuk
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Trueg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-23 14:03 UTC by Christian Mollekopf
Modified: 2011-07-28 20:33 UTC (History)
2 users (show)

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 Christian Mollekopf 2011-02-23 14:03:32 UTC
Version:           SVN (using Devel) 
OS:                Linux

Currently the Nepomuk::Resource constructor taking a QString identifier does not set the identifiers property but uses the identifier as a url which is stored in nie:url property.
Further the constructor taking a QUrl does not set nie:url as it should.



Reproducible: Didn't try



Expected Results:  
Expected behaviour:
-Constructor taking a URL sets nie:url if the given url is not a nepomuk:/ url
-The constructor taking an identifier adds identifier to the identifiers property and does not set the nie:url property


Briefly discussed with Sebastian Trüg
Comment 1 Sebastian Trueg 2011-02-23 17:03:29 UTC
Small elaboration: this only affects identifiers that are formed like URLs with a schema. In this context it were akondi ids which look like this: akonadi:?item=ABC
Comment 2 Vishesh Handa 2011-02-24 03:10:00 UTC
I think I'm okay with changing this IF we also need some other identifiers to identify resources with. That way I could clean up some of the hacks I did in the Nepomuk internals.

By other identifiers I mean ways of looking for resources. Currently we are limited to nie:url, nao:identifier, and the resource uri.

Otherwise I'm not too keen on going and changing stuff.
Comment 3 Christian Mollekopf 2011-05-02 00:15:38 UTC
(In reply to comment #2)
> I think I'm okay with changing this IF we also need some other identifiers to
> identify resources with. That way I could clean up some of the hacks I did in
> the Nepomuk internals.
> 
> By other identifiers I mean ways of looking for resources. Currently we are
> limited to nie:url, nao:identifier, and the resource uri.

Sorry for the late reply, I forgot about that issue.

I'm not to sure what other identifiers you mean. I didn't mean to set another identifier. 

What I wanted to say is that if I create an item like Nepomuk::HtmlDocument res("akonadi:?item=21");
then res.getProperty(Nepomuk::Vocabulary::NIE::url()) should return "akonadi:?item=21" (not the nepomuk uri), and res.resourceUri() should return the nepomuk uri.

Atm, this seems to work once the NIE::url() was set manually, but before not (It might also be related that it only works once the resource is written back, but I have at least one setProperty call between the creation of the resource and the check, so that shouldn't be an issue)

And if I create a Resource using 
Nepomuk::Resource res("randomText");
I should be able to retrieve the same resource using the same constructor, and it should probably be available in the identifier list. (I didn't check that recently if it works now)

> 
> Otherwise I'm not too keen on going and changing stuff.
Comment 4 Vishesh Handa 2011-07-28 20:33:14 UTC
Until there is a use case for this case, I'm not going to fix this. We shouldn't be mixing up urls and identifiers.