knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::TripleTemplate< StringType > Class Template Reference

#include <Triple.h>

Inheritance diagram for knowrob::TripleTemplate< StringType >:
Collaboration diagram for knowrob::TripleTemplate< StringType >:

Public Member Functions

 TripleTemplate ()
 
 TripleTemplate (std::string_view subject_iri, std::string_view predicate_iri)
 
 TripleTemplate (std::string_view subject_iri, std::string_view predicate_iri, std::string_view object_iri)
 
template<typename ValT >
 TripleTemplate (std::string_view subject, std::string_view predicate, const ValT &object, XSDType type)
 
 TripleTemplate (const Triple &other)
 
void setSubject (std::string_view subject) override
 
void setPredicate (std::string_view predicate) override
 
void setObjectIRI (std::string_view object) override
 
void setSubjectBlank (std::string_view identifier) override
 
void setObjectBlank (std::string_view identifier) override
 
void setStringValue (std::string_view v) override
 
void setDoubleValue (double v) override
 
void setFloatValue (float v) override
 
void setIntValue (int v) override
 
void setBooleanValue (bool v) override
 
void setLongValue (long v) override
 
void setShortValue (short v) override
 
void setUnsignedLongValue (unsigned long v) override
 
void setUnsignedIntValue (unsigned int v) override
 
void setUnsignedShortValue (unsigned short v) override
 
void setGraph (std::string_view graph) override
 
void setPerspective (std::string_view perspective) override
 
std::string_view subject () const override
 
std::string_view predicate () const override
 
std::string_view valueAsString () const override
 
double valueAsDouble () const override
 
float valueAsFloat () const override
 
long valueAsLong () const override
 
int valueAsInt () const override
 
bool valueAsBoolean () const override
 
short valueAsShort () const override
 
unsigned long valueAsUnsignedLong () const override
 
unsigned int valueAsUnsignedInt () const override
 
unsigned short valueAsUnsignedShort () const override
 
std::optional< std::string_view > graph () const override
 
std::optional< std::string_view > perspective () const override
 
void reset () override
 
 TripleTemplate ()
 
 TripleTemplate (std::string_view subject_iri, std::string_view predicate_iri)
 
 TripleTemplate (std::string_view subject_iri, std::string_view predicate_iri, std::string_view object_iri)
 
template<typename ValT >
 TripleTemplate (std::string_view subject, std::string_view predicate, const ValT &object, XSDType type)
 
 TripleTemplate (const Triple &other)
 
void setSubject (std::string_view subject) override
 
void setPredicate (std::string_view predicate) override
 
void setObjectIRI (std::string_view object) override
 
void setSubjectBlank (std::string_view identifier) override
 
void setObjectBlank (std::string_view identifier) override
 
void setStringValue (std::string_view v) override
 
void setDoubleValue (double v) override
 
void setFloatValue (float v) override
 
void setIntValue (int v) override
 
void setBooleanValue (bool v) override
 
void setLongValue (long v) override
 
void setShortValue (short v) override
 
void setUnsignedLongValue (unsigned long v) override
 
void setUnsignedIntValue (unsigned int v) override
 
void setUnsignedShortValue (unsigned short v) override
 
void setGraph (std::string_view graph) override
 
void setPerspective (std::string_view perspective) override
 
std::string_view subject () const override
 
std::string_view predicate () const override
 
std::string_view valueAsString () const override
 
double valueAsDouble () const override
 
float valueAsFloat () const override
 
long valueAsLong () const override
 
int valueAsInt () const override
 
bool valueAsBoolean () const override
 
short valueAsShort () const override
 
unsigned long valueAsUnsignedLong () const override
 
unsigned int valueAsUnsignedInt () const override
 
unsigned short valueAsUnsignedShort () const override
 
std::optional< std::string_view > graph () const override
 
std::optional< std::string_view > perspective () const override
 
void reset () override
 
- Public Member Functions inherited from knowrob::Triple
 Triple ()
 
 Triple (XSDType xsdType)
 
virtual ~Triple ()=default
 
bool mergeFrame (const Triple &other)
 
bool isXSDLiteral () const
 
bool isSubjectBlank () const
 
bool isObjectBlank () const
 
bool isObjectIRI () const
 
bool isSubjectIRI () const
 
auto xsdType () const
 
auto xsdTypeIRI () const
 
void setXSDValue (std::string_view v, XSDType type)
 
std::string createStringValue () const
 
bool isOccasional () const
 
bool isUncertain () const
 
auto begin () const
 
auto end () const
 
auto confidence () const
 
void setIsOccasional (bool isOccasional)
 
void setIsUncertain (bool isUncertain)
 
void setBegin (double begin)
 
void setEnd (double end)
 
