dkpro / dkpro-cassis

UIMA CAS processing library written in Python
https://pypi.org/project/dkpro-cassis/
Apache License 2.0
84 stars 22 forks source link

uima.tcas.DocumentAnnotation not predefined when deserializing from JSON #278

Closed jcklie closed 5 months ago

jcklie commented 1 year ago

Describe the bug

uima.tcas.DocumentAnnotation is not predefined and not added by default to the TypeSystem

jcklie commented 1 year ago
with p.open("rb") as f:
    ts = TypeSystem(add_document_annotation_type=True)

    cassis.load_cas_from_json(f, typesystem=ts)

is sometimes required

jcklie commented 1 year ago

The issue occurs when a type extends from uima.tcas.DocumentAnnotation but does not define it, e.g.

"de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData" : {
      "%NAME" : "de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData",
      "%SUPER_TYPE" : "uima.tcas.DocumentAnnotation",
      "documentTitle" : {
        "%NAME" : "documentTitle",
        "%RANGE" : "uima.cas.String"
      },
reckart commented 5 months ago

Seems to be a duplicate of #280