RDF::Query::Expression::Nary - Class for n-ary expressions


RDF-Query documentation Contained in the RDF-Query distribution.

Index


Code Index:

NAME

Top

RDF::Query::Expression::Nary - Class for n-ary expressions

VERSION

Top

This document describes RDF::Query::Expression::Nary version 2.907.

METHODS

Top

Beyond the methods documented below, this class inherits methods from the RDF::Query::Expression class.

sse

Returns the SSE string for this algebra expression.

as_sparql

Returns the SPARQL string for this algebra expression.

AUTHOR

Top

 Gregory Todd Williams <gwilliams@cpan.org>


RDF-Query documentation Contained in the RDF-Query distribution.
# RDF::Query::Expression::Nary
# -----------------------------------------------------------------------------

package RDF::Query::Expression::Nary;

use strict;
use warnings;
no warnings 'redefine';
use base qw(RDF::Query::Expression);

use Data::Dumper;
use Scalar::Util qw(blessed);
use Carp qw(carp croak confess);

######################################################################

our ($VERSION);
BEGIN {
	$VERSION	= '2.907';
}

######################################################################

sub sse {
	my $self	= shift;
	my $context	= shift;
	
	return sprintf(
		'(%s %s)',
		$self->op,
		join(' ', map { $_->sse( $context ) } $self->operands),
	);
}

sub as_sparql {
	my $self	= shift;
	my $context	= shift;
	my $indent	= shift;
	my $op		= $self->op;
	my @args	= map { $_->as_sparql( $context, $indent ) } $self->operands;
	return join(" $op ", @args);
}


1;

__END__