Questions about relation layer configuration and editing annotated XML

3 views
Skip to first unread message

Raymond Badan

unread,
Apr 13, 2026, 8:51:46 AM (13 days ago) Apr 13
to inception-users

Dear Richard,

I have two questions regarding my annotation setup in INCEpTION.

First, I am trying to create a relation layer where Layer 1 is the source and Layer 2 is the target. However, the interface does not seem to allow me to explicitly set the target layer — it defaults to the same layer as the source, and I cannot modify it after creation. Is it possible in INCEpTION to constrain a relation layer so that it links specifically from one span layer to another (i.e., Layer 1 → Layer 2 )? If so, could you clarify how to configure this correctly?

Second, I am working with an XML document that I have already annotated. I would like to remove approximately 300 lines from the end of the text, but I want to preserve all existing annotations. What is the recommended way to trim the document without losing or corrupting the annotations? Should this be done within INCEpTION, or by modifying the source XML externally?

Thank you very much for your help.

Best regards,
Remon BADAN

Raymond Badan

unread,
Apr 16, 2026, 5:16:55 PM (10 days ago) Apr 16
to inception-users
Following up on my question, I managed to figure out a way to work around the relational layer limitations. However, if you can help with the second question about deleting about 300 lines from the end of my half annotated text, it would be great!

Best!!!
Remon

Richard Eckart de Castilho

unread,
Apr 17, 2026, 12:58:17 AM (9 days ago) Apr 17
to inception-users
Hi Ramon,

sorry for the late response.

> On 13. Apr 2026, at 14:51, Raymond Badan <raymon...@gmail.com> wrote:
>
> First, I am trying to create a relation layer where Layer 1 is the source and Layer 2 is the target. However, the interface does not seem to allow me to explicitly set the target layer — it defaults to the same layer as the source, and I cannot modify it after creation. Is it possible in INCEpTION to constrain a relation layer so that it links specifically from one span layer to another (i.e., Layer 1 → Layer 2 )? If so, could you clarify how to configure this correctly?

Great you found a solution for you.

There is an experimental option to allow the creation of cross-layer relations.
When enabled, you can choose a relation to attach to any layer.
However, there may be unexpected problems. If you use the option
and run into problems, please be sure to raise an issue on the tracker.

https://inception-project.github.io/releases/40.2/docs/admin-guide.html#sect_settings_cross-layer-relations

> Second, I am working with an XML document that I have already annotated. I would like to remove approximately 300 lines from the end of the text, but I want to preserve all existing annotations. What is the recommended way to trim the document without losing or corrupting the annotations? Should this be done within INCEpTION, or by modifying the source XML externally?

Normally, I would recommend exporting the file (including annotations), making your modifications
and then importing it again (possibly into a new project). However, if you export an XML file with
annotations as a UIMA CAS (XML or JSON) file, modify it using a Python script via DKPro Cassis and
then import it again, INCEpTION will no longer know that it originally was an XML file and will not
automatically choose the right annotation editor for it (you could switch the editor manually though).

So you could try that. Don't trim the string, just replace the parts of the string you want to "remove"
with space characters. Based on different discussions on this list, I am currently considering of adding
an option to re-import UIMA CAS (XML/JSON) files while preserving the original file type. If implemented,
that would remove the need to manually switch the editor. However, it's not implemented yet.

Cheers,

-- Richard

Reply all
Reply to author
Forward
0 new messages