Attean::API::MutableModel - Role representing mutable models
This document describes Attean::API::MutableModel version 0.010
use v5.14; use Attean;
This is a Moo role that mutable models consume. It defines the required methods for updating data, and provides default functionality.
This role consumes the Attean::API::Model role.
Classes consuming this role must provide the following methods:
add_quad( $quad )
Adds the Attean::API::Quad $quad to the model.
$quad
remove_quad( $quad )
Removes the Attean::API::Quad $quad from the model.
create_graph( $graph )
Creates a new, empty graph in the model with the Attean::API::BlankOrIRI identifier $graph. If the model does not support empty graphs, this operation may be a no-op.
$graph
drop_graph( $graph )
Removes the graph in the model with the Attean::API::BlankOrIRI identifier $graph.
clear_graph( $graph )
Removes all quads that belong to the graph in the model with the Attean::API::BlankOrIRI identifier $graph. If the model does not support empty graphs, this operation may be an alias for drop_graph( $graph ).
This role provides default implementations of the following methods:
load_triples( $format, $graph => $data )
Parses the serialized triples contained in the string $data using the $format parser (see "get_parser" in Attean). Triples resulting from parsing are turned into quads using the $graph identifier, and added to the model.
$data
$format
add_iter( $iter )
Adds all the quads from the Attean::API::QuadIterator $iter to the model.
$iter
add_list( $graph, @elements )
Adds an rdf:List encoded list of @elements to the model in the $graph. Returns the Attean::API::Blank head of the list.
@elements
Please report any bugs or feature requests to through the GitHub web interface at https://github.com/kasei/attean/issues.
http://www.perlrdf.org/
Gregory Todd Williams <gwilliams@cpan.org>
<gwilliams@cpan.org>
Copyright (c) 2014 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Attean, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Attean
CPAN shell
perl -MCPAN -e shell install Attean
For more information on module installation, please visit the detailed CPAN module installation guide.