Re: Using RUTA

2017-02-22 Thread José Vicente Moyano Murillo
Hi Peter, good morning.

Have we any opportunity to get a fixed version? I mean a snapshot or an
access to the repo.

Regards

2017-02-22 10:38 GMT+01:00 José Vicente Moyano Murillo :

> you're right
>
> % is performing some kind of "or".
>
> So we will wait for the new release.
>
> Many thanks
>
> 2017-02-22 9:54 GMT+01:00 Peter Klügl :
>
>> I actually wonder why your rules work. I am quite sure that they match
>> too often, i. e. they match also if only one of the conjunct rule
>> elements match.
>>
>> You can simply try that by using a wrong string in the check like "NG"
>> instead of "Neil Gaiman"
>>
>> Anyways, the problem will be fixed in a few minutes and will be part of
>> the next release.
>>
>>
>> Best,
>>
>>
>> Peter
>>
>>
>> Am 22.02.2017 um 09:38 schrieb Peter Klügl:
>> > Thanks. Maybe its just a bug in 2.5.0 I already fixed. I'll investigate
>> it.
>> >
>> >
>> > Am 22.02.2017 um 09:24 schrieb José Vicente Moyano Murillo:
>> >> Thank you very much Peter. Your advice was amazing.
>> >>
>> >> We tried the first option using Conjunct rules and as you said it does
>> not
>> >> work with version 2.5.0. But we change a little your example and it
>> works
>> >> perfectly witn 2.4.0 and 2.5.0
>> >>
>> >> We use theses examples with success:
>> >>
>> >> DECLARE Annotation RuleDetection;
>> >>  Book{ -> CREATE(NeilsBook) } <- {
>> >>   Attribute{Attribute.name=="title", Attribute.ct=="Norse
>> Mythology"}"
>> >>   %
>> >>   Attribute{Attribute.name=="author", Attribute.ct=="Neil
>> >> Gaiman"};"
>> >>  };
>> >>
>> >>
>> >> DECLARE Annotation RuleDetection;
>> >>  Book{ -> CREATE(NeilsBook) } <- {
>> >>Attribute{FEATURE("name","title"), FEATURE("ct", "Norse
>> Mythology")}"
>> >>   %
>> >>Attribute{FEATURE("name","author"), FEATURE("ct", "Neil
>> >> Gaiman")};
>> >>  };
>> >>
>> >> DECLARE Annotation RuleDetection;
>> >>  Book{ -> CREATE(NeilsBook) } <- {
>> >>   Attribute{Attribute.name=="title", Attribute.ct=="Norse
>> Mythology"}"
>> >>   %
>> >>Attribute{FEATURE("name","author"), FEATURE("ct", "Neil
>> >> Gaiman")};
>> >>  };
>> >>
>> >>
>> >> May be the problem is with when we use Identifiers:
>> >>a1:Attribute and  a2:Attribute
>> >>
>> >> In any case thank you very much for your help.
>> >>
>> >>
>> >> 2017-02-21 17:46 GMT+01:00 Peter Klügl :
>> >>
>> >>> Hi,
>> >>>
>> >>>
>> >>> I'd normally say that you need the conjunt rules construct to specify
>> an
>> >>> AND between two rule element independent of the position:
>> >>>
>> >>>
>> >>> Book{-> NeilsBook}<-{
>> >>> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"}
>> >>> % a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"};
>> >>> };
>> >>>
>> >>>
>> >>> However, I just noted that there is a problem with conjunct rules. I
>> >>> haven't used it in a long time and the test coverage much lower than
>> the
>> >>> other constructs. I'll create a ticket for it and fix it.
>> >>>
>> >>>
>> >>> Without conjunct rules, you need some boolean variables for cheking
>> the
>> >>> AND, which looks all but declarative:
>> >>>
>> >>>
>> >>> BOOLEAN ft, fa;
>> >>> FOREACH(book) Book{}{
>> >>> book{-> ft = false, fa = false};
>> >>> book->{a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"->
>> >>> ft=true};};
>> >>> book->{a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"->
>> >>> fa=true};};
>> >>> book{ft,fa -> NeilsBook};
>> >>> }
>> >>>
>> >>>
>> >>> ... or with a BLOCK...
>> >>>
>> >>>
>> >>> BLOCK(book) Book{}{
>> >>> Document{-> ft = false, fa = false};
>> >>> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"->
>> ft=true};
>> >>> a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"-> fa=true};
>> >>> Document{ft,fa -> NeilsBook};
>> >>> }
>> >>>
>> >>>
>> >>> If the order of the attributes is known, you can avoid the AND check
>> and
>> >>> just specify a sequential constraint:
>> >>>
>> >>>
>> >>> Book{-> NeilsBook}<-{
>> >>> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"}
>> >>> # a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"};
>> >>> };
>> >>>
>> >>>
>> >>> If you need to check on the complete title with the URL, you can
>> replace
>> >>> the coveredText comparison with a REGEXP condition.
>> >>>
>> >>>
>> >>> (tested with UIMA Ruta 2.5.0)
>> >>>
>> >>>
>> >>> Best,
>> >>>
>> >>>
>> >>> Peter
>> >>>
>> >>>
>> >>>
>> >>> Am 21.02.2017 um 13:58 schrieb José Vicente Moyano Murillo:
>>  Hello everyone
>> 
>>  I'm planning to use RUTA to create some annotations. But i'm not
>> able to
>>  accomplish my objective.
>> 
>>  This is my case right now:
>> 
>>  I have a text annotated with some annotations "*Book*".
>> 
>>  Under "*Book*" annotation i have a few annotations "*Attribute*" that
>>  stores some information about the book. Each "*Attribute*" has a
>> feature
>> >>> "

Re: Many views in the cas to serialize cause java.lang.NullPointerException in service uima-as

2017-02-22 Thread Jaroslaw Cwiklik
Nelson, I agree with Marshall. If you can produce a small test case that
shows the problem I will find time to debug it.

-jerry

On Fri, Feb 17, 2017 at 2:14 PM, Marshall Schor  wrote:

> Hi Nelson,
>
> Due to local holidays, you may not see activity here until mid-next week.
>
> Meanwhile, it would help to have a small test case which reproduces this
> issue.
>
> If you could make one and zip it up and attach it to a Jira, that would
> enable
> great progress :-)
>
> -Marshall
>
>
> On 2/16/2017 8:52 AM, nelson rivera wrote:
> > I tested the solution that proposes, add processParentLast="true" to
> > the  Cas Multiplier delegate's configuration. The behavior is the
> > same. The other alternative that you say, is that i have a bug
> > somewhere in my code which allows a CAS to be accessed in two separate
> > threads, but i not have idea,because the cas generated in the second
> > cas multipler is composed of all views and then this cas go to the end
> > annotator that have only 1 instance, and here finish the flow.
> >
> > 2017-02-15 16:31 GMT-05:00, Jaroslaw Cwiklik :
> >> Nelson, change Cas Multiplier in your deployment descriptor as follows:
> >>
> >> 
> >>  >> processParentLast="true"/>
> >> 
> >>
> >> Note: processParentLast="true".
> >>
> >> In UIMA-AS async aggregate its possible for a child CAS and its parent
> CAS
> >> to flow through the pipeline at the same time and the parent CAS may
> reach
> >> the end before its child(ren). The above setting will ensure the parent
> CAS
> >> does not flow ahead of its children. From UIMA-AS documentation:
> >>
> >> "The processParentLast attribute on the  element is
> >> optional, and specifies processing order of an input CAS relative to its
> >> children. If true, a flow of an input CAS will be suspended after it is
> >> returned from a Cas Multiplier delegate until all its child CASes have
> >> finished processing. If false, an input CAS can be processed in parallel
> >> with its children."
> >>
> >>
> >> If the above change does not fix the NPE, I suspect you may have a bug
> >> somewhere in your code which allows a CAS to be accessed in two separate
> >> threads.
> >>
> >> -jerry
> >>
> >> On Wed, Feb 15, 2017 at 12:43 PM, Jaroslaw Cwiklik 
> >> wrote:
> >>
> >>> Nelson, I can try to setup a simple pipeline with one AE which will add
> >>> 20
> >>> views and than test serialization. Not sure if I get to it today. If
> not
> >>> this will have to wait till Monday next week. I've already mentioned
> this
> >>> before, don't operate on a CAS once it leaves an AE. The contract is
> >>> CAS-In
> >>> CAS-out. A CAS instance can only be operated on by one AE at a time.
> >>>
> >>> -jerry
> >>>
> >>> On Wed, Feb 15, 2017 at 11:06 AM, Marshall Schor 
> wrote:
> >>>
>  On 2/15/2017 9:51 AM, Jaroslaw Cwiklik wrote:
> > Not exactly sure how to debug this.
>  a small-ish test case we could run would enable debugging...
> 
> > The UIMA-AS does not touch contents of
> > a CAS directly. Are there any other errors in the log besides NPE?
> The
> > UIMA-AS uses uima-sdk to serialize CASes. Since you are getting null
>  from
> > getView(N), this view must have been deleted somehow.
> >
> > -jerry
> >
> > On Mon, Feb 13, 2017 at 11:43 AM, nelson rivera <
>  nelsonriver...@gmail.com>
> > wrote:
> >
> >> I was able to check your email just today. The agregegate is async,
> >> but only process one input CAS at the same time,default
> >> numberOfCASes.
> >> I read your possible explanation but i have no idea that another
> >> thread can modificate the cas, because the last annotator's
> execution
> >> is correct and only missing that the framework uima-as serializes
> the
> >> cas.
> >>
> >> This is the configuration of deploy of the aggregate:
> >>
> >> 
> >>  >> xmlns="http://uima.apache.org/resourceSpecifier;>
> >>
> >> XClusterAnalyzerAE Deploy Descriptor
> >> Deploys XClusterAnalyzerAE
> >>
> >> 
> >>
> >> 
> >>  >> brokerURL="${defaultBrokerURL}"/>
> >> 
> >>  />
> >> 
> >> 
> >>  >> internalReplyQueueScaleout="3">
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >>  >> continueOnRetryFailure="true"/>
> >> 
> >> 
> >> 
> >> 
> >> 
> >>  >> continueOnRetryFailure="true"/>
> >> 
> >> 
> 

Re: Passing object from cpe to collection reader

2017-02-22 Thread Jaroslaw Cwiklik
Oops, by mistake I included a link to very old uima documentation. Sorry
about that. The Java Docs can be found here:

https://uima.apache.org/d/uimaj-current/apidocs/index.html

Looks for UimaFramework and produceCollectionReader(...)

-jerry

On Wed, Feb 22, 2017 at 1:40 PM, Jaroslaw Cwiklik  wrote:

> Not sure if this is the best way to do it but can you first instantiate
> and initialize your CR and plug it in to the CPM? Something like this:
>
>Map additionalParams = new HashMap();
>
>   additionalParams.put("object1", object1);
>
>  BaseCollectionReader colreader = (BaseCollectionReader)
>   UIMAFramework.produceResource(resourceSpecifier, additionalParams);
>
> And than use an instance of BaseCPMImpl to call
>
>   public void setCollectionReader(BaseCollectionReader aCollectionReader)
> {
>
>
> Check documentation for details:
> https://uima.apache.org/downloads/releaseDocs/2.3.0-
> incubating/docs/api/org/apache/uima/UIMAFramework.html
>
> -jerry
>
>
> On Wed, Feb 22, 2017 at 2:44 AM, Prerna Bhatia 
> wrote:
>
>> Hi All,
>>
>> At the time of initialization of the CPE, I am passing list of objects to
>> CPE. I want these objects to be used by collection reader to prepare the
>> documents and run AAE on it. How can this be done?
>>
>> Thanks in advance,
>> Prerna
>>
>
>


Re: Passing object from cpe to collection reader

2017-02-22 Thread Jaroslaw Cwiklik
Not sure if this is the best way to do it but can you first instantiate and
initialize your CR and plug it in to the CPM? Something like this:

   Map additionalParams = new HashMap();

  additionalParams.put("object1", object1);

 BaseCollectionReader colreader = (BaseCollectionReader)
  UIMAFramework.produceResource(resourceSpecifier, additionalParams);

And than use an instance of BaseCPMImpl to call

  public void setCollectionReader(BaseCollectionReader aCollectionReader) {


Check documentation for details:
https://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/api/org/apache/uima/UIMAFramework.html

-jerry


On Wed, Feb 22, 2017 at 2:44 AM, Prerna Bhatia 
wrote:

> Hi All,
>
> At the time of initialization of the CPE, I am passing list of objects to
> CPE. I want these objects to be used by collection reader to prepare the
> documents and run AAE on it. How can this be done?
>
> Thanks in advance,
> Prerna
>


RE: Starter Kit

2017-02-22 Thread Oliver Ferschke
Hi,
The getting started guide Chad mentioned is pretty good for vanilla UIMA.
If you would like to avoid all the xml descriptors and rather do things 
programmatically with UIMA+uimafit, you could look into the uimafit 
documentation right away.
It also has a brief getting started guide.
https://uima.apache.org/d/uimafit-current/tools.uimafit.book.html#ugr.tools.uimafit.gettingstarted

And then there's also DKPro - an ecosystem of NLP components and resources 
built on top of UIMA + uimafit - which has great documentation and tutorials:
https://dkpro.github.io/dkpro-core/

Have fun,
Oliver


-Original Message-
From: Reinhard Erich Voglmaier [mailto:reinhard.e.voglma...@gsk.com] 
Sent: Wednesday, February 22, 2017 9:44 AM
To: user@uima.apache.org
Subject: Starter Kit

Dear All,

since a while I am listening at the user group and trying to start use of UIMA.

What do you me suggest to get up to speed with UIMA. There is a lot of 
documentation to read, but what do you suggest me to do to start small projects 
with UIMA ?

>From installation of a Linux Box to first tests, is there any example, kind of 
>"UIMA for idiots"

Thank you very much

Reinhard


GSK monitors email communications sent to and from GSK in order to protect GSK, 
our employees, customers, suppliers and business partners, from cyber threats 
and loss of GSK Information. GSK monitoring is conducted with appropriate 
confidentiality controls and in accordance with local laws and after 
appropriate consultation.


Starter Kit

2017-02-22 Thread Reinhard Erich Voglmaier
Dear All,

since a while I am listening at the user group and trying to start use of UIMA.

What do you me suggest to get up to speed with UIMA. There is a lot of 
documentation to read, but what do you suggest me to do to start small projects 
with UIMA ?

>From installation of a Linux Box to first tests, is there any example, kind of 
>"UIMA for idiots"

Thank you very much

Reinhard


GSK monitors email communications sent to and from GSK in order to protect GSK, 
our employees, customers, suppliers and business partners, from cyber threats 
and loss of GSK Information. GSK monitoring is conducted with appropriate 
confidentiality controls and in accordance with local laws and after 
appropriate consultation.


Re: Starter Kit

2017-02-22 Thread Chad Cravens
Hello Reinhard:

This was a great start for me:
https://uima.apache.org/doc-uima-annotator.html

On Wed, Feb 22, 2017 at 9:44 AM, Reinhard Erich Voglmaier <
reinhard.e.voglma...@gsk.com> wrote:

> Dear All,
>
> since a while I am listening at the user group and trying to start use of
> UIMA.
>
> What do you me suggest to get up to speed with UIMA. There is a lot of
> documentation to read, but what do you suggest me to do to start small
> projects with UIMA ?
>
> From installation of a Linux Box to first tests, is there any example,
> kind of "UIMA for idiots"
>
> Thank you very much
>
> Reinhard
>
>
> GSK monitors email communications sent to and from GSK in order to protect
> GSK, our employees, customers, suppliers and business partners, from cyber
> threats and loss of GSK Information. GSK monitoring is conducted with
> appropriate confidentiality controls and in accordance with local laws and
> after appropriate consultation.
>



-- 
Kindest Regards,
Chad Cravens
(843) 291-8340

[image: http://www.ossys.com] 
[image: http://www.linkedin.com/company/open-source-systems-llc]
   [image:
https://www.facebook.com/OpenSrcSys] 
   [image: https://twitter.com/OpenSrcSys] 
 [image: http://www.youtube.com/OpenSrcSys]
   [image: http://www.ossys.com/feed]
   [image: cont...@ossys.com] 
Chad Cravens
(843) 291-8340
chad.crav...@ossys.com
http://www.ossys.com


Re: Using RUTA

2017-02-22 Thread José Vicente Moyano Murillo
you're right

% is performing some kind of "or".

So we will wait for the new release.

Many thanks

2017-02-22 9:54 GMT+01:00 Peter Klügl :

> I actually wonder why your rules work. I am quite sure that they match
> too often, i. e. they match also if only one of the conjunct rule
> elements match.
>
> You can simply try that by using a wrong string in the check like "NG"
> instead of "Neil Gaiman"
>
> Anyways, the problem will be fixed in a few minutes and will be part of
> the next release.
>
>
> Best,
>
>
> Peter
>
>
> Am 22.02.2017 um 09:38 schrieb Peter Klügl:
> > Thanks. Maybe its just a bug in 2.5.0 I already fixed. I'll investigate
> it.
> >
> >
> > Am 22.02.2017 um 09:24 schrieb José Vicente Moyano Murillo:
> >> Thank you very much Peter. Your advice was amazing.
> >>
> >> We tried the first option using Conjunct rules and as you said it does
> not
> >> work with version 2.5.0. But we change a little your example and it
> works
> >> perfectly witn 2.4.0 and 2.5.0
> >>
> >> We use theses examples with success:
> >>
> >> DECLARE Annotation RuleDetection;
> >>  Book{ -> CREATE(NeilsBook) } <- {
> >>   Attribute{Attribute.name=="title", Attribute.ct=="Norse
> Mythology"}"
> >>   %
> >>   Attribute{Attribute.name=="author", Attribute.ct=="Neil
> >> Gaiman"};"
> >>  };
> >>
> >>
> >> DECLARE Annotation RuleDetection;
> >>  Book{ -> CREATE(NeilsBook) } <- {
> >>Attribute{FEATURE("name","title"), FEATURE("ct", "Norse
> Mythology")}"
> >>   %
> >>Attribute{FEATURE("name","author"), FEATURE("ct", "Neil
> >> Gaiman")};
> >>  };
> >>
> >> DECLARE Annotation RuleDetection;
> >>  Book{ -> CREATE(NeilsBook) } <- {
> >>   Attribute{Attribute.name=="title", Attribute.ct=="Norse
> Mythology"}"
> >>   %
> >>Attribute{FEATURE("name","author"), FEATURE("ct", "Neil
> >> Gaiman")};
> >>  };
> >>
> >>
> >> May be the problem is with when we use Identifiers:
> >>a1:Attribute and  a2:Attribute
> >>
> >> In any case thank you very much for your help.
> >>
> >>
> >> 2017-02-21 17:46 GMT+01:00 Peter Klügl :
> >>
> >>> Hi,
> >>>
> >>>
> >>> I'd normally say that you need the conjunt rules construct to specify
> an
> >>> AND between two rule element independent of the position:
> >>>
> >>>
> >>> Book{-> NeilsBook}<-{
> >>> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"}
> >>> % a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"};
> >>> };
> >>>
> >>>
> >>> However, I just noted that there is a problem with conjunct rules. I
> >>> haven't used it in a long time and the test coverage much lower than
> the
> >>> other constructs. I'll create a ticket for it and fix it.
> >>>
> >>>
> >>> Without conjunct rules, you need some boolean variables for cheking the
> >>> AND, which looks all but declarative:
> >>>
> >>>
> >>> BOOLEAN ft, fa;
> >>> FOREACH(book) Book{}{
> >>> book{-> ft = false, fa = false};
> >>> book->{a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"->
> >>> ft=true};};
> >>> book->{a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"->
> >>> fa=true};};
> >>> book{ft,fa -> NeilsBook};
> >>> }
> >>>
> >>>
> >>> ... or with a BLOCK...
> >>>
> >>>
> >>> BLOCK(book) Book{}{
> >>> Document{-> ft = false, fa = false};
> >>> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"->
> ft=true};
> >>> a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"-> fa=true};
> >>> Document{ft,fa -> NeilsBook};
> >>> }
> >>>
> >>>
> >>> If the order of the attributes is known, you can avoid the AND check
> and
> >>> just specify a sequential constraint:
> >>>
> >>>
> >>> Book{-> NeilsBook}<-{
> >>> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"}
> >>> # a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"};
> >>> };
> >>>
> >>>
> >>> If you need to check on the complete title with the URL, you can
> replace
> >>> the coveredText comparison with a REGEXP condition.
> >>>
> >>>
> >>> (tested with UIMA Ruta 2.5.0)
> >>>
> >>>
> >>> Best,
> >>>
> >>>
> >>> Peter
> >>>
> >>>
> >>>
> >>> Am 21.02.2017 um 13:58 schrieb José Vicente Moyano Murillo:
>  Hello everyone
> 
>  I'm planning to use RUTA to create some annotations. But i'm not able
> to
>  accomplish my objective.
> 
>  This is my case right now:
> 
>  I have a text annotated with some annotations "*Book*".
> 
>  Under "*Book*" annotation i have a few annotations "*Attribute*" that
>  stores some information about the book. Each "*Attribute*" has a
> feature
> >>> "
>  *name*" and a feature "*parent*" to its parent (one "*Book*"
> annotation).
> 
>  And example could be a text with 2 "*Book*" annotations:
> 
>  "*Book*" annotation number 1 with 3 nested attributes
>  1.- *Attribute* with name feature equals "title" -> covered text:
> "Norse
>  Mythology
>  

Re: Using RUTA

2017-02-22 Thread Peter Klügl
I actually wonder why your rules work. I am quite sure that they match
too often, i. e. they match also if only one of the conjunct rule
elements match.

You can simply try that by using a wrong string in the check like "NG"
instead of "Neil Gaiman"

Anyways, the problem will be fixed in a few minutes and will be part of
the next release.


Best,


Peter

 
Am 22.02.2017 um 09:38 schrieb Peter Klügl:
> Thanks. Maybe its just a bug in 2.5.0 I already fixed. I'll investigate it.
>
>
> Am 22.02.2017 um 09:24 schrieb José Vicente Moyano Murillo:
>> Thank you very much Peter. Your advice was amazing.
>>
>> We tried the first option using Conjunct rules and as you said it does not
>> work with version 2.5.0. But we change a little your example and it works
>> perfectly witn 2.4.0 and 2.5.0
>>
>> We use theses examples with success:
>>
>> DECLARE Annotation RuleDetection;
>>  Book{ -> CREATE(NeilsBook) } <- {
>>   Attribute{Attribute.name=="title", Attribute.ct=="Norse Mythology"}"
>>   %
>>   Attribute{Attribute.name=="author", Attribute.ct=="Neil
>> Gaiman"};"
>>  };
>>
>>
>> DECLARE Annotation RuleDetection;
>>  Book{ -> CREATE(NeilsBook) } <- {
>>Attribute{FEATURE("name","title"), FEATURE("ct", "Norse Mythology")}"
>>   %
>>Attribute{FEATURE("name","author"), FEATURE("ct", "Neil
>> Gaiman")};
>>  };
>>
>> DECLARE Annotation RuleDetection;
>>  Book{ -> CREATE(NeilsBook) } <- {
>>   Attribute{Attribute.name=="title", Attribute.ct=="Norse Mythology"}"
>>   %
>>Attribute{FEATURE("name","author"), FEATURE("ct", "Neil
>> Gaiman")};
>>  };
>>
>>
>> May be the problem is with when we use Identifiers:
>>a1:Attribute and  a2:Attribute
>>
>> In any case thank you very much for your help.
>>
>>
>> 2017-02-21 17:46 GMT+01:00 Peter Klügl :
>>
>>> Hi,
>>>
>>>
>>> I'd normally say that you need the conjunt rules construct to specify an
>>> AND between two rule element independent of the position:
>>>
>>>
>>> Book{-> NeilsBook}<-{
>>> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"}
>>> % a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"};
>>> };
>>>
>>>
>>> However, I just noted that there is a problem with conjunct rules. I
>>> haven't used it in a long time and the test coverage much lower than the
>>> other constructs. I'll create a ticket for it and fix it.
>>>
>>>
>>> Without conjunct rules, you need some boolean variables for cheking the
>>> AND, which looks all but declarative:
>>>
>>>
>>> BOOLEAN ft, fa;
>>> FOREACH(book) Book{}{
>>> book{-> ft = false, fa = false};
>>> book->{a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"->
>>> ft=true};};
>>> book->{a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"->
>>> fa=true};};
>>> book{ft,fa -> NeilsBook};
>>> }
>>>
>>>
>>> ... or with a BLOCK...
>>>
>>>
>>> BLOCK(book) Book{}{
>>> Document{-> ft = false, fa = false};
>>> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"-> ft=true};
>>> a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"-> fa=true};
>>> Document{ft,fa -> NeilsBook};
>>> }
>>>
>>>
>>> If the order of the attributes is known, you can avoid the AND check and
>>> just specify a sequential constraint:
>>>
>>>
>>> Book{-> NeilsBook}<-{
>>> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"}
>>> # a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"};
>>> };
>>>
>>>
>>> If you need to check on the complete title with the URL, you can replace
>>> the coveredText comparison with a REGEXP condition.
>>>
>>>
>>> (tested with UIMA Ruta 2.5.0)
>>>
>>>
>>> Best,
>>>
>>>
>>> Peter
>>>
>>>
>>>
>>> Am 21.02.2017 um 13:58 schrieb José Vicente Moyano Murillo:
 Hello everyone

 I'm planning to use RUTA to create some annotations. But i'm not able to
 accomplish my objective.

 This is my case right now:

 I have a text annotated with some annotations "*Book*".

 Under "*Book*" annotation i have a few annotations "*Attribute*" that
 stores some information about the book. Each "*Attribute*" has a feature
>>> "
 *name*" and a feature "*parent*" to its parent (one "*Book*" annotation).

 And example could be a text with 2 "*Book*" annotations:

 "*Book*" annotation number 1 with 3 nested attributes
 1.- *Attribute* with name feature equals "title" -> covered text: "Norse
 Mythology
 >> gaiman/1124023596;jsessionid=FD1D8F9690602616CA59B38CFE9290
>>> 06.prodny_store02-atgap08?ean=9780393609097>
 "
 2.- *Attribute* with name feature equals "author" ->  covered text: "Neil
 Gaiman"
 3.- *Attribute* with name feature equals "language" - > covered text:
 "English"


 "*Book*" annotation number 2 with 3 nested attributes
 1.- *Attribute* with name feature equals "title" -> covered text: "Never
 Never
 

Re: Using RUTA

2017-02-22 Thread Peter Klügl
Thanks. Maybe its just a bug in 2.5.0 I already fixed. I'll investigate it.


Am 22.02.2017 um 09:24 schrieb José Vicente Moyano Murillo:
> Thank you very much Peter. Your advice was amazing.
>
> We tried the first option using Conjunct rules and as you said it does not
> work with version 2.5.0. But we change a little your example and it works
> perfectly witn 2.4.0 and 2.5.0
>
> We use theses examples with success:
>
> DECLARE Annotation RuleDetection;
>  Book{ -> CREATE(NeilsBook) } <- {
>   Attribute{Attribute.name=="title", Attribute.ct=="Norse Mythology"}"
>   %
>   Attribute{Attribute.name=="author", Attribute.ct=="Neil
> Gaiman"};"
>  };
>
>
> DECLARE Annotation RuleDetection;
>  Book{ -> CREATE(NeilsBook) } <- {
>Attribute{FEATURE("name","title"), FEATURE("ct", "Norse Mythology")}"
>   %
>Attribute{FEATURE("name","author"), FEATURE("ct", "Neil
> Gaiman")};
>  };
>
> DECLARE Annotation RuleDetection;
>  Book{ -> CREATE(NeilsBook) } <- {
>   Attribute{Attribute.name=="title", Attribute.ct=="Norse Mythology"}"
>   %
>Attribute{FEATURE("name","author"), FEATURE("ct", "Neil
> Gaiman")};
>  };
>
>
> May be the problem is with when we use Identifiers:
>a1:Attribute and  a2:Attribute
>
> In any case thank you very much for your help.
>
>
> 2017-02-21 17:46 GMT+01:00 Peter Klügl :
>
>> Hi,
>>
>>
>> I'd normally say that you need the conjunt rules construct to specify an
>> AND between two rule element independent of the position:
>>
>>
>> Book{-> NeilsBook}<-{
>> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"}
>> % a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"};
>> };
>>
>>
>> However, I just noted that there is a problem with conjunct rules. I
>> haven't used it in a long time and the test coverage much lower than the
>> other constructs. I'll create a ticket for it and fix it.
>>
>>
>> Without conjunct rules, you need some boolean variables for cheking the
>> AND, which looks all but declarative:
>>
>>
>> BOOLEAN ft, fa;
>> FOREACH(book) Book{}{
>> book{-> ft = false, fa = false};
>> book->{a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"->
>> ft=true};};
>> book->{a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"->
>> fa=true};};
>> book{ft,fa -> NeilsBook};
>> }
>>
>>
>> ... or with a BLOCK...
>>
>>
>> BLOCK(book) Book{}{
>> Document{-> ft = false, fa = false};
>> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"-> ft=true};
>> a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"-> fa=true};
>> Document{ft,fa -> NeilsBook};
>> }
>>
>>
>> If the order of the attributes is known, you can avoid the AND check and
>> just specify a sequential constraint:
>>
>>
>> Book{-> NeilsBook}<-{
>> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"}
>> # a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"};
>> };
>>
>>
>> If you need to check on the complete title with the URL, you can replace
>> the coveredText comparison with a REGEXP condition.
>>
>>
>> (tested with UIMA Ruta 2.5.0)
>>
>>
>> Best,
>>
>>
>> Peter
>>
>>
>>
>> Am 21.02.2017 um 13:58 schrieb José Vicente Moyano Murillo:
>>> Hello everyone
>>>
>>> I'm planning to use RUTA to create some annotations. But i'm not able to
>>> accomplish my objective.
>>>
>>> This is my case right now:
>>>
>>> I have a text annotated with some annotations "*Book*".
>>>
>>> Under "*Book*" annotation i have a few annotations "*Attribute*" that
>>> stores some information about the book. Each "*Attribute*" has a feature
>> "
>>> *name*" and a feature "*parent*" to its parent (one "*Book*" annotation).
>>>
>>> And example could be a text with 2 "*Book*" annotations:
>>>
>>> "*Book*" annotation number 1 with 3 nested attributes
>>> 1.- *Attribute* with name feature equals "title" -> covered text: "Norse
>>> Mythology
>>> > gaiman/1124023596;jsessionid=FD1D8F9690602616CA59B38CFE9290
>> 06.prodny_store02-atgap08?ean=9780393609097>
>>> "
>>> 2.- *Attribute* with name feature equals "author" ->  covered text: "Neil
>>> Gaiman"
>>> 3.- *Attribute* with name feature equals "language" - > covered text:
>>> "English"
>>>
>>>
>>> "*Book*" annotation number 2 with 3 nested attributes
>>> 1.- *Attribute* with name feature equals "title" -> covered text: "Never
>>> Never
>>> > jsessionid=FD1D8F9690602616CA59B38CFE929006.prodny_store02-atgap08?ean=
>> 9780316433174>
>>> "
>>> 2.- *Attribute* with name feature equals "author" ->  covered text:
>> "James
>>> Patterson"
>>> 3.- *Attribute* with name feature equals "language" - > covered text:
>>> "English"
>>>
>>> I need to respect this schema but i have this question:
>>> It is possible to create and annotation over a book for a given author
>> name
>>> and a given title name?
>>>
>>> Thank's in advance
>>>
>>



Re: Using RUTA

2017-02-22 Thread José Vicente Moyano Murillo
Thank you very much Peter. Your advice was amazing.

We tried the first option using Conjunct rules and as you said it does not
work with version 2.5.0. But we change a little your example and it works
perfectly witn 2.4.0 and 2.5.0

We use theses examples with success:

DECLARE Annotation RuleDetection;
 Book{ -> CREATE(NeilsBook) } <- {
  Attribute{Attribute.name=="title", Attribute.ct=="Norse Mythology"}"
  %
  Attribute{Attribute.name=="author", Attribute.ct=="Neil
Gaiman"};"
 };


DECLARE Annotation RuleDetection;
 Book{ -> CREATE(NeilsBook) } <- {
   Attribute{FEATURE("name","title"), FEATURE("ct", "Norse Mythology")}"
  %
   Attribute{FEATURE("name","author"), FEATURE("ct", "Neil
Gaiman")};
 };

DECLARE Annotation RuleDetection;
 Book{ -> CREATE(NeilsBook) } <- {
  Attribute{Attribute.name=="title", Attribute.ct=="Norse Mythology"}"
  %
   Attribute{FEATURE("name","author"), FEATURE("ct", "Neil
Gaiman")};
 };


May be the problem is with when we use Identifiers:
   a1:Attribute and  a2:Attribute

In any case thank you very much for your help.


2017-02-21 17:46 GMT+01:00 Peter Klügl :

> Hi,
>
>
> I'd normally say that you need the conjunt rules construct to specify an
> AND between two rule element independent of the position:
>
>
> Book{-> NeilsBook}<-{
> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"}
> % a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"};
> };
>
>
> However, I just noted that there is a problem with conjunct rules. I
> haven't used it in a long time and the test coverage much lower than the
> other constructs. I'll create a ticket for it and fix it.
>
>
> Without conjunct rules, you need some boolean variables for cheking the
> AND, which looks all but declarative:
>
>
> BOOLEAN ft, fa;
> FOREACH(book) Book{}{
> book{-> ft = false, fa = false};
> book->{a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"->
> ft=true};};
> book->{a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"->
> fa=true};};
> book{ft,fa -> NeilsBook};
> }
>
>
> ... or with a BLOCK...
>
>
> BLOCK(book) Book{}{
> Document{-> ft = false, fa = false};
> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"-> ft=true};
> a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"-> fa=true};
> Document{ft,fa -> NeilsBook};
> }
>
>
> If the order of the attributes is known, you can avoid the AND check and
> just specify a sequential constraint:
>
>
> Book{-> NeilsBook}<-{
> a1:Attribute{a1.name=="title", a1.ct=="Norse Mythology"}
> # a2:Attribute{a2.name=="author", a2.ct=="Neil Gaiman"};
> };
>
>
> If you need to check on the complete title with the URL, you can replace
> the coveredText comparison with a REGEXP condition.
>
>
> (tested with UIMA Ruta 2.5.0)
>
>
> Best,
>
>
> Peter
>
>
>
> Am 21.02.2017 um 13:58 schrieb José Vicente Moyano Murillo:
> > Hello everyone
> >
> > I'm planning to use RUTA to create some annotations. But i'm not able to
> > accomplish my objective.
> >
> > This is my case right now:
> >
> > I have a text annotated with some annotations "*Book*".
> >
> > Under "*Book*" annotation i have a few annotations "*Attribute*" that
> > stores some information about the book. Each "*Attribute*" has a feature
> "
> > *name*" and a feature "*parent*" to its parent (one "*Book*" annotation).
> >
> > And example could be a text with 2 "*Book*" annotations:
> >
> > "*Book*" annotation number 1 with 3 nested attributes
> > 1.- *Attribute* with name feature equals "title" -> covered text: "Norse
> > Mythology
> >  gaiman/1124023596;jsessionid=FD1D8F9690602616CA59B38CFE9290
> 06.prodny_store02-atgap08?ean=9780393609097>
> > "
> > 2.- *Attribute* with name feature equals "author" ->  covered text: "Neil
> > Gaiman"
> > 3.- *Attribute* with name feature equals "language" - > covered text:
> > "English"
> >
> >
> > "*Book*" annotation number 2 with 3 nested attributes
> > 1.- *Attribute* with name feature equals "title" -> covered text: "Never
> > Never
> >  jsessionid=FD1D8F9690602616CA59B38CFE929006.prodny_store02-atgap08?ean=
> 9780316433174>
> > "
> > 2.- *Attribute* with name feature equals "author" ->  covered text:
> "James
> > Patterson"
> > 3.- *Attribute* with name feature equals "language" - > covered text:
> > "English"
> >
> > I need to respect this schema but i have this question:
> > It is possible to create and annotation over a book for a given author
> name
> > and a given title name?
> >
> > Thank's in advance
> >
>
>