Skip to content

Commit

Permalink
Fix Attean::Algebra::Update->blank_nodes (#70).
Browse files Browse the repository at this point in the history
  • Loading branch information
kasei committed Feb 12, 2016
1 parent 91a9293 commit 50a445f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/Attean/Algebra.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,19 @@ package Attean::Algebra::Update 0.012 {
}
}

around 'blank_nodes' => sub {
my $orig = shift;
my $self = shift;
my @blanks = $orig->($self, @_);
my %seen = map { $_->value => 1 } @blanks;
foreach my $data ($self->insert, $self->delete) {
my @triples = @{ $data };
my @b = grep { $_->does('Attean::API::Blank') } map { $_->values } @triples;
push(@blanks, grep { not $seen{$_->value}++ } @b);
}
return @blanks;
};

sub algebra_as_string {
my $self = shift;
state $S = {
Expand Down Expand Up @@ -1482,8 +1495,6 @@ package Attean::Algebra::Update 0.012 {
}
}

# DELETE WHERE

1;

__END__
Expand Down

0 comments on commit 50a445f

Please sign in to comment.