MooseX::Semantic::Role::RdfBackend - Associate a class with a RDF::Trine::Store
# My/Model/Person.pm package My::Model::Person; use Moose; with qw(MooseX::Semantic::Role::RdfBackend); __PACKAGE__->rdf_store({ storetype => 'DBI', name => 'semantic_moose', dsn => 'dbi:SQLite:dbname=t/data/semantic_moose.sqlite', username => 'FAKE', password => 'FAKE', }); ... # your script my $p = My::Model::Person->new( rdf_about => 'http://mydomain.org/data/John' ); $p->store(); my $x = My::Model::Person->new_from_store( 'http://mydomain.org/data/John' ); print $x->rdf_about # prints "<http://mydomain.org/data/John>"
Reference to a lazily built RDF::Trine::Store object. Can be instantiated with everything that RDF::Trine::Store's new method accepts, i.e. a DSN-like string, a hash reference of options or a blessed object.
new
new_from_store( $uri )
Searches the RDF store for a resource $uri and tries to instantiate an object using the new_from_model method of MooseX::Semantic::Role::RdfImport.
$uri
new_from_model
Exports an instance to RDF into the model underlying the RDF store.
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.