Package: restframework-rdf
[![Documentation Status](https://readthedocs.org/projects/restframework-rdf/badge/?version=latest)](https://restframework-rdf.readthedocs.io/en/latest/?badge=latest)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8158686.svg)](https://doi.org/10.5281/zenodo.8158686)# restframework-rdfDjango apps for integration between Resource Description Framework (RDF) and [django REST framework](https://www.django-rest-framework.org/). The repository contains two django apps,rdffor general RDF functionality andsparqlto add views for SPARQL queries. The functionality is intended as generic and useful for any project that intends to expose an RDF database through a django REST framework API.These apps were originally developed within the [read-it interface](https://github.com/UUDigitalHumanitieslab/readit-interface). The code was moved to this independent repository so it could be used in another application, [EDPOP](https://github.com/UUDigitalHumanitieslab/EDPOP).Both of these applications are in active development; as such, this repository may see further updates to serve the needs of different applications. We welcome contributions to make the package more widely applicable.However, be advised that this repository was primarily developed to be used in our own applications. It may not have the level of documentation that you would expect from a public-facing package. At the very least, the documentation will assume that you have basic familiarity with both RDF and django REST framework.## Quick startFollow the [getting started guide](/docs/getting-started.md) to use the app in a django project.Usage documentation is available in the [documentation directory](/docs/) or [read the docs](https://restframework-rdf.readthedocs.io/en/latest/getting-started/)## Development and unit testsThese steps are for development on the rdf app itself. Follow the steps below in order to run the unit tests.### BlazegraphBefore you start, you need to install [Blazegraph](http://blazegraph.com/). The unit tests assume that you have a blazegraph server running and that the namespace ‘rdf-test’ is created. The following steps suffice to make this true.Follow the [Blazegraph quick start guide](https://github.com/blazegraph/database/wiki/Quick_Start) to download and start the database server and a foreground process.
While the server is running, you can access its web interface athttp://localhost:9999. This lets you upload and download data, try out queries and review statistics about the dataset. The server can be stopped by typingctrl-c.
Visit the [web interface](http://localhost:9999), navigate to theNAMESPACEStab. Use thecreate namespaceform to create a new namespace. Chooserdf-testas a name, and set the mode toquads. All other checkboxes should be disabled. A popup is shown with additional settings. Leave these at their default values and chooseCreate. The created namespace should now appear in the list of namespaces. Chooseuseto use the rdf-test namespace when operating the web interface### Running unit testsClone this repositoryInstall the required python packages viapip install -r requirements.txtMake sure your blazegraph server is running (see above).Run the unit tests withpytest.### Usage during developmentTo use your work-in-progress drf app in a django project, build the package with`bash python setup.py sdist `You can now find the package in this repository underdist/restframework-drf-blablabla.tar.gzTo install the package in your project, install via pip as`bash pip installpath/to/repository/dist/restframework-drf-*.targ.gz`### DocumentationDocumentation (in thedocsdirectory) is based on [MkDocs](https://www.mkdocs.org/).You can browse the documentation in a development server by running`bash mkdocs serve `