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 { 00041 KDE_DEPRECATED NEPOMUK_EXPORT QList<Soprano::Node> valuesToRDFNodes( const Variant& ); 00042 00049 KDE_DEPRECATED NEPOMUK_EXPORT Soprano::Node valueToRDFNode( const Variant& ); 00050 00058 template<typename T> QList<T> convertResourceList( const QList<Resource>& l ) { 00059 QList<T> rl; 00060 for( QList<Resource>::const_iterator it = l.constBegin(); 00061 it != l.constEnd(); ++it ) 00062 rl.append( T( *it ) ); 00063 return rl; 00064 } 00065 00073 template<typename T> QList<Resource> convertResourceList( const QList<T>& l ) { 00074 QList<Resource> rl; 00075 Q_FOREACH( const T& r, l ) 00076 rl.append( Resource( r ) ); 00077 return rl; 00078 } 00079 00083 KDE_DEPRECATED NEPOMUK_EXPORT Variant RDFLiteralToValue( const Soprano::Node& node ); 00084 00088 KDE_DEPRECATED NEPOMUK_EXPORT void setDefaultRepository( const QString& s ); 00089 00095 KDE_DEPRECATED NEPOMUK_EXPORT QString defaultGraph(); 00096 00100 KDE_DEPRECATED NEPOMUK_EXPORT QString typePredicate(); 00101 00105 KDE_DEPRECATED NEPOMUK_EXPORT QString rdfNamepace(); 00106 00110 KDE_DEPRECATED NEPOMUK_EXPORT QString rdfsNamespace(); 00111 00115 KDE_DEPRECATED NEPOMUK_EXPORT QString nrlNamespace(); 00116 00120 KDE_DEPRECATED NEPOMUK_EXPORT QString naoNamespace(); 00121 } 00122 00123 #endif
KDE 4.6 API Reference