Attean...:Model(3pm)
πΈ NAME πΈ
Okay so this is the Attean...:Model(3pm) page, filed under User Contributed Perl Documentation, and the main character is Attean::API::Model β RDF Model. Periodt. π
π VERSION π
This document describes Attean::API::Model version 0.035. Slay. β¨
π¦ DESCRIPTION π¦
The Attean::API::Model role defines a common API that all RDF models conform to. It gives you a consistent interface for probing, counting, and retrieving Attean::API::Quads that match a pattern, plus related functionality like enumerating graph names and extracting structured data from the models' quads. It's giving very organized, very useful, no cap. π
β¨ REQUIRED METHODS β¨
The following methods are required by the Attean::API::Model role:
get_quads( $subject, $predicate, $object, $graph )β Returns anAttean::API::Iteratorfor quads in the model that match the supplied$subject,$predicate,$object, and$graph.
Any of these terms may be:
- An
Attean::API::Termobject, in which case matching is equality-based. - An
Attean::API::Variableobject orundef, in which case that term will be considered a wildcard for matching purposes. - An
ARRAYreference ofAttean::API::Termobjects, in which case matching will be equality-based on the disjunction of the supplied terms.
The returned iterator conforms to both Attean::API::Iterator and Attean::API::QuadIterator. Iconic behavior honestly. π«Ά
count_quads( $subject, $predicate, $object, $graph )β Returns the number of quads in the model matching the supplied pattern, using the same matching semantics asget_quads.count_quads_estimate( $subject, $predicate, $object, $graph )β Returns an estimate of the number of quads in the model matching the supplied pattern, using the same matching semantics asget_quads. This estimate is guaranteed to be non-zero if the count returned from an equivalent call tocount_quadswould return a non-zero result.get_graphsβ Returns anAttean::API::Iteratorof distinctAttean::API::Termobjects that are used in the graph position of quads in the model.
π METHODS π
The Attean::API::Model role provides default implementations of the following methods:
get_bindings( $subject, $predicate, $object, $graph )β Returns anAttean::API::IteratorofAttean::API::Resultobjects corresponding to quads in the model matching the supplied pattern. For eachAttean::API::Variablein the pattern list, a mapping will be present in the corresponding result object. For example,$model->get_bindings( variable('s') )returns an iterator of results containing just a mapping from's'to subjects of all quads in the model. Cute and efficient, bestie. πget_list( $graph, $head )β Returns anAttean::API::IteratorofAttean::API::Termobjects that are members of therdf:Listwith the specified$head, with 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 anAttean::API::IteratorofAttean::API::Termobjects that are members of therdf:Sequencewith the specified$head, with matching restricted to only the specified$graph.subjects( $predicate, $object, $graph )β Returns anAttean::API::IteratorofAttean::API::Termobjects of all subjects of quads matching the supplied pattern, using the same matching semantics asget_quads.
Heads up: 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. Not me explaining duplicates, but also yes. π
predicates( $subject, $object, $graph )β Returns anAttean::API::IteratorofAttean::API::Termobjects of all predicates of quads matching the supplied pattern, using the same matching semantics asget_quadswith anundefpredicate.
The objects returned will not necessarily be unique β see the note for subjects above.
objects( $subject, $predicate, $graph )β Returns anAttean::API::IteratorofAttean::API::Termobjects of all objects of quads matching the supplied pattern, using the same matching semantics asget_quadswith anundefobject.
The objects returned will not necessarily be unique β see the note for subjects above.
graphs( $subject, $predicate, $object )β Returns anAttean::API::IteratorofAttean::API::Termobjects of all graphs of quads matching the supplied pattern, using the same matching semantics asget_quadswith anundefgraph.
The objects returned will not necessarily be unique β see the note for subjects above.
graph_nodes( $graph )β Returns anAttean::API::IteratorofAttean::API::Termobjects 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. Vibe check passed? True. π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 anAttean::API::IteratorofAttean::API::Resultobjects which result from evaluating the given query algebra β for example, one obtained from parsing a query withAtteanX::Parser::SPARQLβ with the supplied default graph(s) against data in the model.
π BUGS π
Please report any bugs or feature requests through the GitHub web interface at https://github.com/kasei/attean/issues. Do it for the plot, bestie. π
π SEE ALSO π
No entries are listed here in the original page. It's giving empty section, and that's canon. π
π AUTHOR π
Gregory Todd Williams "<gwilliams@cpan.org>" β king behavior. π
π 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.
π Cute little footer moment: this page comes from perl v5.40.0, dated 2025-01-26, and it's the Attean...:Model(3pm) page. Bye bestie, go read some quads. π
π¦ where this page comes from
- debian trixie: libattean-perl 0.035-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libattean-perl 0.035-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libattean-perl 0.035-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms