diff options
author | Jörn Hees <joernhees@users.noreply.github.com> | 2015-08-02 18:55:16 +0200 |
---|---|---|
committer | Jörn Hees <joernhees@users.noreply.github.com> | 2015-08-02 18:55:16 +0200 |
commit | fbc29da56a03929341e65e207684a5358bddcf26 (patch) | |
tree | 79ea3ed3f2897e010f7d329990794ddf6e385459 | |
parent | 53b56b9b049d0649b6946f7de4642355e5e63949 (diff) | |
parent | 7fa1bb08b55fea6db487337da5c1174a6d9d9295 (diff) | |
download | rdflib-fbc29da56a03929341e65e207684a5358bddcf26.tar.gz |
Merge pull request #504 from RDFLib/issue-495-graphs-method
Re-added 'graphs' method as alias of 'contexts' to the Dataset object, fixes #495
-rw-r--r-- | rdflib/graph.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rdflib/graph.py b/rdflib/graph.py index 68339eba..61a505fa 100644 --- a/rdflib/graph.py +++ b/rdflib/graph.py @@ -1625,9 +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) + + graphs = contexts def quads(self, quad): for s, p, o, c in super(Dataset, self).quads(quad): @@ -1636,7 +1639,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 |