diff options
author | Ivan Herman <ivan@ivan-herman.net> | 2015-08-01 13:17:03 +0200 |
---|---|---|
committer | Ivan Herman <ivan@ivan-herman.net> | 2015-08-01 13:17:03 +0200 |
commit | 41c6466f804bb86aa9e2cfca023c77ba5160a19b (patch) | |
tree | 2bf501d3ff21782d7d10ba2c09c918c3ada952c0 | |
parent | 53b56b9b049d0649b6946f7de4642355e5e63949 (diff) | |
download | rdflib-41c6466f804bb86aa9e2cfca023c77ba5160a19b.tar.gz |
Added a 'graphs' method to the Dataset object (the documentation already had it...)
-rw-r--r-- | rdflib/graph.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rdflib/graph.py b/rdflib/graph.py index 68339eba..80f21b60 100644 --- a/rdflib/graph.py +++ b/rdflib/graph.py @@ -1629,6 +1629,13 @@ class Dataset(ConjunctiveGraph): yield c 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) + def quads(self, quad): for s, p, o, c in super(Dataset, self).quads(quad): if c.identifier==self.default_context: @@ -1636,7 +1643,6 @@ class Dataset(ConjunctiveGraph): else: yield (s, p, o, c.identifier) - class QuotedGraph(Graph): """ Quoted Graphs are intended to implement Notation 3 formulae. They are |