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
595 stars 152 forks source link

Annotations are missing when exporting in NIF #4121

Open skarampatakis opened 1 year ago

skarampatakis commented 1 year ago

Describe the bug

Annotations are missing when exporting into NIF. Exporting to other formats works well, the annotations are there, but when NIF is selected, the annotations are not there anymore.

To Reproduce

Steps to reproduce the behavior:

  1. Create a project
  2. Add a document
  3. Choose the Named Entity Layer
  4. Select a span within the text and select a Named Entity type from the dropdown
  5. Click the Export button to export the document in NIF format

Expected behavior

Annotations are there in the respective span, as it happens to be when other export formats are chosen.

Screenshots

No response

Environment

Version and build ID: INCEpTION -- 28.5 (2023-07-20 07:20:35, build db3d2ed7) Operating system: Docker on Ubuntu 22.04 Browser: Chrome Version 114.0.5735.90 (Official Build) (64-bit)

Additional context

No response

reckart commented 1 year ago

For export with NIF, the value and/or identifier fields must be a valid IRI. E.g. if you simply put LOC into the value, this is not a valid IRI and the annotation will not be exported. If you put e.g. urn:LOC there, it will work. The value feature maps to the NIF itsrdf:taClassRef property which apparently needs an IRI as its value.

reckart commented 1 year ago

For curiosity: (why) do you need to use NIF?

skarampatakis commented 1 year ago

For export with NIF, the value and/or identifier fields must be a valid IRI. E.g. if you simply put LOC into the value, this is not a valid IRI and the annotation will not be exported. If you put e.g. urn:LOC there, it will work. The value feature maps to the NIF itsrdf:taClassRef property which apparently needs an IRI as its value.

Thanks a lot, that makes sense. However I would say that this could be handled by the export component already, ie creating those IRIs by using some default or user defined prefix. Editing the tagsets works as you described, but then exporting to other formats will show also IRIs instead of the named entity types in this case, which might cause other issues. Plus if I m not wrong, editing the tagsets after annotation is done, does not seem to make the trick, you have to go over all annotations and change the NE type.

For curiosity: (why) do you need to use NIF?

I will further analyse and process the annotated documents after manual annotation and all of the rest data is in RDF so I thought that this could save me some time converting the annotations from other formats.

tpluscode commented 7 months ago

Maybe this can be closed in favor of #4567?

reckart commented 7 months ago

IMHO NIF is generally not a great format to use and #4567 is potentially more useful.

But this is just bit of a special case related to the NIF format that might still be improved here.