@@ -243,9 +243,7 @@ has last_etag => ( is => 'rw', isa => Str, predicate => 'has_last_etag');
243
243
=item namespaces ( $namespace_map )
244
244
245
245
Gets or sets the namespaces that some serializers use for
246
- pretty-printing. Should be handed a L<URI::NamespaceMap> object. RDF,
247
- VoID, Hydra, DC Terms and XML Schema are added by the module and do
248
- not need to be declared.
246
+ pretty-printing. Should be handed a L<URI::NamespaceMap> object.
249
247
250
248
=cut
251
249
@@ -255,16 +253,14 @@ has 'namespaces' => (is => 'rw',
255
253
lazy => 1,
256
254
handles => {
257
255
' add_namespace_mapping' => ' add_mapping' ,
256
+ ' guess_namespaces' => ' guess_and_add' ,
258
257
' list_namespaces' => ' list_namespaces'
259
258
});
260
259
261
260
262
261
sub _build_namespaces {
263
262
my $self = shift ;
264
- my $nsmap = shift || URI::NamespaceMap-> new();
265
- $nsmap -> guess_and_add(' rdf' , ' void' , ' dct' , ' xsd' );
266
- $nsmap -> add_mapping(hydra => ' http://www.w3.org/ns/hydra/core#' );
267
- return $nsmap ;
263
+ return shift || URI::NamespaceMap-> new();
268
264
}
269
265
270
266
# Just a temporary compatibility hack
@@ -352,6 +348,7 @@ sub response {
352
348
$output_model -> add_statement($st );
353
349
}
354
350
my $cl = literal($counter , undef , ' http://www.w3.org/2001/XMLSchema#integer' );
351
+ $self -> guess_namespaces(' void' );
355
352
my $void = $self -> namespaces-> void;
356
353
$output_model -> add_statement(statement(iri($uri ),
357
354
iri($void -> triples),
@@ -715,7 +712,6 @@ sub _void_content {
715
712
}
716
713
717
714
if ($self -> has_fragments) {
718
- $self -> add_namespace_mapping(hydra => ' http://www.w3.org/ns/hydra/core#' );
719
715
$self -> _common_fragments_control($self -> _voidmodel);
720
716
}
721
717
0 commit comments