diff service/reasoning/reasoning.py @ 1055:e1693cc0b992

fix oneshot. more time reportin Ignore-this: c99ce7d8d31a8ed45bdcb8d0ad08a3aa darcs-hash:ae1b7c90ca9331b713af23a1f9a81cfb56380845
author drewp <drewp@bigasterisk.com>
date Tue, 09 Feb 2016 22:10:38 -0800
parents bbaf0576f653
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