[Kde-pim] nepomuk + sentDate()

Vishesh Handa handa.vish at gmail.com
Fri Nov 2 02:30:10 GMT 2012


Hey Laurent

I just saw this email while browsing some stuff. I seem to have missed it.
Please feel free to remind me if I do not respond in a couple of days. I
tend to put stuff for later and then forget about it. Sorry.

On Fri, Mar 9, 2012 at 2:50 PM, laurent Montel <montel at kde.org> wrote:

> Hi,
> I saw in kdepim-runtime/agents/ontologies/nmo/message.h we used a QDateTime
> when we save Date.
> It's normal but when we use search message we can search by date.
> But a date is YYYY-MM-DD but in nepomuk with save time too
>
> => when we search which condition "equal" it will not get message.
>
> So it it possible to adapt code to use just a QDate ?
>

I see. This does seem like a problem.

I presume you're talking about nmo:sentDate and nmo:receivedDate. It would
be possible to just use a QDate, but that would require a lot of change and
I'm not sure it is the right way to go about it. Specially since the
sent/received time seems important.

I think the proper fix would be searching for only the date when performing
the searches. I experimented with a couple of queries and it seems this
query gives me the correct results -


select * where {

?r a nmo:Message .

?r nmo:sentDate ?dt .

FILTER(xsd:date(?dt) = "2012-10-09"^^xsd:date ) .

}


Could you point me to the relevant code? I'll be happy to take a better
look.


Also, I just checked and SPARQL seems to have these really cool datetime
functions which will can be used in queries [1]


[1] http://www.w3.org/TR/sparql11-query/#func-date-time


> for the moment:
>     /**
>      * Get property
> http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#sentDate.
>      * Date when this message was sent.
>      */
>     QDateTime sentDate() const {
>         QDateTime value;
>         if(m_res-
> >contains(QUrl::fromEncoded("
> http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#sentDate",
> QUrl::StrictMode)))
>             value = m_res-
> >property(QUrl::fromEncoded("
> http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#sentDate",
> QUrl::StrictMode)).first().value<QDateTime>();
>         return value;
>     }
>
>
> Thanks for infos.
>
>
> --
> Laurent Montel | laurent.montel at kdab.com | KDE/Qt Senior Software Engineer
> KDAB (France) S.A.S., a KDAB Group company
> Tel. France +33 (0)4 90 84 08 53, Sweden (HQ) +46-563-540090
> KDAB - Qt Experts - Platform-independent software solutions
>
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list