Hi Eric

I do not have tested type system inclusion with the CAS editor. But
here how I handle the same problem as you:
May I suggest you to edit your type system and to straightly copy the
following content in the "types" section


    <typeDescription>
      <name>org.apache.uima.examples.SourceDocumentInformation</name>
      <description/>
      <supertypeName>uima.tcas.Annotation</supertypeName>
      <features>
        <featureDescription>
          <name>uri</name>
          <description/>
          <rangeTypeName>uima.cas.String</rangeTypeName>

        </featureDescription>
                <featureDescription>
          <name>offsetInSource</name>
          <description/>
          <rangeTypeName>uima.cas.Integer</rangeTypeName>

        </featureDescription>
                <featureDescription>
          <name>offsetInSource</name>
          <description/>
          <rangeTypeName>uima.cas.Integer</rangeTypeName>

        </featureDescription>
                                <featureDescription>
          <name>documentSize</name>
          <description/>
          <rangeTypeName>uima.cas.Integer</rangeTypeName>

        </featureDescription>
                        <featureDescription>
          <name>lastSegment</name>
          <description/>
          <rangeTypeName>uima.cas.Boolean</rangeTypeName>

        </featureDescription>
      </features>
    </typeDescription>


On Mon, Apr 23, 2012 at 10:28 PM, Eric Riebling <[email protected]> wrote:
> Thanks for the quick response, this helps!  Let me try and best
> document all the places where I felt led astray by the documentation,
> in hopes this helps either improve it, or helps others trying to run CAS
> Editor.  In the meantime, I will investigate applying all this to the
> latest UIMA 2.4.0 as recommended.
>
> 1.  Which Eclipse menu items to click?
>
> The instructions say to click:
>
>  new Projects -> Other -> Cas Editor -> Cas Editor Project
>
> but for current Eclipse, the path is actually:
>
>  File -> New -> Project -> Cas Editor -> Cas Editor Project
>
> or
>
>  New -> Other -> Cas Editor -> Cas Editor Project
>    2.  Which of multiple Project Properties to click?
>
> People accustomed to working with UIMA in Eclipse will notice right away
> there is a new project in their Navigator or Project Explorer pane, after
> step 1.  This is where Eclipse/UIMA projects appear.  So when the
> instructions
>
> Instead they need to look in a different place, not where projects normally
> appear, not where UIMA tooling usually apears (Descriptor editors), but in
> the bottom pane of their Eclipse workspace, alongside Console, Search,
> Problems
> etc. tabs.  Right click on THIS newly created CAS Editor and choose
> Properties
> and you will then see the Project options for Typesystem and Corpus Folders.
>
> 3.  Terminology disconnects
>
> There are a couple small terminology leaps that need to be made, as one is
> now looking at
> a 'Corpus Explorer' window.  The relationship between Corpus Explorer and
> Cas Editor is
> not really explained, so it is a surprise to the reader.
>
> A second small terminology leap: There is still no 'CAS Editor' to be found
> in
> Eclipse.  The thing you actually run is called an 'Annotation Editor.'  Cas
> Editor is only the description of the overall tooling, and the name of a
> heading category inside of which are actual Eclipse Views:
>
>  Window -> Show View -> Other -> Cas Editor ->
>    Annotation Styles
>    Corpus Explorer
>    Edit View
>    Feature Structure View
>
> 4.  Step by step instructions
>
>  a) Copy type system or copy and rename to TypeSystem.xml into
>        the newly created Corpus Explorer project.  Do this from
>        Navigator or Project Explorer panels.
>
>      * It is not possible to do it with Corpus Explorer or
>        from Cas Editor Project Properties.  If you try using
>        Cas Editor -> Properties -> Project -> Typesystem -> Browse
>        to create a type system, it says 'No entries available.'
>
>      * It is not possible to point to a type system in another
>        UIMA project, even though best practices say that type systems
>        should be in their own project.
>
>  b) Create a Corpus folder.  This also has to be done from Navigator
>        or Project Explorer.  (If you try doing it from Corpus Explorer ->
>        Properties -> Project -> Corpus Folders -> New, it again
>        says 'No entries available.')  While here, you might also
>        want to copy your corpus XMI or XML documents into the folder.
>
> The instructions say "use copy and paste" but don't say from where or to
> where to do the copying and pasting, therefore could be more specific.
>
>  c) Now that the Typesystem and Corpus folder are in the Project, go back
> over to
>        Corpus Explorer -> newly created Corpus Explorer Project ->
>        Properties -> Project -> Typesystem -> Browse and add it.  Do
>        the same with Corpus Folders -> New to add the Corpus folder you
>        created in step b) above.
>
>  d) In the Corpus Explorer panel, expand the Corpus
>        folder and right click a document, and choose Annotation Editor
>
> Finally, having gotten this far, one can hope for success.
> Unless this error message awaits them (which is where I'm stuck now) :
>
>  There is a problem with the document: Error parsing XCAS or XMI-CAS from
>  source <unknown> at line 1, column 3384: unknown type:
>  org.apache.uima.examples.SourceDocumentInformation
>
> I've tried adding the absolute path to the UIMA jar containing
> SourceDocumentInformation
> type and class files (uima-core.jar) to the CDE path, but that didn't help.
> (And shouldn't it have been included automatically?)  I then tried adding
> project references in the project Properties (Navigator panel), and got an
> even more bizarro behavior: the Corpus folder now appears twice
> in the Corpus Explorer project, and in one of those, the one corpus document
> I
> placed there appears twice.  (??!!)
>
> It seems that I need to add SourceDocumentInformation explicitly to the
> projecttype system.  It's just that
> SourceDocumentInformation.xml isn't readily available as a type system file,
> it's buried inside uima-core.jar.  So it's not as simple as editing the type
> system file, and "Add"ing an Imported Type System.
>
> So I copy SourceDocumentInformation.xml into the Cas Editor project, edit
> the type system to import it (by location - by name doesn't work)  As
> soon as I open in the type system in Component Descriptor Editor, it
> returns errors no matter how I formulate the path to import the SDI,
> whether by name, by relative path, by absolute path... something about
> Component Descriptor Editor acts up when it's editing a type system in
> a Cas Editor Project.
>
> Finally trying the imported type system techniques, the Cas Editor, I mean
> Annotation Editor blows up thusly:
>
> java.lang.NullPointerException
>        at
> org.apache.uima.caseditor.editor.DocumentUimaImpl.<init>(DocumentUimaImpl.java:90)
>        at
> org.apache.uima.caseditor.core.model.DocumentElement.getDocument(DocumentElement.java:129)
>        at
> org.apache.uima.caseditor.editor.DefaultCasDocumentProvider.createDocument(DefaultCasDocumentProvider.java:94)
>        at
> org.eclipse.ui.texteditor.AbstractDocumentProvider.createElementInfo(AbstractDocumentProvider.java:333)
>        at
> org.eclipse.ui.texteditor.AbstractDocumentProvider.connect(AbstractDocumentProvider.java:400)
>        at
> org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4213)
>        at
> org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:237)
>        at
> org.apache.uima.caseditor.editor.AnnotationEditor.doSetInput(AnnotationEditor.java:699)
>        at
> org.eclipse.ui.texteditor.AbstractTextEditor$19.run(AbstractTextEditor.java:3200)
>        at
> org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
>        at
> org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
>        at
> org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
>        at
> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
>        at
> org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
>        at
> org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2642)
>        at
> org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3218)
>        at
> org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3245)
>        at
> org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:828)
>        at
> org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:647)
>        at
> org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
>        at
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
>        at
> org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
>        at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
>        at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
>        at
> org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
>        at
> org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
>        at
> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
>        at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
>        at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
>        at
> org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu.java:331)
>        at
> org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMenu.java:179)
>        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
>        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
>        at
> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
>        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
>        at
> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
>        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
>        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
>        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
>        at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>        at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
>        at
> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
>        at
> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
>        at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>        at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
>        at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
>        at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
>        at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
>        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
>        at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
>        at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
>
>
>
> On 4/22/2012 5:35 PM, Jörn Kottmann wrote:
>>
>> Looks like you are using an old version. The 2.4.0 version works better.
>> I suggest that you try that one instead.
>>
>> In this version it asks you to point it to a type system if none for the
>> XMI
>> file can be found in the configured location (default is TypeSystem.xml
>> in the root of the project).
>>
>> Hope this helps,
>> Jörn
>>
>> On 04/20/2012 10:08 PM, Eric Riebling wrote:
>>>
>>> I've been using UIMA for years and years, but I am completely stumped
>>> trying to run the CAS Editor. Is anyone expert enough to provide an
>>> actual step-by-step guide for getting the CAS Editor to appear, given
>>> an existing type system and annotated XMI?
>>>
>>> I have tried everything in the instructions, but keep getting error
>>> messages. First, missing type system. After RENAMING and putting
>>> in the root of project, complaint that document is not in a corpus
>>> folder. Explanation how to create a corpus folder is vague and
>>> confusing.
>>>
>>> I guess I'm hoping for STEP BY STEP instructions of exactly what to
>>> click and type in Eclipse, and what should happen at each stage, as
>>> far as expected output. Discouragingly, nothing I try looks like the
>>> pictures
>>> in the UIMA Tools Guide and Reference.
>>>
>>> What I'm really hoping for are instructions so clear that 'even faculty'
>>> can
>>> follow them to add annotations to documents, provided the documents and
>>> type system are already set up. :)
>>
>>
>>
>



-- 
Dr. Nicolas Hernandez
Associate Professor (Maître de Conférences)
Université de Nantes - LINA CNRS
http://enicolashernandez.blogspot.com
http://www.univ-nantes.fr/hernandez-n
+33 (0)2 51 12 53 94
+33 (0)2 40 30 60 67

Reply via email to