Skip to content

Commit

Permalink
Support for multiple nanopublications in agent output.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmccu committed Nov 7, 2024
1 parent 507090c commit 439cff2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 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.14'
__version__='2.3.15'

if __name__ == '__main__':
print(__version__)
4 changes: 3 additions & 1 deletion whyis/autonomic/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,23 @@ def process_instance(self, i, inputGraph):
output_nanopub = self.create_output_nanopub()
o = output_nanopub.assertion.resource(i.identifier) # OutputClass(i.identifier)
error = False
new_nps = []
try:
result = self.process_nanopub(i, o, output_nanopub)
for new_np in flask.current_app.nanopub_manager.prepare(rdflib.ConjunctiveGraph(store=output_nanopub.store)):
if len(new_np.assertion) == 0 and not error:
continue
self.explain(new_np, i, o)
new_np.add((new_np.identifier, sio.isAbout, i.identifier))
new_nps.append(new_np)
# print new_np.serialize(format="trig")
except Exception as e:
output_nanopub.add(
(output_nanopub.assertion.identifier, flask.current_app.NS.sioc.content, rdflib.Literal(str(e))))
logging.exception("Error processing resource %s in nanopub %s" % (i.identifier, inputGraph.identifier))
error = True
if not self.dry_run:
flask.current_app.nanopub_manager.publish(output_nanopub)
flask.current_app.nanopub_manager.publish(new_nps)
else:
print("Not publishing",output_nanopub.identifier,", dry run.")
results = [output_nanopub]
Expand Down

0 comments on commit 439cff2

Please sign in to comment.