Skip to content

Commit

Permalink
feat(cognitarium): add store query
Browse files Browse the repository at this point in the history
  • Loading branch information
amimart committed Apr 20, 2023
1 parent 87e93d4 commit 66c4579
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions contracts/okp4-cognitarium/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct InstantiateMsg {
/// Execute messages
#[cw_serde]
pub enum ExecuteMsg {
/// # Insert
/// # InsertData
/// Insert the data as RDF triples in the store.
/// For already existing triples it acts as no-op.
///
Expand All @@ -26,7 +26,13 @@ pub enum ExecuteMsg {
#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
/// # Resources
/// # Store
///
/// Returns information about the triple store.
#[returns(StoreResponse)]
Store,

/// # Select
///
/// Returns the resources matching the criteria defined by the provided query.
///
Expand Down Expand Up @@ -85,6 +91,36 @@ pub enum DataInput {
NTriples(Binary),
}

/// # StoreResponse
///
/// Contains information related to triple store.
#[cw_serde]
pub struct StoreResponse {
/// The store owner.
pub owner: String,

/// The store limits.
pub limits: StoreLimits,

/// The store current usage.
pub stat: StoreStat,
}

/// # StoreStat
///
/// Contains usage information about the triple store.
#[cw_serde]
pub struct StoreStat {
/// The total number of triple present in the store.
pub triple_count: Uint128,

/// The total number of IRI namespace present in the store.
pub namespace_count: Uint128,

/// The total triple size in the store, in bytes.
pub byte_size: Uint128,
}

/// # IRI
/// Represents an IRI.
#[cw_serde]
Expand Down

0 comments on commit 66c4579

Please sign in to comment.