Toby Inkster > RDF-TrineX-Serializer-MockTurtleSoup > RDF::TrineX::Serializer::MockTurtleSoup

Download:
RDF-TrineX-Serializer-MockTurtleSoup-0.005.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.005   Source  

NAME ^

RDF::TrineX::Serializer::MockTurtleSoup - he's a bit slow, but he's sure good lookin'

SYNOPSIS ^

 use RDF::TrineX::Serializer::MockTurtleSoup;
 
 my $ser = "RDF::TrineX::Serializer::MockTurtleSoup"->new(%opts);
 $ser->serialize_model_to_file($fh, $model);

DESCRIPTION ^

Like RDF::Trine::Serializer::Turtle but real pretty.

And slower.

And probably breaks with some complex graphs.

What's so pretty?

Options

The constructor supports the following options:

abbreviate

This option will be used as the right-hand side of a smart match to test URIs to see if they should be abbreviated to QNames.

URIs used as predicates or as the object of rdf:type triples are always abbreviated anyway. URIs which cannot be abbreviated to a legal QName will just be output as URIs.

apostrophe

Boolean; if true, then the serializer will sometimes quote literals with an apostrophe instead of double-quote marks. This is allowed by recent versions of the Turtle spec, but was disallowed by earlier specifications, and not widely supported yet. Defaults to false.

colspace

This allows your predicate-object pairs to line up as nice columns. The smaller the number, the closer they get. Default is 20.

encoding

Either "ascii" or "utf8". Default is "utf8".

indent

A whitespace string to indent by. The default is one tab character. (God's chosen indentation.)

labelling

This option will be used as the right-hand side of a smart match to determine which URIs are considered to be equivalent to rdfs:label. The default is just http://www.w3.org/2000/01/rdf-schema#label.

namespaces

A hashref of prefix => URI pairs to define preferred QName prefixes. There is no guarantee that these will be honoured, but they usually will. RDF::Prefixes does a damn good job without any help, so this is generally pretty unnecessary.

priorities

If defined, must be a coderef. The coderef will be called with arguments: the serializer object itself, a node and the RDF::Trine::Model being serialized.

The coderef can use data within the model to determine how "interesting" the node is. High numbers are very interesting. Negitive numbers are very boring.

Interesting nodes are more likely to appear earlier on in the output.

Default is undef.

repeats

Boolean. If false (the default), will output data like:

 <http://example.com/>
    dc:title "Cat"@en, "Chat"@fr.

If true, will output data like:

 <http://example.com/>
    dc:title "Cat"@en;
    dc:title "Chat"@fr.

Methods

This module provides the same API as RDF::Trine::Serializer.

BUGS ^

Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=RDF-TrineX-Serializer-MockTurtleSoup.

SEE ALSO ^

RDF::Trine::Serializer::Turtle.

AUTHOR ^

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE ^

This software is copyright (c) 2013 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

DISCLAIMER OF WARRANTIES ^

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

syntax highlighting: