SOS icon indicating copy to clipboard operation
SOS copied to clipboard

Add support for encoding using Google Protobuf

Open nuest opened this issue 9 years ago • 4 comments

extending on the experiments with EXI #189 - what about supporting Google Protobuf as an encoding? It promises to be even faster, but afaics it will be a bit more complicated to implement:

https://developers.google.com/protocol-buffers/

nuest avatar Apr 14 '15 14:04 nuest

You'll laugh, but I've actually started an implementation some time ago.

If somebody wants to do this I could provide my proto files as a starting point...

autermann avatar Apr 14 '15 14:04 autermann

I'd never laugh about that - I wish I'd be so deep into the SOS code I could just start something like that.

Maybe you can put the proto files in a branch an link to it here? Then we can wait and see if this issue gains more traction...

nuest avatar Apr 15 '15 05:04 nuest

I wish I'd be so deep into the SOS code I could just start something like that.

You don't have to dig deep into the SOS code. First you'll have to rewrite the existing OGC schemas to proto files which is quite some work. One could look into solutions to automate this (like https://github.com/tranchis/xsd2thrift), but somehow I'm not convinced this will work for the OGC schemas and it's substitution groups, etc.

Regarding the branch. What I have is far from being worth a branch:

option java_outer_classname = "SosServiceProto";
option java_package = "org.n52.sos.protobuf";

message Observation {

}

message SpatialFilter {

}

enum TemporalOperator {
    BEFORE = 1;
    AFTER = 2;
    BEGINS = 3;
    BEGUNBY = 4;
    CONTAINS = 5;
    DURING = 6;
    ENDEDBY = 7;
    ENDS = 8;
    EQUALS = 9;
    MEETS = 10;
    METBY = 11;
    OVERLAPPED = 12;
    OVERLAPS = 13;
}

message TemporalFilter {
    required string field = 1;
    required TemporalOperator operator = 2;
    required TimePrimitive time = 3;
}

message TimePrimitive {
    oneof Type {
        TimePeriod period = 1;
        TimeInstant instant = 2;
    };
}

message TimeInstant {
    oneof Time {
        string dateTime = 1;
        string indeterminateTime = 2;
    }
}

message SosContents {
    repeated SosObservationOffering observation_offering;
}

message OwsOperationsMetadata {
    repeated OwsParameter parameter = 1;
    repeated OwsOperation operation = 2;
}

message OwsOperation {
    required OwsDCP dcp = 1;
    repeated OwsParameter parameter = 2;
}

message OwsParameter {
    required string name = 1;
    oneof ParameterRestriction {
        OwsAnyValue any_value = 2;
        OwsAllowedValues allowed_values = 3;
    }
}

message OwsAnyValue {

}

message OwsAllowedValues {
    repeated string value = 1;
}

message OwsDCP {
    required OwsHTTP http = 1;
}

message OwsHTTP {
    oneof HttpMethod {
        OwsGET get = 1;
        OwsPOST post = 2;
    }
}

message OwsGET {
    required string href = 1;
}

message OwsPOST {
    required string href = 1;
}

message OwsServiceIdentification {
    optional string title = 1;
    optional string abstract = 2;
    optional string serviceType = 3;
    optional string serviceTypeVersion = 4;
    repeated string profile = 5;
    optional string fees = 6;
    optional string accessConstraints = 7;
}

message OwsServiceProvider {
    optional string providerName = 1;
    optional string providerSite = 2;
    optional string individualName = 3;
    optional string OwsServiceContact serviceContact = 4;
}

message OwsAddress {
    optional string deliveryPoint = 1;
    optional string city = 2;
    optional string administrativeArea = 3;
    optional string postalCode = 4;
    optional string country = 5;
    optional string electronicMailAddress = 6;
}

message OwsServiceContact {
    optional string voice = 1;
    optional string facsimile = 2;
    optional OwsAddress address = 3;
}

message SosObservationOffering {
    required string identifier = 1;
    optional string name = 2;
    required string procedure = 3;
    repeated string procedureDescriptionFormat = 4;
    repeated string observableProperty = 5;
    repeated string responseFormat = 6;
    repeated string observationType = 7;
}

message TimePeriod {
    required TimeInstant begin = 1;
    required TimeInstant end = 2;
}

message GetObservationRequest {
    repeated string procedure = 1;
    repeated string observable_property = 2;
    repeated string feature_of_interest = 3;
    repeated string offering = 4;

    optional TemporalFilter temporal_filter = 5;
    optional SpatialFilter spatial_filter = 6;
}

message GetObservationResponse {
    repeated Observation observation = 1;
}

message GetCapabilitiesRequest {
    repeated string section;
}
message GetCapabilitiesResponse {
    optional OwsServiceIdentification service_identification;
    optional OwsServiceProvider service_provider;
    optional OwsOperationsMetadata operations_metadata;
    optional SosContents;
}

message DescribeSensorRequest {

}

message DescribeSensorResponse {

}

message GetFeatureOfInterestRequest {

}

message GetFeatureOfInterestResponse {

}

message GetResultRequest {

}

message GetResultResponse {

}

message GetObservationByIdRequest {

}

message GetObservationByIdResponse {

}

message DeleteSensorRequest {

}

message DeleteSensorResponse {

}

message InsertObservationRequest {

}

message InsertObservationResponse {

}

message InsertResultTemplateRequest {

}

message InsertResultTemplateResponse {

}

message InsertSensorRequest {

}

message InsertSensorResponse {

}

message UpdateSensorDescriptionRequest {

}

message UpdateSensorDescriptionResponse {

}

service SOS {
    rpc GetObservation (GetObservationRequest) returns (GetObservationResponse);
    rpc GetCapabilities (GetCapabilitiesRequest) returns (GetCapabilitiesResponse);
    rpc DescribeSensor (DescribeSensorRequest) returns (DescribeSensorResponse);


    rpc GetFeatureOfInterest (GetFeatureOfInterestRequest) returns (GetFeatureOfInterestResponse);
    rpc GetObservation (GetObservationByIdRequest) returns (GetObservationByIdResponse);


    rpc GetResult (GetResultRequest) returns (GetResultResponse);
    rpc InsertResultTemplate (InsertResultTemplateRequest) returns (InsertResultTemplateResponse);


    rpc InsertObservation (InsertObservationRequest) returns (InsertObservationResponse);
    rpc InsertSensor (InsertSensorRequest) returns (InsertSensorResponse);
    rpc DeleteSensor (DeleteSensorRequest) returns (DeleteSensorResponse);
    rpc UpdateSensorDescription (UpdateSensorDescriptionRequest) returns (UpdateSensorDescriptionResponse);
}

autermann avatar Apr 15 '15 07:04 autermann

Ok - looks like GSoC 2016, or an external semester project, or if a detailed evaluation of the alternative data formats with respect to the performance is conducted, a thesis project.

nuest avatar Apr 15 '15 10:04 nuest