syntax = "proto3";
package eu.ostrzyciel.jelly.core.proto.v1;

// Jelly gRPC streaming protocol.
// Specification document: https://w3id.org/jelly/1.0.0/specification/streaming
// Protocol version: 1.0.0

import "rdf.proto";

// Subscribe command sent by the client to the server.
message RdfStreamSubscribe {
  // The topic to which the client wants to subscribe (UTF-8 encoded).
  string topic = 1;
  // Optional: the stream options requested by the client.
  // The server should respond with a stream that matches these options.
  // In case that is not possible, the server must respond with the
  // INVALID_ARGUMENT error.
  RdfStreamOptions requested_options = 2;
}

// Acknowledgement of receiving a stream sent by the server to the client.
message RdfStreamReceived {
}

// Pub/Sub service for RDF streams, to be implemented by the server.
service RdfStreamService {
  // Subscribe to an RDF stream.
  rpc SubscribeRdf (RdfStreamSubscribe) returns (stream RdfStreamFrame);
  // Publish an RDF stream.
  // In case the server cannot process the stream, it must respond with
  // the INVALID_ARGUMENT error.
  rpc PublishRdf (stream RdfStreamFrame) returns (RdfStreamReceived);
}
