Skip to content

Commit

Permalink
feature: Add reset triplestore command line command (ongoing)
Browse files Browse the repository at this point in the history
  • Loading branch information
subotic committed Jun 12, 2019
1 parent 277121b commit d078e4a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions knora/reset_triplestore.py
@@ -0,0 +1,24 @@
import os
from typing import List, Set, Dict, Tuple, Optional
from pprint import pprint
import argparse
import json
from jsonschema import validate
from knora import KnoraError, Knora
import sys


def main(args):
# parse the arguments of the command line
parser = argparse.ArgumentParser()
parser.add_argument("-s", "--server", type=str, default="http://0.0.0.0:3333", help="URL of the Knora server")

args = parser.parse_args(args)

# create the knora connection object
con = Knora(args.server)
con.login(args.user, args.password)
con.reset_triplestore_content()

if __name__ == '__main__':
main(sys.argv[1:])
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -31,6 +31,7 @@
entry_points={
'console_scripts': [
'knora-create-ontology=knora.create_ontology:main',
'knora-reset-triplestore=knora.reset_triplestore:main',
'knoractl=knora.knora_ctl:cli'
],
},
Expand Down

0 comments on commit d078e4a

Please sign in to comment.