void setConfidence (double confidence)
 
bool operator== (const Triple &other) const
 
bool operator< (const Triple &other) const
 
void write (std::ostream &os) const override
 
 Triple ()
 
 Triple (XSDType xsdType)
 
virtual ~Triple ()=default
 
bool mergeFrame (const Triple &other)
 
bool isXSDLiteral () const
 
bool isSubjectBlank () const
 
bool isObjectBlank () const
 
bool isObjectIRI () const
 
bool isSubjectIRI () const
 
auto xsdType () const
 
auto xsdTypeIRI () const
 
void setXSDValue (std::string_view v, XSDType type)
 
std::string createStringValue () const
 
bool isOccasional () const
 
bool isUncertain () const
 
auto begin () const
 
auto end () const
 
auto confidence () const
 
void setIsOccasional (bool isOccasional)
 
void setIsUncertain (bool isUncertain)
 
void setBegin (double begin)
 
void setEnd (double end)
 
void setConfidence (double confidence)
 
bool operator== (const Triple &other) const
 
bool operator< (const Triple &other) const
 
void write (std::ostream &os) const override
 
- Public Member Functions inherited from knowrob::Printable
virtual ~Printable ()=default
 
virtual std::string format () const
 
virtual ~Printable ()=default
 
virtual std::string format () const
 

Protected Types

using TypedObject = std::variant< StringType, float, double, long, int, short, bool, unsigned long, unsigned int, unsigned short >
 
using TypedObject = std::variant< StringType, float, double, long, int, short, bool, unsigned long, unsigned int, unsigned short >
 

Protected Member Functions

template<typename ValT >
void set (const ValT &value, XSDType type)
 
template<typename ValT >
void set (const ValT &value, XSDType type)
 

Protected Attributes

StringType subject_
 
StringType predicate_
 
TypedObject object_
 
std::optional< StringType > graph_
 
std::optional< StringType > perspective_
 
- Protected Attributes inherited from knowrob::Triple
bool isOccasional_
 
bool isUncertain_
 
std::optional< double > begin_
 
std::optional< double > end_
 
std::optional< double > confidence_
 
std::optional< XSDTypexsdType_
 

Additional Inherited Members

- Static Protected Member Functions inherited from knowrob::Triple
static bool isBlank (std::string_view str)
 
static bool isBlank (std::string_view str)
 

Detailed Description

template<class StringType>
class knowrob::TripleTemplate< StringType >

A Triple with a specified string type for the triple data.

Template Parameters
StringTypethe string type for the triple data.

Definition at line 347 of file Triple.h.

Member Typedef Documentation

◆ TypedObject [1/2]

template<class StringType >
using knowrob::TripleTemplate< StringType >::TypedObject = std::variant<StringType, float, double, long, int, short, bool, unsigned long, unsigned int, unsigned short>
protected

Definition at line 349 of file Triple.h.

◆ TypedObject [2/2]

template<class StringType >
using knowrob::TripleTemplate< StringType >::TypedObject = std::variant<StringType, float, double, long, int, short, bool, unsigned long, unsigned int, unsigned short>
protected

Definition at line 349 of file Triple.h.

Constructor & Destructor Documentation

◆ TripleTemplate() [1/10]

template<class StringType >
knowrob::TripleTemplate< StringType >::TripleTemplate ( )
inline

Definition at line 360 of file Triple.h.

361  : Triple() {}

◆ TripleTemplate() [2/10]

template<class StringType >
knowrob::TripleTemplate< StringType >::TripleTemplate ( std::string_view  subject_iri,
std::string_view  predicate_iri 
)
inline

Definition at line 363 of file Triple.h.

364  : Triple(),
365  subject_(subject_iri),
366  predicate_(predicate_iri) {
367  xsdType_ = std::nullopt;
368  }
std::optional< XSDType > xsdType_
Definition: Triple.h:335
StringType predicate_
Definition: Triple.h:561
StringType subject_
Definition: Triple.h:560

◆ TripleTemplate() [3/10]

template<class StringType >
knowrob::TripleTemplate< StringType >::TripleTemplate ( std::string_view  subject_iri,
std::string_view  predicate_iri,
std::string_view  object_iri 
)
inline

Definition at line 370 of file Triple.h.

371  : Triple(),
372  subject_(subject_iri),
373  predicate_(predicate_iri) {
374  object_ = StringType(object_iri);
375  xsdType_ = std::nullopt;
376  }
TypedObject object_
Definition: Triple.h:562

◆ TripleTemplate() [4/10]

template<class StringType >
template<typename ValT >
knowrob::TripleTemplate< StringType >::TripleTemplate ( std::string_view  subject,
std::string_view  predicate,
const ValT &  object,
XSDType  type 
)
inline

