Skip to content

Commit

Permalink
Merge pull request #211 from bgyori/entity_info
Browse files Browse the repository at this point in the history
Add entity info endpoint
  • Loading branch information
dianakolusheva committed Mar 24, 2021
2 parents 564c689 + fc31e1f commit ca1bf73
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion emmaa_service/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from indralab_web_templates.path_templates import path_temps
from indra.config import get_config
from indra.sources.hypothesis import upload_statement_annotation
from indra.databases.identifiers import get_identifiers_url


app = Flask(__name__)
Expand Down Expand Up @@ -1712,7 +1713,7 @@ def submit_curation_endpoint(hash_val, **kwargs):
text = request.json.get('text')
is_test = 'test' in request.args
if not is_test:
assert tag is not 'test'
assert tag != 'test'
try:
dbid = submit_curation(hash_val, tag, email, ip, text, ev_hash,
source_api)
Expand Down Expand Up @@ -1887,6 +1888,16 @@ def pusher_authentication():
return json.dumps(auth)


@app.route("/entity_info/<model>", methods=['GET', 'POST'])
def entity_info(model):
# For now, the model isn't explicitly used but could be necessary
# for adding model-specific entity info later
namespace = request.args.get('namespace')
identifier = request.args.get('id')
url = get_identifiers_url(namespace, identifier)
return {'url': url}


if __name__ == '__main__':
parser = argparse.ArgumentParser('Run the EMMAA dashboard service.')
parser.add_argument('--host', default='0.0.0.0')
Expand Down

0 comments on commit ca1bf73

Please sign in to comment.