Open
Description
The introduction of deterministic longturtle serialisation in 7.1.3
introduces a bug where namespace prefixes are no longer applied.
The reproduction below shows the namespace prefixes working correctly in regular Turtle, but not in Longturtle. Downgrading to 7.1.1
makes the namespace prefixes work.
# Using rdflib==7.1.3 or rdflib==7.1.4
from rdflib import Graph, Namespace, URIRef
graph = Graph()
graph.add((
URIRef("https://example.com/subject"),
URIRef("https://example.com/predicate"),
URIRef("https://example.com/object")
))
graph.bind("ex", Namespace("https://example.com/"))
print(graph.serialize(format="turtle"))
# @prefix ex: <https://example.com/> .
#
# ex:subject ex:predicate ex:object .
print(graph.serialize(format="longturtle"))
# PREFIX ns1: <https://example.com/>
#
# ns1:subject
# ns1:predicate ns1:object ;
# .
Metadata
Metadata
Assignees
Labels
No labels