<commit_before>syntax = "proto3";

option java_package = "ai.grakn.rpc.proto";
option java_outer_classname = "SessionProto";

import "Concept.proto";
import "Answer.proto";

package session;

service SessionService {
    // Represents a full transaction. The stream of `Transaction.Req`s must begin with a `Open` message.
    // When the call is completed, the transaction will always be closed, with or without a `Commit` message.
    rpc transaction (stream Transaction.Req) returns (stream Transaction.Res);
}

message Transaction {
    message Req {
        oneof req {
            Open.Req open_req = 1;
            Commit.Req commit_req = 2;
            Query.Req query_req = 3;
            Iter.Req iterate_req = 4;
            GetSchemaConcept.Req getSchemaConcept_req = 5;
            GetConcept.Req getConcept_req = 6;
            GetAttributes.Req getAttributes_req = 7;
            PutEntityType.Req putEntityType_req = 8;
            PutAttributeType.Req putAttributeType_req = 9;
            PutRelationType.Req putRelationType_req = 10;
            PutRole.Req putRole_req = 11;
            PutRule.Req putRule_req = 12;
            ConceptMethod.Req conceptMethod_req = 13;
        }
    }
    message Res {
        oneof res {
            Open.Res open_res = 1;
            Commit.Res commit_res = 2;
            Query.Iter query_iter = 3;
            Iter.Res iterate_res = 4;
            GetSchemaConcept.Res getSchemaConcept_res = 5;
            GetConcept.Res getConcept_res = 6;
            GetAttributes.Iter getAttributes_iter = 7;
            PutEntityType.Res putEntityType_res = 8;
            PutAttributeType.Res putAttributeType_res = 9;
            PutRelationType.Res putRelationType_res = 10;
            PutRole.Res putRole_res = 11;
            PutRule.Res putRule_res = 12;
            ConceptMethod.Res conceptMethod_res = 13;
        }
    }

    message Iter {
        message Req {
            int32 id = 1;
        }
        message Res {
            oneof res {
                bool done = 1;
                Query.Iter.Res query_iter_res = 2;
                GetAttributes.Iter.Res getAttributes_iter_res = 3;
                Method.Iter.Res conceptMethod_iter_res = 4;
            }
        }
    }<commit_msg>Add metadata map field to gRPC protocols<commit_after>syntax = "proto3";

option java_package = "ai.grakn.rpc.proto";
option java_outer_classname = "SessionProto";

import "Concept.proto";
import "Answer.proto";

package session;

service SessionService {
    // Represents a full transaction. The stream of `Transaction.Req`s must begin with a `Open` message.
    // When the call is completed, the transaction will always be closed, with or without a `Commit` message.
    rpc transaction (stream Transaction.Req) returns (stream Transaction.Res);
}

message Transaction {
    message Req {
        map<string, string> metadata = 1000;
        oneof req {
            Open.Req open_req = 1;
            Commit.Req commit_req = 2;
            Query.Req query_req = 3;
            Iter.Req iterate_req = 4;
            GetSchemaConcept.Req getSchemaConcept_req = 5;
            GetConcept.Req getConcept_req = 6;
            GetAttributes.Req getAttributes_req = 7;
            PutEntityType.Req putEntityType_req = 8;
            PutAttributeType.Req putAttributeType_req = 9;
            PutRelationType.Req putRelationType_req = 10;
            PutRole.Req putRole_req = 11;
            PutRule.Req putRule_req = 12;
            ConceptMethod.Req conceptMethod_req = 13;
        }
    }
    message Res {
        map<string, string> metadata = 1000;
        oneof res {
            Open.Res open_res = 1;
            Commit.Res commit_res = 2;
            Query.Iter query_iter = 3;
            Iter.Res iterate_res = 4;
            GetSchemaConcept.Res getSchemaConcept_res = 5;
            GetConcept.Res getConcept_res = 6;
            GetAttributes.Iter getAttributes_iter = 7;
            PutEntityType.Res putEntityType_res = 8;
            PutAttributeType.Res putAttributeType_res = 9;
            PutRelationType.Res putRelationType_res = 10;
            PutRole.Res putRole_res = 11;
            PutRule.Res putRule_res = 12;
            ConceptMethod.Res conceptMethod_res = 13;
        }
    }

    message Iter {
        message Req {
            int32 id = 1;
        }
        message Res {
            oneof res {
                bool done = 1;
                Query.Iter.Res query_iter_res = 2;
                GetAttributes.Iter.Res getAttributes_iter_res = 3;
                Method.Iter.Res conceptMethod_iter_res = 4;
            }
        }
    }
{'fraction_non_alphanumeric': 0.07264864864864864, 'fraction_numerical': 0.019891891891891892, 'mean_word_length': 1.8894440974391005, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5545512', 'n_tokens_mistral': 1405, 'n_tokens_neox': 1298, 'n_words': 344}