Skip to content

Commit

Permalink
Merge pull request #504 from RDFLib/issue-495-graphs-method
Browse files Browse the repository at this point in the history
Re-added 'graphs' method as alias of 'contexts' to the Dataset object, fixes #495
  • Loading branch information
joernhees committed Aug 2, 2015
2 parents 53b56b9 + 7fa1bb0 commit fbc29da
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rdflib/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1625,9 +1625,12 @@ def remove_graph(self, g):
def contexts(self, triple=None):
default = False
for c in super(Dataset, self).contexts(triple):
default|=c.identifier == DATASET_DEFAULT_GRAPH_ID
default |= c.identifier == DATASET_DEFAULT_GRAPH_ID
yield c
if not default: yield self.graph(DATASET_DEFAULT_GRAPH_ID)
if not default:
yield self.graph(DATASET_DEFAULT_GRAPH_ID)

graphs = contexts

def quads(self, quad):
for s, p, o, c in super(Dataset, self).quads(quad):
Expand All @@ -1636,7 +1639,6 @@ def quads(self, quad):
else:
yield (s, p, o, c.identifier)


class QuotedGraph(Graph):
"""
Quoted Graphs are intended to implement Notation 3 formulae. They are
Expand Down

0 comments on commit fbc29da

Please sign in to comment.