Skip to content

Commit

Permalink
Fixed one last database_util issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmccu committed Sep 11, 2024
1 parent a6ce19e commit 88eb4bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion whyis/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__='2.3.5'
__version__='2.3.6'

if __name__ == '__main__':
print(__version__)
9 changes: 6 additions & 3 deletions whyis/database/database_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,20 @@ def publish(data, format='text/trig;charset=utf-8'):

def put(graph):
g = ConjunctiveGraph(store=graph.store)
data = g.serialize(format='trig')
data = g.serialize(format='turtle')
print(data)
s = requests.session()
s.keep_alive = False

kwargs = dict(
headers={'Content-Type':'text/trig;charset=utf-8'},
headers={'Content-Type':'text/turtle;charset=utf-8'},
)
if store.auth is not None:
kwargs['auth'] = store.auth
r = s.put(store.query_endpoint, data=data, **kwargs)
r = s.put(store.query_endpoint,
params=dict(graph=graph.identifier),
data=data,
**kwargs)
if not r.ok:
print(f"Error: {store.query_endpoint} PUT returned status {r.status_code}:\n{r.text}")
else:
Expand Down

0 comments on commit 88eb4bc

Please sign in to comment.