{ "info": { "author": "Aisha Mohamed", "author_email": "ahmohamed@qf.org.qa", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3.5" ], "description": "# RDF2SRL\n\nThis package exposes RDF data from sparql database engines for relational \nlearning models.\n\nIt provides some convenience functions that send sparql queries in http \nrequests for both public and private sparql endpoints. \n\nStarting from version 1.0.3, a ```SmartRDFGraphDataset``` class is added that performs\nclient-side optimization of the Sparql query processing. This improves the performance \nif the configuration of the public endpoint isn't tuned for a specific query.\n\n## Installation\nYou cna install the requirements using \n```\npip install -r requiremtns.txt\n```\nYou can install the RDF2SRL package from PyPI:\n```\npip install RDF2SRL\n```\n\n## Getting Started\n### Collecting Statistics about the data\nWe can use this package to get some statistics about the DBpedia dataset.\nLet's use the [DBpedia public endpoint](http://dbpedia.org/sparql) provided \nby [OpenLink Virtuoso](http://dbpedia.org/page/Virtuoso_Universal_Server)\n\nFirst, import the ```RDFGraphDataset``` class from the python package ```rdf2srl```\nand initialize the ```RDFGraphDataset``` class with the endpoint URI and the graph URI\n\n```python\nfrom rdf2srl import RDFGraphDataset\nloader = RDFGraphDataset(sparql_endpoint=\"http://dbpedia.org/sparql\", graph_name='http://dbpedia.org/')\n```\nNow, Let's find the number of (subject, predicate, object) triples in the DBpedia graph:\n```python\nnum_triples = loader.num_triples()\n```\nTo find the number of (subject, predicate, object) triples where the object is another entity,\nfind the number of entity to entity triples.\n```python\nnum_e2e_triples = loader.num_entity2entity_triples()\n```\nTo find the number of (subject, predicate, object) triples where the object is a literal value,\nfind the number of entity to entity triples.\n```python\nnum_e2l_triples = loader.num_entity2literal_triples()\n```\n### Loading the dataset into a dataframe\n\nWe can also use the package to access the entities in the graph. A useful format for\nrelational learning models is a dictionary that maps each entity to an index that starts\nfrom 0 to n_entities-1. Other available formats are pandas dataframes and python lists.\n```python\nentity2idx = loader.entities('dict')\n```\nSimilarly, we can get all the entity-to-entity predicates in the graph. A useful format for\nrelational learning models is a dictionary that maps each predicate to an index that starts\nfrom 0 to n_relations-1. Other available formats are pandas dataframes and python lists.\n```python\nrelation2idx = loader.relations('dict')\n```\nNow, we can get the triples in the dataset in a dataframe of three columns: [subject, object, predicate]\nwhere the values inside the tuples represent the indices in ```entity2idx``` and ```relation2idx```.\nThe other available format is python list.\nThe dataframe can be saved in ```csv``` file if output_dir is passed.\n```python\ntriples = loader.triples('list')\n```\n\n## list of the convenience functions available:\n```python\nRDFGraphDataset.num_entities() \nRDFGraphDataset.num_predicates() \nRDFGraphDataset.num_relations() \nRDFGraphDataset.num_attributes() \nRDFGraphDataset.num_attr_literal_pairs() \nRDFGraphDataset.num_triples() \nRDFGraphDataset.num_entity2literal_triples() \nRDFGraphDataset.num_entity2entity_triples() \nRDFGraphDataset.num_rdf_type_triples() \nRDFGraphDataset.predicates(format) # where format is one of ['dict', 'df', 'list'] \nRDFGraphDataset.relations(format) # where format is one of ['dict', 'df', 'list'] \nRDFGraphDataset.attributes(format) # where format is one of ['dict', 'df', 'list'] \nRDFGraphDataset.entities(format) # where format is one of ['dict', 'df', 'list'] \nRDFGraphDataset.attr_literal_pairs() \nRDFGraphDataset.triples(format) # where format is one of ['df', 'list'] \nRDFGraphDataset.entity2entity_triples(format) # where format is one of ['df', 'list'] \nRDFGraphDataset.entity2literal_triples(format) # where format is one of ['df', 'list'] \nRDFGraphDataset.subjects(predicate) \nRDFGraphDataset.objects(predicate) \nRDFGraphDataset.predicates_freq()\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/aishahasmoh/RDF2SRL", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "rdf2srl", "package_url": "https://pypi.org/project/rdf2srl/", "platform": "", "project_url": "https://pypi.org/project/rdf2srl/", "project_urls": { "Homepage": "https://github.com/aishahasmoh/RDF2SRL" }, "release_url": "https://pypi.org/project/rdf2srl/1.0.11/", "requires_dist": [ "SPARQLWrapper", "pandas" ], "requires_python": "", "summary": "Exposes RDF datasets from sparql endpoints for relational learning models in convenient formats", "version": "1.0.11" }, "last_serial": 5171741, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "9cf441d17bc378ff3ebe34f95c84f341", "sha256": "cae3a7c09932f32bbcdbf43a48239395329236f7991e5587286a47989e02f7c2" }, "downloads": -1, "filename": "rdf2srl-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9cf441d17bc378ff3ebe34f95c84f341", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6877, "upload_time": "2019-01-13T07:26:56", "url": "https://files.pythonhosted.org/packages/0d/96/8da45c8fdd718bd4b892ef6d68eb729a13978198798050646578177602e5/rdf2srl-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ff227c1c533c536b212ea10d6d85176c", "sha256": "3259932c826bf0f070b523df7afa255e4e19bb1a761c19125f6b46bf227ec31d" }, "downloads": -1, "filename": "rdf2srl-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ff227c1c533c536b212ea10d6d85176c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6856, "upload_time": "2019-01-13T07:26:58", "url": "https://files.pythonhosted.org/packages/4c/ec/feccbf4158b7f411f5c207957febfcb660204c23d1b7708a1ee21a0fdb81/rdf2srl-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "6412b768883e73b917ff29d541115522", "sha256": "a7ed68415699bf5feb8d7bb4ac601b63598d15b859c26e0c480f39f248a7bb7a" }, "downloads": -1, "filename": "rdf2srl-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6412b768883e73b917ff29d541115522", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8494, "upload_time": "2019-01-21T06:36:42", "url": "https://files.pythonhosted.org/packages/18/12/14fc974bc6605c2edd11bbc8e9d08cb74bbd936c447ee1a554e4f7023ae9/rdf2srl-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "26c28395965ef01d293ae12db3e63e3d", "sha256": "320cfde5999dc6d2b4d139a603db7b6be622bfc08cb8493c133999aa34c14034" }, "downloads": -1, "filename": "rdf2srl-1.0.1.tar.gz", "has_sig": false, "md5_digest": "26c28395965ef01d293ae12db3e63e3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7625, "upload_time": "2019-01-21T06:36:43", "url": "https://files.pythonhosted.org/packages/b8/00/3dd6242cbdfdaa9e0e8d521b2a83eba6ef064f0403a4ae853171fcae8eba/rdf2srl-1.0.1.tar.gz" } ], "1.0.10": [ { "comment_text": "", "digests": { "md5": "0aff9aafd6b8500e5ee61fad5bbce5da", "sha256": "381da5a7826aa279efa000e586f212e48b4ca75c0d40b0f8f9fc16eadcacdaa4" }, "downloads": -1, "filename": "rdf2srl-1.0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "0aff9aafd6b8500e5ee61fad5bbce5da", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12804, "upload_time": "2019-04-21T11:35:22", "url": "https://files.pythonhosted.org/packages/30/f1/8d85dceb097375c753dcce44ceef7c5d82de3b53bd541101bb995a300337/rdf2srl-1.0.10-py3-none-any.whl" } ], "1.0.11": [ { "comment_text": "", "digests": { "md5": "b9e562ab868a5a0c82e1087d86d3f984", "sha256": "a56497642245da696d6256e8cc1156d1276a786c85e95f4ce5bfbc2e2edcd035" }, "downloads": -1, "filename": "rdf2srl-1.0.11-py3-none-any.whl", "has_sig": false, "md5_digest": "b9e562ab868a5a0c82e1087d86d3f984", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13008, "upload_time": "2019-04-22T06:51:22", "url": "https://files.pythonhosted.org/packages/ab/12/311f1754dd105ef9896c63addd62f95d1d474d30a48233b33badd927165f/rdf2srl-1.0.11-py3-none-any.whl" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "1331c1be5d76b02dd1d948271f2f5b0b", "sha256": "00fada721b1556fb126b440fe7fed3e5af8ecb38e79cd0b90ec60d54a0c10dfa" }, "downloads": -1, "filename": "rdf2srl-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "1331c1be5d76b02dd1d948271f2f5b0b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8517, "upload_time": "2019-01-21T07:16:29", "url": "https://files.pythonhosted.org/packages/ca/ff/da39634f24a6075fbb367907bbe54ac7c83f72a893f248e8ca5e265f05ad/rdf2srl-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0cd2a7b88b7c0aea76c32a909f4ea128", "sha256": "32736e2df3d93daf925051822084116c126bd92dad22d01888be5d8830147ce8" }, "downloads": -1, "filename": "rdf2srl-1.0.2.tar.gz", "has_sig": false, "md5_digest": "0cd2a7b88b7c0aea76c32a909f4ea128", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7736, "upload_time": "2019-01-21T07:16:30", "url": "https://files.pythonhosted.org/packages/fc/36/45697c835d789cc407270467fc152c4f0d60ded821f40fd8346656b3a333/rdf2srl-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "9ae61df172e2178468ad1af877771aad", "sha256": "f16a220a6a7c2709f73b98b1e69d98baa6fa6ec3b9528dde3d8fc11b5466e0a4" }, "downloads": -1, "filename": "rdf2srl-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "9ae61df172e2178468ad1af877771aad", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8524, "upload_time": "2019-01-21T07:48:36", "url": "https://files.pythonhosted.org/packages/50/fe/5e57b24ba4f270389f740ec6e1b0ed6ec087dcc75cbe174d74f128ce6c71/rdf2srl-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fbd02f28a0324f77381462f4a09d8f81", "sha256": "becd523db2a07923edba86092f793a64bf9c9f0b71fc08ab1bba0ede4fa0fed1" }, "downloads": -1, "filename": "rdf2srl-1.0.3.tar.gz", "has_sig": false, "md5_digest": "fbd02f28a0324f77381462f4a09d8f81", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7760, "upload_time": "2019-01-21T07:48:38", "url": "https://files.pythonhosted.org/packages/11/44/59efea345b7642bfdcc245dc25737a9932b51f059badb069628c06f37bb8/rdf2srl-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "383e5b20cca5bb9e77245378665a65f3", "sha256": "c74843ccae1a688ac5bdc7278f46444210bd9710f86ca0c54d02d43ec2920671" }, "downloads": -1, "filename": "rdf2srl-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "383e5b20cca5bb9e77245378665a65f3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9106, "upload_time": "2019-02-25T10:55:06", "url": "https://files.pythonhosted.org/packages/b9/c8/dcbbc23e9feae2c8346a128517eafa9e0e5ec67e0eea294d2352739a833a/rdf2srl-1.0.4-py3-none-any.whl" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "4ef4d4a98b9a0e6a4bdd0f8142f63cc4", "sha256": "75622fa3432580f4286c6105a594ebdd1e89e6441c40c8dc5f4356114b1dfd4e" }, "downloads": -1, "filename": "rdf2srl-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "4ef4d4a98b9a0e6a4bdd0f8142f63cc4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9137, "upload_time": "2019-02-26T11:13:45", "url": "https://files.pythonhosted.org/packages/cd/8c/5650753e46a0c55397a569afe57d12ebbe8da1c8d05b658e571fd1fd881c/rdf2srl-1.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "65e7ff5ffd5ee6c8ae349f5b650eb616", "sha256": "7aa83c992595836199a3747884c38b0d4586fe2a15462ea554a19de21c97dc5d" }, "downloads": -1, "filename": "rdf2srl-1.0.5.tar.gz", "has_sig": false, "md5_digest": "65e7ff5ffd5ee6c8ae349f5b650eb616", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8572, "upload_time": "2019-02-26T11:13:47", "url": "https://files.pythonhosted.org/packages/23/ae/b6b850ffdafd64dbc75e1e4404a3b5eb97aaaab418184a31ba6098cd97c1/rdf2srl-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "606659cc6b37252b2efb445760e8a2fc", "sha256": "41648db4c021346b5d7b9fc3e30f6ef595122ade7a94f936a3b2c65700a6c0c7" }, "downloads": -1, "filename": "rdf2srl-1.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "606659cc6b37252b2efb445760e8a2fc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9235, "upload_time": "2019-04-02T06:10:35", "url": "https://files.pythonhosted.org/packages/a1/a0/a7284ddc5e2e8e716a880eb9952a669ceae920fbeb8f6cb0d0eb8ed12e4c/rdf2srl-1.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3cfc37333e678947f6774b8657c1e3c1", "sha256": "3c265352380dc606cb16e129b652815f7b93afcf0cb3c20d90d8561bec5a8fc9" }, "downloads": -1, "filename": "rdf2srl-1.0.6.tar.gz", "has_sig": false, "md5_digest": "3cfc37333e678947f6774b8657c1e3c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8666, "upload_time": "2019-04-02T06:10:37", "url": "https://files.pythonhosted.org/packages/b0/39/edbcb4534725942bc824ef6bc7b3b632a1a5fe501e89494496272c5d6bc2/rdf2srl-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "62cd47568f1e2c603961093b715c4b3c", "sha256": "21a24ac12f8c0a62cbcc37d21857cc092f3d1bd7eef9f06ec1786c81179b1bf0" }, "downloads": -1, "filename": "rdf2srl-1.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "62cd47568f1e2c603961093b715c4b3c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9236, "upload_time": "2019-04-02T10:08:29", "url": "https://files.pythonhosted.org/packages/65/ae/176ba3cda364475134ca72d6ded0afdede2b03aab3c4d4c4f40bba3daaa2/rdf2srl-1.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9e4760eb43ef0e85fd6fd3706ffe2c50", "sha256": "74e15c2bc7f753148f94027220b5546337192395dfb6ec19522e33886b879c76" }, "downloads": -1, "filename": "rdf2srl-1.0.7.tar.gz", "has_sig": false, "md5_digest": "9e4760eb43ef0e85fd6fd3706ffe2c50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8663, "upload_time": "2019-04-02T10:08:31", "url": "https://files.pythonhosted.org/packages/e7/a7/d9d611dda44e11302bdfbae9f713d192309673bf923faf947d3bd8203584/rdf2srl-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "0891d938ed3f4e42f6fcf47a6a896400", "sha256": "c79477577d9130bb8f5b742ce55f47693751b9d1a18dd0fcb446e996dd42d975" }, "downloads": -1, "filename": "rdf2srl-1.0.8-py3-none-any.whl", "has_sig": false, "md5_digest": "0891d938ed3f4e42f6fcf47a6a896400", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9239, "upload_time": "2019-04-02T11:50:42", "url": "https://files.pythonhosted.org/packages/d8/e8/77f7afb1b551a9de84afdd73cd9b0292c80a01104d41cc16435f14703d29/rdf2srl-1.0.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4fbcbf619537c8f680761c7138631e6d", "sha256": "aca88465161f4a04b8f97ef862afaa5791f03665d0d7b9ed4fa1e1f74f5fc2fa" }, "downloads": -1, "filename": "rdf2srl-1.0.8.tar.gz", "has_sig": false, "md5_digest": "4fbcbf619537c8f680761c7138631e6d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8654, "upload_time": "2019-04-02T11:50:44", "url": "https://files.pythonhosted.org/packages/f1/1c/5903c6ae999848f6c3cd00674250a48d966770edc42e9eac65ad83764374/rdf2srl-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "d4b847b82437a9123434486ccc75d1e3", "sha256": "aede81c1e65cf065017c5a88be178c805bffa0ddefd750cd4a860f95793126bd" }, "downloads": -1, "filename": "rdf2srl-1.0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "d4b847b82437a9123434486ccc75d1e3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12736, "upload_time": "2019-04-21T10:02:44", "url": "https://files.pythonhosted.org/packages/71/8e/e991b4f7576ee377085f041ef278c35046bf4b0fe2cf0e491cb9cf4d6679/rdf2srl-1.0.9-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b9e562ab868a5a0c82e1087d86d3f984", "sha256": "a56497642245da696d6256e8cc1156d1276a786c85e95f4ce5bfbc2e2edcd035" }, "downloads": -1, "filename": "rdf2srl-1.0.11-py3-none-any.whl", "has_sig": false, "md5_digest": "b9e562ab868a5a0c82e1087d86d3f984", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13008, "upload_time": "2019-04-22T06:51:22", "url": "https://files.pythonhosted.org/packages/ab/12/311f1754dd105ef9896c63addd62f95d1d474d30a48233b33badd927165f/rdf2srl-1.0.11-py3-none-any.whl" } ] }