diff --git a/contracts/okp4-cognitarium/src/msg.rs b/contracts/okp4-cognitarium/src/msg.rs index 510e9f2d..c28c677e 100644 --- a/contracts/okp4-cognitarium/src/msg.rs +++ b/contracts/okp4-cognitarium/src/msg.rs @@ -363,7 +363,7 @@ pub struct SelectQuery { /// If `None`, there is no limit. /// Note: the value of the limit cannot exceed the maximum query limit defined in the store /// limitations. - pub limit: Option, + pub limit: Option, } /// # DescribeQuery diff --git a/docs/okp4-cognitarium-querymsg-definitions-selectquery-properties-limit.md b/docs/okp4-cognitarium-querymsg-definitions-selectquery-properties-limit.md index f65ddf67..cfdbd050 100644 --- a/docs/okp4-cognitarium-querymsg-definitions-selectquery-properties-limit.md +++ b/docs/okp4-cognitarium-querymsg-definitions-selectquery-properties-limit.md @@ -18,4 +18,4 @@ The maximum number of results to return. If `None`, there is no limit. Note: the **minimum**: the value of this number must greater than or equal to: `0` -**unknown format**: the value of this string must follow the format: `uint64` +**unknown format**: the value of this string must follow the format: `uint32` diff --git a/docs/okp4-cognitarium-querymsg-definitions-selectquery.md b/docs/okp4-cognitarium-querymsg-definitions-selectquery.md index 95f679d4..9a8e333c 100644 --- a/docs/okp4-cognitarium-querymsg-definitions-selectquery.md +++ b/docs/okp4-cognitarium-querymsg-definitions-selectquery.md @@ -45,7 +45,7 @@ The maximum number of results to return. If `None`, there is no limit. Note: the **minimum**: the value of this number must greater than or equal to: `0` -**unknown format**: the value of this string must follow the format: `uint64` +**unknown format**: the value of this string must follow the format: `uint32` ## prefixes diff --git a/docs/okp4-cognitarium-querymsg.md b/docs/okp4-cognitarium-querymsg.md index bff1d864..9e492b17 100644 --- a/docs/okp4-cognitarium-querymsg.md +++ b/docs/okp4-cognitarium-querymsg.md @@ -237,7 +237,7 @@ The maximum number of results to return. If `None`, there is no limit. Note: the **minimum**: the value of this number must greater than or equal to: `0` -**unknown format**: the value of this string must follow the format: `uint64` +**unknown format**: the value of this string must follow the format: `uint32` ### prefixes diff --git a/docs/schema/okp4-cognitarium.json b/docs/schema/okp4-cognitarium.json index 943a35f2..b0ebc10c 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","required":["limits"],"properties":{"limits":{"description":"Limitations regarding store usage.","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. If `None`, the default value of [Uint128::MAX] is used, which can be considered as no limit.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_insert_data_byte_size":{"description":"The maximum number of bytes an insert data query can contains. If `None`, the default value of [Uint128::MAX] is used, which can be considered as no limit.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_insert_data_triple_count":{"description":"The maximum number of triples an insert data query can contains (after parsing). If `None`, the default value of [Uint128::MAX] is used, which can be considered as no limit.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_query_limit":{"description":"The maximum limit of a query, i.e. the maximum number of triples returned by a select query. If `None`, the default value of 30 is used.","type":["integer","null"],"format":"uint32","minimum":0},"max_query_variable_count":{"description":"The maximum number of variables a query can select. If `None`, the default value of 30 is used.","type":["integer","null"],"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. If `None`, the default value of [Uint128::MAX] is used, which can be considered as no limit.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_triple_count":{"description":"The maximum number of triples the store can contains. If `None`, the default value of [Uint128::MAX] is used, which can be considered as no limit.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"},{"type":"null"}]}},"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":"uint64","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":["u_r_i"]},"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":"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":["limits"],"properties":{"limits":{"description":"Limitations regarding store usage.","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. If `None`, the default value of [Uint128::MAX] is used, which can be considered as no limit.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_insert_data_byte_size":{"description":"The maximum number of bytes an insert data query can contains. If `None`, the default value of [Uint128::MAX] is used, which can be considered as no limit.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_insert_data_triple_count":{"description":"The maximum number of triples an insert data query can contains (after parsing). If `None`, the default value of [Uint128::MAX] is used, which can be considered as no limit.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_query_limit":{"description":"The maximum limit of a query, i.e. the maximum number of triples returned by a select query. If `None`, the default value of 30 is used.","type":["integer","null"],"format":"uint32","minimum":0},"max_query_variable_count":{"description":"The maximum number of variables a query can select. If `None`, the default value of 30 is used.","type":["integer","null"],"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. If `None`, the default value of [Uint128::MAX] is used, which can be considered as no limit.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"},{"type":"null"}]},"max_triple_count":{"description":"The maximum number of triples the store can contains. If `None`, the default value of [Uint128::MAX] is used, which can be considered as no limit.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"},{"type":"null"}]}},"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":["u_r_i"]},"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"}