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 
28 namespace 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 
93  CLuceneIndex* index() const;
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 
166 
172  int transactionCacheSize() const;
173 
182  void rebuildIndex();
183 
193 
207 
220  void setIndexOnlyPredicates( const QList<QUrl>& predicates );
221 
236 
249 
279  void setForceIndexPredicates( const QList<QUrl>& predicates );
280 
292 
311 
329  static QString encodeUriForLuceneQuery( const QUrl& uri );
330 
334 
335  private:
336  IndexFilterModelPrivate* const d;
337  };
338  }
339 }
340 
341 #endif
soprano_export.h
QUrl
Soprano::Index::IndexFilterModel::setForceIndexPredicates
void setForceIndexPredicates(const QList< QUrl > &predicates)
Soprano::Index::IndexFilterModel::addIndexOnlyPredicate
void addIndexOnlyPredicate(const QUrl &predicate)
Soprano::Index::IndexFilterModel::setTransactionCacheSize
void setTransactionCacheSize(int size)
Soprano::Index::IndexFilterModel::IndexFilterModel
IndexFilterModel(const QString &indexDir, Soprano::Model *model=0)
Soprano::Index::IndexFilterModel::encodeStringForLuceneQuery
static QString encodeStringForLuceneQuery(const QString &value)
Soprano::Query::QueryLanguage
QueryLanguage
Definition: sopranotypes.h:129
Soprano::Vocabulary::RDF::predicate
SOPRANO_EXPORT QUrl predicate()
Soprano::FilterModel::addStatement
virtual Error::ErrorCode addStatement(const Statement &statement)=0
Soprano::Index::IndexFilterModel::IndexFilterModel
IndexFilterModel(CLuceneIndex *index, Soprano::Model *model=0)
Soprano::FilterModel
A FilterModel is a virtual model that wraps another Model.
Definition: filtermodel.h:49
QList
Soprano::Vocabulary::Xesam::size
SOPRANO_EXPORT QUrl size()
Soprano::Vocabulary::RDF::value
SOPRANO_EXPORT QUrl value()
Soprano::Statement
A Statement instance represents one RDF quadruple.
Definition: statement.h:48
Soprano::Index::IndexFilterModel::optimizeIndex
void optimizeIndex()
Soprano::Index::IndexFilterModel::index
CLuceneIndex * index() const
Soprano::QueryResultIterator
An iterator for query results.
Definition: queryresultiterator.h:109
SOPRANO_INDEX_EXPORT
#define SOPRANO_INDEX_EXPORT
Definition: soprano_export.h:73
Soprano::Index::CLuceneIndex
The CLuceneIndex provides a wrapper around a CLucene index which stores RDF statements.
Definition: cluceneindex.h:76
filtermodel.h
Soprano::Index::IndexFilterModel::removeStatement
Soprano::Error::ErrorCode removeStatement(const Soprano::Statement &statement)
Soprano::Index::IndexFilterModel::~IndexFilterModel
~IndexFilterModel()
Soprano::Index::IndexFilterModel::forceIndexPredicates
QList< QUrl > forceIndexPredicates() const
Soprano::FilterModel::removeStatement
virtual Error::ErrorCode removeStatement(const Statement &statement)=0
Soprano::Index::IndexFilterModel::transactionCacheSize
int transactionCacheSize() const
Soprano::Model
A Model is the central class in Soprano. It is a queryable collection of RDF quadruples,...
Definition: model.h:95
Soprano::Index::IndexFilterModel::removeAllStatements
Soprano::Error::ErrorCode removeAllStatements(const Soprano::Statement &statement)
Soprano::Index::IndexFilterModel
The IndexFilterModel provides a full text index around any Soprano Model.
Definition: indexfiltermodel.h:62
Soprano
Definition: backend.h:36
Soprano::Index::IndexFilterModel::indexOnlyPredicates
QList< QUrl > indexOnlyPredicates() const
Soprano::Index::IndexFilterModel::rebuildIndex
void rebuildIndex()
Soprano::Index::IndexFilterModel::executeQuery
QueryResultIterator executeQuery(const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
Soprano::Index::IndexFilterModel::addForceIndexPredicate
void addForceIndexPredicate(const QUrl &predicate)
Soprano::Index::IndexFilterModel::setIndexOnlyPredicates
void setIndexOnlyPredicates(const QList< QUrl > &predicates)
Soprano::Error::ErrorCode
ErrorCode
Definition: error.h:40
Soprano::FilterModel::removeAllStatements
virtual Error::ErrorCode removeAllStatements(const Statement &statement)=0
QString
Soprano::Index::IndexFilterModel::addStatement
Soprano::Error::ErrorCode addStatement(const Soprano::Statement &statement)
Soprano::Vocabulary::Xesam::language
SOPRANO_EXPORT QUrl language()
Soprano::Index::IndexFilterModel::encodeUriForLuceneQuery
static QString encodeUriForLuceneQuery(const QUrl &uri)