Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specific type of array elements in element FS is not retained #285

Open
reckart opened this issue Mar 21, 2023 · 0 comments
Open

Specific type of array elements in element FS is not retained #285

reckart opened this issue Mar 21, 2023 · 0 comments
Labels
Milestone

Comments

@reckart
Copy link
Member

reckart commented Mar 21, 2023

Describe the bug
When cassis is parsing an array like this:

{
    "%ID" : 11,
    "%TYPE" : "webanno.custom.LinkType",
    "role" : "p1",
    "@target" : 12
  }, {
    "%ID" : 13,
    "%TYPE" : "webanno.custom.LinkType[]",
    "%ELEMENTS" : [ 11, 9 ]
  }

it is serialized again as:

{
    "%ID" : 11,
    "%TYPE" : "webanno.custom.LinkType",
    "role" : "p1",
    "@target" : 12
  }, {
    "%ID" : 13,
    "%TYPE" : "uima.cas.FSArray",
    "%ELEMENTS" : [ 11, 9 ]
  }

This is technically not wrong and the information about the element type in the array should usually be accessible through the definition of the feature which references the array - however, we can currently not serialize this.

To Reproduce
See test tsv3-testSimpleSlotFeature.

Expected behavior
Optimally, it should be serialized in the same was as it was loaded. Java UIMA v3 reifies array types in the type system - so instead of only an FSArray, it dynamically creates types like FSArray<LinkType> and binds the FSArray to that - so we have access to the array element type without having to look at the feature it is referenced from. This is particularly useful for arrays which are shared and can be referenced from multiple features (with potentially different yet compatible element type definitions).

However, it seems this won't be trivial to fix in the Python implementation and would require also introducing dynamic array types.

Please complete the following information:

  • Version: 0.7.5
@reckart reckart added this to the Backlog milestone Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant