1Attean::API::Binding(3)User Contributed Perl DocumentatioAnttean::API::Binding(3)
2
3
4
6 Attean::API::Binding - Name to term bindings
7
9 This document describes Attean::API::Binding version 0.030
10
12 The Attean::API::Binding role defines a common API for all objects that
13 map names to Attean::API::Term objects. This includes triples, quads,
14 and SPARQL results (variable bindings).
15
17 Classes consuming this role must provide the following methods:
18
19 "value( $name )"
20 Returns the Attean::API::Term object mapped to the variable named
21 $name, or "undef" if no such term is mapped.
22
23 "variables"
24 Returns a list of the variable names mapped to Attean::API::Term
25 objects in this mapping.
26
27 "apply_map( $mapper )"
28 Returns a new mapping object (of the same class as the referent)
29 with term objects rewritten using the supplied Attean::Mapper
30 object $mapper.
31
33 This role provides default implementations of the following methods:
34
35 "mapping"
36 Returns a HASH mapping variable names to Attean::API::Term objects.
37
38 "values"
39 Returns a list of Attean::API::Term objects corresponding to the
40 variable names returned by the referent's "variables" method.
41
42 "tuples_string"
43 Returns a string serialization of the Attean::API::Term objects in
44 the order they are returned by the referent's "values" method.
45
46 "as_string"
47 Returns a string serialization of the variable bindings.
48
49 "has_blanks"
50 Returns true if any variable is bound to an Attean::API::Blank
51 term, false otherwise.
52
53 "is_ground"
54 Returns tue is all the bound values consume Attean::API::Term,
55 false otherwise.
56
57 "values_consuming_role( $role )"
58 Returns the list of bound values that consume $role.
59
60 "tree_attributes"
61 Returns the variables which are bound in this object.
62
63 "apply_bindings( $binding )"
64 Construct a new binding by replacing variables with their bound
65 values from $binding.
66
67 "parse ( $string )"
68 Returns a triple or quad pattern object using the variables and/or
69 terms parsed from $string in SPARQL syntax.
70
71 "project( @keys )"
72 Returns a new Attean::Result binding which contains variable-value
73 mappings from the invocant for every variable name in @keys.
74
76 Please report any bugs or feature requests to through the GitHub web
77 interface at <https://github.com/kasei/attean/issues>.
78
81 Gregory Todd Williams "<gwilliams@cpan.org>"
82
84 Copyright (c) 2014--2020 Gregory Todd Williams. This program is free
85 software; you can redistribute it and/or modify it under the same terms
86 as Perl itself.
87
88
89
90perl v5.32.1 2021-02-08 Attean::API::Binding(3)