diff --git a/docs/README.md b/docs/README.md index 3bdac38f..2d7bfbce 100644 --- a/docs/README.md +++ b/docs/README.md @@ -66,6 +66,8 @@ * [NamedNode](./okp4-cognitarium-querymsg-definitions-node-oneof-namednode.md "An RDF IRI") – `undefined#/query/definitions/Node/oneOf/0` +* [NamedNode](./okp4-cognitarium-querymsg-definitions-varornamednode--oneof-namednode.md "An RDF IRI") – `undefined#/query/definitions/VarOrNamedNode/oneOf/1` + * [Node](./okp4-cognitarium-executemsg-definitions-varornode-oneof-node.md "A node, i") – `undefined#/execute/definitions/VarOrNode/oneOf/1` * [Node](./okp4-cognitarium-executemsg-definitions-varornodeorliteral-oneof-node.md "A node, i") – `undefined#/execute/definitions/VarOrNodeOrLiteral/oneOf/1` @@ -214,6 +216,8 @@ * [Variable](./okp4-cognitarium-querymsg-definitions-selectitem-oneof-variable.md "Represents a variable") – `undefined#/query/definitions/SelectItem/oneOf/0` +* [Variable](./okp4-cognitarium-querymsg-definitions-varornamednode--oneof-variable.md "A variable") – `undefined#/query/definitions/VarOrNamedNode/oneOf/0` + * [Variable](./okp4-cognitarium-querymsg-definitions-varornode-oneof-variable.md "A variable") – `undefined#/query/definitions/VarOrNode/oneOf/0` * [Variable](./okp4-cognitarium-querymsg-definitions-varornodeorliteral-oneof-variable.md "A variable") – `undefined#/query/definitions/VarOrNodeOrLiteral/oneOf/0` diff --git a/docs/okp4-cognitarium-querymsg-definitions-varornamednode--oneof-namednode-properties-named_node.md b/docs/okp4-cognitarium-querymsg-definitions-varornamednode--oneof-namednode-properties-named_node.md new file mode 100644 index 00000000..3602df4b --- /dev/null +++ b/docs/okp4-cognitarium-querymsg-definitions-varornamednode--oneof-namednode-properties-named_node.md @@ -0,0 +1,15 @@ +# Untitled undefined type in okp4-cognitarium Schema + +```txt +undefined#/query/definitions/VarOrNamedNode/oneOf/1/properties/named_node +``` + + + +| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In | +| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :----------------------------------------------------------------------------- | +| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [okp4-cognitarium.json\*](schema/okp4-cognitarium.json "open original schema") | + +## named\_node Type + +unknown diff --git a/docs/okp4-cognitarium-querymsg-definitions-varornamednode--oneof-namednode.md b/docs/okp4-cognitarium-querymsg-definitions-varornamednode--oneof-namednode.md new file mode 100644 index 00000000..9ddfac67 --- /dev/null +++ b/docs/okp4-cognitarium-querymsg-definitions-varornamednode--oneof-namednode.md @@ -0,0 +1,39 @@ +# NamedNode Schema + +```txt +undefined#/query/definitions/VarOrNamedNode/oneOf/1 +``` + +An RDF [IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-iri). + +| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In | +| :------------------ | :--------- | :------------- | :----------- | :---------------- | :-------------------- | :------------------ | :----------------------------------------------------------------------------- | +| Can be instantiated | No | Unknown status | No | Forbidden | Forbidden | none | [okp4-cognitarium.json\*](schema/okp4-cognitarium.json "open original schema") | + +## 1 Type + +`object` ([NamedNode](okp4-cognitarium-querymsg-definitions-varornamednode--oneof-namednode.md)) + +# 1 Properties + +| Property | Type | Required | Nullable | Defined by | +| :------------------------- | :------------ | :------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [named\_node](#named_node) | Not specified | Required | cannot be null | [okp4-cognitarium](okp4-cognitarium-querymsg-definitions-varornamednode--oneof-namednode-properties-named_node.md "undefined#/query/definitions/VarOrNamedNode/oneOf/1/properties/named_node") | + +## named\_node + + + +`named_node` + +* is required + +* Type: unknown + +* cannot be null + +* defined in: [okp4-cognitarium](okp4-cognitarium-querymsg-definitions-varornamednode--oneof-namednode-properties-named_node.md "undefined#/query/definitions/VarOrNamedNode/oneOf/1/properties/named_node") + +### named\_node Type + +unknown diff --git a/docs/okp4-cognitarium-querymsg-definitions-varornamednode--oneof-variable-properties-variable.md b/docs/okp4-cognitarium-querymsg-definitions-varornamednode--oneof-variable-properties-variable.md new file mode 100644 index 00000000..fd3f2c1b --- /dev/null +++ b/docs/okp4-cognitarium-querymsg-definitions-varornamednode--oneof-variable-properties-variable.md @@ -0,0 +1,15 @@ +# Untitled string in okp4-cognitarium Schema + +```txt +undefined#/query/definitions/VarOrNamedNode/oneOf/0/properties/variable +``` + + + +| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In | +| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :----------------------------------------------------------------------------- | +| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [okp4-cognitarium.json\*](schema/okp4-cognitarium.json "open original schema") | + +## variable Type + +`string` diff --git a/docs/okp4-cognitarium-querymsg-definitions-varornamednode--oneof-variable.md b/docs/okp4-cognitarium-querymsg-definitions-varornamednode--oneof-variable.md new file mode 100644 index 00000000..b0d9cfba --- /dev/null +++ b/docs/okp4-cognitarium-querymsg-definitions-varornamednode--oneof-variable.md @@ -0,0 +1,39 @@ +# Variable Schema + +```txt +undefined#/query/definitions/VarOrNamedNode/oneOf/0 +``` + +A variable. + +| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In | +| :------------------ | :--------- | :------------- | :----------- | :---------------- | :-------------------- | :------------------ | :----------------------------------------------------------------------------- | +| Can be instantiated | No | Unknown status | No | Forbidden | Forbidden | none | [okp4-cognitarium.json\*](schema/okp4-cognitarium.json "open original schema") | + +## 0 Type + +`object` ([Variable](okp4-cognitarium-querymsg-definitions-varornamednode--oneof-variable.md)) + +# 0 Properties + +| Property | Type | Required | Nullable | Defined by | +| :-------------------- | :------- | :------- | :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [variable](#variable) | `string` | Required | cannot be null | [okp4-cognitarium](okp4-cognitarium-querymsg-definitions-varornamednode--oneof-variable-properties-variable.md "undefined#/query/definitions/VarOrNamedNode/oneOf/0/properties/variable") | + +## variable + + + +`variable` + +* is required + +* Type: `string` + +* cannot be null + +* defined in: [okp4-cognitarium](okp4-cognitarium-querymsg-definitions-varornamednode--oneof-variable-properties-variable.md "undefined#/query/definitions/VarOrNamedNode/oneOf/0/properties/variable") + +### variable Type + +`string` diff --git a/docs/okp4-cognitarium-querymsg-definitions-varornamednode-.md b/docs/okp4-cognitarium-querymsg-definitions-varornamednode-.md new file mode 100644 index 00000000..00fa39b6 --- /dev/null +++ b/docs/okp4-cognitarium-querymsg-definitions-varornamednode-.md @@ -0,0 +1,21 @@ +# VarOrNamedNode { Schema + +```txt +undefined#/query/definitions/VarOrNamedNode +``` + +Represents either a variable or a named node (IRI). + +| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In | +| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :----------------------------------------------------------------------------- | +| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [okp4-cognitarium.json\*](schema/okp4-cognitarium.json "open original schema") | + +## VarOrNamedNode Type + +merged type ([VarOrNamedNode {](okp4-cognitarium-querymsg-definitions-varornamednode-.md)) + +one (and only one) of + +* [Variable](okp4-cognitarium-querymsg-definitions-varornamednode--oneof-variable.md "check type definition") + +* [NamedNode](okp4-cognitarium-querymsg-definitions-varornamednode--oneof-namednode.md "check type definition") diff --git a/docs/okp4-cognitarium-querymsg.md b/docs/okp4-cognitarium-querymsg.md index 9e492b17..e8699b9f 100644 --- a/docs/okp4-cognitarium-querymsg.md +++ b/docs/okp4-cognitarium-querymsg.md @@ -384,6 +384,17 @@ all of * [Untitled undefined type in okp4-cognitarium](okp4-cognitarium-querymsg-definitions-triplepattern-properties-subject-allof-0.md "check type definition") +## Definitions group VarOrNamedNode + +Reference this group by using + +```json +{"$ref":"undefined#/query/definitions/VarOrNamedNode"} +``` + +| Property | Type | Required | Nullable | Defined by | +| :------- | :--- | :------- | :------- | :--------- | + ## Definitions group VarOrNode Reference this group by using diff --git a/docs/schema/okp4-cognitarium.json b/docs/schema/okp4-cognitarium.json index 7afa08c8..882a97d6 100644 --- a/docs/schema/okp4-cognitarium.json +++ b/docs/schema/okp4-cognitarium.json @@ -1 +1 @@ -{"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"} +{"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/VarOrNamedNode"}]},"where":{"description":"The WHERE clause. This clause is used to specify the resource identifier to describe using variable bindings.","type":"array","items":{"$ref":"./okp4-cognitarium.json/#/definitions/WhereCondition"}}},"additionalProperties":false},"IRI":{"title":"IRI","description":"Represents an IRI.","oneOf":[{"title":"Prefixed","description":"An IRI prefixed with a prefix. The prefixed IRI is expanded to a full IRI using the prefix definition specified in the query. For example, the prefixed IRI `rdf:type` is expanded to `http://www.w3.org/1999/02/22-rdf-syntax-ns#type`.","type":"object","required":["prefixed"],"properties":{"prefixed":{"type":"string"}},"additionalProperties":false},{"title":"Full","description":"A full IRI.","type":"object","required":["full"],"properties":{"full":{"type":"string"}},"additionalProperties":false}]},"Literal":{"title":"Literal","description":"An RDF [literal](https://www.w3.org/TR/rdf11-concepts/#dfn-literal).","oneOf":[{"title":"Simple","description":"A [simple literal](https://www.w3.org/TR/rdf11-concepts/#dfn-simple-literal) without datatype or language form.","type":"object","required":["simple"],"properties":{"simple":{"type":"string"}},"additionalProperties":false},{"title":"LanguageTaggedString","description":"A [language-tagged string](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string)","type":"object","required":["language_tagged_string"],"properties":{"language_tagged_string":{"type":"object","required":["language","value"],"properties":{"language":{"description":"The [language tag](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tag).","type":"string"},"value":{"description":"The [lexical form](https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form).","type":"string"}},"additionalProperties":false}},"additionalProperties":false},{"title":"TypedValue","description":"A value with a datatype.","type":"object","required":["typed_value"],"properties":{"typed_value":{"type":"object","required":["datatype","value"],"properties":{"datatype":{"description":"The [datatype IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-datatype-iri).","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/IRI"}]},"value":{"description":"The [lexical form](https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form).","type":"string"}},"additionalProperties":false}},"additionalProperties":false}]},"Node":{"title":"Node","description":"Represents either an IRI (named node) or a blank node.","oneOf":[{"title":"NamedNode","description":"An RDF [IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-iri).","type":"object","required":["named_node"],"properties":{"named_node":{"$ref":"./okp4-cognitarium.json/#/definitions/IRI"}},"additionalProperties":false},{"title":"BlankNode","description":"An RDF [blank node](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node).","type":"object","required":["blank_node"],"properties":{"blank_node":{"type":"string"}},"additionalProperties":false}]},"Prefix":{"title":"Prefix","description":"Represents a prefix in a [SelectQuery]. A prefix is a shortcut for a namespace used in the query.","type":"object","required":["namespace","prefix"],"properties":{"namespace":{"description":"The namespace associated with the prefix.","type":"string"},"prefix":{"description":"The prefix.","type":"string"}},"additionalProperties":false},"SelectItem":{"title":"SelectItem","description":"Represents an item to select in a [SelectQuery].","oneOf":[{"title":"Variable","description":"Represents a variable.","type":"object","required":["variable"],"properties":{"variable":{"type":"string"}},"additionalProperties":false}]},"SelectQuery":{"title":"SelectQuery","description":"Represents a SELECT query over the triple store, allowing to select variables to return and to filter the results.","type":"object","required":["prefixes","select","where"],"properties":{"limit":{"description":"The maximum number of results to return. If `None`, there is no limit. Note: the value of the limit cannot exceed the maximum query limit defined in the store limitations.","type":["integer","null"],"format":"uint32","minimum":0},"prefixes":{"description":"The prefixes used in the query.","type":"array","items":{"$ref":"./okp4-cognitarium.json/#/definitions/Prefix"}},"select":{"description":"The items to select. Note: the number of items to select cannot exceed the maximum query variable count defined in the store limitations.","type":"array","items":{"$ref":"./okp4-cognitarium.json/#/definitions/SelectItem"}},"where":{"description":"The WHERE clause. If `None`, there is no WHERE clause, i.e. all triples are returned without filtering.","type":"array","items":{"$ref":"./okp4-cognitarium.json/#/definitions/WhereCondition"}}},"additionalProperties":false},"SimpleWhereCondition":{"title":"SimpleWhereCondition","description":"Represents a simple condition in a [WhereCondition].","oneOf":[{"title":"TriplePattern","description":"Represents a triple pattern, i.e. a condition on a triple based on its subject, predicate and object.","type":"object","required":["triple_pattern"],"properties":{"triple_pattern":{"$ref":"./okp4-cognitarium.json/#/definitions/TriplePattern"}},"additionalProperties":false}]},"TriplePattern":{"title":"TriplePattern","description":"Represents a triple pattern in a [SimpleWhereCondition].","type":"object","required":["object","predicate","subject"],"properties":{"object":{"description":"The object of the triple pattern.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/VarOrNodeOrLiteral"}]},"predicate":{"description":"The predicate of the triple pattern.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/VarOrNode"}]},"subject":{"description":"The subject of the triple pattern.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/VarOrNode"}]}},"additionalProperties":false},"VarOrNamedNode":{"title":"VarOrNamedNode {","description":"Represents either a variable or a named node (IRI).","oneOf":[{"title":"Variable","description":"A variable.","type":"object","required":["variable"],"properties":{"variable":{"type":"string"}},"additionalProperties":false},{"title":"NamedNode","description":"An RDF [IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-iri).","type":"object","required":["named_node"],"properties":{"named_node":{"$ref":"./okp4-cognitarium.json/#/definitions/IRI"}},"additionalProperties":false}]},"VarOrNode":{"title":"VarOrNode","description":"Represents either a variable or a node.","oneOf":[{"title":"Variable","description":"A variable.","type":"object","required":["variable"],"properties":{"variable":{"type":"string"}},"additionalProperties":false},{"title":"Node","description":"A node, i.e. an IRI or a blank node.","type":"object","required":["node"],"properties":{"node":{"$ref":"./okp4-cognitarium.json/#/definitions/Node"}},"additionalProperties":false}]},"VarOrNodeOrLiteral":{"title":"VarOrNodeOrLiteral","description":"Represents either a variable, a node or a literal.","oneOf":[{"title":"Variable","description":"A variable.","type":"object","required":["variable"],"properties":{"variable":{"type":"string"}},"additionalProperties":false},{"title":"Node","description":"A node, i.e. an IRI or a blank node.","type":"object","required":["node"],"properties":{"node":{"$ref":"./okp4-cognitarium.json/#/definitions/Node"}},"additionalProperties":false},{"title":"Literal","description":"An RDF [literal](https://www.w3.org/TR/rdf11-concepts/#dfn-literal), i.e. a simple literal, a language-tagged string or a typed value.","type":"object","required":["literal"],"properties":{"literal":{"$ref":"./okp4-cognitarium.json/#/definitions/Literal"}},"additionalProperties":false}]},"WhereCondition":{"title":"WhereCondition","description":"Represents a condition in a [WhereClause].","oneOf":[{"title":"Simple","description":"Represents a simple condition.","type":"object","required":["simple"],"properties":{"simple":{"$ref":"./okp4-cognitarium.json/#/definitions/SimpleWhereCondition"}},"additionalProperties":false}]}}},"migrate":null,"sudo":null,"responses":{"describe":{"$schema":"http://json-schema.org/draft-07/schema#","title":"DescribeResponse","description":"Represents the response of a [QueryMsg::Describe] query.","type":"object","required":["data","format"],"properties":{"data":{"description":"The data serialized in the specified format.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Binary"}]},"format":{"description":"The format of the data.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/DataFormat"}]}},"additionalProperties":false,"definitions":{"Binary":{"description":"Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .","type":"string"},"DataFormat":{"title":"DataFormat","description":"Represents the format in which the data are serialized, for example when returned by a query or when inserted in the store.","oneOf":[{"title":"RDF XML","description":"Output in [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) format.","type":"string","enum":["rdf_xml"]},{"title":"Turtle","description":"Output in [Turtle](https://www.w3.org/TR/turtle/) format.","type":"string","enum":["turtle"]},{"title":"N-Triples","description":"Output in [N-Triples](https://www.w3.org/TR/n-triples/) format.","type":"string","enum":["n_triples"]},{"title":"N-Quads","description":"Output in [N-Quads](https://www.w3.org/TR/n-quads/) format.","type":"string","enum":["n_quads"]}]}}},"select":{"$schema":"http://json-schema.org/draft-07/schema#","title":"SelectResponse","description":"Represents the response of a [QueryMsg::Select] query.","type":"object","required":["head","results"],"properties":{"head":{"description":"The head of the response, i.e. the set of variables mentioned in the results.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Head"}]},"results":{"description":"The results of the select query.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Results"}]}},"additionalProperties":false,"definitions":{"Head":{"title":"Head","description":"Represents the head of a [SelectResponse].","type":"object","required":["vars"],"properties":{"vars":{"description":"The variables selected in the query.","type":"array","items":{"type":"string"}}},"additionalProperties":false},"IRI":{"title":"IRI","description":"Represents an IRI.","oneOf":[{"title":"Prefixed","description":"An IRI prefixed with a prefix. The prefixed IRI is expanded to a full IRI using the prefix definition specified in the query. For example, the prefixed IRI `rdf:type` is expanded to `http://www.w3.org/1999/02/22-rdf-syntax-ns#type`.","type":"object","required":["prefixed"],"properties":{"prefixed":{"type":"string"}},"additionalProperties":false},{"title":"Full","description":"A full IRI.","type":"object","required":["full"],"properties":{"full":{"type":"string"}},"additionalProperties":false}]},"Results":{"title":"Results","description":"Represents the results of a [SelectResponse].","type":"object","required":["bindings"],"properties":{"bindings":{"description":"The bindings of the results.","type":"array","items":{"type":"object","additionalProperties":{"$ref":"./okp4-cognitarium.json/#/definitions/Value"}}}},"additionalProperties":false},"Value":{"title":"Value","oneOf":[{"title":"URI","description":"Represents an IRI.","type":"object","required":["type","value"],"properties":{"type":{"type":"string","enum":["uri"]},"value":{"description":"The value of the IRI.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/IRI"}]}},"additionalProperties":false},{"title":"Literal","description":"Represents a literal S with optional language tag L or datatype IRI D.","type":"object","required":["type","value"],"properties":{"datatype":{"description":"The datatype of the literal.","anyOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/IRI"},{"type":"null"}]},"type":{"type":"string","enum":["literal"]},"value":{"description":"The value of the literal.","type":"string"},"xml:lang":{"description":"The language tag of the literal.","type":["string","null"]}},"additionalProperties":false},{"title":"BlankNode","description":"Represents a blank node.","type":"object","required":["type","value"],"properties":{"type":{"type":"string","enum":["blank_node"]},"value":{"description":"The identifier of the blank node.","type":"string"}},"additionalProperties":false}]}}},"store":{"$schema":"http://json-schema.org/draft-07/schema#","title":"StoreResponse","description":"Contains information related to triple store.","type":"object","required":["limits","owner","stat"],"properties":{"limits":{"description":"The store limits.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/StoreLimits"}]},"owner":{"description":"The store owner.","type":"string"},"stat":{"description":"The store current usage.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/StoreStat"}]}},"additionalProperties":false,"definitions":{"StoreLimits":{"title":"StoreLimits","description":"Contains limitations regarding store usages.","type":"object","required":["max_byte_size","max_insert_data_byte_size","max_insert_data_triple_count","max_query_limit","max_query_variable_count","max_triple_byte_size","max_triple_count"],"properties":{"max_byte_size":{"description":"The maximum number of bytes the store can contains. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"max_insert_data_byte_size":{"description":"The maximum number of bytes an insert data query can contains.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"max_insert_data_triple_count":{"description":"The maximum number of triples an insert data query can contains (after parsing).","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"max_query_limit":{"description":"The maximum limit of a query, i.e. the maximum number of triples returned by a select query.","type":"integer","format":"uint32","minimum":0},"max_query_variable_count":{"description":"The maximum number of variables a query can select.","type":"integer","format":"uint32","minimum":0},"max_triple_byte_size":{"description":"The maximum number of bytes the store can contains for a single triple. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any. The limit is used to prevent storing very large triples, especially literals.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"max_triple_count":{"description":"The maximum number of triples the store can contains.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]}},"additionalProperties":false},"StoreStat":{"title":"StoreStat","description":"Contains usage information about the triple store.","type":"object","required":["byte_size","namespace_count","triple_count"],"properties":{"byte_size":{"description":"The total triple size in the store, in bytes.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"namespace_count":{"description":"The total number of IRI namespace present in the store.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]},"triple_count":{"description":"The total number of triple present in the store.","allOf":[{"$ref":"./okp4-cognitarium.json/#/definitions/Uint128"}]}},"additionalProperties":false},"Uint128":{"description":"A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```","type":"string"}}}},"description":"# 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"}