Enum CommonPredicate
- java.lang.Object
-
- java.lang.Enum<CommonPredicate>
-
- org.incenp.obofoundry.sssom.model.CommonPredicate
-
- All Implemented Interfaces:
Serializable,Comparable<CommonPredicate>
public enum CommonPredicate extends Enum<CommonPredicate>
Represents some "well-known" mapping predicates for which we have built-in knowledge on how to invert them.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description OWL_EQUIVALENT_CLASSSEMAPV_CROSS_SPECIES_BROAD_MATCHSEMAPV_CROSS_SPECIES_EXACT_MATCHSEMAPV_CROSS_SPECIES_NARROW_MATCHSKOS_BROAD_MATCHSKOS_EXACT_MATCHSKOS_NARROW_MATCH
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CommonPredicatefromString(String v)Parses a string into a common predicate.StringgetInverse()Gets the inverse predicate for this predicate.static Mappinginvert(Mapping mapping)Deprecated.UseMapping.invert()instead.booleanisExact()Indicates whether the predicate is “exact”.booleanisInvertible()Indicates whether a predicate can be inverted.StringtoString()static CommonPredicatevalueOf(String name)Returns the enum constant of this type with the specified name.static CommonPredicate[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SKOS_EXACT_MATCH
public static final CommonPredicate SKOS_EXACT_MATCH
-
SKOS_NARROW_MATCH
public static final CommonPredicate SKOS_NARROW_MATCH
-
SKOS_BROAD_MATCH
public static final CommonPredicate SKOS_BROAD_MATCH
-
OWL_EQUIVALENT_CLASS
public static final CommonPredicate OWL_EQUIVALENT_CLASS
-
SEMAPV_CROSS_SPECIES_EXACT_MATCH
public static final CommonPredicate SEMAPV_CROSS_SPECIES_EXACT_MATCH
-
SEMAPV_CROSS_SPECIES_NARROW_MATCH
public static final CommonPredicate SEMAPV_CROSS_SPECIES_NARROW_MATCH
-
SEMAPV_CROSS_SPECIES_BROAD_MATCH
public static final CommonPredicate SEMAPV_CROSS_SPECIES_BROAD_MATCH
-
-
Method Detail
-
values
public static CommonPredicate[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CommonPredicate c : CommonPredicate.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CommonPredicate valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
isExact
public boolean isExact()
Indicates whether the predicate is “exact”. A mapping with an exact predicate can be inverted without changing the predicate.- Returns:
trueif the predicate is exact,falseotherwise.
-
getInverse
public String getInverse()
Gets the inverse predicate for this predicate. When a predicate has a known inverse predicate, the inverse predicate should be used when inverting a mapping.- Returns:
- The inverse predicate, if known; otherwise
null.
-
isInvertible
public boolean isInvertible()
Indicates whether a predicate can be inverted. A predicate can be inverted if it is an exact predicate or if it has a known inverse predicate.- Returns:
trueif the predicate can be inverted, otherwisefalse.
-
toString
public String toString()
- Overrides:
toStringin classEnum<CommonPredicate>
-
fromString
public static CommonPredicate fromString(String v)
Parses a string into a common predicate.- Parameters:
v- The string to parse.- Returns:
- The corresponding predicate, or
nullif the provided string does not match any of the common predicates.
-
invert
@Deprecated public static Mapping invert(Mapping mapping)
Deprecated.UseMapping.invert()instead.Try inverting a mapping according to standard inversion rules.- Parameters:
mapping- The mapping to invert.- Returns:
- A new mapping that is an inversion of the provided one, or
nullif the mapping could not be inverted.
-
-