1Attean::Expression(3) User Contributed Perl DocumentationAttean::Expression(3)
2
3
4
6 Attean::Expression - SPARQL Expressions
7
9 This document describes Attean::Expression version 0.025
10
12 use v5.14;
13 use Attean;
14
15 my $binding = Attean::Result->new();
16 my $value = Attean::ValueExpression->new( value => Attean::Literal->integer(2) );
17 my $plus = Attean::BinaryExpression->new( children => [$value, $value], operator => '+' );
18 my $result = $plus->evaluate($binding);
19 say $result->numeric_value; # 4
20
22 This is a utility package that defines all the Attean SPARQL expression
23 classes consisting of logical, numeric, and function operators,
24 constant terms, and variables. Expressions may be evaluated in the
25 context of a Attean::API::Result object, and either return a
26 Attean::API::Term object or throw a type error exception.
27
28 The expression classes are:
29
30 · Attean::ValueExpression
31
32 · Attean::UnaryExpression
33
34 · Attean::BinaryExpression
35
36 · Attean::FunctionExpression
37
39 Please report any bugs or feature requests to through the GitHub web
40 interface at <https://github.com/kasei/attean/issues>.
41
44 Gregory Todd Williams "<gwilliams@cpan.org>"
45
47 Copyright (c) 2014--2019 Gregory Todd Williams. This program is free
48 software; you can redistribute it and/or modify it under the same terms
49 as Perl itself.
50
51
52
53perl v5.30.0 2019-10-31 Attean::Expression(3)