uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Björn Rudzewitz <bjoern.rudzew...@uni-tuebingen.de>
Subject Re: RUTA problem with extended DKPro Type System
Date Fri, 17 Jul 2020 08:28:59 GMT
Dear Peter,

thank you very much for your helpful answer!

I tried the two options and both lenient loading and a merged type 
system in the project root worked for me. Thanks a lot!

Best regards,

Björn Rudzewitz

Am 15.07.20 um 12:42 schrieb Peter Klügl:
> Hi,
>
>
> the problem is that the type system used to open the XMI file does not
> define all typed present in the XMI.
>
>
> Short answer:
>
> If you do not really care about the type DocumentMetaData, then activate
> leniently loading in the preferences: Menu -> Window -> Preferences ->
> UIMA Cas Editor -> Annotation Editor -> Load CAS leniently
>
> When checked, annotation of types not present in the used type system
> description will be ignored. Please mind that they will be lost if the
> CAS is modified and stored again.
>
>
> Long answer:
>
> The CAS Editor requires a type system (description) in order to open a
> CAS/XMI file. There are different strategies how the type system is
> selected. Eclipse is able to remember the type system once used to open
> a specific file. Then, there could be a default type system in the scope
> of the project, normally project-root/TypeSystem.xml. Then, there are
> also additional strategies in the Ruta Workbench: if the last launch
> delegate (launch config) is a Ruta script and this Ruta script is in the
> same project as the XMI file, then use the generated type system
> descriptor of that Ruta script.
>
> You can normally check the used type system in the tab of the editor
> (tooltip?).
>
> If you have a merged type system with all types, you could name it
> "TypeSystem.xml" and copy it to the project root.
>
> You could add an import of the type system for missing types in the Ruta
> script, so that the generated description contains all types and the
> exception is avoided.
>
> The solution of your problem depends a bit on how you use the Ruta
> Workbench. I personally only use maven projects and rely on the merged
> type system in the project root, which is automatically created using
> classpath scanning.
>
> If you only want to take a look at the some annotations and others can
> be neglected, then I would change the preference mentioned above.
>
>
> Best,
>
>
> Peter
>
>
> Am 13.07.2020 um 12:25 schrieb Björn Rudzewitz:
>> Dear all,
>>
>> I want use RUTA to develop rules to extend the output of a UIMA
>> pipeline. The original pipeline is defined in another project and uses
>> a type system that extends the DKPro type system by importing certain
>> types from it, but it also has custom types that are not available in
>> DKPro.
>>
>> I already exported a merged type system that does not contain import
>> statements/references to external type systems and put that into the
>> descriptor/ folder of my RUTA project (which is in the build path). In
>> the input/ folder of my RUTA project, I put some XMI files that I
>> exported from the original pipeline.
>>
>> In order to test the approach, I wrote a simple RUTA script with one
>> rule (supposed to mark ):
>>
>> TYPESYSTEM DidiTypeSystem;
>>
>> Token{REGEXP("...er") -> MARK(CompAdv)};
>>
>> The problem is when I run this RUTA script and select one of the
>> generated XMIs in the output folder, I get an error message that I can
>> not interpret (see below at the end of the mail). It seems to be the
>> case that it can not find the DocumentMetaData type from DKPro, but I
>> checked and it is present in the type system. I also used the
>> org.apache.uima.tools.AnnotationViewerMain tool outside of RUTA to
>> double-check and the DocumentMetaData annotation is definitely present
>> in the document and annotated on the netire source text.
>>
>> I would be very gratefule for any hints as to what I could do to
>> overcome the error.
>>
>> Best regards,
>>
>> Björn Rudzewitz
>>
>> org.apache.uima.UIMARuntimeException
>>      at org.apache.uima.util.CasIOUtils.load(CasIOUtils.java:368)
>>      at org.apache.uima.util.CasIOUtils.load(CasIOUtils.java:312)
>>      at org.apache.uima.util.CasIOUtils.load(CasIOUtils.java:193)
>>      at org.apache.uima.util.CasIOUtils.load(CasIOUtils.java:218)
>>      at
>> org.apache.uima.caseditor.editor.DocumentUimaImpl.setContent(DocumentUimaImpl.java:291)
>>      at
>> org.apache.uima.caseditor.editor.DocumentUimaImpl.<init>(DocumentUimaImpl.java:105)
>>      at
>> org.apache.uima.caseditor.ide.DefaultCasDocumentProvider.createDocument(DefaultCasDocumentProvider.java:405)
>>      at
>> org.apache.uima.caseditor.editor.TextDocumentProvider.createDocument(TextDocumentProvider.java:103)
>>      at
>> org.eclipse.ui.texteditor.AbstractDocumentProvider.createElementInfo(AbstractDocumentProvider.java:330)
>>      at
>> org.apache.uima.caseditor.editor.TextDocumentProvider.createElementInfo(TextDocumentProvider.java:135)
>>      at
>> org.eclipse.ui.texteditor.AbstractDocumentProvider.connect(AbstractDocumentProvider.java:395)
>>      at
>> org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4212)
>>      at
>> org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:260)
>>      at
>> org.apache.uima.caseditor.editor.AnnotationEditor.doSetInput(AnnotationEditor.java:924)
>>      at
>> org.eclipse.ui.texteditor.AbstractTextEditor.lambda$1(AbstractTextEditor.java:3179)
>>      at
>> org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:436)
>>      at
>> org.eclipse.jface.operation.ModalContext.run(ModalContext.java:352)
>>      at
>> org.eclipse.ui.internal.WorkbenchWindow.lambda$5(WorkbenchWindow.java:2419)
>>      at
>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
>>      at
>> org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2417)
>>      at
>> org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3196)
>>      at
>> org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3221)
>>      at
>> org.apache.uima.caseditor.editor.AnnotationEditor.init(AnnotationEditor.java:667)
>>      at
>> org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:353)
>>      at
>> org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:340)
>>      at jdk.internal.reflect.GeneratedMethodAccessor87.invoke(Unknown
>> Source)
>>      at
>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>>      at
>> org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
>>      at
>> org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:1002)
>>      at
>> org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:967)
>>      at
>> org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:139)
>>      at
>> org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:408)
>>      at
>> org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:331)
>>      at
>> org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202)
>>      at
>> org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:91)
>>      at
>> org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60)
>>      at
>> org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42)
>>      at
>> org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132)
>>      at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:1002)
>>      at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:662)
>>      at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:768)
>>      at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:739)
>>      at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:733)
>>      at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
>>      at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:717)
>>      at
>> org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1297)
>>      at
>> org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.lambda$0(LazyStackRenderer.java:75)
>>      at
>> org.eclipse.e4.ui.services.internal.events.UIEventHandler.lambda$0(UIEventHandler.java:38)
>>      at
>> org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236)
>>      at
>> org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:146)
>>      at org.eclipse.swt.widgets.Display.syncExec(Display.java:5786)
>>      at
>> org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:219)
>>      at
>> org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
>>      at
>> org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205)
>>      at
>> org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203)
>>      at
>> org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
>>      at
>> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
>>      at
>> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
>>      at
>> org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:132)
>>      at
>> org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
>>      at
>> org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
>>      at
>> org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
>>      at
>> org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63)
>>      at
>> org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
>>      at
>> org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElementGen(ElementContainerImpl.java:170)
>>      at
>> org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:188)
>>      at
>> org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:661)
>>      at
>> org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:625)
>>      at
>> org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:790)
>>      at
>> org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:404)
>>      at
>> org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1239)
>>      at
>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3207)
>>      at
>> org.eclipse.ui.internal.WorkbenchPage.lambda$9(WorkbenchPage.java:3112)
>>      at
>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
>>      at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3110)
>>      at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3080)
>>      at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3071)
>>      at org.eclipse.ui.ide.IDE.openEditor(IDE.java:570)
>>      at org.eclipse.ui.ide.IDE.openEditor(IDE.java:525)
>>      at
>> org.eclipse.dltk.internal.ui.editor.EditorUtility.openInEditor(EditorUtility.java:380)
>>      at
>> org.eclipse.dltk.internal.ui.editor.EditorUtility.openInEditor(EditorUtility.java:149)
>>      at
>> org.eclipse.dltk.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:45)
>>      at org.eclipse.dltk.ui.actions.OpenAction.run(OpenAction.java:265)
>>      at org.eclipse.dltk.ui.actions.OpenAction.run(OpenAction.java:246)
>>      at
>> org.eclipse.dltk.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:282)
>>      at
>> org.eclipse.dltk.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:260)
>>      at
>> org.eclipse.dltk.internal.ui.scriptview.ScriptExplorerActionGroup.handleOpen(ScriptExplorerActionGroup.java:327)
>>      at
>> org.eclipse.dltk.internal.ui.scriptview.ScriptExplorerPart.lambda$2(ScriptExplorerPart.java:629)
>>      at
>> org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:797)
>>      at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
>>      at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47)
>>      at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
>>      at
>> org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:794)
>>      at
>> org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1110)
>>      at
>> org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
>>      at
>> org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:270)
>>      at
>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:310)
>>      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
>>      at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5676)
>>      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1423)
>>      at
>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4935)
>>      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4429)
>>      at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
>>      at org.eclipse.jface.window.Window.open(Window.java:799)
>>      at
>> org.eclipse.ui.internal.views.log.EventDetailsDialog.open(EventDetailsDialog.java:191)
>>      at
>> org.eclipse.ui.internal.views.log.EventDetailsDialogAction.run(EventDetailsDialogAction.java:102)
>>      at
>> org.eclipse.ui.internal.views.log.LogView.lambda$2(LogView.java:588)
>>      at
>> org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:777)
>>      at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
>>      at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47)
>>      at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
>>      at
>> org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:774)
>>      at
>> org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1518)
>>      at
>> org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1205)
>>      at
>> org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:251)
>>      at
>> org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:249)
>>      at
>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:308)
>>      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
>>      at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5676)
>>      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1423)
>>      at
>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4935)
>>      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4429)
>>      at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
>>      at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
>>      at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
>>      at
>> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
>>      at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:660)
>>      at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
>>      at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:559)
>>      at
>> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
>>      at
>> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
>>      at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
>>      at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
>>      at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
>>      at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
>>      at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
>>      at
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>>      at
>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>      at
>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>>      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
>>      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
>>      at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
>>      at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
>> 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.DocumentMetaData.
>>      at
>> org.apache.uima.cas.impl.XmiCasDeserializer$XmiCasDeserializerHandler.createException(XmiCasDeserializer.java:1635)
>>      at
>> org.apache.uima.cas.impl.XmiCasDeserializer$XmiCasDeserializerHandler.createException(XmiCasDeserializer.java:1657)
>>      at
>> org.apache.uima.cas.impl.XmiCasDeserializer$XmiCasDeserializerHandler.readFS(XmiCasDeserializer.java:490)
>>      at
>> org.apache.uima.cas.impl.XmiCasDeserializer$XmiCasDeserializerHandler.startElement(XmiCasDeserializer.java:409)
>>      at
>> org.apache.uima.util.XmlCasDeserializer$XmlCasDeserializerHandler.startElement(XmlCasDeserializer.java:150)
>>      at
>> java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:510)
>>      at
>> java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
>>      at
>> java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:351)
>>      at
>> java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710)
>>      at
>> java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
>>      at
>> java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
>>      at
>> java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
>>      at
>> java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
>>      at
>> java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
>>      at
>> java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
>>      at
>> java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
>>      at
>> org.apache.uima.util.XmlCasDeserializer.deserializeR(XmlCasDeserializer.java:111)
>>      at org.apache.uima.util.CasIOUtils.load(CasIOUtils.java:366)
>>      ... 144 more
>>
>>
>>
-- 
Björn Rudzewitz, M.A.
Universität Tübingen
Seminar für Sprachwissenschaft
br@sfs.uni-tuebingen.de
http://www.sfs.uni-tuebingen.de/~brzdwtz/


Mime
View raw message