Attean::API::MutableModel3pm
Role representing mutable models
Usage
use v5.14;use Attean;
Version
This document describes Attean::API::MutableModel version 0.035
Overview
This is a Moo role that mutable models consume. It defines the required methods for updating data, and provides default functionality.
Roles
This role consumes the Attean::API::Model role.
Required methods
Classes consuming this role must provide the following methods:
- add_quad( $quad )
-
Adds the Attean::API::Quad
$quadto the model.
- remove_quad( $quad )
-
Removes the Attean::API::Quad
$quadfrom 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.
- 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 fordrop_graph( $graph ).
Methods
This role provides default implementations of the following methods:
- "load_triples( $format, $graph => $data )"
-
Parses the serialized triples contained in the string
$datausing the$formatparser (see "get_parser" in Attean). Triples resulting from parsing are turned into quads using the$graphidentifier, and added to the model.
- "load_triples_from_io( $format, $graph => $data )"
-
Parses the serialized triples read from the filehandle
$iousing the$formatparser (see "get_parser" in Attean). Triples resulting from parsing are turned into quads using the$graphidentifier, and added to the model.
- add_iter( $iter )
-
Adds all the quads from the Attean::API::QuadIterator
$iterto the model.
- "add_list( $graph, @elements )"
-
Adds an rdf:List encoded list of
@elementsto the model in the$graph. Returns the Attean::API::Blank head of the list.
Releases
6 releases since Debian 8 (Jessie); the text changed 5 times.