diff --git a/notebooks/ASKEM MIRA demo.ipynb b/notebooks/ASKEM MIRA demo.ipynb index 15fc8cf61..11bebec16 100644 --- a/notebooks/ASKEM MIRA demo.ipynb +++ b/notebooks/ASKEM MIRA demo.ipynb @@ -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/" ] }, { @@ -539,7 +539,7 @@ { "data": { "text/html": [ - "\n" + "\n" ], "text/plain": [ "" @@ -551,7 +551,7 @@ ], "source": [ "%%html\n", - "" + "" ] } ], diff --git a/notebooks/DKG_Viz_Demo.ipynb b/notebooks/DKG_Viz_Demo.ipynb index 947b74adc..23d3c8b64 100644 --- a/notebooks/DKG_Viz_Demo.ipynb +++ b/notebooks/DKG_Viz_Demo.ipynb @@ -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" ] }, @@ -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" ] }, diff --git a/notebooks/Entity Similarity Demo.ipynb b/notebooks/Entity Similarity Demo.ipynb index 6f80c402b..4c455d37e 100644 --- a/notebooks/Entity Similarity Demo.ipynb +++ b/notebooks/Entity Similarity Demo.ipynb @@ -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." ] }, { @@ -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", @@ -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", @@ -533,7 +533,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/notebooks/Extend_DKG_demo.ipynb b/notebooks/Extend_DKG_demo.ipynb index 71e4ecfb5..73ec3e526 100644 --- a/notebooks/Extend_DKG_demo.ipynb +++ b/notebooks/Extend_DKG_demo.ipynb @@ -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" ] }, @@ -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" ] }, @@ -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" ] @@ -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" ] diff --git a/notebooks/dkg_api.ipynb b/notebooks/dkg_api.ipynb index 8299c82d1..873dd93cc 100644 --- a/notebooks/dkg_api.ipynb +++ b/notebooks/dkg_api.ipynb @@ -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" ] }, @@ -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": {}, @@ -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": {}, @@ -513,7 +647,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -527,7 +661,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/notebooks/hackathon_2023.10/dkg_grounding_model_comparison.ipynb b/notebooks/hackathon_2023.10/dkg_grounding_model_comparison.ipynb index a7971f79a..0246e6a8e 100644 --- a/notebooks/hackathon_2023.10/dkg_grounding_model_comparison.ipynb +++ b/notebooks/hackathon_2023.10/dkg_grounding_model_comparison.ipynb @@ -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" ] } ], @@ -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()" ] }, diff --git a/notebooks/model_api.ipynb b/notebooks/model_api.ipynb index d5a33bafe..51041b752 100644 --- a/notebooks/model_api.ipynb +++ b/notebooks/model_api.ipynb @@ -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", @@ -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",