Skip to content

Commit

Permalink
Merge pull request #365 from nanglo123/update_dkg_links
Browse files Browse the repository at this point in the history
Update dkg links in notebooks
  • Loading branch information
bgyori committed Sep 18, 2024
2 parents b234100 + bdead12 commit a3cd2a9
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 22 deletions.
6 changes: 3 additions & 3 deletions notebooks/ASKEM MIRA demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@
"MIRA is available at: https://github.com/indralab/mira, and can be used as\n",
"- A Python library, documented at https://miramodel.readthedocs.io/\n",
"- A local, dockerized REST API: https://github.com/indralab/mira/tree/main/docker#readme\n",
"- A public REST API: http://34.230.33.149:8771/"
"- A public REST API: http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/"
]
},
{
Expand All @@ -539,7 +539,7 @@
{
"data": {
"text/html": [
"<iframe src=\"http://34.230.33.149:8771/docs\" width=\"1000\" height=\"1000\"></iframe>\n"
"<iframe src=\"http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/docs\" width=\"1000\" height=\"1000\"></iframe>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
Expand All @@ -551,7 +551,7 @@
],
"source": [
"%%html\n",
"<iframe src=\"http://34.230.33.149:8771/docs\" width=\"1000\" height=\"1000\"></iframe>"
"<iframe src=\"http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/docs\" width=\"1000\" height=\"1000\"></iframe>"
]
}
],
Expand Down
4 changes: 2 additions & 2 deletions notebooks/DKG_Viz_Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"data_json ={\n",
" \"source_curie\":\"probonto:k0000016\"\n",
"}\n",
"response = requests.post(\"http://34.230.33.149:8771/api/relations\", json=data_json)\n",
"response = requests.post(\"http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/api/relations\", json=data_json)\n",
"response"
]
},
Expand Down Expand Up @@ -103,7 +103,7 @@
" \"source_curie\":\"probonto:k0000016\",\n",
" \"full\": True\n",
"}\n",
"response = requests.post(\"http://34.230.33.149:8771/api/relations\", json=data_json)\n",
"response = requests.post(\"http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/api/relations\", json=data_json)\n",
"response"
]
},
Expand Down
8 changes: 4 additions & 4 deletions notebooks/Entity Similarity Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"id": "5fe79eed-1cc3-4338-922b-5b8c8b70f722",
"metadata": {},
"source": [
"Documentation for the entity similarity endpoint can be found at http://34.230.33.149:8771/docs#/entities/entity_similarity_api_entity_similarity_post. It takes in compact URIs (CURIEs), which are the \"primary keys\" for terms in the DKG. It then performs an all-by-all comparison of sources and targets."
"Documentation for the entity similarity endpoint can be found at http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/docs#/entities/entity_similarity_api_entity_similarity_post. It takes in compact URIs (CURIEs), which are the \"primary keys\" for terms in the DKG. It then performs an all-by-all comparison of sources and targets."
]
},
{
Expand All @@ -52,7 +52,7 @@
"metadata": {},
"outputs": [],
"source": [
"URL = \"http://127.0.0.1:8771/api/entity_similarity\"\n",
"URL = \"http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/api/entity_similarity\"\n",
"\n",
"def get_similarities_df(sources, targets=None):\n",
" if targets is None:\n",
Expand All @@ -62,7 +62,7 @@
" df = pd.DataFrame(res.json())\n",
"\n",
" curies = \",\".join(sorted(set(df.source).union(df.target)))\n",
" res = requests.get(f\"http://127.0.0.1:8771/api/entities/{curies}\").json()\n",
" res = requests.get(f\"http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/api/entities/{curies}\").json()\n",
" names = {record['id']: record['name'] for record in res}\n",
" \n",
" assert \"similarity\" in df.columns\n",
Expand Down Expand Up @@ -533,7 +533,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions notebooks/Extend_DKG_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
}
],
"source": [
"response = requests.post(\"http://localhost:8771/api/add_nodes\", json=node_list)\n",
"response = requests.post(\"http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/api/add_nodes\", json=node_list)\n",
"response.status_code"
]
},
Expand Down Expand Up @@ -210,7 +210,7 @@
"source": [
"node_list.append(node3)\n",
"node_list.append(node1)\n",
"response = requests.post(\"http://localhost:8771/api/add_nodes\", json=node_list)\n",
"response = requests.post(\"http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/api/add_nodes\", json=node_list)\n",
"response.status_code"
]
},
Expand Down Expand Up @@ -298,7 +298,7 @@
],
"source": [
"response = requests.post(\n",
" \"http://localhost:8771/api/add_relations\", json=relation_list\n",
" \"http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/api/add_relations\", json=relation_list\n",
")\n",
"response.status_code"
]
Expand Down Expand Up @@ -415,7 +415,7 @@
"]\n",
"\n",
"response = requests.post(\n",
" \"http://localhost:8771/api/add_resources\", json=resource_list\n",
" \"http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/api/add_resources\", json=resource_list\n",
")\n",
"response.status_code"
]
Expand Down
144 changes: 139 additions & 5 deletions notebooks/dkg_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"metadata": {},
"outputs": [],
"source": [
"base = \"http://34.230.33.149:8771/api\"\n",
"base = \"http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/api\"\n",
"# base = \"http://localhost:8771/api\" # Local deployment"
]
},
Expand Down Expand Up @@ -461,7 +461,80 @@
"outputs": [
{
"data": {
"text/plain": "[{'subject': 'doid:946',\n 'predicate': ['rdfs:subClassOf'],\n 'object': 'doid:2789'},\n {'subject': 'doid:946',\n 'predicate': ['rdfs:subClassOf', 'rdfs:subClassOf'],\n 'object': 'doid:1398'},\n {'subject': 'doid:946',\n 'predicate': ['rdfs:subClassOf', 'rdfs:subClassOf', 'rdfs:subClassOf'],\n 'object': 'doid:0050117'},\n {'subject': 'doid:946',\n 'predicate': ['rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf'],\n 'object': 'doid:4'},\n {'subject': 'doid:946',\n 'predicate': ['rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf'],\n 'object': 'ogms:0000031'},\n {'subject': 'doid:946',\n 'predicate': ['rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf'],\n 'object': 'bfo:0000016'},\n {'subject': 'doid:946',\n 'predicate': ['rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf'],\n 'object': 'bfo:0000017'},\n {'subject': 'doid:946',\n 'predicate': ['rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf'],\n 'object': 'bfo:0000020'},\n {'subject': 'doid:946',\n 'predicate': ['rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf'],\n 'object': 'bfo:0000002'},\n {'subject': 'doid:946',\n 'predicate': ['rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf',\n 'rdfs:subClassOf'],\n 'object': 'bfo:0000001'}]"
"text/plain": [
"[{'subject': 'doid:946',\n",
" 'predicate': ['rdfs:subClassOf'],\n",
" 'object': 'doid:2789'},\n",
" {'subject': 'doid:946',\n",
" 'predicate': ['rdfs:subClassOf', 'rdfs:subClassOf'],\n",
" 'object': 'doid:1398'},\n",
" {'subject': 'doid:946',\n",
" 'predicate': ['rdfs:subClassOf', 'rdfs:subClassOf', 'rdfs:subClassOf'],\n",
" 'object': 'doid:0050117'},\n",
" {'subject': 'doid:946',\n",
" 'predicate': ['rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf'],\n",
" 'object': 'doid:4'},\n",
" {'subject': 'doid:946',\n",
" 'predicate': ['rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf'],\n",
" 'object': 'ogms:0000031'},\n",
" {'subject': 'doid:946',\n",
" 'predicate': ['rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf'],\n",
" 'object': 'bfo:0000016'},\n",
" {'subject': 'doid:946',\n",
" 'predicate': ['rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf'],\n",
" 'object': 'bfo:0000017'},\n",
" {'subject': 'doid:946',\n",
" 'predicate': ['rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf'],\n",
" 'object': 'bfo:0000020'},\n",
" {'subject': 'doid:946',\n",
" 'predicate': ['rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf'],\n",
" 'object': 'bfo:0000002'},\n",
" {'subject': 'doid:946',\n",
" 'predicate': ['rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf',\n",
" 'rdfs:subClassOf'],\n",
" 'object': 'bfo:0000001'}]"
]
},
"execution_count": 24,
"metadata": {},
Expand Down Expand Up @@ -499,7 +572,68 @@
"outputs": [
{
"data": {
"text/plain": "[{'subject': {'id': 'symp:0020011',\n 'name': 'bloody diarrhea',\n 'type': 'class',\n 'obsolete': False,\n 'description': None,\n 'synonyms': [],\n 'alts': [],\n 'xrefs': [],\n 'labels': [],\n 'properties': {}},\n 'predicate': {'pred': 'rdfs:subClassOf',\n 'source': 'symp',\n 'version': '2022-10-20',\n 'graph': 'http://purl.obolibrary.org/obo/symp.owl'},\n 'object': {'id': 'symp:0000570',\n 'name': 'diarrhea',\n 'type': 'class',\n 'obsolete': False,\n 'description': 'Diarrhea is a feces and droppng symptom involving the abnormally frequent intestinal evacuations with more or less fluid stools.',\n 'synonyms': [{'value': 'the runs', 'type': 'oboinowl:hasExactSynonym'},\n {'value': 'diarrhoea', 'type': 'oboinowl:hasExactSynonym'},\n {'value': 'loose bowels', 'type': 'oboinowl:hasExactSynonym'},\n {'value': 'loose bowel', 'type': 'oboinowl:hasExactSynonym'},\n {'value': 'bacterial gastroenteritis', 'type': 'oboinowl:hasExactSynonym'},\n {'value': 'fecal incontinence', 'type': 'oboinowl:hasExactSynonym'},\n {'value': 'incontinence of feces', 'type': 'oboinowl:hasExactSynonym'}],\n 'alts': [],\n 'xrefs': [],\n 'labels': [],\n 'properties': {}}},\n {'subject': {'id': 'symp:0000738',\n 'name': 'yellowish green diarrhea',\n 'type': 'class',\n 'obsolete': False,\n 'description': None,\n 'synonyms': [],\n 'alts': [],\n 'xrefs': [],\n 'labels': [],\n 'properties': {}},\n 'predicate': {'pred': 'rdfs:subClassOf',\n 'source': 'symp',\n 'version': '2022-10-20',\n 'graph': 'http://purl.obolibrary.org/obo/symp.owl'},\n 'object': {'id': 'symp:0000570',\n 'name': 'diarrhea',\n 'type': 'class',\n 'obsolete': False,\n 'description': 'Diarrhea is a feces and droppng symptom involving the abnormally frequent intestinal evacuations with more or less fluid stools.',\n 'synonyms': [{'value': 'the runs', 'type': 'oboinowl:hasExactSynonym'},\n {'value': 'diarrhoea', 'type': 'oboinowl:hasExactSynonym'},\n {'value': 'loose bowels', 'type': 'oboinowl:hasExactSynonym'},\n {'value': 'loose bowel', 'type': 'oboinowl:hasExactSynonym'},\n {'value': 'bacterial gastroenteritis', 'type': 'oboinowl:hasExactSynonym'},\n {'value': 'fecal incontinence', 'type': 'oboinowl:hasExactSynonym'},\n {'value': 'incontinence of feces', 'type': 'oboinowl:hasExactSynonym'}],\n 'alts': [],\n 'xrefs': [],\n 'labels': [],\n 'properties': {}}}]"
"text/plain": [
"[{'subject': {'id': 'symp:0020011',\n",
" 'name': 'bloody diarrhea',\n",
" 'type': 'class',\n",
" 'obsolete': False,\n",
" 'description': None,\n",
" 'synonyms': [],\n",
" 'alts': [],\n",
" 'xrefs': [],\n",
" 'labels': [],\n",
" 'properties': {}},\n",
" 'predicate': {'pred': 'rdfs:subClassOf',\n",
" 'source': 'symp',\n",
" 'version': '2022-10-20',\n",
" 'graph': 'http://purl.obolibrary.org/obo/symp.owl'},\n",
" 'object': {'id': 'symp:0000570',\n",
" 'name': 'diarrhea',\n",
" 'type': 'class',\n",
" 'obsolete': False,\n",
" 'description': 'Diarrhea is a feces and droppng symptom involving the abnormally frequent intestinal evacuations with more or less fluid stools.',\n",
" 'synonyms': [{'value': 'the runs', 'type': 'oboinowl:hasExactSynonym'},\n",
" {'value': 'diarrhoea', 'type': 'oboinowl:hasExactSynonym'},\n",
" {'value': 'loose bowels', 'type': 'oboinowl:hasExactSynonym'},\n",
" {'value': 'loose bowel', 'type': 'oboinowl:hasExactSynonym'},\n",
" {'value': 'bacterial gastroenteritis', 'type': 'oboinowl:hasExactSynonym'},\n",
" {'value': 'fecal incontinence', 'type': 'oboinowl:hasExactSynonym'},\n",
" {'value': 'incontinence of feces', 'type': 'oboinowl:hasExactSynonym'}],\n",
" 'alts': [],\n",
" 'xrefs': [],\n",
" 'labels': [],\n",
" 'properties': {}}},\n",
" {'subject': {'id': 'symp:0000738',\n",
" 'name': 'yellowish green diarrhea',\n",
" 'type': 'class',\n",
" 'obsolete': False,\n",
" 'description': None,\n",
" 'synonyms': [],\n",
" 'alts': [],\n",
" 'xrefs': [],\n",
" 'labels': [],\n",
" 'properties': {}},\n",
" 'predicate': {'pred': 'rdfs:subClassOf',\n",
" 'source': 'symp',\n",
" 'version': '2022-10-20',\n",
" 'graph': 'http://purl.obolibrary.org/obo/symp.owl'},\n",
" 'object': {'id': 'symp:0000570',\n",
" 'name': 'diarrhea',\n",
" 'type': 'class',\n",
" 'obsolete': False,\n",
" 'description': 'Diarrhea is a feces and droppng symptom involving the abnormally frequent intestinal evacuations with more or less fluid stools.',\n",
" 'synonyms': [{'value': 'the runs', 'type': 'oboinowl:hasExactSynonym'},\n",
" {'value': 'diarrhoea', 'type': 'oboinowl:hasExactSynonym'},\n",
" {'value': 'loose bowels', 'type': 'oboinowl:hasExactSynonym'},\n",
" {'value': 'loose bowel', 'type': 'oboinowl:hasExactSynonym'},\n",
" {'value': 'bacterial gastroenteritis', 'type': 'oboinowl:hasExactSynonym'},\n",
" {'value': 'fecal incontinence', 'type': 'oboinowl:hasExactSynonym'},\n",
" {'value': 'incontinence of feces', 'type': 'oboinowl:hasExactSynonym'}],\n",
" 'alts': [],\n",
" 'xrefs': [],\n",
" 'labels': [],\n",
" 'properties': {}}}]"
]
},
"execution_count": 25,
"metadata": {},
Expand All @@ -513,7 +647,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -527,7 +661,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"env: MIRA_REST_URL=http://34.230.33.149:8771\n"
"env: MIRA_REST_URL=http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771\n"
]
}
],
Expand All @@ -41,7 +41,7 @@
"from mira.sources import biomodels\n",
"from mira.metamodel import *\n",
"\n",
"%env MIRA_REST_URL=http://34.230.33.149:8771\n",
"%env MIRA_REST_URL=http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771\n",
"rc = get_dkg_refinement_closure()"
]
},
Expand Down
4 changes: 2 additions & 2 deletions notebooks/model_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"# Model REST API\n",
"\n",
"The Model REST API provides an interface for transforming models in various ways. Here are some examples. The model REST API documentation is available at [http://34.230.33.149:8771/docs#/](http://34.230.33.149:8771/docs#/)\n",
"The Model REST API provides an interface for transforming models in various ways. Here are some examples. The model REST API documentation is available at [http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/docs#/](http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771/docs#/)\n",
"\n",
"## Setup\n",
"\n",
Expand All @@ -31,7 +31,7 @@
"from mira.metamodel import Concept, ControlledConversion, NaturalConversion, TemplateModel\n",
"\n",
"# rest_url = \"http://127.0.0.1:8000\" # Local service\n",
"rest_url = \"http://34.230.33.149:8771\"\n",
"rest_url = \"http://mira-epi-dkg-lb-c7b58edea41524e6.elb.us-east-1.amazonaws.com:8771\"\n",
"\n",
"# Example TemplateModel\n",
"infected = Concept(name=\"infected population\", identifiers={\"ido\": \"0000511\"})\n",
Expand Down

0 comments on commit a3cd2a9

Please sign in to comment.