add failing tests for relationship logic, next we fix them
Tara L Andrews [Thu, 19 Apr 2012 14:01:01 +0000 (16:01 +0200)]
lib/Text/Tradition/Collation/RelationshipStore.pm
t/data/legendfrag.xml [new file with mode: 0644]
t/text_tradition_collation_relationshipstore.t

index dade4b4..d894568 100644 (file)
@@ -202,6 +202,63 @@ scoped non-locally.
 Returns a status boolean and a list of all reading pairs connected by the call to
 add_relationship.
 
+=begin testing
+
+use Text::Tradition;
+use TryCatch;
+
+my $t1 = Text::Tradition->new( 'input' => 'Self', 'file' => 't/data/legendfrag.xml' );
+# Test 1: try to equate nodes that are prevented with an intermediate collation
+ok( $t1, "Parsed test fragment file" );
+my $c1 = $t1->collation;
+my $trel = $c1->get_relationship( '9,2', '9,3' );
+is( ref( $trel ), 'Text::Tradition::Collation::Relationship',
+       "Troublesome relationship exists" );
+is( $trel->type, 'collated', "Troublesome relationship is a collation" );
+
+# Try to make the link we want
+try {
+       $c1->add_relationship( '8,6', '10,3', { 'type' => 'orthographic' } );
+       ok( 1, "Added cross-collation relationship as expected" );
+} catch {
+       ok( 0, "Existing collation blocked equivalence relationship" );
+}
+
+try {
+       $c1->calculate_ranks();
+       ok( 1, "Successfully calculated ranks" );
+} catch {
+       ok( 0, "Collation now has a cycle" );
+}
+
+# Test 2: try to equate nodes that are prevented with a real intermediate
+# equivalence
+
+my $t2 = Text::Tradition->new( 'input' => 'Self', 'file' => 't/data/legendfrag.xml' );
+# Test 1: try to equate nodes that are prevented with an intermediate collation
+my $c2 = $t2->collation;
+$c2->add_relationship( '9,2', '9,3', { 'type' => 'lexical' } );
+my $trel2 = $c2->get_relationship( '9,2', '9,3' );
+is( ref( $trel2 ), 'Text::Tradition::Collation::Relationship',
+       "Created blocking relationship" );
+is( $trel2->type, 'lexical', "Blocking relationship is not a collation" );
+# This time the link ought to fail
+try {
+       $c2->add_relationship( '8,6', '10,3', { 'type' => 'orthographic' } );
+       ok( 0, "Existing equivalence blocked crossing relationship" );
+} catch {
+       ok( 1, "Added cross-equivalent bad relationship" );
+}
+
+try {
+       $c2->calculate_ranks();
+       ok( 1, "Successfully calculated ranks" );
+} catch {
+       ok( 0, "Collation now has a cycle" );
+}
+
+=end testing
+
 =cut
 
 sub add_relationship {
diff --git a/t/data/legendfrag.xml b/t/data/legendfrag.xml
new file mode 100644 (file)
index 0000000..004a7ca
--- /dev/null
@@ -0,0 +1,1822 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
+  <key attr.name="ac_label" attr.type="string" for="graph" id="dg0"/>
+  <key attr.name="baselabel" attr.type="string" for="graph" id="dg1"/>
+  <key attr.name="language" attr.type="string" for="graph" id="dg2"/>
+  <key attr.name="linear" attr.type="boolean" for="graph" id="dg3"/>
+  <key attr.name="name" attr.type="string" for="graph" id="dg4"/>
+  <key attr.name="version" attr.type="string" for="graph" id="dg5"/>
+  <key attr.name="wit_list_separator" attr.type="string" for="graph" id="dg6"/>
+  <key attr.name="wordsep" attr.type="string" for="graph" id="dg7"/>
+  <key attr.name="id" attr.type="string" for="node" id="dn0"/>
+  <key attr.name="is_common" attr.type="boolean" for="node" id="dn1"/>
+  <key attr.name="is_end" attr.type="boolean" for="node" id="dn2"/>
+  <key attr.name="is_lacuna" attr.type="boolean" for="node" id="dn3"/>
+  <key attr.name="is_ph" attr.type="boolean" for="node" id="dn4"/>
+  <key attr.name="is_start" attr.type="boolean" for="node" id="dn5"/>
+  <key attr.name="join_next" attr.type="boolean" for="node" id="dn6"/>
+  <key attr.name="join_prior" attr.type="boolean" for="node" id="dn7"/>
+  <key attr.name="language" attr.type="string" for="node" id="dn8"/>
+  <key attr.name="lemma" attr.type="string" for="node" id="dn9"/>
+  <key attr.name="normal_form" attr.type="string" for="node" id="dn10"/>
+  <key attr.name="rank" attr.type="int" for="node" id="dn11"/>
+  <key attr.name="text" attr.type="string" for="node" id="dn12"/>
+  <key attr.name="annotation" attr.type="string" for="edge" id="de0"/>
+  <key attr.name="displayform" attr.type="string" for="edge" id="de1"/>
+  <key attr.name="extra" attr.type="boolean" for="edge" id="de2"/>
+  <key attr.name="non_correctable" attr.type="boolean" for="edge" id="de3"/>
+  <key attr.name="non_independent" attr.type="boolean" for="edge" id="de4"/>
+  <key attr.name="reading_a" attr.type="string" for="edge" id="de5"/>
+  <key attr.name="reading_b" attr.type="string" for="edge" id="de6"/>
+  <key attr.name="scope" attr.type="string" for="edge" id="de7"/>
+  <key attr.name="type" attr.type="string" for="edge" id="de8"/>
+  <key attr.name="witness" attr.type="string" for="edge" id="de9"/>
+  <graph edgedefault="directed" id="Legend of Bishop Henry" parse.edgeids="canonical" parse.edges="3499" parse.nodeids="canonical" parse.nodes="2256" parse.order="nodesfirst">
+    <data key="dg0"> (a.c.)</data>
+    <data key="dg1">base text</data>
+    <data key="dg2">Latin</data>
+    <data key="dg3">1</data>
+    <data key="dg5">3.1</data>
+    <data key="dg6">, </data>
+    <data key="dg4">Legend of Bishop Henry</data>
+    <data key="dg7"> </data>
+    <node id="n0">
+      <data key="dn8">Default</data>
+      <data key="dn12">#END#</data>
+      <data key="dn2">1</data>
+      <data key="dn0">#END#</data>
+      <data key="dn11">1137</data>
+    </node>
+    <node id="n1">
+      <data key="dn8">Default</data>
+      <data key="dn12">#START#</data>
+      <data key="dn5">1</data>
+      <data key="dn0">#START#</data>
+      <data key="dn11">0</data>
+    </node>
+    <node id="n2">
+      <data key="dn8">Default</data>
+      <data key="dn12">beatus</data>
+      <data key="dn0">10,2</data>
+      <data key="dn11">10</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n3">
+      <data key="dn8">Default</data>
+      <data key="dn12">venerabilis</data>
+      <data key="dn0">10,3</data>
+      <data key="dn11">10</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n4">
+      <data key="dn8">Default</data>
+      <data key="dn12">sanctus</data>
+      <data key="dn0">10,4</data>
+      <data key="dn11">10</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n5">
+      <data key="dn8">Default</data>
+      <data key="dn12">henricus</data>
+      <data key="dn0">11,2</data>
+      <data key="dn11">11</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n6">
+      <data key="dn8">Default</data>
+      <data key="dn12">heinricus</data>
+      <data key="dn0">11,3</data>
+      <data key="dn11">11</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n7">
+      <data key="dn8">Default</data>
+      <data key="dn12">Henricus</data>
+      <data key="dn0">11,4</data>
+      <data key="dn11">11</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n8">
+      <data key="dn8">Default</data>
+      <data key="dn12">pontifex</data>
+      <data key="dn0">11,5</data>
+      <data key="dn11">11</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n9">
+      <data key="dn8">Default</data>
+      <data key="dn12">de</data>
+      <data key="dn0">12,2</data>
+      <data key="dn11">12</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n10">
+      <data key="dn8">Default</data>
+      <data key="dn12">in</data>
+      <data key="dn0">12,3</data>
+      <data key="dn11">12</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n11">
+      <data key="dn8">Default</data>
+      <data key="dn12">ex</data>
+      <data key="dn0">12,4</data>
+      <data key="dn11">12</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n12">
+      <data key="dn8">Default</data>
+      <data key="dn12">anglia</data>
+      <data key="dn0">13,2</data>
+      <data key="dn11">13</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n13">
+      <data key="dn8">Default</data>
+      <data key="dn12">Anglia</data>
+      <data key="dn0">13,3</data>
+      <data key="dn11">13</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n14">
+      <data key="dn8">Default</data>
+      <data key="dn12">oriundus</data>
+      <data key="dn0">14,2</data>
+      <data key="dn11">14</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n15">
+      <data key="dn8">Default</data>
+      <data key="dn12">in</data>
+      <data key="dn0">6,2</data>
+      <data key="dn11">6</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n16">
+      <data key="dn8">Default</data>
+      <data key="dn12">svecia</data>
+      <data key="dn0">7,1</data>
+      <data key="dn11">7</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n17">
+      <data key="dn8">Default</data>
+      <data key="dn12">suetia</data>
+      <data key="dn0">7,3</data>
+      <data key="dn11">7</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n18">
+      <data key="dn8">Default</data>
+      <data key="dn12">swetia</data>
+      <data key="dn0">7,4</data>
+      <data key="dn11">7</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n19">
+      <data key="dn8">Default</data>
+      <data key="dn12">swecia</data>
+      <data key="dn0">7,5</data>
+      <data key="dn11">7</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n20">
+      <data key="dn8">Default</data>
+      <data key="dn12">suecia</data>
+      <data key="dn0">7,6</data>
+      <data key="dn11">7</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n21">
+      <data key="dn8">Default</data>
+      <data key="dn12">Swecia</data>
+      <data key="dn0">7,7</data>
+      <data key="dn11">7</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n22">
+      <data key="dn8">Default</data>
+      <data key="dn12">#LACUNA#</data>
+      <data key="dn0">8,1</data>
+      <data key="dn11">8</data>
+      <data key="dn1">0</data>
+      <data key="dn3">1</data>
+    </node>
+    <node id="n23">
+      <data key="dn8">Default</data>
+      <data key="dn12">Venerabilis</data>
+      <data key="dn0">8,2</data>
+      <data key="dn11">8</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n24">
+      <data key="dn8">Default</data>
+      <data key="dn12">beatus</data>
+      <data key="dn0">8,3</data>
+      <data key="dn11">8</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n25">
+      <data key="dn8">Default</data>
+      <data key="dn12">sanctus</data>
+      <data key="dn0">8,4</data>
+      <data key="dn11">8</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n26">
+      <data key="dn8">Default</data>
+      <data key="dn12">uenerabilis</data>
+      <data key="dn0">8,5</data>
+      <data key="dn11">8</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n27">
+      <data key="dn8">Default</data>
+      <data key="dn12">venerabilis</data>
+      <data key="dn0">8,6</data>
+      <data key="dn11">8</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n28">
+      <data key="dn8">Default</data>
+      <data key="dn12">henricus</data>
+      <data key="dn0">9,2</data>
+      <data key="dn11">9</data>
+      <data key="dn1">0</data>
+    </node>
+    <node id="n29">
+      <data key="dn8">Default</data>
+      <data key="dn12">pontifex</data>
+      <data key="dn0">9,3</data>
+      <data key="dn11">9</data>
+      <data key="dn1">0</data>
+    </node>
+    <edge source="n1" target="n0" id="e0">
+      <data key="de9">K</data>
+    </edge>
+    <edge source="n1" target="n0" id="e1">
+      <data key="de9">A</data>
+    </edge>
+    <edge source="n1" target="n0" id="e2">
+      <data key="de9">Ab</data>
+    </edge>
+    <edge source="n1" target="n0" id="e3">
+      <data key="de9">B</data>
+    </edge>
+    <edge source="n1" target="n0" id="e4">
+      <data key="de9">BA</data>
+    </edge>
+    <edge source="n1" target="n0" id="e5">
+      <data key="de9">BL</data>
+    </edge>
+    <edge source="n1" target="n0" id="e6">
+      <data key="de9">BLu</data>
+    </edge>
+    <edge source="n1" target="n0" id="e7">
+      <data key="de9">BS</data>
+    </edge>
+    <edge source="n1" target="n0" id="e8">
+      <data key="de9">H</data>
+    </edge>
+    <edge source="n1" target="n0" id="e9">
+      <data key="de9">Ho</data>
+    </edge>
+    <edge source="n1" target="n0" id="e10">
+      <data key="de9">JG</data>
+    </edge>
+    <edge source="n1" target="n0" id="e11">
+      <data key="de9">L</data>
+    </edge>
+    <edge source="n1" target="n0" id="e12">
+      <data key="de9">Q</data>
+    </edge>
+    <edge source="n1" target="n0" id="e13">
+      <data key="de9">St</data>
+    </edge>
+    <edge source="n1" target="n0" id="e14">
+      <data key="de9">U</data>
+    </edge>
+    <edge source="n1" target="n0" id="e15">
+      <data key="de9">Y</data>
+    </edge>
+    <edge source="n1" target="n0" id="e16">
+      <data key="de9">O</data>
+    </edge>
+    <edge source="n1" target="n0" id="e17">
+      <data key="de9">Sk</data>
+    </edge>
+    <edge source="n1" target="n0" id="e18">
+      <data key="de9">AJ</data>
+    </edge>
+    <edge source="n1" target="n0" id="e19">
+      <data key="de9">CP</data>
+    </edge>
+    <edge source="n1" target="n0" id="e20">
+      <data key="de9">Cd</data>
+    </edge>
+    <edge source="n1" target="n0" id="e21">
+      <data key="de9">D</data>
+    </edge>
+    <edge source="n1" target="n0" id="e22">
+      <data key="de9">De</data>
+    </edge>
+    <edge source="n1" target="n0" id="e23">
+      <data key="de9">E</data>
+    </edge>
+    <edge source="n1" target="n0" id="e24">
+      <data key="de9">Fg</data>
+    </edge>
+    <edge source="n1" target="n0" id="e25">
+      <data key="de9">I</data>
+    </edge>
+    <edge source="n1" target="n0" id="e26">
+      <data key="de9">JB</data>
+    </edge>
+    <edge source="n1" target="n0" id="e27">
+      <data key="de9">LT</data>
+    </edge>
+    <edge source="n1" target="n0" id="e28">
+      <data key="de9">Lu</data>
+    </edge>
+    <edge source="n1" target="n0" id="e29">
+      <data key="de9">NR</data>
+    </edge>
+    <edge source="n1" target="n0" id="e30">
+      <data key="de9">NR2</data>
+    </edge>
+    <edge source="n1" target="n0" id="e31">
+      <data key="de9">R</data>
+    </edge>
+    <edge source="n1" target="n0" id="e32">
+      <data key="de9">Va</data>
+    </edge>
+    <edge source="n1" target="n0" id="e33">
+      <data key="de9">Z</data>
+    </edge>
+    <edge source="n1" target="n0" id="e34">
+      <data key="de9">BSt</data>
+    </edge>
+    <edge source="n1" target="n0" id="e35">
+      <data key="de9">BU</data>
+    </edge>
+    <edge source="n1" target="n0" id="e36">
+      <data key="de9">Bc</data>
+    </edge>
+    <edge source="n1" target="n0" id="e37">
+      <data key="de9">C</data>
+    </edge>
+    <edge source="n1" target="n0" id="e38">
+      <data key="de9">Dr</data>
+    </edge>
+    <edge source="n1" target="n0" id="e39">
+      <data key="de9">Ef</data>
+    </edge>
+    <edge source="n1" target="n0" id="e40">
+      <data key="de9">F</data>
+    </edge>
+    <edge source="n1" target="n0" id="e41">
+      <data key="de9">G</data>
+    </edge>
+    <edge source="n1" target="n0" id="e42">
+      <data key="de9">Gh</data>
+    </edge>
+    <edge source="n1" target="n0" id="e43">
+      <data key="de9">Li</data>
+    </edge>
+    <edge source="n1" target="n0" id="e44">
+      <data key="de9">M</data>
+    </edge>
+    <edge source="n1" target="n0" id="e45">
+      <data key="de9">MN</data>
+    </edge>
+    <edge source="n1" target="n0" id="e46">
+      <data key="de9">N</data>
+    </edge>
+    <edge source="n1" target="n0" id="e47">
+      <data key="de9">P</data>
+    </edge>
+    <edge source="n1" target="n0" id="e48">
+      <data key="de9">S</data>
+    </edge>
+    <edge source="n1" target="n0" id="e49">
+      <data key="de9">T</data>
+    </edge>
+    <edge source="n1" target="n0" id="e50">
+      <data key="de9">V</data>
+    </edge>
+    <edge source="n1" target="n0" id="e51">
+      <data key="de9">Vg</data>
+    </edge>
+    <edge source="n1" target="n0" id="e52">
+      <data key="de9">X</data>
+    </edge>
+    <edge source="n2" target="n7" id="e53">
+      <data key="de9">T</data>
+    </edge>
+    <edge source="n2" target="n9" id="e54">
+      <data key="de9">Sk</data>
+    </edge>
+    <edge source="n2" target="n5" id="e55">
+      <data key="de9">A</data>
+    </edge>
+    <edge source="n2" target="n5" id="e56">
+      <data key="de9">B</data>
+    </edge>
+    <edge source="n2" target="n5" id="e57">
+      <data key="de9">BSt</data>
+    </edge>
+    <edge source="n2" target="n5" id="e58">
+      <data key="de9">BU</data>
+    </edge>
+    <edge source="n2" target="n5" id="e59">
+      <data key="de9">Bc</data>
+    </edge>
+    <edge source="n2" target="n5" id="e60">
+      <data key="de9">C</data>
+    </edge>
+    <edge source="n2" target="n5" id="e61">
+      <data key="de9">Dr</data>
+    </edge>
+    <edge source="n2" target="n5" id="e62">
+      <data key="de9">Ef</data>
+    </edge>
+    <edge source="n2" target="n5" id="e63">
+      <data key="de9">F</data>
+    </edge>
+    <edge source="n2" target="n5" id="e64">
+      <data key="de9">Gh</data>
+    </edge>
+    <edge source="n2" target="n5" id="e65">
+      <data key="de9">H</data>
+    </edge>
+    <edge source="n2" target="n5" id="e66">
+      <data key="de9">Ho</data>
+    </edge>
+    <edge source="n2" target="n5" id="e67">
+      <data key="de9">JG</data>
+    </edge>
+    <edge source="n2" target="n5" id="e68">
+      <data key="de9">K</data>
+    </edge>
+    <edge source="n2" target="n5" id="e69">
+      <data key="de9">M</data>
+    </edge>
+    <edge source="n2" target="n5" id="e70">
+      <data key="de9">MN</data>
+    </edge>
+    <edge source="n2" target="n5" id="e71">
+      <data key="de9">O</data>
+    </edge>
+    <edge source="n2" target="n5" id="e72">
+      <data key="de9">P</data>
+    </edge>
+    <edge source="n2" target="n5" id="e73">
+      <data key="de9">S</data>
+    </edge>
+    <edge source="n2" target="n5" id="e74">
+      <data key="de9">St</data>
+    </edge>
+    <edge source="n2" target="n5" id="e75">
+      <data key="de9">U</data>
+    </edge>
+    <edge source="n2" target="n5" id="e76">
+      <data key="de9">V</data>
+    </edge>
+    <edge source="n2" target="n5" id="e77">
+      <data key="de9">Vg</data>
+    </edge>
+    <edge source="n2" target="n5" id="e78">
+      <data key="de9">X</data>
+    </edge>
+    <edge source="n2" target="n5" id="e79">
+      <data key="de9">Y</data>
+    </edge>
+    <edge source="n2" target="n6" id="e80">
+      <data key="de9">BA</data>
+    </edge>
+    <edge source="n3" target="n8" id="e81">
+      <data key="de9">N</data>
+    </edge>
+    <edge source="n4" target="n5" id="e82">
+      <data key="de9">BL</data>
+    </edge>
+    <edge source="n4" target="n5" id="e83">
+      <data key="de9">BLu</data>
+    </edge>
+    <edge source="n4" target="n5" id="e84">
+      <data key="de9">BS</data>
+    </edge>
+    <edge source="n4" target="n5" id="e85">
+      <data key="de9">Q</data>
+    </edge>
+    <edge source="n4" target="n7" id="e86">
+      <data key="de9">G</data>
+    </edge>
+    <edge source="n1" target="n0" id="e87">
+      <data key="de9">N</data>
+    </edge>
+    <edge source="n1" target="n0" id="e88">
+      <data key="de9">H</data>
+    </edge>
+    <edge source="n1" target="n0" id="e89">
+      <data key="de9">De</data>
+    </edge>
+    <edge source="n1" target="n0" id="e90">
+      <data key="de9">CP</data>
+    </edge>
+    <edge source="n5" target="n10" id="e91">
+      <data key="de9">A</data>
+    </edge>
+    <edge source="n5" target="n10" id="e92">
+      <data key="de9">BL</data>
+    </edge>
+    <edge source="n5" target="n10" id="e93">
+      <data key="de9">BS</data>
+    </edge>
+    <edge source="n5" target="n10" id="e94">
+      <data key="de9">BSt</data>
+    </edge>
+    <edge source="n5" target="n10" id="e95">
+      <data key="de9">BU</data>
+    </edge>
+    <edge source="n5" target="n10" id="e96">
+      <data key="de9">Bc</data>
+    </edge>
+    <edge source="n5" target="n10" id="e97">
+      <data key="de9">C</data>
+    </edge>
+    <edge source="n5" target="n10" id="e98">
+      <data key="de9">Dr</data>
+    </edge>
+    <edge source="n5" target="n10" id="e99">
+      <data key="de9">Ho</data>
+    </edge>
+    <edge source="n5" target="n10" id="e100">
+      <data key="de9">K</data>
+    </edge>
+    <edge source="n5" target="n10" id="e101">
+      <data key="de9">Li</data>
+    </edge>
+    <edge source="n5" target="n10" id="e102">
+      <data key="de9">M</data>
+    </edge>
+    <edge source="n5" target="n10" id="e103">
+      <data key="de9">S</data>
+    </edge>
+    <edge source="n5" target="n10" id="e104">
+      <data key="de9">St</data>
+    </edge>
+    <edge source="n5" target="n10" id="e105">
+      <data key="de9">V</data>
+    </edge>
+    <edge source="n5" target="n10" id="e106">
+      <data key="de9">Vg</data>
+    </edge>
+    <edge source="n5" target="n10" id="e107">
+      <data key="de9">X</data>
+    </edge>
+    <edge source="n5" target="n11" id="e108">
+      <data key="de9">BLu</data>
+    </edge>
+    <edge source="n5" target="n9" id="e109">
+      <data key="de9">B</data>
+    </edge>
+    <edge source="n5" target="n9" id="e110">
+      <data key="de9">Ef</data>
+    </edge>
+    <edge source="n5" target="n9" id="e111">
+      <data key="de9">F</data>
+    </edge>
+    <edge source="n5" target="n9" id="e112">
+      <data key="de9">Gh</data>
+    </edge>
+    <edge source="n5" target="n9" id="e113">
+      <data key="de9">H</data>
+    </edge>
+    <edge source="n5" target="n9" id="e114">
+      <data key="de9">JG</data>
+    </edge>
+    <edge source="n5" target="n9" id="e115">
+      <data key="de9">MN</data>
+    </edge>
+    <edge source="n5" target="n9" id="e116">
+      <data key="de9">O</data>
+    </edge>
+    <edge source="n5" target="n9" id="e117">
+      <data key="de9">P</data>
+    </edge>
+    <edge source="n5" target="n9" id="e118">
+      <data key="de9">Q</data>
+    </edge>
+    <edge source="n5" target="n9" id="e119">
+      <data key="de9">U</data>
+    </edge>
+    <edge source="n5" target="n9" id="e120">
+      <data key="de9">Y</data>
+    </edge>
+    <edge source="n6" target="n9" id="e121">
+      <data key="de9">BA</data>
+    </edge>
+    <edge source="n7" target="n10" id="e122">
+      <data key="de9">G</data>
+    </edge>
+    <edge source="n7" target="n10" id="e123">
+      <data key="de9">L</data>
+    </edge>
+    <edge source="n7" target="n10" id="e124">
+      <data key="de9">T</data>
+    </edge>
+    <edge source="n8" target="n9" id="e125">
+      <data key="de9">N</data>
+    </edge>
+    <edge source="n1" target="n0" id="e126">
+      <data key="de9">Ab</data>
+    </edge>
+    <edge source="n1" target="n0" id="e127">
+      <data key="de9">BL</data>
+    </edge>
+    <edge source="n1" target="n0" id="e128">
+      <data key="de9">NR</data>
+    </edge>
+    <edge source="n1" target="n0" id="e129">
+      <data key="de9">B</data>
+    </edge>
+    <edge source="n1" target="n0" id="e130">
+      <data key="de9">C</data>
+    </edge>
+    <edge source="n1" target="n0" id="e131">
+      <data key="de9">Dr</data>
+    </edge>
+    <edge source="n1" target="n0" id="e132">
+      <data key="de9">E</data>
+    </edge>
+    <edge source="n1" target="n0" id="e133">
+      <data key="de9">Ef</data>
+    </edge>
+    <edge source="n1" target="n0" id="e134">
+      <data key="de9">Fg</data>
+    </edge>
+    <edge source="n1" target="n0" id="e135">
+      <data key="de9">I</data>
+    </edge>
+    <edge source="n1" target="n0" id="e136">
+      <data key="de9">JG</data>
+    </edge>
+    <edge source="n1" target="n0" id="e137">
+      <data key="de9">K</data>
+    </edge>
+    <edge source="n1" target="n0" id="e138">
+      <data key="de9">MN</data>
+    </edge>
+    <edge source="n1" target="n0" id="e139">
+      <data key="de9">S</data>
+    </edge>
+    <edge source="n1" target="n0" id="e140">
+      <data key="de9">T</data>
+    </edge>
+    <edge source="n1" target="n0" id="e141">
+      <data key="de9">Y</data>
+    </edge>
+    <edge source="n1" target="n0" id="e142">
+      <data key="de9">P</data>
+    </edge>
+    <edge source="n9" target="n13" id="e143">
+      <data key="de9">N</data>
+    </edge>
+    <edge source="n9" target="n13" id="e144">
+      <data key="de9">Y</data>
+    </edge>
+    <edge source="n9" target="n12" id="e145">
+      <data key="de9">B</data>
+    </edge>
+    <edge source="n9" target="n12" id="e146">
+      <data key="de9">BA</data>
+    </edge>
+    <edge source="n9" target="n12" id="e147">
+      <data key="de9">Ef</data>
+    </edge>
+    <edge source="n9" target="n12" id="e148">
+      <data key="de9">F</data>
+    </edge>
+    <edge source="n9" target="n12" id="e149">
+      <data key="de9">Gh</data>
+    </edge>
+    <edge source="n9" target="n12" id="e150">
+      <data key="de9">H</data>
+    </edge>
+    <edge source="n9" target="n12" id="e151">
+      <data key="de9">JG</data>
+    </edge>
+    <edge source="n9" target="n12" id="e152">
+      <data key="de9">MN</data>
+    </edge>
+    <edge source="n9" target="n12" id="e153">
+      <data key="de9">O</data>
+    </edge>
+    <edge source="n9" target="n12" id="e154">
+      <data key="de9">P</data>
+    </edge>
+    <edge source="n9" target="n12" id="e155">
+      <data key="de9">Q</data>
+    </edge>
+    <edge source="n9" target="n12" id="e156">
+      <data key="de9">Sk</data>
+    </edge>
+    <edge source="n9" target="n12" id="e157">
+      <data key="de9">U</data>
+    </edge>
+    <edge source="n10" target="n12" id="e158">
+      <data key="de9">A</data>
+    </edge>
+    <edge source="n10" target="n12" id="e159">
+      <data key="de9">BL</data>
+    </edge>
+    <edge source="n10" target="n12" id="e160">
+      <data key="de9">BS</data>
+    </edge>
+    <edge source="n10" target="n12" id="e161">
+      <data key="de9">BSt</data>
+    </edge>
+    <edge source="n10" target="n12" id="e162">
+      <data key="de9">BU</data>
+    </edge>
+    <edge source="n10" target="n12" id="e163">
+      <data key="de9">Bc</data>
+    </edge>
+    <edge source="n10" target="n12" id="e164">
+      <data key="de9">C</data>
+    </edge>
+    <edge source="n10" target="n12" id="e165">
+      <data key="de9">Dr</data>
+    </edge>
+    <edge source="n10" target="n12" id="e166">
+      <data key="de9">G</data>
+    </edge>
+    <edge source="n10" target="n12" id="e167">
+      <data key="de9">Ho</data>
+    </edge>
+    <edge source="n10" target="n12" id="e168">
+      <data key="de9">K</data>
+    </edge>
+    <edge source="n10" target="n12" id="e169">
+      <data key="de9">L</data>
+    </edge>
+    <edge source="n10" target="n12" id="e170">
+      <data key="de9">M</data>
+    </edge>
+    <edge source="n10" target="n12" id="e171">
+      <data key="de9">S</data>
+    </edge>
+    <edge source="n10" target="n12" id="e172">
+      <data key="de9">St</data>
+    </edge>
+    <edge source="n10" target="n12" id="e173">
+      <data key="de9">T</data>
+    </edge>
+    <edge source="n10" target="n12" id="e174">
+      <data key="de9">V</data>
+    </edge>
+    <edge source="n10" target="n12" id="e175">
+      <data key="de9">Vg</data>
+    </edge>
+    <edge source="n10" target="n12" id="e176">
+      <data key="de9">X</data>
+    </edge>
+    <edge source="n10" target="n13" id="e177">
+      <data key="de9">Li</data>
+    </edge>
+    <edge source="n11" target="n12" id="e178">
+      <data key="de9">BLu</data>
+    </edge>
+    <edge source="n12" target="n14" id="e179">
+      <data key="de9">A</data>
+    </edge>
+    <edge source="n12" target="n14" id="e180">
+      <data key="de9">B</data>
+    </edge>
+    <edge source="n12" target="n14" id="e181">
+      <data key="de9">BA</data>
+    </edge>
+    <edge source="n12" target="n14" id="e182">
+      <data key="de9">BL</data>
+    </edge>
+    <edge source="n12" target="n14" id="e183">
+      <data key="de9">BLu</data>
+    </edge>
+    <edge source="n12" target="n14" id="e184">
+      <data key="de9">BS</data>
+    </edge>
+    <edge source="n12" target="n14" id="e185">
+      <data key="de9">BSt</data>
+    </edge>
+    <edge source="n12" target="n14" id="e186">
+      <data key="de9">BU</data>
+    </edge>
+    <edge source="n12" target="n14" id="e187">
+      <data key="de9">Bc</data>
+    </edge>
+    <edge source="n12" target="n14" id="e188">
+      <data key="de9">C</data>
+    </edge>
+    <edge source="n12" target="n14" id="e189">
+      <data key="de9">Dr</data>
+    </edge>
+    <edge source="n12" target="n14" id="e190">
+      <data key="de9">Ef</data>
+    </edge>
+    <edge source="n12" target="n14" id="e191">
+      <data key="de9">F</data>
+    </edge>
+    <edge source="n12" target="n14" id="e192">
+      <data key="de9">G</data>
+    </edge>
+    <edge source="n12" target="n14" id="e193">
+      <data key="de9">Gh</data>
+    </edge>
+    <edge source="n12" target="n14" id="e194">
+      <data key="de9">H</data>
+    </edge>
+    <edge source="n12" target="n14" id="e195">
+      <data key="de9">Ho</data>
+    </edge>
+    <edge source="n12" target="n14" id="e196">
+      <data key="de9">JG</data>
+    </edge>
+    <edge source="n12" target="n14" id="e197">
+      <data key="de9">K</data>
+    </edge>
+    <edge source="n12" target="n14" id="e198">
+      <data key="de9">L</data>
+    </edge>
+    <edge source="n12" target="n14" id="e199">
+      <data key="de9">M</data>
+    </edge>
+    <edge source="n12" target="n14" id="e200">
+      <data key="de9">MN</data>
+    </edge>
+    <edge source="n12" target="n14" id="e201">
+      <data key="de9">O</data>
+    </edge>
+    <edge source="n12" target="n14" id="e202">
+      <data key="de9">P</data>
+    </edge>
+    <edge source="n12" target="n14" id="e203">
+      <data key="de9">Q</data>
+    </edge>
+    <edge source="n12" target="n14" id="e204">
+      <data key="de9">S</data>
+    </edge>
+    <edge source="n12" target="n14" id="e205">
+      <data key="de9">Sk</data>
+    </edge>
+    <edge source="n12" target="n14" id="e206">
+      <data key="de9">St</data>
+    </edge>
+    <edge source="n12" target="n14" id="e207">
+      <data key="de9">T</data>
+    </edge>
+    <edge source="n12" target="n14" id="e208">
+      <data key="de9">U</data>
+    </edge>
+    <edge source="n12" target="n14" id="e209">
+      <data key="de9">V</data>
+    </edge>
+    <edge source="n12" target="n14" id="e210">
+      <data key="de9">Vg</data>
+    </edge>
+    <edge source="n12" target="n14" id="e211">
+      <data key="de9">X</data>
+    </edge>
+    <edge source="n13" target="n14" id="e212">
+      <data key="de9">Li</data>
+    </edge>
+    <edge source="n13" target="n14" id="e213">
+      <data key="de9">N</data>
+    </edge>
+    <edge source="n13" target="n14" id="e214">
+      <data key="de9">Y</data>
+    </edge>
+    <edge source="n14" target="n0" id="e215">
+      <data key="de9">Q</data>
+    </edge>
+    <edge source="n14" target="n0" id="e216">
+      <data key="de9">BS</data>
+    </edge>
+    <edge source="n14" target="n0" id="e217">
+      <data key="de9">JG</data>
+    </edge>
+    <edge source="n14" target="n0" id="e218">
+      <data key="de9">A</data>
+    </edge>
+    <edge source="n14" target="n0" id="e219">
+      <data key="de9">B</data>
+    </edge>
+    <edge source="n14" target="n0" id="e220">
+      <data key="de9">BA</data>
+    </edge>
+    <edge source="n14" target="n0" id="e221">
+      <data key="de9">BL</data>
+    </edge>
+    <edge source="n14" target="n0" id="e222">
+      <data key="de9">BLu</data>
+    </edge>
+    <edge source="n14" target="n0" id="e223">
+      <data key="de9">BSt</data>
+    </edge>
+    <edge source="n14" target="n0" id="e224">
+      <data key="de9">BU</data>
+    </edge>
+    <edge source="n14" target="n0" id="e225">
+      <data key="de9">Bc</data>
+    </edge>
+    <edge source="n14" target="n0" id="e226">
+      <data key="de9">C</data>
+    </edge>
+    <edge source="n14" target="n0" id="e227">
+      <data key="de9">Dr</data>
+    </edge>
+    <edge source="n14" target="n0" id="e228">
+      <data key="de9">Ef</data>
+    </edge>
+    <edge source="n14" target="n0" id="e229">
+      <data key="de9">F</data>
+    </edge>
+    <edge source="n14" target="n0" id="e230">
+      <data key="de9">G</data>
+    </edge>
+    <edge source="n14" target="n0" id="e231">
+      <data key="de9">Gh</data>
+    </edge>
+    <edge source="n14" target="n0" id="e232">
+      <data key="de9">H</data>
+    </edge>
+    <edge source="n14" target="n0" id="e233">
+      <data key="de9">Ho</data>
+    </edge>
+    <edge source="n14" target="n0" id="e234">
+      <data key="de9">K</data>
+    </edge>
+    <edge source="n14" target="n0" id="e235">
+      <data key="de9">L</data>
+    </edge>
+    <edge source="n14" target="n0" id="e236">
+      <data key="de9">Li</data>
+    </edge>
+    <edge source="n14" target="n0" id="e237">
+      <data key="de9">M</data>
+    </edge>
+    <edge source="n14" target="n0" id="e238">
+      <data key="de9">MN</data>
+    </edge>
+    <edge source="n14" target="n0" id="e239">
+      <data key="de9">N</data>
+    </edge>
+    <edge source="n14" target="n0" id="e240">
+      <data key="de9">O</data>
+    </edge>
+    <edge source="n14" target="n0" id="e241">
+      <data key="de9">P</data>
+    </edge>
+    <edge source="n14" target="n0" id="e242">
+      <data key="de9">S</data>
+    </edge>
+    <edge source="n14" target="n0" id="e243">
+      <data key="de9">Sk</data>
+    </edge>
+    <edge source="n14" target="n0" id="e244">
+      <data key="de9">St</data>
+    </edge>
+    <edge source="n14" target="n0" id="e245">
+      <data key="de9">T</data>
+    </edge>
+    <edge source="n14" target="n0" id="e246">
+      <data key="de9">U</data>
+    </edge>
+    <edge source="n14" target="n0" id="e247">
+      <data key="de9">V</data>
+    </edge>
+    <edge source="n14" target="n0" id="e248">
+      <data key="de9">Vg</data>
+    </edge>
+    <edge source="n14" target="n0" id="e249">
+      <data key="de9">X</data>
+    </edge>
+    <edge source="n14" target="n0" id="e250">
+      <data key="de9">Y</data>
+    </edge>
+    <edge source="n1" target="n0" id="e251">
+      <data key="de9">Gh</data>
+    </edge>
+    <edge source="n1" target="n0" id="e252">
+      <data key="de9">Sk</data>
+    </edge>
+    <edge source="n1" target="n0" id="e253">
+      <data key="de9">Vg</data>
+    </edge>
+    <edge source="n1" target="n0" id="e254">
+      <data key="de9">Z</data>
+    </edge>
+    <edge source="n1" target="n0" id="e255">
+      <data key="de9">L</data>
+    </edge>
+    <edge source="n1" target="n0" id="e256">
+      <data key="de9">U</data>
+    </edge>
+    <edge source="n1" target="n0" id="e257">
+      <data key="de9">Cd</data>
+    </edge>
+    <edge source="n1" target="n0" id="e258">
+      <data key="de9">BA</data>
+    </edge>
+    <edge source="n1" target="n0" id="e259">
+      <data key="de9">BLu</data>
+    </edge>
+    <edge source="n1" target="n0" id="e260">
+      <data key="de9">BS</data>
+    </edge>
+    <edge source="n1" target="n0" id="e261">
+      <data key="de9">BSt</data>
+    </edge>
+    <edge source="n1" target="n0" id="e262">
+      <data key="de9">O</data>
+    </edge>
+    <edge source="n1" target="n0" id="e263">
+      <data key="de9">X</data>
+    </edge>
+    <edge source="n1" target="n15" id="e264">
+      <data key="de9">Dr</data>
+    </edge>
+    <edge source="n1" target="n15" id="e265">
+      <data key="de9">P</data>
+    </edge>
+    <edge source="n1" target="n15" id="e266">
+      <data key="de9">A</data>
+    </edge>
+    <edge source="n1" target="n15" id="e267">
+      <data key="de9">Ab</data>
+    </edge>
+    <edge source="n1" target="n15" id="e268">
+      <data key="de9">B</data>
+    </edge>
+    <edge source="n1" target="n15" id="e269">
+      <data key="de9">BA</data>
+    </edge>
+    <edge source="n1" target="n15" id="e270">
+      <data key="de9">BL</data>
+    </edge>
+    <edge source="n1" target="n15" id="e271">
+      <data key="de9">BLu</data>
+    </edge>
+    <edge source="n1" target="n15" id="e272">
+      <data key="de9">BS</data>
+    </edge>
+    <edge source="n1" target="n15" id="e273">
+      <data key="de9">BSt</data>
+    </edge>
+    <edge source="n1" target="n15" id="e274">
+      <data key="de9">BU</data>
+    </edge>
+    <edge source="n1" target="n15" id="e275">
+      <data key="de9">Bc</data>
+    </edge>
+    <edge source="n1" target="n15" id="e276">
+      <data key="de9">C</data>
+    </edge>
+    <edge source="n1" target="n15" id="e277">
+      <data key="de9">Ef</data>
+    </edge>
+    <edge source="n1" target="n15" id="e278">
+      <data key="de9">F</data>
+    </edge>
+    <edge source="n1" target="n15" id="e279">
+      <data key="de9">G</data>
+    </edge>
+    <edge source="n1" target="n15" id="e280">
+      <data key="de9">Gh</data>
+    </edge>
+    <edge source="n1" target="n15" id="e281">
+      <data key="de9">H</data>
+    </edge>
+    <edge source="n1" target="n15" id="e282">
+      <data key="de9">Ho</data>
+    </edge>
+    <edge source="n1" target="n15" id="e283">
+      <data key="de9">JG</data>
+    </edge>
+    <edge source="n1" target="n15" id="e284">
+      <data key="de9">K</data>
+    </edge>
+    <edge source="n1" target="n15" id="e285">
+      <data key="de9">L</data>
+    </edge>
+    <edge source="n1" target="n15" id="e286">
+      <data key="de9">Li</data>
+    </edge>
+    <edge source="n1" target="n15" id="e287">
+      <data key="de9">M</data>
+    </edge>
+    <edge source="n1" target="n15" id="e288">
+      <data key="de9">MN</data>
+    </edge>
+    <edge source="n1" target="n15" id="e289">
+      <data key="de9">N</data>
+    </edge>
+    <edge source="n1" target="n15" id="e290">
+      <data key="de9">O</data>
+    </edge>
+    <edge source="n1" target="n15" id="e291">
+      <data key="de9">Q</data>
+    </edge>
+    <edge source="n1" target="n15" id="e292">
+      <data key="de9">S</data>
+    </edge>
+    <edge source="n1" target="n15" id="e293">
+      <data key="de9">Sk</data>
+    </edge>
+    <edge source="n1" target="n15" id="e294">
+      <data key="de9">St</data>
+    </edge>
+    <edge source="n1" target="n15" id="e295">
+      <data key="de9">T</data>
+    </edge>
+    <edge source="n1" target="n15" id="e296">
+      <data key="de9">U</data>
+    </edge>
+    <edge source="n1" target="n15" id="e297">
+      <data key="de9">V</data>
+    </edge>
+    <edge source="n1" target="n15" id="e298">
+      <data key="de9">Vg</data>
+    </edge>
+    <edge source="n1" target="n15" id="e299">
+      <data key="de9">X</data>
+    </edge>
+    <edge source="n1" target="n15" id="e300">
+      <data key="de9">Y</data>
+    </edge>
+    <edge source="n1" target="n0" id="e301">
+      <data key="de9">M</data>
+    </edge>
+    <edge source="n1" target="n0" id="e302">
+      <data key="de9">AJ</data>
+    </edge>
+    <edge source="n1" target="n0" id="e303">
+      <data key="de9">Li</data>
+    </edge>
+    <edge source="n15" target="n18" id="e304">
+      <data key="de9">BA</data>
+    </edge>
+    <edge source="n15" target="n18" id="e305">
+      <data key="de9">P</data>
+    </edge>
+    <edge source="n15" target="n21" id="e306">
+      <data key="de9">T</data>
+    </edge>
+    <edge source="n15" target="n17" id="e307">
+      <data key="de9">BLu</data>
+    </edge>
+    <edge source="n15" target="n17" id="e308">
+      <data key="de9">Gh</data>
+    </edge>
+    <edge source="n15" target="n17" id="e309">
+      <data key="de9">JG</data>
+    </edge>
+    <edge source="n15" target="n17" id="e310">
+      <data key="de9">S</data>
+    </edge>
+    <edge source="n15" target="n19" id="e311">
+      <data key="de9">A</data>
+    </edge>
+    <edge source="n15" target="n19" id="e312">
+      <data key="de9">B</data>
+    </edge>
+    <edge source="n15" target="n19" id="e313">
+      <data key="de9">BU</data>
+    </edge>
+    <edge source="n15" target="n19" id="e314">
+      <data key="de9">C</data>
+    </edge>
+    <edge source="n15" target="n19" id="e315">
+      <data key="de9">Ho</data>
+    </edge>
+    <edge source="n15" target="n19" id="e316">
+      <data key="de9">K</data>
+    </edge>
+    <edge source="n15" target="n19" id="e317">
+      <data key="de9">M</data>
+    </edge>
+    <edge source="n15" target="n19" id="e318">
+      <data key="de9">MN</data>
+    </edge>
+    <edge source="n15" target="n19" id="e319">
+      <data key="de9">O</data>
+    </edge>
+    <edge source="n15" target="n19" id="e320">
+      <data key="de9">Sk</data>
+    </edge>
+    <edge source="n15" target="n19" id="e321">
+      <data key="de9">St</data>
+    </edge>
+    <edge source="n15" target="n19" id="e322">
+      <data key="de9">Vg</data>
+    </edge>
+    <edge source="n15" target="n20" id="e323">
+      <data key="de9">Ab</data>
+    </edge>
+    <edge source="n15" target="n20" id="e324">
+      <data key="de9">BL</data>
+    </edge>
+    <edge source="n15" target="n20" id="e325">
+      <data key="de9">BS</data>
+    </edge>
+    <edge source="n15" target="n20" id="e326">
+      <data key="de9">BSt</data>
+    </edge>
+    <edge source="n15" target="n20" id="e327">
+      <data key="de9">Bc</data>
+    </edge>
+    <edge source="n15" target="n20" id="e328">
+      <data key="de9">Dr</data>
+    </edge>
+    <edge source="n15" target="n20" id="e329">
+      <data key="de9">Ef</data>
+    </edge>
+    <edge source="n15" target="n20" id="e330">
+      <data key="de9">F</data>
+    </edge>
+    <edge source="n15" target="n20" id="e331">
+      <data key="de9">G</data>
+    </edge>
+    <edge source="n15" target="n20" id="e332">
+      <data key="de9">H</data>
+    </edge>
+    <edge source="n15" target="n20" id="e333">
+      <data key="de9">L</data>
+    </edge>
+    <edge source="n15" target="n20" id="e334">
+      <data key="de9">Li</data>
+    </edge>
+    <edge source="n15" target="n20" id="e335">
+      <data key="de9">N</data>
+    </edge>
+    <edge source="n15" target="n20" id="e336">
+      <data key="de9">Q</data>
+    </edge>
+    <edge source="n15" target="n20" id="e337">
+      <data key="de9">U</data>
+    </edge>
+    <edge source="n15" target="n20" id="e338">
+      <data key="de9">X</data>
+    </edge>
+    <edge source="n15" target="n20" id="e339">
+      <data key="de9">Y</data>
+    </edge>
+    <edge source="n15" target="n16" id="e340">
+      <data key="de9">V</data>
+    </edge>
+    <edge source="n1" target="n0" id="e341">
+      <data key="de9">Lu</data>
+    </edge>
+    <edge source="n1" target="n0" id="e342">
+      <data key="de9">Bc</data>
+    </edge>
+    <edge source="n1" target="n0" id="e343">
+      <data key="de9">St</data>
+    </edge>
+    <edge source="n1" target="n0" id="e344">
+      <data key="de9">V</data>
+    </edge>
+    <edge source="n1" target="n0" id="e345">
+      <data key="de9">JB</data>
+    </edge>
+    <edge source="n1" target="n0" id="e346">
+      <data key="de9">NR2</data>
+    </edge>
+    <edge source="n16" target="n27" id="e347">
+      <data key="de9">V</data>
+    </edge>
+    <edge source="n17" target="n26" id="e348">
+      <data key="de9">Gh</data>
+    </edge>
+    <edge source="n17" target="n26" id="e349">
+      <data key="de9">S</data>
+    </edge>
+    <edge source="n17" target="n27" id="e350">
+      <data key="de9">JG</data>
+    </edge>
+    <edge source="n17" target="n4" id="e351">
+      <data key="de9">BLu</data>
+    </edge>
+    <edge source="n18" target="n27" id="e352">
+      <data key="de9">BA</data>
+    </edge>
+    <edge source="n18" target="n27" id="e353">
+      <data key="de9">P</data>
+    </edge>
+    <edge source="n19" target="n26" id="e354">
+      <data key="de9">Vg</data>
+    </edge>
+    <edge source="n19" target="n23" id="e355">
+      <data key="de9">BU</data>
+    </edge>
+    <edge source="n19" target="n27" id="e356">
+      <data key="de9">A</data>
+    </edge>
+    <edge source="n19" target="n27" id="e357">
+      <data key="de9">B</data>
+    </edge>
+    <edge source="n19" target="n27" id="e358">
+      <data key="de9">C</data>
+    </edge>
+    <edge source="n19" target="n27" id="e359">
+      <data key="de9">Ho</data>
+    </edge>
+    <edge source="n19" target="n27" id="e360">
+      <data key="de9">K</data>
+    </edge>
+    <edge source="n19" target="n27" id="e361">
+      <data key="de9">M</data>
+    </edge>
+    <edge source="n19" target="n27" id="e362">
+      <data key="de9">MN</data>
+    </edge>
+    <edge source="n19" target="n27" id="e363">
+      <data key="de9">O</data>
+    </edge>
+    <edge source="n19" target="n27" id="e364">
+      <data key="de9">Sk</data>
+    </edge>
+    <edge source="n19" target="n27" id="e365">
+      <data key="de9">St</data>
+    </edge>
+    <edge source="n20" target="n22" id="e366">
+      <data key="de9">Ab</data>
+    </edge>
+    <edge source="n20" target="n24" id="e367">
+      <data key="de9">N</data>
+    </edge>
+    <edge source="n20" target="n26" id="e368">
+      <data key="de9">Ef</data>
+    </edge>
+    <edge source="n20" target="n26" id="e369">
+      <data key="de9">H</data>
+    </edge>
+    <edge source="n20" target="n27" id="e370">
+      <data key="de9">BS</data>
+    </edge>
+    <edge source="n20" target="n27" id="e371">
+      <data key="de9">BSt</data>
+    </edge>
+    <edge source="n20" target="n27" id="e372">
+      <data key="de9">Bc</data>
+    </edge>
+    <edge source="n20" target="n27" id="e373">
+      <data key="de9">Dr</data>
+    </edge>
+    <edge source="n20" target="n27" id="e374">
+      <data key="de9">F</data>
+    </edge>
+    <edge source="n20" target="n27" id="e375">
+      <data key="de9">G</data>
+    </edge>
+    <edge source="n20" target="n27" id="e376">
+      <data key="de9">L</data>
+    </edge>
+    <edge source="n20" target="n27" id="e377">
+      <data key="de9">Q</data>
+    </edge>
+    <edge source="n20" target="n27" id="e378">
+      <data key="de9">U</data>
+    </edge>
+    <edge source="n20" target="n27" id="e379">
+      <data key="de9">X</data>
+    </edge>
+    <edge source="n20" target="n27" id="e380">
+      <data key="de9">Y</data>
+    </edge>
+    <edge source="n20" target="n4" id="e381">
+      <data key="de9">BL</data>
+    </edge>
+    <edge source="n20" target="n25" id="e382">
+      <data key="de9">Li</data>
+    </edge>
+    <edge source="n21" target="n23" id="e383">
+      <data key="de9">T</data>
+    </edge>
+    <edge source="n1" target="n0" id="e384">
+      <data key="de9">BU</data>
+    </edge>
+    <edge source="n1" target="n0" id="e385">
+      <data key="de9">D</data>
+    </edge>
+    <edge source="n1" target="n0" id="e386">
+      <data key="de9">A</data>
+    </edge>
+    <edge source="n1" target="n0" id="e387">
+      <data key="de9">Va</data>
+    </edge>
+    <edge source="n22" target="n0" id="e388">
+      <data key="de9">Ab</data>
+    </edge>
+    <edge source="n23" target="n29" id="e389">
+      <data key="de9">BU</data>
+    </edge>
+    <edge source="n23" target="n29" id="e390">
+      <data key="de9">T</data>
+    </edge>
+    <edge source="n24" target="n28" id="e391">
+      <data key="de9">N</data>
+    </edge>
+    <edge source="n25" target="n29" id="e392">
+      <data key="de9">Li</data>
+    </edge>
+    <edge source="n26" target="n29" id="e393">
+      <data key="de9">Ef</data>
+    </edge>
+    <edge source="n26" target="n29" id="e394">
+      <data key="de9">Gh</data>
+    </edge>
+    <edge source="n26" target="n29" id="e395">
+      <data key="de9">H</data>
+    </edge>
+    <edge source="n26" target="n29" id="e396">
+      <data key="de9">S</data>
+    </edge>
+    <edge source="n26" target="n29" id="e397">
+      <data key="de9">Vg</data>
+    </edge>
+    <edge source="n27" target="n29" id="e398">
+      <data key="de9">A</data>
+    </edge>
+    <edge source="n27" target="n29" id="e399">
+      <data key="de9">B</data>
+    </edge>
+    <edge source="n27" target="n29" id="e400">
+      <data key="de9">BA</data>
+    </edge>
+    <edge source="n27" target="n29" id="e401">
+      <data key="de9">BS</data>
+    </edge>
+    <edge source="n27" target="n29" id="e402">
+      <data key="de9">BSt</data>
+    </edge>
+    <edge source="n27" target="n29" id="e403">
+      <data key="de9">Bc</data>
+    </edge>
+    <edge source="n27" target="n29" id="e404">
+      <data key="de9">C</data>
+    </edge>
+    <edge source="n27" target="n29" id="e405">
+      <data key="de9">Dr</data>
+    </edge>
+    <edge source="n27" target="n29" id="e406">
+      <data key="de9">F</data>
+    </edge>
+    <edge source="n27" target="n29" id="e407">
+      <data key="de9">G</data>
+    </edge>
+    <edge source="n27" target="n29" id="e408">
+      <data key="de9">Ho</data>
+    </edge>
+    <edge source="n27" target="n29" id="e409">
+      <data key="de9">JG</data>
+    </edge>
+    <edge source="n27" target="n29" id="e410">
+      <data key="de9">K</data>
+    </edge>
+    <edge source="n27" target="n29" id="e411">
+      <data key="de9">L</data>
+    </edge>
+    <edge source="n27" target="n29" id="e412">
+      <data key="de9">M</data>
+    </edge>
+    <edge source="n27" target="n29" id="e413">
+      <data key="de9">MN</data>
+    </edge>
+    <edge source="n27" target="n29" id="e414">
+      <data key="de9">O</data>
+    </edge>
+    <edge source="n27" target="n29" id="e415">
+      <data key="de9">P</data>
+    </edge>
+    <edge source="n27" target="n29" id="e416">
+      <data key="de9">Q</data>
+    </edge>
+    <edge source="n27" target="n29" id="e417">
+      <data key="de9">Sk</data>
+    </edge>
+    <edge source="n27" target="n29" id="e418">
+      <data key="de9">St</data>
+    </edge>
+    <edge source="n27" target="n29" id="e419">
+      <data key="de9">U</data>
+    </edge>
+    <edge source="n27" target="n29" id="e420">
+      <data key="de9">V</data>
+    </edge>
+    <edge source="n27" target="n29" id="e421">
+      <data key="de9">X</data>
+    </edge>
+    <edge source="n27" target="n29" id="e422">
+      <data key="de9">Y</data>
+    </edge>
+    <edge source="n1" target="n0" id="e423">
+      <data key="de9">G</data>
+    </edge>
+    <edge source="n1" target="n0" id="e424">
+      <data key="de9">Ho</data>
+    </edge>
+    <edge source="n1" target="n0" id="e425">
+      <data key="de9">F</data>
+    </edge>
+    <edge source="n1" target="n0" id="e426">
+      <data key="de9">Q</data>
+    </edge>
+    <edge source="n28" target="n3" id="e427">
+      <data key="de9">N</data>
+    </edge>
+    <edge source="n29" target="n2" id="e428">
+      <data key="de9">A</data>
+    </edge>
+    <edge source="n29" target="n2" id="e429">
+      <data key="de9">B</data>
+    </edge>
+    <edge source="n29" target="n2" id="e430">
+      <data key="de9">BA</data>
+    </edge>
+    <edge source="n29" target="n2" id="e431">
+      <data key="de9">BSt</data>
+    </edge>
+    <edge source="n29" target="n2" id="e432">
+      <data key="de9">BU</data>
+    </edge>
+    <edge source="n29" target="n2" id="e433">
+      <data key="de9">Bc</data>
+    </edge>
+    <edge source="n29" target="n2" id="e434">
+      <data key="de9">C</data>
+    </edge>
+    <edge source="n29" target="n2" id="e435">
+      <data key="de9">Dr</data>
+    </edge>
+    <edge source="n29" target="n2" id="e436">
+      <data key="de9">Ef</data>
+    </edge>
+    <edge source="n29" target="n2" id="e437">
+      <data key="de9">F</data>
+    </edge>
+    <edge source="n29" target="n2" id="e438">
+      <data key="de9">Gh</data>
+    </edge>
+    <edge source="n29" target="n2" id="e439">
+      <data key="de9">H</data>
+    </edge>
+    <edge source="n29" target="n2" id="e440">
+      <data key="de9">Ho</data>
+    </edge>
+    <edge source="n29" target="n2" id="e441">
+      <data key="de9">JG</data>
+    </edge>
+    <edge source="n29" target="n2" id="e442">
+      <data key="de9">K</data>
+    </edge>
+    <edge source="n29" target="n2" id="e443">
+      <data key="de9">M</data>
+    </edge>
+    <edge source="n29" target="n2" id="e444">
+      <data key="de9">MN</data>
+    </edge>
+    <edge source="n29" target="n2" id="e445">
+      <data key="de9">O</data>
+    </edge>
+    <edge source="n29" target="n2" id="e446">
+      <data key="de9">P</data>
+    </edge>
+    <edge source="n29" target="n2" id="e447">
+      <data key="de9">S</data>
+    </edge>
+    <edge source="n29" target="n2" id="e448">
+      <data key="de9">Sk</data>
+    </edge>
+    <edge source="n29" target="n2" id="e449">
+      <data key="de9">St</data>
+    </edge>
+    <edge source="n29" target="n2" id="e450">
+      <data key="de9">T</data>
+    </edge>
+    <edge source="n29" target="n2" id="e451">
+      <data key="de9">U</data>
+    </edge>
+    <edge source="n29" target="n2" id="e452">
+      <data key="de9">V</data>
+    </edge>
+    <edge source="n29" target="n2" id="e453">
+      <data key="de9">Vg</data>
+    </edge>
+    <edge source="n29" target="n2" id="e454">
+      <data key="de9">X</data>
+    </edge>
+    <edge source="n29" target="n2" id="e455">
+      <data key="de9">Y</data>
+    </edge>
+    <edge source="n29" target="n5" id="e456">
+      <data key="de9">Li</data>
+    </edge>
+    <edge source="n29" target="n4" id="e457">
+      <data key="de9">BS</data>
+    </edge>
+    <edge source="n29" target="n4" id="e458">
+      <data key="de9">G</data>
+    </edge>
+    <edge source="n29" target="n4" id="e459">
+      <data key="de9">Q</data>
+    </edge>
+    <edge source="n29" target="n7" id="e460">
+      <data key="de9">L</data>
+    </edge>
+    <edge source="n1" target="n0" id="e461">
+      <data key="de9">R</data>
+    </edge>
+    <edge source="n1" target="n0" id="e462">
+      <data key="de9">LT</data>
+    </edge>
+  </graph>
+  <graph edgedefault="directed" id="relationships" parse.edgeids="canonical" parse.edges="704" parse.nodeids="canonical" parse.nodes="2256" parse.order="nodesfirst">
+    <node id="n0">
+      <data key="dn0">#END#</data>
+    </node>
+    <node id="n1">
+      <data key="dn0">#START#</data>
+    </node>
+    <node id="n2">
+      <data key="dn0">10,2</data>
+    </node>
+    <node id="n3">
+      <data key="dn0">10,3</data>
+    </node>
+    <node id="n4">
+      <data key="dn0">10,4</data>
+    </node>
+    <node id="n5">
+      <data key="dn0">11,2</data>
+    </node>
+    <node id="n6">
+      <data key="dn0">11,3</data>
+    </node>
+    <node id="n7">
+      <data key="dn0">11,4</data>
+    </node>
+    <node id="n8">
+      <data key="dn0">11,5</data>
+    </node>
+    <node id="n9">
+      <data key="dn0">12,2</data>
+    </node>
+    <node id="n10">
+      <data key="dn0">12,3</data>
+    </node>
+    <node id="n11">
+      <data key="dn0">12,4</data>
+    </node>
+    <node id="n12">
+      <data key="dn0">13,2</data>
+    </node>
+    <node id="n13">
+      <data key="dn0">13,3</data>
+    </node>
+    <node id="n14">
+      <data key="dn0">14,2</data>
+    </node>
+    <node id="n15">
+      <data key="dn0">6,2</data>
+    </node>
+    <node id="n16">
+      <data key="dn0">7,1</data>
+    </node>
+    <node id="n17">
+      <data key="dn0">7,3</data>
+    </node>
+    <node id="n18">
+      <data key="dn0">7,4</data>
+    </node>
+    <node id="n19">
+      <data key="dn0">7,5</data>
+    </node>
+    <node id="n20">
+      <data key="dn0">7,6</data>
+    </node>
+    <node id="n21">
+      <data key="dn0">7,7</data>
+    </node>
+    <node id="n22">
+      <data key="dn0">8,1</data>
+    </node>
+    <node id="n23">
+      <data key="dn0">8,2</data>
+    </node>
+    <node id="n24">
+      <data key="dn0">8,3</data>
+    </node>
+    <node id="n25">
+      <data key="dn0">8,4</data>
+    </node>
+    <node id="n26">
+      <data key="dn0">8,5</data>
+    </node>
+    <node id="n27">
+      <data key="dn0">8,6</data>
+    </node>
+    <node id="n28">
+      <data key="dn0">9,2</data>
+    </node>
+    <node id="n29">
+      <data key="dn0">9,3</data>
+    </node>
+    <edge source="n5" target="n6" id="e1">
+      <data key="de5">henricus</data>
+      <data key="de6">heinricus</data>
+      <data key="de8">spelling</data>
+      <data key="de0">Same word. One reading has a capital H, the other hasn't.</data>
+      <data key="de7">local</data>
+    </edge>
+    <edge source="n5" target="n7" id="e2">
+      <data key="de5">henricus</data>
+      <data key="de6">Henricus</data>
+      <data key="de8">orthographic</data>
+      <data key="de0">Same word. One reading has a capital H, the other hasn't.</data>
+      <data key="de7">local</data>
+    </edge>
+    <edge source="n10" target="n11" id="e5">
+      <data key="de5">in</data>
+      <data key="de6">ex</data>
+      <data key="de8">collated</data>
+      <data key="de0">Parsed together for rank 12</data>
+      <data key="de7">local</data>
+    </edge>
+    <edge source="n12" target="n13" id="e6">
+      <data key="de5">anglia</data>
+      <data key="de6">Anglia</data>
+      <data key="de8">orthographic</data>
+      <data key="de7">local</data>
+    </edge>
+    <edge source="n16" target="n17" id="e7">
+      <data key="de5">svecia</data>
+      <data key="de6">suetia</data>
+      <data key="de8">orthographic</data>
+      <data key="de0">Same word. </data>
+      <data key="de7">local</data>
+    </edge>
+    <edge source="n16" target="n18" id="e8">
+      <data key="de5">svecia</data>
+      <data key="de6">swetia</data>
+      <data key="de8">orthographic</data>
+      <data key="de0">Same word. </data>
+      <data key="de7">local</data>
+    </edge>
+    <edge source="n18" target="n19" id="e9">
+      <data key="de5">swetia</data>
+      <data key="de6">swecia</data>
+      <data key="de8">orthographic</data>
+      <data key="de0">Same word. </data>
+      <data key="de7">local</data>
+    </edge>
+    <edge source="n19" target="n21" id="e10">
+      <data key="de5">swecia</data>
+      <data key="de6">Swecia</data>
+      <data key="de8">orthographic</data>
+      <data key="de0">Same word. </data>
+      <data key="de7">local</data>
+    </edge>
+    <edge source="n20" target="n21" id="e11">
+      <data key="de5">suecia</data>
+      <data key="de6">Swecia</data>
+      <data key="de8">orthographic</data>
+      <data key="de7">local</data>
+    </edge>
+    <edge source="n23" target="n26" id="e12">
+      <data key="de5">Venerabilis</data>
+      <data key="de6">uenerabilis</data>
+      <data key="de8">orthographic</data>
+      <data key="de7">local</data>
+    </edge>
+    <edge source="n23" target="n27" id="e13">
+      <data key="de5">Venerabilis</data>
+      <data key="de6">venerabilis</data>
+      <data key="de8">orthographic</data>
+      <data key="de7">global</data>
+    </edge>
+    <edge source="n26" target="n27" id="e15">
+      <data key="de5">uenerabilis</data>
+      <data key="de6">venerabilis</data>
+      <data key="de8">orthographic</data>
+      <data key="de7">local</data>
+    </edge>
+    <edge source="n28" target="n29" id="e16">
+      <data key="de5">henricus</data>
+      <data key="de6">pontifex</data>
+      <data key="de8">collated</data>
+      <data key="de7">local</data>
+      <data key="de0">Parsed together for rank 9</data>
+    </edge>
+  </graph>
+</graphml>
index 01c888d..320832e 100644 (file)
@@ -40,5 +40,63 @@ is( scalar @v3, 0, "Nothing deleted on non-existent relationship" );
 
 
 
+# =begin testing
+{
+use Text::Tradition;
+use TryCatch;
+
+my $t1 = Text::Tradition->new( 'input' => 'Self', 'file' => 't/data/legendfrag.xml' );
+# Test 1: try to equate nodes that are prevented with an intermediate collation
+ok( $t1, "Parsed test fragment file" );
+my $c1 = $t1->collation;
+my $trel = $c1->get_relationship( '9,2', '9,3' );
+is( ref( $trel ), 'Text::Tradition::Collation::Relationship',
+       "Troublesome relationship exists" );
+is( $trel->type, 'collated', "Troublesome relationship is a collation" );
+
+# Try to make the link we want
+try {
+       $c1->add_relationship( '8,6', '10,3', { 'type' => 'orthographic' } );
+       ok( 1, "Added cross-collation relationship as expected" );
+} catch {
+       ok( 0, "Existing collation blocked equivalence relationship" );
+}
+
+try {
+       $c1->calculate_ranks();
+       ok( 1, "Successfully calculated ranks" );
+} catch {
+       ok( 0, "Collation now has a cycle" );
+}
+
+# Test 2: try to equate nodes that are prevented with a real intermediate
+# equivalence
+
+my $t2 = Text::Tradition->new( 'input' => 'Self', 'file' => 't/data/legendfrag.xml' );
+# Test 1: try to equate nodes that are prevented with an intermediate collation
+my $c2 = $t2->collation;
+$c2->add_relationship( '9,2', '9,3', { 'type' => 'lexical' } );
+my $trel2 = $c2->get_relationship( '9,2', '9,3' );
+is( ref( $trel2 ), 'Text::Tradition::Collation::Relationship',
+       "Created blocking relationship" );
+is( $trel2->type, 'lexical', "Blocking relationship is not a collation" );
+# This time the link ought to fail
+try {
+       $c2->add_relationship( '8,6', '10,3', { 'type' => 'orthographic' } );
+       ok( 0, "Existing equivalence blocked crossing relationship" );
+} catch {
+       ok( 1, "Added cross-equivalent bad relationship" );
+}
+
+try {
+       $c2->calculate_ranks();
+       ok( 1, "Successfully calculated ranks" );
+} catch {
+       ok( 0, "Collation now has a cycle" );
+}
+}
+
+
+
 
 1;