Skip to content

Commit

Permalink
working on prov store
Browse files Browse the repository at this point in the history
  • Loading branch information
cehbrecht committed Apr 12, 2024
1 parent c6f095d commit 4e99064
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions duck/db.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from rdflib import Graph, URIRef
from rdflib.plugins.sparql import prepareQuery

# from pywps import configuration
from pywps import configuration

# Provide the path to the SQLite database in the local folder
DB_URL = "sqlite:////var/lib/pywps/db/provenance.sqlite"
# DB_URL = "sqlite:////var/lib/pywps/db/provenance.sqlite"
# DB_URL = "sqlite:////tmp/provenance.sqlite"
# DB_URL = configuration.get_config_value("provenance", "db_uri")
DB_URL = configuration.get_config_value("logging", "database")


class GraphDB(object):
Expand Down
8 changes: 6 additions & 2 deletions duck/processes/wps_clintai.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
INFO_ROLE = "https://clint.dkrz.de/spec/crai/info"

models_list = list(craimodels.info_models().keys())
info_models_string = json.dumps(craimodels.metadata(), separators=(',', ':'))
info_models_string = json.dumps(craimodels.metadata(), separators=(",", ":"))


class ClintAI(Process):
def __init__(self):
Expand Down Expand Up @@ -214,7 +215,10 @@ def _handler(self, request, response):
start_time,
end_time,
)
prov.store_rdf()
try:
prov.store_rdf()
except Exception:
LOGGER.exception("failed to store provenance record!")
# prov end

response.update_status("done.", 100)
Expand Down

0 comments on commit 4e99064

Please sign in to comment.