Attean::API::Model - RDF Model
This document describes Attean::API::Model version 0.003_01
The Attean::API::Model role defines a common API for all RDF models to conform to. It is provides a consistent interface for probing, counting, and retrieving Attean::API::Quads matching a pattern, as well as related functionality such as enumerating the graph names, and extracting structured data from the models' quads.
The following methods are required by the Attean::API::Model role:
get_quads( $subject, $predicate, $object, $graph )
Returns an Attean::API::Iterator for quads in the model that match the supplied
Any of these terms may be:
* An Attean::API::Term object, in which case matching is equality-based
* A Attean::API::Variable object or
undef, in which case that term will be considered as a wildcard for the purposes of matching
* An ARRAY reference of Attean::API::Term objects, in which case the matching will be equality-based on the disjunction of the supplied terms
count_quads( $subject, $predicate, $object, $graph )
Returns the number of quads in the model matching the supplied pattern (using the same matching semantics as
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 )
get_sequence( $graph, $head )
subjects( $predicate, $object, $graph )
predicates( $subject, $object, $graph )
objects( $subject, $predicate, $graph )
graphs( $subject, $predicate, $object )
graph_nodes( $graph )
Please report any bugs or feature requests to through the GitHub web interface at https://github.com/kasei/attean/issues.
Gregory Todd Williams
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.