{ "info": { "author": "Panos Mitzias", "author_email": "pmitzias@gmail.com", "bugtrack_url": null, "classifiers": [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "# PyLOD\r\nPyLOD is a Python wrapper for exposing Linked Open Data from public SPARQL-served endpoints. It acts as an abstraction layer for the retrieval of structured data, such as classes, properties and individuals, without requiring any knowledge of SPARQL.\r\n\r\n## Getting Started\r\nPyLOD is a minimal module for Python (2.x. and 3.x).\r\n\r\n### Prerequisites\r\n\r\n[SPARQLWrapper](https://rdflib.github.io/sparqlwrapper/) - SPARQLWrapper is a simple Python wrapper around a SPARQL service to remotelly execute queries.\r\n\r\n### Installation\r\n\r\n* #### Manually\r\n\r\n 1. Install [SPARQLWrapper](https://github.com/RDFLib/sparqlwrapper).\r\n 2. Save `PyLOD.py` to your project's directory.\r\n\r\n* #### From PyPi\r\n\r\n ```\r\n pip install PyLOD\r\n ```\r\n\r\n## Usage\r\n**1. Import the PyLOD class and create a PyLOD class object.**\r\n```python\r\nfrom PyLOD import PyLOD\r\npylod = PyLOD()\r\n```\r\n\r\n**2. Provide a dictionary of desired namespaces**\r\n```python\r\nmy_namespaces={\r\n \"dbo\": \"http://dbpedia.org/ontology/\",\r\n \"dbp\": \"http://dbpedia.org/property/\"\r\n}\r\n\r\npylod.namespaces.set_namespaces(my_namespaces)\r\n```\r\n This step is optional, since PyLOD already incorporates a set of known namespaces. To get the list of defined namespaces, use this:\r\n\r\n ```python\r\nprint(pylod.namespaces.get_namespaces())\r\n```\r\n\r\n**3. Define a dictionary of SPARQL endpoints to be queried:**\r\n```python\r\nmy_endpoints={\r\n \"DBpedia\": \"http://dbpedia.org/sparql\",\r\n \"GeoLinkedData\": \"http://linkedgeodata.org/sparql\"\r\n}\r\n\r\npylod.endpoints.set_endpoints(my_endpoints)\r\n```\r\n If no endpoints are defined, PyLOD will use a pre-defined set of known endpoints. To get the list of these endpoints, do this:\r\n\r\n ```python\r\nprint(pylod.endpoints.get_endpoints())\r\n```\r\n\r\n**4. Use PyLOD's `expose` functions to retrieve structured data from the endpoints.**\r\nSet the optional argument `limit_per_endpoint` to limit the results per endpoint. For example:\r\n```python\r\n# Get entities of type owl:Class\r\nclasses = pylod.expose.classes(limit_per_endpoint=100)\r\n\r\n# Get the sub-classes of a specific class \r\nsub_classes = pylod.expose.sub_classes(super_class=\"dbo:Artist\")\r\n\r\n# Get instances of a specific class \r\ninstances = pylod.expose.instances_of_class(cls=\"dbo:Artist\", include_subclasses=True, limit_per_endpoint=50)\r\n\r\n# Execute custom SPARQL select query to all endpoints\r\nresults = pylod.sparql.execute_select_to_all_endpoints(query=\"SELECT * WHERE {?s ?p ?o}\")\r\n```\r\n\r\n### Expose functions:\r\n* __classes()__ - Returns class entities\r\n* __sub_classes()__ - Returns the sub-classes of a given class \r\n* __super_classes()__ - Returns the super-classes of a given class \r\n* __equivalent_classes()__ - Returns the equivalent classes of a given class \r\n* __disjoint_classes()__ - Returns the disjoint classes of a given class \r\n* __sub_properties()__ - Returns the sub-properties of a given property \r\n* __super_properties()__ - Returns the super-properties of a given property \r\n* __triples()__ - Allows the retrieval of triples within the pattern (subject-predicate-object)\r\n* __subjects()__ - Returns the subjects of a given predicate-object pair \r\n* __predicates()__ - Returns the predicates of a given subject-object pair\r\n* __objects()__ - Returns the objects of a given subject-predicate pair\r\n* __instances_of_class()__ - Returns instances of a given class type\r\n* __labels()__ - Returns labels of a given entity, with an optional language argument\r\n\r\n### SPARQL functions:\r\n* __execute_select()__ - Allows the execution of a custom SPARQL select query to a given endpoint URL\r\n* __execute_select_to_all_endpoints()__ - Allows the execution of a custom SPARQL select query to all endpoints defined in `pylod.endpoints.get_endpoints()`\r\n* __is_active_endpoint()__ - Checks if a given endpoint URL is alive and responds to SPARQL queries\r\n\r\n## Documentation\r\n[The official webpage](http://pmitzias.com/PyLOD) - [The Docs](http://pmitzias.com/PyLOD/docs.html)\r\n\r\n## Authors\r\n* [Panos Mitzias](http://pmitzias.com) - Design and development\r\n* [Stratos Kontopoulos](http://stratoskontopoulos.com) - Contribution to the design\r\n\r\n## Powered by\r\n* [Centre for Research & Technology Hellas - CERTH](https://www.certh.gr/root.en.aspx)\r\n* [Multimedia Knowledge & Social Media Analytics Laboratory - MKLab](http://mklab.iti.gr/)\r\n\r\n## Applications\r\nPyLOD has been deployed in the following projects:\r\n\r\n* [PERICLES](http://project-pericles.eu/)\r\n* [ROBORDER](http://roborder.eu/)\r\n* [TENSOR](https://tensor-project.eu/)\r\n* [SUITCEYES](http://suitceyes.eu/)\r\n\r\n\r\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/panmitz/PyLOD", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "PyLOD", "package_url": "https://pypi.org/project/PyLOD/", "platform": "", "project_url": "https://pypi.org/project/PyLOD/", "project_urls": { "Homepage": "https://github.com/panmitz/PyLOD" }, "release_url": "https://pypi.org/project/PyLOD/0.1.12/", "requires_dist": [ "sparqlwrapper" ], "requires_python": "", "summary": "PyLOD is a Python wrapper for exposing Linked Open Data from public SPARQL-served endpoints.", "version": "0.1.12" }, "last_serial": 4085567, "releases": { "0.1.10": [ { "comment_text": "", "digests": { "md5": "256cb752131f70c2e377745ba99f5100", "sha256": "b56c1e7e5e8210dd57b9bb17cb1eb2c388c7416ae8ab0f106a2ff2f12d95a168" }, "downloads": -1, "filename": "PyLOD-0.1.10-py2-none-any.whl", "has_sig": false, "md5_digest": "256cb752131f70c2e377745ba99f5100", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7798, "upload_time": "2018-06-27T13:35:10", "url": "https://files.pythonhosted.org/packages/9d/ed/634747945a1991e367e3a99ba952d45f8d0f9574f6c74416a1e6bcde7f0f/PyLOD-0.1.10-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1ff7aa4777092c570adead2f9e70c412", "sha256": "ded0fc132f805457e3308191733d8c1cec40dfb8b8c550c80c17e3e01e5afd49" }, "downloads": -1, "filename": "PyLOD-0.1.10.tar.gz", "has_sig": false, "md5_digest": "1ff7aa4777092c570adead2f9e70c412", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9122, "upload_time": "2018-06-27T13:35:11", "url": "https://files.pythonhosted.org/packages/6b/d5/281b0e5dbcbd87372b2345c71f1f4664a42aa40bc4b5993152a4a351bb91/PyLOD-0.1.10.tar.gz" } ], "0.1.11": [ { "comment_text": "", "digests": { "md5": "c1e0c25c6009f21de6944273b1595d9d", "sha256": "3a7e01333c1aafe0d080dccb4f5a67b490dea34664e90dfa2a7621bb17915841" }, "downloads": -1, "filename": "PyLOD-0.1.11-py2-none-any.whl", "has_sig": false, "md5_digest": "c1e0c25c6009f21de6944273b1595d9d", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7970, "upload_time": "2018-07-02T13:41:14", "url": "https://files.pythonhosted.org/packages/e1/24/768533c86e60dbb68c980d7a905c7dcea0ed4f4b8bae14a96d58dc106467/PyLOD-0.1.11-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5240812b44815c98bee4c79b79789cf5", "sha256": "e34bcc303a940a41e7d6d58390634f7aef94e74ade57e1285d0d5adae6f99cea" }, "downloads": -1, "filename": "PyLOD-0.1.11.tar.gz", "has_sig": false, "md5_digest": "5240812b44815c98bee4c79b79789cf5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9320, "upload_time": "2018-07-02T13:41:15", "url": "https://files.pythonhosted.org/packages/e8/50/abba0673869239ac4a24510beb512c5d9acf53dbf0b0667c2c74a4bc00b1/PyLOD-0.1.11.tar.gz" } ], "0.1.12": [ { "comment_text": "", "digests": { "md5": "15a1b7759963c5cf4bdbff4e66a1717c", "sha256": "6081d1518400752c77d59ff865b74fc04db9410f3b77bc87eead647744eccd14" }, "downloads": -1, "filename": "PyLOD-0.1.12-py2-none-any.whl", "has_sig": false, "md5_digest": "15a1b7759963c5cf4bdbff4e66a1717c", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7973, "upload_time": "2018-07-20T12:13:42", "url": "https://files.pythonhosted.org/packages/cb/e9/2a4ecf3934a469fbd70c63cbb5f8ada24b2a1d254af9087e7e621f287aa3/PyLOD-0.1.12-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5a8269bca9c2e158b82395fd8549771b", "sha256": "7096f0868557d19d97407b4e9d6d5ca2d8fee7d08a85013ddc6ce9f0b9fa580f" }, "downloads": -1, "filename": "PyLOD-0.1.12.tar.gz", "has_sig": false, "md5_digest": "5a8269bca9c2e158b82395fd8549771b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9330, "upload_time": "2018-07-20T12:13:43", "url": "https://files.pythonhosted.org/packages/81/50/a40af39abe4c556b24207a0f978bc1ea2fbf77e9a61ace0565e359ca5416/PyLOD-0.1.12.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "15a1b7759963c5cf4bdbff4e66a1717c", "sha256": "6081d1518400752c77d59ff865b74fc04db9410f3b77bc87eead647744eccd14" }, "downloads": -1, "filename": "PyLOD-0.1.12-py2-none-any.whl", "has_sig": false, "md5_digest": "15a1b7759963c5cf4bdbff4e66a1717c", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7973, "upload_time": "2018-07-20T12:13:42", "url": "https://files.pythonhosted.org/packages/cb/e9/2a4ecf3934a469fbd70c63cbb5f8ada24b2a1d254af9087e7e621f287aa3/PyLOD-0.1.12-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5a8269bca9c2e158b82395fd8549771b", "sha256": "7096f0868557d19d97407b4e9d6d5ca2d8fee7d08a85013ddc6ce9f0b9fa580f" }, "downloads": -1, "filename": "PyLOD-0.1.12.tar.gz", "has_sig": false, "md5_digest": "5a8269bca9c2e158b82395fd8549771b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9330, "upload_time": "2018-07-20T12:13:43", "url": "https://files.pythonhosted.org/packages/81/50/a40af39abe4c556b24207a0f978bc1ea2fbf77e9a61ace0565e359ca5416/PyLOD-0.1.12.tar.gz" } ] }