diff options
author | Mark Watts <watts.mark2015@gmail.com> | 2020-05-31 17:24:19 -0500 |
---|---|---|
committer | Mark Watts <watts.mark2015@gmail.com> | 2020-05-31 17:24:19 -0500 |
commit | 1bd87331e3758ad78bf178d40752f4a075441fad (patch) | |
tree | f060e65e23c51dcff8337c570f714466b1eca99f | |
parent | 037ea51e5f4863a7f98ff59972fcd34d39a7ed97 (diff) | |
download | rdflib-1bd87331e3758ad78bf178d40752f4a075441fad.tar.gz |
Making ntriples parser BNode context per-instance (#980)
-rw-r--r-- | rdflib/plugins/parsers/ntriples.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rdflib/plugins/parsers/ntriples.py b/rdflib/plugins/parsers/ntriples.py index 41c529a7..e2ee5ff3 100644 --- a/rdflib/plugins/parsers/ntriples.py +++ b/rdflib/plugins/parsers/ntriples.py @@ -122,9 +122,12 @@ class NTriplesParser(object): sink = p.parse(f) # file; use parsestring for a string """ - _bnode_ids = {} + def __init__(self, sink=None, bnode_context=None): + if bnode_context is not None: + self._bnode_ids = bnode_context + else: + self._bnode_ids = {} - def __init__(self, sink=None): if sink is not None: self.sink = sink else: |