Nepomuk
tools.h
Go to the documentation of this file.00001 /* 00002 * This file is part of the Nepomuk KDE project. 00003 * Copyright (C) 2006-2008 Sebastian Trueg <trueg@kde.org> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Library General Public License 00016 * along with this library; see the file COPYING.LIB. If not, write to 00017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef _NEPOMUK_TOOLS_H_ 00022 #define _NEPOMUK_TOOLS_H_ 00023 00024 #include <QtCore/QString> 00025 #include <QtCore/QList> 00026 00027 #include "variant.h" 00028 #include "nepomuk_export.h" 00029 00030 #include <soprano/node.h> 00031 00032 #include <kdemacros.h> 00033 00034 namespace Nepomuk { 00038 KDE_DEPRECATED NEPOMUK_EXPORT void setDefaultRepository( const QString& s ); 00039 00046 KDE_DEPRECATED NEPOMUK_EXPORT QString defaultGraph(); 00047 00054 KDE_DEPRECATED NEPOMUK_EXPORT QString typePredicate(); 00055 00061 NEPOMUK_EXPORT QList<Soprano::Node> valuesToRDFNodes( const Variant& ); 00062 NEPOMUK_EXPORT Soprano::Node valueToRDFNode( const Variant& ); 00063 00068 NEPOMUK_EXPORT Variant RDFLiteralToValue( const Soprano::Node& node ); 00069 00070 template<typename T> QList<T> convertResourceList( const QList<Resource>& l ) { 00071 QList<T> rl; 00072 for( QList<Resource>::const_iterator it = l.constBegin(); 00073 it != l.constEnd(); ++it ) 00074 rl.append( T( *it ) ); 00075 return rl; 00076 } 00077 00078 template<typename T> QList<Resource> convertResourceList( const QList<T>& l ) { 00079 QList<Resource> rl; 00080 Q_FOREACH( T r, l ) 00081 /* for( QList<T>::const_iterator it = l.constBegin(); */ 00082 /* it != l.constEnd(); ++it ) */ 00083 rl.append( Resource( r/*it*/ ) ); 00084 return rl; 00085 } 00086 00090 KDE_DEPRECATED NEPOMUK_EXPORT QString rdfNamepace(); 00091 00095 KDE_DEPRECATED NEPOMUK_EXPORT QString rdfsNamespace(); 00096 00100 KDE_DEPRECATED NEPOMUK_EXPORT QString nrlNamespace(); 00101 00105 KDE_DEPRECATED NEPOMUK_EXPORT QString naoNamespace(); 00106 } 00107 00108 #endif