Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
776aa20
initial commit
af-pna May 24, 2017
6c9705a
fixed endpoint (SELECT) and blame
May 26, 2017
f55a282
added html for results
May 26, 2017
2119a36
fixed blame for different arguments
May 26, 2017
5c72194
some design, commits overview, fixed path bug, local js/css
af-pna May 29, 2017
3726a2d
added ordered quad serializer, hex to prov store, git commit graphic
af-pna May 30, 2017
58fd41d
moved files to submodules, fixed blame, added provenance endpoint for…
af-pna Jun 5, 2017
249bda2
temporary commit
Jun 6, 2017
81488b4
Merge branch 'feature/provenance' of https://github.com/Kyrosh/QuitSt…
Jun 6, 2017
448214f
fixed blame, cleanup
Jun 6, 2017
afda713
for presentation
af-pna Jun 6, 2017
28aec95
moved plugins to tools, fixed rewriting and commits
af-pna Jun 12, 2017
e491434
added fonts, working on commits and in-memory copies, added default f…
af-pna Jun 14, 2017
a584a66
tag links, fix for sync, fix for sorted quads
Jun 14, 2017
10755a4
graphFile instead of hasQuadFile?, check against registered graph fil…
af-pna Jun 14, 2017
6670f65
updated version of rdflib
af-pna Jun 14, 2017
604a922
force copy, empty blame, cleaned quit.py initialize(), refactored dro…
Jun 14, 2017
c4db4ea
Merge branch 'feature/provenance' of https://github.com/Kyrosh/QuitSt…
Jun 14, 2017
3595980
clean_path and uriref for matching, fixed zero element cached generator
Jun 14, 2017
35fa609
fixed exception, fixed find graph on commit
Jun 14, 2017
5a77237
storemode for config, fixed develop branch, config error page, index …
Jun 28, 2017
febb1d1
temp
af-pna Aug 9, 2017
d820d64
profiling
af-pna Aug 10, 2017
6d0eeff
Merge all changes on master to feature/provenance
white-gecko Aug 22, 2017
0731d71
Merge branch 'master' into feature/provenance+masterCherryPick
white-gecko Aug 22, 2017
95240f9
Fix timezone and import problem
white-gecko Aug 22, 2017
c006e7e
Fix graphfile recognition
white-gecko Aug 22, 2017
4c284aa
Set default git user in Dockerfile
white-gecko Aug 22, 2017
a4be8f1
pylama fixes for quit.py and git.py
white-gecko Aug 22, 2017
dd5e4bc
Fix codingy style with autopep8
white-gecko Aug 23, 2017
4191ac9
Fix some more pep8 errors
white-gecko Aug 23, 2017
3f84b14
Specify unsupported query exception, not fail always
white-gecko Aug 23, 2017
7eeacc5
Add message to UnsupportedQuery Exception
white-gecko Aug 23, 2017
a1fbe07
Implement logging and remove prints
white-gecko Aug 23, 2017
42865f2
Fix typo in variablename deletedtriples
white-gecko Aug 24, 2017
fc33301
Change exception log
white-gecko Aug 24, 2017
e90d3b3
More streamlining of logging
white-gecko Aug 24, 2017
7b92979
fixed graphs
af-pna Aug 24, 2017
d1df905
partly fixed diff
af-pna Aug 24, 2017
e2a33ba
Merge 'kyrosh/feature/provenance_performance' into feature/provenance
white-gecko Aug 24, 2017
6238ca6
Fix pep8 errors after merge
white-gecko Aug 24, 2017
0cec177
Fix errors in git.py
white-gecko Aug 24, 2017
e69f542
Clean up graphs.py
white-gecko Aug 24, 2017
c3e67bd
Re-add version constraints to requirements.txt
white-gecko Aug 24, 2017
b8eaaf5
Some more clean up
white-gecko Aug 24, 2017
78a47ea
Remove prints and benchmark
white-gecko Aug 24, 2017
cea48f9
Remove unused methods and imports
white-gecko Aug 24, 2017
caefb56
Fix #53. Remove outcommented code.
white-gecko Aug 24, 2017
5f068d8
Set pygit2 to fixed version
white-gecko Aug 24, 2017
6a53e1b
Reword varname and shorten line
white-gecko Aug 24, 2017
0f513bd
Remove FileReference because it is unused
white-gecko Aug 25, 2017
809ca9c
Fixed delta generation for Blame
af-pna Aug 28, 2017
e621ebb
Merge branch 'feature/provenance' of https://github.com/AKSW/QuitStor…
af-pna Aug 28, 2017
4871049
fixed some bugs that caused parsing of blobs, preselect master in git…
Sep 7, 2017
089a7cb
Fix error with unasigned variable
white-gecko Sep 7, 2017
9bb6857
Return master as default branch
white-gecko Sep 7, 2017
24c81ad
Don't overwrite head by quit
white-gecko Sep 7, 2017
98a946e
Remove unused name parameter
white-gecko Sep 7, 2017
1855993
Throw git commit exceptions to the frontend
white-gecko Sep 7, 2017
dd10057
Improve branch handling from frontend
white-gecko Sep 7, 2017
d60a9eb
check for delta in update.py
af-pna Sep 11, 2017
0a0227c
new store modes
af-pna Sep 11, 2017
cef6a48
Fix pylama
white-gecko Sep 11, 2017
bd51511
Add documentation for Quit.instance method
white-gecko Sep 11, 2017
ff2cd44
commit2blob cache
Sep 11, 2017
b214fa5
Merge branch 'feature/provenance' of https://github.com/AKSW/QuitStor…
Sep 11, 2017
67828b4
Divide behavior of InMemoryAggregatedGraph
white-gecko Sep 11, 2017
5f4e71f
Don't sort for now
white-gecko Sep 11, 2017
933ca1d
Remove instance of GitRepo
white-gecko Sep 11, 2017
b5158c0
storemode is now called features, features are disabled by default an…
Sep 15, 2017
5dc0450
fixes (Issue #65)
Sep 15, 2017
186c12f
fixes (Issue #65)
Sep 15, 2017
03da56b
Merge branch 'feature/provenance' of https://github.com/AKSW/QuitStor…
Sep 15, 2017
558e7e9
Disable profiling
white-gecko Sep 26, 2017
8657a09
Fix format string
white-gecko Sep 26, 2017
1618c92
Fix nameing of prov:roles
white-gecko Sep 26, 2017
655738d
added prov as default binding
Sep 26, 2017
d0ee8a3
removed default for feature args
Sep 26, 2017
6c5a5a3
Merge branch 'feature/provenance' of https://github.com/AKSW/QuitStor…
Sep 26, 2017
e2a5586
Fix representation of changesets in prov graph
white-gecko Sep 26, 2017
97d1651
Fix provenance feature and specializationOf
white-gecko Sep 26, 2017
5e09f2b
readded default for args parse
af-pna Sep 27, 2017
f50cc25
added linewise serialized cache for blobs, fixed empty file problem
af-pna Sep 29, 2017
314a441
Set provEntitiy
white-gecko Sep 30, 2017
ff95b57
Merge remote-tracking branch 'refs/remotes/origin/feature/provenance'…
white-gecko Sep 30, 2017
2227893
Fix coding standard
white-gecko Oct 3, 2017
d25ed38
Fix config tests
white-gecko Oct 3, 2017
20e5950
Fix test_app
white-gecko Oct 3, 2017
da6a09c
Fix typo and rename serialisers to serializers
white-gecko Oct 3, 2017
4566f9b
Add attribution
white-gecko Oct 3, 2017
774421f
Fix htmlresults serializer
white-gecko Oct 3, 2017
d6f6932
Fix coding standard in htmlresult serializer
white-gecko Oct 3, 2017
7a31077
Hopefully fix typo in quit cache
white-gecko Oct 3, 2017
b181734
Add documentation for new store modes. Fix #52.
white-gecko Oct 3, 2017
0cda60f
Remove unneeded clean_path method
white-gecko Oct 3, 2017
7560365
Clean up old GitRepo
white-gecko Oct 3, 2017
cd7aeb1
Fix failing test
white-gecko Oct 3, 2017
13bb4fb
Minor MemoryStore fixes
white-gecko Oct 3, 2017
e417149
Update license text for htmlresults.py
white-gecko Oct 4, 2017
0833602
(Hopefully) fixes slow initial commits after update queries
Oct 5, 2017
c1687fc
additional qualified provenance properties in derivedFrom between ent…
Oct 5, 2017
5c6cbd2
Merge branch 'feature/provenance' of https://github.com/AKSW/QuitStor…
Oct 5, 2017
be9d669
fixed pep8
af-pna Oct 5, 2017
549980c
Fix logging in git.py and add pull debug log
white-gecko Oct 6, 2017
ee36e49
write unassigned.nq again
Oct 6, 2017
9a2106b
Merge branch 'feature/provenance' of https://github.com/AKSW/QuitStor…
Oct 6, 2017
d01033a
Add routes for revert and merge
white-gecko Oct 6, 2017
157991e
Fix coding standards
white-gecko Oct 6, 2017
a92e63c
Add parameters for pull, push, and fetch
white-gecko Oct 6, 2017
cb647be
Reorg tests
splattater Oct 10, 2017
b0376db
Move tests to severalTests placeholder
splattater Oct 10, 2017
f48b700
Add first tests for index class
splattater Oct 10, 2017
4ee789d
Add repositories for app tests
splattater Oct 12, 2017
ca6f604
Move gc configuration to Repository and fix it
white-gecko Oct 16, 2017
f84ce6d
Fix coding style
white-gecko Oct 16, 2017
56b2652
Add test for argument feature provenance
splattater Oct 16, 2017
46ad0c8
Trigger garbage collection and test it
white-gecko Oct 16, 2017
dc97a02
Add test for activated versioning
splattater Oct 17, 2017
4bd0e21
Fix error with gc
splattater Oct 17, 2017
36193f9
Remove comments
splattater Oct 17, 2017
3e41858
Add a failing test that describes #69
splattater Oct 17, 2017
296299b
Update test behaviour
splattater Oct 23, 2017
e4e8477
Merge pull request #72 from AKSW/issue/mode-graphfiles-fails
white-gecko Oct 23, 2017
e65ecf2
Add test that describes #70
splattater Oct 17, 2017
5dd8e24
Remove option no-versioning
splattater Oct 24, 2017
8e18a08
Merge pull request #73 from AKSW/issue/no-versioning-fails
white-gecko Oct 24, 2017
585e064
Use pygit2.Signature
white-gecko Oct 24, 2017
27e383a
Remove duplication of Signature
white-gecko Oct 24, 2017
aec03ec
Merge pull request #74 from AKSW/feature/usePygit2Signature
splattater Oct 25, 2017
c8b3250
Reword doc strings. Fixes #55.
white-gecko Oct 25, 2017
53e710a
Remove unused imports an unused CACHE
white-gecko Oct 25, 2017
af33ec2
Forward KeyError in Cache to correctly handle cache misses
white-gecko Oct 25, 2017
6ea54e0
Merge pull request #77 from AKSW/feature/raiseKeyErrorInCache
white-gecko Oct 30, 2017
696aa32
Update content negotiation
splattater Oct 19, 2017
0f760d9
Merge pull request #71 from AKSW/issue/conneg
white-gecko Nov 1, 2017
cee76c0
Fix Flask CORS warning
white-gecko Dec 11, 2017
18e3d35
Merge pull request #85 from AKSW/feature/fixCorsWarning
splattater Dec 12, 2017
15e7e47
Don't forward not supported mimetype
white-gecko Dec 14, 2017
9dee25c
Fix some query result mimetypes
white-gecko Dec 14, 2017
40e380d
Merge pull request #88 from AKSW/feature/fixSomeMimetypes
splattater Dec 15, 2017
9b9bcbc
Merge pull request #87 from AKSW/feature/removeConnegException
splattater Dec 15, 2017
78bf488
Merge pull request #89 from AKSW/feature/removeUnusedStuff
splattater Dec 15, 2017
3718764
Test and fix the push method of the Repository
white-gecko Dec 18, 2017
dd39549
Add proper exception for push error and doc strings.
white-gecko Dec 18, 2017
c80cd72
Merge pull request #91 from AKSW/feature/testAndFixPush
splattater Dec 18, 2017
8ed07b0
Add callback method for reporting if a remote rejectes a push
white-gecko Dec 19, 2017
7e50b77
Streamline the Repository Interface and add docu
white-gecko Dec 20, 2017
dad4e6d
Add documentation for the merge method and a docu stub for revert
white-gecko Dec 21, 2017
d7166a6
Fix typo in http interface documentation
white-gecko Dec 22, 2017
97c557a
Merge pull request #94 from AKSW/feature/streamlineAndDocumentReposit…
splattater Jan 2, 2018
f202666
Parse Accept header for Commits API
white-gecko Jan 4, 2018
ac3518a
Add tests for commit API
white-gecko Jan 4, 2018
5f44bfc
Add case for unsupported mimetype
white-gecko Jan 4, 2018
bdc07ca
Add test for no accept header
white-gecko Jan 4, 2018
a9d6e46
Merge pull request #96 from AKSW/feature/fixMimeTypeForCommitsAPI
splattater Jan 4, 2018
22936a1
extends key of blob cache by its filename (Issue #78)
Kyrosh Nov 1, 2017
2330fad
minor change
Kyrosh Nov 1, 2017
8c63794
(hopefully) fixes travis error
Kyrosh Nov 1, 2017
155b6e1
Add new app tests, where one is failing
white-gecko Dec 13, 2017
91fc087
Add tests
splattater Jan 4, 2018
0fc2d91
Add logging
white-gecko Jan 4, 2018
c80878b
Rename variables and functions
white-gecko Jan 4, 2018
0115664
Add docstring
white-gecko Jan 4, 2018
e5defec
Fix issue with empty contexts
white-gecko Jan 4, 2018
418948b
Revert order in _apply
white-gecko Jan 4, 2018
57e4ab7
Update tests to make use of TemporaryRepository
splattater Jan 5, 2018
570e0d5
Update two assertions
splattater Jan 5, 2018
088f935
Order tests
splattater Jan 5, 2018
bf5f6b5
fix typo
white-gecko Jan 5, 2018
cf12453
Merge pull request #86 from AKSW/feature/improveAppTests
white-gecko Jan 5, 2018
61cc15d
Change __all__ to tuples
white-gecko Jan 5, 2018
98044da
Merge pull request #97 from AKSW/feature/__all__Tuples
white-gecko Jan 5, 2018
2fb2649
New assertion, clone and fix for helper
white-gecko Jan 5, 2018
37353b5
Fix raising error for rejection of push. Add deactivated test.
white-gecko Jan 6, 2018
be1c130
Merge pull request #98 from AKSW/feature/newAssertionAndCloneWithHelper
splattater Jan 8, 2018
1937ee8
Fix typo
splattater Jan 8, 2018
037a58a
Properly skip the disabled test
white-gecko Jan 8, 2018
d5d47ec
Merge pull request #92 from AKSW/feature/reportRemotePushException
splattater Jan 8, 2018
2028fc6
Remove and add (un)needed log messages
splattater Jan 8, 2018
4c2b512
Merge pull request #100 from AKSW/feature/improveLogging
white-gecko Jan 8, 2018
a07d607
Fix #75
splattater Jan 8, 2018
fcdfdd1
Fix issue with result nested in a list
splattater Jan 8, 2018
29e6a27
Add app test for blame.
splattater Jan 8, 2018
4998594
Add argumtent for query variables
splattater Jan 9, 2018
90c08ad
Add test for correctness of blame
splattater Jan 9, 2018
1c21416
Merge pull request #101 from AKSW/fix/issue75
white-gecko Jan 9, 2018
8f197ef
Add tests for pull, fetch, clone and update scenario
white-gecko Dec 20, 2017
6efd14d
Separate pull into fetch and merge methods
white-gecko Dec 21, 2017
9890065
Clarify git HTTP API
white-gecko Jan 3, 2018
952895b
Add app tests for pull
white-gecko Jan 3, 2018
49399e1
Merge pull request #93 from AKSW/feature/testAndFixPull
splattater Jan 11, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,16 @@ before_script:

# command to run tests
script:
- coverage run -a --source=quit tests/test_core.py
- coverage run -a --source=quit tests/test_conf.py
- coverage run -a --source=quit tests/test_app.py
- coverage run -a --source=quit tests/test_cache.py
- coverage run -a --source=quit tests/test_conf.py
- coverage run -a --source=quit tests/test_core.py
- coverage run -a --source=quit tests/test_endpoint.py
- coverage run -a --source=quit tests/test_git.py
- coverage run -a --source=quit tests/test_graphs.py
- coverage run -a --source=quit tests/test_helpers.py
- coverage run -a --source=quit tests/test_namespace.py
- coverage run -a --source=quit tests/test_provenance.py

after_success:
coveralls
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ EXPOSE 80
# Quit writes its log file to the current directory
WORKDIR /var/log

# Set default git user
RUN git config --global user.name QuitStore && git config --global user.email quitstore@example.org

CMD quit --configfile ${QUIT_CONFIGFILE} --port ${QUIT_PORT}
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ Run Quit-Store without versioning activated

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.

`-f`, `--features`

This option enables additional features of the store:

- `provenance` - Store provenance information for each revision.
- `persistance` - Store all internal data as RDF graph.

`-v`, `--verbose` and `-vv`, `--verboseverbose`

Set the loglevel for the standard output to verbose (INFO) respective extra verbose (DEBUG).
Expand Down
15 changes: 15 additions & 0 deletions config-vocab.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,20 @@ quit:storeFromDir a rdfs:Property ;
quit:pathOfGitRepo a rdfs:Property ;
rdfs:label "Path to the local Git Repository" .

quit:defaultBranch a rdfs:Property ;
rdfs:label "Branch used as default" .

quit:globalFile a rdfs:Property ;
rdfs:label "File for unassigned graphs" .

quit:linkToGitRemote a rdfs:Property ;
rdfs:label "Link to the Git Remote" .

quit:Binding a rdfs:Class ;
rdfs:label "Information about custom namespaces" .

quit:prefix a rdfs:Property ;
rdfs:label "Prefix for a binding" .

quit:namespace a rdfs:Property ;
rdfs:label "Actual namespace for a binding" .
27 changes: 22 additions & 5 deletions config.example.ttl
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
@base <http://my.quit.conf/> .
@prefix conf: <http://my.quit.conf/> .
@prefix quit: <http://quit.aksw.org/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<exampleStore> a quit:QuitStore ;
conf:exampleStore a quit:QuitStore ;
quit:allowNewGraphs 1 ;
quit:pathOfGitRepo "../store.default" .
quit:pathOfGitRepo "../store.default" ;
quit:defaultBranch "master" ;
quit:globalFile "global.nq" .

<exampleDBpedia> a quit:Graph ;
conf:exampleDBpedia a quit:Graph ;
quit:graphUri <http://dbpedia.org/> ;
quit:isVersioned 1 ;
quit:graphFile "dbpedia.nq" .

<exampleGraph> a quit:Graph ;
conf:exampleGraph a quit:Graph ;
quit:graphUri <http://my.quit.graph/> ;
quit:isVersioned 1 ;
quit:graphFile "default.nq" .

conf:default a <Graph> ;
quit:graphUri <http://aksw.org/NormanRadtke> ;
quit:isVersioned 1 ;
quit:graphFile "radtke.nq" .

conf:default1 a <Graph> ;
quit:graphUri <http://aksw.org/NatanaelArndt> ;
quit:isVersioned 1 ;
quit:graphFile "arndt.nq" .

conf:aksw a <Binding> ;
quit:prefix "aksw" ;
quit:namespace <http://aksw.org/> .
quit:graphFile "default.nq" .
2 changes: 2 additions & 0 deletions lol.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python quit/quit.py -cm localconfig --disable-data-store
:: --disable-data-store --disable-provenance-store
2 changes: 1 addition & 1 deletion pylama.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[pylama]
format = pylint
skip = tests/*,quit/update.py
skip = tests/*,quit/tools/*
linters = pep8
ignore = E402

Expand Down
20 changes: 20 additions & 0 deletions quit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import quit.tools.plugin

from rdflib.plugins.sparql.algebra import SequencePath

# from Github: https://github.com/RDFLib/rdflib/issues/617
# Egregious hack, the SequencePath object doesn't support compare, this implements the __lt__ method
# so that algebra.py works on sorting in SPARQL queries on e.g. rdf:List paths


def sequencePathCompareLt(self, other):
return str(self) < str(other)


def sequencePathCompareGt(self, other):
return str(self) < str(other)


setattr(SequencePath, '__lt__', sequencePathCompareLt)
setattr(SequencePath, '__gt__', sequencePathCompareGt)
# End egregious hack
17 changes: 17 additions & 0 deletions quit/benchmark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import time


def benchmark(f):

def timed(*args, **kw):

print("starting '%r'" % (f.__name__))

ts = time.time()
result = f(*args, **kw)
te = time.time()

print("ending '%r' after %2.4f sec" % (f.__name__, te - ts))
return result

return timed
90 changes: 90 additions & 0 deletions quit/cache.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
from collections import OrderedDict
from sortedcontainers import SortedList


class Cache:

def __init__(self, capacity=50):
self.stack = OrderedDict()
self.capacity = capacity

def get(self, key):
"""Get a value from the cache.

Raises:
KeyError if no value was found for the given key
"""
value = self.stack.pop(key)
self.stack[key] = value
return value

def set(self, key, value):
try:
self.stack.pop(key)
except KeyError:
if len(self.stack) >= self.capacity:
self.stack.popitem(last=False)
self.stack[key] = value

def remove(self, key):
try:
return self.stack.pop(key)
except KeyError:
return

def __contains__(self, key):
return key in self.stack

def __iter__(self):
return (c for c in self.stack)

@property
def size(self):
"""
Return the size of the cache
"""
return len(self.stack)


class FileReference:
"""A class that manages n-quad files.
This class stores inforamtation about the location of a n-quad file and is
able to add and delete triples/quads to that file.
"""

def __init__(self, path, content):
"""Initialize a new FileReference instance.
Args:
filelocation: A string of the filepath.
filecontentinmem: Boolean to decide if local filesystem should be used to
or if file content should be kept in memory too . (Defaults false)
Raises:
ValueError: If no file at the filelocation, or in the given directory + filelocation.
"""

if isinstance(content, str):
content = content.splitlines() or []

self._path = path
self._content = SortedList(content)
self._modified = False

@property
def path(self):
return self._path

@property
def content(self):
return "\n".join(self._content)

def add(self, data):
"""Add a quad to the file content."""
self._content.add(data)

def extend(self, data):
"""Add quads to the file content."""
self._content.extend(data)

def remove(self, data):
"""Remove quad from the file content."""
self._content.remove(data)
Loading