Definition at line 379 of file Triple.h.

380  : Triple(),
381  subject_(subject),
383  if (type == XSDType::STRING) {
384  object_ = StringType(object);
385  xsdType_ = type;
386  } else {
387  set(object, type);
388  }
389  }
void set(const ValT &value, XSDType type)
Definition: Triple.h:568
std::string_view predicate() const override
Definition: Triple.h:506
std::string_view subject() const override
Definition: Triple.h:503
const IRIAtomPtr type
Definition: rdf.h:15

◆ TripleTemplate() [5/10]

template<class StringType >
knowrob::TripleTemplate< StringType >::TripleTemplate ( const Triple other)
inlineexplicit

Definition at line 391 of file Triple.h.

392  : Triple() {
393  subject_ = other.subject();
394  predicate_ = other.predicate();
395  isOccasional_ = other.isOccasional();
396  isUncertain_ = other.isUncertain();
397  xsdType_ = other.xsdType();
398  graph_ = other.graph();
399  perspective_ = other.perspective();
400  begin_ = other.begin();
401  end_ = other.end();
402  confidence_ = other.confidence();
403 
404  if (!xsdType_) {
405  object_ = StringType(other.valueAsString());
406  } else {
407  switch (*xsdType_) {
408  case XSDType::STRING:
409  object_ = StringType(other.valueAsString());
410  break;
411  case XSDType::FLOAT:
412  object_ = other.valueAsFloat();
413  break;
414  case XSDType::DOUBLE:
415  object_ = other.valueAsDouble();
416  break;
417  case XSDType::LONG:
418  object_ = other.valueAsLong();
419  break;
421  case XSDType::INTEGER:
422  object_ = other.valueAsInt();
423  break;
424  case XSDType::BOOLEAN:
425  object_ = other.valueAsBoolean();
426  break;
427  case XSDType::SHORT:
428  object_ = other.valueAsShort();
429  break;
431  object_ = other.valueAsUnsignedLong();
432  break;
434  object_ = other.valueAsUnsignedInt();
435  break;
437  object_ = other.valueAsUnsignedShort();
438  break;
439  case XSDType::LAST:
440  break;
441  }
442  }
443  }
bool isOccasional_
Definition: Triple.h:330
std::optional< double > end_
Definition: Triple.h:333
bool isUncertain_
Definition: Triple.h:331
std::optional< double > confidence_
Definition: Triple.h:334
std::optional< double > begin_
Definition: Triple.h:332
std::optional< StringType > graph_
Definition: Triple.h:564
std::optional< StringType > perspective_
Definition: Triple.h:565

◆ TripleTemplate() [6/10]

template<class StringType >
knowrob::TripleTemplate< StringType >::TripleTemplate ( )
inline

Definition at line 360 of file Triple.h.

361  : Triple() {}

◆ TripleTemplate() [7/10]

template<class StringType >
knowrob::TripleTemplate< StringType >::TripleTemplate ( std::string_view  subject_iri,
std::string_view  predicate_iri 
)
inline

Definition at line 363 of file Triple.h.

364  : Triple(),
365  subject_(subject_iri),
366  predicate_(predicate_iri) {
367  xsdType_ = std::nullopt;
368  }

◆ TripleTemplate() [8/10]

template<class StringType >
knowrob::TripleTemplate< StringType >::TripleTemplate ( std::string_view  subject_iri,
std::string_view  predicate_iri,
std::string_view  object_iri 
)
inline

Definition at line 370 of file Triple.h.

371  : Triple(),
372  subject_(subject_iri),
373  predicate_(predicate_iri) {
374  object_ = StringType(object_iri);
375  xsdType_ = std::nullopt;
376  }

◆ TripleTemplate() [9/10]

template<class StringType >
template<typename ValT >
knowrob::TripleTemplate< StringType >::TripleTemplate ( std::string_view  subject,
std::string_view  predicate,
const ValT &  object,
XSDType  type 
)
inline

Definition at line 379 of file Triple.h.

380  : Triple(),
381  subject_(subject),
383  if (type == XSDType::STRING) {
384  object_ = StringType(object);
385  xsdType_ = type;
386  } else {
387  set(object, type);
388  }
389  }

◆ TripleTemplate() [10/10]

template<class StringType >
knowrob::TripleTemplate< StringType >::TripleTemplate ( const Triple other)
inlineexplicit

Definition at line 391 of file Triple.h.

