RDFLib/rdflib — Issue #24: Add/Sub/Mul operators traceback
Author: gjhiggins
Created: 2012-02-20 08:30:43+00:00
State: open

azarot...@gmail.com, 2008-05-07T13:58:27.000Z

What steps will reproduce the problem?
1. Create two ConjunctiveGraphs, a and b
2. Add some triples to each
3. Try to add them together: c = a + b

What is the expected output? What do you see instead?

Expected: Create new graph called c.

Actual:
Traceback (most recent call last):
File "", line 1, in
File "build/bdist.linux-i686/egg/rdflib/Graph.py", line 406, in __add__
AttributeError: 'ConjunctiveGraph' object has no attribute 'graph'

What version of the product are you using? On what operating system?
2.4.0, Linux, Python 2.5.2

Please provide any additional information below.

The += operator on graphs works as expected, as it does not use the
non-existant .graph property.

Suggested Fix:

__add__, __mul__ and __sub__ should use the same triple iteration as
__iadd__ function

Comment 1 by eik...@gmail.com

Comment 2 by eik...@gmail.com

Comment 3 by gromgull
fixed in r1739