biothings / biothings_explorer

TRAPI service for BioThings Explorer
https://explorer.biothings.io
Apache License 2.0
10 stars 11 forks source link

display list of APIs and/or metaKG on home page #687

Open andrewsu opened 1 year ago

andrewsu commented 1 year ago

Users may be interested in what resources BTE is able to access. We should have some view of the API list and/or the metaKG on the web front end of BTE. This would be useful for both our hosted instances (e.g., bte.transltr.io) and a user's local instance.

I imagine the solution here could be based on what @marcodarko is developing in https://github.com/SmartAPI/smartAPI/pull/194, but probably something simpler than what I was envisioning in https://github.com/biothings/biothings_explorer/issues/633. So basically something in between in terms of complexity and functionality.

newgene commented 1 month ago

BTE currently provides /v1/meta_knowledge_graph endpoint (like this example) to return both the nodes and edges info required by the TRAPI specification.

We can add an additional field called apis to the same endpoint to cover the underlying API information corresponding to the current BTE instance. The data structure can look like this:

# /v1/meta_knowledge_graph
   - nodes:
      ...
   - edges:
      ...
   - apis:
     - api:
          id: 
          name:
        metakg: 
          no_node_types
          no_edge_types
          edges
             subject:
             object:
             predicate:
     - ...

For now we can keep this additional apis field returned as default (TRAPI specs allows additional fields other than the required nodes and edges), but if the content becomes too verbose, we can introduce an optional query parameter like apis=true/false to toggle inclusion/exclusion of this field.