subtype 'RelationshipVector',
=> as 'ArrayRef',
=> where { @$_ == 2
- && $_->[0]->isa( 'Text::Tradition::Collation::Reading' )
- && $_->[1]->isa( 'Text::Tradition::Collation::Reading' )
+ && $_->[0]->isa( 'Graph::Easy::Node' )
+ && $_->[1]->isa( 'Graph::Easy::Node' )
},
message { 'Argument should be [ SourceReading, TargetReading ]' };
no Moose::Util::TypeConstraints; ## see comment above
-has 'sort' => (
+has 'type' => (
is => 'rw',
isa => 'RelationshipType',
required => 1,
);
-has 'orig_relation' => (
+has 'this_relation' => (
is => 'rw',
isa => 'RelationshipVector',
required => 1,
);
-has 'related_readings' => (
+has 'primary_relation' => (
is => 'rw',
isa => 'RelationshipTokenVector',
);
default => 0,
);
+has 'non_correctable' => (
+ is => 'rw',
+ isa => 'Bool',
+ );
+
+has 'non_independent' => (
+ is => 'rw',
+ isa => 'Bool',
+ );
+
+has 'equal_rank' => (
+ is => 'rw',
+ isa => 'Bool',
+ );
+
sub FOREIGNBUILDARGS {
my $class = shift;
my %args = @_;
- # Make the label match our 'sort' attribute.
+ # Make the label match our 'type' attribute.
my @superclass_args;
- if( exists $args{'sort'} ) {
- push( @superclass_args, 'label', $args{'sort'} );
+ if( exists $args{'type'} ) {
+ push( @superclass_args, 'label', $args{'type'} );
}
return @superclass_args;
}
$self->set_attribute( 'class', 'relationship' );
- my( $source, $target ) = @{$self->orig_relation};
- if( $source->has_position && $target->has_position
- && $source->position ne $target->position ) {
- die "Cannot set relationship between readings in different positions";
- }
- unless( $self->related_readings ) {
- $self->related_readings( [ $self->orig_relation->[0]->label,
- $self->orig_relation->[1]->label ] );
+ unless( $self->primary_relation ) {
+ $self->primary_relation( [ $self->this_relation->[0]->label,
+ $self->this_relation->[1]->label ] );
}
}