From 7fa1bb08b55fea6db487337da5c1174a6d9d9295 Mon Sep 17 00:00:00 2001 From: Joern Hees Date: Sun, 2 Aug 2015 15:02:32 +0200 Subject: made Dataset.graphs an alias of Dataset.contexts --- rdflib/graph.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/rdflib/graph.py b/rdflib/graph.py index 80f21b60..61a505fa 100644 --- a/rdflib/graph.py +++ b/rdflib/graph.py @@ -1625,16 +1625,12 @@ class Dataset(ConjunctiveGraph): 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) - def graphs(self, triple=None) : - default = False - for c in super(Dataset, self).contexts(triple): - default|=c.identifier == DATASET_DEFAULT_GRAPH_ID - yield c - 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): -- cgit v1.2.1