[Nepomuk] Re: Problem when storing properties with the DMS

Christian Mollekopf chrigi_1 at fastmail.fm
Thu Jun 23 21:12:18 CEST 2011


btw. also DataManagementModelTest::testStoreResources_duplicates fails for  
me, don't know if it is related or not.

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/


More information about the Nepomuk mailing list