diff --git a/.github/workflows/auto-fix-md.yml b/.github/workflows/auto-fix-md.yml index f2ec56a009a..2e914f30794 100644 --- a/.github/workflows/auto-fix-md.yml +++ b/.github/workflows/auto-fix-md.yml @@ -20,6 +20,7 @@ jobs: continue-on-error: true with: args: "**/*.md" + ignore: contracts/**/*.md contracts_versioned_docs/**/*.md modules/**/*.md modules_versioned_docs/**/*.md commands/**/*.md commands_versioned_docs/**/*.md fix: true - name: Commit changes diff --git a/.github/workflows/update-versioned-docs.yml b/.github/workflows/update-versioned-docs.yml index 1b112c16c25..7b7c2e511eb 100644 --- a/.github/workflows/update-versioned-docs.yml +++ b/.github/workflows/update-versioned-docs.yml @@ -72,7 +72,7 @@ jobs: - name: Search for all modified files that involve the creation of PR or commit to main id: changed-files - uses: tj-actions/changed-files@v37.5.1 + uses: tj-actions/changed-files@v38.1.3 with: files: | *.json diff --git a/contracts/okp4-cognitarium.md b/contracts/okp4-cognitarium.md index ed1cadc3791..2f8b3c50202 100644 --- a/contracts/okp4-cognitarium.md +++ b/contracts/okp4-cognitarium.md @@ -83,8 +83,27 @@ Returns a description of the resource identified by the provided IRI as a set of |`describe.format`|**[DataFormat](#dataformat)\|null**. The format in which the triples are serialized. If not provided, the default format is [Turtle](https://www.w3.org/TR/turtle/) format.| |`describe.query`|*(Required.) * **[DescribeQuery](#describequery)**. The query to execute.| +### QueryMsg::Construct + +Returns the resources matching the criteria defined by the provided query as a set of RDF triples serialized in the provided format. + +|parameter|description| +|----------|-----------| +|`construct`|*(Required.) * **object**. | +|`construct.format`|**[DataFormat](#dataformat)\|null**. The format in which the triples are serialized. If not provided, the default format is [Turtle](https://www.w3.org/TR/turtle/) format.| +|`construct.query`|*(Required.) * **[ConstructQuery](#constructquery)**. The query to execute.| + ## Responses +### construct + +Represents the response of a [QueryMsg::Construct] query. + +|property|description| +|----------|-----------| +|`data`|*(Required.) * **[Binary](#binary)**. The data serialized in the specified format.| +|`format`|*(Required.) * **[DataFormat](#dataformat)**. The format of the data.| + ### describe Represents the response of a [QueryMsg::Describe] query. @@ -143,6 +162,16 @@ An RDF [blank node](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node). |----------|-----------| |`blank_node`|*(Required.) * **string**. | +### ConstructQuery + +Represents a CONSTRUCT query over the triple store, allowing to retrieve a set of triples serialized in a specific format. + +|property|description| +|----------|-----------| +|`construct`|*(Required.) * **Array<[TriplePattern](#triplepattern)>**. The triples to construct. If nothing is provided, the patterns from the `where` clause are used for construction.| +|`prefixes`|*(Required.) * **Array<[Prefix](#prefix)>**. The prefixes used in the query.| +|`where`|*(Required.) * **Array<[WhereCondition](#wherecondition)>**. The WHERE clause. This clause is used to specify the triples to construct using variable bindings.| + ### DataFormat Represents the format in which the data are serialized, for example when returned by a query or when inserted in the store. diff --git a/contracts/schema/okp4-cognitarium.json b/contracts/schema/okp4-cognitarium.json deleted file mode 100644 index 03f6ef50e3f..00000000000 --- a/contracts/schema/okp4-cognitarium.json +++ /dev/null @@ -1 +0,0 @@ -{"contract_name":"okp4-cognitarium","contract_version":"2.1.0","idl_version":"1.0.0","instantiate":{"$schema":"http://json-schema.org/draft-07/schema#","title":"InstantiateMsg","description":"Instantiate message","type":"object","properties":{"limits":{"description":"Limitations regarding store usage.","default":{"max_byte_size":"340282366920938463463374607431768211455","max_insert_data_byte_size":"340282366920938463463374607431768211455","max_insert_data_triple_count":"340282366920938463463374607431768211455","max_query_limit":30,"max_query_variable_count":30,"max_triple_byte_size":"340282366920938463463374607431768211455","max_triple_count":"340282366920938463463374607431768211455"},"allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/StoreLimitsInput"}]}},"additionalProperties":false,"definitions":{"StoreLimitsInput":{"title":"StoreLimitsInput","description":"Contains requested limitations regarding store usages.","type":"object","properties":{"max_byte_size":{"description":"The maximum number of bytes the store can contains. 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.","default":"340282366920938463463374607431768211455","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"max_insert_data_byte_size":{"description":"The maximum number of bytes an insert data query can contains. Default to [Uint128::MAX] if not set, which can be considered as no limit.","default":"340282366920938463463374607431768211455","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"max_insert_data_triple_count":{"description":"The maximum number of triples an insert data query can contains (after parsing). Default to [Uint128::MAX] if not set, which can be considered as no limit.","default":"340282366920938463463374607431768211455","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"max_query_limit":{"description":"The maximum limit of a query, i.e. the maximum number of triples returned by a select query. Default to 30 if not set.","default":30,"type":"integer","format":"uint32","minimum":0},"max_query_variable_count":{"description":"The maximum number of variables a query can select. Default to 30 if not set.","default":30,"type":"integer","format":"uint32","minimum":0},"max_triple_byte_size":{"description":"The maximum number of bytes the store can contains 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.","default":"340282366920938463463374607431768211455","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"max_triple_count":{"description":"The maximum number of triples the store can contains. Default to [Uint128::MAX] if not set, which can be considered as no limit.","default":"340282366920938463463374607431768211455","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]}},"additionalProperties":false},"Uint128":{"description":"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.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```","type":"string"}}},"execute":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ExecuteMsg","description":"Execute messages","oneOf":[{"title":"InsertData","description":"Insert the data as RDF triples in the store. For already existing triples it acts as no-op.\n\nOnly the smart contract owner (i.e. the address who instantiated it) is authorized to perform this action.","type":"object","required":["insert_data"],"properties":{"insert_data":{"type":"object","required":["data"],"properties":{"data":{"description":"The data to insert. The data must be serialized in the format specified by the `format` field. And the data are subject to the limitations defined by the `limits` specified at contract instantiation.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Binary"}]},"format":{"description":"The data format in which the triples are serialized. If not provided, the default format is [Turtle](https://www.w3.org/TR/turtle/) format.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/DataFormat"},{"type":"null"}]}},"additionalProperties":false}},"additionalProperties":false},{"title":"DeleteData","description":"Delete the data (RDF triples) from the store matching the patterns defined by the provided query. For non-existing triples it acts as no-op.\n\nExample: ```json { \"prefixes\": [ { \"prefix\": \"foaf\", \"namespace\": \"http://xmlns.com/foaf/0.1/\" } ], \"delete\": [ { \"subject\": { \"variable\": \"s\" }, \"predicate\": { \"variable\": \"p\" }, \"object\": { \"variable\": \"o\" } } ], \"where\": [ { \"simple\": { \"triplePattern\": { \"subject\": { \"variable\": \"s\" }, \"predicate\": { \"node\": { \"namedNode\": {\"prefixed\": \"foaf:givenName\"} } }, \"object\": { \"literal\": { \"simple\": \"Myrddin\" } } } } }, { \"simple\": { \"triplePattern\": { \"subject\": { \"variable\": \"s\" }, \"predicate\": { \"variable\": \"p\" }, \"object\": { \"variable\": \"o\" } } } } ] ```\n\nOnly the smart contract owner (i.e. the address who instantiated it) is authorized to perform this action.","type":"object","required":["delete_data"],"properties":{"delete_data":{"type":"object","required":["delete","prefixes"],"properties":{"delete":{"description":"The items to delete.","type":"array","items":{"$ref":"./okp4-cognitarium.json/#/definitions/TriplePattern"}},"prefixes":{"description":"The prefixes used in the operation.","type":"array","items":{"$ref":"./okp4-cognitarium.json/#/definitions/Prefix"}},"where":{"description":"The WHERE clause to apply. If not provided, all the RDF triples are considered.","type":["array","null"],"items":{"$ref":"./okp4-cognitarium.json/#/definitions/WhereCondition"}}},"additionalProperties":false}},"additionalProperties":false}],"definitions":{"Binary":{"description":"Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .","type":"string"},"DataFormat":{"title":"DataFormat","description":"Represents the format in which the data are serialized, for example when returned by a query or when inserted in the store.","oneOf":[{"title":"RDF XML","description":"Output in [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) format.","type":"string","enum":["rdf_xml"]},{"title":"Turtle","description":"Output in [Turtle](https://www.w3.org/TR/turtle/) format.","type":"string","enum":["turtle"]},{"title":"N-Triples","description":"Output in [N-Triples](https://www.w3.org/TR/n-triples/) format.","type":"string","enum":["n_triples"]},{"title":"N-Quads","description":"Output in [N-Quads](https://www.w3.org/TR/n-quads/) format.","type":"string","enum":["n_quads"]}]},"IRI":{"title":"IRI","description":"Represents an IRI.","oneOf":[{"title":"Prefixed","description":"An IRI prefixed with a prefix. The prefixed IRI is expanded to a full IRI using the prefix definition specified in the query. For example, the prefixed IRI `rdf:type` is expanded to `http://www.w3.org/1999/02/22-rdf-syntax-ns#type`.","type":"object","required":["prefixed"],"properties":{"prefixed":{"type":"string"}},"additionalProperties":false},{"title":"Full","description":"A full IRI.","type":"object","required":["full"],"properties":{"full":{"type":"string"}},"additionalProperties":false}]},"Literal":{"title":"Literal","description":"An RDF [literal](https://www.w3.org/TR/rdf11-concepts/#dfn-literal).","oneOf":[{"title":"Simple","description":"A [simple literal](https://www.w3.org/TR/rdf11-concepts/#dfn-simple-literal) without datatype or language form.","type":"object","required":["simple"],"properties":{"simple":{"type":"string"}},"additionalProperties":false},{"title":"LanguageTaggedString","description":"A [language-tagged string](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string)","type":"object","required":["language_tagged_string"],"properties":{"language_tagged_string":{"type":"object","required":["language","value"],"properties":{"language":{"description":"The [language tag](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tag).","type":"string"},"value":{"description":"The [lexical form](https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form).","type":"string"}},"additionalProperties":false}},"additionalProperties":false},{"title":"TypedValue","description":"A value with a datatype.","type":"object","required":["typed_value"],"properties":{"typed_value":{"type":"object","required":["datatype","value"],"properties":{"datatype":{"description":"The [datatype IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-datatype-iri).","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/IRI"}]},"value":{"description":"The [lexical form](https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form).","type":"string"}},"additionalProperties":false}},"additionalProperties":false}]},"Node":{"title":"Node","description":"Represents either an IRI (named node) or a blank node.","oneOf":[{"title":"NamedNode","description":"An RDF [IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-iri).","type":"object","required":["named_node"],"properties":{"named_node":{"$ref":"./okp4-cognitarium.json/#/definitions/IRI"}},"additionalProperties":false},{"title":"BlankNode","description":"An RDF [blank node](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node).","type":"object","required":["blank_node"],"properties":{"blank_node":{"type":"string"}},"additionalProperties":false}]},"Prefix":{"title":"Prefix","description":"Represents a prefix in a [SelectQuery]. A prefix is a shortcut for a namespace used in the query.","type":"object","required":["namespace","prefix"],"properties":{"namespace":{"description":"The namespace associated with the prefix.","type":"string"},"prefix":{"description":"The prefix.","type":"string"}},"additionalProperties":false},"SimpleWhereCondition":{"title":"SimpleWhereCondition","description":"Represents a simple condition in a [WhereCondition].","oneOf":[{"title":"TriplePattern","description":"Represents a triple pattern, i.e. a condition on a triple based on its subject, predicate and object.","type":"object","required":["triple_pattern"],"properties":{"triple_pattern":{"$ref":"./okp4-cognitarium.json/#/definitions/TriplePattern"}},"additionalProperties":false}]},"TriplePattern":{"title":"TriplePattern","description":"Represents a triple pattern in a [SimpleWhereCondition].","type":"object","required":["object","predicate","subject"],"properties":{"object":{"description":"The object of the triple pattern.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/VarOrNodeOrLiteral"}]},"predicate":{"description":"The predicate of the triple pattern.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/VarOrNode"}]},"subject":{"description":"The subject of the triple pattern.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/VarOrNode"}]}},"additionalProperties":false},"VarOrNode":{"title":"VarOrNode","description":"Represents either a variable or a node.","oneOf":[{"title":"Variable","description":"A variable.","type":"object","required":["variable"],"properties":{"variable":{"type":"string"}},"additionalProperties":false},{"title":"Node","description":"A node, i.e. an IRI or a blank node.","type":"object","required":["node"],"properties":{"node":{"$ref":"./okp4-cognitarium.json/#/definitions/Node"}},"additionalProperties":false}]},"VarOrNodeOrLiteral":{"title":"VarOrNodeOrLiteral","description":"Represents either a variable, a node or a literal.","oneOf":[{"title":"Variable","description":"A variable.","type":"object","required":["variable"],"properties":{"variable":{"type":"string"}},"additionalProperties":false},{"title":"Node","description":"A node, i.e. an IRI or a blank node.","type":"object","required":["node"],"properties":{"node":{"$ref":"./okp4-cognitarium.json/#/definitions/Node"}},"additionalProperties":false},{"title":"Literal","description":"An RDF [literal](https://www.w3.org/TR/rdf11-concepts/#dfn-literal), i.e. a simple literal, a language-tagged string or a typed value.","type":"object","required":["literal"],"properties":{"literal":{"$ref":"./okp4-cognitarium.json/#/definitions/Literal"}},"additionalProperties":false}]},"WhereCondition":{"title":"WhereCondition","description":"Represents a condition in a [WhereClause].","oneOf":[{"title":"Simple","description":"Represents a simple condition.","type":"object","required":["simple"],"properties":{"simple":{"$ref":"./okp4-cognitarium.json/#/definitions/SimpleWhereCondition"}},"additionalProperties":false}]}}},"query":{"$schema":"http://json-schema.org/draft-07/schema#","title":"QueryMsg","description":"Query messages","oneOf":[{"title":"Store","description":"Returns information about the triple store.","type":"string","enum":["store"]},{"title":"Select","description":"Returns the resources matching the criteria defined by the provided query.","type":"object","required":["select"],"properties":{"select":{"type":"object","required":["query"],"properties":{"query":{"description":"The query to execute.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/SelectQuery"}]}},"additionalProperties":false}},"additionalProperties":false},{"title":"Describe","description":"Returns a description of the resource identified by the provided IRI as a set of RDF triples serialized in the provided format.","type":"object","required":["describe"],"properties":{"describe":{"type":"object","required":["query"],"properties":{"format":{"description":"The format in which the triples are serialized. If not provided, the default format is [Turtle](https://www.w3.org/TR/turtle/) format.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/DataFormat"},{"type":"null"}]},"query":{"description":"The query to execute.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/DescribeQuery"}]}},"additionalProperties":false}},"additionalProperties":false}],"definitions":{"DataFormat":{"title":"DataFormat","description":"Represents the format in which the data are serialized, for example when returned by a query or when inserted in the store.","oneOf":[{"title":"RDF XML","description":"Output in [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) format.","type":"string","enum":["rdf_xml"]},{"title":"Turtle","description":"Output in [Turtle](https://www.w3.org/TR/turtle/) format.","type":"string","enum":["turtle"]},{"title":"N-Triples","description":"Output in [N-Triples](https://www.w3.org/TR/n-triples/) format.","type":"string","enum":["n_triples"]},{"title":"N-Quads","description":"Output in [N-Quads](https://www.w3.org/TR/n-quads/) format.","type":"string","enum":["n_quads"]}]},"DescribeQuery":{"title":"DescribeQuery","description":"Represents a DESCRIBE query over the triple store, allowing to retrieve a description of a resource as a set of triples serialized in a specific format.","type":"object","required":["prefixes","resource","where"],"properties":{"prefixes":{"description":"The prefixes used in the query.","type":"array","items":{"$ref":"./okp4-cognitarium.json/#/definitions/Prefix"}},"resource":{"description":"The resource to describe given as a variable or a node.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/VarOrNamedNode"}]},"where":{"description":"The WHERE clause. This clause is used to specify the resource identifier to describe using variable bindings.","type":"array","items":{"$ref":"./okp4-cognitarium.json/#/definitions/WhereCondition"}}},"additionalProperties":false},"IRI":{"title":"IRI","description":"Represents an IRI.","oneOf":[{"title":"Prefixed","description":"An IRI prefixed with a prefix. The prefixed IRI is expanded to a full IRI using the prefix definition specified in the query. For example, the prefixed IRI `rdf:type` is expanded to `http://www.w3.org/1999/02/22-rdf-syntax-ns#type`.","type":"object","required":["prefixed"],"properties":{"prefixed":{"type":"string"}},"additionalProperties":false},{"title":"Full","description":"A full IRI.","type":"object","required":["full"],"properties":{"full":{"type":"string"}},"additionalProperties":false}]},"Literal":{"title":"Literal","description":"An RDF [literal](https://www.w3.org/TR/rdf11-concepts/#dfn-literal).","oneOf":[{"title":"Simple","description":"A [simple literal](https://www.w3.org/TR/rdf11-concepts/#dfn-simple-literal) without datatype or language form.","type":"object","required":["simple"],"properties":{"simple":{"type":"string"}},"additionalProperties":false},{"title":"LanguageTaggedString","description":"A [language-tagged string](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string)","type":"object","required":["language_tagged_string"],"properties":{"language_tagged_string":{"type":"object","required":["language","value"],"properties":{"language":{"description":"The [language tag](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tag).","type":"string"},"value":{"description":"The [lexical form](https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form).","type":"string"}},"additionalProperties":false}},"additionalProperties":false},{"title":"TypedValue","description":"A value with a datatype.","type":"object","required":["typed_value"],"properties":{"typed_value":{"type":"object","required":["datatype","value"],"properties":{"datatype":{"description":"The [datatype IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-datatype-iri).","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/IRI"}]},"value":{"description":"The [lexical form](https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form).","type":"string"}},"additionalProperties":false}},"additionalProperties":false}]},"Node":{"title":"Node","description":"Represents either an IRI (named node) or a blank node.","oneOf":[{"title":"NamedNode","description":"An RDF [IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-iri).","type":"object","required":["named_node"],"properties":{"named_node":{"$ref":"./okp4-cognitarium.json/#/definitions/IRI"}},"additionalProperties":false},{"title":"BlankNode","description":"An RDF [blank node](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node).","type":"object","required":["blank_node"],"properties":{"blank_node":{"type":"string"}},"additionalProperties":false}]},"Prefix":{"title":"Prefix","description":"Represents a prefix in a [SelectQuery]. A prefix is a shortcut for a namespace used in the query.","type":"object","required":["namespace","prefix"],"properties":{"namespace":{"description":"The namespace associated with the prefix.","type":"string"},"prefix":{"description":"The prefix.","type":"string"}},"additionalProperties":false},"SelectItem":{"title":"SelectItem","description":"Represents an item to select in a [SelectQuery].","oneOf":[{"title":"Variable","description":"Represents a variable.","type":"object","required":["variable"],"properties":{"variable":{"type":"string"}},"additionalProperties":false}]},"SelectQuery":{"title":"SelectQuery","description":"Represents a SELECT query over the triple store, allowing to select variables to return and to filter the results.","type":"object","required":["prefixes","select","where"],"properties":{"limit":{"description":"The maximum number of results to return. If `None`, there is no limit. Note: the value of the limit cannot exceed the maximum query limit defined in the store limitations.","type":["integer","null"],"format":"uint32","minimum":0},"prefixes":{"description":"The prefixes used in the query.","type":"array","items":{"$ref":"./okp4-cognitarium.json/#/definitions/Prefix"}},"select":{"description":"The items to select. Note: the number of items to select cannot exceed the maximum query variable count defined in the store limitations.","type":"array","items":{"$ref":"./okp4-cognitarium.json/#/definitions/SelectItem"}},"where":{"description":"The WHERE clause. If `None`, there is no WHERE clause, i.e. all triples are returned without filtering.","type":"array","items":{"$ref":"./okp4-cognitarium.json/#/definitions/WhereCondition"}}},"additionalProperties":false},"SimpleWhereCondition":{"title":"SimpleWhereCondition","description":"Represents a simple condition in a [WhereCondition].","oneOf":[{"title":"TriplePattern","description":"Represents a triple pattern, i.e. a condition on a triple based on its subject, predicate and object.","type":"object","required":["triple_pattern"],"properties":{"triple_pattern":{"$ref":"./okp4-cognitarium.json/#/definitions/TriplePattern"}},"additionalProperties":false}]},"TriplePattern":{"title":"TriplePattern","description":"Represents a triple pattern in a [SimpleWhereCondition].","type":"object","required":["object","predicate","subject"],"properties":{"object":{"description":"The object of the triple pattern.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/VarOrNodeOrLiteral"}]},"predicate":{"description":"The predicate of the triple pattern.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/VarOrNode"}]},"subject":{"description":"The subject of the triple pattern.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/VarOrNode"}]}},"additionalProperties":false},"VarOrNamedNode":{"title":"VarOrNamedNode {","description":"Represents either a variable or a named node (IRI).","oneOf":[{"title":"Variable","description":"A variable.","type":"object","required":["variable"],"properties":{"variable":{"type":"string"}},"additionalProperties":false},{"title":"NamedNode","description":"An RDF [IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-iri).","type":"object","required":["named_node"],"properties":{"named_node":{"$ref":"./okp4-cognitarium.json/#/definitions/IRI"}},"additionalProperties":false}]},"VarOrNode":{"title":"VarOrNode","description":"Represents either a variable or a node.","oneOf":[{"title":"Variable","description":"A variable.","type":"object","required":["variable"],"properties":{"variable":{"type":"string"}},"additionalProperties":false},{"title":"Node","description":"A node, i.e. an IRI or a blank node.","type":"object","required":["node"],"properties":{"node":{"$ref":"./okp4-cognitarium.json/#/definitions/Node"}},"additionalProperties":false}]},"VarOrNodeOrLiteral":{"title":"VarOrNodeOrLiteral","description":"Represents either a variable, a node or a literal.","oneOf":[{"title":"Variable","description":"A variable.","type":"object","required":["variable"],"properties":{"variable":{"type":"string"}},"additionalProperties":false},{"title":"Node","description":"A node, i.e. an IRI or a blank node.","type":"object","required":["node"],"properties":{"node":{"$ref":"./okp4-cognitarium.json/#/definitions/Node"}},"additionalProperties":false},{"title":"Literal","description":"An RDF [literal](https://www.w3.org/TR/rdf11-concepts/#dfn-literal), i.e. a simple literal, a language-tagged string or a typed value.","type":"object","required":["literal"],"properties":{"literal":{"$ref":"./okp4-cognitarium.json/#/definitions/Literal"}},"additionalProperties":false}]},"WhereCondition":{"title":"WhereCondition","description":"Represents a condition in a [WhereClause].","oneOf":[{"title":"Simple","description":"Represents a simple condition.","type":"object","required":["simple"],"properties":{"simple":{"$ref":"./okp4-cognitarium.json/#/definitions/SimpleWhereCondition"}},"additionalProperties":false}]}}},"migrate":null,"sudo":null,"responses":{"describe":{"$schema":"http://json-schema.org/draft-07/schema#","title":"DescribeResponse","description":"Represents the response of a [QueryMsg::Describe] query.","type":"object","required":["data","format"],"properties":{"data":{"description":"The data serialized in the specified format.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Binary"}]},"format":{"description":"The format of the data.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/DataFormat"}]}},"additionalProperties":false,"definitions":{"Binary":{"description":"Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .","type":"string"},"DataFormat":{"title":"DataFormat","description":"Represents the format in which the data are serialized, for example when returned by a query or when inserted in the store.","oneOf":[{"title":"RDF XML","description":"Output in [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) format.","type":"string","enum":["rdf_xml"]},{"title":"Turtle","description":"Output in [Turtle](https://www.w3.org/TR/turtle/) format.","type":"string","enum":["turtle"]},{"title":"N-Triples","description":"Output in [N-Triples](https://www.w3.org/TR/n-triples/) format.","type":"string","enum":["n_triples"]},{"title":"N-Quads","description":"Output in [N-Quads](https://www.w3.org/TR/n-quads/) format.","type":"string","enum":["n_quads"]}]}}},"select":{"$schema":"http://json-schema.org/draft-07/schema#","title":"SelectResponse","description":"Represents the response of a [QueryMsg::Select] query.","type":"object","required":["head","results"],"properties":{"head":{"description":"The head of the response, i.e. the set of variables mentioned in the results.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Head"}]},"results":{"description":"The results of the select query.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Results"}]}},"additionalProperties":false,"definitions":{"Head":{"title":"Head","description":"Represents the head of a [SelectResponse].","type":"object","required":["vars"],"properties":{"vars":{"description":"The variables selected in the query.","type":"array","items":{"type":"string"}}},"additionalProperties":false},"IRI":{"title":"IRI","description":"Represents an IRI.","oneOf":[{"title":"Prefixed","description":"An IRI prefixed with a prefix. The prefixed IRI is expanded to a full IRI using the prefix definition specified in the query. For example, the prefixed IRI `rdf:type` is expanded to `http://www.w3.org/1999/02/22-rdf-syntax-ns#type`.","type":"object","required":["prefixed"],"properties":{"prefixed":{"type":"string"}},"additionalProperties":false},{"title":"Full","description":"A full IRI.","type":"object","required":["full"],"properties":{"full":{"type":"string"}},"additionalProperties":false}]},"Results":{"title":"Results","description":"Represents the results of a [SelectResponse].","type":"object","required":["bindings"],"properties":{"bindings":{"description":"The bindings of the results.","type":"array","items":{"type":"object","additionalProperties":{"$ref":"./okp4-cognitarium.json/#/definitions/Value"}}}},"additionalProperties":false},"Value":{"title":"Value","oneOf":[{"title":"URI","description":"Represents an IRI.","type":"object","required":["type","value"],"properties":{"type":{"type":"string","enum":["uri"]},"value":{"description":"The value of the IRI.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/IRI"}]}},"additionalProperties":false},{"title":"Literal","description":"Represents a literal S with optional language tag L or datatype IRI D.","type":"object","required":["type","value"],"properties":{"datatype":{"description":"The datatype of the literal.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/IRI"},{"type":"null"}]},"type":{"type":"string","enum":["literal"]},"value":{"description":"The value of the literal.","type":"string"},"xml:lang":{"description":"The language tag of the literal.","type":["string","null"]}},"additionalProperties":false},{"title":"BlankNode","description":"Represents a blank node.","type":"object","required":["type","value"],"properties":{"type":{"type":"string","enum":["blank_node"]},"value":{"description":"The identifier of the blank node.","type":"string"}},"additionalProperties":false}]}}},"store":{"$schema":"http://json-schema.org/draft-07/schema#","title":"StoreResponse","description":"Contains information related to triple store.","type":"object","required":["limits","owner","stat"],"properties":{"limits":{"description":"The store limits.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/StoreLimits"}]},"owner":{"description":"The store owner.","type":"string"},"stat":{"description":"The store current usage.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/StoreStat"}]}},"additionalProperties":false,"definitions":{"StoreLimits":{"title":"StoreLimits","description":"Contains limitations regarding store usages.","type":"object","required":["max_byte_size","max_insert_data_byte_size","max_insert_data_triple_count","max_query_limit","max_query_variable_count","max_triple_byte_size","max_triple_count"],"properties":{"max_byte_size":{"description":"The maximum number of bytes the store can contains. 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.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"max_insert_data_byte_size":{"description":"The maximum number of bytes an insert data query can contains.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"max_insert_data_triple_count":{"description":"The maximum number of triples an insert data query can contains (after parsing).","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"max_query_limit":{"description":"The maximum limit of a query, i.e. the maximum number of triples returned by a select query.","type":"integer","format":"uint32","minimum":0},"max_query_variable_count":{"description":"The maximum number of variables a query can select.","type":"integer","format":"uint32","minimum":0},"max_triple_byte_size":{"description":"The maximum number of bytes the store can contains 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.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"max_triple_count":{"description":"The maximum number of triples the store can contains.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]}},"additionalProperties":false},"StoreStat":{"title":"StoreStat","description":"Contains usage information about the triple store.","type":"object","required":["byte_size","namespace_count","triple_count"],"properties":{"byte_size":{"description":"The total triple size in the store, in bytes.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"namespace_count":{"description":"The total number of IRI namespace present in the store.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"triple_count":{"description":"The total number of triple present in the store.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]}},"additionalProperties":false},"Uint128":{"description":"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.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```","type":"string"}}}},"description":"# Cognitarium\n\n## Overview\n\nThe `okp4-cognitarium` smart contract enables the storage of [RDF graphs triples](https://en.wikipedia.org/wiki/Semantic_triple) (i.e. `subject`-`predicate`-`object`) in any [Cosmos blockchains](https://cosmos.network/) using the [CosmWasm](https://cosmwasm.com/) framework.\n\n➡️ Checkout the [examples](https://github.com/okp4/contracts/tree/main/contracts/okp4-cognitarium/examples/) for usage information.","title":"okp4-cognitarium"} diff --git a/contracts/schema/okp4-law-stone.json b/contracts/schema/okp4-law-stone.json deleted file mode 100644 index ace358850eb..00000000000 --- a/contracts/schema/okp4-law-stone.json +++ /dev/null @@ -1 +0,0 @@ -{"contract_name":"okp4-law-stone","contract_version":"2.1.0","idl_version":"1.0.0","instantiate":{"$schema":"http://json-schema.org/draft-07/schema#","title":"InstantiateMsg","description":"Instantiate message","type":"object","required":["program","storage_address"],"properties":{"program":{"description":"The Prolog program carrying law rules and facts.","allOf":[{"$ref":"./okp4-law-stone.json/#/definitions/Binary"}]},"storage_address":{"description":"The `okp4-objectarium` contract address on which to store the law program.","type":"string"}},"additionalProperties":false,"definitions":{"Binary":{"description":"Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .","type":"string"}}},"execute":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ExecuteMsg","description":"Execute messages","oneOf":[{"title":"BreakStone","description":"Break the stone making this contract unusable, by clearing all the related resources: - Unpin all the pinned objects on `okp4-objectarium` contracts, if any. - Forget the main program (i.e. or at least unpin it). Only the contract admin is authorized to break it, if any. If already broken, this is a no-op.","type":"string","enum":["break_stone"]}]},"query":{"$schema":"http://json-schema.org/draft-07/schema#","title":"QueryMsg","description":"Query messages","oneOf":[{"title":"Ask","description":"If not broken, ask the logic module the provided query with the law program loaded.","type":"object","required":["ask"],"properties":{"ask":{"type":"object","required":["query"],"properties":{"query":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false},{"title":"Program","description":"If not broken, returns the law program location information.","type":"string","enum":["program"]}]},"migrate":null,"sudo":null,"responses":{"ask":{"$schema":"http://json-schema.org/draft-07/schema#","title":"AskResponse","type":"object","required":["gas_used","height"],"properties":{"answer":{"anyOf":[{"$ref":"./okp4-law-stone.json/#/definitions/Answer"},{"type":"null"}]},"gas_used":{"type":"integer","format":"uint64","minimum":0},"height":{"type":"integer","format":"uint64","minimum":0}},"definitions":{"Answer":{"type":"object","required":["has_more","results","success","variables"],"properties":{"has_more":{"type":"boolean"},"results":{"type":"array","items":{"$ref":"./okp4-law-stone.json/#/definitions/Result"}},"success":{"type":"boolean"},"variables":{"type":"array","items":{"type":"string"}}}},"Result":{"type":"object","required":["substitutions"],"properties":{"substitutions":{"type":"array","items":{"$ref":"./okp4-law-stone.json/#/definitions/Substitution"}}}},"Substitution":{"type":"object","required":["term","variable"],"properties":{"term":{"$ref":"./okp4-law-stone.json/#/definitions/Term"},"variable":{"type":"string"}}},"Term":{"type":"object","required":["arguments","name"],"properties":{"arguments":{"type":"array","items":{"$ref":"./okp4-law-stone.json/#/definitions/Term"}},"name":{"type":"string"}}}}},"program":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ProgramResponse","description":"ProgramResponse carry elements to locate the program in a `okp4-objectarium` contract.","type":"object","required":["object_id","storage_address"],"properties":{"object_id":{"description":"The program object id in the `okp4-objectarium` contract.","type":"string"},"storage_address":{"description":"The `okp4-objectarium` contract address on which the law program is stored.","type":"string"}},"additionalProperties":false}},"description":"# Law Stone\n\n## Overview\n\nThe `okp4-law-stone` smart contract aims to provide GaaS (i.e. Governance as a Service) in any [Cosmos blockchains](https://cosmos.network/) using the [CosmWasm](https://cosmwasm.com/) framework and the [Logic](https://docs.okp4.network/modules/next/logic) OKP4 module.\n\nThis contract is built around a Prolog program describing the law by rules and facts. The law stone is immutable, this means it can only been questioned, there is no update mechanisms.\n\nThe `okp4-law-stone` responsibility is to guarantee the availability of its rules in order to question them, but not to ensure the rules application.\n\nTo ensure reliability over time, the associated Prolog program is stored and pinned in a `okp4-objectarium` contract. Moreover, all the eventual loaded files must be stored in a `okp4-objectarium` contract as well, allowing the contract to pin them.\n\nTo be able to free the underlying resources (i.e. objects in `okp4-objectarium`) if not used anymore, the contract admin can break the stone.\n\n➡️ Checkout the [examples](https://github.com/okp4/contracts/tree/main/contracts/okp4-law-stone/examples/) for usage information.","title":"okp4-law-stone"} diff --git a/contracts/schema/okp4-objectarium.json b/contracts/schema/okp4-objectarium.json deleted file mode 100644 index 23d8c0b0593..00000000000 --- a/contracts/schema/okp4-objectarium.json +++ /dev/null @@ -1 +0,0 @@ -{"contract_name":"okp4-objectarium","contract_version":"2.1.0","idl_version":"1.0.0","instantiate":{"$schema":"http://json-schema.org/draft-07/schema#","title":"InstantiateMsg","description":"Instantiate messages","type":"object","required":["bucket"],"properties":{"bucket":{"description":"The name of the bucket. The name could not be empty or contains whitespaces. If name contains whitespace, they will be removed.","type":"string"},"config":{"description":"The configuration of the bucket.","default":{"accepted_compression_algorithms":["passthrough","snappy","lzma"],"hash_algorithm":"sha256"},"allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/BucketConfig"}]},"limits":{"description":"The limits of the bucket.","default":{"max_object_pins":null,"max_object_size":null,"max_objects":null,"max_total_size":null},"allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/BucketLimits"}]},"pagination":{"description":"The configuration for paginated query.","default":{"default_page_size":10,"max_page_size":30},"allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/PaginationConfig"}]}},"additionalProperties":false,"definitions":{"BucketConfig":{"description":"BucketConfig is the type of the configuration of a bucket.\n\nThe configuration is set at the instantiation of the bucket, and is immutable and cannot be changed. The configuration is optional and if not set, the default configuration is used.","type":"object","properties":{"accepted_compression_algorithms":{"description":"The acceptable compression algorithms for the objects in the bucket. If this parameter is not set (none or empty array), then all compression algorithms are accepted. If this parameter is set, then only the compression algorithms in the array are accepted.\n\nWhen an object is stored in the bucket without a specified compression algorithm, the first algorithm in the array is used. Therefore, the order of the algorithms in the array is significant. Typically, the most efficient compression algorithm, such as the NoCompression algorithm, should be placed first in the array.\n\nAny attempt to store an object using a different compression algorithm than the ones specified here will fail.","default":["passthrough","snappy","lzma"],"type":"array","items":{"$ref":"./okp4-objectarium.json/#/definitions/CompressionAlgorithm"}},"hash_algorithm":{"description":"The algorithm used to hash the content of the objects to generate the id of the objects. The algorithm is optional and if not set, the default algorithm is used.\n\nThe default algorithm is Sha256 if not set.","default":"sha256","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/HashAlgorithm"}]}},"additionalProperties":false},"BucketLimits":{"description":"BucketLimits is the type of the limits of a bucket.\n\nThe limits are optional and if not set, there is no limit.","type":"object","properties":{"max_object_pins":{"description":"The maximum number of pins in the bucket for an object.","anyOf":[{"$ref":"./okp4-objectarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_object_size":{"description":"The maximum size of the objects in the bucket.","anyOf":[{"$ref":"./okp4-objectarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_objects":{"description":"The maximum number of objects in the bucket.","anyOf":[{"$ref":"./okp4-objectarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_total_size":{"description":"The maximum total size of the objects in the bucket.","anyOf":[{"$ref":"./okp4-objectarium.json/#/definitions/Uint128"},{"type":"null"}]}},"additionalProperties":false},"CompressionAlgorithm":{"description":"CompressionAlgorithm is an enumeration that defines the different compression algorithms supported for compressing the content of objects. The compression algorithm specified here are relevant algorithms for compressing data on-chain, which means that they are fast to compress and decompress, and have a low computational cost.\n\nThe order of the compression algorithms is based on their estimated computational cost (quite opinionated) during both compression and decompression, ranging from the lowest to the highest. This particular order is utilized to establish the default compression algorithm for storing an object.","oneOf":[{"title":"Passthrough","description":"Represents no compression algorithm. The object is stored as is without any compression.","type":"string","enum":["passthrough"]},{"title":"Snappy","description":"Represents the Snappy algorithm. Snappy is a compression/decompression algorithm that does not aim for maximum compression. Instead, it aims for very high speeds and reasonable compression.\n\nSee [the snappy web page](https://google.github.io/snappy/) for more information.","type":"string","enum":["snappy"]},{"title":"Lzma","description":"Represents the LZMA algorithm. LZMA is a lossless data compression/decompression algorithm that features a high compression ratio and a variable compression-dictionary size up to 4 GB.\n\nSee [the LZMA wiki page](https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Markov_chain_algorithm) for more information.","type":"string","enum":["lzma"]}]},"HashAlgorithm":{"description":"HashAlgorithm is an enumeration that defines the different hash algorithms supported for hashing the content of objects.","oneOf":[{"title":"MD5","description":"Represents the MD5 algorithm. MD5 is a widely used cryptographic hash function that produces a 128-bit hash value. The computational cost of MD5 is relatively low compared to other hash functions, but its short hash length makes it easier to find hash collisions. It is now considered insecure for cryptographic purposes, but can still used in non-security contexts.\n\nMD5 hashes are stored on-chain as 32 hexadecimal characters.\n\nSee [the MD5 Wikipedia page](https://en.wikipedia.org/wiki/MD5) for more information.","type":"string","enum":["m_d5"]},{"title":"SHA1","description":"Represents the SHA-224 algorithm. SHA-224 is a variant of the SHA-2 family of hash functions that produces a 224-bit hash value. It is similar to SHA-256, but with a shorter output size. The computational cost of SHA-224 is moderate, and its relatively short hash length makes it easier to store and transmit.\n\nSHA-224 hashes are stored on-chain as 56 hexadecimal characters.\n\nSee [the SHA-2 Wikipedia page](https://en.wikipedia.org/wiki/SHA-2) for more information.","type":"string","enum":["sha224"]},{"title":"SHA256","description":"Represents the SHA-256 algorithm. SHA-256 is a member of the SHA-2 family of hash functions that produces a 256-bit hash value. It is widely used in cryptography and other security-related applications. The computational cost of SHA-256 is moderate, and its hash length strikes a good balance between security and convenience.\n\nSHA-256 hashes are stored on-chain as 64 hexadecimal characters.\n\nSee [the SHA-2 Wikipedia page](https://en.wikipedia.org/wiki/SHA-2) for more information.","type":"string","enum":["sha256"]},{"title":"SHA384","description":"Represents the SHA-384 algorithm. SHA-384 is a variant of the SHA-2 family of hash functions that produces a 384-bit hash value. It is similar to SHA-512, but with a shorter output size. The computational cost of SHA-384 is relatively high, but its longer hash length provides better security against hash collisions.\n\nSHA-384 hashes are stored on-chain as 96 hexadecimal characters.\n\nSee [the SHA-2 Wikipedia page](https://en.wikipedia.org/wiki/SHA-2) for more information.","type":"string","enum":["sha384"]},{"title":"SHA512","description":"Represents the SHA-512 algorithm. SHA-512 is a member of the SHA-2 family of hash functions that produces a 512-bit hash value. It is widely used in cryptography and other security-related applications. The computational cost of SHA-512 is relatively high, but its longer hash length provides better security against hash collisions.\n\nSHA-512 hashes are stored on-chain as 128 hexadecimal characters.\n\nSee [the SHA-2 Wikipedia page](https://en.wikipedia.org/wiki/SHA-2) for more information.","type":"string","enum":["sha512"]}]},"PaginationConfig":{"description":"PaginationConfig is the type carrying configuration for paginated queries.\n\nThe fields are optional and if not set, there is a default configuration.","type":"object","properties":{"default_page_size":{"description":"The default number of elements in a page.\n\nShall be less or equal than `max_page_size`. Default to '10' if not set.","default":10,"type":"integer","format":"uint32","minimum":0},"max_page_size":{"description":"The maximum elements a page can contains.\n\nShall be less than `u32::MAX - 1`. Default to '30' if not set.","default":30,"type":"integer","format":"uint32","minimum":0}},"additionalProperties":false},"Uint128":{"description":"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.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```","type":"string"}}},"execute":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ExecuteMsg","description":"Execute messages","oneOf":[{"title":"StoreObject","description":"StoreObject store an object to the bucket and make the sender the owner of the object. The object is referenced by the hash of its content and this value is returned. If the object is already stored, an error is returned.\n\nThe \"pin\" parameter specifies if the object should be pinned for the sender. In such case, the object cannot be removed (forget) from the storage.\n\nThe \"compression_algorithm\" parameter specifies the algorithm for compressing the object before storing it in the storage, which is optional. If no algorithm is specified, the algorithm used is the first algorithm of the bucket configuration limits. Note that the chosen algorithm can save storage space, but it will increase CPU usage. Depending on the chosen compression algorithm and the achieved compression ratio, the gas cost of the operation will vary, either increasing or decreasing.","type":"object","required":["store_object"],"properties":{"store_object":{"type":"object","required":["data","pin"],"properties":{"compression_algorithm":{"description":"Specifies the compression algorithm to use when storing the object. If None, the first algorithm specified in the list of accepted compression algorithms of the bucket is used (see [BucketLimits::accepted_compression_algorithms]).","anyOf":[{"$ref":"./okp4-objectarium.json/#/definitions/CompressionAlgorithm"},{"type":"null"}]},"data":{"description":"The content of the object to store.","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/Binary"}]},"pin":{"description":"Specifies if the object should be pinned for the sender.","type":"boolean"}},"additionalProperties":false}},"additionalProperties":false},{"title":"ForgetObject","description":"ForgetObject first unpin the object from the bucket for the considered sender, then remove it from the storage if it is not pinned anymore. If the object is pinned for other senders, it is not removed from the storage and an error is returned. If the object is not pinned for the sender, this is a no-op.","type":"object","required":["forget_object"],"properties":{"forget_object":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false},{"title":"PinObject","description":"PinObject pins the object in the bucket for the considered sender. If the object is already pinned for the sender, this is a no-op. While an object is pinned, it cannot be removed from the storage.","type":"object","required":["pin_object"],"properties":{"pin_object":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false},{"title":"UnpinObject","description":"UnpinObject unpins the object in the bucket for the considered sender. If the object is not pinned for the sender, this is a no-op. The object can be removed from the storage if it is not pinned anymore.","type":"object","required":["unpin_object"],"properties":{"unpin_object":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false}],"definitions":{"Binary":{"description":"Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .","type":"string"},"CompressionAlgorithm":{"description":"CompressionAlgorithm is an enumeration that defines the different compression algorithms supported for compressing the content of objects. The compression algorithm specified here are relevant algorithms for compressing data on-chain, which means that they are fast to compress and decompress, and have a low computational cost.\n\nThe order of the compression algorithms is based on their estimated computational cost (quite opinionated) during both compression and decompression, ranging from the lowest to the highest. This particular order is utilized to establish the default compression algorithm for storing an object.","oneOf":[{"title":"Passthrough","description":"Represents no compression algorithm. The object is stored as is without any compression.","type":"string","enum":["passthrough"]},{"title":"Snappy","description":"Represents the Snappy algorithm. Snappy is a compression/decompression algorithm that does not aim for maximum compression. Instead, it aims for very high speeds and reasonable compression.\n\nSee [the snappy web page](https://google.github.io/snappy/) for more information.","type":"string","enum":["snappy"]},{"title":"Lzma","description":"Represents the LZMA algorithm. LZMA is a lossless data compression/decompression algorithm that features a high compression ratio and a variable compression-dictionary size up to 4 GB.\n\nSee [the LZMA wiki page](https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Markov_chain_algorithm) for more information.","type":"string","enum":["lzma"]}]}}},"query":{"$schema":"http://json-schema.org/draft-07/schema#","title":"QueryMsg","description":"Query messages","oneOf":[{"title":"Bucket","description":"Bucket returns the bucket information.","type":"object","required":["bucket"],"properties":{"bucket":{"type":"object","additionalProperties":false}},"additionalProperties":false},{"title":"Object","description":"Object returns the object information with the given id.","type":"object","required":["object"],"properties":{"object":{"type":"object","required":["id"],"properties":{"id":{"description":"The id of the object to get.","type":"string"}},"additionalProperties":false}},"additionalProperties":false},{"title":"Objects","description":"Objects returns the list of objects in the bucket with support for pagination.","type":"object","required":["objects"],"properties":{"objects":{"type":"object","properties":{"address":{"description":"The owner of the objects to get.","type":["string","null"]},"after":{"description":"The point in the sequence to start returning objects.","type":["string","null"]},"first":{"description":"The number of objects to return.","type":["integer","null"],"format":"uint32","minimum":0}},"additionalProperties":false}},"additionalProperties":false},{"title":"ObjectData","description":"ObjectData returns the content of the object with the given id.","type":"object","required":["object_data"],"properties":{"object_data":{"type":"object","required":["id"],"properties":{"id":{"description":"The id of the object to get.","type":"string"}},"additionalProperties":false}},"additionalProperties":false},{"title":"ObjectPins","description":"ObjectPins returns the list of addresses that pinned the object with the given id with support for pagination.","type":"object","required":["object_pins"],"properties":{"object_pins":{"type":"object","required":["id"],"properties":{"after":{"description":"The point in the sequence to start returning pins.","type":["string","null"]},"first":{"description":"The number of pins to return.","type":["integer","null"],"format":"uint32","minimum":0},"id":{"description":"The id of the object to get the pins for.","type":"string"}},"additionalProperties":false}},"additionalProperties":false}]},"migrate":null,"sudo":null,"responses":{"bucket":{"$schema":"http://json-schema.org/draft-07/schema#","title":"BucketResponse","description":"BucketResponse is the response of the Bucket query.","type":"object","required":["config","limits","name","pagination"],"properties":{"config":{"description":"The configuration of the bucket.","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/BucketConfig"}]},"limits":{"description":"The limits of the bucket.","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/BucketLimits"}]},"name":{"description":"The name of the bucket.","type":"string"},"pagination":{"description":"The configuration for paginated query.","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/PaginationConfig"}]}},"additionalProperties":false,"definitions":{"BucketConfig":{"description":"BucketConfig is the type of the configuration of a bucket.\n\nThe configuration is set at the instantiation of the bucket, and is immutable and cannot be changed. The configuration is optional and if not set, the default configuration is used.","type":"object","properties":{"accepted_compression_algorithms":{"description":"The acceptable compression algorithms for the objects in the bucket. If this parameter is not set (none or empty array), then all compression algorithms are accepted. If this parameter is set, then only the compression algorithms in the array are accepted.\n\nWhen an object is stored in the bucket without a specified compression algorithm, the first algorithm in the array is used. Therefore, the order of the algorithms in the array is significant. Typically, the most efficient compression algorithm, such as the NoCompression algorithm, should be placed first in the array.\n\nAny attempt to store an object using a different compression algorithm than the ones specified here will fail.","default":["passthrough","snappy","lzma"],"type":"array","items":{"$ref":"./okp4-objectarium.json/#/definitions/CompressionAlgorithm"}},"hash_algorithm":{"description":"The algorithm used to hash the content of the objects to generate the id of the objects. The algorithm is optional and if not set, the default algorithm is used.\n\nThe default algorithm is Sha256 if not set.","default":"sha256","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/HashAlgorithm"}]}},"additionalProperties":false},"BucketLimits":{"description":"BucketLimits is the type of the limits of a bucket.\n\nThe limits are optional and if not set, there is no limit.","type":"object","properties":{"max_object_pins":{"description":"The maximum number of pins in the bucket for an object.","anyOf":[{"$ref":"./okp4-objectarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_object_size":{"description":"The maximum size of the objects in the bucket.","anyOf":[{"$ref":"./okp4-objectarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_objects":{"description":"The maximum number of objects in the bucket.","anyOf":[{"$ref":"./okp4-objectarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_total_size":{"description":"The maximum total size of the objects in the bucket.","anyOf":[{"$ref":"./okp4-objectarium.json/#/definitions/Uint128"},{"type":"null"}]}},"additionalProperties":false},"CompressionAlgorithm":{"description":"CompressionAlgorithm is an enumeration that defines the different compression algorithms supported for compressing the content of objects. The compression algorithm specified here are relevant algorithms for compressing data on-chain, which means that they are fast to compress and decompress, and have a low computational cost.\n\nThe order of the compression algorithms is based on their estimated computational cost (quite opinionated) during both compression and decompression, ranging from the lowest to the highest. This particular order is utilized to establish the default compression algorithm for storing an object.","oneOf":[{"title":"Passthrough","description":"Represents no compression algorithm. The object is stored as is without any compression.","type":"string","enum":["passthrough"]},{"title":"Snappy","description":"Represents the Snappy algorithm. Snappy is a compression/decompression algorithm that does not aim for maximum compression. Instead, it aims for very high speeds and reasonable compression.\n\nSee [the snappy web page](https://google.github.io/snappy/) for more information.","type":"string","enum":["snappy"]},{"title":"Lzma","description":"Represents the LZMA algorithm. LZMA is a lossless data compression/decompression algorithm that features a high compression ratio and a variable compression-dictionary size up to 4 GB.\n\nSee [the LZMA wiki page](https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Markov_chain_algorithm) for more information.","type":"string","enum":["lzma"]}]},"HashAlgorithm":{"description":"HashAlgorithm is an enumeration that defines the different hash algorithms supported for hashing the content of objects.","oneOf":[{"title":"MD5","description":"Represents the MD5 algorithm. MD5 is a widely used cryptographic hash function that produces a 128-bit hash value. The computational cost of MD5 is relatively low compared to other hash functions, but its short hash length makes it easier to find hash collisions. It is now considered insecure for cryptographic purposes, but can still used in non-security contexts.\n\nMD5 hashes are stored on-chain as 32 hexadecimal characters.\n\nSee [the MD5 Wikipedia page](https://en.wikipedia.org/wiki/MD5) for more information.","type":"string","enum":["m_d5"]},{"title":"SHA1","description":"Represents the SHA-224 algorithm. SHA-224 is a variant of the SHA-2 family of hash functions that produces a 224-bit hash value. It is similar to SHA-256, but with a shorter output size. The computational cost of SHA-224 is moderate, and its relatively short hash length makes it easier to store and transmit.\n\nSHA-224 hashes are stored on-chain as 56 hexadecimal characters.\n\nSee [the SHA-2 Wikipedia page](https://en.wikipedia.org/wiki/SHA-2) for more information.","type":"string","enum":["sha224"]},{"title":"SHA256","description":"Represents the SHA-256 algorithm. SHA-256 is a member of the SHA-2 family of hash functions that produces a 256-bit hash value. It is widely used in cryptography and other security-related applications. The computational cost of SHA-256 is moderate, and its hash length strikes a good balance between security and convenience.\n\nSHA-256 hashes are stored on-chain as 64 hexadecimal characters.\n\nSee [the SHA-2 Wikipedia page](https://en.wikipedia.org/wiki/SHA-2) for more information.","type":"string","enum":["sha256"]},{"title":"SHA384","description":"Represents the SHA-384 algorithm. SHA-384 is a variant of the SHA-2 family of hash functions that produces a 384-bit hash value. It is similar to SHA-512, but with a shorter output size. The computational cost of SHA-384 is relatively high, but its longer hash length provides better security against hash collisions.\n\nSHA-384 hashes are stored on-chain as 96 hexadecimal characters.\n\nSee [the SHA-2 Wikipedia page](https://en.wikipedia.org/wiki/SHA-2) for more information.","type":"string","enum":["sha384"]},{"title":"SHA512","description":"Represents the SHA-512 algorithm. SHA-512 is a member of the SHA-2 family of hash functions that produces a 512-bit hash value. It is widely used in cryptography and other security-related applications. The computational cost of SHA-512 is relatively high, but its longer hash length provides better security against hash collisions.\n\nSHA-512 hashes are stored on-chain as 128 hexadecimal characters.\n\nSee [the SHA-2 Wikipedia page](https://en.wikipedia.org/wiki/SHA-2) for more information.","type":"string","enum":["sha512"]}]},"PaginationConfig":{"description":"PaginationConfig is the type carrying configuration for paginated queries.\n\nThe fields are optional and if not set, there is a default configuration.","type":"object","properties":{"default_page_size":{"description":"The default number of elements in a page.\n\nShall be less or equal than `max_page_size`. Default to '10' if not set.","default":10,"type":"integer","format":"uint32","minimum":0},"max_page_size":{"description":"The maximum elements a page can contains.\n\nShall be less than `u32::MAX - 1`. Default to '30' if not set.","default":30,"type":"integer","format":"uint32","minimum":0}},"additionalProperties":false},"Uint128":{"description":"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.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```","type":"string"}}},"object":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ObjectResponse","description":"ObjectResponse is the response of the Object query.","type":"object","required":["compressed_size","compression_algorithm","id","is_pinned","owner","size"],"properties":{"compressed_size":{"description":"The size of the object when compressed. If the object is not compressed, the value is the same as `size`.","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/Uint128"}]},"compression_algorithm":{"description":"The compression algorithm used to compress the content of the object.","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/CompressionAlgorithm"}]},"id":{"description":"The id of the object.","type":"string"},"is_pinned":{"description":"Tells if the object is pinned by at least one address.","type":"boolean"},"owner":{"description":"The owner of the object.","type":"string"},"size":{"description":"The size of the object.","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/Uint128"}]}},"additionalProperties":false,"definitions":{"CompressionAlgorithm":{"description":"CompressionAlgorithm is an enumeration that defines the different compression algorithms supported for compressing the content of objects. The compression algorithm specified here are relevant algorithms for compressing data on-chain, which means that they are fast to compress and decompress, and have a low computational cost.\n\nThe order of the compression algorithms is based on their estimated computational cost (quite opinionated) during both compression and decompression, ranging from the lowest to the highest. This particular order is utilized to establish the default compression algorithm for storing an object.","oneOf":[{"title":"Passthrough","description":"Represents no compression algorithm. The object is stored as is without any compression.","type":"string","enum":["passthrough"]},{"title":"Snappy","description":"Represents the Snappy algorithm. Snappy is a compression/decompression algorithm that does not aim for maximum compression. Instead, it aims for very high speeds and reasonable compression.\n\nSee [the snappy web page](https://google.github.io/snappy/) for more information.","type":"string","enum":["snappy"]},{"title":"Lzma","description":"Represents the LZMA algorithm. LZMA is a lossless data compression/decompression algorithm that features a high compression ratio and a variable compression-dictionary size up to 4 GB.\n\nSee [the LZMA wiki page](https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Markov_chain_algorithm) for more information.","type":"string","enum":["lzma"]}]},"Uint128":{"description":"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.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```","type":"string"}}},"object_data":{"$schema":"http://json-schema.org/draft-07/schema#","title":"Binary","description":"Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .","type":"string"},"object_pins":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ObjectPinsResponse","description":"ObjectPinsResponse is the response of the GetObjectPins query.","type":"object","required":["data","page_info"],"properties":{"data":{"description":"The list of addresses that pinned the object.","type":"array","items":{"type":"string"}},"page_info":{"description":"The page information.","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/PageInfo"}]}},"additionalProperties":false,"definitions":{"PageInfo":{"title":"PageInfo","description":"PageInfo is the page information returned for paginated queries.","type":"object","required":["cursor","has_next_page"],"properties":{"cursor":{"description":"The cursor to the next page.","type":"string"},"has_next_page":{"description":"Tells if there is a next page.","type":"boolean"}},"additionalProperties":false}}},"objects":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ObjectsResponse","description":"ObjectsResponse is the response of the Objects query.","type":"object","required":["data","page_info"],"properties":{"data":{"description":"The list of objects in the bucket.","type":"array","items":{"$ref":"./okp4-objectarium.json/#/definitions/ObjectResponse"}},"page_info":{"description":"The page information.","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/PageInfo"}]}},"additionalProperties":false,"definitions":{"CompressionAlgorithm":{"description":"CompressionAlgorithm is an enumeration that defines the different compression algorithms supported for compressing the content of objects. The compression algorithm specified here are relevant algorithms for compressing data on-chain, which means that they are fast to compress and decompress, and have a low computational cost.\n\nThe order of the compression algorithms is based on their estimated computational cost (quite opinionated) during both compression and decompression, ranging from the lowest to the highest. This particular order is utilized to establish the default compression algorithm for storing an object.","oneOf":[{"title":"Passthrough","description":"Represents no compression algorithm. The object is stored as is without any compression.","type":"string","enum":["passthrough"]},{"title":"Snappy","description":"Represents the Snappy algorithm. Snappy is a compression/decompression algorithm that does not aim for maximum compression. Instead, it aims for very high speeds and reasonable compression.\n\nSee [the snappy web page](https://google.github.io/snappy/) for more information.","type":"string","enum":["snappy"]},{"title":"Lzma","description":"Represents the LZMA algorithm. LZMA is a lossless data compression/decompression algorithm that features a high compression ratio and a variable compression-dictionary size up to 4 GB.\n\nSee [the LZMA wiki page](https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Markov_chain_algorithm) for more information.","type":"string","enum":["lzma"]}]},"ObjectResponse":{"title":"ObjectResponse","description":"ObjectResponse is the response of the Object query.","type":"object","required":["compressed_size","compression_algorithm","id","is_pinned","owner","size"],"properties":{"compressed_size":{"description":"The size of the object when compressed. If the object is not compressed, the value is the same as `size`.","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/Uint128"}]},"compression_algorithm":{"description":"The compression algorithm used to compress the content of the object.","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/CompressionAlgorithm"}]},"id":{"description":"The id of the object.","type":"string"},"is_pinned":{"description":"Tells if the object is pinned by at least one address.","type":"boolean"},"owner":{"description":"The owner of the object.","type":"string"},"size":{"description":"The size of the object.","allOf":[{"$ref":"./okp4-objectarium.json/#/definitions/Uint128"}]}},"additionalProperties":false},"PageInfo":{"title":"PageInfo","description":"PageInfo is the page information returned for paginated queries.","type":"object","required":["cursor","has_next_page"],"properties":{"cursor":{"description":"The cursor to the next page.","type":"string"},"has_next_page":{"description":"Tells if there is a next page.","type":"boolean"}},"additionalProperties":false},"Uint128":{"description":"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.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```","type":"string"}}}},"description":"# Objectarium\n\n## Overview\n\nThe `okp4-objectarium` smart contract enables the storage of arbitrary `objects` in any [Cosmos blockchains](https://cosmos.network/) using the [CosmWasm](https://cosmwasm.com/) framework.\n\nThis contract allows for storing `objects`, pinning and unpinning `objects` for a given sender address, and it also includes the ability to remove (forget) `objects` if they are no longer pinned.\n\n## Usage\n\n### Instantiate\n\nThe `okp4-objectarium` can be instantiated as follows, refer to the schema for more information on configuration, limits and pagination configuration:\n\n```bash\nokp4d tx wasm instantiate $CODE_ID \\\n --label \"my-storage\" \\\n --from $ADDR \\\n --admin $ADMIN_ADDR \\\n --gas 1000000 \\\n --broadcast-mode block \\\n '{\"bucket\":\"my-bucket\"}'\n```\n\n### Execute\n\nWe can store an object by providing its data in base64 encoded, we can pin the stored object to prevent it from being removed:\n\n```bash\nokp4d tx wasm execute $CONTRACT_ADDR \\\n --from $ADDR \\\n --gas 1000000 \\\n --broadcast-mode block \\\n \"{\\\"store_object\\\":{\\\"data\\\": \\\"$(cat my-data | base64)\\\",\\\"pin\\\":true}}\"\n```\n\nThe object id is stable as it is a hash, we can't store an object twice.\n\nWith the following commands we can pin and unpin existing objects:\n\n```bash\nokp4d tx wasm execute $CONTRACT_ADDR \\\n --from $ADDR \\\n --gas 1000000 \\\n --broadcast-mode block \\\n \"{\\\"pin_object\\\":{\\\"id\\\": \\\"$OBJECT_ID\\\"}}\"\n\nokp4d tx wasm execute $CONTRACT_ADDR \\\n --from $ADDR \\\n --gas 1000000 \\\n --broadcast-mode block \\\n \"{\\\"unpin_object\\\":{\\\"id\\\": \\\"$OBJECT_ID\\\"}}\"\n```\n\nAnd if an object is not pinned, or pinned by the sender of transaction, we can remove it:\n\n```bash\nokp4d tx wasm execute $CONTRACT_ADDR \\\n --from $ADDR \\\n --gas 1000000 \\\n --broadcast-mode block \\\n \"{\\\"forget_object\\\":{\\\"id\\\": \\\"$OBJECT_ID\\\"}}\"\n```\n\n### Query\n\nQuery an object by its id:\n\n```bash\nokp4d query wasm contract-state smart $CONTRACT_ADDR \\\n \"{\\\"object\\\": {\\\"id\\\": \\\"$OBJECT_ID\\\"}}\"\n```\n\nOr its data:\n\n```bash\nokp4d query wasm contract-state smart $CONTRACT_ADDR \\\n \"{\\\"object_data\\\": {\\\"id\\\": \\\"$OBJECT_ID\\\"}}\"\n```\n\nWe can also list the objects, eventually filtering on the object owner:\n\n```bash\nokp4d query wasm contract-state smart $CONTRACT_ADDR \\\n \"{\\\"objects\\\": {\\\"address\\\": \\\"okp41p8u47en82gmzfm259y6z93r9qe63l25dfwwng6\\\"}}\"\n```\n\nAnd navigate in a cursor based pagination:\n\n```bash\nokp4d query wasm contract-state smart $CONTRACT_ADDR \\\n \"{\\\"objects\\\": {\\\"first\\\": 5, \\\"after\\\": \\\"23Y5t5DBe7DkPwfJo3Sd26Y8Z9epmtpA1FTpdG7DiG6MD8vPRTzzbQ9TccmyoBcePkPK6atUiqcAzJVo3TfYNBGY\\\"}}\"\n```\n\nWe can also query object pins with the same cursor based pagination:\n\n```bash\nokp4d query wasm contract-state smart $CONTRACT_ADDR \\\n \"{\\\"object_pins\\\": {\\\"id\\\": \\\"$OBJECT_ID\\\", \\\"first\\\": 5, \\\"after\\\": \\\"23Y5t5DBe7DkPwfJo3Sd26Y8Z9epmtpA1FTpdG7DiG6MD8vPRTzzbQ9TccmyoBcePkPK6atUiqcAzJVo3TfYNBGY\\\"}}\"\n```","title":"okp4-objectarium"} diff --git a/docs/tutorials/nonos-tuto-3.md b/docs/tutorials/nonos-tuto-3.md new file mode 100644 index 00000000000..d3ad3722fde --- /dev/null +++ b/docs/tutorials/nonos-tuto-3.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 103 +--- +# Video Tuto #3 - Ontology + +🚀 Welcome to the third episode of Nono's Tuto ! +Your tutorial series to become an expert developer on the OKP4 protocol 🔥 + +📚 In this third episode, we'll dive in the Ontology and do some demonstration! + + diff --git a/docs/tutorials/overview.md b/docs/tutorials/overview.md index 473192b5765..522a9dd95f0 100644 --- a/docs/tutorials/overview.md +++ b/docs/tutorials/overview.md @@ -20,3 +20,4 @@ Discover our video tutorials with Arnaud our Blockchain Architect: * [Introduction to OKP4 Architecture](./nonos-tuto-1) * [Governance, you said](./nonos-tuto-2) +* [Learn more about Ontology](./nonos-tuto-3) diff --git a/docs/whitepaper/solution.md b/docs/whitepaper/solution.md index fa78e292926..5522eb098b5 100644 --- a/docs/whitepaper/solution.md +++ b/docs/whitepaper/solution.md @@ -93,14 +93,19 @@ From this perspective, Digital Services serve as the structural and functional u **STaaS-Storage as a service:** The Dataverse is capable of supporting all storage options. These range from local storage options to cloud storage solutions operated by major providers such as Dropbox or Any”Drive”. Additionally, decentralized storage networks like InterPlanetary File System (IPFS), Filecoin, or Arweave can also be integrated into the platform. + **Compute-as-a-Service:** Similarly, the Dataverse is adaptable to a range of computation options. While many services will be provided as APIs with their own computational resources, others can be executed on cloud services operated by commercial entities or decentralized compute resources. This flexibility is essential for accommodating different types of computational tasks and workloads. Revelant general purpose compute networks as [Akash](https://akash.network/) can be easily referenced into the protocol. + **Identity Provider:** In terms of identity management, the Dataverse can integrate with various identity management services or identity standards, depending on the specific requirements. Whether it's a simple, a decentralized identity management system, or a more complex centralized identity service, OKP4 can support it, providing secure and flexible solutions for identity management; + **Orchestration-as-a-Service:** The Orchestration Service is a **crucial service** of the Protocol which orchestrates the invocations of other services. It is a reflex component of the Ecosystem that listens to the transactions of the blockchain and is triggered on command, when a particular transaction of execution request is registered in the blockchain. It's important to note that, given the potential for multiple instances of the service and several types of orchestration services, there is a decentralized mechanism in place that ensures the correct instance of the appropriate type is executed. + **Algorithms and Models:** From simple logical rules to sophisticated AI-driven algorithms, machine learning models, data processing scripts, image recognition models, predictive analytics, natural language processing (NLP) models, and even blockchain smart contracts, the Dataverse is designed to accommodate and utilize a diverse range of algorithms and models. Their inclusion is dictated solely by the unique needs and objectives of the tasks at hand. + **Analytic-as-a-Service:** In an era of increasing data complexity and volume, effective knowledge representation is pivotal. The Analytics and Business Intelligence services is designed to transform raw data into useful insights, employing tools of B.I and Knowledge Graphs. BI tools can be effectively employed to comprehend the data shared within the zones and facilitate the extraction of useful knowledge. Knowledge Graph can facilitate the interpretation of the complex interactions and dependencies within the Dataverse, offering an intuitive view of the knowledge extraction processes. diff --git a/docusaurus.config.js b/docusaurus.config.js index 6514faa5bae..c3857897203 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -20,6 +20,11 @@ async function createconfig() { deploymentBranch: 'gh-pages', trailingSlash: false, + i18n: { + defaultLocale: 'en', + locales: ['en', 'fr'] + }, + presets: [ [ 'classic', diff --git a/i18n/en/code.json b/i18n/en/code.json new file mode 100644 index 00000000000..d4a31840e7b --- /dev/null +++ b/i18n/en/code.json @@ -0,0 +1,6 @@ +{ + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "Back to main menu →", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + } +} diff --git a/i18n/fr/code.json b/i18n/fr/code.json new file mode 100644 index 00000000000..76831c32969 --- /dev/null +++ b/i18n/fr/code.json @@ -0,0 +1,6 @@ +{ + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "Retour au menu principal →", + "description": "Le libellé du bouton de retour pour revenir au menu principal, à l'intérieur du menu secondaire de la barre latérale de la barre de navigation mobile (utilisé notamment pour afficher la barre latérale des documents)" + } +} diff --git a/src/scss/custom.scss b/src/scss/custom.scss index 57272d0a0f6..67f3b845356 100644 --- a/src/scss/custom.scss +++ b/src/scss/custom.scss @@ -39,6 +39,7 @@ --ifm-footer-background-color-main: transparent linear-gradient(212deg, #181c49 0%, #343869 100%) 0% 0% no-repeat padding-box; --ifm-navbar-background-color: #f2f6f9; + --ifm-navbar-item-color: linear-gradient(39.81deg, #006796 21.82%, #00b6b7 98.43%); --ifm-article-anchor-color: #ff9500; --ifm-graph-svg-background-color: #ecf0f1; --ifm-knowledge-graph-data-fill-color: #f3a83f; diff --git a/src/scss/main.scss b/src/scss/main.scss index cc69a7ca25e..75e4fc61162 100644 --- a/src/scss/main.scss +++ b/src/scss/main.scss @@ -1,3 +1,9 @@ +@mixin with-linear-gradient($background-color) { + background: var($background-color); + background-clip: text; + -webkit-text-fill-color: transparent; +} + html { background: var(--ifm-background-color-main); min-height: 100%; @@ -33,6 +39,12 @@ html { .navbar__items--right { display: flex; flex-direction: row-reverse; + + @media (max-width: 996px) { + position: absolute; + right: 55px; + top: 40px; + } } .card-title { @@ -77,6 +89,18 @@ html { .navbar__items { font-size: 18px; + @media (max-width: 996px) { + flex-direction: row-reverse; + + .navbar__brand { + width: 100%; + } + } + + .navbar__link { + color: inherit; + } + .navbar__search { input { font-family: var(--ifm-font-family-base); @@ -96,10 +120,26 @@ html { color: var(--ifm-color-primary); } + .navbar-sidebar { + left: inherit; + right: 0; + transform: translate3d(100%, 0, 0); + } + .navbar__link--active { + @include with-linear-gradient(--ifm-navbar-item-color); + font-weight: var(--ifm-font-weight-bold); } + .navbar__link:hover { + @include with-linear-gradient(--ifm-navbar-item-color); + } + + .dropdown .navbar__link:hover::after { + border-color: #00b6b7 transparent; + } + .footer { background: var(--ifm-footer-background-color-main);