inception-project / inception

INCEpTION provides a semantic annotation platform offering intelligent annotation assistance and knowledge management.
https://inception-project.github.io
Apache License 2.0
593 stars 151 forks source link

Document Metadata are not accessible through the remote API #3629

Closed letailli closed 1 year ago

letailli commented 1 year ago

Describe the bug I am not sure this a bug. It might be the expected behavior but it would be great if we can use DocumentMetadata and remote API modules together.

To Reproduce

  1. I setup DocumentMetadata and remote API in INCEpTION configuration

    remote-api.enabled=true
    documentmetadata.enabled=true
  2. I create a projet .

  3. I setup a "Document Metadata" layer in the project (see Screenshot 1)

  4. I add a document in the project and fill the metadata for this document (see Screenshot 2)

  5. I try to read the document to get the metadata. http://localhost:8080/api/aero/v1/projects/0/documents/3?format=dkpro-core-uima-inline-xml

Expected behavior The metadata don't appear in the API response. I would like to acess Document Metadata through the remote API (create and read).

Screenshots image

image

Please complete the following information:

reckart commented 1 year ago

Please use the CAS XMI format instead of the inline XML format. I recommend processing the CAS XMI data using DKPro Cassis (Python) or for Java users the Apache UIMA Java SDK.

letailli commented 1 year ago

Thank you for your answer.

However I don't get the data either with this format.

I tried : http://localhost:8080/api/aero/v1/projects/0/documents/3?format=xmi-xml1.1 I saved the result in chataigne_test_Opscidia_API_xmi-xml1.1_API.zip I can see a line <type:LayerDefinition xmi:id="1417" name="webanno.custom.Language" uiName="Document Metadata"/> but the data are missing.

Whereas in the manual export I have them : <custom:Language xmi:id="1368" sofa="1" Language="EN" OriginalURL="https://lemonde.fr"/> (I attached the full export in chataigne_test_Opscidia_export_UIMA CAS XMI (XML 1.1).zip)

chataigne_test_Opscidia_API_xmi-xml1.1_API.zip chataigne_test_Opscidia_export_UIMA CAS XMI (XML 1.1).zip

reckart commented 1 year ago

You are exporting the document you have originally imported. To export annotated documents via the remote API, use the "read annotations" endpoint: https://openminted.github.io/releases/aero-spec/1.0.0/omtd-aero/#_read_annotations

letailli commented 1 year ago

Yes with read annotations it's OK. Thank you

reckart commented 1 year ago

Another tip: if you plan using DKPro Cassis, export using CAS XMI XML 1.0 because there seems to be no Python-based XML parser that supports XML 1.1.