{ "info": { "author": "Jasper Op de Coul (Infrae)", "author_email": "jasper@infrae.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Sparrow\n=======\n\nIntroduction\n------------\n\nSparrow is a library that provides a high-level API for\nRDF Databases. Any database the provides support for SPARQL Queries and\nhas a triplestore that can handle contexts can be used as a backend.\n\nThe goal of Sparrow is to make sure all these different backends act the same,\nmaking it possible to change RDF Database backends without having to change\nyour code.\n\nAt the moment there is support for the following backends:\n\n * `Redland / librdf`_\n * `RDFLib`_\n * `Sesame / openrdf`_\n * `Allegro Graph`_\n\n.. _Redland / librdf: http://librdf.org\n.. _RDFLib: http://www.rdflib.net\n.. _Sesame / openrdf: http://www.openrdf.org\n.. _Allegro Graph: http://www.franz.com/agraph/\n\nThe API provides support for the following basic functions:\n\n * Parsing RDF statements from different formats into a contextual database\n * Serializing the RDF statements from a specific context of a database\n * Removing statements from a specific context of a database\n * Performing SPARQL Queries\n\nSparrow does not provide a Graph API, but it can parse and serialize python\ndictionary objects. This uses the same format as the JSON serialization.\nEach TripleStore backend provides the following formats:\n \n * RDFXML \n * NTriples\n * Turtle\n * JSON\n * Python dictionaries\n\n\nInstallation\n------------\n\nSparrow comes with buildout profiles for several databases. \nThese profiles will install and setup the different backends for you.\nYou don't have to use buildout, but I would recommend it.\n\nTo install type:\n\n::\n\n > python2.5 bootstrap.py\n > ./bin/buildout\n\nThis will create some scripts in the bin folder like a testrunner and\n(depending on which profile you choose) scripts for configuring and starting\nthe different backends.\n\nUsage\n-----\n\nNormally, you will only need to import the base sparrow module\n\n>>> import sparrow\n\nMost of the database backends will not work out of the box. \nSince the RDFLib backend is written in python and packaged on pypi,\nit is always available, and installed with Sparrow.\n\nLet's create an in memory rdflib database\n\n>>> db = sparrow.database('rdflib', 'memory')\n>>> db\n\n\nLet's add some triples to the database, we will use turtle syntax for this.\nWe'll make some example statements where we will state that john is a person,\nand that his firstname is \"John\".\n\n>>> data = \"\"\"@prefix ex: .\n... ex:john a ex:Person; ex:name \"John\" .\"\"\"\n\nNow we can add this to the database. We will need to tell the database in \nwhich context to store the data. The data itself can be either a file or http\nbased URI, a string of data, or a file-like object.\n\nSo, let's add this to the `persons` context.\n\n>>> db.add_turtle(StringIO(data), 'persons')\n\nWe can now ask the database, which contexts it has:\n\n>>> db.contexts()\n[u'persons']\n\nYou can store data in as many different contexts as you like, or put everything\nin a single context.\n\nLets do a simple SPARQL query on the database\n\n>>> result = db.select('SELECT ?x {?x \"John\".}')\n\nWe can get the results as a list of dictionaries. This follows the SPARQL\nJSON result format.\n\n>>> result\n[{u'x': {'type': u'uri', 'value': u'http://example.org#john'}}]\n\nBesides querying, we can also get the data back from the database in any\nof the supported formats. We specify which format we want, and which context\nto use.\n\n>>> db.get_ntriples('persons').read()\n' ...'\n\nIf the database backend supports it, you can ask how many triples are in a \ncontext.\n\n>>> db.count('persons')\n2\n\nIf you want to remove triples, you will need to supply data describing which\ntriples to remove.\n\n>>> data = ' a .'\n>>> db.remove_turtle(data, 'persons')\n>>> db.count('persons')\n1\n\nYou can also remove all triples in a context\n\n>>> db.clear('persons')\n>>> db.count('persons')\n0\n\nSince the 'persons' context is now empty, it is also removed.\n\n>>> db.contexts()\n[]\n\n\nChangelog for Sparrow\n=====================\n\nSparrow 1.0b4 (2009-07-20)\n--------------------------\n - Picked better default profile\n\nSparrow 1.0b3 (2009-07-20)\n--------------------------\n - Fixed import errors in redland and allegro backend\n - API Changes: removed format method, all stores are supposed to\n provide 'ntriples', 'rdfxml' and 'turtle' serializations\n - API Changes: renamed IDatabase to ITripleStore, added ISPARQLEndpoint \n interface, added methods for different formats.\n - Added json and python dict serialization and parser formats for \n all backends\n - Added configure.zcml with utility registrations\n - Fixed allegro query tests\n\nSparrow 1.0b2 (2009-07-13)\n--------------------------\n - Added Allegro backend\n - More unittests\n - Added Allegro graph buildout profile\n \n\nSparrow 1.0b1 (2009-07-12)\n--------------------------\n - Refactored Redland/LibRDF, Sesame backends from Metro\n - Added RDFLib backend\n - Added Sesame buildout profile, configure and start scripts\n - Added basic test coverage", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "python RDF SPARQL", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "sparrow", "package_url": "https://pypi.org/project/sparrow/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/sparrow/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/sparrow/1.0b4/", "requires_dist": null, "requires_python": null, "summary": "Sparrow, Common RDF/SPARQL Database API", "version": "1.0b4" }, "last_serial": 799858, "releases": { "1.0b1": [ { "comment_text": "", "digests": { "md5": "4300b2646dee07c298973eadcdae7722", "sha256": "ae8729d9fb84558ce8aa1296342d2a23a4c249dc050430f9d61552715408789d" }, "downloads": -1, "filename": "sparrow-1.0b1-py2.5.egg", "has_sig": false, "md5_digest": "4300b2646dee07c298973eadcdae7722", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 62652, "upload_time": "2009-07-13T16:34:57", "url": "https://files.pythonhosted.org/packages/35/88/94744511a8b0a8a700aeebbd23f8ae9bd32bffb9e5292404f6caa7de7f36/sparrow-1.0b1-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "7eaef5766f0bdeef66fbc8961f839174", "sha256": "d3044db72623f13143c90acc3fd7d7bdba46d55bd6974863487a53898dc8cc20" }, "downloads": -1, "filename": "sparrow-1.0b1.tar.gz", "has_sig": false, "md5_digest": "7eaef5766f0bdeef66fbc8961f839174", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40477, "upload_time": "2009-07-13T16:34:56", "url": "https://files.pythonhosted.org/packages/48/a1/f13c790febed0eac1aaea38a24410ec89e5ff88f8914a45e8a5cceba82f2/sparrow-1.0b1.tar.gz" } ], "1.0b2": [ { "comment_text": "", "digests": { "md5": "7597d7e28ae11090360c5d14642e575f", "sha256": "7ede4c342bea9af2526c1b52346f48bfec49c3ae23f766442c10158c029b0b35" }, "downloads": -1, "filename": "sparrow-1.0b2-py2.5.egg", "has_sig": false, "md5_digest": "7597d7e28ae11090360c5d14642e575f", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 68804, "upload_time": "2009-07-14T18:31:29", "url": "https://files.pythonhosted.org/packages/41/0d/5217f4f00ccd64e2278c6a7c30c381b0494b9232eb88b84cfecac3199d48/sparrow-1.0b2-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "7e4043a86f6f82151565e8f5cd39570a", "sha256": "b5a2af6b6561de44279d3eee5106fe8b2dd712e87f8cd454e3ffbc71cb6ece27" }, "downloads": -1, "filename": "sparrow-1.0b2.tar.gz", "has_sig": false, "md5_digest": "7e4043a86f6f82151565e8f5cd39570a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41878, "upload_time": "2009-07-14T18:31:28", "url": "https://files.pythonhosted.org/packages/dc/d5/81f28d71c16a286678de9b6734498954055199e9cd149e37c33854f01675/sparrow-1.0b2.tar.gz" } ], "1.0b3": [ { "comment_text": "", "digests": { "md5": "3c5ba28518b6102900ecfc42f662f0ed", "sha256": "ac820fa413e35ae443066da83e6f1e2c44e17ede0e14bad5419f8146c8fb1230" }, "downloads": -1, "filename": "sparrow-1.0b3-py2.5.egg", "has_sig": false, "md5_digest": "3c5ba28518b6102900ecfc42f662f0ed", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 57270, "upload_time": "2009-07-20T15:47:27", "url": "https://files.pythonhosted.org/packages/b5/85/1346c8684108d6c70afd06598916a139408010e9e3c8cf3552f9a244cb37/sparrow-1.0b3-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "257e45c02a6bb352a2f1b201e191b210", "sha256": "aab4be94edb7f71fa917a05eafac4a2482cf608f5c8a94dcc15c87ead34f25cf" }, "downloads": -1, "filename": "sparrow-1.0b3.tar.gz", "has_sig": false, "md5_digest": "257e45c02a6bb352a2f1b201e191b210", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19086, "upload_time": "2009-07-20T15:47:26", "url": "https://files.pythonhosted.org/packages/3f/ca/8b01c18bbcaa360d6748c77d0aa47023c38fdef567f76f32b5b6bcb0c487/sparrow-1.0b3.tar.gz" } ], "1.0b4": [ { "comment_text": "", "digests": { "md5": "614905876c81d53cdd15114510921e4f", "sha256": "a659659ff167f6e4c85825bd940c4dd513ebb87df3a452ea39b9f762655689f7" }, "downloads": -1, "filename": "sparrow-1.0b4-py2.5.egg", "has_sig": false, "md5_digest": "614905876c81d53cdd15114510921e4f", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 97795, "upload_time": "2009-07-20T15:55:59", "url": "https://files.pythonhosted.org/packages/be/2d/88d51c61e9328419c04c743932196f6c9a491eda62ce24b0429a960fc3bf/sparrow-1.0b4-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "891fd710d41fcf04a539737f70b6978a", "sha256": "c53f17d51f5454fdc026e5f5fe2b35b8d6e1e1a66e02ed58a85aa5d2f8d6e7bd" }, "downloads": -1, "filename": "sparrow-1.0b4.tar.gz", "has_sig": false, "md5_digest": "891fd710d41fcf04a539737f70b6978a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59088, "upload_time": "2009-07-20T15:55:57", "url": "https://files.pythonhosted.org/packages/9e/60/e0adc61cc42d3866eac19c37c9a80356aa481ffbd9171f47a2374a501774/sparrow-1.0b4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "614905876c81d53cdd15114510921e4f", "sha256": "a659659ff167f6e4c85825bd940c4dd513ebb87df3a452ea39b9f762655689f7" }, "downloads": -1, "filename": "sparrow-1.0b4-py2.5.egg", "has_sig": false, "md5_digest": "614905876c81d53cdd15114510921e4f", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 97795, "upload_time": "2009-07-20T15:55:59", "url": "https://files.pythonhosted.org/packages/be/2d/88d51c61e9328419c04c743932196f6c9a491eda62ce24b0429a960fc3bf/sparrow-1.0b4-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "891fd710d41fcf04a539737f70b6978a", "sha256": "c53f17d51f5454fdc026e5f5fe2b35b8d6e1e1a66e02ed58a85aa5d2f8d6e7bd" }, "downloads": -1, "filename": "sparrow-1.0b4.tar.gz", "has_sig": false, "md5_digest": "891fd710d41fcf04a539737f70b6978a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59088, "upload_time": "2009-07-20T15:55:57", "url": "https://files.pythonhosted.org/packages/9e/60/e0adc61cc42d3866eac19c37c9a80356aa481ffbd9171f47a2374a501774/sparrow-1.0b4.tar.gz" } ] }