Skip to content

Blank-nodes collisions #980

Closed
Closed
@nleguillarme

Description

@nleguillarme

Hi.

If I understand correctly the graphs merging process explained here, the following piece of code should create a graph with two distinct blank nodes :

from rdflib import Graph

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")

for triple in g:
    print(triple)

However, when executing the code, I get the following output :

(rdflib.term.BNode('Ne3fd8261b37741fca22d502483d88964'), rdflib.term.URIRef('http://purl.obolibrary.org/obo/RO_0002350'), rdflib.term.URIRef('http://www.gbif.org/species/0000002')) (rdflib.term.BNode('Ne3fd8261b37741fca22d502483d88964'), rdflib.term.URIRef('http://purl.obolibrary.org/obo/RO_0002350'), rdflib.term.URIRef('http://www.gbif.org/species/0000001'))

Am I missing something ? (versions : rdflib 4.2.2, python 3.7.5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions