[ 
https://issues.apache.org/jira/browse/UIMA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13783732#comment-13783732
 ] 

Richard Eckart de Castilho commented on UIMA-3303:
--------------------------------------------------

{quote}
I do not like IMPORT * FROM <typesystem> AS <prefix> because a type system can 
define many packages or a package that is not related to its name. It seems 
more natural to me to import packages explicitly.
{quote}

I wonder, this construction you do not like is still present in your 
suggestion. The idea here is to import everything that is in a certain type 
system file by its full names. Of course, the type system may define multiple 
packages, but that's exactly the point here. You may not want to import each 
separately.

{quote}
IMPORT a.b.c AS d could either be import type a.b.c as d or import package 
a.b.c as d. The PACKAGE keyword disambiguate this case.
{quote}

Yep. I seem to recall that Peter ran into this ambiguity some time back as 
well, although I do not remember the context (type aliases, auto-complete, ...?)

Btw. there is no idea yet how {{<typesystem>}} can be written. I suppose the 
default case would be to look in the classpath, e.g.:

{noformat}
1) IMPORT * FROM org.apache.uima.ruta.MyTypes
{noformat}

Options could be also

{noformat}
2) IMPORT * FROM MyTypes -- automatically pre-pending package name of Ruta 
script 
3) IMPORT * FROM file:///home/MyTypes.xml -- import from local file
4) IMPORT * FROM http://uima.apache.org/ruta/1.0/officialtypes.xml -- import 
from remote file
5) IMPORT * FROM classpath*:org/apache/uima/ruta/**/types/*.xml -- import from 
all type descriptors in these packages (Spring syntax)
{noformat}

I think 2 also is quite reasonable, not so sure about 3-5. I would always 
discourage 3. 4 mimicks how people often use DTD/XML Schema but isn't a road 
that UIMA has so far taken. 5 is kind of an in-line version of the uimaFIT 
detection mechanism.

> Add a way to alias types in RUTA (e.g. "IMPORT type AS alias")
> --------------------------------------------------------------
>
>                 Key: UIMA-3303
>                 URL: https://issues.apache.org/jira/browse/UIMA-3303
>             Project: UIMA
>          Issue Type: Bug
>          Components: ruta
>            Reporter: Alexandre Patry
>            Assignee: Alexandre Patry
>
> It would be convenient to define type aliases in RUTA script.
> One scenario where it would help is when many types have the same short name:
> {noformat}
> IMPORT com.example.a.T AS TA
> IMPORT com.example.b.T AS TB
> {noformat}
> For a discussion about it, see UIMA-3292.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to