From 8d70e0bf4d6303eb135551ed3b5e2714e0d668d1 Mon Sep 17 00:00:00 2001 From: Bot Anik <98603954+bot-anik@users.noreply.github.com> Date: Tue, 13 Jun 2023 10:01:34 +0000 Subject: [PATCH] chore(release): perform release 2.0.0 --- CHANGELOG.md | 100 ++++++++++++++++++++ contracts/okp4-cognitarium/Cargo.toml | 2 +- contracts/okp4-law-stone/Cargo.toml | 2 +- contracts/okp4-objectarium/Cargo.toml | 2 +- docs/schema/okp4-cognitarium.json | 2 +- docs/schema/okp4-law-stone.json | 2 +- docs/schema/okp4-objectarium.json | 2 +- packages/okp4-logic-bindings/Cargo.toml | 2 +- packages/okp4-objectarium-client/Cargo.toml | 2 +- 9 files changed, 108 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2a51556..8edd3e38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,105 @@ # ØKP4 contracts +## [2.0.0](https://github.com/okp4/contracts/compare/v1.0.0...v2.0.0) (2023-06-13) + + +### ⚠ BREAKING CHANGES + +* **objectarium:** update objectarium sample according to api change + +### Features + +* **cagnotarium:** add nquads insert support ([f963d21](https://github.com/okp4/contracts/commit/f963d21b229d6d5f49e03153cbf5f2d00d764f54)) +* **cognitarium:** add dummy store query impl ([e30e507](https://github.com/okp4/contracts/commit/e30e507de9fcbac01af6cc94a70951239b014bff)) +* **cognitarium:** add dummy triple pattern query iterator ([ac6e42d](https://github.com/okp4/contracts/commit/ac6e42de007d0f75cac0c91b265e0b21572777da)) +* **cognitarium:** add max_query_limit limit ([b97835b](https://github.com/okp4/contracts/commit/b97835bb68d09e282bdb77e850177d25351e2e8e)) +* **cognitarium:** add namespace state ([2844aac](https://github.com/okp4/contracts/commit/2844aac4ad05a929624c43c3d268c4ebc1396a1b)) +* **cognitarium:** add plan builder structure ([9d374eb](https://github.com/okp4/contracts/commit/9d374eb14dbbc6983dcbfb3b34ca525374d1a2b3)) +* **cognitarium:** add query solutions iterator ([4b5c0ac](https://github.com/okp4/contracts/commit/4b5c0acceddc23031df368b3ca78b50c0146e889)) +* **cognitarium:** add rdf parsing related errors ([7c25908](https://github.com/okp4/contracts/commit/7c259089e9e409a683333bc7c85bd114ff2a37e3)) +* **cognitarium:** add store limits related errors ([9667847](https://github.com/okp4/contracts/commit/96678479dd6936542af2d9de1fce845b1e2277d6)) +* **cognitarium:** add store query ([66c4579](https://github.com/okp4/contracts/commit/66c4579404bdb8b269f203db329649ea0f1c48af)) +* **cognitarium:** build query plan from basic graph pattern ([0ef6f1f](https://github.com/okp4/contracts/commit/0ef6f1f73948c581a8479d26bf40824d733f2a03)) +* **cognitarium:** build query plan from where clause ([b57e3a0](https://github.com/okp4/contracts/commit/b57e3a01b024b8230ee6599fc68560c54a005701)) +* **cognitarium:** define query engine structure ([6a8d7b9](https://github.com/okp4/contracts/commit/6a8d7b94c74d17245a3de3c2f0acd26e6a44949f)) +* **cognitarium:** design insert execute message ([3994205](https://github.com/okp4/contracts/commit/39942050c1f07df9b59315c1882a4602e1b1b921)) +* **cognitarium:** design instantiate message ([1edacf6](https://github.com/okp4/contracts/commit/1edacf6748b2b1fd0a17e801e1336fd608f115ef)) +* **cognitarium:** design query select resources message ([3934ddf](https://github.com/okp4/contracts/commit/3934ddfa61a2d20ddd9f7a159eecd37def971c5b)) +* **cognitarium:** design remove execute message ([bb901da](https://github.com/okp4/contracts/commit/bb901dafda75dc1e88aa746c9d18c4117ff5208e)) +* **cognitarium:** design triples state ([a38aa79](https://github.com/okp4/contracts/commit/a38aa79752c4e1162eff5fd3a23c9c65c6612ced)) +* **cognitarium:** disallow select with no where clause ([bf89eaa](https://github.com/okp4/contracts/commit/bf89eaa1264253c171cdc805f750d6f3fea644a1)) +* **cognitarium:** handle engine limit query node ([9fa3b9d](https://github.com/okp4/contracts/commit/9fa3b9da23e8d4f5969a4052de4bb01d92b5c37b)) +* **cognitarium:** handle limit & skip at plan build ([a96258f](https://github.com/okp4/contracts/commit/a96258fa688d9b66a25895d31c9f700b2d6debd1)) +* **cognitarium:** handle query engine for loop join ([f9af316](https://github.com/okp4/contracts/commit/f9af31624f5cac5aa14956a29ed3896404cf1d27)) +* **cognitarium:** handle query engine skip node ([65e09ee](https://github.com/okp4/contracts/commit/65e09ee51c28585280db920aa5ac1c4f19e64d0f)) +* **cognitarium:** impl map query var to msg value ([bc8ed42](https://github.com/okp4/contracts/commit/bc8ed42bda4baa3aafd978c9c198c498b0bb1704)) +* **cognitarium:** implement base insert logic ([79dbc9b](https://github.com/okp4/contracts/commit/79dbc9bf7304f549e99bb92ebfff424d2e5087c9)) +* **cognitarium:** implement instantiate msg ([05e6319](https://github.com/okp4/contracts/commit/05e63191d85565faa1a56cb2f69eaf5300ecb6ef)) +* **cognitarium:** implement rdf parsing ([1f8c0d0](https://github.com/okp4/contracts/commit/1f8c0d085433648172e94056b4ab167ac1a722a1)) +* **cognitarium:** implement store configuration state ([8b4e10b](https://github.com/okp4/contracts/commit/8b4e10b423b64ffe24d2fc2456db85ccb3c6ea92)) +* **cognitarium:** implement store query msg ([4f0b8fb](https://github.com/okp4/contracts/commit/4f0b8fb567073b616ee301419d592b17cd48e25f)) +* **cognitarium:** implement triple mapping with rio api ([c13f530](https://github.com/okp4/contracts/commit/c13f530a7c0fcb22271748d4f018a0e71ac6832a)) +* **cognitarium:** implements building triple pattern query node ([7f32451](https://github.com/okp4/contracts/commit/7f32451ef530cb286b05d0ec80fe72b42f6ad597)) +* **cognitarium:** implements cosmwasm primary key serde for triple ([4f19584](https://github.com/okp4/contracts/commit/4f195846744a5c5a364a4d71d802721a9b2b2fd2)) +* **cognitarium:** implements query engine cartesian join ([112d07f](https://github.com/okp4/contracts/commit/112d07f1134d632aab38046152d9ed9849d506b9)) +* **cognitarium:** implements query engine main logic ([ee8254b](https://github.com/okp4/contracts/commit/ee8254b51e00611f4858f173a742582ac012f37e)) +* **cognitarium:** implements query resovled var mappings ([6d589c7](https://github.com/okp4/contracts/commit/6d589c771013147b81be5c578017f5ecfabc73cf)) +* **cognitarium:** implements select query ([bf8c45d](https://github.com/okp4/contracts/commit/bf8c45d46fcf4c821a1634e7164c07febf425088)) +* **cognitarium:** implements triple pattern iterator ([7c1c800](https://github.com/okp4/contracts/commit/7c1c800a3ab2e053eba80baad1d3dc6031661a71)) +* **cognitarium:** introduce query plan model ([3a074be](https://github.com/okp4/contracts/commit/3a074bee14163e8c7762ace7e687119025361246)) +* **cognitarium:** maintain namespace counter in state ([24e4c45](https://github.com/okp4/contracts/commit/24e4c450e56e05fea0fbca593ed4a41d3f084469)) +* **cognitarium:** make linter happy ([b07861a](https://github.com/okp4/contracts/commit/b07861a4e4f2f4700a4e6253ef6ca15922eb9bee)) +* **cognitarium:** manage insert error cases ([c10cf6a](https://github.com/okp4/contracts/commit/c10cf6af731e73f2967d1339bf5d4f1ed4f6cb32)) +* **cognitarium:** perform authorization before insert ([9c19cf3](https://github.com/okp4/contracts/commit/9c19cf38b6d89e03b280908cd5d549bf3b0b795e)) +* **cognitarium:** resolve query node bound variables ([dd6953f](https://github.com/okp4/contracts/commit/dd6953f593b3eace5511db573870c7f990afc202)) +* **cognitarium:** rework querying interface ([1213e38](https://github.com/okp4/contracts/commit/1213e38c9877d88210c795e24d3e12db022998a2)) +* **cognitarium:** rework triples primary key storage ([5409300](https://github.com/okp4/contracts/commit/5409300bcef438d5b9be0da7de62baead8ace99c)) +* **cognitarium:** separate iri namespaces from triples ([a5066ea](https://github.com/okp4/contracts/commit/a5066eaf6a5680a5b365a5bbd0671fde9dcc7050)) +* **cognitarium:** specifiy the sparql select query ([b4ed270](https://github.com/okp4/contracts/commit/b4ed270cc691b80c9310c09871eec5979d094b20)) +* **cognitarium:** specify Describe query ([158ed40](https://github.com/okp4/contracts/commit/158ed40ed2cd8290d46af45232fdbd103e009ba0)) +* **cognitarium:** specify max_byte_size limit ([62c2f81](https://github.com/okp4/contracts/commit/62c2f81fb690a2313d676862bb7fde5ffdd8a450)) +* **cognitarium:** specify max_insert_data_byte_size limit ([5c46dd8](https://github.com/okp4/contracts/commit/5c46dd803155991f54d28684692ab1e35d2ab0ca)) +* **cognitarium:** specify max_insert_data_triple_count limit ([47fd466](https://github.com/okp4/contracts/commit/47fd466446cb010b24a4b5c459d82b9f3fa422dd)) +* **cognitarium:** specify max_triple_byte_size limit ([a467889](https://github.com/okp4/contracts/commit/a467889caf988dcbcba160f494e3b18af501effc)) +* **cognitarium:** specify prefixes support for select query ([4568e49](https://github.com/okp4/contracts/commit/4568e49ef909b745dbaf2bcc70fe8608bffc75dc)) +* **cognitarium:** specify rdf triple deletion ([bc1e31e](https://github.com/okp4/contracts/commit/bc1e31e84433a9a7e32986210209d4e6543f6fae)) +* **cognitarium:** specify the max_query_variable_count limit ([2b0231d](https://github.com/okp4/contracts/commit/2b0231db4473df5aeddd9b5c45c55343d7d77999)) +* **cognitarium:** update query limit msg type ([eb3353b](https://github.com/okp4/contracts/commit/eb3353bde7f4251492ab09cd99c6934fc1ae1d75)) +* **coqgnitarium:** implement select at query engine level ([5a85ef3](https://github.com/okp4/contracts/commit/5a85ef36e9b789f5232c2f67dcf0402f790242ad)) +* **logic-bindings:** implements term value parser ([888eaf9](https://github.com/okp4/contracts/commit/888eaf94386f302f16acc1958d5d3b07adfec4a2)) +* **logic-bindings:** prune mocking elements ([49157aa](https://github.com/okp4/contracts/commit/49157aa11ecae992ceb26c4b3c79219f5a9b3a02)) +* **logic:** implements logic cosmwasm URI handling ([c539bf5](https://github.com/okp4/contracts/commit/c539bf5744eceb80eb773ac74d6b2900fb75afd6)) +* **objectarium:** add compression functions (partially) ([5ace7a3](https://github.com/okp4/contracts/commit/5ace7a393242f8dccc6332bca166b5c274d88cb6)) +* **objectarium:** implement compression of objects ([36c5068](https://github.com/okp4/contracts/commit/36c50685d7f6c6ea2cf1756c83dfc49681be771c)) +* **objectarium:** implement MD5 hash algorithm ([be4bb16](https://github.com/okp4/contracts/commit/be4bb16c313947962ed801d2861d2ac6d0b85776)) +* **objectarium:** implement SHA-224 hash algorithm ([3f8b938](https://github.com/okp4/contracts/commit/3f8b93839839355311900164324cbd628e82f3fb)) +* **objectarium:** implement SHA-384 hash algorithm ([36e5e05](https://github.com/okp4/contracts/commit/36e5e050c072535f1fa9ee3daaa3497ab2cc0bf5)) +* **objectarium:** implement SHA-512 hash algorithm ([550d87f](https://github.com/okp4/contracts/commit/550d87fd00c6f8bdbf9cc29dbbfb057d72c318b9)) +* **objectarium:** implement Snappy compression algorithm ([2958730](https://github.com/okp4/contracts/commit/29587308b8247d7128fa7d485395b4116938ec7d)) +* **objectarium:** specify compression support for objects ([d84cc5e](https://github.com/okp4/contracts/commit/d84cc5e885d1038c77c6a4f2e5b1059506fae928)) +* **objectarium:** update objectarium sample according to api change ([db61108](https://github.com/okp4/contracts/commit/db61108af2345b450730d9197c69855212f651d0)) +* **storage:** implements storage object logic fs URI ([42d709d](https://github.com/okp4/contracts/commit/42d709d5bda637cd5e61b87580b205f7ec66733e)) +* **storage:** map object ref to cw-storage msgs ([dfa6554](https://github.com/okp4/contracts/commit/dfa6554eb10a8944ca7b11c1fd180469da31e60c)) + + +### Bug Fixes + +* **cognitarium:** avoid opening triple iter with wrong variables type ([fbd8bc4](https://github.com/okp4/contracts/commit/fbd8bc4c9e6fbd2af3c05903ed5af81452e3dca3)) +* **cognitarium:** ensure data input property naming ([87e93d4](https://github.com/okp4/contracts/commit/87e93d4082b72d390fc5a67a208716dcc2cfb080)) +* **cognitarium:** extraction of prefix ([9393523](https://github.com/okp4/contracts/commit/9393523f82646d13654915f5cdcdf69f8a84c5a7)) +* **cognitarium:** handle urn in explode iri ([3837b8e](https://github.com/okp4/contracts/commit/3837b8e5f96d0366b0db0a059d1aad62df6a17b0)) +* **cognitarium:** make the query engine compile! ([23536ae](https://github.com/okp4/contracts/commit/23536ae3362eadaf4c79f4d42113957e416fd1fe)) +* **cognitarium:** manage default values for store limits ([148fdef](https://github.com/okp4/contracts/commit/148fdefd77fdd72164ff73ca79eca135f9774d89)) +* **cognitarium:** manage non implemented messages ([67fdc69](https://github.com/okp4/contracts/commit/67fdc690517a7cad7918df4cc70c7bb74f6d809e)) +* **cognitarium:** properly chose join type ([3ff77df](https://github.com/okp4/contracts/commit/3ff77df605e85f44fd0d7739ac22a503c93f01bd)) +* **cognitarium:** properly format output json keys ([c4de274](https://github.com/okp4/contracts/commit/c4de27469f013041ce451eecfef09c5c8f0b8da0)) +* **cognitarium:** return empty iter on not found triple iter load ([757177d](https://github.com/okp4/contracts/commit/757177d340e1748a6ac043376598e8e419e90acb)) +* **cognitarium:** use binary representation of triple pk parts ([30ae1f4](https://github.com/okp4/contracts/commit/30ae1f43704d1c68ffa25836898d4253e5ea6177)) +* **cognitarium:** use btree instead of hashmap for select results ([01a052d](https://github.com/okp4/contracts/commit/01a052d87090d9d4a3b91f285deb3c3207c9b42e)) +* **docs:** generate docs escaping invalid char ([1f9f717](https://github.com/okp4/contracts/commit/1f9f717bd60c4fa1b501afae4c8ced89490c7088)) +* **objectarium:** remove object data on forget_object ([7ee621d](https://github.com/okp4/contracts/commit/7ee621de8aee46251a9ed8e294da6ef4704708fa)) +* set correct contract name for contracts (based on crate name) ([f52db19](https://github.com/okp4/contracts/commit/f52db1948ecac9e8fa6da3a54ecd6bc312d6bfd7)) + ## 1.0.0 (2023-03-24) diff --git a/contracts/okp4-cognitarium/Cargo.toml b/contracts/okp4-cognitarium/Cargo.toml index f6de5967..b7574392 100644 --- a/contracts/okp4-cognitarium/Cargo.toml +++ b/contracts/okp4-cognitarium/Cargo.toml @@ -2,7 +2,7 @@ authors = ["OKP4"] edition = "2021" name = "okp4-cognitarium" -version = "1.0.0" +version = "2.0.0" exclude = [ # Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication. diff --git a/contracts/okp4-law-stone/Cargo.toml b/contracts/okp4-law-stone/Cargo.toml index 5e058d0a..3de0fe8c 100644 --- a/contracts/okp4-law-stone/Cargo.toml +++ b/contracts/okp4-law-stone/Cargo.toml @@ -2,7 +2,7 @@ authors = ["OKP4"] edition = "2021" name = "okp4-law-stone" -version = "1.0.0" +version = "2.0.0" exclude = [ # Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication. diff --git a/contracts/okp4-objectarium/Cargo.toml b/contracts/okp4-objectarium/Cargo.toml index 80a19159..f3c06088 100644 --- a/contracts/okp4-objectarium/Cargo.toml +++ b/contracts/okp4-objectarium/Cargo.toml @@ -2,7 +2,7 @@ authors = ["OKP4"] edition = "2021" name = "okp4-objectarium" -version = "1.0.0" +version = "2.0.0" exclude = [ # Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication. diff --git a/docs/schema/okp4-cognitarium.json b/docs/schema/okp4-cognitarium.json index cbc74cb0..7afa08c8 100644 --- a/docs/schema/okp4-cognitarium.json +++ b/docs/schema/okp4-cognitarium.json @@ -1 +1 @@ -{"contract_name":"okp4-cognitarium","contract_version":"1.0.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/VarOrNode"}]},"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},"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":"# Triplestore\n\n## Overview\n\nThe `okp4-cognitarium` smart contract enables the storage of RDF graphs triples (i.e. `subject`-`predicate`-`object`) in any [Cosmos blockchains](https://cosmos.network/) using the [CosmWasm](https://cosmwasm.com/) framework.","title":"okp4-cognitarium"} +{"contract_name":"okp4-cognitarium","contract_version":"2.0.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/VarOrNode"}]},"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},"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":"# Triplestore\n\n## Overview\n\nThe `okp4-cognitarium` smart contract enables the storage of RDF graphs triples (i.e. `subject`-`predicate`-`object`) in any [Cosmos blockchains](https://cosmos.network/) using the [CosmWasm](https://cosmwasm.com/) framework.","title":"okp4-cognitarium"} diff --git a/docs/schema/okp4-law-stone.json b/docs/schema/okp4-law-stone.json index 59fc1e64..85450db2 100644 --- a/docs/schema/okp4-law-stone.json +++ b/docs/schema/okp4-law-stone.json @@ -1 +1 @@ -{"contract_name":"okp4-law-stone","contract_version":"1.0.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"} +{"contract_name":"okp4-law-stone","contract_version":"2.0.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/docs/schema/okp4-objectarium.json b/docs/schema/okp4-objectarium.json index 2196d824..536f1295 100644 --- a/docs/schema/okp4-objectarium.json +++ b/docs/schema/okp4-objectarium.json @@ -1 +1 @@ -{"contract_name":"okp4-objectarium","contract_version":"1.0.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"],"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"],"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"]}]},"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"]}]}}},"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"],"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"]}]},"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"]}]},"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"]}]},"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"} +{"contract_name":"okp4-objectarium","contract_version":"2.0.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"],"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"],"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"]}]},"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"]}]}}},"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"],"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"]}]},"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"]}]},"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"]}]},"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/packages/okp4-logic-bindings/Cargo.toml b/packages/okp4-logic-bindings/Cargo.toml index 5d033923..7ee0e2d6 100644 --- a/packages/okp4-logic-bindings/Cargo.toml +++ b/packages/okp4-logic-bindings/Cargo.toml @@ -2,7 +2,7 @@ authors = ["OKP4"] edition = "2021" name = "okp4-logic-bindings" -version = "1.0.0" +version = "2.0.0" [dependencies] cosmwasm-std.workspace = true diff --git a/packages/okp4-objectarium-client/Cargo.toml b/packages/okp4-objectarium-client/Cargo.toml index e966e3f6..2ef8f04f 100644 --- a/packages/okp4-objectarium-client/Cargo.toml +++ b/packages/okp4-objectarium-client/Cargo.toml @@ -2,7 +2,7 @@ authors = ["OKP4"] edition = "2021" name = "okp4-objectarium-client" -version = "1.0.0" +version = "2.0.0" [dependencies] cosmwasm-std.workspace = true