[Nepomuk] Re: Correct usage of ontologies?

Matthias Fuchs mat69 at gmx.net
Mon Apr 4 17:34:58 CEST 2011


Am Montag 04 April 2011, 15:38:39 schrieb Sebastian Trüg:
> It is a bit weird. Soon Nepomuk will check ranges and domains. Then you
> will get an error if you try to use a class as a property or use an
> invalid property value.

Indeed, I often have a page to the ontologies open, to see how they should be 
used. But not always.

In this regard is the code [1] finally correct? ;)
Using comic as an own tag is kinda redundant there, as it is the super topic 
of the specific comic anyway. Yet accessing the comics via their super tag 
does not work yet in Dolphin.

> >> 
> >> I thought about a generic base like:
> >> 
> >> nmm:Series
> >> nmm:TVSeries subclass of nmm:Series
> >> nmm:ComicSeries subclass of nmm:Series
> >> 
> >> nmm:Episode
> >> nmm:TVShow subclassof nmm:Episode
> >> 
> >> and then we change the range and domain of nmm:series to the base
> >> classes.
> >> 
> >> This way we could either add something like nmm:ComicEpisode or just use
> >> the base class with a nie:title and no numbering and no season
> >> information.
> > 
> > Ah I see.
> > There is still one problem with comics. Meaning that there is no rule.
> > Some comics are organised liked books into chapters, then into episodes
> > and then into the strips of the episodes. [1]
> 
> This is comparable to show, season, episode
> 
> > At the same time others are organised into volumes, then chapters, then
> > pages. [2]
> 
> same as above - only the naming differs really.
> 
> > Simple ones like Garfiled or XKCD are only "organised" via their number
> > or date.
> 
> Here we could have only one "season".
> 
> So maybe this could work after all - in case the naming of the
> categorization is not really important we could use the same approach
> for all.
> 
> The only question then would be: how to name the base class for Season?

I am afraid I am not good with terms.
So what I thought of for a very general case would be something like 
SeriesItems. Ok, as I said, not good in that. :D



[1]
Nepomuk::Resource res(destUrl, NFO::FileDataObject());

Nepomuk::Resource comicTopic("Comic", PIMO::Topic());
comicTopic.setLabel(i18n("Comic"));
res.addTag(comicTopic);

if (!mAdditionalText.isEmpty() ) {
    res.setProperty(NIE::description(), mAdditionalText);
}
if ((mSuffixType == "Date") && !mShownIdentifierSuffix.isEmpty()) {
    res.setProperty(NIE::contentCreated(), 
Nepomuk::Variant(QDate::fromString(mShownIdentifierSuffix, Qt::ISODate)));
}
if (!mComicTitle.isEmpty()) {
    Nepomuk::Resource topic(mComicTitle, PIMO::Topic());
    topic.setLabel(mComicTitle);
    topic.setProperty(PIMO::superTopic(), comicTopic);
    res.addTag(topic);
}
if (!mStripTitle.isEmpty()) {
    res.setProperty(NIE::title(), mStripTitle);
}
if (!mWebsiteUrl.isEmpty()) {
    Nepomuk::Resource website(mWebsiteUrl, 
Nepomuk::Vocabulary::NFO::Website());
    website.setProperty(NIE::url(), mWebsiteUrl);
    res.setProperty(NDO::referrer(), website);
}

const QStringList authors = mComicAuthor.split(',', QString::SkipEmptyParts);
foreach (QString author, authors) {
    author = author.trimmed();
    Nepomuk::Resource authorRes(author, NCO::PersonContact());
    authorRes.setProperty(NCO::fullname(), author);
    res.addProperty(NAO::creator(), authorRes);
}



More information about the Nepomuk mailing list