bmeg / grip

Graph Integration Platform
https://bmeg.github.io/grip
MIT License
24 stars 8 forks source link

Feature/fhir json schema + Remove Elasticsearch support from Grip #318

Open matthewpeterkort opened 1 month ago

matthewpeterkort commented 1 month ago

This PR does a few things:

Add support for storing jsonschema as a grip graph grip schema post --graphName CALIPER --jsonSchema test.json

The protobuf for this is defined as:

  rpc AddJsonSchema(RawJson) returns (EditResult) {
    option (google.api.http) = {
        post: "/v1/graph/{graph}/jsonschema"
        body: "*"
    };
  }

Add support for loading FHIR json directly into grip via new proto method: grip caliperload schema-test/Observation.ndjson CALIPER test-data2

message RawJson {
  string graph = 1;
  string project_id = 2;
  google.protobuf.Struct data = 3;
}

  rpc BulkAddRaw (stream RawJson) returns (BulkJsonEditResult) {
    option (google.api.http) = {
      post: "/v1/rawJson"
    };
  }

Note also BulkJsonEditResult is also added, adding support for returning messages back to the client so that an HTTP code can be generated from the error messages or the lack of error messages.

message BulkJsonEditResult{
    int32 insert_count = 1;
    repeated string errors = 2;
}

Reorganize schema files into schema dir. Those files were previously in gripql directory.

Also removes all instances of elasticSearch from Grip. This include the website too.

Add support for graphql schema generation as a grip graph from jsonschema with grip schema graphql --graphName CALIPER --jsonSchema test.json

where graphName is the name of the graph that you want to create a schema for and --jsonSchema is the jsonschema file that you want to use. ex: https://raw.githubusercontent.com/bmeg/iceberg/refs/heads/feature/FHIR-resource-type/schemas/graph/graph-fhir.json

This is more of an experimental feature that has no direct application at the moment but could be built out in the grip-graphql plugin side to be made useful.