Class Link

java.lang.Object
edu.fiu.jtlex.data.Link
All Implemented Interfaces:
ILink

public class Link extends Object implements ILink
Default implementation of ILink.
Author:
Pablo Maldonado
  • Constructor Details

    • Link

      public Link​(ILink.LinkTag linktag, int linkID, String syntax, INode eventInstance, ISignal signal, INode relatedToNode, ILinkType relType, ILink.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 != LinkTag.TLINK
    • Link

      public Link​(ILink.LinkTag linktag, int linkID, String syntax, INode eventInstance, ISignal signal, INode relatedToNode, ILinkType 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 linktag == LinkTag.TLINK
  • Method Details

    • getLinkID

      public int getLinkID()
      Description copied from interface: ILink
      Returns the ID of the link.
      Link ID gives each TimeML link an identification number OPTIONAL
      Specified by:
      getLinkID in interface ILink
      Returns:
      the ID of the link.
    • getLinkTag

      public ILink.LinkTag getLinkTag()
      Description copied from interface: ILink
      Returns the type of Link.
      Specified by:
      getLinkTag in interface ILink
      Returns:
      ILink.LinkTag.TLINK / ILink.LinkTag.ALINK / ILink.LinkTag.SLINK
    • getSyntax

      public String getSyntax()
      Description copied from interface: ILink
      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).
      OPTIONAL
      Specified by:
      getSyntax in interface ILink
      Returns:
      the syntax of the link.
    • getEventInstance

      public INode getEventInstance()
      Description copied from interface: ILink
      Returns the ID of the event instance involved in the link. OBLIGATORY
      Specified by:
      getEventInstance in interface ILink
      Returns:
      the ID of the event instance involved in the link.
    • getSignal

      public ISignal getSignal()
      Description copied from interface: ILink
      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.
      OPTIONAL
      Specified by:
      getSignal in interface ILink
      Returns:
      the optional ID of the relation signal.
    • getOrigin

      public ILink.Origintype getOrigin()
      Description copied from interface: ILink
      Returns whether a TLINK was generated MANUALLY or by CLOSURE.
      THIS IS ONLY FOR TLINK
      Specified by:
      getOrigin in interface ILink
      Returns:
      Whether link was generated MANUALLY or by CLOSURE
    • getRelatedToNode

      public INode getRelatedToNode()
      Description copied from interface: ILink
      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.
      Specified by:
      getRelatedToNode in interface ILink
      Returns:
      the ID of the entity that is being related to the event instance with ID=eventInstanceID or time expression with ID=timeID.
    • getRelType

      public ILinkType getRelType()
      Description copied from interface: ILink
      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.
      Specified by:
      getRelType in interface ILink
      Returns:
      ALinkRelType / SLinkRelType / TLinkRelType
      See Also:
      ILink.ALinkType, ILink.SLinkType, ILink.TLinkType
    • hashCode

      public int hashCode()
      Description copied from interface: ILink
      Specified by:
      hashCode in interface ILink
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toJSON

      public String toJSON()
      Description copied from interface: ILink
      Returns the JSON (RFC 8259) representation of the Link.
      Specified by:
      toJSON in interface ILink
      Returns:
      the JSON (RFC 8259) representation of the Link.
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Object
    • clone

      public Link clone()
      Specified by:
      clone in interface ILink