EURODEO / e-soh-datastore-poc

E-SOH datastore PoCs
0 stars 0 forks source link

Support links attribute in GetTSAttrGroups method #72

Open jo-asplin-met-no opened 12 months ago

jo-asplin-met-no commented 12 months ago

The links attribute is currently not supported:

// ### for now don't support the 'links' attribute
// TODO: support this!
delete(attr2col, "Links")
delete(col2attr, "links")

The reason is twofold:

  1. In datastore.proto, the attribute is represented as an array to an object instead of a string like the other attributes:
message Link {
  string href = 1;
  string rel = 2;
  string type = 3;
  string hreflang = 4;
  string title = 5;
}

message TSMetadata {
  string version = 1;
  string type = 2;
...
  repeated Link links = 23;
}
  1. In ts-init.sql, the attribute is represented as parallel arrays, which differs from how it is represented in datastore.proto:
CREATE TABLE time_series (
...
    link_href TEXT[],
    link_rel TEXT[],
    link_type TEXT[],
    link_hreflang TEXT[],
    link_title TEXT[],
...
);

We should provide support for the links attribute in a way that minimizes the need for special code (that explicitly refers to the name "links" etc.).