• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

NepomukDaemons

Nepomuk::Search::Term

Nepomuk::Search::Term Class Reference

A Query constist of Terms. More...

#include <nepomuk/term.h>

List of all members.


Public Types

enum  Comparator {
  Contains, Equal, Greater, Smaller,
  GreaterOrEqual, SmallerOrEqual
}
enum  Type {
  InvalidTerm, LiteralTerm, ResourceTerm, AndTerm,
  OrTerm, ComparisonTerm
}

Public Member Functions

void addSubTerm (const Term &)
Comparator comparator () const
QString field () const
bool isValid () const
Term & operator= (const Soprano::LiteralValue &other)
Term & operator= (const Term &other)
bool operator== (const Term &) const
QUrl property () const
QUrl resource () const
void setComparator (Comparator)
void setField (const QString &)
void setProperty (const QUrl &)
void setResource (const QUrl &)
void setSubTerms (const QList< Term > &)
void setType (Type)
void setValue (const Soprano::LiteralValue &)
QList< Term > subTerms () const
 Term (const QUrl &field, const QUrl &resource)
 Term (const QUrl &field, const Soprano::LiteralValue &value, Comparator c=Contains)
 Term (const QString &field, const Soprano::LiteralValue &value, Comparator c=Contains)
 Term (const QUrl &resource)
 Term (const Soprano::LiteralValue &value)
 Term (const Term &other)
 Term ()
Type type () const
Soprano::LiteralValue value () const
 ~Term ()

Detailed Description

A Query constist of Terms.

Queries are build from Term instances. A Term can have one of multiple types and subterms. See Term::Type for details on the different Term types.

Author:
Sebastian Trueg <trueg@kde.org>

Definition at line 44 of file term.h.


Member Enumeration Documentation

enum Nepomuk::Search::Term::Comparator

Enumerator:
Contains 
Equal 
Greater 
Smaller 
GreaterOrEqual 
SmallerOrEqual 

Definition at line 88 of file term.h.

enum Nepomuk::Search::Term::Type

Each search term has a type.

Enumerator:
InvalidTerm  An invalid term does not do anything.
LiteralTerm  A literal term is the simplest form of Term.

It matches all resource that contain the value.

It is also used to specify literal values in comparison Terms such as ContainsTerm or EqualityTerm.

ResourceTerm  A resource term matches one resource by URI.

It is also used to specify a resource in EqualityTerm Terms.

AndTerm  Match all resources that match all sub terms.
OrTerm  Match all resources that match one of the sub terms.
ComparisonTerm  A comparison.

The comparison operator needs to be specified in addition. For specifying the property the same applies as for ContainsTerm.