392  : Triple() {
393  subject_ = other.subject();
394  predicate_ = other.predicate();
395  isOccasional_ = other.isOccasional();
396  isUncertain_ = other.isUncertain();
397  xsdType_ = other.xsdType();
398  graph_ = other.graph();
399  perspective_ = other.perspective();
400  begin_ = other.begin();
401  end_ = other.end();
402  confidence_ = other.confidence();
403 
404  if (!xsdType_) {
405  object_ = StringType(other.valueAsString());
406  } else {
407  switch (*xsdType_) {
408  case XSDType::STRING:
409  object_ = StringType(other.valueAsString());
410  break;
411  case XSDType::FLOAT:
412  object_ = other.valueAsFloat();
413  break;
414  case XSDType::DOUBLE:
415  object_ = other.valueAsDouble();
416  break;
417  case XSDType::LONG:
418  object_ = other.valueAsLong();
419  break;
421  case XSDType::INTEGER:
422  object_ = other.valueAsInt();
423  break;
424  case XSDType::BOOLEAN:
425  object_ = other.valueAsBoolean();
426  break;
427  case XSDType::SHORT:
428  object_ = other.valueAsShort();
429  break;
431  object_ = other.valueAsUnsignedLong();
432  break;
434  object_ = other.valueAsUnsignedInt();
435  break;
437  object_ = other.valueAsUnsignedShort();
438  break;
439  case XSDType::LAST:
440  break;
441  }
442  }
443  }

Member Function Documentation

◆ graph() [1/2]

template<class StringType >
std::optional<std::string_view> knowrob::TripleTemplate< StringType >::graph ( ) const
inlineoverridevirtual
Returns
the graph of the triple.

Implements knowrob::Triple.

Definition at line 539 of file Triple.h.

539  {
540  if (graph_.has_value()) return graph_.value();
541  else return std::nullopt;
542  }

◆ graph() [2/2]

template<class StringType >
std::optional<std::string_view> knowrob::TripleTemplate< StringType >::graph ( ) const
inlineoverridevirtual
Returns
the graph of the triple.

Implements knowrob::Triple.

Definition at line 539 of file Triple.h.

539  {
540  if (graph_.has_value()) return graph_.value();
541  else return std::nullopt;
542  }

◆ perspective() [1/2]

template<class StringType >
std::optional<std::string_view> knowrob::TripleTemplate< StringType >::perspective ( ) const
inlineoverridevirtual
Returns
the perspective of the triple.

Implements knowrob::Triple.

Definition at line 545 of file Triple.h.

545  {
546  if (perspective_.has_value()) return perspective_.value();
547  else return std::nullopt;
548  }

◆ perspective() [2/2]

template<class StringType >
std::optional<std::string_view> knowrob::TripleTemplate< StringType >::perspective ( ) const
inlineoverridevirtual
Returns
the perspective of the triple.

Implements knowrob::Triple.

Definition at line 545 of file Triple.h.

545  {
546  if (perspective_.has_value()) return perspective_.value();
547  else return std::nullopt;
548  }

◆ predicate() [1/2]

template<class StringType >
std::string_view knowrob::TripleTemplate< StringType >::predicate ( ) const
inlineoverridevirtual
Returns
the predicate of the triple.

Implements knowrob::Triple.

Definition at line 506 of file Triple.h.

506 { return predicate_; }

◆ predicate() [2/2]

template<class StringType >
std::string_view knowrob::TripleTemplate< StringType >::predicate ( ) const
inlineoverridevirtual
Returns
the predicate of the triple.

Implements knowrob::Triple.

Definition at line 506 of file Triple.h.

506 { return predicate_; }

◆ reset() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::reset ( )
inlineoverridevirtual

Reset the triple to its initial state.

Implements knowrob::Triple.

Definition at line 550 of file Triple.h.

550  {
551  graph_ = std::nullopt;
552  begin_ = std::nullopt;
553  end_ = std::nullopt;
554  xsdType_ = std::nullopt;
555  isUncertain_ = false;
556  isOccasional_ = false;
557  }

◆ reset() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::reset ( )
inlineoverridevirtual

Reset the triple to its initial state.

Implements knowrob::Triple.

Definition at line 550 of file Triple.h.

550  {
551  graph_ = std::nullopt;
552  begin_ = std::nullopt;
553  end_ = std::nullopt;
554  xsdType_ = std::nullopt;
555  isUncertain_ = false;
556  isOccasional_ = false;
557  }

◆ set() [1/2]

template<class StringType >
template<typename ValT >
void knowrob::TripleTemplate< StringType >::set ( const ValT &  value,
XSDType  type 
)
inlineprotected

Definition at line 568 of file Triple.h.

568  {
569  object_ = value;
570  xsdType_ = type;
571  }

◆ set() [2/2]

template<class StringType >
template<typename ValT >
void knowrob::TripleTemplate< StringType >::set ( const ValT &  value,
XSDType  type 
)
inlineprotected

Definition at line 568 of file Triple.h.

