schema

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

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

Go to latest
Published: Nov 20, 2024 License: BSD-3-Clause Imports: 6 Imported by: 2

README

AXONE cognitarium schema

Generated go types for axone-cognitarium contract.

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

Installation

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

Cognitarium

A CosmWasm Smart Contract which enables the storage and querying of Semantic data using RDF (Resource Description Framework), which represents information as semantic triples.

Purpose

The Smart Contract operates as a semantic database, adept at storing and fetching RDF triples via semantic queries. It can be deployed on any blockchain within the Cosmos blockchains network, utilizing the CosmWasm framework.

The key features of the contract include:

Insertion of RDF Triples: This functionality enables the insertion of new data in the form of RDF triples onto the blockchain, ensuring secure and tamper-proof storage. The Smart Contract supports inserting these triples in various serialization formats including RDF/XML, Turtle, N-Triples and N-Quads.

Removal of RDF Triples: This functionality enables the selective deletion of RDF triples from the on-chain store. Users can specify patterns or criteria that identify the triples to be removed, ensuring precise and targeted removal of data.

Querying of RDF Triples: The Smart Contract provides powerful on-chain querying capabilities, allowing users to retrieve specific RDF triples stored on the blockchain. This is done using a variation of SPARQL, a specialized query language designed for retrieving and manipulating data stored in RDF format. Users can specify their search criteria in the query, and the Smart Contract will return the matching RDF triples, directly accessing the on-chain data. This feature supports various serialization formats for the output, such as Turtle, N-Triples, N-Quads, and RDF/XML, offering flexibility in how the retrieved data is presented and used.

Policies of the Store: The Smart Contract includes a straightforward yet effective policies functionality to manage the capacity and usage of the on-chain storage effectively. These policies ensure efficient operation and prevent misuse or overuse of the Smart Contract. For instance:

  • Maximum Triples: Caps the total number of RDF triples the store can hold, preventing database overload.
  • Storage Size Limit: Sets an upper bound on the store's data size in bytes, managing blockchain resource use.
  • Query Size Limit: Restricts the size or complexity of queries to maintain fast and reliable data retrieval.
  • Insert Data Limit: Limits the size of data (in bytes) that can be added in a single transaction, ensuring smooth and efficient data insertion.

Rationale

The data preserved in the blockchain holds significant value due to its derivation from a distributed consensus, rendering it a reliable source for decision-making, applicable to both on-chain and off-chain scenarios.

To effectively utilize this data, it's essential to adopt representation models that cater to diverse requirements. The Smart Contract Cognitarium provides such a model, facilitating the depiction of intricate and evolving semantic connections within a highly interconnected dataset. This approach transforms the data into a Knowledge Graph, enabling an accurate portrayal of existing facts and fostering the generation of new insights.

Play

Model your data with RDF

RDF encodes information in triple structures. The basic structure of an RDF triple is subject-predicate-object, much like a simple sentence in the English language.

  1. Subject: The subject is the entity or resource the statement is about. It's typically a URI (Uniform Resource Identifier) which uniquely identifies a resource.
  2. Predicate: The predicate (also called a property) is a specific aspect, characteristic, attribute, or relation that describes the subject. It's also typically a URI.
  3. Object: The object is the value of the attribute defined by the predicate for the subject. It can be a URI or a literal (such as a string or a number) and may also include additional information such as a language tag or a datatype.

In RDF, prefixes are used as a shorthand notation for long URIs to make the data more readable and less verbose. They're similar to namespaces in programming languages. For instance, instead of writing http://www.w3.org/2001/XMLSchema#integer, you could declare a prefix xsd to represent the http://www.w3.org/2001/XMLSchema# URI and then use xsd:integer.

Turtle (Terse RDF Triple Language) is a syntax that allows RDF to be completely written in a compact and natural text form, with abbreviations for common usage patterns and datatypes.

Here's an RDF triple written in Turtle format (.ttl file):

@prefix ex: <http://example.com/stuff/1.0/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:Alice ex:hasAge "30"^^xsd:integer .

