[Nepomuk] Retrieve "linked" artwork file

Sebastian Trüg trueg at kde.org
Tue Oct 18 09:11:34 UTC 2011


On 10/18/2011 10:54 AM, daitheflu at free.fr wrote:
> Hi,
> 
> Thanks Sebastian, that helped me *a lot*.
> 
> I checked with NepomukShell and discovered that my artwork Resource had no NIE:url !
> I thought that the constructor would have automatically set it but it didn't, and it does not.

That is weird, it should normally work - maybe a bindings thing.

> Since the following wasn't sufficient :
> 
>     img = Nepomuk.Resource(coverpath, OntologiesUrls.image())
> 
> I just added :
> 
>     img = Nepomuk.Resource(coverpath, OntologiesUrls.image())
>     img.setProperty(OntologiesUrls.url(), coverpath)

Do this instead:

img = Nepomuk.Resource(KUrl(coverpath), OntologiesUrls.image())

> And that did the trick :)
> It's now working like a charm !
> 
> 
> 
> As for your Python tool that generate ontologies, that could be very interesting.
> I could have write one by myself, but I was too lazy. So I just hardcoded the one I needed.
> If yours is not too difficult to understand and if you're OK, I could maybe maintain it.

it is very simple. I just did not know where to put it...
I will try to find it again today.

Then again pretty much all the ontology URIs you need are already in
Soprano.Vocabulary and Nepomuk.Vocabulary - unless the python bindings
do not include them.

Cheers,
Sebastian


More information about the Nepomuk mailing list