schema

package module
v5.0.0-...-dcb2a6b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2025 License: BSD-3-Clause Imports: 5 Imported by: 2

README

AXONE dataverse schema

Generated go types for axone-dataverse contract.

version build lint test conventional commits semantic-release contributor covenant License

Installation

go get github.com/axone-protocol/axone-contract-schema/go/dataverse-schema

Dataverse

Overview

The dataverse smart contract is responsible for overseeing and managing the Dataverse.

Dataverse

The Dataverse is an ever-expanding universe that encompasses a wide range of digital resources. These include datasets, data processing algorithms, ML algorithm, storage resources, computational resources, identity management solutions, orchestration engines, oracles, and many other resources recorded on the blockchain.

When the smart contract is instantiated, it creates a Dataverse instance. This instance is separated and isolated from any pre-existing ones, and as many dataverse instances as required can be created.

Zones

Zones within the Dataverse represent distinct areas or domains where specific governance rules and policies are applied. These Zones are conceptual frameworks created to manage and organize resources under a unified set of regulations and permissions.

Each Zone is defined by its unique identity and set of governing rules, which dictate how resources within it can be accessed, used, and shared. This approach allows for granular control over different segments of the Dataverse, catering to various requirements and use cases. By managing these Zones, the dataverse smart contract ensures that resources are utilized in compliance with the defined policies and consents, thereby maintaining order and integrity within the Dataverse.

Resources

In the context of the Dataverse, Resources refer to a broad category of digital entities, which include Services and Digital Resources.

  • Digital Resources: This category extends to various digital entities such as datasets, algorithms, machine learning models, and other digital assets. Like Services, Digital Resources are identified by a URI in conjunction with the Service responsible for their provision.

  • Services: These are network-accessible functionalities like REST APIs, gRPC services, and other similar offerings. Each Service in the Dataverse is uniquely identified by its Uniform Resource Identifier (URI) and is associated with a specific Registrar responsible for its registration and management.

Decentralized Identifiers (DID)

Decentralized Identifiers (DID) are a foundational element in the Dataverse, serving as unique, persistent, and globally resolvable identifiers that are fully under the control of the DID subject, which could be an individual, organization, or a any kind of resource (dataset, algorithm, nft, ML algorithm).

DIDs play a crucial role in the Dataverse by facilitating a trustable and interoperable identity mechanism. They enable the establishment of a verifiable and self-sovereign identity for resources, services, and entities within the ecosystem.

Claims

Claims in the Dataverse context are assertions or statements made about a Resource identified by a DID.

Claims play a pivotal role in the governance framework of the Dataverse. By leveraging knowledge derived from verifiable credentials, the governances established by Zones can evaluate the fulfilment of specific rules and compliance. This evaluation is critical in ensuring that the resources within the Dataverse adhere to the established norms, policies, and requirements.

Claims are submitted in the form of Verifiable Presentations (VPs), which are aggregations of one or more Verifiable Credentials (VCs).

Dependencies

Given its role and status, this smart contract serves as the primary access point for the AXONE protocol to manage all on-chain stored resources. To fulfill its tasks, the smart contract relies on other smart contracts within the AXONE ecosystem. Notably, it uses the Cognitarium smart contract for persisting the Dataverse representation in an ontological form and the Law Stone smart contract to establish governance rules.

InstantiateMsg

InstantiateMsg is used to initialize a new instance of the dataverse.

parameter description
name _(Required.) _ string. A unique name to identify the dataverse instance.
triplestore_config _(Required.) _ TripleStoreConfig. The configuration used to instantiate the triple store.
triplestore_config.code_id Uint64. The code id that will be used to instantiate the triple store contract in which to store dataverse semantic data. It must implement the cognitarium interface.
triplestore_config.limits TripleStoreLimitsInput. Limitations regarding triple store usage.

ExecuteMsg

ExecuteMsg defines the set of possible actions that can be performed on the dataverse.

This enum provides variants for registering services, datasets, and other operations related to the dataverse.

ExecuteMsg::SubmitClaims

Submits new claims about a resource to the dataverse.

The SubmitClaims message is a pivotal component in the dataverse, enabling entities to contribute new claims about various resources. A claim represents a statement made by an entity, referred to as the issuer, which could be a person, organization, or service. These claims pertain to a diverse range of resources, including digital resources, services, zones, or individuals, and are asserted as factual by the issuer.

Format

Claims are injected into the dataverse through Verifiable Credentials (VCs).

