[Nepomuk] Nepomuk Core - Questions & Patches
Vishesh Handa
handa.vish at gmail.com
Wed May 26 10:08:55 CEST 2010
Hey Sebastian
On Wed, May 26, 2010 at 1:03 PM, Sebastian Trüg <trueg at kde.org> wrote:
> On 05/25/2010 08:40 PM, Vishesh Handa wrote:
> > 1. If I call Resource( QString("file:/whatever") ) and whatever is
> > actually a filex:/ url. It won't get identified, cause the filex:/
> > searching is only applicable to QUrls.
>
> You are right. While this is misuse of the API it should still be fixed.
>
> > 2. Code like this is perfectly legal, and works (no modifications
> required)
> >
> > Resource r1( KUrl("nepomuk:/res/blah-blah") );
> > r1.setRating( 5 );
> > qDebug() << r1.rating();
> >
> > This is because determineUri() accepts uris whose scheme is "nepomuk",
> > but don't really exist in the database. Should this be allowed?
>
> That was my intention, yes.
>
Oh. I didn't think it was intentional.
>
> > 3. When checking if the the m_kickoffUri is a nie:url for a resource.
> > The nieUrl is assigned to be equal to the uri. This however gets fixed
> > in the load(). And nieUrl isn't used anywhere, so it doesn't matter that
> > much.
>
> I suppose you mean this part:
>
> if( it.next() ) {
> QUrl uri = it["r"].uri();
> if( uri.isEmpty() ) {
> m_uri = m_kickoffUri;
> }
> else {
> m_uri = uri;
> m_nieUrl = uri;
> }
>
> The last two lines. AFAICT this is perfectly fine since in the latter
> case both nie:url and resource URI are equal.
>
>
I respectfully disagree. :)
The query used is this "select distinct ?r ?o where { { ?r nie:url <uri> . }
UNION { <uri> ?p ?o . } } LIMIT 1". The case where ?r isn't empty is when
the <uri> contains the nie:url and therefore ?r will contain the resource
uri.
Please have a look at -> http://pastebin.com/v536fMvv
- Vishesh Handa
Cheers,
> Sebastian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/nepomuk/attachments/20100526/bc9b7a56/attachment.htm
More information about the Nepomuk
mailing list