ranking-agent / kp-registry

Knowledge Provider Registry
0 stars 0 forks source link

Possible restructuring of search endpoint #6

Open alongreyber opened 3 years ago

alongreyber commented 3 years ago

The search method is a bit un-intuitive for the access pattern that we have. This is a possible way we could re-structure to improve.

Current Structure

{ "source" : ["ChemicalSubstance", "Metabolite"],
  "target" : ["Gene"] }

Returns:

{"simple_kp" : {"url" : "http://simple-kp", "operations" : [{
      "source" : "ChemicalSubstance",
      "target" : "Gene"
    },
    {
      "source" : "Metabolite",
      "target" : "Gene"
    }
 ]}}

Proposed Structure

[
{
  "source" : "ChemicalSubstance",
  "target" : "Gene"
},
{
  "source" : "Metabolite",
  "target" : "Gene"
}
]

Returns:

[
 [{"name" : "simple_kp", "url" : "http://simple-kp"}],
 [{"name" : "simple_kp", "url" : "http://simple-kp"}]
]