uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Eckart de Castilho (JIRA)" <...@uima.apache.org>
Subject [jira] [Comment Edited] (UIMA-3303) Add a way to alias types in RUTA (e.g. "IMPORT type AS alias")
Date Wed, 02 Oct 2013 08:32:24 GMT

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

Richard Eckart de Castilho edited comment on UIMA-3303 at 10/2/13 8:30 AM:
---------------------------------------------------------------------------

I think the following two suggestions are redundant:

{noformat}
IMPORT PACKAGE <package> (FROM <typesystemfile>)? AS <prefix> -- make the
specified package from typesystemfile (or detected automatically) available using prefix
IMPORT <package>.* (FROM <typesystemfile>)? -- make all the types from the specified
package and typesystemfile (or detected automatically) available in the current namespace
{noformat}

They can be merged into this

{noformat}
IMPORT PACKAGE <package> (FROM <typesystemfile>)? (AS <prefix>?) -- make
the specified package from typesystemfile (or detected automatically) available using prefix
or in the current namespace if no prefix is given
{noformat}

Looking back, I'm also a bit confused about these:

{noformat}
IMPORT * FROM <typesystemfile> -- make all the types from typesystem available in the
current namespace
IMPORT FROM <typesystemfile>   -- shorthand
IMPORT TYPESYSTEM <typesystemfile> -- make all the types from typesystem available using
their long name
{noformat}

and think they could be merged into this

{noformat}
IMPORT PACKAGE <package> FROM <typesystemfile> (AS <prefix>?) --  make all
types from package in type system available under prefix
IMPORT FROM <typesystemfile> -- make all the types from the type system available using
long
{noformat}

Maybe we should switch to some kind of grammar notation (and maybe to the wiki...):

{noformat}
import := "IMPORT" (all|package|type) ("FROM" source)? (AS alias)?
all := "*" | ""  // Allows import with long names
package := "PACKAGE" <package name> // Allows imports with short names
type := <type name> // Allows imports of single types
source := qualifiedClasspathSource | unqualifiedClasspathSource
qualifiedClasspathSource := <org.apache.uima.types.MyTypes>
unqualifiedClasspathSource := <MyTypes> // Implicitly import from script package
alias := <package alias (prefix) or type alias (alternative type name)>
{noformat}



was (Author: rec):
I think the following two suggestions are redundant:

{noformat}
IMPORT PACKAGE <package> (FROM <typesystemfile>)? AS <prefix> -- make the
specified package from typesystemfile (or detected automatically) available using prefix
IMPORT <package>.* (FROM <typesystemfile>)? -- make all the types from the specified
package and typesystemfile (or detected automatically) available in the current namespace
{noformat}

They can be merged into this

{noformat}
IMPORT PACKAGE <package> (FROM <typesystemfile>)? (AS <prefix>?) -- make
the specified package from typesystemfile (or detected automatically) available using prefix
or in the current namespace if no prefix is given
{noformat}

Looking back, I'm also a bit confused about these:

{noformat}
IMPORT * FROM <typesystemfile> -- make all the types from typesystem available in the
current namespace
IMPORT FROM <typesystemfile>   -- shorthand
IMPORT TYPESYSTEM <typesystemfile> -- make all the types from typesystem available using
their long name
{noformat}

and think they could be merged into this

{noformat}
IMPORT PACKAGE <package> FROM <typesystemfile> (AS <prefix>?) --  make all
types from package in type system available under prefix
IMPORT FROM <typesystemfile> -- make all the types from the type system available using
long
{noformat}

Maybe we should switch to some kind of grammar notation (and maybe to the wiki...):

{noformat}
import := "IMPORT" (all|package|type) ("FROM" source)? (AS (alias))?
all := "*" | ""  // Allows import with long names
package := "PACKAGE" <package name> // Allows imports with short names
type := <type name> // Allows imports of single types
source := qualifiedClasspathSource | unqualifiedClasspathSource
qualifiedClasspathSource := <org.apache.uima.types.MyTypes>
unqualifiedClasspathSource := <MyTypes> // Implicitly import from script package
alias := <package alias (prefix) or type alias (alternative type name)>
{noformat}


> 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)

Mime
View raw message