diff service/reasoning/reasoning.py @ 250:c1287ab87add

fix oneshot. more time reportin Ignore-this: c99ce7d8d31a8ed45bdcb8d0ad08a3aa
author drewp@bigasterisk.com
date Tue, 09 Feb 2016 22:10:38 -0800
parents e5c27d2f11ab
children 254df9f881a6
line wrap: on
line diff
--- a/service/reasoning/reasoning.py	Tue Feb 09 22:01:19 2016 -0800
+++ b/service/reasoning/reasoning.py	Tue Feb 09 22:10:38 2016 -0800
@@ -291,7 +291,7 @@
 def parseRdf(text, contentType):
     g = Graph()
     g.parse(StringInputSource(text), format={
-        'text/n3': ['n3'],
+        'text/n3': 'n3',
         }[contentType])
     return g
 
@@ -314,7 +314,9 @@
             if not len(g):
                 log.warn("incoming oneshot graph had no statements: %r", self.request.body)
                 return
+            t1 = time.time()
             self.settings.reasoning.inputGraph.addOneShot(g)
+            self.set_header('x-graph-ms', str(1000 * (time.time() - t1)))
         except Exception as e:
             log.error(e)
             raise