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

The multipleReferencesAllowed flag on array features is not handled #187

Closed
reckart opened this issue Aug 18, 2021 · 0 comments
Closed

The multipleReferencesAllowed flag on array features is not handled #187

reckart opened this issue Aug 18, 2021 · 0 comments
Assignees
Labels
Milestone

Comments

@reckart
Copy link
Member

reckart commented Aug 18, 2021

Describe the bug
The multipleReferencesAllowed on an array feature indicates if the array can be rendered as an XML attributed or not. If when rendered as an attribute, the array does not receive an ID. Also, if two FSes refer to the same array, this array will end up twice in the XMI.

To Reproduce

def test_multiple_references_allowed_true():
    typesystem = TypeSystem()
    Foo = typesystem.create_type("Foo")
    IntegerArray = typesystem.get_type("uima.cas.IntegerArray")
    f = typesystem.create_feature(Foo, "intArray", "uima.cas.IntegerArray", elementType="uima.cas.Integer")

    cas = Cas(typesystem)
    foo = Foo()
    foo.intArray = IntegerArray(elements=[1,2,3])
    cas.add(foo)

    f.multipleReferencesAllowed = True
    actual_xmi = cas.to_xmi(pretty_print=True)
    print(actual_xmi)

    f.multipleReferencesAllowed = False
    actual_xmi = cas.to_xmi(pretty_print=True)
    print(actual_xmi)

Expected behavior
If f.multipleReferencesAllowed is true, the array should be rendered as a separate element, otherwise as an attribute.

Please complete the following information:

  • Version: 0.6.0-SNAPSHOT
@reckart reckart added this to the 0.6.0 milestone Aug 18, 2021
@reckart reckart self-assigned this Aug 18, 2021
reckart added a commit that referenced this issue Aug 18, 2021
…_all_fs

#186 - Creating subtypes of inheritance-final types (arrays) is not prevented
#187 - The multipleReferencesAllowed flag on array features is not handled

- Consistently wrap arrays into their proper UIMA array types when deserializing
- Tests and code updated because in order to access the array elements it is now necessary to access them via the `elements` property of the array wrapper
- Add handling of the multipleReferencesAllowed flag in during (de)serialization
reckart added a commit that referenced this issue Aug 18, 2021
…ndled

- Restore test data that was accidentally removed during the refactoring
- Fixed tests subsequently
reckart added a commit that referenced this issue Aug 18, 2021
reckart added a commit that referenced this issue Aug 18, 2021
reckart added a commit that referenced this issue Aug 18, 2021
reckart added a commit that referenced this issue Aug 18, 2021
reckart added a commit that referenced this issue Aug 18, 2021
reckart added a commit that referenced this issue Aug 19, 2021
…ed-and-arrays' into feature/168-Experimental-JSON-CAS-support

* feature/185-186-187-Handling-of-multipleReferencesAllowed-and-arrays:
  #187 - The multipleReferencesAllowed flag on array features is not handled
  #187 - The multipleReferencesAllowed flag on array features is not handled
  #187 - The multipleReferencesAllowed flag on array features is not handled
  #187 - The multipleReferencesAllowed flag on array features is not handled
  #187 - The multipleReferencesAllowed flag on array features is not handled
  #187 - The multipleReferencesAllowed flag on array features is not handled
  #186 - Creating subtypes of inheritance-final types (arrays) is not prevented
  #185 - Transitively referenced primitive arrays not returned by _find_all_fs #186 - Creating subtypes of inheritance-final types (arrays) is not prevented #187 - The multipleReferencesAllowed flag on array features is not handled
reckart added a commit that referenced this issue Aug 19, 2021
…ndled

- Handle cases where the "elements" of an array is not an empty array but simply None
reckart added a commit that referenced this issue Aug 19, 2021
…ed-and-arrays' into feature/168-Experimental-JSON-CAS-support

* feature/185-186-187-Handling-of-multipleReferencesAllowed-and-arrays:
  #187 - The multipleReferencesAllowed flag on array features is not handled
reckart added a commit that referenced this issue Aug 19, 2021
…ltipleReferencesAllowed-and-arrays

#185 #186 #187: Handling of multipleReferencesAllowed and arrays
@reckart reckart closed this as completed Aug 19, 2021
reckart added a commit that referenced this issue Aug 19, 2021
…g-to-resolve-feature-path

* main:
  #187 - The multipleReferencesAllowed flag on array features is not handled
  #187 - The multipleReferencesAllowed flag on array features is not handled
  #187 - The multipleReferencesAllowed flag on array features is not handled
  #187 - The multipleReferencesAllowed flag on array features is not handled
  #187 - The multipleReferencesAllowed flag on array features is not handled
  #187 - The multipleReferencesAllowed flag on array features is not handled
  #187 - The multipleReferencesAllowed flag on array features is not handled
  #186 - Creating subtypes of inheritance-final types (arrays) is not prevented
  #185 - Transitively referenced primitive arrays not returned by _find_all_fs #186 - Creating subtypes of inheritance-final types (arrays) is not prevented #187 - The multipleReferencesAllowed flag on array features is not handled

# Conflicts:
#	tests/test_typesystem.py
reckart added a commit that referenced this issue Aug 19, 2021
reckart added a commit that referenced this issue Aug 25, 2021
* main:
  #194 - Allow visual comparison between two CASes
  #194 - Allow visual comparison between two CASes
  #194 - Allow visual comparison between two CASes
  #187 - The multipleReferencesAllowed flag on array features is not handled

# Conflicts:
#	cassis/__init__.py
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