00001 /* This file is part of Soprano Project. 00002 * 00003 * Copyright (C) 2006 Daniele Galdi <daniele.galdi@gmail.com> 00004 * Copyright (C) 2007 Sebastian Trueg <trueg@kde.org> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef SOPRANO_STATEMENT_H 00023 #define SOPRANO_STATEMENT_H 00024 00025 #include "node.h" 00026 #include "soprano_export.h" 00027 00028 namespace Soprano 00029 { 00047 class SOPRANO_EXPORT Statement 00048 { 00049 public: 00051 00054 Statement(); 00055 00067 Statement( const Node &subject, const Node &predicate, const Node &object, const Node &context = Node() ); 00068 00069 Statement( const Statement &other ); 00070 00071 virtual ~Statement(); 00072 00073 Statement& operator=( const Statement& other ); 00075 00077 bool operator==( const Statement& other ) const; 00078 bool operator!=( const Statement& other ) const; 00079 00089 bool matches( const Statement& other ) const; 00091 00093 00100 bool isValid() const; 00102 00104 00107 Node subject() const; 00108 00112 Node predicate() const; 00113 00117 Node object() const; 00118 00122 Node context() const; 00124 00126 00131 void setSubject( const Node &subject ); 00132 00138 void setPredicate( const Node &predicate ); 00144 void setObject( const Node &object ); 00145 00151 void setContext( const Node &context ); 00153 00154 private: 00155 class Private; 00156 QSharedDataPointer<Private> d; 00157 }; 00158 } 00159 00160 SOPRANO_EXPORT QDebug operator<<( QDebug s, const Soprano::Statement& ); 00161 SOPRANO_EXPORT QTextStream& operator<<( QTextStream& s, const Soprano::Statement& ); 00162 00163 #endif // SOPRANO_STATEMENT_H 00164