Whenever I try to add triple into the store using following code it gives me following error. Could you please help me in this regard. Thanks in advance.
store = plugin.get('IOMemory',Store)()
store.add((abc, FOAF['knows'],def))
Error:
Traceback (most recent call last):
File "C:\Python27\internetcode.py", line 114, in <module>
store.add((abc, FOAF['knows'],def))
TypeError: add() takes at least 3 arguments (2 given)
So first, you need to know that when python says that a method takes 3 arguments, it really means two argument plus the instance argument (usually
self). You are currently passing the instance (store) plus a three element tuple:(abc, FOAF['knows'], def), which counts as one argument.store.add()needs a third argument. That’s what the error message is trying to tell you. I don’t know what it needs, but the documentation should be able to explain further.If nothing else, you can try
store.add((abc, FOAF['knows'], def), None), and see if that causes a new error.