Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a 'graphs' method to the Dataset object #504

Merged
merged 2 commits into from
Aug 2, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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