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

Nepomuk

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

#include <Nepomuk/Query/LiteralTerm>

Inheritance diagram for Nepomuk::Query::LiteralTerm:
Nepomuk::Query::Term

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
Public Member Functions inherited from Nepomuk::Query::Term
 Term ()
 Term (const Term &other)
 ~Term ()
bool isAndTerm () const
bool isComparisonTerm () const
bool isLiteralTerm () const
bool isNegationTerm () const
bool isOptionalTerm () const
bool isOrTerm () const
bool isResourceTerm () const
bool isResourceTypeTerm () const
bool isValid () const
bool operator!= (const Term &term) const
QDebug operator<< (QDebug) const
Term & operator= (const Term &other)
bool operator== (const Term &term) const
Term optimized () const
AndTerm & toAndTerm ()
AndTerm toAndTerm () const
ComparisonTerm & toComparisonTerm ()
ComparisonTerm toComparisonTerm () const
LiteralTerm & toLiteralTerm ()
LiteralTerm toLiteralTerm () const
NegationTerm & toNegationTerm ()
NegationTerm toNegationTerm () const
OptionalTerm & toOptionalTerm ()
OptionalTerm toOptionalTerm () const
OrTerm & toOrTerm ()
OrTerm toOrTerm () const
ResourceTerm & toResourceTerm ()
ResourceTerm toResourceTerm () const
ResourceTypeTerm & toResourceTypeTerm ()
ResourceTypeTerm toResourceTypeTerm () const
QString toString () const
Type type () const

Additional Inherited Members

Public Types inherited from Nepomuk::Query::Term
enum  Type {
  Invalid , Literal , Resource , And ,
  Or , Comparison , ResourceType , Negation ,
  Optional
}
Static Public Member Functions inherited from Nepomuk::Query::Term
static Term fromString (const QString &s)
static Term fromVariant (const Variant &variant)
Related Symbols inherited from Nepomuk::Query::Term
static Term fromProperty (const Types::Property &property, const Variant &variant)

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") ) );
Nepomuk::Query::ComparisonTerm
A term matching the value of a property.
Definition comparisonterm.h:71
Nepomuk::Query::LiteralTerm::LiteralTerm
LiteralTerm(const LiteralTerm &term)
Copy constructor.

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.nosp@m.@kde.nosp@m..org
Since
4.4

Definition at line 86 of file literalterm.h.

Constructor & Destructor Documentation

◆ LiteralTerm() [1/2]

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

Copy constructor.

◆ LiteralTerm() [2/2]

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

Default constructor.

Parameters
valueThe value this LiteralTerm should match to.

◆ ~LiteralTerm()

Nepomuk::Query::LiteralTerm::~LiteralTerm ( )

Desctructor.

Member Function Documentation

◆ operator=()

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

Assignment operator.

◆ setValue()

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

Set the value this LiteralTerm should match to.

See also
value()

◆ 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
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 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
  • 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