we no longer use position; stop breaking relationship adding
[scpubgit/stemmatology.git] / lib / Text / Tradition / Collation / Relationship.pm
index 49ac1db..c2ad3ae 100644 (file)
@@ -27,19 +27,19 @@ subtype 'RelationshipTokenVector',
 
 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',
 );
@@ -59,15 +59,20 @@ 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;
 }
@@ -77,14 +82,9 @@ sub BUILD {
 
     $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 ] );
     }
 }