If triple's object contains XML special characters like '<' or '&, inserting of the triple fails. '<' and '&' should probably be encoded to '<' and '&'. I'm using Eemeli Kantola's kpwrapper [1], but it looks like the bug is in Node.py
>>> sc.insert(Triple('foo', 'bar', '&'))
/usr/lib/python2.6/site-packages/kp-0.9.2a1-py2.6.egg/kp/Node.pyc in send(self, payload, pl_type, encoding, confirm, expire_time)
341 parser = make_parser()
342 parser.setContentHandler(icf)
--> 343 parser.parse(StringIO.StringIO(rcvd['bnodes']))
344 if encoding.lower() == 'rdf-m3':
345 return (rcvd["status"], bnodes)
The full code for replicating this problem:
>>> from kpwrapper import SIBConnection, Triple
>>> sc = SIBConnection('', 'preconfigured')
Preconfigured discovery using config from /home/janne/.kprc
Got params: ('cloudsizzle', ('TCP', ('127.0.0.1', 10010)))
>>> sc.insert(Triple('foo', 'bar', '&'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.linux-x86_64/egg/kpwrapper/__init__.py", line 306, in insert
File "build/bdist.linux-x86_64/egg/kp/Node.py", line 343, in send
KeyError: 'bnodes'
moved to https://smart-m3.atlassian.net/browse/SMART-8