Soprano 2.9.4
indexfiltermodel.h
Go to the documentation of this file.
1/*
2 * This file is part of Soprano Project.
3 *
4 * Copyright (C) 2007-2008 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_INDEX_MODEL_FILTER_H_
23#define _SOPRANO_INDEX_MODEL_FILTER_H_
24
25#include "filtermodel.h"
26#include "soprano_export.h"
27
28namespace Soprano {
29
30 namespace Query {
31 class Query;
32 }
33
44 namespace Index {
45
46 class CLuceneIndex;
47 class QueryResult;
48 class IndexFilterModelPrivate;
49
62 {
63 public:
73 IndexFilterModel( const QString& indexDir, Soprano::Model* model = 0 );
74
84
89
94
103
110
117
142 QueryResultIterator executeQuery( const QString& query, Query::QueryLanguage language, const QString& userQueryLanguage = QString() ) const;
143
144 /*
145 * Extract full text matching parts of a %query and replace them with
146 * results from an index %query.
147 *
148 * \param query The query to rewrite.
149 *
150 * \return A rewritten query stripped of all full test and regexp matching parts
151 * and replaced by results from an index query.
152 */
153// Query::Query evaluateAndRewriteQuery( const Query::Query& query ) const;
154
165 void setTransactionCacheSize( int size );
166
173
183
193
206 void addIndexOnlyPredicate( const QUrl& predicate );
207
220 void setIndexOnlyPredicates( const QList<QUrl>& predicates );
221
236
248 void addForceIndexPredicate( const QUrl& predicate );
249
279 void setForceIndexPredicates( const QList<QUrl>& predicates );
280
292
311
330
331 using FilterModel::addStatement;
332 using FilterModel::removeStatement;
333 using FilterModel::removeAllStatements;
334
335 private:
336 IndexFilterModelPrivate* const d;
337 };
338 }
339}
340
341#endif
A FilterModel is a virtual model that wraps another Model.
Definition: filtermodel.h:49
The CLuceneIndex provides a wrapper around a CLucene index which stores RDF statements.
Definition: cluceneindex.h:76
The IndexFilterModel provides a full text index around any Soprano Model.
static QString encodeUriForLuceneQuery(const QUrl &uri)
void setIndexOnlyPredicates(const QList< QUrl > &predicates)
Soprano::Error::ErrorCode removeStatement(const Soprano::Statement &statement)
void setTransactionCacheSize(int size)
void addIndexOnlyPredicate(const QUrl &predicate)
QList< QUrl > forceIndexPredicates() const
Soprano::Error::ErrorCode addStatement(const Soprano::Statement &statement)
void addForceIndexPredicate(const QUrl &predicate)
QueryResultIterator executeQuery(const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
static QString encodeStringForLuceneQuery(const QString &value)
CLuceneIndex * index() const
IndexFilterModel(CLuceneIndex *index, Soprano::Model *model=0)
IndexFilterModel(const QString &indexDir, Soprano::Model *model=0)
Soprano::Error::ErrorCode removeAllStatements(const Soprano::Statement &statement)
void setForceIndexPredicates(const QList< QUrl > &predicates)
QList< QUrl > indexOnlyPredicates() const
A Model is the central class in Soprano. It is a queryable collection of RDF quadruples,...
Definition: model.h:95
An iterator for query results.
A Statement instance represents one RDF quadruple.
Definition: statement.h:48
#define SOPRANO_INDEX_EXPORT