Class Relationship

java.lang.Object
com.lexalytics.salience.Relationship

public class Relationship
extends java.lang.Object

A Relationship object represents a connection between one or more Entity objects. This is retrieved by Salience through the API method calls Salience.getNamedEntityRelationships() and Salience.getUserEntityRelationships().

  • Constructor Summary

    Constructors 
    Constructor Description
    Relationship​(java.util.Vector<Entity> vEntities, java.lang.String sType, java.lang.String sExtra, java.lang.String sReference, float fScore, java.util.Map<java.lang.String,​java.util.Set<Entity>> mRelatedEntities)
    Creates a new relationship object.
  • Method Summary

    Modifier and Type Method Description
    float getConfidenceScore()
    Retrieves a measure of confidence in the relationship extraction.
    java.util.Vector<Entity> getEntities()
    Retrieves a list of the Entity objects that comprise the relationship.
    java.lang.String getExtra()
    Retrieves any extra information that has been extracted about the relationship.
    java.lang.String getReference()
    Retrieves the paths and line numbers of rules/models that generated this relationship.
    java.util.Map<java.lang.String,​java.util.Set<Entity>> getRelatedEntities()
    The entities that make up this relationship, indexed by their role in the relationship.
    java.lang.String getType()
    Retrieves a label describing the nature of the relationship.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Relationship

      public Relationship​(java.util.Vector<Entity> vEntities, java.lang.String sType, java.lang.String sExtra, java.lang.String sReference, float fScore, java.util.Map<java.lang.String,​java.util.Set<Entity>> mRelatedEntities)
      Creates a new relationship object. This is not intended for client use. Objects of this type are created by Salience Engine to provide results for the Salience.getNamedEntityRelationships() and Salience.getUserEntityRelationships() API methods.
      Parameters:
      vEntities - The Entity objects that are connected by a relationship.
      sType - A descriptive label for the type of the relationship.
      sExtra - Extra information about the relationship.
      sReference - Files and line numbers where the defining relationship rule was found
      fScore - A measure of confidence in the relationship extraction.
      mRelatedEntities - A Map of Sets of Entity objects that make up this relationship, indexed by their role.
  • Method Details

    • getEntities

      public java.util.Vector<Entity> getEntities()
      Retrieves a list of the Entity objects that comprise the relationship.
      Returns:
      A Vector of Entity objects that comprise the relationship.
    • getType

      public java.lang.String getType()
      Retrieves a label describing the nature of the relationship. This is provided in the pattern files in the data directory that configure relationship extraction.
      Returns:
      A String containing a description of the relationship.
    • getExtra

      public java.lang.String getExtra()
      Retrieves any extra information that has been extracted about the relationship.
      Returns:
      A String containing extra information for the relationship.
    • getReference

      public java.lang.String getReference()
      Retrieves the paths and line numbers of rules/models that generated this relationship.
      Returns:
      A String containing ; separated paths with ::# line number references.
    • getConfidenceScore

      public float getConfidenceScore()
      Retrieves a measure of confidence in the relationship extraction.
      Returns:
      A measure of confidence in the relationship extraction.
    • getRelatedEntities

      public java.util.Map<java.lang.String,​java.util.Set<Entity>> getRelatedEntities()
      The entities that make up this relationship, indexed by their role in the relationship.
      Returns:
      A Map of Sets of Entity objects making up the relationship.