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

Nepomuk

  • Nepomuk
  • Query
  • LiteralTerm
Public Member Functions

Nepomuk::Query::LiteralTerm Class Reference

Match literal properties via full text. More...

#include <Nepomuk/Query/LiteralTerm>

Inheritance diagram for Nepomuk::Query::LiteralTerm:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 LiteralTerm (const LiteralTerm &term)
 LiteralTerm (const Soprano::LiteralValue &value=Soprano::LiteralValue())
 ~LiteralTerm ()
LiteralTerm & operator= (const LiteralTerm &term)
void setValue (const Soprano::LiteralValue &value)
Soprano::LiteralValue value () const

Detailed Description

Match literal properties via full text.

Other than the rest of the terms LiteralTerm has two uses:

Usage in ComparisonTerm

LiteralTerm can be used in a ComparisonTerm with both properties with a literal range and a resource range. The former case is the simple one: the value() of the LiteralTerm will simply be compared to the value of the ComparisonTerm::property(). In the latter case value() will be matched to rdfs:label of any resource. So in essence the following two examples are equal:

 ComparisonTerm( Vocabulary::NAO::hasTag(), LiteralTerm("nepomuk") );
 ComparisonTerm( Vocabulary::NAO::hasTag(), ComparisonTerm( Vocabulary::RDFS::label(), LiteralTerm("nepomuk") ) );

Usage as "stand-alone" term

As a term by itself LiteralTerm will act like a traditional full text query and match all resources that contain the string value in some property.

 LiteralTerm( "nepomuk" );

The example above will match all resources that have a property with a value containing the string "nepomuk".

Examples

LiteralTerm("nepomuk")

searches for the term "nepomuk".

LiteralTerm("'nepomuk*'")

searches for the terms starting with "nepomuk".

LiteralTerm("'nepomuk kde'")

searches for the term "nepomuk kde".

LiteralTerm("'nepomuk* kde'")

searches for terms matching "nepomuk* kde".

LiteralTerm always tries to normalize the query terms as best as possible. This includes automatically adding quotes as needed.

Warning:
Be aware that the examples above apply to using LiteralTerm as a stand-alone term or in a ComparisonTerm::Contains term. When using ComparisonTerm::Regexp the test as specified will be used as-is to create the regular expression.
Author:
Sebastian Trueg <trueg@kde.org>
Since:
4.4

Definition at line 86 of file literalterm.h.


Constructor & Destructor Documentation

Nepomuk::Query::LiteralTerm::LiteralTerm ( const LiteralTerm &  term)

Copy constructor.

Nepomuk::Query::LiteralTerm::LiteralTerm ( const Soprano::LiteralValue &  value = Soprano::LiteralValue())

Default constructor.

Parameters:
valueThe value this LiteralTerm should match to.
Nepomuk::Query::LiteralTerm::~LiteralTerm ( )

Desctructor.


Member Function Documentation

LiteralTerm& Nepomuk::Query::LiteralTerm::operator= ( const LiteralTerm &  term)

Assignment operator.

void Nepomuk::Query::LiteralTerm::setValue ( const Soprano::LiteralValue &  value)

Set the value this LiteralTerm should match to.

See also:
value()
Soprano::LiteralValue Nepomuk::Query::LiteralTerm::value ( ) const

The value this LiteralTerm should match to.

See also:
setValue()

The documentation for this class was generated from the following file:
  • literalterm.h

Nepomuk

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • 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
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal