RDF::Query::Algebra::Load - Algebra class for LOAD operations


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

Index


Code Index:

NAME

Top

RDF::Query::Algebra::Load - Algebra class for LOAD operations

VERSION

Top

This document describes RDF::Query::Algebra::Load version 2.907.

METHODS

Top

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

new ( $url )

Returns a new LOAD structure.

construct_args

Returns a list of arguments that, passed to this class' constructor, will produce a clone of this algebra pattern.

sse

Returns the SSE string for this algebra expression.

as_sparql

Returns the SPARQL string for this algebra expression.

referenced_blanks

Returns a list of the blank node names used in this algebra expression.

referenced_variables
url
graph

AUTHOR

Top

 Gregory Todd Williams <gwilliams@cpan.org>


RDF-Query documentation Contained in the RDF-Query distribution.
# RDF::Query::Algebra::Load
# -----------------------------------------------------------------------------

package RDF::Query::Algebra::Load;

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

use Data::Dumper;
use Log::Log4perl;
use Scalar::Util qw(refaddr);
use Carp qw(carp croak confess);
use Scalar::Util qw(blessed reftype refaddr);
use Time::HiRes qw(gettimeofday tv_interval);
use RDF::Trine::Iterator qw(smap sgrep swatch);

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

our ($VERSION);
my %TRIPLE_LABELS;
my @node_methods	= qw(subject predicate object);
BEGIN {
	$VERSION	= '2.907';
}

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

sub new {
	my $class	= shift;
	my $url		= shift;
	my $graph	= shift;
	return bless([$url, $graph], $class);
}

sub construct_args {
	my $self	= shift;
	return ($self->url, $self->graph);
}

sub sse {
	my $self	= shift;
	my $context	= shift;
	my $indent	= shift;
	
	my $url		= $self->url;
	my $graph	= $self->graph;
	my $string;
	if ($graph) {
		$string	= sprintf(
			"(load <%s> <%s>)",
			$url->uri_value,
			$graph->uri_value,
		);
	} else {
		$string	= sprintf(
			"(load <%s>)",
			$url->uri_value,
		);
	}
	return $string;
}

sub as_sparql {
	my $self	= shift;
	my $context	= shift;
	my $indent	= shift;
	
	my $url		= $self->url;
	my $graph	= $self->graph;
	my $string;
	if ($graph) {
		$string	= sprintf(
			"LOAD <%s> INTO GRAPH <%s>",
			$url->uri_value,
			$graph->uri_value,
		);
	} else {
		$string	= sprintf(
			"LOAD <%s>",
			$url->uri_value,
		);
	}
	return $string;
}

sub referenced_blanks {
	my $self	= shift;
	return;
}

sub referenced_variables {
	my $self	= shift;
	return;
}

sub url {
	my $self	= shift;
	return $self->[0];
}

sub graph {
	my $self	= shift;
	return $self->[1];
}


1;

__END__