Skip to content

Commit 3f820d3

Browse files
committed
Adding calls to rdflib.store.Store __init__/add/remove
- Enables rdflib events
1 parent 53d98fc commit 3f820d3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

rdflib_sqlalchemy/store.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ def __init__(self, identifier=None, configuration=None, engine=None,
142142

143143
# XXX For backward compatibility we still support getting the connection string in constructor
144144
# TODO: deprecate this once refactoring is more mature
145-
if configuration:
146-
self.open(configuration)
145+
super(SQLAlchemy, self).__init__(configuration)
147146

148147
def __repr__(self):
149148
"""Readable serialisation."""
@@ -315,6 +314,7 @@ def destroy(self, configuration):
315314

316315
def add(self, triple, context=None, quoted=False):
317316
"""Add a triple to the store of triples."""
317+
super(SQLAlchemy, self).add(triple, context, quoted)
318318
subject, predicate, obj = triple
319319
_, statement, params = self._get_build_command(
320320
(subject, predicate, obj),
@@ -335,7 +335,9 @@ def add(self, triple, context=None, quoted=False):
335335
def addN(self, quads):
336336
"""Add a list of triples in quads form."""
337337
commands_dict = {}
338+
add_event = super(SQLAlchemy, self).add
338339
for subject, predicate, obj, context in quads:
340+
add_event((subject, predicate, obj), context)
339341
command_type, statement, params = self._get_build_command(
340342
(subject, predicate, obj),
341343
context,
@@ -367,6 +369,7 @@ def _add_ignore_on_conflict(self, statement):
367369

368370
def remove(self, triple, context):
369371
"""Remove a triple from the store."""
372+
super(SQLAlchemy, self).remove(triple, context)
370373
subject, predicate, obj = triple
371374

372375
if context is not None:

0 commit comments

Comments
 (0)