[Nepomuk] Re: Using nfo:OperatingSystem

Matthias Fuchs mat69 at gmx.net
Sun Apr 24 17:13:05 CEST 2011


Am Sonntag 24 April 2011, 15:45:10 schrieb Matthias Fuchs:
> Hi there,
> 
> I have another question regarding ontologies.
> The Metalink specification supports OS fields, these contain the OS a file
> is for.
> E.g. "test.exe" could have "Windows XP", "Windows Vista", "Windows 7" ...
> assigned to it. [1]
> 
> Now I wonder how I should assign these oses to the downloaded file.
> 
> Suppose we have a Nepomuk:Resource dest (the downloaded file), would the
> following be ok?
> 
> QList<Nepomuk::Resource> oses;
> foreach (const QString &osString, osStrings) {
>   Nepomuk::Resource os(osString, NFO::OperatingSystem);
>   os.setLabel(osString); //or rather os.setProperty(NIE::title(),
> osString)? }
> dest.addProperty(NIE::hasLogicalPart(), oses);
> //especially here I am not sure, how to correctly connect an
> InformationElement with a DataObject. Basically I want to say the file
> works on these oses.
> 
> Thanks for reading! :)
> 
> 
> [1] Which terms to use, e.g. rather Windows Nt ... is not that clear in the
> spec.
> _______________________________________________
> Nepomuk mailing list
> Nepomuk at kde.org
> https://mail.kde.org/mailman/listinfo/nepomuk

Uah, now I just realised, that nie:title, nie:version, nie:language ... all 
are in the domain of InformationElement.

Does that mean that
Nepomuk::File file(url);
file.setProperty(NIE::language, "de");
would be wrong?
 

Should I rather use -- in the context of the first post:

Nepomuk::File file(url);
Nepomuk::Resource res(url, NIE::Executable());

Nepomuk::Resource os("Linux X86", NFO::OperatingSystem());
os.setLabel("Linux X86");

res.setProperty(NIE::language(), "de");
res.setProperty(NIE::version(), "4.0");
res.setProperty(NIE::description(), "Pretty cool file.");
res.setProperty(?????, os);

file.setProperty(NIE::interpretedAs(), res);

If I should do it that way it would be quite complicated since I'd have to 
figure what type the InformationElement should use.


More information about the Nepomuk mailing list