In this example:

  • ex:Alice is the subject (using ex as a prefix for the http://example.com/stuff/1.0/ URI).
  • ex:hasAge is the predicate.
  • "30"^^xsd:integer is the object, a literal of datatype integer (using xsd as a prefix for the XML Schema Datatype namespace).

In the Turtle syntax, the semicolon (;) is used as a shorthand to reduce verbosity when multiple predicates and objects have the same subject. It allows you to write multiple predicates and objects for the same subject without having to repeat the subject. The comma (,) is used as a shorthand for reducing verbosity when the same subject and predicate have multiple objects.

Suppose we want to express that Alice is 30 years old person, and her email is alice@example.com:

@prefix ex: <http://example.com/stuff/1.0/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:Alice a <http://www.w3.org/2002/07/owl#Person> ;
         ex:hasAge "30"^^xsd:integer ;
         ex:hasEmail "alice@example.com" .

:::tip The lowercase "a" is a special abbreviation for the RDF type property, which states that a resource is an instance of a particular class. This is essentially equivalent to <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>, and it's used to indicate the type of a resource. :::

The same RDF triple can be expressed in RDF/XML format (.rdf.xml file):

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:ex="http://example.com/stuff/1.0/"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
  <rdf:Description rdf:about="http://example.com/stuff/1.0/Alice">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Person"/>
    <ex:hasAge rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">30</ex:hasAge>
    <ex:hasEmail>alice@example.com</ex:hasEmail>
  </rdf:Description>
</rdf:RDF>
Instantiate the Smart Contract

Let's initiate a new instance of Smart Contract and input some RDF triples into it. The axone-cognitarium can be set up in the following manner. Please consult the schema for additional details regarding configuration settings.

axoned tx wasm instantiate $CODE_ID \
    --from $ADDR \
    --label "my-rdf-storage" \
    --admin $ADMIN_ADDR \
    --gas 1000000 \
    '{}'

:::tip You can provide some limitation parameters to restrict usage for both execute and query messages. For instance, you can set a maximum number of triples that can be stored in the smart contract, or a maximum size of data that can be inserted in a single transaction.

The default values are:

{
  "limits": {
    "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"
  }
}

:::

Insert RDF triples

To insert RDF triples, you need to send an InsertData message through the cognitarium smart contract you've already instantiated. For this operation, your inputs should include the data of the triples, encoded in base64, as well as the format. The format options available are:

  • turtle (default)
  • rdf_xml
  • n_triples
  • n_quads

Let's consider the following example of data in Turtle format, contained within a file named data.ttl. It describes a small network of people and their relationships, such as name, title, and whom they know.

@prefix : <http://example.org/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix schema: <http://schema.org/> .

:alice a foaf:Person ;
  foaf:name "Alice" ;
  foaf:knows :bob ;
  schema:email "alice@example.org" .

:bob a foaf:Person ;
  foaf:name "Bob" ;
  foaf:knows :alice, :carol ;
  schema:jobTitle "Software Developer" .

:carol a foaf:Person ;
  foaf:name "Carol" ;
  schema:jobTitle "Data Scientist" ;
  foaf:knows :bob .

You can insert this data into the cognitarium smart contract with the following command:

axoned tx wasm execute $CONTRACT_ADDR \
    --from axone1cu9wzlcyyxpek20jaqfwzu3llzjgx34cqf94yj \
    --gas 10000000 \
    "{\"insert_data\":{\"format\": \"turtle\", \"data\": \"$(cat data.ttl | base64 | tr -d '\n\r')\"}}"

With the transaction hash we can query the number of triples inserted:

axoned query tx $TX_HASH -ojson |
    jq -r '.events[] | select(.type == "wasm") | .attributes[] | select(.key == "triple_count") | .value'
Query RDF triples

Now that we've populated the axone-cognitarium with several triples, let's explore how to retrieve this data. We can utilize the Select query message for this purpose. If you're familiar with SPARQL, you'll find the process quite intuitive.

A select query on a cognitarium instance enables you to fetch and filter the data. The select.query JSON should contain the following:

  • prefixes array: to declare a prefix and its related namespace
  • limit: the number of elements to return
  • where: filters and variable declarations
  • select array: all variable names you declared in where you want to get

where should be an array of elements specifying triple filterings. You have to specify subject, predicate and object as a variable, or, alternatively, a prefixed or full named_node.

object can also be a simple literal.

The following query will select all the triples subject, predicate and object from the store:

{
  "select": {
    "query": {
      "prefixes": [],
      "select": [
        {
          "variable": "subject"
        },
        {
          "variable": "predicate"
        },
        {
          "variable": "object"
        }
      ],
      "where": [
        {
          "simple": {
            "triple_pattern": {
              "subject": {
                "variable": "subject"
              },
              "predicate": {
                "variable": "predicate"
              },
              "object": {
                "variable": "object"
              }
            }
          }
        }
      ],
      "limit": null
    }
  }
}

It's semantically equivalent to the following SPARQL query:

SELECT ?subject ?predicate ?object
WHERE {
    ?subject ?predicate ?object
}

This query can be executed on the cognitarium smart contract using the command below:

axoned query wasm contract-state smart $CONTRACT_ADDR \
    '{"select":{"query":{"prefixes":[],"select":[{"variable":"subject"},{"variable":"predicate"},{"variable":"object"}],"where":[{"simple":{"triple_pattern":{"subject":{"variable":"subject"},"predicate":{"variable":"predicate"},"object":{"variable":"object"}}}}],"limit":null}}}'

Now, let's try something more interresting. Let's retrieve the names of people and their job titles, but only for those who know at least one other person in the network. This query introduces filtering based on relationships.

Here's the query:

{
  "select": {
    "query": {
      "prefixes": [
        { "foaf": "http://xmlns.com/foaf/0.1/" },
        { "schema": "http://schema.org/" }
      ],
      "select": [
        {
          "variable": "personName"
        },
        {
          "variable": "jobTitle"
        }
      ],
      "where": [
        {
          "simple": {
            "triple_pattern": {
              "subject": {
                "variable": "person"
              },
              "predicate": {
                "node": {
                  "named_node": {
                    "full": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
                  }
                }
              },
              "object": {
                "node": {
                  "named_node": {
                    "prefixed": "foaf:Person"
                  }
                }
              }
            }
          }
        },
        {
          "simple": {
            "triple_pattern": {
              "subject": {
                "variable": "person"
              },
              "predicate": {
                "node": {
                  "named_node": {
                    "prefixed": "foaf:Name"
                  }
                }
              },
              "object": {
                "variable": "personName"
              }
            }
          }
        },
        {
          "simple": {
            "triple_pattern": {
              "subject": {
                "variable": "person"
              },
              "predicate": {
                "node": {
                  "named_node": {
                    "prefixed": "schema:jobTitle"
                  }
                }
              },
              "object": {
                "variable": "jobTitle"
              }
            }
          }
        },
        {
          "simple": {
            "triple_pattern": {
              "subject": {
                "variable": "person"
              },
              "predicate": {
                "node": {
                  "named_node": {
                    "prefixed": "foaf:knows"
                  }
                }
              },
              "object": {
                "variable": "knownPerson"
              }
            }
          }
        }
      ],
      "limit": null
    }
  }
}

It's semantically equivalent to the following SPARQL query:

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX schema: <http://schema.org/>

SELECT ?personName ?jobTitle
WHERE {
  ?person a foaf:Person .
  ?person foaf:name ?personName .
  ?person schema:jobTitle ?jobTitle .
  ?person foaf:knows ?knownPerson .
}

This query can be executed on the cognitarium smart contract using the command below:

axoned query wasm contract-state smart $CONTRACT_ADDR \
    '{"select":{"query":{"prefixes":[{"foaf":"http://xmlns.com/foaf/0.1/"},{"schema":"http://schema.org/"}],"select":[{"variable":"personName"},{"variable":"jobTitle"}],"where":[{"simple":{"triple_pattern":{"subject":{"variable":"person"},"predicate":{"node":{"named_node":{"full":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"}}},"object":{"node":{"named_node":{"prefixed":"foaf:Person"}}}}}},{"simple":{"triple_pattern":{"subject":{"variable":"person"},"predicate":{"node":{"named_node":{"prefixed":"foaf:Name"}}},"object":{"variable":"personName"}}}},{"simple":{"triple_pattern":{"subject":{"variable":"person"},"predicate":{"node":{"named_node":{"prefixed":"schema:jobTitle"}}},"object":{"variable":"jobTitle"}}}},{"simple":{"triple_pattern":{"subject":{"variable":"person"},"predicate":{"node":{"named_node":{"prefixed":"foaf:knows"}}},"object":{"variable":"knownPerson"}}}}],"limit":null}}}'

InstantiateMsg

Instantiate message

parameter description
limits StoreLimitsInput. Limitations regarding store usage.
limits.max_byte_size Uint128. The maximum number of bytes the store can contain. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any. Default to [Uint128::MAX] if not set, which can be considered as no limit.
Default: "340282366920938463463374607431768211455"
limits.max_insert_data_byte_size Uint128. The maximum number of bytes an insert data query can contain. Default to [Uint128::MAX] if not set, which can be considered as no limit.
Default: "340282366920938463463374607431768211455"
limits.max_insert_data_triple_count Uint128. The maximum number of triples an insert data query can contain (after parsing). Default to [Uint128::MAX] if not set, which can be considered as no limit.
Default: "340282366920938463463374607431768211455"
limits.max_query_limit integer. 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
limits.max_query_variable_count integer. The maximum number of variables a query can select. Default to 30 if not set.
Default: 30
limits.max_triple_byte_size Uint128. The maximum number of bytes the store can contain for a single triple. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any. The limit is used to prevent storing very large triples, especially literals. Default to [Uint128::MAX] if not set, which can be considered as no limit.
Default: "340282366920938463463374607431768211455"
limits.max_triple_count Uint128. The maximum number of triples the store can contain. Default to [Uint128::MAX] if not set, which can be considered as no limit.
Default: "340282366920938463463374607431768211455"

ExecuteMsg

Execute messages

ExecuteMsg::InsertData

Insert the data as RDF triples in the store. For already existing triples it acts as no-op.

Only the smart contract owner (i.e. the address who instantiated it) is authorized to perform this action.

parameter description
insert_data _(Required.) _ object.
insert_data.data _(Required.) _ Binary. 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.
insert_data.format DataFormat|null. The data format in which the triples are serialized. If not provided, the default format is Turtle format.
ExecuteMsg::DeleteData

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.

Example: 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": { "namedNode": {"prefixed": "foaf:givenName"} }, "object": { "literal": { "simple": "Myrddin" } } } } }, { "simple": { "triplePattern": { "subject": { "variable": "s" }, "predicate": { "variable": "p" }, "object": { "variable": "o" } } } } ]

Only the smart contract owner (i.e. the address who instantiated it) is authorized to perform this action.

parameter description
delete_data _(Required.) _ object.
delete_data.delete _(Required.) _ Array<TripleDeleteTemplate>. Specifies the specific triple templates to delete. If nothing is provided and the where clause is a single Bgp, the patterns are used for deletion.
delete_data.prefixes _(Required.) _ Array<Prefix>. The prefixes used in the operation.
delete_data.where WhereClause|null. Defines the patterns that data (RDF triples) should match in order for it to be considered for deletion, if any.

QueryMsg

Query messages

QueryMsg::Store

Returns information about the triple store.

parameter description
store _(Required.) _ object.
QueryMsg::Select

Returns the resources matching the criteria defined by the provided query.

parameter description
select _(Required.) _ object.
select.query _(Required.) _ SelectQuery. The query to execute.
QueryMsg::Describe

Returns a description of the resource identified by the provided IRI as a set of RDF triples serialized in the provided format.

parameter description
describe _(Required.) _ object.
describe.format DataFormat|null. The format in which the triples are serialized. If not provided, the default format is Turtle format.
describe.query _(Required.) _ DescribeQuery. The query to execute.
QueryMsg::Construct

Returns the resources matching the criteria defined by the provided query as a set of RDF triples serialized in the provided format.

parameter description
construct _(Required.) _ object.
construct.format DataFormat|null. The format in which the triples are serialized. If not provided, the default format is Turtle format.
construct.query _(Required.) _ ConstructQuery. The query to execute.

Responses

construct

Represents the response of a [QueryMsg::Construct] query.

property description
data _(Required.) _ Binary. The data serialized in the specified format.
format _(Required.) _ DataFormat. The format of the data.
describe

Represents the response of a [QueryMsg::Describe] query.

property description
data _(Required.) _ Binary. The data serialized in the specified format.
format _(Required.) _ DataFormat. The format of the data.
select

Represents the response of a [QueryMsg::Select] query.

property description
head _(Required.) _ Head. The head of the response, i.e. the set of variables mentioned in the results.
head.vars Array<string>. The variables selected in the query.
results _(Required.) _ Results. The results of the select query.
results.bindings Array<object>. The bindings of the results.
store

Contains information related to triple store.

property description
limits _(Required.) _ StoreLimits. The store limits.
limits.max_byte_size Uint128. The maximum number of bytes the store can contain. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any.
limits.max_insert_data_byte_size Uint128. The maximum number of bytes an insert data query can contain.
limits.max_insert_data_triple_count Uint128. The maximum number of triples an insert data query can contain (after parsing).
limits.max_query_limit integer. The maximum limit of a query, i.e. the maximum number of triples returned by a select query.
limits.max_query_variable_count integer. The maximum number of variables a query can select.
limits.max_triple_byte_size Uint128. The maximum number of bytes the store can contain for a single triple. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any. The limit is used to prevent storing very large triples, especially literals.
limits.max_triple_count Uint128. The maximum number of triples the store can contain.
owner _(Required.) _ string. The store owner.
stat _(Required.) _ StoreStat. The store current usage.
stat.byte_size Uint128. The total triple size in the store, in bytes.
stat.namespace_count Uint128. The total number of IRI namespace present in the store.
stat.triple_count Uint128. The total number of triple present in the store.

Definitions

Bgp

Represents a basic graph pattern expressed as a set of triple patterns.

property description
bgp _(Required.) _ object.
bgp.patterns _(Required.) _ Array<TriplePattern>.
Binary

A string containing Base64-encoded data.

type
string.
BlankNode

An RDF blank node.

property description
blank_node _(Required.) _ string.
ConstructQuery

Represents a CONSTRUCT query over the triple store, allowing to retrieve a set of triples serialized in a specific format.

property description
construct _(Required.) _ Array<TripleConstructTemplate>. The triples to construct. If nothing is provided and the where clause is a single Bgp, the patterns are used for construction.
prefixes _(Required.) _ Array<Prefix>. The prefixes used in the query.
where _(Required.) _ WhereClause. The WHERE clause. This clause is used to specify the triples to construct using variable bindings.
DataFormat

Represents the format in which the data are serialized, for example when returned by a query or when inserted in the store.

variant description
RDF XML string: rdf_xml. Output in RDF/XML format.
Turtle string: turtle. Output in Turtle format.
N-Triples string: n_triples. Output in N-Triples format.
N-Quads string: n_quads. Output in N-Quads format.
DescribeQuery

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.

property description
prefixes _(Required.) _ Array<Prefix>. The prefixes used in the query.
resource _(Required.) _ VarOrNamedNode. The resource to describe given as a variable or a node.
where WhereClause|null. The WHERE clause. This clause is used to specify the resource identifier to describe using variable bindings.
Expression

Represents a logical combination of operations whose evaluation results in a term.

variant description
undefined object. A named node constant.
undefined object. A literal constant.
undefined object. A variable that must be bound for evaluation.
undefined object. Logical conjunction of expressions. All expressions must evaluate to true for the conjunction to be true. If the conjunction is empty, it is considered true.
undefined object. Logical disjunction of expressions. At least one expression must evaluate to true for the disjunction to be true. If the disjunction is empty, it is considered false.
undefined object. Equality comparison.
undefined object. Greater than comparison.
undefined object. Greater or equal comparison.
undefined object. Less than comparison.
undefined object. Less or equal comparison.
undefined object. Negation of an expression.
Filter

Filters the inner clause matching the expression. The solutions coming from the inner clause that do not match the expression are discarded. The variables provided in the inner clause are available in the filter expression.

property description
filter _(Required.) _ object.
filter.expr _(Required.) _ object|object|object|object|object|object|object|object|object|object|object.
filter.inner _(Required.) _ Bgp|LateralJoin|Filter.
Full

A full IRI.

property description
full _(Required.) _ string.
Head

Represents the head of a [SelectResponse].

property description
vars _(Required.) _ Array<string>. The variables selected in the query.
IRI

Represents an IRI.

variant description
Prefixed object. 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.
Full object. A full IRI.
LanguageTaggedString

A language-tagged string

property description
language_tagged_string _(Required.) _ object.
language_tagged_string.language _(Required.) _ string. The language tag.
language_tagged_string.value _(Required.) _ string. The lexical form.
LateralJoin

Evaluates right for all result row of left

property description
lateral_join _(Required.) _ object.
lateral_join.left _(Required.) _ Bgp|LateralJoin|Filter.
lateral_join.right _(Required.) _ Bgp|LateralJoin|Filter.
Literal

An RDF literal.

variant description
Simple object. A simple literal without datatype or language form.
LanguageTaggedString object. A language-tagged string
TypedValue object. A value with a datatype.
N-Quads

Output in N-Quads format.

literal
"n_quads"
N-Triples

Output in N-Triples format.

literal
"n_triples"
NamedNode

An RDF IRI.

property description
named_node _(Required.) _ Prefixed|Full.
Node

Represents either an IRI (named node) or a blank node.

variant description
NamedNode object. An RDF IRI.
BlankNode object. An RDF blank node.
Prefix

Represents a prefix, i.e. a shortcut for a namespace used in a query.

property description
namespace _(Required.) _ string. The namespace associated with the prefix.
prefix _(Required.) _ string. The prefix.
Prefixed

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.

property description
prefixed _(Required.) _ string.
RDF XML

Output in RDF/XML format.

literal
"rdf_xml"
Results

Represents the results of a [SelectResponse].

property description
bindings _(Required.) _ Array<object>. The bindings of the results.
SelectItem

Represents an item to select in a [SelectQuery].

variant description
Variable object. Represents a variable.
SelectQuery

Represents a SELECT query over the triple store, allowing to select variables to return and to filter the results.

property description
limit integer|null. 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.
prefixes _(Required.) _ Array<Prefix>. The prefixes used in the query.
select _(Required.) _ Array<SelectItem>. The items to select. Note: the number of items to select cannot exceed the maximum query variable count defined in the store limitations.
where _(Required.) _ WhereClause. The WHERE clause. If None, there is no WHERE clause, i.e. all triples are returned without filtering.
Simple

A simple literal without datatype or language form.

property description
simple _(Required.) _ string.
StoreLimits

Contains limitations regarding store usages.

property description
max_byte_size _(Required.) _ Uint128. The maximum number of bytes the store can contain. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any.
max_insert_data_byte_size _(Required.) _ Uint128. The maximum number of bytes an insert data query can contain.
max_insert_data_triple_count _(Required.) _ Uint128. The maximum number of triples an insert data query can contain (after parsing).
max_query_limit _(Required.) _ integer. The maximum limit of a query, i.e. the maximum number of triples returned by a select query.
max_query_variable_count _(Required.) _ integer. The maximum number of variables a query can select.
max_triple_byte_size _(Required.) _ Uint128. The maximum number of bytes the store can contain for a single triple. The size of a triple is counted as the sum of the size of its subject, predicate and object, including the size of data types and language tags if any. The limit is used to prevent storing very large triples, especially literals.
max_triple_count _(Required.) _ Uint128. The maximum number of triples the store can contain.
StoreLimitsInput

Contains requested limitations regarding store usages.

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

Contains usage information about the triple store.

property description
byte_size _(Required.) _ Uint128. The total triple size in the store, in bytes.
namespace_count _(Required.) _ Uint128. The total number of IRI namespace present in the store.
triple_count _(Required.) _ Uint128. The total number of triple present in the store.
TripleConstructTemplate

Represents a triple template to be forged for a construct query.

property description
object _(Required.) _ VarOrNodeOrLiteral. The object of the triple pattern.
predicate _(Required.) _ VarOrNamedNode. The predicate of the triple pattern.
subject _(Required.) _ VarOrNode. The subject of the triple pattern.
TripleDeleteTemplate

Represents a triple template to be deleted.

property description
object _(Required.) _ VarOrNamedNodeOrLiteral. The object of the triple pattern.
predicate _(Required.) _ VarOrNamedNode. The predicate of the triple pattern.
subject _(Required.) _ VarOrNamedNode. The subject of the triple pattern.
TriplePattern

Represents a triple pattern in a [SimpleWhereCondition].

property description
object _(Required.) _ VarOrNodeOrLiteral. The object of the triple pattern.
predicate _(Required.) _ VarOrNamedNode. The predicate of the triple pattern.
subject _(Required.) _ VarOrNode. The subject of the triple pattern.
Turtle

Output in Turtle format.

literal
"turtle"
TypedValue

A value with a datatype.

property description
typed_value _(Required.) _ object.
typed_value.datatype _(Required.) _ IRI. The datatype IRI.
typed_value.value _(Required.) _ string. The lexical form.
URI

Represents an IRI.

property description
type _(Required.) _ string.
value _(Required.) _ IRI. The value of the IRI.
Uint128

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

type
string.
Value
variant description
URI object. Represents an IRI.
Literal object. Represents a literal S with optional language tag L or datatype IRI D.
BlankNode object. Represents a blank node.
VarOrNamedNode

Represents either a variable or a named node (IRI).

variant description
Variable object. A variable.
NamedNode object. An RDF IRI.
VarOrNamedNodeOrLiteral

Represents either a variable, a named node or a literal.

variant description
Variable object. A variable.
NamedNode object. An RDF IRI.
Literal object. An RDF literal, i.e. a simple literal, a language-tagged string or a typed value.
VarOrNode

Represents either a variable or a node.

variant description
Variable object. A variable.
Node object. A node, i.e. an IRI or a blank node.
VarOrNodeOrLiteral

Represents either a variable, a node or a literal.

variant description
Variable object. A variable.
Node object. A node, i.e. an IRI or a blank node.
Literal object. An RDF literal, i.e. a simple literal, a language-tagged string or a typed value.
Variable

A variable.

property description
variable _(Required.) _ string.
WhereClause

Represents a WHERE clause, i.e. a set of conditions to filter the results.

variant description
Bgp object. Represents a basic graph pattern expressed as a set of triple patterns.
LateralJoin object. Evaluates right for all result row of left
Filter object. Filters the inner clause matching the expression. The solutions coming from the inner clause that do not match the expression are discarded. The variables provided in the inner clause are available in the filter expression.
undefined

A named node constant.

property description
named_node _(Required.) _ Prefixed|Full.

Rendered by Fadroma (@fadroma/schema 1.1.0) from axone-cognitarium.json (a6344c92b24801fb)

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binary

type Binary string

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

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

type BlankNode

type BlankNode struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

BlankNode represents the BlankNode variant of the enum.

type ConstructQuery

type ConstructQuery struct {
	// The triples to construct. If nothing is provided and the `where` clause is a single Bgp, the patterns are used for construction.
	Construct []TripleConstructTemplate `json:"construct"`
	// The prefixes used in the query.
	Prefixes []Prefix `json:"prefixes"`
	// The WHERE clause. This clause is used to specify the triples to construct using variable bindings.
	Where WhereClause `json:"where"`
}

Represents a CONSTRUCT query over the triple store, allowing to retrieve a set of triples serialized in a specific format.

type ConstructResponse

type ConstructResponse struct {
	// The data serialized in the specified format.
	Data Binary `json:"data"`
	// The format of the data.
	Format DataFormat `json:"format"`
}

Represents the response of a [QueryMsg::Construct] query.

type DataFormat

type DataFormat string

Represents the format in which the data are serialized, for example when returned by a query or when inserted in the store.

const (
	// Output in [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) format.
	DataFormat_RdfXml DataFormat = "rdf_xml"
	// Output in [Turtle](https://www.w3.org/TR/turtle/) format.
	DataFormat_Turtle DataFormat = "turtle"
	// Output in [N-Triples](https://www.w3.org/TR/n-triples/) format.
	DataFormat_NTriples DataFormat = "n_triples"
	// Output in [N-Quads](https://www.w3.org/TR/n-quads/) format.
	DataFormat_NQuads DataFormat = "n_quads"
)

type DescribeQuery

type DescribeQuery struct {
	// The WHERE clause. This clause is used to specify the resource identifier to describe using variable bindings.
	Where *WhereClause `json:"where,omitempty"`
	// The prefixes used in the query.
	Prefixes []Prefix `json:"prefixes"`
	// The resource to describe given as a variable or a node.
	Resource VarOrNamedNode `json:"resource"`
}

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 DescribeResponse

type DescribeResponse struct {
	// The data serialized in the specified format.
	Data Binary `json:"data"`
	// The format of the data.
	Format DataFormat `json:"format"`
}

Represents the response of a [QueryMsg::Describe] query.

type ExecuteMsg

type ExecuteMsg struct {
	/*
	   Insert the data as RDF triples in the store. For already existing triples it acts as no-op.

	   Only the smart contract owner (i.e. the address who instantiated it) is authorized to perform this action.
	*/
	InsertData *ExecuteMsg_InsertData `json:"insert_data,omitempty"`
	/*
	   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.

	   Example: “`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": { "namedNode": {"prefixed": "foaf:givenName"} }, "object": { "literal": { "simple": "Myrddin" } } } } }, { "simple": { "triplePattern": { "subject": { "variable": "s" }, "predicate": { "variable": "p" }, "object": { "variable": "o" } } } } ] “`

	   Only the smart contract owner (i.e. the address who instantiated it) is authorized to perform this action.
	*/
	DeleteData *ExecuteMsg_DeleteData `json:"delete_data,omitempty"`
}

Execute messages

type ExecuteMsg_DeleteData

type ExecuteMsg_DeleteData struct {
	// Specifies the specific triple templates to delete. If nothing is provided and the `where` clause is a single Bgp, the patterns are used for deletion.
	Delete []TripleDeleteTemplate `json:"delete"`
	// The prefixes used in the operation.
	Prefixes []Prefix `json:"prefixes"`
	// Defines the patterns that data (RDF triples) should match in order for it to be considered for deletion, if any.
	Where *WhereClause `json:"where,omitempty"`
}

type ExecuteMsg_InsertData

type ExecuteMsg_InsertData struct {
	// 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.
	Data Binary `json:"data"`
	// The data format in which the triples are serialized. If not provided, the default format is [Turtle](https://www.w3.org/TR/turtle/) format.
	Format *DataFormat `json:"format,omitempty"`
}

type Expression

type Expression struct {
	// A named node constant.
	NamedNode *Expression_NamedNode `json:"named_node,omitempty"`
	// A literal constant.
	Literal *Expression_Literal `json:"literal,omitempty"`
	// A variable that must be bound for evaluation.
	Variable *Expression_Variable `json:"variable,omitempty"`
	// Logical conjunction of expressions. All expressions must evaluate to true for the conjunction to be true. If the conjunction is empty, it is considered true.
	And *Expression_And `json:"and,omitempty"`
	// Logical disjunction of expressions. At least one expression must evaluate to true for the disjunction to be true. If the disjunction is empty, it is considered false.
	Or *Expression_Or `json:"or,omitempty"`
	// Equality comparison.
	Equal *Expression_Equal `json:"equal,omitempty"`
	// Greater than comparison.
	Greater *Expression_Greater `json:"greater,omitempty"`
	// Greater or equal comparison.
	GreaterOrEqual *Expression_GreaterOrEqual `json:"greater_or_equal,omitempty"`
	// Less than comparison.
	Less *Expression_Less `json:"less,omitempty"`
	// Less or equal comparison.
	LessOrEqual *Expression_LessOrEqual `json:"less_or_equal,omitempty"`
	// Negation of an expression.
	Not *Expression_Not `json:"not,omitempty"`
}

Represents a logical combination of operations whose evaluation results in a term.

type Expression_And

type Expression_And []Expression

type Expression_Literal

type Expression_Literal Literal

type Expression_NamedNode

type Expression_NamedNode IRI

type Expression_Not

type Expression_Not Expression

type Expression_Or

type Expression_Or []Expression

type Expression_Variable

type Expression_Variable string
type Head struct {
	// The variables selected in the query.
	Vars []string `json:"vars"`
}

Represents the head of a SelectResponse.

type IRI

type IRI struct {
	// 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`.
	Prefixed *IRI_Prefixed `json:"prefixed,omitempty"`
	// A full IRI.
	Full *IRI_Full `json:"full,omitempty"`
}

Represents an IRI.

type IRI_Full

type IRI_Full string

type IRI_Prefixed

type IRI_Prefixed string

type InstantiateMsg

type InstantiateMsg struct {
	// Limitations regarding store usage.
	Limits StoreLimitsInput `json:"limits"`
}

Instantiate message

type Literal

type Literal struct {
	// A [simple literal](https://www.w3.org/TR/rdf11-concepts/#dfn-simple-literal) without datatype or language form.
	Simple *Literal_Simple `json:"simple,omitempty"`
	// A [language-tagged string](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string)
	LanguageTaggedString *Literal_LanguageTaggedString `json:"language_tagged_string,omitempty"`
	// A value with a datatype.
	TypedValue *Literal_TypedValue `json:"typed_value,omitempty"`
}

An RDF [literal](https://www.w3.org/TR/rdf11-concepts/#dfn-literal).

type Literal_LanguageTaggedString

type Literal_LanguageTaggedString struct {
	// The [language tag](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tag).
	Language string `json:"language"`
	// The [lexical form](https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form).
	Value string `json:"value"`
}

type Literal_Simple

type Literal_Simple string

type Literal_TypedValue

type Literal_TypedValue struct {
	// The [datatype IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-datatype-iri).
	Datatype IRI `json:"datatype"`
	// The [lexical form](https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form).
	Value string `json:"value"`
}

type Node

type Node struct {
	// An RDF [IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-iri).
	NamedNode *Node_NamedNode `json:"named_node,omitempty"`
	// An RDF [blank node](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node).
	BlankNode *Node_BlankNode `json:"blank_node,omitempty"`
}

Represents either an IRI (named node) or a blank node.

type Node_BlankNode

type Node_BlankNode string

type Node_NamedNode

type Node_NamedNode IRI

type Nullable_IRI

type Nullable_IRI = *IRI

Nullable_IRI is a nullable type of IRI The datatype of the literal.

type Prefix

type Prefix struct {
	// The namespace associated with the prefix.
	Namespace string `json:"namespace"`
	// The prefix.
	Prefix string `json:"prefix"`
}

Represents a prefix, i.e. a shortcut for a namespace used in a query.

type QueryClient

type QueryClient interface {
	// Construct is the client API for the QueryMsg_Construct query message
	Construct(ctx context.Context, req *QueryMsg_Construct, opts ...grpc.CallOption) (*ConstructResponse, error)
	// Describe is the client API for the QueryMsg_Describe query message
	Describe(ctx context.Context, req *QueryMsg_Describe, opts ...grpc.CallOption) (*DescribeResponse, error)
	// Select is the client API for the QueryMsg_Select query message
	Select(ctx context.Context, req *QueryMsg_Select, opts ...grpc.CallOption) (*SelectResponse, error)
	// Store is the client API for the QueryMsg_Store query message
	Store(ctx context.Context, req *QueryMsg_Store, opts ...grpc.CallOption) (*StoreResponse, error)
}

QueryClient is the client API for Query service.

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

func NewQueryClient

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

NewQueryClient creates a new QueryClient

type QueryMsg

type QueryMsg struct {
	// Returns information about the triple store.
	Store *QueryMsg_Store `json:"store,omitempty"`
	// Returns the resources matching the criteria defined by the provided query.
	Select *QueryMsg_Select `json:"select,omitempty"`
	// Returns a description of the resource identified by the provided IRI as a set of RDF triples serialized in the provided format.
	Describe *QueryMsg_Describe `json:"describe,omitempty"`
	// Returns the resources matching the criteria defined by the provided query as a set of RDF triples serialized in the provided format.
	Construct *QueryMsg_Construct `json:"construct,omitempty"`
}

Query messages

type QueryMsg_Construct

type QueryMsg_Construct struct {
	// The format in which the triples are serialized. If not provided, the default format is [Turtle](https://www.w3.org/TR/turtle/) format.
	Format *DataFormat `json:"format,omitempty"`
	// The query to execute.
	Query ConstructQuery `json:"query"`
}

type QueryMsg_Describe

type QueryMsg_Describe struct {
	// The format in which the triples are serialized. If not provided, the default format is [Turtle](https://www.w3.org/TR/turtle/) format.
	Format *DataFormat `json:"format,omitempty"`
	// The query to execute.
	Query DescribeQuery `json:"query"`
}

type QueryMsg_Select

type QueryMsg_Select struct {
	// The query to execute.
	Query SelectQuery `json:"query"`
}

type QueryMsg_Store

type QueryMsg_Store struct{}

type Results

type Results struct {
	// The bindings of the results.
	Bindings []map[string]Value `json:"bindings"`
}

Represents the results of a SelectResponse.

type SelectItem

type SelectItem struct {
	// Represents a variable.
	Variable *SelectItem_Variable `json:"variable,omitempty"`
}

Represents an item to select in a SelectQuery.

type SelectItem_Variable

type SelectItem_Variable string

type SelectQuery

type SelectQuery struct {
	// 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.
	Limit *int `json:"limit,omitempty"`
	// The prefixes used in the query.
	Prefixes []Prefix `json:"prefixes"`
	// The items to select. Note: the number of items to select cannot exceed the maximum query variable count defined in the store limitations.
	Select []SelectItem `json:"select"`
	// The WHERE clause. If `None`, there is no WHERE clause, i.e. all triples are returned without filtering.
	Where WhereClause `json:"where"`
}

Represents a SELECT query over the triple store, allowing to select variables to return and to filter the results.

type SelectResponse

type SelectResponse struct {
	// The head of the response, i.e. the set of variables mentioned in the results.
	Head Head `json:"head"`
	// The results of the select query.
	Results Results `json:"results"`
}

Represents the response of a [QueryMsg::Select] query.

type StoreLimits

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

Contains limitations regarding store usages.

type StoreLimitsInput

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

Contains requested limitations regarding store usages.

type StoreResponse

type StoreResponse struct {
	// The store limits.
	Limits StoreLimits `json:"limits"`
	// The store owner.
	Owner string `json:"owner"`
	// The store current usage.
	Stat StoreStat `json:"stat"`
}

Contains information related to triple store.

type StoreStat

type StoreStat struct {
	// The total triple size in the store, in bytes.
	ByteSize Uint128 `json:"byte_size"`
	// The total number of IRI namespace present in the store.
	NamespaceCount Uint128 `json:"namespace_count"`
	// The total number of triple present in the store.
	TripleCount Uint128 `json:"triple_count"`
}

Contains usage information about the triple store.

type TripleConstructTemplate

type TripleConstructTemplate struct {
	// The object of the triple pattern.
	Object VarOrNodeOrLiteral `json:"object"`
	// The predicate of the triple pattern.
	Predicate VarOrNamedNode `json:"predicate"`
	// The subject of the triple pattern.
	Subject VarOrNode `json:"subject"`
}

Represents a triple template to be forged for a construct query.

type TripleDeleteTemplate

type TripleDeleteTemplate struct {
	// The object of the triple pattern.
	Object VarOrNamedNodeOrLiteral `json:"object"`
	// The predicate of the triple pattern.
	Predicate VarOrNamedNode `json:"predicate"`
	// The subject of the triple pattern.
	Subject VarOrNamedNode `json:"subject"`
}

Represents a triple template to be deleted.

type TriplePattern

type TriplePattern struct {
	// The object of the triple pattern.
	Object VarOrNodeOrLiteral `json:"object"`
	// The predicate of the triple pattern.
	Predicate VarOrNamedNode `json:"predicate"`
	// The subject of the triple pattern.
	Subject VarOrNode `json:"subject"`
}

Represents a triple pattern in a [SimpleWhereCondition].

type Tuple_of_Expression_and_Expression

type Tuple_of_Expression_and_Expression struct {
	F0 Expression
	F1 Expression
}

Tuple_of_Expression_and_Expression is a tuple with custom marshal and unmarshal methods

func (Tuple_of_Expression_and_Expression) MarshalJSON

func (t Tuple_of_Expression_and_Expression) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Tuple_of_Expression_and_Expression

func (*Tuple_of_Expression_and_Expression) UnmarshalJSON

func (t *Tuple_of_Expression_and_Expression) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Tuple_of_Expression_and_Expression

type URI

type URI struct {
	Type  string `json:"type"`
	Value IRI    `json:"value"`
}

URI represents the URI variant of the enum.

type Uint128

type Uint128 string

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

Examples

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

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

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

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

type Value

type Value struct {
	ValueType
}

Value is the interface for the enum.

func (Value) MarshalJSON

func (v Value) MarshalJSON() ([]byte, error)

MarshalJSON custom marshaler for the Value interface.

func (*Value) UnmarshalJSON

func (v *Value) UnmarshalJSON(data []byte) error

UnmarshalJSON custom unmarshaler for the Value interface.

type ValueType

type ValueType interface {
	// contains filtered or unexported methods
}

type Value_Literal

type Value_Literal struct {
	Type     string  `json:"type"`
	Value    string  `json:"value"`
	Lang     *string `json:"xml:lang,omitempty"`
	Datatype *IRI    `json:"datatype,omitempty"`
}

Literal represents the Literal variant of the enum.

type Value_Value

type Value_Value IRI

The value of the IRI.

type Value_Xmllang

type Value_Xmllang string

The language tag of the literal.

type VarOrNamedNode

type VarOrNamedNode struct {
	// A variable.
	Variable *VarOrNamedNode_Variable `json:"variable,omitempty"`
	// An RDF [IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-iri).
	NamedNode *VarOrNamedNode_NamedNode `json:"named_node,omitempty"`
}

Represents either a variable or a named node (IRI).

type VarOrNamedNodeOrLiteral

type VarOrNamedNodeOrLiteral struct {
	// A variable.
	Variable *VarOrNamedNodeOrLiteral_Variable `json:"variable,omitempty"`
	// An RDF [IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-iri).
	NamedNode *VarOrNamedNodeOrLiteral_NamedNode `json:"named_node,omitempty"`
	// 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.
	Literal *VarOrNamedNodeOrLiteral_Literal `json:"literal,omitempty"`
}

Represents either a variable, a named node or a literal.

type VarOrNamedNodeOrLiteral_Literal

type VarOrNamedNodeOrLiteral_Literal Literal

type VarOrNamedNodeOrLiteral_NamedNode

type VarOrNamedNodeOrLiteral_NamedNode IRI

type VarOrNamedNodeOrLiteral_Variable

type VarOrNamedNodeOrLiteral_Variable string

type VarOrNamedNode_NamedNode

type VarOrNamedNode_NamedNode IRI

type VarOrNamedNode_Variable

type VarOrNamedNode_Variable string

type VarOrNode

type VarOrNode struct {
	// A variable.
	Variable *VarOrNode_Variable `json:"variable,omitempty"`
	// A node, i.e. an IRI or a blank node.
	Node *VarOrNode_Node `json:"node,omitempty"`
}

Represents either a variable or a node.

type VarOrNodeOrLiteral

type VarOrNodeOrLiteral struct {
	// A variable.
	Variable *VarOrNodeOrLiteral_Variable `json:"variable,omitempty"`
	// A node, i.e. an IRI or a blank node.
	Node *VarOrNodeOrLiteral_Node `json:"node,omitempty"`
	// 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.
	Literal *VarOrNodeOrLiteral_Literal `json:"literal,omitempty"`
}

Represents either a variable, a node or a literal.

type VarOrNodeOrLiteral_Literal

type VarOrNodeOrLiteral_Literal Literal

type VarOrNodeOrLiteral_Node

type VarOrNodeOrLiteral_Node Node

type VarOrNodeOrLiteral_Variable

type VarOrNodeOrLiteral_Variable string

type VarOrNode_Node

type VarOrNode_Node Node

type VarOrNode_Variable

type VarOrNode_Variable string

type WhereClause

type WhereClause struct {
	// Represents a basic graph pattern expressed as a set of triple patterns.
	Bgp *WhereClause_Bgp `json:"bgp,omitempty"`
	// Evaluates right for all result row of left
	LateralJoin *WhereClause_LateralJoin `json:"lateral_join,omitempty"`
	// Filters the inner clause matching the expression. The solutions coming from the inner clause that do not match the expression are discarded. The variables provided in the inner clause are available in the filter expression.
	Filter *WhereClause_Filter `json:"filter,omitempty"`
}

Represents a WHERE clause, i.e. a set of conditions to filter the results.

type WhereClause_Bgp

type WhereClause_Bgp struct {
	Patterns []TriplePattern `json:"patterns"`
}

type WhereClause_Filter

type WhereClause_Filter struct {
	Expr  Expression  `json:"expr"`
	Inner WhereClause `json:"inner"`
}

type WhereClause_LateralJoin

type WhereClause_LateralJoin struct {
	Left  WhereClause `json:"left"`
	Right WhereClause `json:"right"`
}

Jump to

Keyboard shortcuts

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