/*
  # UniProt NCBI taxonomy annotations

  There are two interesnting pieces of information here:

  1. the organism from which this protein comes
  2. the host, for viruses and the like
*/
package com.bio4j.model;

import com.bio4j.angulillos.*;
import com.bio4j.angulillos.Arity.*;

public final class UniProtNCBITaxonomyGraph<V,E> extends LinkGraph<UniProtNCBITaxonomyGraph<V,E>,V,E> {

  public UniProtNCBITaxonomyGraph(UniProtGraph<V,E> uniProtGraph, NCBITaxonomyGraph<V,E> ncbiTaxonomyGraph) {

    super(uniProtGraph.raw());
    this.uniProtGraph = uniProtGraph;
    this.ncbiTaxonomyGraph = ncbiTaxonomyGraph;
  }

  public final UniProtGraph<V,E> uniProtGraph;
  public final NCBITaxonomyGraph<V,E> ncbiTaxonomyGraph;

  @Override public final UniProtNCBITaxonomyGraph<V,E> self() { return this; }

  public final class Organism extends LinkEdge<
    UniProtGraph<V,E>, UniProtGraph<V,E>.Protein,
    Organism,
    NCBITaxonomyGraph<V,E>, NCBITaxonomyGraph<V,E>.Taxon
  >
  {
    private Organism(E edge) { super(edge, organism); }
    @Override public final Organism self() { return this; }
  }

  public final OrganismType organism = new OrganismType();
  public final class OrganismType extends LinkEdgeType<
    UniProtGraph<V,E>, UniProtGraph<V,E>.Protein,
    Organism,
    NCBITaxonomyGraph<V,E>, NCBITaxonomyGraph<V,E>.Taxon
  >
  implements FromAny, ToOne {

    private OrganismType() { super(uniProtGraph.protein, ncbiTaxonomyGraph.taxon); }
    @Override public final Organism fromRaw(E edge) { return new Organism(edge); }
  }
}

@@ -1542,11 +1542,701 @@
 ); %7D%0A  %7D
+%0A%0A  public final class Host extends LinkEdge%3C%0A    UniProtGraph%3CV,E%3E, UniProtGraph%3CV,E%3E.Protein,%0A    Host,%0A    NCBITaxonomyGraph%3CV,E%3E, NCBITaxonomyGraph%3CV,E%3E.Taxon%0A  %3E%0A  %7B%0A    private Host(E edge) %7B super(edge, host); %7D%0A    @Override public final Host self() %7B return this; %7D%0A  %7D%0A%0A  public final HostType host = new HostType();%0A  public final class HostType extends LinkEdgeType%3C%0A    UniProtGraph%3CV,E%3E, UniProtGraph%3CV,E%3E.Protein,%0A    Host,%0A    NCBITaxonomyGraph%3CV,E%3E, NCBITaxonomyGraph%3CV,E%3E.Taxon%0A  %3E%0A  implements FromAny, ToAny %7B%0A%0A    private HostType() %7B super(uniProtGraph.protein, ncbiTaxonomyGraph.taxon); %7D%0A    @Override public final Host fromRaw(E edge) %7B return new Host(edge); %7D%0A  %7D
 %0A%7D%0A

add a host organism edge between proteins and taxa