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

Error if there is no sofa #218

Open
reckart opened this issue Sep 27, 2021 · 0 comments
Open

Error if there is no sofa #218

reckart opened this issue Sep 27, 2021 · 0 comments
Labels
Milestone

Comments

@reckart
Copy link
Member

reckart commented Sep 27, 2021

Describe the bug
It is possible to create CAS objects in the UIMA Java SDK that do contain feature structures but not any sofa. XMI representing such CAS objects cannot be loaded in cassis.

To Reproduce

  public static CAS casWithFloatingPointSpecialValues() throws Exception {
    CAS cas = createCas();

    DoubleArrayFS doubleArrayFs = cas.createDoubleArrayFS(5);
    doubleArrayFs.set(0, 0.0);
    doubleArrayFs.set(1, 1.0);
    doubleArrayFs.set(2, Double.NEGATIVE_INFINITY);
    doubleArrayFs.set(3, Double.POSITIVE_INFINITY);
    doubleArrayFs.set(4, Double.NaN);
    cas.addFsToIndexes(doubleArrayFs);

    return cas;
  }
<?xml version="1.0" encoding="UTF-8"?><xmi:XMI xmlns:noNamespace="http:///uima/noNamespace.ecore" xmlns:tcas="http:///uima/tcas.ecore" xmlns:xmi="http://www.omg.org/XMI" xmlns:cas="http:///uima/cas.ecore" xmi:version="2.0">
    <cas:NULL xmi:id="0"/>
    <cas:DoubleArray xmi:id="1" elements="0.0 1.0 -Infinity Infinity NaN"/>
    <cas:View members="1"/>
</xmi:XMI>

Expected behavior
Good question. I'd say the CAS should load and probably add the feature structures to the default view but without initializing the sofa of the view.

Error message

../cassis/xmi.py:73: in load_cas_from_xmi
    return deserializer.deserialize(
../cassis/xmi.py:123: in deserialize
    proto_view = self._parse_view(elem)
../cassis/xmi.py:295: in _parse_view
    sofa = int(attributes["sofa"])

Please complete the following information:

  • Version: 0.6.0-SNAPSHOT
@jcklie jcklie added this to the 0.7.0 milestone Sep 29, 2021
@reckart reckart modified the milestones: 0.7.0, Backlog Dec 15, 2021
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

2 participants