[Nepomuk] Re: How to read back the Nepomuk::Resource identifier

Christian Mollekopf chrigi_1 at fastmail.fm
Wed Feb 23 14:05:34 CET 2011


On Tuesday 22 February 2011 17:23:56 Sebastian Trüg wrote:
> On 02/22/2011 04:19 PM, Christian Mollekopf wrote:
> > On Tuesday 22 February 2011 15:40:53 Sebastian Trüg wrote:
> >> Ok, correction: it is not ignored. It is used as nie:url. So if you use
> >> "akonadi:?item=abc" as identifier in the Resource constructor you get a
> >> new resource with a random URI and nie:url property set to the akonadi
> >> URI.
> > 
> > I see, that works. That makes sense, but is not really predictable. I
> > think the constructor taking an url should behave this way, in case the
> > url is not a nepomuk:/ url. The constructor taking an identifier should
> > really set the identifier IMHO.
> 
> I agree. Once upon a time that was the way the system behaved. Then a
> lot of things were changed, fixed, improved, and on the way this use
> case got changed. Since there was no unit test for this special case we
> did not catch it.
> It's not clear yet how to fix it. Could you maybe create a bug report
> for it?
> 
Sure, https://bugs.kde.org/show_bug.cgi?id=266968

Cheers

> Cheers,
> Sebastian
> 
> > Cheers
> > 
> >> Cheers,
> >> Sebastian
> >> 
> >> On 02/22/2011 03:23 PM, Sebastian Trüg wrote:
> >>> Hi Chris,
> >>> 
> >>> I just realized that this is a bit of a bug. If an identifier has a
> >>> schema, i.e. is a URI with a schema, it is more or less ignored. :(
> >>> And since akonadi URIs have the akonadi: schema this could be the
> >>> problem....
> >>> 
> >>> I need to fix that somehow.
> >>> 
> >>> Cheers,
> >>> Sebastian
> >>> 
> >>> On 02/22/2011 02:54 PM, Christian Mollekopf wrote:
> >>>> On Tuesday 22 February 2011 14:41:39 Sebastian Trüg wrote:
> >>>>> On 02/22/2011 01:05 PM, Christian Mollekopf wrote:
> >>>>>> On Tuesday 22 February 2011 11:30:30 Sebastian Trüg wrote:
> >>>>>>> That is weird indeed.
> >>>>>>> Could you please do a kDebug() on the resource to see its details.
> >>>>>> 
> >>>>>> What exactly would you like to see? (I can't just  print the whole
> >>>>>> resource, or can I?)
> >>>>>> 
> >>>>>> the identifiers part is just empty, directly on creation, or also
> >>>>>> when loaded later on. The uri is also first empty, and later on
> >>>>>> when loaded from storage a normal nepomuk:/ uri.
> >>>>>> 
> >>>>>> I'd expect that when created like this:
> >>>>>> 
> >>>>>> Nepomuk::Resource res(identifier,
> >>>>>> Nepomuk::Vocabulary::NFO::HtmlDocument());
> >>>>> 
> >>>>> is "identifier" a QString. Only then it would be used as identifier.
> >>>>> Otherwise it would be used as nie:url I think...
> >>>> 
> >>>> yes, identifier is a QString.
> >>>> 
> >>>>>> res.identifiers() would return identifier, is that correct?
> >>>>>> 
> >>>>>>> Cheers,
> >>>>>>> Sebastian
> >>>>>>> 
> >>>>>>> On 02/17/2011 05:41 PM, Christian Mollekopf wrote:
> >>>>>>>> another question =)
> >>>>>>>> 
> >>>>>>>> So far I created Nepomuk::Resources  for an Akonadi::Item using
> >>>>>>>> the the url of the Akonadi::Item as identifier, which works well
> >>>>>>>> so far.
> >>>>>>>> 
> >>>>>>>> But now that I tried getting the Akonadi::Item url back from the
> >>>>>>>> corresponding Nepomu::Resource, I realized that neither the uri
> >>>>>>>> nor the indetifiers contain the Akonadi::Item url which was used
> >>>>>>>> to create the Resource.
> >>>>>>>> 
> >>>>>>>> In other words, using the same url as identifier always gives me
> >>>>>>>> the same Resource, but I can't get that url back from the
> >>>>>>>> Resource. Is that normal?
> >>>>>>>> 
> >>>>>>>> And how should I work around this? By Adding the url as additional
> >>>>>>>> Identifier?
> >>>>>>>> 
> >>>>>>>> Cheers,
> >>>>>>>> 
> >>>>>>>> Chris



More information about the Nepomuk mailing list