[Nepomuk] Re: Problem when storing properties with the DMS
Vishesh Handa
handa.vish at gmail.com
Fri Jun 24 09:02:22 CEST 2011
Hey Christian
On Fri, Jun 24, 2011 at 12:42 AM, Christian Mollekopf
<chrigi_1 at fastmail.fm>wrote:
> btw. also DataManagementModelTest::testStoreResources_duplicates fails for
> me, don't know if it is related or not.
>
No. That's something I need to fix, but it's not a priority.
I investigated the problem. And here is what I found -
* In the test suite nie:isPartOf had been given the wrong range. I've
corrected it.
* The test I wrote for you was wrong. The resource with label
"testresource2" should have a nie:isPartOf connecting it to the resource
with label "testResource1". I've fixed the test, and it runs fine. Almost.
* The correct nie:isPartOf relation is added
Now, here is the problem -
nao:prefLabel has a rdfs:range of rdfs:Literal. And if I create a
Soprano::LiteralValue("something"), that turns into a literal with the data
type xsd:string. So, I'm not sure how I should write this test.
@ Trueg:
Please take a look at the attached patch.
@ Christain:
The test runs perfectly otherwise. Something else is wrong. If you tell me
what exactly you're doing maybe we can figure it out.
> On Thu, 23 Jun 2011 20:58:23 +0200, Christian Mollekopf
> <chrigi_1 at fastmail.fm> wrote:
>
> > Hey,
> >
> > Today I faced a problem when setting the nie:isPartOf property on a
> > SimpleResource item.
> > In the akonadi feeder storing would always fail with a message like:
> > "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf has a
> > rdfs:range of
> >
> http://www.semanticdesktop.org/ontologies/2007/01/19/nie#InformationElement
> ."
> >
> > which is at least a correct statement, but I made sure that all resources
> > have the types informationelement and DataObject, so it should work.
> >
> > Second I wrote a little test app:
> >
> > SimpleResourceGraph graph;
> > SimpleResource res;
> > res.setProperty( Soprano::Vocabulary::NAO::prefLabel(),
> > "testresource"
> > );
> > res.setTypes(QList <QUrl>() << Vocabulary::NIE::DataObject() <<
> > Vocabulary::NIE::InformationElement());
> > graph.insert(res);
> > SimpleResource res2;
> > res2.setProperty( Soprano::Vocabulary::NAO::prefLabel(),
> > "testresource2" );
> > res2.setTypes(QList <QUrl>() << Vocabulary::NIE::DataObject() <<
> > Vocabulary::NIE::InformationElement());
> > res2.addProperty( Vocabulary::NIE::isPartOf(), res );
> > graph.insert(res2);
> > KJob *job = graph.save();
> >
> > This actually worked without errors, but the property ended up on the
> > wrong resource (testresource instead of tesetresource2).
> > Vishesh had a quick look at this one.
> >
> > He then put this into a unittest in datamanagementmodeltest.cpp, here we
> > both experienced the same issue:
> >
> > QDEBUG : DataManagementModelTest::testStoreResource_nieIsPartOf()
> > qttest(30079)/nepomuk (storage service) Nepomuk::ResourceMerger::merge:
> > Invalid resource range. QUrl( "_:zb" ) has types
> > (QUrl("
> http://www.semanticdesktop.org/ontologies/2007/01/19/nie#DataObject")
> > , QUrl(
> > "
> http://www.semanticdesktop.org/ontologies/2007/01/19/nie#InformationElement
> "
> > ) )
> > QDEBUG : DataManagementModelTest::testStoreResource_nieIsPartOf()
> >
> "/home/chrigi/devel/kde/build/kde-runtime/nepomuk/services/storage/test/datamanagementmodeltest(30079)"
> > Soprano: "Invalid argument (1)":
> > "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf has a
> > rdfs:range of
> > http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject
> ."
> > QDEBUG : DataManagementModelTest::testStoreResource_nieIsPartOf()
> > qttest(30079)/nepomuk (storage service)
> > Nepomuk::DataManagementModel::storeResources: MERGING FAILED!
> > QDEBUG : DataManagementModelTest::testStoreResource_nieIsPartOf()
> >
> "/home/chrigi/devel/kde/build/kde-runtime/nepomuk/services/storage/test/datamanagementmodeltest(30079)"
> > Soprano: "Invalid argument (1)":
> > "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf has a
> > rdfs:range of
> > http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject
> ."
> >
> > The reported range is actually wrong, as nie:isPartOf has a range of
> > nie:InformationElement, and not nie:DataObject (repectively
> > nfo:FileDataObject).
> >
> > Here are the tests I used: http://paste.kde.org/86809/
> > The first one doesn't work it seems. It is very well possible that it is
> > also not supposed to work this way.
> >
> > Anyways, I'm stuck, any help appreciated =)
> >
> > Cheers,
> >
> > Chris
> > _______________________________________________
> > Nepomuk mailing list
> > Nepomuk at kde.org
> > https://mail.kde.org/mailman/listinfo/nepomuk
>
>
> --
> Using Opera's revolutionary email client: http://www.opera.com/mail/
> _______________________________________________
> Nepomuk mailing list
> Nepomuk at kde.org
> https://mail.kde.org/mailman/listinfo/nepomuk
>
--
Vishesh Handa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/nepomuk/attachments/20110624/99c70463/attachment-0001.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.diff
Type: text/x-patch
Size: 3310 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/nepomuk/attachments/20110624/99c70463/attachment-0001.diff
More information about the Nepomuk
mailing list