568  {
569  object_ = value;
570  xsdType_ = type;
571  }

◆ setBooleanValue() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setBooleanValue ( bool  v)
inlineoverridevirtual

Assign a boolean value to the object of the triple.

Parameters
vthe boolean value to assign.

Implements knowrob::Triple.

Definition at line 479 of file Triple.h.

479 { set(v, XSDType::BOOLEAN); }

◆ setBooleanValue() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setBooleanValue ( bool  v)
inlineoverridevirtual

Assign a boolean value to the object of the triple.

Parameters
vthe boolean value to assign.

Implements knowrob::Triple.

Definition at line 479 of file Triple.h.

479 { set(v, XSDType::BOOLEAN); }

◆ setDoubleValue() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setDoubleValue ( double  v)
inlineoverridevirtual

Assign a double value to the object of the triple.

Parameters
vthe double value to assign.

Implements knowrob::Triple.

Definition at line 470 of file Triple.h.

470 { set(v, XSDType::DOUBLE); }

◆ setDoubleValue() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setDoubleValue ( double  v)
inlineoverridevirtual

Assign a double value to the object of the triple.

Parameters
vthe double value to assign.

Implements knowrob::Triple.

Definition at line 470 of file Triple.h.

470 { set(v, XSDType::DOUBLE); }

◆ setFloatValue() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setFloatValue ( float  v)
inlineoverridevirtual

Assign a float value to the object of the triple.

Parameters
vthe float value to assign.

Implements knowrob::Triple.

Definition at line 473 of file Triple.h.

473 { set(v, XSDType::FLOAT); }

◆ setFloatValue() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setFloatValue ( float  v)
inlineoverridevirtual

Assign a float value to the object of the triple.

Parameters
vthe float value to assign.

Implements knowrob::Triple.

Definition at line 473 of file Triple.h.

473 { set(v, XSDType::FLOAT); }

◆ setGraph() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setGraph ( std::string_view  graph)
inlineoverridevirtual
Parameters
graphthe graph of the triple.

Implements knowrob::Triple.

Definition at line 497 of file Triple.h.

497 { graph_ = graph; }
std::optional< std::string_view > graph() const override
Definition: Triple.h:539

◆ setGraph() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setGraph ( std::string_view  graph)
inlineoverridevirtual
Parameters
graphthe graph of the triple.

Implements knowrob::Triple.

Definition at line 497 of file Triple.h.

497 { graph_ = graph; }

◆ setIntValue() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setIntValue ( int  v)
inlineoverridevirtual

Assign a int value to the object of the triple.

Parameters
vthe int value to assign.

Implements knowrob::Triple.

Definition at line 476 of file Triple.h.

476 { set(v, XSDType::INTEGER); }

◆ setIntValue() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setIntValue ( int  v)
inlineoverridevirtual

Assign a int value to the object of the triple.

Parameters
vthe int value to assign.

Implements knowrob::Triple.

Definition at line 476 of file Triple.h.

476 { set(v, XSDType::INTEGER); }

◆ setLongValue() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setLongValue ( long  v)
inlineoverridevirtual

Assign a long value to the object of the triple.

Parameters
vthe long value to assign.

Implements knowrob::Triple.

Definition at line 482 of file Triple.h.

482 { set(v, XSDType::LONG); }

◆ setLongValue() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setLongValue ( long  v)
inlineoverridevirtual

Assign a long value to the object of the triple.

Parameters
vthe long value to assign.

Implements knowrob::Triple.

Definition at line 482 of file Triple.h.

482 { set(v, XSDType::LONG); }

◆ setObjectBlank() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setObjectBlank ( std::string_view  str)
inlineoverridevirtual
Parameters
stra blank node identifier for the object of the triple.

Implements knowrob::Triple.

Definition at line 461 of file Triple.h.

461 { setObjectIRI(identifier); }
void setObjectIRI(std::string_view object) override
Definition: Triple.h:452

◆ setObjectBlank() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setObjectBlank ( std::string_view  str)
inlineoverridevirtual
Parameters
stra blank node identifier for the object of the triple.

Implements knowrob::Triple.

Definition at line 461 of file Triple.h.

461 { setObjectIRI(identifier); }

◆ setObjectIRI() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setObjectIRI ( std::string_view  object)
inlineoverridevirtual
Parameters
objectthe object of the triple.

Implements knowrob::Triple.

Definition at line 452 of file Triple.h.

452  {
453  object_ = StringType(object);
454  xsdType_ = std::nullopt;
455  }

◆ setObjectIRI() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setObjectIRI ( std::string_view  object)
inlineoverridevirtual
Parameters
objectthe object of the triple.

Implements knowrob::Triple.

Definition at line 452 of file Triple.h.

