Search code examples
rutadkpro-core

UIMA Ruta Workbench with Maven and DKPro Core


I'm trying to use DKPro Core components within the RUTA workbench, as in the following example with the german novel: https://github.com/pkluegl/ruta

IMPORT PACKAGE de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos FROM desc.type.POS AS pos;
IMPORT de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Lemma FROM desc.type.LexicalUnits;

Maven properly get the dependencies from DKPro Core. While I'm able to execute the main ruta script within Eclipse and to get the xmi file in the output directory, I'm unable to open this xmi file in the annotation browser:

Caused by: XCASParsingException: Error parsing XCAS or XMI-CAS from source <unknown> at line <unknown>, column <unknown>: unknown type: de.tudarmstadt.ukp.dkpro.core.api.metadata.type.TagsetDescription.

I guess the typesystems of DKPro Core imports are not accessible to the Workbench, and I have no idea on how to solve this issue. I tried upgrading the parent project to the current ruta version (2.6.1, same as my ruta workbench) without any better result.


Solution

  • There are different options to solve this problem. You could import the DKPRo Core type system containing TagsetDescription in your Ruta script so that the generated type system description also provides the type, in case that type system description is used to open the XMI in the CAS Editor.

    I often generate a type system description containing all type system descriptions available in the classpath of the project (uimaFIT types.txt) in order to open XMIs in the CAS Editor. For example with the following code:

    protected void storeTypeSystem() {
    
            File tsFile = new File("TypeSystem.xml");
    
            try {
    
                TypeSystemDescription typeSystemDescription = TypeSystemDescriptionFactory.createTypeSystemDescription();
                try (OutputStream os = new FileOutputStream(tsFile)) {
                    typeSystemDescription.toXML(os);
                }
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    

    You can specify the type system description that should be used for all files within a project in the properties of that project: Properties -> UIMA Type System. By default, it points to the file created by the sample code above.

    DISCLAIMER: I am a developer of UIMA Ruta