MooseX::Semantic::Role::RdfExport - Role for exporting Moose objects to RDF
package My::Model::Person; use Moose; with qw(MooseX::Semantic::Role::RdfExport); has name => ( traits => ['Semantic'], is => 'rw', isa => 'Str', uri => 'http://xmlns.com/foaf/0.1/name', uri_writer => ['http://myont.org/onto#name'], ); package main; my $p = My::Model::Person->new( rdf_about => 'http://myont.org/data/John', name => 'John' ); print $p->export_to_string(format=>'turtle'); # <http://myont.org/data/John> <http://myont.org/onto#name> "John"^^<http://www.w3.org/2001/XMLSchema#string> ; # <http://xmlns.com/foaf/0.1/name> "John"^^<http://www.w3.org/2001/XMLSchema#string> .
export_to_model($model, %opts)
Exports the object to RDF in model $model.
$model
For %opts see "EXPORT OPTIONS" below.
%opts
export_to_string( %opts )
For %opts, see "EXPORT OPTIONS" below.
TODO
Format string to be passed to RDF::Trine::Parser, e.g. turtle or rdfxml. Defaults to nquads.
turtle
rdfxml
nquads
Additional options for the RDF::Trine::Serializer to be used.
Optional URI of the named graph this export should be exported into.
Konstantin Baierer (<kba@cpan.org>)
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perldoc perlartistic.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install MooseX::Semantic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Semantic
CPAN shell
perl -MCPAN -e shell install MooseX::Semantic
For more information on module installation, please visit the detailed CPAN module installation guide.