summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Car <nicholas.car@surroundaustralia.com>2021-12-10 23:25:12 +1000
committerGitHub <noreply@github.com>2021-12-10 23:25:12 +1000
commit60397f5eb2f6c4eb8f282811b40c6914c74f8283 (patch)
tree8eafc6a2c2b15a0b8494474237462e2f4be9e85a
parent327de4ecc9e7a9a7c73b55d1b59b6e1e600f64ed (diff)
parent5db73199f0036cfb68c5c68e99ff31d422f5261b (diff)
downloadrdflib-60397f5eb2f6c4eb8f282811b40c6914c74f8283.tar.gz
Merge pull request #1495 from RDFLib/issue_980
demo 980 resolution
-rw-r--r--test/test_980.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/test_980.py b/test/test_980.py
new file mode 100644
index 00000000..3c60a849
--- /dev/null
+++ b/test/test_980.py
@@ -0,0 +1,28 @@
+from rdflib import Graph
+
+
+def test_980():
+ """
+ The problem that this test ensures rdflib solves is that, previous to PR #1108, the
+ parsing of two triples with the same n-triples Blank Nodes IDs, here _:0, would
+ result in triples with the same rdflib internal BN IDs, e.g.
+ rdflib.term.BNode('Ne3fd8261b37741fca22d502483d88964'), see the Issue #980. They
+ should have different IDs.
+ """
+ graph1 = """
+ _:0 <http://purl.obolibrary.org/obo/RO_0002350> <http://www.gbif.org/species/0000001> .
+ """
+ graph2 = """
+ _:0 <http://purl.obolibrary.org/obo/RO_0002350> <http://www.gbif.org/species/0000002> .
+ """
+
+ g = Graph()
+ g.parse(data=graph1, format="nt")
+ g.parse(data=graph2, format="nt")
+
+ subs = 0
+ for s in g.subjects(None, None):
+ subs += 1
+
+ # we must see two different BN subjects
+ assert subs == 2