UIMA
  1. UIMA
  2. UIMA-2409

CasCopier.copyCasView should be able to copy into a view with a different name

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.1SDK
    • Component/s: Core Java Framework
    • Labels:
      None

      Description

      The CasCopier should be able to copy a CAS view into a new CAS and giving this new CAS view a different name.

      A common use case is to copy a view of multi view CAS into a new single view CAS.

      1. UIMA-2409.patch
        8 kB
        Joern Kottmann

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        390d 7h 27m 1 Marshall Schor 18/Jun/13 21:47
        Resolved Resolved Reopened Reopened
        29d 15h 36m 2 Marshall Schor 18/Jul/13 21:27
        Reopened Reopened Resolved Resolved
        8h 58m 2 Marshall Schor 18/Jul/13 22:22
        Marshall Schor made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Marshall Schor added a comment -

        The code that disallowed copying between 2 views of the same CAS was removed. Copying from v1 to v1 (same view) throws concurrent modification exception. I think that's OK. Copying from v1 to v2 of the same CAS seems to work. If the sofa data isn't copied, any types that are subtypes of AnnotationBase will have begin/end potentially pointing to meaningless places (if the sofa data is different). I think this is a user beware condition. What motivated this was that the previous restrictions started breaking some user code which was copying a (non-annotation) between views - that should be OK.

        Show
        Marshall Schor added a comment - The code that disallowed copying between 2 views of the same CAS was removed. Copying from v1 to v1 (same view) throws concurrent modification exception. I think that's OK. Copying from v1 to v2 of the same CAS seems to work. If the sofa data isn't copied, any types that are subtypes of AnnotationBase will have begin/end potentially pointing to meaningless places (if the sofa data is different). I think this is a user beware condition. What motivated this was that the previous restrictions started breaking some user code which was copying a (non-annotation) between views - that should be OK.
        Marshall Schor made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Marshall Schor added a comment -

        The disallowing of copying from one view to another is too strong - breaks some existing code. Refine this to a more precise prohibition - just where needed.

        Show
        Marshall Schor added a comment - The disallowing of copying from one view to another is too strong - breaks some existing code. Refine this to a more precise prohibition - just where needed.
        Marshall Schor made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Marshall Schor added a comment -

        Added more checking and clarification: the copier doesn't work between 2 views in the same CAS (there are lots of subtle issues here). If this is needed, we can look into what's possible in a next iteration.

        Show
        Marshall Schor added a comment - Added more checking and clarification: the copier doesn't work between 2 views in the same CAS (there are lots of subtle issues here). If this is needed, we can look into what's possible in a next iteration.
        Marshall Schor made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Marshall Schor added a comment -

        Found a NPE when the Cas being copied is passed as a "base" view.

        Show
        Marshall Schor added a comment - Found a NPE when the Cas being copied is passed as a "base" view.
        Marshall Schor made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Marshall Schor [ schor ]
        Resolution Fixed [ 1 ]
        Hide
        Marshall Schor added a comment -

        Here's what got implemented:

        1) a deep copy. This includes FSs that may be indexed in other views. But we don't index the FSs in these other views in the copy... but, we do create the SofaFS if needed (these are only needed for Types which are subtypes of AnnotationBaseFS. Any SofaFSs added this way do not have their Sofa Data (if any) copied over

        2) only checking for src/tgt CASes being the same view in the same CAS as an "error".

        3) the bit of code in the copier to insure the SofaFS ref is set for subtypes of AnnotationFS was slightly extended by having it do the same thing for subtypes of AnnotationBaseFS.

        A new version of a utility test class to (partially) compare CASes was copied and changed to support comparing different CAS Views. I've only added one test for this that does the basics, and doesn't test the edge cases. We can always do more later

        Show
        Marshall Schor added a comment - Here's what got implemented: 1) a deep copy. This includes FSs that may be indexed in other views. But we don't index the FSs in these other views in the copy... but, we do create the SofaFS if needed (these are only needed for Types which are subtypes of AnnotationBaseFS. Any SofaFSs added this way do not have their Sofa Data (if any) copied over 2) only checking for src/tgt CASes being the same view in the same CAS as an "error". 3) the bit of code in the copier to insure the SofaFS ref is set for subtypes of AnnotationFS was slightly extended by having it do the same thing for subtypes of AnnotationBaseFS. A new version of a utility test class to (partially) compare CASes was copied and changed to support comparing different CAS Views. I've only added one test for this that does the basics, and doesn't test the edge cases. We can always do more later
        Hide
        Peter Klügl added a comment -

        so +1 for adding this functionality. I actually wonder why I haven't found this issue...

        Show
        Peter Klügl added a comment - so +1 for adding this functionality. I actually wonder why I haven't found this issue...
        Hide
        Joern Kottmann added a comment -

        Yes, the patch should be reviewed before it is applied. I was not confident that it works for all the edge cases. Can you have a look Marshall?

        Show
        Joern Kottmann added a comment - Yes, the patch should be reviewed before it is applied. I was not confident that it works for all the edge cases. Can you have a look Marshall?
        Hide
        Marshall Schor added a comment -

        What is the status of this change? It looks like one attempt was made in May 2012, then reverted in July 2012, and a patch attached (for review) in July 2012, but nothing further.

        Should the patch be reviewed and then applied (with any fixups needed)?

        Show
        Marshall Schor added a comment - What is the status of this change? It looks like one attempt was made in May 2012, then reverted in July 2012, and a patch attached (for review) in July 2012, but nothing further. Should the patch be reviewed and then applied (with any fixups needed)?
        Joern Kottmann made changes -
        Field Original Value New Value
        Attachment UIMA-2409.patch [ 12535157 ]
        Hide
        Joern Kottmann added a comment -

        First draft to change the view name on a view copy.

        Show
        Joern Kottmann added a comment - First draft to change the view name on a view copy.
        Joern Kottmann created issue -

          People

          • Assignee:
            Marshall Schor
            Reporter:
            Joern Kottmann
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development