Soprano  2.9.2
statement.h
Go to the documentation of this file.
1 /* This file is part of Soprano Project.
2  *
3  * Copyright (C) 2006 Daniele Galdi <daniele.galdi@gmail.com>
4  * Copyright (C) 2007-2009 Sebastian Trueg <trueg@kde.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef SOPRANO_STATEMENT_H
23 #define SOPRANO_STATEMENT_H
24 
25 #include "node.h"
26 #include "soprano_export.h"
27 
28 namespace Soprano
29 {
48  {
49  public:
51 
54  Statement();
55 
67  Statement( const Node &subject, const Node &predicate, const Node &object, const Node &context = Node() );
68 
69  Statement( const Statement &other );
70 
71  virtual ~Statement();
72 
73  Statement& operator=( const Statement& other );
75 
77  bool operator==( const Statement& other ) const;
78  bool operator!=( const Statement& other ) const;
79 
97  bool matches( const Statement& other ) const;
99 
101 
108  bool isValid() const;
110 
112 
115  Node subject() const;
116 
120  Node predicate() const;
121 
125  Node object() const;
126 
130  Node context() const;
132 
134 
139  void setSubject( const Node &subject );
140 
146  void setPredicate( const Node &predicate );
152  void setObject( const Node &object );
153 
159  void setContext( const Node &context );
161 
162  private:
163  class Private;
165  };
166 
170  SOPRANO_EXPORT uint qHash( const Statement& s );
171 }
172 
176 SOPRANO_EXPORT QDebug operator<<( QDebug s, const Soprano::Statement& );
177 
182 
183 #endif // SOPRANO_STATEMENT_H
184