Primarily, the claims leverage the AXONE ontology, which facilitates articulating assertions about widely acknowledged resources in the dataverse, including digital services, digital resources, zones, governance, and more.

Additionally, other schemas may also be employed to supplement and enhance the validated knowledge contributed to these resources.

Preconditions

To maintain integrity and coherence in the dataverse, several preconditions are set for the submission of claims:

  1. Format Requirement: Claims must be encapsulated within Verifiable Credentials (VCs).

  2. Unique Identifier Mandate: Each Verifiable Credential within the dataverse must possess a unique identifier.

  3. Issuer Signature: Claims must bear the issuer's signature. This signature must be verifiable, ensuring authenticity and credibility.

  4. Content: The actual implementation supports the submission of a single Verifiable Credential, containing a single claim.

Supported cryptographic proofs
  • Ed25519Signature2018

  • Ed25519Signature2020

  • EcdsaSecp256k1Signature2019

  • DataIntegrity with the following cryptosuites: eddsa-2022, eddsa-rdfc-2022.

parameter description
submit_claims _(Required.) _ object.
submit_claims.claims _(Required.) _ Binary. The Verifiable Credential containing the claims. The claims must be serialized in the format specified by the format field.
submit_claims.format RdfDatasetFormat|null. RDF dataset serialization format for the claims. If not provided, the default format is N-Quads format.
ExecuteMsg::RevokeClaims

Revoke or withdraw a previously submitted claims.

Preconditions:
  1. Identifier Existance: The identifier of the claims must exist in the dataverse.
parameter description
revoke_claims _(Required.) _ object.
revoke_claims.identifier _(Required.) _ string. The unique identifier of the claims to be revoked.

QueryMsg

QueryMsg defines the set of possible queries that can be made to retrieve information about the dataverse.

This enum provides variants for querying the dataverse's details and other related information.

QueryMsg::Dataverse

Retrieves information about the current dataverse instance.

parameter description
dataverse _(Required.) _ object.

Responses

dataverse

DataverseResponse is the response of the Dataverse query.

property description
name _(Required.) _ string. The name of the dataverse.
triplestore_address _(Required.) _ Addr. The cognitarium contract address.

Definitions

Addr

A human readable address.

In Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.

This type represents a validated address. It can be created in the following ways 1. Use Addr::unchecked(input) 2. Use let checked: Addr = deps.api.addr_validate(input)? 3. Use let checked: Addr = deps.api.addr_humanize(canonical_addr)? 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. Addr must not be used in messages sent by the user because this would result in unvalidated instances.

This type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using let mut mutable = Addr::to_string() and operate on that String instance.

type
string.
Binary

A string containing Base64-encoded data.

type
string.
NQuads

N-Quads Format

N-Quads is an extension of N-Triples to support RDF datasets by adding an optional fourth element to represent the graph name. See the official N-Quads specification.

literal
"n_quads"
RdfDatasetFormat

Represents the various serialization formats for an RDF dataset, i.e. a collection of RDF graphs (RDF Dataset).

variant description
NQuads string: n_quads. N-Quads Format

N-Quads is an extension of N-Triples to support RDF datasets by adding an optional fourth element to represent the graph name. See the official N-Quads specification.
TripleStoreConfig

TripleStoreConfig represents the configuration related to the management of the triple store.

property description
code_id _(Required.) _ Uint64. The code id that will be used to instantiate the triple store contract in which to store dataverse semantic data. It must implement the cognitarium interface.
limits _(Required.) _ TripleStoreLimitsInput. Limitations regarding triple store usage.
limits.max_byte_size Uint128|null. The maximum number of bytes the store can contain. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any. Default to [Uint128::MAX] if not set, which can be considered as no limit.
limits.max_insert_data_byte_size Uint128|null. The maximum number of bytes an insert data query can contain. Default to [Uint128::MAX] if not set, which can be considered as no limit.
limits.max_insert_data_triple_count Uint128|null. The maximum number of triples an insert data query can contain (after parsing). Default to [Uint128::MAX] if not set, which can be considered as no limit.
limits.max_query_limit integer|null. The maximum limit of a query, i.e. the maximum number of triples returned by a select query. Default to 30 if not set.
limits.max_query_variable_count integer|null. The maximum number of variables a query can select. Default to 30 if not set.
limits.max_triple_byte_size Uint128|null. The maximum number of bytes the store can contain for a single triple. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any. The limit is used to prevent storing very large triples, especially literals. Default to [Uint128::MAX] if not set, which can be considered as no limit.
limits.max_triple_count Uint128|null. The maximum number of triples the store can contain. Default to [Uint128::MAX] if not set, which can be considered as no limit.
TripleStoreLimitsInput

