Skip to content

Commit

Permalink
Fix LongTurtle multi-BN object serialization bug (#2700)
Browse files Browse the repository at this point in the history
* fix bug

* fix tests
  • Loading branch information
nicholascar committed Mar 12, 2024
1 parent 03673dc commit afeb777
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions rdflib/plugins/serializers/longturtle.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ def objectList(self, objects):
if count > 1:
if not isinstance(objects[0], BNode):
self.write("\n" + self.indent(1))
else:
self.write(" ")
first_nl = True
self.path(objects[0], OBJECT, newline=first_nl)
for obj in objects[1:]:
Expand Down
6 changes: 3 additions & 3 deletions test/test_serializers/test_serializer_longturtle.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def test_longturtle():
ex:nicholas
a sdo:Person ;
sdo:age 41 ;
sdo:alternateName
sdo:alternateName
[
sdo:name "Dr N.J. Car" ;
] ,
Expand All @@ -190,7 +190,7 @@ def test_longturtle():
sdo:name
[
a cn:CompoundName ;
sdo:hasPart
sdo:hasPart
[
a cn:CompoundName ;
rdf:value "Nicholas" ;
Expand All @@ -201,7 +201,7 @@ def test_longturtle():
] ,
[
a cn:CompoundName ;
sdo:hasPart
sdo:hasPart
[
a cn:CompoundName ;
rdf:value "Car" ;
Expand Down

0 comments on commit afeb777

Please sign in to comment.