{ "info": { "author": "Tom Gillespie", "author_email": "tgbugs@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# ontquery\n[![PyPI version](https://badge.fury.io/py/ontquery.svg)](https://pypi.org/project/ontquery/)\n[![Build Status](https://travis-ci.org/tgbugs/ontquery.svg?branch=master)](https://travis-ci.org/tgbugs/ontquery)\n[![Coverage Status](https://coveralls.io/repos/github/tgbugs/ontquery/badge.svg?branch=master)](https://coveralls.io/github/tgbugs/ontquery?branch=master)\n\na framework querying ontology terms\n\n# Installation\nOntquery supports two different use cases each with their own installation instructions. \n\nBy default ontquery installs only the stripped down core libraries so that it can be embedded an reused in\nother applications that need to reduce their dependnecies. For this use case packages can include ontquery\nas a dependency in their package requirements without any special changes e.g. `ontquery>=0.0.6`. \n\nThe second use case enables remote services via a plugin infrastructure.\nTo install this version you should install or require using the [pip extras syntax](https://packaging.python.org/tutorials/installing-packages/#installing-setuptools-extras) e.g. `pip install ontquery[services]>=0.6.0`.\n\n# SciCrunch api key\nIf you don't have your own SciGraph instance you will need a SciCunch API key in order to run the demos (e.g. `python __init__.py`).\n\nTo do this go to SciCrunch and [register for an account](https://scicrunch.org/register) and then [get an api key](https://scicrunch.org/account/developer).\n\nYou can then set the `SCICRUNCH_API_KEY` environment variable.\nFor example in bash `export SCICRUNCH_API_KEY=my-api-key`.\n\nSee https://github.com/tgbugs/ontquery/blob/db8cad7463704bce9010651c3744452aa5370114/ontquery/__init__.py#L557-L558 for how to pass the key in.\n\n# SciGraphRemote Usage\n```python\nfrom ontquery import OntQuery, SciGraphRemote, OntTerm, OntCuries\nfrom ontquery.plugins.namespaces import CURIE_MAP\n\ncuries = OntCuries(CURIE_MAP)\nquery = OntQuery(SciGraphRemote())\nOntTerm.query = query\n```\n```python\nquery('mouse')\n```\n3 potential matches are shown:\n```python\nQuery {'term': 'mouse', 'limit': 10} returned more than one result. Please review.\n\nOntTerm('NCBITaxon:10090', label='Mus musculus', synonyms=['mouse', 'house mouse', 'mice C57BL/6xCBA/CaJ hybrid', 'Mus muscaris'])\n\nOntTerm('NCBITaxon:10088', label='Mus ', synonyms=['mouse', 'Mus', 'mice'])\n\nOntTerm('BIRNLEX:167', label='Mouse', synonyms=['mouse', 'Mus musculus', 'house mouse'])\n```\n\nThe one we are looking for is `Mus musculus`, and we can select that with\n`OntTerm('NCBITaxon:10090', label='Mus musculus')` or with `OntTerm(curie='NCBITaxon:10090')`.\n\nThis workflow works for a variety of categories:\n* species (e.g. 'mouse', 'rat', 'rhesus macaque')\n* brain area (e.g. 'hippocampus', 'CA1', 'S1')\n* cell type (e.g. 'mossy cell', 'pyramidal cell')\n* institution (e.g. 'UC San Francisco', 'Brown University')\n* disease (e.g. \"Parkinson's Disease\", 'ALS')\n\n# Building for release\n`python setup.py sdist --release && python setup.py bdist_wheel --universal --release`\nBuilding a release requires a working install of pyontutils in order to build the\nscigraph client library. The `--release` tells setup to build the scigraph client.\n\n# Related issues\n\nhttps://github.com/NeurodataWithoutBorders/nwb-schema/issues/1#issuecomment-368741867\n\nhttps://github.com/NeurodataWithoutBorders/nwb-schema/issues/1#issuecomment-369215854\n\n# InterlexRemote Notes\nilx_id and any key that takes a uri value can also be given a curie of that uri or a fragment and it will still work.\n\n# InterLexRemote Usage\nTo access InterLex programatically you can set `SCICRUNCH_API_KEY` or\nyou can set `INTERLEX_API_KEY` either will work, but `INTERLEX_API_KEY`\nhas priority if both are set.\n\n```python\nimport ontquery as oq\nimport os\nInterLexRemote = oq.plugin.get('InterLex')\n\nilx_cli = InterLexRemote(\n # When ready, should be changed to 'https://scicrunch.org/api/1/' for production (default)\n apiEndpoint = 'https://beta.scicrunch.org/api/1/',\n)\nilx_cli.setup()\n\n# NEEDS: label, type, subThingOf\nresponse = ilx_cli.add_entity(\n type = 'A type that should be one of the following: term, relationship, annotation, cde, fde, pde',\n # subThingOf can take either iri or curie form of ID\n subThingOf = 'http://uri.interlex.org/base/ilx_0108124', # superclass or subClassOf ILX ID\n label = 'Label of entity you wish to create',\n definition = 'Entities definition',\n comment = 'A comment to help understand entity',\n synonyms = ['synonym1', 'synonym2', 'etc'],\n predicates = {\n # annotation_entity_ilx_id : 'annotation_value',\n 'http://uri.interlex.org/base/tmp_0381624': 'PMID:12345', # annotation\n # relationship_entity_ilx_id : 'entity2_ilx_id',\n 'http://uri.interlex.org/base/ilx_0112772': 'http://uri.interlex.org/base/ilx_0100001', # relationship\n }\n)\n\n# NEEDS: label, type\nresponse = ilx_cli.add_pde(\n label = 'Label of entity you wish to create',\n definition = 'Entities definition',\n comment = 'A comment to help understand entity',\n synonyms = ['synonym1', 'synonym2', 'etc'],\n predicates = {\n # annotation_entity_ilx_id : 'annotation_value',\n 'http://uri.interlex.org/base/tmp_0381624': 'PMID:12345', # annotation\n # relationship_entity_ilx_id : 'entity2_ilx_id',\n 'http://uri.interlex.org/base/ilx_0112772': 'http://uri.interlex.org/base/ilx_0100001', # relationship\n }\n)\n\n# NEEDS: ilx_id\nresponse = ilx_cli.update_entity(\n label = 'New Label', # Should be avoided unless there is a typo\n type = 'term', # Just in case intended type wasn't created\n ilx_id = 'TMP:0101431', # entity \"brain\" ilx_id example\n definition = 'update!',\n comment = 'update!',\n # Optional\n subThingOf = 'http://uri.interlex.org/base/ilx_0108124', # ILX ID for Organ\n synonyms = ['Encephalon', 'Cerebro'],\n predicates_to_add = {\n # Annotation\n 'http://uri.interlex.org/base/tmp_0381624': 'PMID:12346',\n # Relationship\n 'http://uri.interlex.org/base/ilx_0112772': 'http://uri.interlex.org/base/ilx_0100000', # relationship\n },\n # Need to be exact or they will be ignored\n predicates_to_delete = {\n # Annotation\n 'http://uri.interlex.org/base/tmp_0381624': 'PMID:12345',\n # Relationship\n 'http://uri.interlex.org/base/ilx_0112772': 'http://uri.interlex.org/base/ilx_0100001', # relationship\n },\n)\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tgbugs/ontquery", "keywords": "ontology terminology scigraph interlex term lookup ols", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ontquery", "package_url": "https://pypi.org/project/ontquery/", "platform": "", "project_url": "https://pypi.org/project/ontquery/", "project_urls": { "Homepage": "https://github.com/tgbugs/ontquery" }, "release_url": "https://pypi.org/project/ontquery/0.1.0/", "requires_dist": [ "pyontutils ; extra == 'dev'", "rdflib ; extra == 'services'", "requests ; extra == 'services'", "pytest ; extra == 'test'", "pytest-runner ; extra == 'test'", "rdflib ; extra == 'test'", "requests ; extra == 'test'" ], "requires_python": ">=3.6", "summary": "a framework querying ontology terms", "version": "0.1.0" }, "last_serial": 5355510, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "746b3b4323d176659b4bacc6cf673219", "sha256": "06e57e352fded1436b1d9650a7c0e21e1c04763d8022ec65a896eb0d22d4ee24" }, "downloads": -1, "filename": "ontquery-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "746b3b4323d176659b4bacc6cf673219", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11951, "upload_time": "2018-08-06T11:53:10", "url": "https://files.pythonhosted.org/packages/44/37/9c4e7d75dcde68eb1f5becd4d340dfd211a708ba5e9a654839a6dd57bb46/ontquery-0.0.1-py2.py3-none-any.whl" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "e0b13ee8b783e3be91081b15abf8af91", "sha256": "42948fa6723369ca734ff44fdfada08775e5613cf9b9c90334fcc3218767fd48" }, "downloads": -1, "filename": "ontquery-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e0b13ee8b783e3be91081b15abf8af91", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13140, "upload_time": "2018-10-03T02:11:53", "url": "https://files.pythonhosted.org/packages/bd/1f/3f98a31b809cf3b15d76f95ca9bf150d92e826406b993f64120546c7009f/ontquery-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f67d1e7784803a4ef02951fa80636f7f", "sha256": "a2ef5f6c11a70cb6d12f3b9ad2fcfd1be5abdaf980e059df6599e52dad089864" }, "downloads": -1, "filename": "ontquery-0.0.2.tar.gz", "has_sig": false, "md5_digest": "f67d1e7784803a4ef02951fa80636f7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27164, "upload_time": "2018-10-03T02:11:54", "url": "https://files.pythonhosted.org/packages/64/6e/0a35bc9127d8de97e34730b2d3df6d01817c4a7c881f728b89e6ead9686a/ontquery-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "87fb9ce0e2f6cfac5557d0b842b74616", "sha256": "5d5bf1794bf7d24eb6e7500ea7c14a8743bf636b3136650a77879182d38858e5" }, "downloads": -1, "filename": "ontquery-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "87fb9ce0e2f6cfac5557d0b842b74616", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 26512, "upload_time": "2018-10-14T05:16:22", "url": "https://files.pythonhosted.org/packages/b9/3c/5ef411b79ea66dd9c7c5dbcda91187f3bef4cef2d51cd4406106ec58af28/ontquery-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "642614fe0f1eae9f5a85ecd264125c23", "sha256": "7d7b45a5bd5373a47c7b9e53ceddef28a6c5e370f0f2710cbffdaf10cfa6519b" }, "downloads": -1, "filename": "ontquery-0.0.3.tar.gz", "has_sig": false, "md5_digest": "642614fe0f1eae9f5a85ecd264125c23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27187, "upload_time": "2018-10-14T05:16:24", "url": "https://files.pythonhosted.org/packages/33/3c/9f046101837a9eb51ce4d7785c3fedc16c7b92ac9d0483602359565463be/ontquery-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "9797ddffb0fd8a40f13e5e117f0bada6", "sha256": "ea1ba860bbf1953cb67462a383b6af824d806b60bac279ae9a70b0138c70521b" }, "downloads": -1, "filename": "ontquery-0.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9797ddffb0fd8a40f13e5e117f0bada6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 28163, "upload_time": "2018-10-18T10:04:33", "url": "https://files.pythonhosted.org/packages/c4/30/81bbeaa4f7f982c19b761275320c96c48b4caf9579dc024f671de5ae8322/ontquery-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8f381901093299994bf34a12ffa22ec1", "sha256": "50769cfb5a4e6174003476e6f65693c787ec88499ba361b0f77995e2a8663daa" }, "downloads": -1, "filename": "ontquery-0.0.4.tar.gz", "has_sig": false, "md5_digest": "8f381901093299994bf34a12ffa22ec1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29499, "upload_time": "2018-10-18T10:04:34", "url": "https://files.pythonhosted.org/packages/7c/ac/ca0ac28a55cf9ca2400cbf00e7bd81158c01dc5fffb896f5142604e1cc91/ontquery-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "a27633ec04b223929cfb0bd3ca1e7438", "sha256": "a6302ff426f504667167c44610e22d7fde0352b809fbd0a02de12e87cb0c8126" }, "downloads": -1, "filename": "ontquery-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a27633ec04b223929cfb0bd3ca1e7438", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 29211, "upload_time": "2018-10-18T10:39:55", "url": "https://files.pythonhosted.org/packages/0e/33/d5a1c2500a52c848f381cfc862b9d87e2fc6c916ebbf037a0fd88c062ae8/ontquery-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "99601369ea3be47797c4dfa7de5d25a5", "sha256": "0ebfd9717aad1808797043b43c35331ddcb0c395180cc1db084d7a7ec7d289de" }, "downloads": -1, "filename": "ontquery-0.0.5.tar.gz", "has_sig": false, "md5_digest": "99601369ea3be47797c4dfa7de5d25a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29501, "upload_time": "2018-10-18T10:39:56", "url": "https://files.pythonhosted.org/packages/65/97/2ae7e86f9c120073a682d9b8a9a4ea3cfb3a171149cfe7841b6b0ccc6442/ontquery-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "0c59e42fe0e85942656812794c85ec08", "sha256": "dc58a6b281021c37dc8f38e61d872c3d099266513e7ad2581239c2cd2cf0d84e" }, "downloads": -1, "filename": "ontquery-0.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0c59e42fe0e85942656812794c85ec08", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 43985, "upload_time": "2019-03-28T22:13:31", "url": "https://files.pythonhosted.org/packages/79/88/7964a086a8b62077682b34e10c3865e25e26cbffa0fe20dff427d4ee15fd/ontquery-0.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "95ce607497318e65b0a1eb721f79877e", "sha256": "37a8558270ae9bdb280bbd42fbdfc6d0c81df34819f8e4d2d67777743e483a87" }, "downloads": -1, "filename": "ontquery-0.0.6.tar.gz", "has_sig": false, "md5_digest": "95ce607497318e65b0a1eb721f79877e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 49978, "upload_time": "2019-03-28T22:13:33", "url": "https://files.pythonhosted.org/packages/ab/70/218b4f0f6a6c6e696ccfbd4e67f2c45bf2912c81abb998b65ed075179943/ontquery-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "2e1a055b1dd3814bf93c415f7c100f25", "sha256": "c8de82e97fdc55ffb9af9db5753e2e8babe59d7bb94d7edf3a199b2d6050f138" }, "downloads": -1, "filename": "ontquery-0.0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2e1a055b1dd3814bf93c415f7c100f25", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 44039, "upload_time": "2019-03-29T19:10:36", "url": "https://files.pythonhosted.org/packages/38/b0/9c96b4e34399074e0d6d8e831fdd7f8d68847f50391148dba7ea4d9d0879/ontquery-0.0.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7fddce170bf874810298ff223f95ada", "sha256": "dccaa3f7ddf4163df58ad9a48ffe08369e5a8cd1ddf8da858b70aa70f651baab" }, "downloads": -1, "filename": "ontquery-0.0.7.tar.gz", "has_sig": false, "md5_digest": "a7fddce170bf874810298ff223f95ada", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 50140, "upload_time": "2019-03-29T19:10:38", "url": "https://files.pythonhosted.org/packages/c1/aa/882a3d31600cd97485fcf60c07994fd0e103da121522967e6257e7c18896/ontquery-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "7003307f531f9da05b2e4b3935d78703", "sha256": "0a4fd7ded6a0f591e412ff8a86cf9590d962c3284fc395ff6ab78812133923f9" }, "downloads": -1, "filename": "ontquery-0.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7003307f531f9da05b2e4b3935d78703", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 44127, "upload_time": "2019-04-02T03:08:14", "url": "https://files.pythonhosted.org/packages/a5/ce/d9be9a4b00672edca0f6c999ce0d60eff540b4bf694e3d719eefb4601074/ontquery-0.0.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b4ef7bb5ab7686e293758a5f5b01454d", "sha256": "0d4ac4a8aac11cfcb656c266d903f008e23e1fa3769efce18ed8d6a76317a030" }, "downloads": -1, "filename": "ontquery-0.0.8.tar.gz", "has_sig": false, "md5_digest": "b4ef7bb5ab7686e293758a5f5b01454d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 50259, "upload_time": "2019-04-02T03:08:16", "url": "https://files.pythonhosted.org/packages/45/83/562710deabee5d29e20d47c6e8cb6e874a5108a3cbc54958ddf018e395f9/ontquery-0.0.8.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "44d2c069c2164696fbf76f6c895d3b24", "sha256": "2c51298e118c7d49c4f53dbdc2b3a06c2d9ca3e6beb13fbb321c59d643dc7d0b" }, "downloads": -1, "filename": "ontquery-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "44d2c069c2164696fbf76f6c895d3b24", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 48018, "upload_time": "2019-06-04T04:02:47", "url": "https://files.pythonhosted.org/packages/e7/8b/a0a61c90418a4668c31cb8a61f79b71c483673e1911c40d9d978ceb7391f/ontquery-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c081a050dfdab757152bd1612305722f", "sha256": "559301a3698d4d9a5e8bb8a2e956a8962b027bdf5a1a30d658fb333a3a467c06" }, "downloads": -1, "filename": "ontquery-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c081a050dfdab757152bd1612305722f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 55445, "upload_time": "2019-06-04T04:02:49", "url": "https://files.pythonhosted.org/packages/b6/67/64df6460fb5fd46e0259142a1edb87e30cebc2e1d6af313627f940c9066e/ontquery-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "44d2c069c2164696fbf76f6c895d3b24", "sha256": "2c51298e118c7d49c4f53dbdc2b3a06c2d9ca3e6beb13fbb321c59d643dc7d0b" }, "downloads": -1, "filename": "ontquery-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "44d2c069c2164696fbf76f6c895d3b24", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 48018, "upload_time": "2019-06-04T04:02:47", "url": "https://files.pythonhosted.org/packages/e7/8b/a0a61c90418a4668c31cb8a61f79b71c483673e1911c40d9d978ceb7391f/ontquery-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c081a050dfdab757152bd1612305722f", "sha256": "559301a3698d4d9a5e8bb8a2e956a8962b027bdf5a1a30d658fb333a3a467c06" }, "downloads": -1, "filename": "ontquery-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c081a050dfdab757152bd1612305722f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 55445, "upload_time": "2019-06-04T04:02:49", "url": "https://files.pythonhosted.org/packages/b6/67/64df6460fb5fd46e0259142a1edb87e30cebc2e1d6af313627f940c9066e/ontquery-0.1.0.tar.gz" } ] }