• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

Nepomuk

  • nepomuk
  • query
result.h
Go to the documentation of this file.
1/*
2 This file is part of the Nepomuk KDE project.
3 Copyright (C) 2008-2010 Sebastian Trueg <trueg@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18 */
19
20#ifndef _NEPOMUK_QUERY_RESULT_H_
21#define _NEPOMUK_QUERY_RESULT_H_
22
23#include <QtCore/QSharedDataPointer>
24#include <QtCore/QUrl>
25#include <QtCore/QList>
26#include <QtCore/QHash>
27
28#include <Soprano/Statement>
29#include <Soprano/BindingSet>
30
31#include "nepomukquery_export.h"
32
33namespace Nepomuk {
34
35 class Resource;
36 class Variant;
37 namespace Types {
38 class Property;
39 }
40
41 namespace Query {
57 class NEPOMUKQUERY_EXPORT Result
58 {
59 public:
63 Result();
64
71 Result( const Nepomuk::Resource& resource, double score = 0.0 );
72
76 Result( const Result& );
77
81 ~Result();
82
86 Result& operator=( const Result& );
87
97 double score() const;
98
102 Resource resource() const;
103
112 void setScore( double score );
113
119 void addRequestProperty( const Types::Property& property, const Soprano::Node& value );
120
126 QHash<Types::Property, Soprano::Node> requestProperties() const;
127
133 Soprano::Node operator[]( const Types::Property& property ) const;
134
140 Soprano::Node requestProperty( const Types::Property& property ) const;
141
151 void setAdditionalBindings( const Soprano::BindingSet& bindings );
152
159 Soprano::BindingSet additionalBindings() const;
160
183 Variant additionalBinding( const QString& name ) const;
184
193 void setExcerpt( const QString& text );
194
207 QString excerpt() const;
208
212 bool operator==( const Result& ) const;
213
214 private:
215 class Private;
216 QSharedDataPointer<Private> d;
217 };
218 }
219}
220
221#endif
Nepomuk::Query::Result
A single search result.
Definition: result.h:58
Nepomuk::Query::Result::requestProperties
QHash< Types::Property, Soprano::Node > requestProperties() const
Retrieve the values of the request properties.
Nepomuk::Query::Result::setAdditionalBindings
void setAdditionalBindings(const Soprano::BindingSet &bindings)
Set the additional bindings a query returned besides the result itself and the request properties.
Nepomuk::Query::Result::addRequestProperty
void addRequestProperty(const Types::Property &property, const Soprano::Node &value)
Add the value of a request property.
Nepomuk::Query::Result::setExcerpt
void setExcerpt(const QString &text)
Set the excerpt from the query.
Nepomuk::Query::Result::Result
Result(const Result &)
Copy constructor.
Nepomuk::Query::Result::Result
Result(const Nepomuk::Resource &resource, double score=0.0)
Create a new result.
Nepomuk::Query::Result::additionalBinding
Variant additionalBinding(const QString &name) const
Retrieve an additional binding as returned by the query.
Nepomuk::Query::Result::~Result
~Result()
Destructor.
Nepomuk::Query::Result::score
double score() const
The score of the result.
Nepomuk::Query::Result::Result
Result()
Create an empty result.
Nepomuk::Query::Result::resource
Resource resource() const
The result resource.
Nepomuk::Query::Result::excerpt
QString excerpt() const
An excerpt of the matched text with highlighted search words in case the query contained a full text ...
Nepomuk::Query::Result::setScore
void setScore(double score)
Set the score of the result.
Nepomuk::Query::Result::operator=
Result & operator=(const Result &)
Assignment operator.
Nepomuk::Query::Result::requestProperty
Soprano::Node requestProperty(const Types::Property &property) const
Retrieve value of request property property.
Nepomuk::Query::Result::additionalBindings
Soprano::BindingSet additionalBindings() const
Retrieve the set of additional bindings as set via setAdditionalBindings().
Nepomuk::Query::Result::operator[]
Soprano::Node operator[](const Types::Property &property) const
Retrieve value of request property property.
Nepomuk::Query::Result::operator==
bool operator==(const Result &) const
Comparison operator.
Nepomuk::Resource
Resource is the central object type in Nepomuk.
Definition: resource.h:95
Nepomuk::Types::Property
A property is a resource of type rdf:Property which relates a domain with a range.
Definition: property.h:53
Nepomuk::Variant
The Nepomuk Variant extends over QVariant by introducing direct support for Resource embedding,...
Definition: variant.h:66
Nepomuk
nepomukquery_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk

Skip menu "Nepomuk"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal