5#include <knowCore/ValueList.h>
7#include <kDB/Repository/Connection.h>
8#include <kDB/Repository/Transaction.h>
10#include "FocusNodeDeclaration.h"
12namespace kDB::Repository::RDF
43 bool operator==(
const FocusNode& _rhs)
const;
47 cres_qresult<bool>
exists()
const;
59 knowCore::Uri
uri()
const;
63 knowCore::Uri
graph()
const;
71 cres_qresult<bool>
hasProperty(
const knowCore::Uri& _property,
76 cres_qresult<knowCore::Value>
property(
const knowCore::Uri& _property,
81 template<
typename _T_>
82 requires(not std::is_base_of_v<knowCore::Value, _T_>)
83 cres_qresult<_T_>
property(
const knowCore::Uri& _property)
const;
87 cres_qresult<void>
setProperty(
const knowCore::Uri& _property,
const knowCore::Value& _value,
93 const knowCore::Value& _value,
104 cres_qresult<knowCore::ValueList>
propertyList(
const knowCore::Uri& _property,
111 cres_qresult<void>
setPropertyInMap(
const knowCore::Uri& _property,
const knowCore::Uri& _key,
112 const knowCore::Value& _value,
117 cres_qresult<knowCore::ValueHash>
propertyMap(
const knowCore::Uri& _property,
123 cres_qresult<knowCore::Value>
130 template<
typename _T_>
131 requires(not std::is_base_of_v<knowCore::Value, _T_>)
132 cres_qresult<void>
setProperty(
const knowCore::Uri& _property,
const _T_& _value,
135 return setProperty(_property, knowCore::Value::fromValue(_value), _transaction);
140 cres_qresult<QCborMap>
toCborMap()
const;
145 const knowCore::Uri& _graph,
const QCborMap& _map);
150 cres_qresult<void>
setProperty(
const knowCore::Uri& _property,
const knowCore::Value& _value,
152 bool _allow_constant_changes)
const;
154 const knowCore::Value& _value,
156 bool _allow_constant_changes)
const;
157 cres_qresult<void>
setPropertyInMap(
const knowCore::Uri& _property,
const knowCore::Uri& _key,
158 const knowCore::Value& _value,
160 bool _allow_constant_changes)
const;
166 const knowCore::Uri& _graph_uri,
167 const knowCore::Uri& _typeUri,
168 const knowCore::ValueHash& _properties,
169 const knowCore::Uri& _focusNodeUri);
172 QExplicitlySharedDataPointer<Private> d;
174 template<
typename _T_>
175 requires(not std::is_base_of_v<knowCore::Value, _T_>)
178 cres_try(knowCore::Value value, property(_property));
179 return value.value<_T_>();
182 template<
typename _TDerive_>
189 _TDerive_& operator=(
const _TDerive_& _rhs)
191 m_focus_node = _rhs.m_focus_node;
192 return static_cast<_TDerive_&
>(*this);
197 return m_focus_node == _rhs.m_focus_node;
200 void setFocusNode(
const FocusNode& _fn) { m_focus_node = _fn; }
201 const FocusNode& focusNodeRef()
const {
return m_focus_node; }
202 FocusNode& focusNodeRef() {
return m_focus_node; }
208 knowCore::Uri graph()
const {
return m_focus_node.
graph(); }
209 knowCore::Uri uri()
const {
return m_focus_node.
uri(); }
210 knowCore::Uri type()
const {
return m_focus_node.
declaration().
type(); }
218 cres_qresult<bool>
hasProperty(
const knowCore::Uri& _property)
const
225 cres_qresult<knowCore::Value>
property(
const knowCore::Uri& _property)
const
227 return m_focus_node.
property(_property);
232 template<
typename _T_>
233 requires(not std::is_base_of_v<knowCore::Value, _T_>)
234 cres_qresult<_T_>
property(
const knowCore::Uri& _property)
const
236 return m_focus_node.
property<_T_>(_property);
242 const knowCore::Value& _value)
const
244 return m_focus_node.
setProperty(_property, _value);
249 template<
typename _T_>
250 requires(not std::is_base_of_v<knowCore::Value, _T_>)
251 cres_qresult<void>
setProperty(
const knowCore::Uri& _property,
const _T_& _value)
const
253 return m_focus_node.
setProperty(_property, _value);
259 const knowCore::Value& _value,
268 const knowCore::Value& _value,
276 cres_qresult<knowCore::ValueList>
propertyList(
const knowCore::Uri& _property,
280 return m_focus_node.
propertyList(_property, _transaction);
286 cres_qresult<void>
setPropertyInMap(
const knowCore::Uri& _property,
const knowCore::Uri& _key,
287 const knowCore::Value& _value,
290 return m_focus_node.
setPropertyInMap(_property, _key, _value, _transaction);
295 cres_qresult<knowCore::ValueHash>
propertyMap(
const knowCore::Uri& _property,
299 return m_focus_node.
propertyMap(_property, _transaction);
304 cres_qresult<knowCore::Value>
Definition Connection.h:26
Definition QueryConnectionInfo.h:8
Definition FocusNodeCollection.h:21
Definition FocusNodeDeclaration.h:17
knowCore::Uri type() const
Definition FocusNodeDeclaration.cpp:80
Definition FocusNode.h:184
kDB::Repository::Connection connection() const
Definition FocusNode.h:214
cres_qresult< bool > hasProperty(const knowCore::Uri &_property) const
Definition FocusNode.h:218
cres_qresult< void > addPropertyToList(const knowCore::Uri &_property, const knowCore::Value &_value, const Transaction &_transaction=Transaction()) const
Definition FocusNode.h:258
cres_qresult< knowCore::ValueHash > propertyMap(const knowCore::Uri &_property, const Transaction &_transaction=Transaction()) const
Definition FocusNode.h:295
cres_qresult< void > setProperty(const knowCore::Uri &_property, const _T_ &_value) const
Definition FocusNode.h:251
cres_qresult< bool > exists() const
Definition FocusNode.h:207
cres_qresult< _T_ > property(const knowCore::Uri &_property) const
Definition FocusNode.h:234
cres_qresult< void > removePropertyFromList(const knowCore::Uri &_property, const knowCore::Value &_value, const Transaction &_transaction=Transaction()) const
Definition FocusNode.h:267
cres_qresult< knowCore::Value > property(const knowCore::Uri &_property) const
Definition FocusNode.h:225
cres_qresult< knowCore::ValueList > propertyList(const knowCore::Uri &_property, const Transaction &_transaction=Transaction()) const
Definition FocusNode.h:276
cres_qresult< QCborMap > toCborMap() const
Definition FocusNode.h:313
cres_qresult< void > setPropertyInMap(const knowCore::Uri &_property, const knowCore::Uri &_key, const knowCore::Value &_value, const Transaction &_transaction=Transaction()) const
Definition FocusNode.h:286
cres_qresult< void > setProperty(const knowCore::Uri &_property, const knowCore::Value &_value) const
Definition FocusNode.h:241
cres_qresult< knowCore::Value > propertyMapValue(const knowCore::Uri &_property, const knowCore::Uri &_key, const Transaction &_transaction=Transaction()) const
Definition FocusNode.h:305
Definition FocusNode.h:34
kDB::Repository::Connection connection() const
Definition FocusNode.cpp:100
cres_qresult< void > setProperty(const knowCore::Uri &_property, const knowCore::Value &_value, const Transaction &_transaction=Transaction()) const
Definition FocusNode.cpp:229
bool isValid() const
Definition FocusNode.cpp:46
knowCore::Uri graph() const
Definition FocusNode.cpp:98
cres_qresult< void > removePropertyFromList(const knowCore::Uri &_property, const knowCore::Value &_value, const Transaction &_transaction=Transaction()) const
Definition FocusNode.cpp:494
cres_qresult< void > setProperty(const knowCore::Uri &_property, const _T_ &_value, const Transaction &_transaction=Transaction()) const
Definition FocusNode.h:132
cres_qresult< bool > hasProperty(const knowCore::Uri &_property, const Transaction &_transaction=Transaction()) const
Definition FocusNode.cpp:102
knowCore::Uri uri() const
Definition FocusNode.cpp:96
FocusNodeDeclaration declaration() const
Definition FocusNode.cpp:94
cres_qresult< void > setPropertyInMap(const knowCore::Uri &_property, const knowCore::Uri &_key, const knowCore::Value &_value, const Transaction &_transaction=Transaction()) const
Definition FocusNode.cpp:667
static cres_qresult< FocusNode > fromCborMap(const kDB::Repository::Connection &_connection, const knowCore::Uri &_graph, const QCborMap &_map)
Definition FocusNode.cpp:871
cres_qresult< knowCore::ValueHash > propertyMap(const knowCore::Uri &_property, const Transaction &_transaction=Transaction()) const
Definition FocusNode.cpp:754
cres_qresult< bool > exists() const
Definition FocusNode.cpp:68
cres_qresult< knowCore::Value > propertyMapValue(const knowCore::Uri &_property, const knowCore::Uri &_key, const Transaction &_transaction=Transaction()) const
Definition FocusNode.cpp:794
cres_qresult< knowCore::Value > property(const knowCore::Uri &_property, const Transaction &_transaction=Transaction()) const
Definition FocusNode.cpp:142
cres_qresult< void > addPropertyToList(const knowCore::Uri &_property, const knowCore::Value &_value, const Transaction &_transaction=Transaction()) const
Definition FocusNode.cpp:383
cres_qresult< knowCore::ValueList > propertyList(const knowCore::Uri &_property, const Transaction &_transaction=Transaction()) const
Definition FocusNode.cpp:599
cres_qresult< QCborMap > toCborMap() const
Definition FocusNode.cpp:846
Definition Transaction.h:19