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 { 00045 class SOPRANO_EXPORT Statement 00046 { 00047 public: 00049 00052 Statement(); 00053 00065 Statement( const Node &subject, const Node &predicate, const Node &object, const Node &context = Node() ); 00066 00067 Statement( const Statement &other ); 00068 00069 virtual ~Statement(); 00070 00071 Statement& operator=( const Statement& other ); 00073 00075 bool operator==( const Statement& other ) const; 00076 bool operator!=( const Statement& other ) const; 00077 00087 bool matches( const Statement& other ) const; 00089 00091 00098 bool isValid() const; 00100 00102 00105 Node subject() const; 00106 00110 Node predicate() const; 00111 00115 Node object() const; 00116 00120 Node context() const; 00122 00124 00129 void setSubject( const Node &subject ); 00130 00136 void setPredicate( const Node &predicate ); 00142 void setObject( const Node &object ); 00143 00149 void setContext( const Node &context ); 00151 00152 private: 00153 class Private; 00154 QSharedDataPointer<Private> d; 00155 }; 00156 } 00157 00158 SOPRANO_EXPORT QDebug operator<<( QDebug s, const Soprano::Statement& ); 00159 SOPRANO_EXPORT QTextStream& operator<<( QTextStream& s, const Soprano::Statement& ); 00160 00161 #endif // SOPRANO_STATEMENT_H 00162