Class Normalizer

All Implemented Interfaces:
org.incenp.obofoundry.kgcl.model.IChangeVisitor<Void>

public class Normalizer extends ChangeVisitorBase<Void>
Normalizes a KGCL changeset.

Some KGCL changes can be described in more than one way. For example, the edge to create in a EdgeCreation change can be described using either the about_edge slot, or using the subject, predicate, and object slots. This is most likely an error in the KGCL model, but one that has never received any attention. In KGCL-Java, we consider that the “correct” way to describe the edge is through the about_edge slot.

This object is intended to fix this kind of improper usage of KGCL slots.

See Also:
  • Constructor Details

    • Normalizer

      public Normalizer()
  • Method Details

    • visit

      public Void visit(org.incenp.obofoundry.kgcl.model.EdgeCreation v)
      Specified by:
      visit in interface org.incenp.obofoundry.kgcl.model.IChangeVisitor<Void>
      Overrides:
      visit in class ChangeVisitorBase<Void>
    • visit

      public Void visit(org.incenp.obofoundry.kgcl.model.PlaceUnder v)
      Specified by:
      visit in interface org.incenp.obofoundry.kgcl.model.IChangeVisitor<Void>
      Overrides:
      visit in class ChangeVisitorBase<Void>
    • visit

      public Void visit(org.incenp.obofoundry.kgcl.model.EdgeDeletion v)
      Specified by:
      visit in interface org.incenp.obofoundry.kgcl.model.IChangeVisitor<Void>
      Overrides:
      visit in class ChangeVisitorBase<Void>
    • visit

      public Void visit(org.incenp.obofoundry.kgcl.model.RemoveUnder v)
      Specified by:
      visit in interface org.incenp.obofoundry.kgcl.model.IChangeVisitor<Void>
      Overrides:
      visit in class ChangeVisitorBase<Void>
    • normalize

      public static List<org.incenp.obofoundry.kgcl.model.Change> normalize(List<org.incenp.obofoundry.kgcl.model.Change> changeset)
      Normalizes all changes in the given list.
      Parameters:
      changeset - The list of change objects to normalizes.
      Returns:
      The input list after normalization.