Hey Christian<br><br><div class="gmail_quote">On Fri, Jun 24, 2011 at 12:42 AM, Christian Mollekopf <span dir="ltr"><<a href="mailto:chrigi_1@fastmail.fm">chrigi_1@fastmail.fm</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
btw. also DataManagementModelTest::testStoreResources_duplicates fails for<br>
me, don't know if it is related or not.<br></blockquote><div><br>No. That's something I need to fix, but it's not a priority.<br><br>I investigated the problem. And here is what I found -<br><br>* In the test suite nie:isPartOf had been given the wrong range. I've corrected it.<br>
<br>* 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.<br>
<br>* The correct nie:isPartOf relation is added<br><br>Now, here is the problem -<br><br>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. <br>
<br>@ Trueg:<br>Please take a look at the attached patch.<br><br>@ Christain:<br>The test runs perfectly otherwise. Something else is wrong. If you tell me what exactly you're doing maybe we can figure it out.<br><br>
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br>
On Thu, 23 Jun 2011 20:58:23 +0200, Christian Mollekopf<br>
<<a href="mailto:chrigi_1@fastmail.fm">chrigi_1@fastmail.fm</a>> wrote:<br>
<br>
> Hey,<br>
><br>
> Today I faced a problem when setting the nie:isPartOf property on a<br>
> SimpleResource item.<br>
> In the akonadi feeder storing would always fail with a message like:<br>
> "<a href="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf" target="_blank">http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf</a> has a<br>
> rdfs:range of<br>
> <a href="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#InformationElement" target="_blank">http://www.semanticdesktop.org/ontologies/2007/01/19/nie#InformationElement</a>."<br>
><br>
> which is at least a correct statement, but I made sure that all resources<br>
> have the types informationelement and DataObject, so it should work.<br>
><br>
> Second I wrote a little test app:<br>
><br>
> SimpleResourceGraph graph;<br>
> SimpleResource res;<br>
> res.setProperty( Soprano::Vocabulary::NAO::prefLabel(),<br>
> "testresource"<br>
> );<br>
> res.setTypes(QList <QUrl>() << Vocabulary::NIE::DataObject() <<<br>
> Vocabulary::NIE::InformationElement());<br>
> graph.insert(res);<br>
> SimpleResource res2;<br>
> res2.setProperty( Soprano::Vocabulary::NAO::prefLabel(),<br>
> "testresource2" );<br>
> res2.setTypes(QList <QUrl>() << Vocabulary::NIE::DataObject() <<<br>
> Vocabulary::NIE::InformationElement());<br>
> res2.addProperty( Vocabulary::NIE::isPartOf(), res );<br>
> graph.insert(res2);<br>
> KJob *job = graph.save();<br>
><br>
> This actually worked without errors, but the property ended up on the<br>
> wrong resource (testresource instead of tesetresource2).<br>
> Vishesh had a quick look at this one.<br>
><br>
> He then put this into a unittest in datamanagementmodeltest.cpp, here we<br>
> both experienced the same issue:<br>
><br>
> QDEBUG : DataManagementModelTest::testStoreResource_nieIsPartOf()<br>
> qttest(30079)/nepomuk (storage service) Nepomuk::ResourceMerger::merge:<br>
> Invalid resource range. QUrl( "_:zb" ) has types<br>
> (QUrl("<a href="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#DataObject" target="_blank">http://www.semanticdesktop.org/ontologies/2007/01/19/nie#DataObject</a>")<br>
> , QUrl(<br>
> "<a href="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#InformationElement" target="_blank">http://www.semanticdesktop.org/ontologies/2007/01/19/nie#InformationElement</a>"<br>
> ) )<br>
> QDEBUG : DataManagementModelTest::testStoreResource_nieIsPartOf()<br>
> "/home/chrigi/devel/kde/build/kde-runtime/nepomuk/services/storage/test/datamanagementmodeltest(30079)"<br>
> Soprano: "Invalid argument (1)":<br>
> "<a href="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf" target="_blank">http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf</a> has a<br>
> rdfs:range of<br>
> <a href="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject" target="_blank">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject</a>."<br>
> QDEBUG : DataManagementModelTest::testStoreResource_nieIsPartOf()<br>
> qttest(30079)/nepomuk (storage service)<br>
> Nepomuk::DataManagementModel::storeResources: MERGING FAILED!<br>
> QDEBUG : DataManagementModelTest::testStoreResource_nieIsPartOf()<br>
> "/home/chrigi/devel/kde/build/kde-runtime/nepomuk/services/storage/test/datamanagementmodeltest(30079)"<br>
> Soprano: "Invalid argument (1)":<br>
> "<a href="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf" target="_blank">http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf</a> has a<br>
> rdfs:range of<br>
> <a href="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject" target="_blank">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject</a>."<br>
><br>
> The reported range is actually wrong, as nie:isPartOf has a range of<br>
> nie:InformationElement, and not nie:DataObject (repectively<br>
> nfo:FileDataObject).<br>
><br>
> Here are the tests I used: <a href="http://paste.kde.org/86809/" target="_blank">http://paste.kde.org/86809/</a><br>
> The first one doesn't work it seems. It is very well possible that it is<br>
> also not supposed to work this way.<br>
><br>
> Anyways, I'm stuck, any help appreciated =)<br>
><br>
> Cheers,<br>
><br>
> Chris<br>
> _______________________________________________<br>
> Nepomuk mailing list<br>
> <a href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a><br>
> <a href="https://mail.kde.org/mailman/listinfo/nepomuk" target="_blank">https://mail.kde.org/mailman/listinfo/nepomuk</a><br>
<br>
<br>
</div></div><font color="#888888">--<br>
Using Opera's revolutionary email client: <a href="http://www.opera.com/mail/" target="_blank">http://www.opera.com/mail/</a><br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Nepomuk mailing list<br>
<a href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/nepomuk" target="_blank">https://mail.kde.org/mailman/listinfo/nepomuk</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><font color="#999999">Vishesh Handa</font><br>