{ "info": { "author": "Martin Galpin", "author_email": "m@66laps.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "django-4store\n=============\n\n:Author:\n Martin Galpin\n:Contact:\n m@66laps.com\n\ndjango-4store is a small Django application that makes developing\napps with the `4Store RDF database`_ easier.\n\nInstallation\n------------\n\ndjango-4store is on `PyPi`_ for ``easy_install`` or `buildout`_::\n\n $ easy_install django-4store\n\nAlternatively, clone the repository and place it either in your Django\nproject or within your ``$PYTHONPATH``::\n\n $ git clone git://github.com/66laps/django-4store.git\n\nConfiguration\n-------------\n\nEdit your ``settings.py`` and add ``fourstore`` to the end of\n``INSTALLED_APPS``.\n\nYou must also add two additional settings to ``settings.py``::\n\n FOURSTORE_KBNAME = \"demo\" # Name of 4store knowledge base\n FOURSTORE_PORT = 6667 # Port for 4store HTTP server\n\nIt is recommended (but not required) that you also set a constant to\nthe SPARQL endpoint at the same time::\n\n SPARQL_ENDPOINT = \"http://localhost:6667/sparql/\"\n\nCode that depends on this endpoint URL will continue to work during\ntesting (see `Test Cases`_.)\n\nManagement Commands\n-------------------\n\nTwo management commands are provided that wrap the standard ``4s-*``\ncommands for convenience.\n\nThe first, ``4store-import`` will create and import the specified\nfiles into the 4store knowledge base (in ``settings.py``)::\n\n $ python manage.py 4store-import rdf/card.rdf rdf/myself.n3\n\nThe flag ``--recursive`` can be specified to recursively add any RDF\nfiles in a directory.\n\nNote that importing data will overwrite any existing content in the\nknowledge base.\n\nThe second command, ``4store`` will start the HTTP server on the port\nspecified in ``settings.py``::\n\n $ python manage.py 4store\n ...\n\n.. _`Test Cases`:\n\nTest Cases\n----------\n\nA subclass of ``django.test.Testcase`` is included. This provides a\nmechanism for starting an isolated 4store server and automatically\nimporting test fixtures.\n\nFor example, the following test case can be used to test any 4store\ndependant code::\n\n from django.conf import settings\n from HTTP4Store import HTTP4Store\n\n from fourstore.test import Base4StoreTest\n\n class MySemanticTestCase(Base4StoreTest):\n kbfixtures = [\"card.rdf\", \"someone.n3\"]\n\n\tdef test_something(self):\n\t store = HTTP4Store(settings.SPARQL_ENDPOINT)\n\t response = store.sparql(\"SELECT * WHERE { ?s ?p ?o . } \")\n\t self.assertEquals(..., response)\n\nTest fixtures should be placed within the ``fixtures`` directory of\nthe app under testing (note the class variable is ``kbfixtures``).\n\nThe Django setting attribute ``settings.SPARQL_ENDPOINT`` is\nautomatically updated to the current endpoint URL.\n\nThe server is reinitialised between tests and its operation is dependant\non ``setUp`` and ``tearDown``. If you need to override these methods,\nmake sure that you still call the parent implementations::\n\n class MySemanticTestCase(Base4StoreTest):\n ...\n def setUp(self):\n Base4StoreTest.setUp(self)\n\t // do something\n\n def tearDown(self):\n Base4StoreTest.tearDown(self)\n // do something\n\nViews\n-----\n\n`Cross-site HTTP Requests`_ are typically blocked by web browsers for\nmany `historically well documented security reasons`_. These restrictions prevent\nweb applications from communicating directly with SPARQL endpoints.\n\ndjango-4store provides a solution to this problem. The view\n``fourstore.views.sparql_proxy`` relays all HTTP requests it receives\nto a specified endpoint (given in ``urls.py``).\n\nFor example, to communicate with `Dbpedia`_ configure ``urls.py`` as follows::\n\n from django.conf.urls.defaults import url, patterns\n\n urlpatterns = patterns('fourstore.views',\n url(r\"^sparql/$\", \"sparql_proxy\", {\"sparql_endpoint\": \"http://www.dbpedia.org/sparql/\"}),\n )\n\nAny requests made to ``http://www.yourdjangoapp.com/sparql/`` are now\nautomatically relayed to ``http://www.dbpedia.org/sparql/`` and the\nresponse transparent sent back to the originating browser.\n\nNote that in accordance with the `SPARQL Protocol`_ all requests must have a\n``Content-Type`` of ``application/x-www-form-urlencoded``.\n\nTest Suite\n----------\n\nA test suite for django-4store is included::\n\n $ python manage.py test fourstore\n\nLicense\n-------\n\nThis library is free software; you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 3 of the\nLicense, or (at your option) any later version.\n\nThis library is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this library; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\n02110-1301 USA\n\n.. _`4Store RDF database`: http://www.4store.org\n.. _`PyPI`: http://pypi.python.org/pypi?name=django-4store\n.. _`buildout`: http://www.buildout.org/\n.. _`Cross-site HTTP Requests`: https://developer.mozilla.org/En/HTTP_Access_Control\n.. _`historically well documented security reasons`: http://en.wikipedia.org/wiki/Cross-site_scripting#Exploit_scenarios\n.. _`Dbpedia`: http://www.dbpedia.org\n.. _`SPARQL Protocol`: http://www.w3.org/TR/rdf-sparql-protocol/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/66laps/django-fourstore", "keywords": null, "license": "LGPL v3", "maintainer": null, "maintainer_email": null, "name": "django-4store", "package_url": "https://pypi.org/project/django-4store/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-4store/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/66laps/django-fourstore" }, "release_url": "https://pypi.org/project/django-4store/0.3/", "requires_dist": null, "requires_python": null, "summary": "A small Django application that makes developing with the 4Store RDF database easier.", "version": "0.3" }, "last_serial": 789018, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "0c512f80bd6edb4bd23a6252f66c2162", "sha256": "e3a7098cc4bf48afd9f011c5a7a90e5aa69f51eaf02c28b4f368f24b51f836bb" }, "downloads": -1, "filename": "django-4store-0.1.tar.gz", "has_sig": false, "md5_digest": "0c512f80bd6edb4bd23a6252f66c2162", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6169, "upload_time": "2011-01-20T21:41:56", "url": "https://files.pythonhosted.org/packages/d4/31/4782b00a20fc12d7529248e3055d89ea5c175ab65d0dd0346458c747ad67/django-4store-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "4fe27a271c64a2eaa553432d880fe742", "sha256": "e63d22291672595a7935fa5619004118a801cf023bdd23e6fc1b85463f73f09e" }, "downloads": -1, "filename": "django-4store-0.2.tar.gz", "has_sig": false, "md5_digest": "4fe27a271c64a2eaa553432d880fe742", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9322, "upload_time": "2011-01-23T18:18:58", "url": "https://files.pythonhosted.org/packages/cb/58/ab4a9408434d2594f106581a066d22a04dd723cefb7bbf2a71ea7d97d49e/django-4store-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "6f421361c0b8feb20b3251deb1c7c72d", "sha256": "5785989c9697e049a54f19a033b2aa1917553f1540b6542b299b6db9fcd79a20" }, "downloads": -1, "filename": "django-4store-0.2.1.tar.gz", "has_sig": false, "md5_digest": "6f421361c0b8feb20b3251deb1c7c72d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9467, "upload_time": "2011-01-23T23:35:48", "url": "https://files.pythonhosted.org/packages/1c/74/c56cd71aa4c5e05d068a90efd3a112dab0338ccffcdf74c8a960344d0c4a/django-4store-0.2.1.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "0435b5a7ee25e331c9fb0bdf429e16ff", "sha256": "100fc2df93be22b39a549099fd8de250ea3309ed70401be054dbdce69fbbc890" }, "downloads": -1, "filename": "django-4store-0.3.tar.gz", "has_sig": false, "md5_digest": "0435b5a7ee25e331c9fb0bdf429e16ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11668, "upload_time": "2011-01-26T12:46:16", "url": "https://files.pythonhosted.org/packages/48/26/f67ac2701f6028f88b84cc2d2683a3507a4c413a8e9c299beaab1000761d/django-4store-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0435b5a7ee25e331c9fb0bdf429e16ff", "sha256": "100fc2df93be22b39a549099fd8de250ea3309ed70401be054dbdce69fbbc890" }, "downloads": -1, "filename": "django-4store-0.3.tar.gz", "has_sig": false, "md5_digest": "0435b5a7ee25e331c9fb0bdf429e16ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11668, "upload_time": "2011-01-26T12:46:16", "url": "https://files.pythonhosted.org/packages/48/26/f67ac2701f6028f88b84cc2d2683a3507a4c413a8e9c299beaab1000761d/django-4store-0.3.tar.gz" } ] }