Skip to content

Commit 66c4579

Browse files
committedApr 20, 2023
feat(cognitarium): add store query
1 parent 87e93d4 commit 66c4579

File tree

1 file changed

+38
-2
lines changed
  • contracts/okp4-cognitarium/src

1 file changed

+38
-2
lines changed
 

‎contracts/okp4-cognitarium/src/msg.rs

+38-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct InstantiateMsg {
1212
/// Execute messages
1313
#[cw_serde]
1414
pub enum ExecuteMsg {
15-
/// # Insert
15+
/// # InsertData
1616
/// Insert the data as RDF triples in the store.
1717
/// For already existing triples it acts as no-op.
1818
///
@@ -26,7 +26,13 @@ pub enum ExecuteMsg {
2626
#[cw_serde]
2727
#[derive(QueryResponses)]
2828
pub enum QueryMsg {
29-
/// # Resources
29+
/// # Store
30+
///
31+
/// Returns information about the triple store.
32+
#[returns(StoreResponse)]
33+
Store,
34+
35+
/// # Select
3036
///
3137
/// Returns the resources matching the criteria defined by the provided query.
3238
///
@@ -85,6 +91,36 @@ pub enum DataInput {
8591
NTriples(Binary),
8692
}
8793

94+
/// # StoreResponse
95+
///
96+
/// Contains information related to triple store.
97+
#[cw_serde]
98+
pub struct StoreResponse {
99+
/// The store owner.
100+
pub owner: String,
101+
102+
/// The store limits.
103+
pub limits: StoreLimits,
104+
105+
/// The store current usage.
106+
pub stat: StoreStat,
107+
}
108+
109+
/// # StoreStat
110+
///
111+
/// Contains usage information about the triple store.
112+
#[cw_serde]
113+
pub struct StoreStat {
114+
/// The total number of triple present in the store.
115+
pub triple_count: Uint128,
116+
117+
/// The total number of IRI namespace present in the store.
118+
pub namespace_count: Uint128,
119+
120+
/// The total triple size in the store, in bytes.
121+
pub byte_size: Uint128,
122+
}
123+
88124
/// # IRI
89125
/// Represents an IRI.
90126
#[cw_serde]

0 commit comments

Comments
 (0)
Please sign in to comment.