kDB: Knowledge DataBase
Loading...
Searching...
No Matches
kDB::Repository::RDF::FocusNode Class Reference

#include <FocusNode.h>

Classes

struct  Private
 

Public Member Functions

 FocusNode (const FocusNode &_rhs)
 
FocusNodeoperator= (const FocusNode &_rhs)
 
 FocusNode (const kDB::Repository::Connection &_connection, const knowCore::Uri &_graph, const knowCore::Uri &_object_uri, const FocusNodeDeclaration &_declaration)
 
 FocusNode (const kDB::Repository::Connection &_connection, const knowCore::Uri &_read_graph, const QList< knowCore::Uri > &_triplestores, const knowCore::Uri &_object_uri, const FocusNodeDeclaration &_declaration)
 
 FocusNode (const kDB::Repository::Connection &_connection, const knowCore::Uri &_read_graph, const std::function< QList< knowCore::Uri >()> &_triplestores, const knowCore::Uri &_object_uri, const FocusNodeDeclaration &_declaration)
 
FocusNodeDeclaration declaration () const
 
knowCore::Uri uri () const
 
knowCore::ReturnValue< bool > hasProperty (const knowCore::Uri &_property) const
 
knowCore::ReturnValue< knowCore::Valueproperty (const knowCore::Uri &_property) const
 
knowCore::ReturnVoid setProperty (const knowCore::Uri &_property, const knowCore::Value &_value) const
 
knowCore::ReturnVoid setProperty (const knowCore::Uri &_property, const knowCore::Value &_value, const Transaction &_transaction) const
 
template<typename _T_ , std::enable_if_t< not std::is_base_of_v< knowCore::Value, _T_ >, bool > = true>
knowCore::ReturnVoid setProperty (const knowCore::Uri &_property, const _T_ &_value) const
 
knowCore::ReturnValue< QCborMap > toCborMap () const
 

Static Public Member Functions

static knowCore::ReturnValue< FocusNodefromCborMap (const kDB::Repository::Connection &_connection, const knowCore::Uri &_graph, const QCborMap &_map, const FocusNodeDeclarationsRegistry *_declaration_registry)
 

Detailed Description

FocusNode is a convenient class that treat a uri in a RDF graph as the root of an object with properties.

For instance for the following RDF Graph:

<a> a <object_type> ;
<property_1> "property value 1" ;
<property_2> "property value 2" .

The property values can be manipulated by creating:

FocusNode a("graph_uri"_kCu, "a"_kCu, Registry::get("object_type"));
Definition FocusNode.h:27

Member Function Documentation

◆ declaration()

FocusNodeDeclaration FocusNode::declaration ( ) const
Returns
the declaration defining this focus node.

◆ fromCborMap()

knowCore::ReturnValue< FocusNode > FocusNode::fromCborMap ( const kDB::Repository::Connection & _connection,
const knowCore::Uri & _graph,
const QCborMap & _map,
const FocusNodeDeclarationsRegistry * _declaration_registry )
static
Returns
a cbor map that represents the value.

◆ hasProperty()

knowCore::ReturnValue< bool > FocusNode::hasProperty ( const knowCore::Uri & _property) const
Returns
if the given property is set

◆ property()

knowCore::ReturnValue< knowCore::Value > FocusNode::property ( const knowCore::Uri & _property) const
Returns
a value for the given property

◆ setProperty() [1/2]

template<typename _T_ , std::enable_if_t< not std::is_base_of_v< knowCore::Value, _T_ >, bool > = true>
knowCore::ReturnVoid kDB::Repository::RDF::FocusNode::setProperty ( const knowCore::Uri & _property,
const _T_ & _value ) const
inline

Set the value for the given property

◆ setProperty() [2/2]

knowCore::ReturnVoid FocusNode::setProperty ( const knowCore::Uri & _property,
const knowCore::Value & _value ) const

Set the value for the given property

◆ toCborMap()

knowCore::ReturnValue< QCborMap > FocusNode::toCborMap ( ) const
Returns
a cbor map that represents the value.

◆ uri()

knowCore::Uri FocusNode::uri ( ) const
Returns
the uri of the focus node, i.e. the root of the properties

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