---
name: "Attean::API::MutableModel"
section: "3pm"
platform: "linux"
package: "libattean-perl"
version: "0.035-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Attean::API::MutableModel"
---

# Attean::API::MutableModel(3pm)

Role representing mutable models

## NAME

Attean::API::MutableModel - Role representing mutable models

## VERSION

This document describes Attean::API::MutableModel version 0.035

## SYNOPSIS

```
  use v5.14;
  use Attean;
```

## DESCRIPTION

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 `$quad` to the model.

- 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.

- 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 )`.

## METHODS

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.

- "load\_triples\_from\_io( $format, $graph =\> $data )"

  Parses the serialized triples read from the filehandle `$io` 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.

- add\_iter( $iter )

  Adds all the quads from the Attean::API::QuadIterator `$iter` to the model.

- "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.

## BUGS

Please report any bugs or feature requests to through the GitHub web interface at \<https://github.com/kasei/attean/issues\>.

## SEE ALSO

## AUTHOR

Gregory Todd Williams  `"<gwilliams@cpan.org>"`

## COPYRIGHT

Copyright (c) 2014--2022 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
