Status of master branch:
This project runs a SPARQL endpoint for Update and Select Queries and enables versioning with Git for each Named Graph.
- Create a directory, which will contain your RDF data
- Run
git initin this directory - Put your RDF data formated as N-Quads into this directory (an empty file should work as well)
- Add the data to the repository (
git add …) and create a commit (git commit -m "init repository") - Create a configuration file named
config.ttl(an example is contained in this directory)
Adjust the config.ttl.
Make sure you put the correct path to your git repository ("../store") and the URI of your graph (<http://example.org/>) and name of the file holding this graph ("example.nq").
conf:store a <YourQuitStore> ;
<pathOfGitRepo> "../store" ; # Set the path to the repository that contains the files .
<origin> "git:github.com/your/repository.git" . # Optional a git repo that will be cloned into dir given in line above on startup.
conf:example a <Graph> ; # Define a Graph resource for a named graph
<graphUri> <http://example.org/> ; # Set the URI of named graph
<isVersioned> 1 ; # Defaults to True, future work
<hasQuadFile> "example.nq" . # Set the filename
The config.ttl could as well be put under version controll for collaboration, but this is not neccessary.
Install libgit2 needed for pygit2 bindings. Install pip and optionally virtualenv resp. virtualenvwrapper:
pip install virtualenv
cd /path/to/this/repo
mkvirtualenv -p /usr/bin/python3.5 quit
Install the required dependencies and run the store:
pip install -r requirements.txt
./quit.py
-cm, --configmode
Quit-Store can be started in three different modes. These modes differ in how the store choses the named graphs and the corresponding files that will be part of the store.
- localconfig - Use the graphs specified in a local config file (e.g.
config.ttl). - repoconfig - Search for a
config.ttlfile in the specified repository. - graphfiles - Use
*.graphfiles for each RDF file or analyze found N-Quads files to get the URI of named graphs.
-t, --targetdir
Specifiy a target directory where the repository can be found or will be cloned (if remote is given) to.
-r, -repourl
Specifiy a link/URI to a remote repository.
-c, --configfile
Specify a path to a configuration file. (Defaults to ./config.ttl)
-nv, --disableversioning
Run Quit-Store without versioning activated
-gc, --garbagecollection
Enable garbage collection. With this option activated, git will check for garbage collection after each commit. This may slow down response time but will keep the repository size small.
Execute a query with curl
curl -X POST -L -T path/to/query/file http://your.host/sparql
Get commits, messages, committer and date of commits
http://your.host/git/log
If you want to convert an N-Triples file to N-Quads where all data is in the same graph, the following line might help.
sed "s/.$/<http:\/\/example.org\/> ./g" data.nt > data.nq
Reinit store with data from commit with id
http://your.host/git/checkout?commitid=12345
Copyright (C) 2017 Norman Radtke http://aksw.org/NormanRadtke and Natanael Arndt http://aksw.org/NatanaelArndt
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses. Please see LICENSE for further information.