Menu

referentElements help needed

Help
2003-04-04
2012-09-14
  • Robyn Kozierok

    Robyn Kozierok - 2003-04-04

    [Well, I finally got SourceForge to let me post this!]

    I need to be able to find out what kind of reference a referentElement
    has.

    For example, if I have an Annotation and call getReferentElements on it,
    and there is a Region in the set of ReferentElements, I want to find out
    what is the role of the reference to the Annotation in the Region, or
    that it is in a subordinate set of that Region.

    It appears that this is not simple to do.  My best guess is that I could
    get the Region's ATLASType, and from that
    getDefinedRolesForSubordinates, and then cycle through those Roles,
    seeing if the subordinate with that Role is the original Annotation or
    not (using equals?)
    If I got through all the roles without finding the original Annotation I
    would assume it belonged to a subordinate set of Annotations with the
    same AnnotationType as the original Annotation.
    Does that sound like the best way to do this?

    Thanks in advance,
    --Robyn

    I need to be able to find out what kind of reference a referentElement
    has.

    For example, if I have an Annotation and call getReferentElements on it,
    and there is a Region in the set of ReferentElements, I want to find out
    what is the role of the reference to the Annotation in the Region, or
    that it is in a subordinate set of that Region.

    It appears that this is not simple to do.  My best guess is that I could
    get the Region's ATLASType, and from that
    getDefinedRolesForSubordinates, and then cycle through those Roles,
    seeing if the subordinate with that Role is the original Annotation or
    not (using equals?)
    If I got through all the roles without finding the original Annotation I
    would assume it belonged to a subordinate set of Annotations with the
    same AnnotationType as the original Annotation.
    Does that sound like the best way to do this?

    Thanks in advance,
    --Robyn

     
    • Christophe Laprun

      I added a getRoleInReferentContext method on ATLASElement that does just what you want. A similar method has been added on ATLASType: getRolesInReferentContext...
      They're in the CVS. However, we have made significant changes in the IO architecture in the CVS version so you might experience problems with using the CVS version of the code...
      We are working on having something stable enough so that it can be released as a intermediate Jar soon.

       

Log in to post a comment.