Validate a Contract template in RDF 1.1 Turtle format, producing any errors as a gRPC status.
rpc ValidateTemplate
ValidateTemplate
asset_controller_api.v1.ValidateTemplate
asset_controller_api.v1.ValidateTemplate
Validate a Contract template in RDF 1.1 Turtle format, producing any errors as a gRPC status.
requests ValidateTemplateRequest
ValidateTemplateRequest
asset_controller.ValidateTemplateRequest
asset_controller.ValidateTemplateRequest
Field | Type | Description |
---|---|---|
ttl | string | Contract details in RDF 1.1 Turtle format |
resp, _ := assetcontroller.ValidateTemplate(ctx, &v1.ValidateTemplateRequest{
Ttl: "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>",
})
fmt.Println(resp)
const validatetemplaterequest = new ValidateTemplateRequest();
validatetemplaterequest.setTtl("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>");
service.validateTemplate(validatetemplaterequest, (err, value:ValidateTemplateResponse|null) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
using System;
using Grpc.Core;
using AssetControllerApi.V1;
namespace main
{
class Program
{
static void Main(string[] args)
{
Channel channel = new Channel("wallet.YOUR_SANDBOX_ID.knoxnetworks.io:443", ChannelCredentials.Insecure);
var client = new AssetController.AssetControllerClient(channel);
var headers = new Metadata();
var validateTemplateRequest = new ValidateTemplateRequest{
Ttl = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>",
};
var reply = client.ValidateTemplate(validateTemplateRequest, headers);
Console.WriteLine("Response: " + reply);
channel.ShutdownAsync().Wait();
}
}
}
package demo;
import io.grpc.Channel;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import asset_controller_api.v1.AssetController.ValidateTemplateRequest;
import asset_controller_api.v1.AssetController.ValidateTemplateResponse;
import wallet_api.v1.CustodialWalletGrpc;
public class App {
public static void main(String[] args) {
ManagedChannel channel = ManagedChannelBuilder
.forAddress("wallet.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build();
CustodialWalletGrpc.CustodialWalletBlockingStub blockStub =
CustodialWalletGrpc.newBlockingStub(channel);
ValidateTemplateRequest req_ValidateTemplateRequest =
ValidateTemplateRequest.newBuilder()
.setTtl("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>")
.build();
ValidateTemplateResponse resp = blockStub.validateTemplate(req_ValidateTemplateRequest);
System.out.println(resp);
channel.shutdown();
}
}
const validatetemplaterequest = new ValidateTemplateRequest();
validatetemplaterequest.setTtl("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>");
service.validateTemplate(validatetemplaterequest, (err, value:ValidateTemplateResponse|null) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
extern crate grpc-sdks;
use tonic::transport::Channel;
use grpc-sdks::wallet_api::v1::wallet_service_client::CustodialWalletClient;
use grpc-sdks::asset_controller_api::v1::ValidateTemplateRequest;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let channel = Channel::from_static("wallet.YOUR_SANDBOX_ID.knoxnetworks.io")
.connect()
.await?;
let mut client = CustodialWalletClient::new(channel);
let request = tonic::Request::new(
ValidateTemplateRequest{
ttl: String::from("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>"),
});
// sending request and waiting for response
let response = client.validate_template(request).await?.into_inner();
println!("RESPONSE={:?}", response);
Ok(())
}
package app
import io.grpc.ManagedChannelBuilder
import asset_controller_api.v1.AssetController.ValidateTemplateRequest
import asset_controller_api.v1.AssetController.ValidateTemplateResponse
import wallet_api.v1.CustodialWalletGrpc
fun main() {
val channel = ManagedChannelBuilder
.forAddress("wallet.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build()
var blockStub = CustodialWalletGrpc.newBlockingStub(channel)
val req_ValidateTemplateRequest = ValidateTemplateRequest.newBuilder()
.setTtl("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema# ...>")
.build()
val resp = blockStub.validateTemplate(req_ValidateTemplateRequest)
println(resp)
channel.shutdown()
}
returns ValidateTemplateResponse
ValidateTemplateResponse
asset_controller.ValidateTemplateResponse
asset_controller.ValidateTemplateResponse
Field | Type | Description |
---|---|---|
nq | string | Canonical NQuads response |
{
"nq": "NQ"
}