{ "info": { "author": "Renato Fabbri", "author_email": "renato.fabbri@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Other Audience", "Intended Audience :: Science/Research", "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Artistic Software", "Topic :: Other/Nonlisted Topic", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Physics", "Topic :: Scientific/Engineering :: Visualization", "Topic :: System :: Networking", "Topic :: Text Processing", "Topic :: Text Processing :: Linguistic" ], "description": "# losd\na very simple python package for SPARQL querying the LOSD (linked open social data) dataset.\n\n### install with\n $ pip install losd\n\nor\n\n $ python setup.py losd\n\nFor greater control of customization, hacking and debugging, clone the repository and install with pip using -e:\n\n $ git clone https://github.com/ttm/losd.git\n $ pip3 install -e \n\n# usage\n\nQueries have the heading:\n```\nPREFIX po: \n```\n\nExamples of usage:\n\n```python\nimport losd as l\npl = l.plainQueryValues\nq = l.query\n\n# get all snapshots:\nquery = '''\nSELECT ?s WHERE {\n ?s a po:Snapshot\n}\n'''\n\nres = pl(q(query))\n\n##########\n# from here on, check to assure that the uris correspond to\n# the snapshot (types) intended\n\n# get all friendship relations in a facebook snapshot:\nuri = res[99]\nquery = '''\nSELECT ?a1 ?a2 WHERE {\n?f a po:Friendship . ?f po:snapshot <%s> .\n?f po:member ?a1, ?a2 .\nFILTER(?a1 != ?a2)\n}\n''' % (uri,)\nres2 = pl(q(query))\n\n\n# get all retweet interactions in a Twitter snapshot:\nuri = res[-1]\nquery = '''\nSELECT ?a1 ?a2 WHERE {\n?m1 po:retweetOf ?m2 . ?m1 po:author ?a1 . ?m2 po:author ?a2 .\n?m1 po:snapshot <%s>\n}\n''' % (uri,)\nres3 = pl(q(query))\n\n# get all interactions in a email snapshot:\nuri = res[48]\nquery = '''\nSELECT ?from ?to WHERE {\n?message1 po:snapshot <%s> . ?message2 po:replyTo ?message1 .\n?message1 po:author ?from . ?message2 po:author ?to .\n}\n''' % (uri,)\nres4 = pl(q(query))\n\n# get all interactions in a IRC snapshot, with texts:\nuri = res[102]\nquery = '''\nSELECT ?a1 ?a2 ?t WHERE {\n?m a po:IRCMessage . ?m po:author ?a1 . ?m po:directedTo ?a2 .\n?m po:cleanText ?t . ?m po:snapshot <%s>\n}\n''' % (uri,)\nres5 = pl(q(query))\n\n# get all interactions in the AA snapshot:\nquery = '''\nSELECT ?a1 ?a2 WHERE {\n?s po:author ?a1 . ?s po:checkParticipant ?a2 .\n}\n'''\nres6 = pl(q(query))\n\n\n# get all friendshipts in the Participa.BR snapshot:\nuri = res[104]\nquery = '''\nSELECT ?a1 ?a2 WHERE {\n?f a po:Friendship . ?f po:snapshot <%s> .\n?f po:member ?a1, ?a2 .\nFILTER(?a1 != ?a2)\n}\n''' % (uri,)\nres7 = pl(q(query))\n\n# get all interactions in the Participa.BR snapshot:\nuri = res[104]\nquery = '''\nSELECT ?a1 ?a2 WHERE {\n?a po:snapshot <%s> . ?a a po:Article .\n?a po:author ?a1 . ?c po:article ?a . ?c po:author ?a2 .\n}\n''' % (uri,)\nres8 = pl(q(query))\n\n# get all interaction in the Cidade Democr\u00e1tica snapshot:\nuri = res[45]\nquery = '''\nSELECT ?a1 ?a2 WHERE {\n?t po:snapshot <%s> . ?t a po:Topic . ?t po:author ?a1 .\n?c a po:Comment . ?c po:topic ?t . ?c po:author ?a2 .\n}\n''' % (uri,)\nres9 = pl(q(query))\n\n\ninteraction = [\n res3,\n res4,\n res5,\n res6,\n res8,\n res9\n]\nfriendship = [\n res2,\n res7,\n]\n\nfr = []\nfor relations in friendship:\n fr.append(l.mkRelationNetwork(relations))\n\ninte = []\nfor interactions in interaction:\n inte.append(l.mkInteractionNetwork(interactions))\n\n# finished. Play with the networks in fr and inte\n# maybe use networkx and pylab to plat them\n\n# :::\n```\n\n### deployment to pypi\nThis package \u0456s delivered by running:\n $ python3 setup.py sdist\n $ twine upload dist/\n\nMaybe use \"python setup.py sdist upload -r pypi\" ?\n\n### Further information\nFurther information should be found in the LOSD article repository:\n\n### Better usage\nPlease consider registration into Data.World to use LOSd in accordance with their policy and facilitating assistance by their staff.\nTake a look at [their own python package](https://pypi.org/project/datadotworld/).\n\n### Contact\nAny issues, questions or ideas should be sent to:\n\nrenato (dot) fabbri [AT] gmail {DOT} com\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/ttm/losd", "keywords": "physics,complex networks,social networks,text,language,linked data", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "losd", "package_url": "https://pypi.org/project/losd/", "platform": "", "project_url": "https://pypi.org/project/losd/", "project_urls": { "Homepage": "https://github.com/ttm/losd" }, "release_url": "https://pypi.org/project/losd/0.2b0/", "requires_dist": null, "requires_python": "", "summary": "losd is (currently) a very simple python package for querying the LOSD (linked open social data) dataset", "version": "0.2b0" }, "last_serial": 5474583, "releases": { "0.1b0": [ { "comment_text": "", "digests": { "md5": "c988746458bfb33221021bd863d3b864", "sha256": "46f70e301ecfe4152ea5f5b560ac0ace4317df2359f0b68bfc1368ed38be086a" }, "downloads": -1, "filename": "losd-0.1b0.tar.gz", "has_sig": false, "md5_digest": "c988746458bfb33221021bd863d3b864", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5755, "upload_time": "2019-07-02T02:05:08", "url": "https://files.pythonhosted.org/packages/18/8b/fa9cd9a28fdd845f56e51ea6ebe03ddc2f5d5810e1c8a685fc934f151936/losd-0.1b0.tar.gz" } ], "0.2b0": [ { "comment_text": "", "digests": { "md5": "79566691c2ff787de374ea205017176e", "sha256": "fd43ea8a6ac56ea5b5bd6cfe2ba276e428440f4cd13281fbbc0fb52b027507a9" }, "downloads": -1, "filename": "losd-0.2b0.tar.gz", "has_sig": false, "md5_digest": "79566691c2ff787de374ea205017176e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5770, "upload_time": "2019-07-02T02:06:28", "url": "https://files.pythonhosted.org/packages/76/1e/0798b319a37d22eff22ef9636956d4a3913cfc51481cc019eb5f0be3c6d3/losd-0.2b0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "79566691c2ff787de374ea205017176e", "sha256": "fd43ea8a6ac56ea5b5bd6cfe2ba276e428440f4cd13281fbbc0fb52b027507a9" }, "downloads": -1, "filename": "losd-0.2b0.tar.gz", "has_sig": false, "md5_digest": "79566691c2ff787de374ea205017176e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5770, "upload_time": "2019-07-02T02:06:28", "url": "https://files.pythonhosted.org/packages/76/1e/0798b319a37d22eff22ef9636956d4a3913cfc51481cc019eb5f0be3c6d3/losd-0.2b0.tar.gz" } ] }