Skip Menu |

This queue is for tickets about the RDF-Core CPAN distribution.

Report information
The Basics
Id: 35817
Status: new
Priority: 0/
Queue: RDF-Core

People
Owner: Nobody in particular
Requestors: cpan [...] jamesmith.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.51
Fixed in: (no value)



Subject: RDF::Core::Serializer populates Subjects hash with empty arrays
In RDF/Core/Serializer.pm (starting at line 136): while (defined $stmt) { if ($self->getSubjects->{$stmt->getSubject->getURI}->[2]) { $retval = $_; last; } $stmt = $enum->getNext; } should be: while (defined $stmt) { if (exists ${$self->getSubjects}{$stmt->getSubject->getURI} && $self->getSubjects->{$stmt->getSubject->getURI}->[2]) { $retval = $_; last; } $stmt = $enum->getNext; } This prevents $stmt->getSubject from being populated by keys pointing to empty arrays. The empty arrays cause problems elsewhere when they are assumed to have a RDF::Core::Resource object at the 0 index. This only arises when trying to serialize a part of a model instead of the complete model. A possible work around is to add all subjects to the getSubjects hash and mark them as serialized before serializing if they aren't supposed to be in the resulting serialization.