Enum Class MappingCardinality

java.lang.Object
java.lang.Enum<MappingCardinality>
org.incenp.obofoundry.sssom.model.MappingCardinality
All Implemented Interfaces:
Serializable, Comparable<MappingCardinality>, Constable

public enum MappingCardinality extends Enum<MappingCardinality>
Represents the cardinality of a mapping. This indicates whether a mapping is between exactly one subject and one object, between one subject and several objects, etc.
  • Enum Constant Details

  • Method Details

    • values

      public static MappingCardinality[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MappingCardinality valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<MappingCardinality>
    • getInverse

      public MappingCardinality getInverse()
      Gets the inverse of this cardinality (i.e., "1:n" -> "n:1").
      Returns:
      The inverse cardinality (may be identical, e.g. for "1:1").
    • fromString

      public static MappingCardinality fromString(String v)
      Parses a string into a mapping cardinality enum value.
      Parameters:
      v - The string to parse.
      Returns:
      The corresponding enumeration value, of null if the provided string does not match any mapping cardinality.
    • inferCardinality

      @Deprecated public static void inferCardinality(List<Mapping> mappings)
      Deprecated.
      Infers the cardinality for all mappings in the given list. This overrides any cardinality information that may already be stored in each mapping.
      Parameters:
      mappings - The mappings for which to infer cardinality.
    • getSubject

      @Deprecated public static String getSubject(Mapping mapping)
      Deprecated.
      Gets a string representing the subject that can be used for cardinality computation. The returned value takes into account the subject_id (or the subject_label if the subject is a literal) and the subject_type.
      Parameters:
      mapping - The mapping from which to derive a subject string.
      Returns:
      A string that can be used to compare subjects across mappings.
    • getObject

      @Deprecated public static String getObject(Mapping mapping)
      Deprecated.
      Gets a string representing the object that can be used for cardinality computation. The returned value takes into account the object_id (or the object_label if the object is a literal) and the object_type.
      Parameters:
      mapping - The mapping from which to derive an object string.
      Returns:
      A String that can be used to compare objects across mappings.