Contains requested limitations regarding store usages.

property description
max_byte_size Uint128|null. The maximum number of bytes the store can contain. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any. Default to [Uint128::MAX] if not set, which can be considered as no limit.
max_insert_data_byte_size Uint128|null. The maximum number of bytes an insert data query can contain. Default to [Uint128::MAX] if not set, which can be considered as no limit.
max_insert_data_triple_count Uint128|null. The maximum number of triples an insert data query can contain (after parsing). Default to [Uint128::MAX] if not set, which can be considered as no limit.
max_query_limit integer|null. The maximum limit of a query, i.e. the maximum number of triples returned by a select query. Default to 30 if not set.
max_query_variable_count integer|null. The maximum number of variables a query can select. Default to 30 if not set.
max_triple_byte_size Uint128|null. The maximum number of bytes the store can contain for a single triple. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any. The limit is used to prevent storing very large triples, especially literals. Default to [Uint128::MAX] if not set, which can be considered as no limit.
max_triple_count Uint128|null. The maximum number of triples the store can contain. Default to [Uint128::MAX] if not set, which can be considered as no limit.
Uint128

A string containing a 128-bit integer in decimal representation.

type
string.
Uint64

A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.

Examples

Use from to create instances of this and u64 to get the value out:


let b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```

|type|
|----|
|**string**.|

---

*Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `axone-dataverse.json` (`13c4a7b5af578887`)*

Documentation

Overview

Code generated by github.com/srdtrk/go-codegen, DO NOT EDIT.

Code generated by github.com/srdtrk/go-codegen, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr string

A human readable address.

In Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.

This type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.

This type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.

type Binary

type Binary string

Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.

This is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.

type DataverseResponse

type DataverseResponse struct {
	// The name of the dataverse.
	Name string `json:"name"`
	// The cognitarium contract address.
	TriplestoreAddress Addr `json:"triplestore_address"`
}

DataverseResponse is the response of the Dataverse query.

type ExecuteMsg

type ExecuteMsg struct {
	/*
	   Submits new claims about a resource to the dataverse.

	   The SubmitClaims message is a pivotal component in the dataverse, enabling entities to contribute new claims about various resources. A claim represents a statement made by an entity, referred to as the issuer, which could be a person, organization, or service. These claims pertain to a diverse range of resources, including digital resources, services, zones, or individuals, and are asserted as factual by the issuer.

	   #### Format

	   Claims are injected into the dataverse through Verifiable Credentials (VCs).

	   Primarily, the claims leverage the AXONE ontology, which facilitates articulating assertions about widely acknowledged resources in the dataverse, including digital services, digital resources, zones, governance, and more.

	   Additionally, other schemas may also be employed to supplement and enhance the validated knowledge contributed to these resources.

	   #### Preconditions

	   To maintain integrity and coherence in the dataverse, several preconditions are set for the submission of claims:

	   1. **Format Requirement**: Claims must be encapsulated within Verifiable Credentials (VCs).

	   2. **Unique Identifier Mandate**: Each Verifiable Credential within the dataverse must possess a unique identifier.

	   3. **Issuer Signature**: Claims must bear the issuer's signature. This signature must be verifiable, ensuring authenticity and credibility.

	   4. **Content**: The actual implementation supports the submission of a single Verifiable Credential, containing a single claim.

	   #### Supported cryptographic proofs

	   - `Ed25519Signature2018`

	   - `Ed25519Signature2020`

	   - `EcdsaSecp256k1Signature2019`

	   - `DataIntegrity` with the following cryptosuites: `eddsa-2022`, `eddsa-rdfc-2022`.
	*/
	SubmitClaims *ExecuteMsg_SubmitClaims `json:"submit_claims,omitempty"`
	/*
	   Revoke or withdraw a previously submitted claims.

	   #### Preconditions:

	   1. **Identifier Existance**: The identifier of the claims must exist in the dataverse.
	*/
	RevokeClaims *ExecuteMsg_RevokeClaims `json:"revoke_claims,omitempty"`
}

`ExecuteMsg` defines the set of possible actions that can be performed on the dataverse.

This enum provides variants for registering services, datasets, and other operations related to the dataverse.

type ExecuteMsg_RevokeClaims

type ExecuteMsg_RevokeClaims struct {
	// The unique identifier of the claims to be revoked.
	Identifier string `json:"identifier"`
}

type ExecuteMsg_SubmitClaims

type ExecuteMsg_SubmitClaims struct {
	// The Verifiable Credential containing the claims. The claims must be serialized in the format specified by the `format` field.
	Claims Binary `json:"claims"`
	// RDF dataset serialization format for the claims. If not provided, the default format is [N-Quads](https://www.w3.org/TR/n-quads/) format.
	Format *RdfDatasetFormat `json:"format,omitempty"`
}

type InstantiateMsg

type InstantiateMsg struct {
	// A unique name to identify the dataverse instance.
	Name string `json:"name"`
	// The configuration used to instantiate the triple store.
	TriplestoreConfig TripleStoreConfig `json:"triplestore_config"`
}

`InstantiateMsg` is used to initialize a new instance of the dataverse.

type QueryClient

type QueryClient interface {
	// Dataverse is the client API for the QueryMsg_Dataverse query message
	Dataverse(ctx context.Context, req *QueryMsg_Dataverse, opts ...grpc.CallOption) (*DataverseResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(gRPCAddress, contractAddress string, opts ...grpc.DialOption) (QueryClient, error)

NewQueryClient creates a new QueryClient

type QueryMsg

type QueryMsg struct {
	// Retrieves information about the current dataverse instance.
	Dataverse *QueryMsg_Dataverse `json:"dataverse,omitempty"`
}

`QueryMsg` defines the set of possible queries that can be made to retrieve information about the dataverse.

This enum provides variants for querying the dataverse's details and other related information.

type QueryMsg_Dataverse

type QueryMsg_Dataverse struct{}

type RdfDatasetFormat

type RdfDatasetFormat string

Represents the various serialization formats for an RDF dataset, i.e. a collection of RDF graphs ([RDF Dataset](https://www.w3.org/TR/rdf11-concepts/#section-dataset)).

const (
	/*
	   N-Quads Format

	   N-Quads is an extension of N-Triples to support RDF datasets by adding an optional fourth element to represent the graph name. See the [official N-Quads specification](https://www.w3.org/TR/n-quads/).
	*/
	RdfDatasetFormat_NQuads RdfDatasetFormat = "n_quads"
)

type TripleStoreConfig

type TripleStoreConfig struct {
	// The code id that will be used to instantiate the triple store contract in which to store dataverse semantic data. It must implement the cognitarium interface.
	CodeId Uint64 `json:"code_id"`
	// Limitations regarding triple store usage.
	Limits TripleStoreLimitsInput `json:"limits"`
}

`TripleStoreConfig` represents the configuration related to the management of the triple store.

type TripleStoreLimitsInput

type TripleStoreLimitsInput struct {
	// The maximum number of bytes the store can contain. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any. Default to [Uint128::MAX] if not set, which can be considered as no limit.
	MaxByteSize *Uint128 `json:"max_byte_size,omitempty"`
	// The maximum number of bytes an insert data query can contain. Default to [Uint128::MAX] if not set, which can be considered as no limit.
	MaxInsertDataByteSize *Uint128 `json:"max_insert_data_byte_size,omitempty"`
	// The maximum number of triples an insert data query can contain (after parsing). Default to [Uint128::MAX] if not set, which can be considered as no limit.
	MaxInsertDataTripleCount *Uint128 `json:"max_insert_data_triple_count,omitempty"`
	// The maximum limit of a query, i.e. the maximum number of triples returned by a select query. Default to 30 if not set.
	MaxQueryLimit *int `json:"max_query_limit,omitempty"`
	// The maximum number of variables a query can select. Default to 30 if not set.
	MaxQueryVariableCount *int `json:"max_query_variable_count,omitempty"`
	// The maximum number of bytes the store can contain for a single triple. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any. The limit is used to prevent storing very large triples, especially literals. Default to [Uint128::MAX] if not set, which can be considered as no limit.
	MaxTripleByteSize *Uint128 `json:"max_triple_byte_size,omitempty"`
	// The maximum number of triples the store can contain. Default to [Uint128::MAX] if not set, which can be considered as no limit.
	MaxTripleCount *Uint128 `json:"max_triple_count,omitempty"`
}

Contains requested limitations regarding store usages.

type Uint128

type Uint128 string

A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.

Examples

Use `from` to create instances of this and `u128` to get the value out:

``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);

let b = Uint128::from(42u64); assert_eq!(b.u128(), 42);

let c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```

type Uint64

type Uint64 string

A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.

Examples

Use `from` to create instances of this and `u64` to get the value out:

``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);

let b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL