.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Attean::QueryPlanner 3pm" .TH Attean::QueryPlanner 3pm "2022-10-06" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Attean::QueryPlanner \- Query planner .SH "VERSION" .IX Header "VERSION" This document describes Attean::QueryPlanner version 0.033 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 9 \& use v5.14; \& use Attean; \& my $planner = Attean::QueryPlanner\->new(); \& my $default_graphs = [ Attean::IRI\->new(\*(Aqhttp://example.org/\*(Aq) ]; \& my $plan = $planner\->plan_for_algebra( $algebra, $model, $default_graphs ); \& my $iter = $plan\->evaluate($model); \& while (my $result = $iter\->next()) { \& say $result\->as_string; \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The Attean::QueryPlanner class is a base class implementing common behavior for query planners. Subclasses will need to consume or compose the Attean::API::JoinPlanner role. .PP Trivial sub-classes may consume Attean::API::NaiveJoinPlanner, while more complex planners may choose to implement complex join planning (e.g. Attean::IDPQueryPlanner). .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SH "METHODS" .IX Header "METHODS" .ie n .IP """new_temporary( $type )""" 4 .el .IP "\f(CWnew_temporary( $type )\fR" 4 .IX Item "new_temporary( $type )" Returns a new unique (in the context of the query planner) \s-1ID\s0 string that may be used for things like fresh (temporary) variables. The \f(CW$type\fR string is used in the generated name to aid in identifying different uses for the names. .ie n .IP """plan_for_algebra( $algebra, $model, \e@active_graphs, \e@default_graphs )""" 4 .el .IP "\f(CWplan_for_algebra( $algebra, $model, \e@active_graphs, \e@default_graphs )\fR" 4 .IX Item "plan_for_algebra( $algebra, $model, @active_graphs, @default_graphs )" Returns the first plan returned from \f(CW\*(C`plans_for_algebra\*(C'\fR. .ie n .IP """plans_for_algebra( $algebra, $model, \e@active_graphs, \e@default_graphs )""" 4 .el .IP "\f(CWplans_for_algebra( $algebra, $model, \e@active_graphs, \e@default_graphs )\fR" 4 .IX Item "plans_for_algebra( $algebra, $model, @active_graphs, @default_graphs )" Returns Attean::API::Plan objects representing alternate query plans for evaluating the query \f(CW$algebra\fR against the \f(CW$model\fR, using the supplied \f(CW$active_graph\fR. .ie n .IP """simplify_path( $subject, $path, $object )""" 4 .el .IP "\f(CWsimplify_path( $subject, $path, $object )\fR" 4 .IX Item "simplify_path( $subject, $path, $object )" Return a simplified Attean::API::Algebra object corresponding to the given property path. .ie n .IP """new_projection( $plan, $distinct, @variable_names )""" 4 .el .IP "\f(CWnew_projection( $plan, $distinct, @variable_names )\fR" 4 .IX Item "new_projection( $plan, $distinct, @variable_names )" Return a new Attean::Plan::Project plan over \f(CW$plan\fR, projecting the named variables. \f(CW$disctinct\fR should be true if the caller can guarantee that the resulting plan will produce distinct results, false otherwise. .Sp This method takes care of computing plan metadata such as the resulting ordering. .ie n .IP """bgp_join_plans( $bgp, $model, \e@active_graphs, \e@default_graphs, \e@interesting_order, \e@plansA, \e@plansB, ... )""" 4 .el .IP "\f(CWbgp_join_plans( $bgp, $model, \e@active_graphs, \e@default_graphs, \e@interesting_order, \e@plansA, \e@plansB, ... )\fR" 4 .IX Item "bgp_join_plans( $bgp, $model, @active_graphs, @default_graphs, @interesting_order, @plansA, @plansB, ... )" Returns a list of alternative plans for the join of a set of triples. The arguments \f(CW@plansA\fR, \f(CW@plansB\fR, etc. represent alternative plans for each triple participating in the join. .ie n .IP """group_join_plans( $model, \e@active_graphs, \e@default_graphs, \e@interesting_order, \e@plansA, \e@plansB, ... )""" 4 .el .IP "\f(CWgroup_join_plans( $model, \e@active_graphs, \e@default_graphs, \e@interesting_order, \e@plansA, \e@plansB, ... )\fR" 4 .IX Item "group_join_plans( $model, @active_graphs, @default_graphs, @interesting_order, @plansA, @plansB, ... )" Returns a list of alternative plans for the join of a set of sub-plans. The arguments \f(CW@plansA\fR, \f(CW@plansB\fR, etc. represent alternative plans for each sub-plan participating in the join. .ie n .IP """joins_for_plan_alternatives( $model, \e@active_graphs, \e@default_graphs, $interesting, \e@plan_A, \e@plan_B, ... )""" 4 .el .IP "\f(CWjoins_for_plan_alternatives( $model, \e@active_graphs, \e@default_graphs, $interesting, \e@plan_A, \e@plan_B, ... )\fR" 4 .IX Item "joins_for_plan_alternatives( $model, @active_graphs, @default_graphs, $interesting, @plan_A, @plan_B, ... )" Returns a list of alternative plans that may all be used to produce results matching the join of \f(CW\*(C`plan_A\*(C'\fR, \f(CW\*(C` plan_B \*(C'\fR>, etc. Each plan array here (e.g. \f(CW@plan_A\fR) should contain equivalent plans. .ie n .IP """access_plans( $model, $active_graphs, $pattern )""" 4 .el .IP "\f(CWaccess_plans( $model, $active_graphs, $pattern )\fR" 4 .IX Item "access_plans( $model, $active_graphs, $pattern )" Returns a list of alternative Attean::API::Plan objects that may be used to produce results matching the Attean::API::TripleOrQuadPattern \f(CW$pattern\fR in the context of \f(CW$active_graphs\fR. .ie n .IP """join_plans( $model, \e@active_graphs, \e@default_graphs, \e@plan_left, \e@plan_right, $type [, $expr] )""" 4 .el .IP "\f(CWjoin_plans( $model, \e@active_graphs, \e@default_graphs, \e@plan_left, \e@plan_right, $type [, $expr] )\fR" 4 .IX Item "join_plans( $model, @active_graphs, @default_graphs, @plan_left, @plan_right, $type [, $expr] )" Returns a list of alternative plans for the join of one plan from \f(CW@plan_left\fR and one plan from \f(CW@plan_right\fR. The join \f(CW$type\fR must be one of \&\f(CW\*(Aqinner\*(Aq\fR, \f(CW\*(Aqleft\*(Aq\fR, or \f(CW\*(Aqminus\*(Aq\fR, indicating the join algorithm to be used. If \f(CW$type\fR is \f(CW\*(Aqleft\*(Aq\fR, then the optional \f(CW$expr\fR may be used to supply a filter expression that should be used by the \s-1SPARQL\s0 left-join algorithm. .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests to through the GitHub web interface at . .SH "SEE ALSO" .IX Header "SEE ALSO" .SH "AUTHOR" .IX Header "AUTHOR" Gregory Todd Williams \f(CW\*(C`\*(C'\fR .SH "COPYRIGHT" .IX Header "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.