The Attean::API::Model role provides default implementations of the following methods:
"get_bindings( $subject, $predicate, $object, $graph )"
Returns an Attean::API::Iterator of Attean::API::Result objects corresponding to quads in the model
matching the supplied pattern. For each Attean::API::Variable in the pattern list, a mapping will be
present in the corresponding result object. For example, "$model->get_bindings( variable('s') )" will
return an iterator of results containing just a mapping from 's' to subjects of all quads in the
model.
"get_list( $graph, $head )"
Returns an Attean::API::Iterator of Attean::API::Term objects that are members of the rdf:List with
the specified $head (and matching restricted to only the specified $graph).
To check if a certain term is a list, the "holds" method may be used, for example:
$model->holds($head, iri('http://www.w3.org/1999/02/22-rdf-syntax-ns#first'), undef, $graph))
will return true if a given term $head is a list.
"get_sequence( $graph, $head )"
Returns an Attean::API::Iterator of Attean::API::Term objects that are members of the rdf:Sequence
with the specified $head (and matching restricted to only the specified $graph).
"subjects( $predicate, $object, $graph )"
Returns an Attean::API::Iterator of Attean::API::Term objects of all subjects of quads matching the
supplied pattern (using the same matching semantics as "get_quads").
The objects returned will not necessarily be unique. It will instead be equivalent to calling
"get_quads" and accessing "$quad->subject" for each $quad value returned by the iterator. For an
iterator of unique subjects, use "$model->subjects->uniq".
"predicates( $subject, $object, $graph )"
Returns an Attean::API::Iterator of Attean::API::Term objects of all predicates of quads matching the
supplied pattern (using the same matching semantics as "get_quads" with an "undef" predicate).
The objects returned will not necessarily be unique (see the note for "subjects" above).
"objects( $subject, $predicate, $graph )"
Returns an Attean::API::Iterator of Attean::API::Term objects of all objects of quads matching the
supplied pattern (using the same matching semantics as "get_quads" with an "undef" object).
The objects returned will not necessarily be unique (see the note for "subjects" above).
"graphs( $subject, $predicate, $object )"
Returns an Attean::API::Iterator of Attean::API::Term objects of all graphs of quads matching the
supplied pattern (using the same matching semantics as "get_quads" with an "undef" graph).
The objects returned will not necessarily be unique (see the note for "subjects" above).
graph_nodes( $graph )
Returns an Attean::API::Iterator of Attean::API::Term objects of unique subjects and objects present
in the specified $graph.
"holds($s, $p, $o, $g)"
holds($triple_pattern)
holds($quad_pattern)
Returns true if the triple/quad pattern matches any data in the model, false otherwise.
"algebra_holds($algebra, $graph)"
"algebra_holds($algebra, \@graphs)"
Returns true if the algebra, evaluated with the supplied default graph(s) matches any data in the
model, false otherwise. This is equivalent to the result of an ASK query over the supplied algebra.
"evaluate($algebra, [ $default_graph | \@default_graphs ])"
Returns an Attean::API::Iterator of Attean::Result objects which result from evaluating the given
query algebra (e.g. one obtained from parsing a query with AtteanX::Parser::SPARQL) with the supplied
default graph(s) against data in the model.