Giter Club home page Giter Club logo

kg_api's Introduction

Implementation of graph based API to expose knowledge graphs.

How to use the API as it is now:

  1. In terminal, navigate to the home of this repository and enter:

python3 -m uvicorn main:app --reload

  1. When you run this a URL will be provided, copy and paste that into a search engine. Add to the end of the URL "/docs" and hit enter. Your URL should look something like: http://127.0.0.1:8000/docs

  2. FastAPI user interface will open. Click on the green POST bar.

    1. Click "Try it out"

    2. Enter any JSON query into the "Request body" box.

      1. This repository contains example json queries you could enter. Either click here or navigate to the docs/example_queries directory, and choose the json_queries notebook. Copy and paste any of these.
    3. Click "Execute" and scroll down to the "Responses" to see the results of your query.

  3. Click on the blue GET bar.

    1. Click "Try it out"

    2. Click "Execute" and scroll down to the "Reponse body" to see the results.

    3. Change the URL by removing "/docs" and adding "/KG_types", hit enter. Your URL should look something like: http://127.0.0.1:8000/KG_types

      1. See the same results as Step 4.2, this is just another way to get there.

Summary of Current API

As of right now, the API only handles direct-relationship queries. For example, "What are the drugs approved to treat the disease Acute Myeloid Leukemia?" is a question that the current API can handle because drug and disease nodes share a common, direct, relationship (edge) between them in the graph database. This pattern is the same for gene-to-gene and drug-to-gene queries.

Future Steps

Future steps include creating additional endpoints that would handle indirect-relationship queries, those that require multiple hops. For example, "What are the gene targets of the disease Acute Myeloid Leukemia?" is a question that we hope to be able to handle in the future. Gene and disease nodes do not share a direct relationship (edge) between them, so this query requires an additional step to find that middle connection, in this case a drug node. So, future goals include writing endpoints to handle such cases.

Formatting Knowledge

To view the files on knowledge standardization, navigate to the database_formatting directory.

Graph Database

To read about how the graph database was created, either click here or navigate to the docs/README_notebooks directory and choose the graph_database_development notebook.

To view the files on graph database development, navigate to the create_graph_db directory. The CSV files used to create the database can be found in a Google Drive folder.

API Development

To read about how the API was developed, either click here or navigate to the docs/README_notebooks directory and choose the api_development notebook.

To view the files on API development, see main.py in the home of this repository, and navigate to the src directory.

kg_api's People

Contributors

emilyz1 avatar katiechristensen avatar omarisb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.