A single subterm specifies the resource or value to match (resource terms can only be matched via Equal or Contains.

Definition at line 50 of file term.h.


Constructor & Destructor Documentation

Nepomuk::Search::Term::Term (  ) 

Constructs an invalid term.

Definition at line 46 of file term.cpp.

Nepomuk::Search::Term::Term ( const Term &  other  ) 

Copy constructor.

Definition at line 52 of file term.cpp.

Nepomuk::Search::Term::Term ( const Soprano::LiteralValue &  value  ) 

Construct a literal term.

Definition at line 58 of file term.cpp.

Nepomuk::Search::Term::Term ( const QUrl &  resource  ) 

Construct a resource term.

Definition at line 65 of file term.cpp.

Nepomuk::Search::Term::Term ( const QString &  field,
const Soprano::LiteralValue &  value,
Comparator  c = Contains 
)

Construct a Contains ComparisonTerm term.

Parameters:
field A string that will be matched against a field label
value A value that will be matched against the field value. Unsupported types are converted to string.
comparator The Comparator to use

Definition at line 72 of file term.cpp.

Nepomuk::Search::Term::Term ( const QUrl &  field,
const Soprano::LiteralValue &  value,
Comparator  c = Contains 
)

Construct a Contains ComparisonTerm term.

Parameters:
field The exact field to match
value A value that will be matched against the field value. Unsupported types are converted to string.
comparator The Comparator to use

Definition at line 80 of file term.cpp.

Nepomuk::Search::Term::Term ( const QUrl &  field,
const QUrl &  resource 
)

Construct an EqualityTerm term.

Parameters:
field The exact field to match
value The resource that should be matched.

Definition at line 88 of file term.cpp.

Nepomuk::Search::Term::~Term (  ) 

Destructor.

Definition at line 96 of file term.cpp.


Member Function Documentation

void Nepomuk::Search::Term::addSubTerm ( const Term &  term  ) 

Add a subterm used by AndTerm, OrTerm, and ComparisonTerm.

See also:
setSubTerm

Definition at line 230 of file term.cpp.

Nepomuk::Search::Term::Comparator Nepomuk::Search::Term::comparator (  )  const

The Comparator used by ComparisonTerm Terms.

See also:
setComparator

Definition at line 160 of file term.cpp.

QString Nepomuk::Search::Term::field (  )  const

A property name used for ComparisonTerm Terms.

Will be matched against the rdfs:label to find the corresponding property.

See also:
setField, property, setProperty

Definition at line 166 of file term.cpp.

bool Nepomuk::Search::Term::isValid (  )  const

Returns:
true if the Term is valid.

Definition at line 118 of file term.cpp.

Nepomuk::Search::Term & Nepomuk::Search::Term::operator= ( const Soprano::LiteralValue &  other  ) 

Make the term a literal term.

Definition at line 108 of file term.cpp.

Nepomuk::Search::Term & Nepomuk::Search::Term::operator= ( const Term &  other  ) 

Assign another term to this one.

Definition at line 101 of file term.cpp.

bool Nepomuk::Search::Term::operator== ( const Term &  other  )  const

Comparison operator.

Definition at line 253 of file term.cpp.

QUrl Nepomuk::Search::Term::property (  )  const

A property used for ComparisonTerm Terms.

See also:
setProperty, field, setField

Definition at line 172 of file term.cpp.

QUrl Nepomuk::Search::Term::resource (  )  const

The resource of a ResourceTerm.

See also:
setResource

Definition at line 154 of file term.cpp.

void Nepomuk::Search::Term::setComparator ( Comparator  c  ) 

Defaults to Equal.

Definition at line 204 of file term.cpp.

void Nepomuk::Search::Term::setField ( const QString &  f  ) 

Set the property label in case the exact property is not known.

Will be mached against the property's rdfs:label.

See also:
field, setProperty, property

Definition at line 210 of file term.cpp.

void Nepomuk::Search::Term::setProperty ( const QUrl &  p  ) 

Set the property for ComparisonTerm Terms.

If the exact property is not known use setField.

See also:
property

Definition at line 223 of file term.cpp.

void Nepomuk::Search::Term::setResource ( const QUrl &  res  ) 

Set the resource of a ResourceTerm.

Definition at line 197 of file term.cpp.

void Nepomuk::Search::Term::setSubTerms ( const QList< Term > &  terms  ) 

Set the subterms used by AndTerm, OrTerm, and ComparisonTerm.

See also:
addSubTerm

Definition at line 217 of file term.cpp.

void Nepomuk::Search::Term::setType ( Type  type  ) 

Set the type of the Term.

Definition at line 184 of file term.cpp.

void Nepomuk::Search::Term::setValue ( const Soprano::LiteralValue &  v  ) 

Set the value of a LiteralTerm.

Definition at line 190 of file term.cpp.

QList< Nepomuk::Search::Term > Nepomuk::Search::Term::subTerms (  )  const

The sub terms used by AndTerm, OrTerm, and ComparisonTerm.

See also:
setSubTerms, addSubTerm

Definition at line 178 of file term.cpp.

Nepomuk::Search::Term::Type Nepomuk::Search::Term::type (  )  const

Returns:
the Term type.
See also:
setType

Definition at line 142 of file term.cpp.

Soprano::LiteralValue Nepomuk::Search::Term::value (  )  const

The literal value of a LiteralTerm.

See also:
setValue

Definition at line 148 of file term.cpp.


The documentation for this class was generated from the following files:
  • term.h
  • term.cpp

NepomukDaemons

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

API Reference

Skip menu "API Reference"
  • KCMShell
  • KNotify
  • KStyles
  • Nepomuk Daemons
Generated for API Reference by doxygen 1.5.7
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