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

Nepomuk

  • Nepomuk
  • Query
  • Result
Public Member Functions | List of all members
Nepomuk::Query::Result Class Reference

#include <Nepomuk/Query/Result>

Public Member Functions

 Result ()
 
 Result (const Nepomuk::Resource &resource, double score=0.0)
 
 Result (const Result &)
 
 ~Result ()
 
Variant additionalBinding (const QString &name) const
 
Soprano::BindingSet additionalBindings () const
 
void addRequestProperty (const Types::Property &property, const Soprano::Node &value)
 
QString excerpt () const
 
Result & operator= (const Result &)
 
bool operator== (const Result &) const
 
Soprano::Node operator[] (const Types::Property &property) const
 
QHash< Types::Property,
Soprano::Node > 
requestProperties () const
 
Soprano::Node requestProperty (const Types::Property &property) const
 
Resource resource () const
 
double score () const
 
void setAdditionalBindings (const Soprano::BindingSet &bindings)
 
void setExcerpt (const QString &text)
 
void setScore (double score)
 

Detailed Description

A single search result.

A search via QueryServiceClient returns a set of Result object. A result consists of a Nepomuk::Resource and an optional score.

Additional bindings (variable values) as requested via ComparisonTerm::setVariableName() can be retrieved using additionalBinding().

Author
Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org
Since
4.4

Definition at line 57 of file result.h.

Constructor & Destructor Documentation

Nepomuk::Query::Result::Result ( )

Create an empty result.

Nepomuk::Query::Result::Result ( const Nepomuk::Resource &  resource,
double  score = 0.0 
)

Create a new result.

Parameters
resourceThe result resource.
scoreThe optional result score.
Nepomuk::Query::Result::Result ( const Result &  )

Copy constructor.

Nepomuk::Query::Result::~Result ( )

Destructor.

Member Function Documentation

Variant Nepomuk::Query::Result::additionalBinding ( const QString &  name) const

Retrieve an additional binding as returned by the query.

Typically these bindings are created via ComparisonTerm::setVariableName(). But they could also stem from custom SPARQL queries. A simple example would be:

select ?r ?rating where { ?r nao:numericRating ?rating . }

Here ?r would be used as the result's resource while ?rating could be accessed via

additionalBinding( QLatin1String("rating") );

If for some reason one needs the plain binding values one could use additionalBinding().

Since
4.5
Soprano::BindingSet Nepomuk::Query::Result::additionalBindings ( ) const

Retrieve the set of additional bindings as set via setAdditionalBindings().

Normally one would use additionalBinding() instead.

Since
4.5
void Nepomuk::Query::Result::addRequestProperty ( const Types::Property &  property,
const Soprano::Node &  value 
)

Add the value of a request property.

See also
Query::RequestProperty
QString Nepomuk::Query::Result::excerpt ( ) const

An excerpt of the matched text with highlighted search words in case the query contained a full text matching.

Returns
A rich-text snippet highlighting the search words or and empty string if the query did not contain any full text search terms.
See also
LiteralTerm
Since
4.6
Result& Nepomuk::Query::Result::operator= ( const Result &  )

Assignment operator.

bool Nepomuk::Query::Result::operator== ( const Result &  ) const

Comparison operator.

Soprano::Node Nepomuk::Query::Result::operator[] ( const Types::Property &  property) const

Retrieve value of request property property.

See also
requestProperties, addRequestProperty
QHash<Types::Property, Soprano::Node> Nepomuk::Query::Result::requestProperties ( ) const

Retrieve the values of the request properties.

See also
Query::RequestProperty
Soprano::Node Nepomuk::Query::Result::requestProperty ( const Types::Property &  property) const

Retrieve value of request property property.

See also
additionalBinding, requestProperties, addRequestProperty
Resource Nepomuk::Query::Result::resource ( ) const

The result resource.

double Nepomuk::Query::Result::score ( ) const

The score of the result.

By default the value is 0.0 which means no score.

Be aware that scoring needs to be enabled via Query::setFullTextScoringEnabled() in order for this value to be filled.

See also
setScore
void Nepomuk::Query::Result::setAdditionalBindings ( const Soprano::BindingSet &  bindings)

Set the additional bindings a query returned besides the result itself and the request properties.

Normally there is no need to call this method as the query service does set the bindings.

Since
4.5
void Nepomuk::Query::Result::setExcerpt ( const QString &  text)

Set the excerpt from the query.

Normally there is no need to call this method as the query service does set the excerpt.

Since
4.6
void Nepomuk::Query::Result::setScore ( double  score)

Set the score of the result.

Normally there is no need to call this method as the query service does set the bindings.

See also
score

The documentation for this class was generated from the following file:
  • result.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:27 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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