452  {
453  object_ = StringType(object);
454  xsdType_ = std::nullopt;
455  }

◆ setPerspective() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setPerspective ( std::string_view  perspective)
inlineoverridevirtual
Parameters
perspectivethe perspective of the triple.

Implements knowrob::Triple.

Definition at line 500 of file Triple.h.

std::optional< std::string_view > perspective() const override
Definition: Triple.h:545

◆ setPerspective() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setPerspective ( std::string_view  perspective)
inlineoverridevirtual
Parameters
perspectivethe perspective of the triple.

Implements knowrob::Triple.

Definition at line 500 of file Triple.h.

◆ setPredicate() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setPredicate ( std::string_view  predicate)
inlineoverridevirtual
Parameters
predicatethe predicate of the triple.

Implements knowrob::Triple.

Definition at line 449 of file Triple.h.

449 { predicate_ = predicate; }

◆ setPredicate() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setPredicate ( std::string_view  predicate)
inlineoverridevirtual
Parameters
predicatethe predicate of the triple.

Implements knowrob::Triple.

Definition at line 449 of file Triple.h.

449 { predicate_ = predicate; }

◆ setShortValue() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setShortValue ( short  v)
inlineoverridevirtual

Assign a short value to the object of the triple.

Parameters
vthe short value to assign.

Implements knowrob::Triple.

Definition at line 485 of file Triple.h.

485 { set(v, XSDType::SHORT); }

◆ setShortValue() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setShortValue ( short  v)
inlineoverridevirtual

Assign a short value to the object of the triple.

Parameters
vthe short value to assign.

Implements knowrob::Triple.

Definition at line 485 of file Triple.h.

485 { set(v, XSDType::SHORT); }

◆ setStringValue() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setStringValue ( std::string_view  v)
inlineoverridevirtual

Assign a string value to the object of the triple.

Parameters
vthe string value to assign.

Implements knowrob::Triple.

Definition at line 464 of file Triple.h.

464  {
465  object_ = StringType(v);
467  }

◆ setStringValue() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setStringValue ( std::string_view  v)
inlineoverridevirtual

Assign a string value to the object of the triple.

Parameters
vthe string value to assign.

Implements knowrob::Triple.

Definition at line 464 of file Triple.h.

464  {
465  object_ = StringType(v);
467  }

◆ setSubject() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setSubject ( std::string_view  subject)
inlineoverridevirtual
Parameters
subjectthe subject of the triple.

Implements knowrob::Triple.

Definition at line 446 of file Triple.h.

446 { subject_ = subject; }

◆ setSubject() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setSubject ( std::string_view  subject)
inlineoverridevirtual
Parameters
subjectthe subject of the triple.

Implements knowrob::Triple.

Definition at line 446 of file Triple.h.

446 { subject_ = subject; }

◆ setSubjectBlank() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setSubjectBlank ( std::string_view  str)
inlineoverridevirtual
Parameters
stra blank node identifier for the subject of the triple.

Implements knowrob::Triple.

Definition at line 458 of file Triple.h.

458 { setSubject(identifier); }
void setSubject(std::string_view subject) override
Definition: Triple.h:446

◆ setSubjectBlank() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setSubjectBlank ( std::string_view  str)
inlineoverridevirtual
Parameters
stra blank node identifier for the subject of the triple.

Implements knowrob::Triple.

Definition at line 458 of file Triple.h.

458 { setSubject(identifier); }

◆ setUnsignedIntValue() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setUnsignedIntValue ( unsigned int  v)
inlineoverridevirtual

Assign a unsigned int value to the object of the triple.

Parameters
vthe unsigned int value to assign.

Implements knowrob::Triple.

Definition at line 491 of file Triple.h.

491 { set(v, XSDType::UNSIGNED_INT); }

◆ setUnsignedIntValue() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setUnsignedIntValue ( unsigned int  v)
inlineoverridevirtual

Assign a unsigned int value to the object of the triple.

Parameters
vthe unsigned int value to assign.

Implements knowrob::Triple.

Definition at line 491 of file Triple.h.

491 { set(v, XSDType::UNSIGNED_INT); }

◆ setUnsignedLongValue() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setUnsignedLongValue ( unsigned long  v)
inlineoverridevirtual

Assign a unsigned long value to the object of the triple.

Parameters
vthe unsigned long value to assign.

Implements knowrob::Triple.

Definition at line 488 of file Triple.h.

◆ setUnsignedLongValue() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setUnsignedLongValue ( unsigned long  v)
inlineoverridevirtual

Assign a unsigned long value to the object of the triple.

Parameters
vthe unsigned long value to assign.

Implements knowrob::Triple.

Definition at line 488 of file Triple.h.

