Class TimeMLLink

java.lang.Object
edu.fiu.jtlex.timeml.data.TimeMLLink
All Implemented Interfaces:
ITimeMLLink

public class TimeMLLink extends Object implements ITimeMLLink
Default implementation of ILink.
Since:
jTLEX 1.0
Author:
Pablo Maldonado
  • Field Details

  • Constructor Details

    • TimeMLLink

      public TimeMLLink(Class<?> linktag, int linkID, String syntax, ITimeMLNode eventInstance, ITimeMLSignal signal, ITimeMLNode relatedToNode, ITimeMLLink.ITimeMLLinkType relType, ITimeMLLink.Origintype orig)
      This is the constructor for Tlink.
      Parameters:
      linktag - linkTag is the type of Link: TLINK
      linkID - Link ID gives each TimeML link an identification number
      syntax - syntax holds any syntactic pattern that was used in generating the link
      eventInstance - Obligatory attribute (one or the other of these needs to be present). This is the ID of the eventInstance or the timeID involved in the temporal link.
      signal - Optional attribute. If the temporal relation holding between the entities is explicitly signaled in the text, then the ID of that signal needs to be supplied here.
      relatedToNode - Obligatory attribute (one or the other of these needs to be present). This is the ID of the entity that is being related to the event instance with ID=eventInstanceID or time expression with ID=timeID.
      relType - Obligatory attribute. This is the temporal relation holding between the entities.
      orig - Optional attribute. This attribute shows whether a TLINK was generated manually or by closure.
      Throws:
      NullPointerException - if TLinkRelType argument is null
      IllegalArgumentException - throw error if linktag is not the TLink Class
    • TimeMLLink

      public TimeMLLink(Class<?> linktag, int linkID, String syntax, ITimeMLNode eventInstance, ITimeMLSignal signal, ITimeMLNode relatedToNode, ITimeMLLink.ITimeMLLinkType relType)
      This is the constructor for Alink and SLink
      Parameters:
      linktag - linkTag is the type of Link: SLINK or ALINK
      linkID - Link ID gives each TimeML link an identification number
      syntax - syntax holds any syntactic pattern that was used in generating the link
      eventInstance - Obligatory attribute. This is the ID of the (aspectual) eventInstance involved in the aspectual link.
      signal - Optional attribute. If the aspectual relation holding between the events is explicitly signaled in the text, then the ID of that signal needs to be filled in here
      relatedToNode - Obligatory attribute. This is the ID of the event instance related to the aspectual event.
      relType - Obligatory attribute. This is the temporal relation holding between the entities for Alink
      Throws:
      NullPointerException - if ALinkRelType argument is null
      IllegalArgumentException - throw error if it is not an ALink or SLink class
  • Method Details

    • getLinkID

      public int getLinkID()
      Returns the ID of the link.
      Link ID gives each TimeML link an identification number Can be null.
      Specified by:
      getLinkID in interface ITimeMLLink
      Returns:
      the ID of the link.
      Since:
      jTLEX 1.0
    • getLinkTag

      public Class<ITimeMLLink> getLinkTag()
      Returns the type of Link. Will never return null due to constructor.
      Specified by:
      getLinkTag in interface ITimeMLLink
      Returns:
      ITimeMLLink.TLink / ITimeMLLink.ALink / ITimeMLLink.SLink
      Since:
      jTLEX 1.0
    • getSyntax

      public String getSyntax()
      Returns the syntax of the link.
      Syntax holds any syntactic pattern that was used in generating the link (e.g. from an automatic annotation tool).
      Can be null.
      Specified by:
      getSyntax in interface ITimeMLLink
      Returns:
      the syntax of the link.
      Since:
      jTLEX 1.0
    • getEventInstance

      public String getEventInstance()
      Returns the ID of the event instance involved in the link. OBLIGATORY, cannot be null
      Specified by:
      getEventInstance in interface ITimeMLLink
      Returns:
      the ID of the event instance involved in the link.
      Since:
      jTLEX 1.0
    • getSignal

      public ITimeMLSignal getSignal()
      Returns the ID of the relation signal.
      If the temporal relation holding between the entities is explicitly signaled in the text, then the ID of that signal needs to be supplied here.
      Can be null.
      Specified by:
      getSignal in interface ITimeMLLink
      Returns:
      the optional ID of the relation signal.
      Since:
      jTLEX 1.0
    • getOrigin

      public ITimeMLLink.Origintype getOrigin()
      Returns whether a TLINK was generated MANUALLY or by CLOSURE.
      THIS IS ONLY FOR TLINK Can be null.
      Specified by:
      getOrigin in interface ITimeMLLink
      Returns:
      Whether link was generated MANUALLY or by CLOSURE
      Since:
      jTLEX 1.0
    • getRelatedToNode

      public String getRelatedToNode()
      Returns the ID of the entity that is being related to the event instance with ID=eventInstanceID or time expression with ID=timeID.
      relatedToEventInstance or relatedToTime needs to be present. Cannot be null due to constructor.
      Specified by:
      getRelatedToNode in interface ITimeMLLink
      Returns:
      the ID of the entity that is being related to the event instance with ID=eventInstanceID or time expression with ID=timeID.
      Since:
      jTLEX 1.0
    • getRelType

      public ITimeMLLink.ITimeMLLinkType getRelType()
      This is the temporal relation holding between the entities.
      These are represented by 3 different enums:
      • ALinkRelType
      • SLinkRelType
      • TLinkRelType

      The returned type depends on the linkTag. Cannot be null due to constructor.
      Specified by:
      getRelType in interface ITimeMLLink
      Returns:
      ALinkRelType / SLinkRelType / TLinkRelType
      Since:
      jTLEX 1.0
      See Also:
    • toString

      public String toString()
      Converts the Link to a String Cannot be null due to requiring items from constructor.
      Specified by:
      toString in interface ITimeMLLink
      Overrides:
      toString in class Object
      Returns:
      String
      Since:
      jTLEX 1.0
    • toJson

      public String toJson()
      Returns the JSON (RFC 8259) representation of the Link. Cannot be null due to requiring items from constructor.
      Specified by:
      toJson in interface ITimeMLLink
      Returns:
      the JSON (RFC 8259) representation of the Link.
      Since:
      jTLEX 1.0
    • clone

      public TimeMLLink clone()
      Returns a field-by-field copy of the Link. Cannot be null due to requiring items from constructor.
      Specified by:
      clone in interface ITimeMLLink
      Overrides:
      clone in class Object
      Returns:
      a copy of the Link.
      Since:
      jTLEX 1.0
    • hashCode

      public int hashCode()
      Generates a hash code for the link.
      Specified by:
      hashCode in interface ITimeMLLink
      Overrides:
      hashCode in class Object
      Returns:
      The hash code.
      Since:
      jTLEX 1.0
    • equals

      public boolean equals(Object o)
      Checks if this link equals an object.
      Specified by:
      equals in interface ITimeMLLink
      Overrides:
      equals in class Object
      Parameters:
      o - The object to compare against.
      Returns:
      True if both links are equal, i.e. same ID and tag, or else false.
      Throws:
      NullPointerException - If the object to compare against is false.
      Since:
      jTLEX 1.0