Example #1
0
  @Test
  public final void testNormalizeInoh() {
    // there're two Protein objects that have entityReference
    // rdf:ID="IMR_0100366_G_alpha_s_Canonical" (in fact a generic ProteinReference inproperly
    // defined);
    // and that PR has two UniProt UnificationXref: P63092 (human), P63095 (rat).
    // Identifiers.org URI for the PR should NOT be generated.
    //
    // Also, there was a bug when replacing the PR's URI (warning: IllegalBioPAXArgumentException:
    // Incompatible type!..)
    // The cause is that there was a (weird, invalid) PublicationXref having db:id as UniProt:P63092
    // that gets the same URI!
    // To avoid such issues altogether (despite illegal pub. xrefs), the Normalizer won't use
    // Identifiers.org for PublicationXrefs anymore.

    Model model = simpleIO.convertFromOWL(getClass().getResourceAsStream("/test-inoh.owl"));
    Normalizer normalizer = new Normalizer();
    normalizer.setXmlBase("");
    normalizer.normalize(model);

    // A weird PublicationXref that uses a UniProt ID won't be normalized:
    assertFalse(model.containsID("http://identifiers.org/uniprot/P63092"));

    // A PR with two UniProt IDs/unif.xrefs - human, rat - won't be normalized!
    assertTrue(model.containsID(model.getXmlBase() + "IMR_0100366_G_alpha_s_Canonical"));
    assertEquals(
        "ProteinReference",
        model
            .getByID(model.getXmlBase() + "IMR_0100366_G_alpha_s_Canonical")
            .getModelInterface()
            .getSimpleName());
  }