◆ setUnsignedShortValue() [1/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setUnsignedShortValue ( unsigned short  v)
inlineoverridevirtual

Assign a unsigned short value to the object of the triple.

Parameters
vthe unsigned short value to assign.

Implements knowrob::Triple.

Definition at line 494 of file Triple.h.

◆ setUnsignedShortValue() [2/2]

template<class StringType >
void knowrob::TripleTemplate< StringType >::setUnsignedShortValue ( unsigned short  v)
inlineoverridevirtual

Assign a unsigned short value to the object of the triple.

Parameters
vthe unsigned short value to assign.

Implements knowrob::Triple.

Definition at line 494 of file Triple.h.

◆ subject() [1/2]

template<class StringType >
std::string_view knowrob::TripleTemplate< StringType >::subject ( ) const
inlineoverridevirtual
Returns
the subject of the triple.

Implements knowrob::Triple.

Definition at line 503 of file Triple.h.

503 { return subject_; }

◆ subject() [2/2]

template<class StringType >
std::string_view knowrob::TripleTemplate< StringType >::subject ( ) const
inlineoverridevirtual
Returns
the subject of the triple.

Implements knowrob::Triple.

Definition at line 503 of file Triple.h.

503 { return subject_; }

◆ valueAsBoolean() [1/2]

template<class StringType >
bool knowrob::TripleTemplate< StringType >::valueAsBoolean ( ) const
inlineoverridevirtual

Read the object part of the triple as a boolean.

Returns
the object as a boolean.

Implements knowrob::Triple.

Definition at line 524 of file Triple.h.

524 { return std::get<bool>(object_); }

◆ valueAsBoolean() [2/2]

template<class StringType >
bool knowrob::TripleTemplate< StringType >::valueAsBoolean ( ) const
inlineoverridevirtual

Read the object part of the triple as a boolean.

Returns
the object as a boolean.

Implements knowrob::Triple.

Definition at line 524 of file Triple.h.

524 { return std::get<bool>(object_); }

◆ valueAsDouble() [1/2]

template<class StringType >
double knowrob::TripleTemplate< StringType >::valueAsDouble ( ) const
inlineoverridevirtual

Read the object part of the triple as a double.

Returns
the object as a double.

Implements knowrob::Triple.

Definition at line 512 of file Triple.h.

512 { return std::get<double>(object_); }

◆ valueAsDouble() [2/2]

template<class StringType >
double knowrob::TripleTemplate< StringType >::valueAsDouble ( ) const
inlineoverridevirtual

Read the object part of the triple as a double.

Returns
the object as a double.

Implements knowrob::Triple.

Definition at line 512 of file Triple.h.

512 { return std::get<double>(object_); }

◆ valueAsFloat() [1/2]

template<class StringType >
float knowrob::TripleTemplate< StringType >::valueAsFloat ( ) const
inlineoverridevirtual

Read the object part of the triple as a float.

Returns
the object as a float.

Implements knowrob::Triple.

Definition at line 515 of file Triple.h.

515 { return std::get<float>(object_); }

◆ valueAsFloat() [2/2]

template<class StringType >
float knowrob::TripleTemplate< StringType >::valueAsFloat ( ) const
inlineoverridevirtual

Read the object part of the triple as a float.

Returns
the object as a float.

Implements knowrob::Triple.

Definition at line 515 of file Triple.h.

515 { return std::get<float>(object_); }

◆ valueAsInt() [1/2]

template<class StringType >
int knowrob::TripleTemplate< StringType >::valueAsInt ( ) const
inlineoverridevirtual

Read the object part of the triple as a int.

Returns
the object as a int.

Implements knowrob::Triple.

Definition at line 521 of file Triple.h.

521 { return std::get<int>(object_); }

◆ valueAsInt() [2/2]

template<class StringType >
int knowrob::TripleTemplate< StringType >::valueAsInt ( ) const
inlineoverridevirtual

Read the object part of the triple as a int.

Returns
the object as a int.

Implements knowrob::Triple.

Definition at line 521 of file Triple.h.

521 { return std::get<int>(object_); }

◆ valueAsLong() [1/2]

template<class StringType >
long knowrob::TripleTemplate< StringType >::valueAsLong ( ) const
inlineoverridevirtual

Read the object part of the triple as a long.

Returns
the object as a long.

Implements knowrob::Triple.

Definition at line 518 of file Triple.h.

518 { return std::get<long>(object_); }

◆ valueAsLong() [2/2]

template<class StringType >
long knowrob::TripleTemplate< StringType >::valueAsLong ( ) const
inlineoverridevirtual

Read the object part of the triple as a long.

Returns
the object as a long.

Implements knowrob::Triple.

Definition at line 518 of file Triple.h.

518 { return std::get<long>(object_); }

◆ valueAsShort() [1/2]

template<class StringType >
short knowrob::TripleTemplate< StringType >::valueAsShort ( ) const
inlineoverridevirtual

Read the object part of the triple as a short.

Returns
the object as a short.

Implements knowrob::Triple.

Definition at line 527 of file Triple.h.

527 { return std::get<short>(object_); }

◆ valueAsShort() [2/2]

template<class StringType >
short knowrob::TripleTemplate< StringType >::valueAsShort ( ) const
inlineoverridevirtual

Read the object part of the triple as a short.

Returns
the object as a short.

Implements knowrob::Triple.

Definition at line 527 of file Triple.h.

527 { return std::get<short>(object_); }

◆ valueAsString() [1/2]

template<class StringType >
std::string_view knowrob::TripleTemplate< StringType >::valueAsString ( ) const
inlineoverridevirtual

Read the object part of the triple as a string.

Returns
the object as a double.

Implements knowrob::Triple.

Definition at line 509 of file Triple.h.

509 { return std::get<StringType>(object_); }

◆ valueAsString() [2/2]

template<class StringType >
std::string_view knowrob::TripleTemplate< StringType >::valueAsString ( ) const
inlineoverridevirtual

Read the object part of the triple as a string.

Returns
the object as a double.

Implements knowrob::Triple.

Definition at line 509 of file Triple.h.

509 { return std::get<StringType>(object_); }

◆ valueAsUnsignedInt() [1/2]

template<class StringType >
unsigned int knowrob::TripleTemplate< StringType >::valueAsUnsignedInt ( ) const
inlineoverridevirtual

Read the object part of the triple as a unsigned int.

Returns
the object as a unsigned int.

Implements knowrob::Triple.

Definition at line 533 of file Triple.h.

533 { return std::get<unsigned int>(object_); }

◆ valueAsUnsignedInt() [2/2]

template<class StringType >
unsigned int knowrob::TripleTemplate< StringType >::valueAsUnsignedInt ( ) const
inlineoverridevirtual

Read the object part of the triple as a unsigned int.

Returns
the object as a unsigned int.

Implements knowrob::Triple.

Definition at line 533 of file Triple.h.

533 { return std::get<unsigned int>(object_); }

◆ valueAsUnsignedLong() [1/2]

template<class StringType >
unsigned long knowrob::TripleTemplate< StringType >::valueAsUnsignedLong ( ) const
inlineoverridevirtual

Read the object part of the triple as a unsigned long.

Returns
the object as a unsigned long.

Implements knowrob::Triple.

Definition at line 530 of file Triple.h.

530 { return std::get<unsigned long>(object_); }

◆ valueAsUnsignedLong() [2/2]

template<class StringType >
unsigned long knowrob::TripleTemplate< StringType >::valueAsUnsignedLong ( ) const
inlineoverridevirtual

Read the object part of the triple as a unsigned long.

Returns
the object as a unsigned long.

Implements knowrob::Triple.

Definition at line 530 of file Triple.h.

530 { return std::get<unsigned long>(object_); }

◆ valueAsUnsignedShort() [1/2]

template<class StringType >
unsigned short knowrob::TripleTemplate< StringType >::valueAsUnsignedShort ( ) const
inlineoverridevirtual

Read the object part of the triple as a unsigned short.

Returns
the object as a unsigned short.

Implements knowrob::Triple.

Definition at line 536 of file Triple.h.

536 { return std::get<unsigned short>(object_); }

◆ valueAsUnsignedShort() [2/2]

template<class StringType >
unsigned short knowrob::TripleTemplate< StringType >::valueAsUnsignedShort ( ) const
inlineoverridevirtual

Read the object part of the triple as a unsigned short.

Returns
the object as a unsigned short.

Implements knowrob::Triple.

Definition at line 536 of file Triple.h.

536 { return std::get<unsigned short>(object_); }

Member Data Documentation

◆ graph_

template<class StringType >
std::optional< StringType > knowrob::TripleTemplate< StringType >::graph_
protected

Definition at line 564 of file Triple.h.

◆ object_

template<class StringType >
TypedObject knowrob::TripleTemplate< StringType >::object_
protected

Definition at line 562 of file Triple.h.

◆ perspective_

template<class StringType >
std::optional< StringType > knowrob::TripleTemplate< StringType >::perspective_
protected

Definition at line 565 of file Triple.h.

◆ predicate_

template<class StringType >
StringType knowrob::TripleTemplate< StringType >::predicate_
protected

Definition at line 561 of file Triple.h.

◆ subject_

template<class StringType >
StringType knowrob::TripleTemplate< StringType >::subject_
protected

Definition at line 560 of file Triple.h.


The documentation for this class was generated from the following file: