{ "info": { "author": "Val\u00e9rie Hanoka", "author_email": "valerieh@protonmail.com", "bugtrack_url": null, "classifiers": [], "description": "Copyright (c) 2017, Val\u00e9rie Hanoka & Labex OBVIL\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nDescription: \n \n \n A module for searching Named Entity on SPARQL endpoints\n ===========================================================\n \n [](https://img.shields.io/badge/python-2.7-ff69b4.svg)\n [](https://travis-ci.org/Valerie-Hanoka/PyNeQL)\n [](https://coveralls.io/github/Valerie-Hanoka/PyNeQL?branch=master)\n [](http://pyneql.readthedocs.io/en/latest/?badge=latest) \n [__%2F%C2%AF-lightgrey.svg)](https://img.shields.io/badge/status-development%20%C2%AF%5C__(%E3%83%84)__%2F%C2%AF-lightgrey.svg)\n \n ---------------\n \n \n Linked Data is the global database of the World Wide Web.\n One can query those linked databases by sending SPARQL queries to different endpoints.\n \n SPARQL vocabularies are huge and it is sometimes tedious to find how to ask for simple\n things as Named Entities.\n \n This module aim to provide a very simple way to query named entities by their name, and retrieve\n a maximum of information from different SPARQL endpoints.\n \n You can [read the docs](https://pyneql.readthedocs.io/) here.\n \n Table of Contents\n ----------------- \n \n - [Quick Start](#quick-start)\n - [Installation Instructions](#installation-instructions)\n - [Usage](#usage)\n - [Finding a Person](#finding-person)\n - [Finding Anything](#finding-anything)\n \n -----------\n \n ## Quick Start\n
\n \n \n ### Installation instructions\n \n \n \n **Nota bene: For the moment, this module is still under development. \n You do not want to use this in production.**\n \n \n You can install PyNeQL by cloning the project to your local directory\n \n git clone https://github.com/Valerie-Hanoka/PyNeQL.git\n \n run `setup.py` \n \n python setup.py install\n \n \n I plan to submit it to PyPI soon.\n \n \n ### Usage\n \n \n \n #### Finding a Person\n \n \n Looking for [Bell Hooks](https://fr.wikipedia.org/wiki/Bell_hooks) in the Biblioth\u00e8que Nationale de France, DBPedia, Wikidata and the French DBPedia:\n \n ```python\n # -*- coding: utf-8 -*-\n \n from pyneql.ontology.person import Person\n from pyneql.utils.endpoints import Endpoint\n \n # Looking for Bell Hooks\n endpoints = [Endpoint.dbpedia_fr, Endpoint.dbpedia, Endpoint.wikidata, Endpoint.bnf]\n bell_hooks = Person(first_name=\"bell\", last_name=\"hooks\")\n bell_hooks.add_query_endpoints(endpoints)\n bell_hooks.query()\n ```\n \n At the moment, the result is as follow:\n \n ```python\n # The result of the query contains 15 pieces of information about Bell Hooks.\n pprint.pprint(bell_hooks.attributes)\n # {\n # u'skos:exactMatch': u'http://data.bnf.fr/ark:/12148/cb12519986q#foaf:Person',\n # u'rdf:type': u'foaf:Person',\n # u'foaf:depiction': set([u'http://commons.wikimedia.org/wiki/Special:FilePath/Bellhooks.jpg?width=300'\n # ,\n # u'https://upload.wikimedia.org/wikipedia/commons/7/7b/Bellhooks.jpg'\n # ,\n # u'http://commons.wikimedia.org/wiki/Special:FilePath/Bellhooks.jpg'\n # ]),\n # u'foaf:name': u'bell hooks',\n # u'rdagroup2elements:biographicalInformation': u'Essayiste et enseignante. - Militante f\\xe9minisme et contre la s\\xe9gragation raciale. - Fondatrice, en 2014, du bell hooks Institute, Berea College (Ky., \\xc9tats-Unis). - Pseudonyme de Gloria Jean Watkins',\n # u'owl:sameAs': set([u'http://data.bnf.fr/ark:/12148/cb12519986q#foaf:Person'\n # , u'dbpedia_fr:Bell_hooks',\n # u'http://viaf.org/viaf/79115934',\n # u'http://data.bnf.fr/ark:/12148/cb12519986q#about'\n # ]),\n # u'bnf_onto:firstYear': u'1952',\n # u'foaf:gender': u'female',\n # u'rdagroup2elements:countryAssociatedWithThePerson': u'http://id.loc.gov/vocabulary/countries/xxu',\n # u'rdagroup2elements:fieldOfActivityOfThePerson': set([u'http://dewey.info/class/300/'\n # , u'Sciences sociales. Sociologie']),\n # u'rdagroup2elements:languageOfThePerson': u'http://id.loc.gov/vocabulary/iso639-2/eng',\n # u'foaf:familyName': u'hooks',\n # u'foaf:givenName': u'bell',\n # u'validated': 1,\n # u'foaf:page': u'http://data.bnf.fr/12519986/bell_hooks/',\n # }\n \n # It is possible to find further information about Bell Hooks\n bell_hooks.find_more_about()\n \n # person.find_more_about() gives 208 more attribute-keys values about her:\n len(bell_hooks.attributes)\n # 223\n ```\n \n ##### Language of the query\n \n It is also possible to specify the language of the query, \n and retrieve some information about the person. In this Snippet, we are looking \n for [Vivian Qu](https://en.wikipedia.org/wiki/Vivian_Qu) by her Chinese name:\n \n \n ```python \n from pyneql.ontology.person import Person\n from pyneql.utils.endpoints import Endpoint\n from pyneql.utils.enum import LanguagesIso6391 as Lang\n \n \n endpoints = [Endpoint.dbpedia_fr, Endpoint.dbpedia, Endpoint.wikidata, Endpoint.bnf]\n vivian_qu = Person(full_name=u'\u6587\u664f', query_language=Lang.Chinese)\n vivian_qu.add_query_endpoints(endpoints)\n vivian_qu.query()\n \n # If is possible to access some important information via dedicated methods\n \n vivian_qu.get_names()\n # {u'foaf:givenName': u'Vivian',\n # u'foaf:name': [u'\\u6587\\u664f', u'Vivian Qu'],\n # u'foaf:surname': u'Qu',\n # u'rdfs:label': [u'\\u30f4\\u30a3\\u30f4\\u30a3\\u30a2\\u30f3\\u30fb\\u30c1\\u30e5\\u30a4',\n # u'\\u0641\\u064a\\u0641\\u064a\\u0627\\u0646 \\u062a\\u0634\\u0648',\n # u'Vivian Qu',\n # u'\\u6587\\u664f'],\n # u'wdt:given_name_(P735)': u'wd:Q650494'}\n \n \n vivian_qu.get_birth_info()\n # {'date': datetime.datetime(1950, 1, 1, 0, 0, tzinfo=tzutc()),\n # 'place': u'Beijing, China'}\n ```\n \n \n #### Finding Anything\n \n \n I plan to develop other classes that will allow safe query of named entites of type \n Location, Books, TimePeriods,...\n \n The class Thing will only be used as a common parent for all other named entities classes. \n As it is not safe to use, I describe it there just for fun.\n \n \n Looking for [\u12a0\u12f2\u1235 \u12a0\u1260\u1263](https://en.wikipedia.org/wiki/Addis_Ababa) in Amharic, on DBPedia:\n \n ```python\n from pyneql.ontology.thing import Thing\n from pyneql.utils.endpoints import Endpoint\n from pyneql.utils.enum import LanguagesIso6391 as Lang\n \n addis_abeba = Thing(label=u'\u12a0\u12f2\u1235 \u12a0\u1260\u1263', query_language=Lang.Amharic)\n addis_abeba.add_query_endpoint(Endpoint.dbpedia)\n addis_abeba.query(strict_mode=True)\n \n # It is possible to access information via keyword search\n addis_abeba.get_attributes_with_keyword('abel')\n # {u'rdfs:label': set([u'Adas Ababa',\n # u'Addis Ababa',\n # u'Addis Abeba',\n # u'Addis-Abeb',\n # u'Addis-Abeba',\n # u'Addisz-Abeba',\n # u'Adis Ababa',\n # u'Adis Abeba',\n # u'Adis-Abeba',\n # u'Adis-Abebo',\n # u'Adisabeba',\n # u'Ad\\xeds Abeba',\n # u'Neanthopolis',\n # u'\\u018fddis-\\u018fb\\u0259b\\u0259',\n # u'\\u0391\\u03bd\\u03c4\\u03af\\u03c2 \\u0391\\u03bc\\u03c0\\u03ad\\u03bc\\u03c0\\u03b1',\n # u'\\u0410\\u0434\\u0434\\u0438\\u0441-\\u0410\\u0431\\u0435\\u0431\\xe6',\n # u'\\u0410\\u0434\\u0434\\u0438\\u0441-\\u0410\\u0431\\u0435\\u0431\\u0430',\n # u'\\u0410\\u0434\\u0438\\u0441 \\u0410\\u0431\\u0435\\u0431\\u0430',\n # u'\\u0410\\u0434\\u044b\\u0441-\\u0410\\u0431\\u044d\\u0431\\u0430',\n # u'\\u0413\\u043e\\u0440\\u0430\\u0434 \\u0410\\u0434\\u044b\\u0441-\\u0410\\u0431\\u0435\\u0431\\u0430',\n # u'\\u0531\\u0564\\u056b\\u057d \\u0531\\u0562\\u0565\\u0562\\u0561',\n # u'\\u05d0\\u05d3\\u05d9\\u05e1 \\u05d0\\u05d1\\u05d0\\u05d1\\u05d0',\n # u'\\u05d0\\u05d3\\u05d9\\u05e1 \\u05d0\\u05d1\\u05d1\\u05d4',\n # u'\\u0622\\u062f\\u06cc\\u0633 \\u0622\\u0628\\u0627\\u0628\\u0627',\n # u'\\u0623\\u062f\\u064a\\u0633 \\u0623\\u0628\\u0627\\u0628\\u0627',\n # u'\\u0626\\u0627\\u062f\\u06cc\\u0633 \\u0626\\u0627\\u0628\\u0627\\u0628\\u0627',\n # u'\\u0627\\u062f\\u064a\\u0633 \\u0627\\u0628\\u0627\\u0628\\u0627',\n # u'\\u0627\\u062f\\u06cc\\u0633 \\u0627\\u0628\\u0627\\u0628\\u0627',\n # u'\\u0905\\u0926\\u093f\\u0938 \\u0905\\u092c\\u093e\\u092c\\u093e',\n # u'\\u0905\\u0926\\u0940\\u0938 \\u0905\\u092c\\u093e\\u092c\\u093e',\n # u'\\u0986\\u09a6\\u09cd\\u09a6\\u09bf\\u09b8 \\u0986\\u09ac\\u09be\\u09ac\\u09be',\n # u'\\u0a06\\u0a26\\u0a3f\\u0a38 \\u0a06\\u0a2c\\u0a2c\\u0a3e',\n # u'\\u0b85\\u0b9f\\u0bbf\\u0bb8\\u0bcd \\u0b85\\u0baa\\u0bbe\\u0baa\\u0bbe',\n # u'\\u0c05\\u0c26\\u0c4d\\u0c26\\u0c3f\\u0c38\\u0c4d \\u0c05\\u0c2c\\u0c3e\\u0c2c\\u0c3e',\n # u'\\u0c85\\u0ca1\\u0cbf\\u0cb8\\u0ccd \\u0c85\\u0cac\\u0cbe\\u0cac',\n # u'\\u0d05\\u0d21\\u0d3f\\u0d38\\u0d4d \\u0d05\\u0d2c\\u0d46\\u0d2c',\n # u'\\u0e41\\u0e2d\\u0e14\\u0e14\\u0e34\\u0e2a\\u0e2d\\u0e32\\u0e1a\\u0e32\\u0e1a\\u0e32',\n # u'\\u0f68\\u0f0b\\u0f4c\\u0f72\\u0f0b\\u0f66\\u0f72\\u0f0b\\u0f68\\u0f0b\\u0f56\\u0f0b\\u0f56\\u0f0d',\n # u'\\u1021\\u102c\\u1012\\u1005\\u103a \\u1021\\u102c\\u1018\\u102c\\u1018\\u102c\\u1019\\u103c\\u102d\\u102f\\u1037',\n # u'\\u10d0\\u10d3\\u10d8\\u10e1-\\u10d0\\u10d1\\u10d4\\u10d1\\u10d0',\n # u'\\u12a0\\u12f2\\u1235 \\u12a0\\u1260\\u1263',\n # u'\\u30a2\\u30c7\\u30a3\\u30b9\\u30a2\\u30d9\\u30d0',\n # u'\\u4e9a\\u7684\\u65af\\u4e9a\\u8d1d\\u5df4',\n # u'\\u963f\\u8fea\\u65af\\u963f\\u8c9d\\u5df4',\n # u'\\uc544\\ub514\\uc2a4\\uc544\\ubc14\\ubc14']),\n # u'skos:altLabel': set([u'Addis',\n # u'Finifinee',\n # u'\\u0100dd\\u012bs \\u0100beb\\u0101'])\n \n ```\n \n \n \n \n \nKeywords: SPARQL semantic NLP named entity NER\nPlatform: UNKNOWN\nClassifier: Development Status :: 3 - Alpha\nClassifier: Topic :: Utilities\nClassifier: Topic :: Text Processing :: LinguisticLicense :: OSI Approved :: BSD License\nClassifier: Programming Language :: Python :: 2.7\nClassifier: Programming Language :: Python :: 3.6\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Valerie-Hanoka/PyNeQL", "keywords": "", "license": "BSD 2-Clause License", "maintainer": "", "maintainer_email": "", "name": "pyneql", "package_url": "https://pypi.org/project/pyneql/", "platform": "", "project_url": "https://pypi.org/project/pyneql/", "project_urls": { "Homepage": "https://github.com/Valerie-Hanoka/PyNeQL" }, "release_url": "https://pypi.org/project/pyneql/0.1.0/", "requires_dist": [ "nose (>=1.3.7)", "python-coveralls (>=2.9.1)", "six (>=1.11.0)", "aenum (>=2.1.2)", "requests (>=2.18.4)", "fuzzywuzzy (>=0.16.0)", "python-dateutil (>=2.7.2)", "future" ], "requires_python": "", "summary": "A SPARQL wrapper to query named entities in the semantic web", "version": "0.1.0" }, "last_serial": 3888350, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "6cfa7caf928d572fe4ecaa49cdb299c7", "sha256": "8887056e6ee44c95ee9bc5ceea2f2fe91d4cb78cae852b40aaaa784de5e8336f" }, "downloads": -1, "filename": "pyneql-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6cfa7caf928d572fe4ecaa49cdb299c7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 109306, "upload_time": "2018-05-22T16:17:15", "url": "https://files.pythonhosted.org/packages/34/86/f6ae3d8442ebf4e6d0e7bce1599b63d71461af07dc50161756848a599e54/pyneql-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d07abd77ae2a7f3d9ebe751d55260c1a", "sha256": "6dd21bb0d0b1f937a7ab2353b00cf5ec51bca59679ac04942daf92182a422ace" }, "downloads": -1, "filename": "pyneql-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d07abd77ae2a7f3d9ebe751d55260c1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 102256, "upload_time": "2018-05-22T16:17:16", "url": "https://files.pythonhosted.org/packages/04/3f/d3f04cb0c5001b82cebaeb6a66424db9bb9a0dfdbe67b3d252dffb75f27f/pyneql-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6cfa7caf928d572fe4ecaa49cdb299c7", "sha256": "8887056e6ee44c95ee9bc5ceea2f2fe91d4cb78cae852b40aaaa784de5e8336f" }, "downloads": -1, "filename": "pyneql-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6cfa7caf928d572fe4ecaa49cdb299c7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 109306, "upload_time": "2018-05-22T16:17:15", "url": "https://files.pythonhosted.org/packages/34/86/f6ae3d8442ebf4e6d0e7bce1599b63d71461af07dc50161756848a599e54/pyneql-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d07abd77ae2a7f3d9ebe751d55260c1a", "sha256": "6dd21bb0d0b1f937a7ab2353b00cf5ec51bca59679ac04942daf92182a422ace" }, "downloads": -1, "filename": "pyneql-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d07abd77ae2a7f3d9ebe751d55260c1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 102256, "upload_time": "2018-05-22T16:17:16", "url": "https://files.pythonhosted.org/packages/04/3f/d3f04cb0c5001b82cebaeb6a66424db9bb9a0dfdbe67b3d252dffb75f27f/pyneql-0.1.0.tar.gz" } ] }