You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by David Riccitelli <da...@insideout.io> on 2012/07/21 19:52:43 UTC

exception using enhancer

I am getting an error in Stanbol (r1364045) using the enhancer web UI with
the entityhub referenced site configuration for dbpedia with *caching
strategy* to *Never* or *Used*.

Attached a screenshot of the error and the exception.

Am I doing something wrong?

BR,
David


-- 
David Riccitelli

********************************************************************************
InsideOut10 s.r.l.
P.IVA: IT-11381771002
Fax: +39 0110708239
---
LinkedIn: http://it.linkedin.com/in/riccitelli
Twitter: ziodave
---
Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
********************************************************************************

Re: [STANBOL-697] Re: exception using enhancer

Posted by David Riccitelli <da...@insideout.io>.
Mock objects could turn useful as well.

But I am getting afraid now of using 'online indexes'...

BR
David
On Jul 22, 2012 10:34 PM, "Rupert Westenthaler" <
rupert.westenthaler@gmail.com> wrote:

> On Sun, Jul 22, 2012 at 7:50 PM, David Riccitelli <da...@insideout.io>
> wrote:
> > Hey Rupert,
> >
> > Are there any unit tests related to these classes? as far as I can
> > understand any Stanbol install configured with a referenced site cache
> > strategy other than 'All' would fail, correct?
> >
>
> I would assume so, but this is a rather uncommon configuration as most
> users do use local indexes for extracting/linking Entities. Queries
> via the Entityhub /find interface are not affected by this as they do
> not contain Reference Constraints. So I assume this is the reason why
> this was not discovered.
>
>
> Currently there are no Unit Tests for this component. To test the
> validity of created SPARQL queries one would need a SPARQL parser.
> Testing optimizations for ARQ, LARQ and Virtuoso would require
> instances of those SPARQL parsers.
>
> Tests for expected Query Results would also require a TripleStore with
> a test data set. For Testing the ARQ, LARQ and Virtuoso query results
> tests would require according SPARQL endpoints over the test data.
>
>
> Adding Tests for standard SPARQL seams feasible. Tests for specific
> optimizations would require a lot of work for setting up the test
> environment
>
> best
> Rupert
>
> > BR,
> > David
> >
> > On Sun, Jul 22, 2012 at 8:48 PM, David Riccitelli <david@insideout.io
> >wrote:
> >
> >> Hello Rupert,
> >>
> >> I now attached the patch file [stanbol-traces.diff] to the issue [
> >> https://issues.apache.org/jira/browse/STANBOL-697].
> >>
> >> BR,
> >> David
> >>
> >>
> >>
> >>
> >> On Sun, Jul 22, 2012 at 8:43 PM, Rupert Westenthaler <
> >> rupert.westenthaler@gmail.com> wrote:
> >>
> >>> Hi David,
> >>>
> >>> the Patch was not attached to the mail. Maybe the file was to big for
> the
> >>> list.
> >>> Anyways the patch should be added to the Issue and not be sent on the
> >>> list.
> >>>
> >>>
> >>> On Sun, Jul 22, 2012 at 7:35 PM, David Riccitelli <da...@insideout.io>
> >>> wrote:
> >>> > Hello Rupert,
> >>> >
> >>> > Find attached the diff file. You might find some more reformatting,
> as
> >>> I had
> >>> > Eclipse apply the code conventions
> >>> > [http://incubator.apache.org/stanbol/development/coding.html].
> >>> >
> >>>
> >>> As long as I do not have a lot of local changes this should not be a
> >>> problem.
> >>>
> >>> best
> >>> Rupert
> >>>
> >>> > BR,
> >>> > David
> >>> >
> >>> >
> >>> > On Sun, Jul 22, 2012 at 8:20 PM, Rupert Westenthaler
> >>> > <ru...@gmail.com> wrote:
> >>> >>
> >>> >> Hi David,
> >>> >>
> >>> >> I think I located the cause for STANBOL-697 in
> >>> >>
> >>> >>     SparqlQueryUtils#addDataTypeValueConstraint(..)
> >>> >>
> >>> >> This method supports multiple values. In the "any" mode (Entities
> need
> >>> >> only to have one of the parsed values) it adds UNIONS to the SPARQL
> >>> >> query. In case only a single value is parsed than the starting '{'
> was
> >>> >> added, but the '}' was never added.
> >>> >>
> >>> >> That means that the reason for this is not a missing '}' but an
> >>> >> unintended '{' that is added for ValueConstraints (and
> >>> >> ReferenceConstraints) with a single value.
> >>> >>
> >>> >> >> I think the issue is line SparqlQueryUtils.java:448 [1]:
> >>> >> >>  queryString.append(" . \n");
> >>> >> >>
> >>> >> >> It adds a dot even though the constraint is the last in the set.
> >>> >> [..]
> >>> >> > I can confirm that, after applying the fix, it is working.
> >>> >>
> >>> >> Adding an additional ’}' in this place would fix the issue for
> queries
> >>> >> used by the Stanbol Enhancer, but will not work for other
> FieldQueries
> >>> >> (e.g. those without a ValueConstraint or ReferenceConstraint).
> >>> >>
> >>> >> >
> >>> >> > In order to find the issue I've added some traces in relevant
> >>> classes.
> >>> >> > It
> >>> >> > might be nice to pull back those traces in the source tree, as
> they
> >>> >> > might
> >>> >> > turn useful in the future as well.
> >>> >> >
> >>> >>
> >>> >> For sure. Can you please provide a Patch file with your changes
> >>> >> instead of the ZIP file with the changed Java classes.
> >>> >>
> >>> >> best
> >>> >> Rupert
> >>> >>
> >>> >>
> >>> >> --
> >>> >> | Rupert Westenthaler             rupert.westenthaler@gmail.com
> >>> >> | Bodenlehenstraße 11                             ++43-699-11108907
> >>> >> | A-5500 Bischofshofen
> >>> >
> >>> >
> >>> >
> >>> >
> >>> > --
> >>> > David Riccitelli
> >>> >
> >>> >
> >>>
> ********************************************************************************
> >>> > InsideOut10 s.r.l.
> >>> > P.IVA: IT-11381771002
> >>> > Fax: +39 0110708239
> >>> > ---
> >>> > LinkedIn: http://it.linkedin.com/in/riccitelli
> >>> > Twitter: ziodave
> >>> > ---
> >>> > Layar Partner Network
> >>> >
> >>>
> ********************************************************************************
> >>> >
> >>>
> >>>
> >>>
> >>> --
> >>> | Rupert Westenthaler             rupert.westenthaler@gmail.com
> >>> | Bodenlehenstraße 11                             ++43-699-11108907
> >>> | A-5500 Bischofshofen
> >>>
> >>
> >>
> >>
> >> --
> >> David Riccitelli
> >>
> >>
> >>
> ********************************************************************************
> >> InsideOut10 s.r.l.
> >> P.IVA: IT-11381771002
> >> Fax: +39 0110708239
> >> ---
> >> LinkedIn: http://it.linkedin.com/in/riccitelli
> >> Twitter: ziodave
> >> ---
> >> Layar Partner Network<
> http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1
> >
> >>
> >>
> ********************************************************************************
> >>
> >>
> >
> >
> > --
> > David Riccitelli
> >
> >
> ********************************************************************************
> > InsideOut10 s.r.l.
> > P.IVA: IT-11381771002
> > Fax: +39 0110708239
> > ---
> > LinkedIn: http://it.linkedin.com/in/riccitelli
> > Twitter: ziodave
> > ---
> > Layar Partner Network<
> http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1
> >
> >
> ********************************************************************************
>
>
>
> --
> | Rupert Westenthaler             rupert.westenthaler@gmail.com
> | Bodenlehenstraße 11                             ++43-699-11108907
> | A-5500 Bischofshofen
>

Re: [STANBOL-697] Re: exception using enhancer

Posted by Rupert Westenthaler <ru...@gmail.com>.
On Sun, Jul 22, 2012 at 7:50 PM, David Riccitelli <da...@insideout.io> wrote:
> Hey Rupert,
>
> Are there any unit tests related to these classes? as far as I can
> understand any Stanbol install configured with a referenced site cache
> strategy other than 'All' would fail, correct?
>

I would assume so, but this is a rather uncommon configuration as most
users do use local indexes for extracting/linking Entities. Queries
via the Entityhub /find interface are not affected by this as they do
not contain Reference Constraints. So I assume this is the reason why
this was not discovered.


Currently there are no Unit Tests for this component. To test the
validity of created SPARQL queries one would need a SPARQL parser.
Testing optimizations for ARQ, LARQ and Virtuoso would require
instances of those SPARQL parsers.

Tests for expected Query Results would also require a TripleStore with
a test data set. For Testing the ARQ, LARQ and Virtuoso query results
tests would require according SPARQL endpoints over the test data.


Adding Tests for standard SPARQL seams feasible. Tests for specific
optimizations would require a lot of work for setting up the test
environment

best
Rupert

> BR,
> David
>
> On Sun, Jul 22, 2012 at 8:48 PM, David Riccitelli <da...@insideout.io>wrote:
>
>> Hello Rupert,
>>
>> I now attached the patch file [stanbol-traces.diff] to the issue [
>> https://issues.apache.org/jira/browse/STANBOL-697].
>>
>> BR,
>> David
>>
>>
>>
>>
>> On Sun, Jul 22, 2012 at 8:43 PM, Rupert Westenthaler <
>> rupert.westenthaler@gmail.com> wrote:
>>
>>> Hi David,
>>>
>>> the Patch was not attached to the mail. Maybe the file was to big for the
>>> list.
>>> Anyways the patch should be added to the Issue and not be sent on the
>>> list.
>>>
>>>
>>> On Sun, Jul 22, 2012 at 7:35 PM, David Riccitelli <da...@insideout.io>
>>> wrote:
>>> > Hello Rupert,
>>> >
>>> > Find attached the diff file. You might find some more reformatting, as
>>> I had
>>> > Eclipse apply the code conventions
>>> > [http://incubator.apache.org/stanbol/development/coding.html].
>>> >
>>>
>>> As long as I do not have a lot of local changes this should not be a
>>> problem.
>>>
>>> best
>>> Rupert
>>>
>>> > BR,
>>> > David
>>> >
>>> >
>>> > On Sun, Jul 22, 2012 at 8:20 PM, Rupert Westenthaler
>>> > <ru...@gmail.com> wrote:
>>> >>
>>> >> Hi David,
>>> >>
>>> >> I think I located the cause for STANBOL-697 in
>>> >>
>>> >>     SparqlQueryUtils#addDataTypeValueConstraint(..)
>>> >>
>>> >> This method supports multiple values. In the "any" mode (Entities need
>>> >> only to have one of the parsed values) it adds UNIONS to the SPARQL
>>> >> query. In case only a single value is parsed than the starting '{' was
>>> >> added, but the '}' was never added.
>>> >>
>>> >> That means that the reason for this is not a missing '}' but an
>>> >> unintended '{' that is added for ValueConstraints (and
>>> >> ReferenceConstraints) with a single value.
>>> >>
>>> >> >> I think the issue is line SparqlQueryUtils.java:448 [1]:
>>> >> >>  queryString.append(" . \n");
>>> >> >>
>>> >> >> It adds a dot even though the constraint is the last in the set.
>>> >> [..]
>>> >> > I can confirm that, after applying the fix, it is working.
>>> >>
>>> >> Adding an additional ’}' in this place would fix the issue for queries
>>> >> used by the Stanbol Enhancer, but will not work for other FieldQueries
>>> >> (e.g. those without a ValueConstraint or ReferenceConstraint).
>>> >>
>>> >> >
>>> >> > In order to find the issue I've added some traces in relevant
>>> classes.
>>> >> > It
>>> >> > might be nice to pull back those traces in the source tree, as they
>>> >> > might
>>> >> > turn useful in the future as well.
>>> >> >
>>> >>
>>> >> For sure. Can you please provide a Patch file with your changes
>>> >> instead of the ZIP file with the changed Java classes.
>>> >>
>>> >> best
>>> >> Rupert
>>> >>
>>> >>
>>> >> --
>>> >> | Rupert Westenthaler             rupert.westenthaler@gmail.com
>>> >> | Bodenlehenstraße 11                             ++43-699-11108907
>>> >> | A-5500 Bischofshofen
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > David Riccitelli
>>> >
>>> >
>>> ********************************************************************************
>>> > InsideOut10 s.r.l.
>>> > P.IVA: IT-11381771002
>>> > Fax: +39 0110708239
>>> > ---
>>> > LinkedIn: http://it.linkedin.com/in/riccitelli
>>> > Twitter: ziodave
>>> > ---
>>> > Layar Partner Network
>>> >
>>> ********************************************************************************
>>> >
>>>
>>>
>>>
>>> --
>>> | Rupert Westenthaler             rupert.westenthaler@gmail.com
>>> | Bodenlehenstraße 11                             ++43-699-11108907
>>> | A-5500 Bischofshofen
>>>
>>
>>
>>
>> --
>> David Riccitelli
>>
>>
>> ********************************************************************************
>> InsideOut10 s.r.l.
>> P.IVA: IT-11381771002
>> Fax: +39 0110708239
>> ---
>> LinkedIn: http://it.linkedin.com/in/riccitelli
>> Twitter: ziodave
>> ---
>> Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
>>
>> ********************************************************************************
>>
>>
>
>
> --
> David Riccitelli
>
> ********************************************************************************
> InsideOut10 s.r.l.
> P.IVA: IT-11381771002
> Fax: +39 0110708239
> ---
> LinkedIn: http://it.linkedin.com/in/riccitelli
> Twitter: ziodave
> ---
> Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
> ********************************************************************************



-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: [STANBOL-697] Re: exception using enhancer

Posted by David Riccitelli <da...@insideout.io>.
Hey Rupert,

Are there any unit tests related to these classes? as far as I can
understand any Stanbol install configured with a referenced site cache
strategy other than 'All' would fail, correct?

BR,
David

On Sun, Jul 22, 2012 at 8:48 PM, David Riccitelli <da...@insideout.io>wrote:

> Hello Rupert,
>
> I now attached the patch file [stanbol-traces.diff] to the issue [
> https://issues.apache.org/jira/browse/STANBOL-697].
>
> BR,
> David
>
>
>
>
> On Sun, Jul 22, 2012 at 8:43 PM, Rupert Westenthaler <
> rupert.westenthaler@gmail.com> wrote:
>
>> Hi David,
>>
>> the Patch was not attached to the mail. Maybe the file was to big for the
>> list.
>> Anyways the patch should be added to the Issue and not be sent on the
>> list.
>>
>>
>> On Sun, Jul 22, 2012 at 7:35 PM, David Riccitelli <da...@insideout.io>
>> wrote:
>> > Hello Rupert,
>> >
>> > Find attached the diff file. You might find some more reformatting, as
>> I had
>> > Eclipse apply the code conventions
>> > [http://incubator.apache.org/stanbol/development/coding.html].
>> >
>>
>> As long as I do not have a lot of local changes this should not be a
>> problem.
>>
>> best
>> Rupert
>>
>> > BR,
>> > David
>> >
>> >
>> > On Sun, Jul 22, 2012 at 8:20 PM, Rupert Westenthaler
>> > <ru...@gmail.com> wrote:
>> >>
>> >> Hi David,
>> >>
>> >> I think I located the cause for STANBOL-697 in
>> >>
>> >>     SparqlQueryUtils#addDataTypeValueConstraint(..)
>> >>
>> >> This method supports multiple values. In the "any" mode (Entities need
>> >> only to have one of the parsed values) it adds UNIONS to the SPARQL
>> >> query. In case only a single value is parsed than the starting '{' was
>> >> added, but the '}' was never added.
>> >>
>> >> That means that the reason for this is not a missing '}' but an
>> >> unintended '{' that is added for ValueConstraints (and
>> >> ReferenceConstraints) with a single value.
>> >>
>> >> >> I think the issue is line SparqlQueryUtils.java:448 [1]:
>> >> >>  queryString.append(" . \n");
>> >> >>
>> >> >> It adds a dot even though the constraint is the last in the set.
>> >> [..]
>> >> > I can confirm that, after applying the fix, it is working.
>> >>
>> >> Adding an additional ’}' in this place would fix the issue for queries
>> >> used by the Stanbol Enhancer, but will not work for other FieldQueries
>> >> (e.g. those without a ValueConstraint or ReferenceConstraint).
>> >>
>> >> >
>> >> > In order to find the issue I've added some traces in relevant
>> classes.
>> >> > It
>> >> > might be nice to pull back those traces in the source tree, as they
>> >> > might
>> >> > turn useful in the future as well.
>> >> >
>> >>
>> >> For sure. Can you please provide a Patch file with your changes
>> >> instead of the ZIP file with the changed Java classes.
>> >>
>> >> best
>> >> Rupert
>> >>
>> >>
>> >> --
>> >> | Rupert Westenthaler             rupert.westenthaler@gmail.com
>> >> | Bodenlehenstraße 11                             ++43-699-11108907
>> >> | A-5500 Bischofshofen
>> >
>> >
>> >
>> >
>> > --
>> > David Riccitelli
>> >
>> >
>> ********************************************************************************
>> > InsideOut10 s.r.l.
>> > P.IVA: IT-11381771002
>> > Fax: +39 0110708239
>> > ---
>> > LinkedIn: http://it.linkedin.com/in/riccitelli
>> > Twitter: ziodave
>> > ---
>> > Layar Partner Network
>> >
>> ********************************************************************************
>> >
>>
>>
>>
>> --
>> | Rupert Westenthaler             rupert.westenthaler@gmail.com
>> | Bodenlehenstraße 11                             ++43-699-11108907
>> | A-5500 Bischofshofen
>>
>
>
>
> --
> David Riccitelli
>
>
> ********************************************************************************
> InsideOut10 s.r.l.
> P.IVA: IT-11381771002
> Fax: +39 0110708239
> ---
> LinkedIn: http://it.linkedin.com/in/riccitelli
> Twitter: ziodave
> ---
> Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
>
> ********************************************************************************
>
>


-- 
David Riccitelli

********************************************************************************
InsideOut10 s.r.l.
P.IVA: IT-11381771002
Fax: +39 0110708239
---
LinkedIn: http://it.linkedin.com/in/riccitelli
Twitter: ziodave
---
Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
********************************************************************************

Re: [STANBOL-697] Re: exception using enhancer

Posted by David Riccitelli <da...@insideout.io>.
Hello Rupert,

I now attached the patch file [stanbol-traces.diff] to the issue [
https://issues.apache.org/jira/browse/STANBOL-697].

BR,
David



On Sun, Jul 22, 2012 at 8:43 PM, Rupert Westenthaler <
rupert.westenthaler@gmail.com> wrote:

> Hi David,
>
> the Patch was not attached to the mail. Maybe the file was to big for the
> list.
> Anyways the patch should be added to the Issue and not be sent on the list.
>
>
> On Sun, Jul 22, 2012 at 7:35 PM, David Riccitelli <da...@insideout.io>
> wrote:
> > Hello Rupert,
> >
> > Find attached the diff file. You might find some more reformatting, as I
> had
> > Eclipse apply the code conventions
> > [http://incubator.apache.org/stanbol/development/coding.html].
> >
>
> As long as I do not have a lot of local changes this should not be a
> problem.
>
> best
> Rupert
>
> > BR,
> > David
> >
> >
> > On Sun, Jul 22, 2012 at 8:20 PM, Rupert Westenthaler
> > <ru...@gmail.com> wrote:
> >>
> >> Hi David,
> >>
> >> I think I located the cause for STANBOL-697 in
> >>
> >>     SparqlQueryUtils#addDataTypeValueConstraint(..)
> >>
> >> This method supports multiple values. In the "any" mode (Entities need
> >> only to have one of the parsed values) it adds UNIONS to the SPARQL
> >> query. In case only a single value is parsed than the starting '{' was
> >> added, but the '}' was never added.
> >>
> >> That means that the reason for this is not a missing '}' but an
> >> unintended '{' that is added for ValueConstraints (and
> >> ReferenceConstraints) with a single value.
> >>
> >> >> I think the issue is line SparqlQueryUtils.java:448 [1]:
> >> >>  queryString.append(" . \n");
> >> >>
> >> >> It adds a dot even though the constraint is the last in the set.
> >> [..]
> >> > I can confirm that, after applying the fix, it is working.
> >>
> >> Adding an additional ’}' in this place would fix the issue for queries
> >> used by the Stanbol Enhancer, but will not work for other FieldQueries
> >> (e.g. those without a ValueConstraint or ReferenceConstraint).
> >>
> >> >
> >> > In order to find the issue I've added some traces in relevant classes.
> >> > It
> >> > might be nice to pull back those traces in the source tree, as they
> >> > might
> >> > turn useful in the future as well.
> >> >
> >>
> >> For sure. Can you please provide a Patch file with your changes
> >> instead of the ZIP file with the changed Java classes.
> >>
> >> best
> >> Rupert
> >>
> >>
> >> --
> >> | Rupert Westenthaler             rupert.westenthaler@gmail.com
> >> | Bodenlehenstraße 11                             ++43-699-11108907
> >> | A-5500 Bischofshofen
> >
> >
> >
> >
> > --
> > David Riccitelli
> >
> >
> ********************************************************************************
> > InsideOut10 s.r.l.
> > P.IVA: IT-11381771002
> > Fax: +39 0110708239
> > ---
> > LinkedIn: http://it.linkedin.com/in/riccitelli
> > Twitter: ziodave
> > ---
> > Layar Partner Network
> >
> ********************************************************************************
> >
>
>
>
> --
> | Rupert Westenthaler             rupert.westenthaler@gmail.com
> | Bodenlehenstraße 11                             ++43-699-11108907
> | A-5500 Bischofshofen
>



-- 
David Riccitelli

********************************************************************************
InsideOut10 s.r.l.
P.IVA: IT-11381771002
Fax: +39 0110708239
---
LinkedIn: http://it.linkedin.com/in/riccitelli
Twitter: ziodave
---
Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
********************************************************************************

Re: [STANBOL-697] Re: exception using enhancer

Posted by Rupert Westenthaler <ru...@gmail.com>.
Hi David,

the Patch was not attached to the mail. Maybe the file was to big for the list.
Anyways the patch should be added to the Issue and not be sent on the list.


On Sun, Jul 22, 2012 at 7:35 PM, David Riccitelli <da...@insideout.io> wrote:
> Hello Rupert,
>
> Find attached the diff file. You might find some more reformatting, as I had
> Eclipse apply the code conventions
> [http://incubator.apache.org/stanbol/development/coding.html].
>

As long as I do not have a lot of local changes this should not be a problem.

best
Rupert

> BR,
> David
>
>
> On Sun, Jul 22, 2012 at 8:20 PM, Rupert Westenthaler
> <ru...@gmail.com> wrote:
>>
>> Hi David,
>>
>> I think I located the cause for STANBOL-697 in
>>
>>     SparqlQueryUtils#addDataTypeValueConstraint(..)
>>
>> This method supports multiple values. In the "any" mode (Entities need
>> only to have one of the parsed values) it adds UNIONS to the SPARQL
>> query. In case only a single value is parsed than the starting '{' was
>> added, but the '}' was never added.
>>
>> That means that the reason for this is not a missing '}' but an
>> unintended '{' that is added for ValueConstraints (and
>> ReferenceConstraints) with a single value.
>>
>> >> I think the issue is line SparqlQueryUtils.java:448 [1]:
>> >>  queryString.append(" . \n");
>> >>
>> >> It adds a dot even though the constraint is the last in the set.
>> [..]
>> > I can confirm that, after applying the fix, it is working.
>>
>> Adding an additional ’}' in this place would fix the issue for queries
>> used by the Stanbol Enhancer, but will not work for other FieldQueries
>> (e.g. those without a ValueConstraint or ReferenceConstraint).
>>
>> >
>> > In order to find the issue I've added some traces in relevant classes.
>> > It
>> > might be nice to pull back those traces in the source tree, as they
>> > might
>> > turn useful in the future as well.
>> >
>>
>> For sure. Can you please provide a Patch file with your changes
>> instead of the ZIP file with the changed Java classes.
>>
>> best
>> Rupert
>>
>>
>> --
>> | Rupert Westenthaler             rupert.westenthaler@gmail.com
>> | Bodenlehenstraße 11                             ++43-699-11108907
>> | A-5500 Bischofshofen
>
>
>
>
> --
> David Riccitelli
>
> ********************************************************************************
> InsideOut10 s.r.l.
> P.IVA: IT-11381771002
> Fax: +39 0110708239
> ---
> LinkedIn: http://it.linkedin.com/in/riccitelli
> Twitter: ziodave
> ---
> Layar Partner Network
> ********************************************************************************
>



-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: [STANBOL-697] Re: exception using enhancer

Posted by David Riccitelli <da...@insideout.io>.
Hello Rupert,

Find attached the diff file. You might find some more reformatting, as I
had Eclipse apply the code conventions [
http://incubator.apache.org/stanbol/development/coding.html].

BR,
David

On Sun, Jul 22, 2012 at 8:20 PM, Rupert Westenthaler <
rupert.westenthaler@gmail.com> wrote:

> Hi David,
>
> I think I located the cause for STANBOL-697 in
>
>     SparqlQueryUtils#addDataTypeValueConstraint(..)
>
> This method supports multiple values. In the "any" mode (Entities need
> only to have one of the parsed values) it adds UNIONS to the SPARQL
> query. In case only a single value is parsed than the starting '{' was
> added, but the '}' was never added.
>
> That means that the reason for this is not a missing '}' but an
> unintended '{' that is added for ValueConstraints (and
> ReferenceConstraints) with a single value.
>
> >> I think the issue is line SparqlQueryUtils.java:448 [1]:
> >>  queryString.append(" . \n");
> >>
> >> It adds a dot even though the constraint is the last in the set.
> [..]
> > I can confirm that, after applying the fix, it is working.
>
> Adding an additional ’}' in this place would fix the issue for queries
> used by the Stanbol Enhancer, but will not work for other FieldQueries
> (e.g. those without a ValueConstraint or ReferenceConstraint).
>
> >
> > In order to find the issue I've added some traces in relevant classes. It
> > might be nice to pull back those traces in the source tree, as they might
> > turn useful in the future as well.
> >
>
> For sure. Can you please provide a Patch file with your changes
> instead of the ZIP file with the changed Java classes.
>
> best
> Rupert
>
>
> --
> | Rupert Westenthaler             rupert.westenthaler@gmail.com
> | Bodenlehenstraße 11                             ++43-699-11108907
> | A-5500 Bischofshofen
>



-- 
David Riccitelli

********************************************************************************
InsideOut10 s.r.l.
P.IVA: IT-11381771002
Fax: +39 0110708239
---
LinkedIn: http://it.linkedin.com/in/riccitelli
Twitter: ziodave
---
Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
********************************************************************************

Re: [STANBOL-697] Re: exception using enhancer

Posted by Rupert Westenthaler <ru...@gmail.com>.
Hi David,

I think I located the cause for STANBOL-697 in

    SparqlQueryUtils#addDataTypeValueConstraint(..)

This method supports multiple values. In the "any" mode (Entities need
only to have one of the parsed values) it adds UNIONS to the SPARQL
query. In case only a single value is parsed than the starting '{' was
added, but the '}' was never added.

That means that the reason for this is not a missing '}' but an
unintended '{' that is added for ValueConstraints (and
ReferenceConstraints) with a single value.

>> I think the issue is line SparqlQueryUtils.java:448 [1]:
>>  queryString.append(" . \n");
>>
>> It adds a dot even though the constraint is the last in the set.
[..]
> I can confirm that, after applying the fix, it is working.

Adding an additional ’}' in this place would fix the issue for queries
used by the Stanbol Enhancer, but will not work for other FieldQueries
(e.g. those without a ValueConstraint or ReferenceConstraint).

>
> In order to find the issue I've added some traces in relevant classes. It
> might be nice to pull back those traces in the source tree, as they might
> turn useful in the future as well.
>

For sure. Can you please provide a Patch file with your changes
instead of the ZIP file with the changed Java classes.

best
Rupert


-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: [STANBOL-697] Re: exception using enhancer

Posted by David Riccitelli <da...@insideout.io>.
Hello Rupert,

I can confirm that, after applying the fix, it is working.

In order to find the issue I've added some traces in relevant classes. It
might be nice to pull back those traces in the source tree, as they might
turn useful in the future as well.

I am attaching the edited classes for your consideration:

   -
   enhancer/engines/entitytagging/src/main/java/org/apache/stanbol/enhancer/engines/entitytagging/impl/NamedEntityTaggingEngine.java
   -
   entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/impl/Resource2ValueAdapter.java
   -
   entityhub/site/linkeddata/src/main/java/org/apache/stanbol/entityhub/site/linkeddata/impl/SparqlEndpointUtils.java
   -
   entityhub/site/linkeddata/src/main/java/org/apache/stanbol/entityhub/site/linkeddata/impl/VirtuosoSearcher.java
   -
   entityhub/query/clerezza/src/main/java/org/apache/stanbol/entityhub/query/clerezza/SparqlFieldQueryFactory.java
   -
   entityhub/query/clerezza/src/main/java/org/apache/stanbol/entityhub/query/clerezza/SparqlQueryUtils.java
   -
   entityhub/query/clerezza/src/main/java/org/apache/stanbol/entityhub/query/clerezza/SparqlFieldQuery.java
   -
   entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java
   -
   entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/FieldQueryImpl.java
   -
   entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/query/Constraint.java



Thanks,
David

On Sun, Jul 22, 2012 at 3:31 PM, David Riccitelli <da...@insideout.io>wrote:

> Rupert,
>
> I think the issue is line SparqlQueryUtils.java:448 [1]:
>  queryString.append(" . \n");
>
> It adds a dot even though the constraint is the last in the set.
>
> I am attaching a possible fix, can you please review it?
>
> Thanks,
> David
>
>
> [1]
> http://svn.apache.org/repos/asf/incubator/stanbol/trunk/entityhub/query/clerezza/src/main/java/org/apache/stanbol/entityhub/query/clerezza/SparqlQueryUtils.java
>
>
> On Sun, Jul 22, 2012 at 3:18 PM, David Riccitelli <da...@insideout.io>wrote:
>
>> I also created a bug report here:
>> https://issues.apache.org/jira/browse/STANBOL-697
>>
>> BR
>> David
>>
>>
>> On Sun, Jul 22, 2012 at 2:49 PM, David Riccitelli <da...@insideout.io>wrote:
>>
>>> Thanks Rupert,
>>>
>>> I am digging into, the issue is probably located here:
>>>  org.apache.stanbol.entityhub.query.clerezza.SparqlQueryUtils
>>> (.addFieldConstraint).
>>>
>>> Let me know ...
>>>
>>> David
>>>
>>>
>>> On Sun, Jul 22, 2012 at 2:37 PM, Rupert Westenthaler <
>>> rupert.westenthaler@gmail.com> wrote:
>>>
>>>> Hi David,
>>>>
>>>> this is clearly a Bug in the SPARQL query generation as it looks like
>>>> a closing '}' is missing in the generated query.
>>>>
>>>> Thanks for reporting. I will have a look into what is causing this.
>>>>
>>>> best
>>>> Rupert
>>>>
>>>> On Sat, Jul 21, 2012 at 7:52 PM, David Riccitelli <da...@insideout.io>
>>>> wrote:
>>>> > I am getting an error in Stanbol (r1364045) using the enhancer web UI
>>>> with
>>>> > the entityhub referenced site configuration for dbpedia with caching
>>>> > strategy to Never or Used.
>>>> >
>>>> > Attached a screenshot of the error and the exception.
>>>> >
>>>> > Am I doing something wrong?
>>>> >
>>>> > BR,
>>>> > David
>>>> >
>>>> >
>>>> > --
>>>> > David Riccitelli
>>>> >
>>>> >
>>>> ********************************************************************************
>>>> > InsideOut10 s.r.l.
>>>> > P.IVA: IT-11381771002
>>>> > Fax: +39 0110708239
>>>> > ---
>>>> > LinkedIn: http://it.linkedin.com/in/riccitelli
>>>> > Twitter: ziodave
>>>> > ---
>>>> > Layar Partner Network
>>>> >
>>>> ********************************************************************************
>>>> >
>>>>
>>>>
>>>>
>>>> --
>>>> | Rupert Westenthaler             rupert.westenthaler@gmail.com
>>>> | Bodenlehenstraße 11                             ++43-699-11108907
>>>> | A-5500 Bischofshofen
>>>>
>>>
>>>
>>>
>>> --
>>> David Riccitelli
>>>
>>>
>>> ********************************************************************************
>>> InsideOut10 s.r.l.
>>> P.IVA: IT-11381771002
>>> Fax: +39 0110708239
>>> ---
>>> LinkedIn: http://it.linkedin.com/in/riccitelli
>>> Twitter: ziodave
>>> ---
>>> Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
>>>
>>> ********************************************************************************
>>>
>>>
>>
>>
>> --
>> David Riccitelli
>>
>>
>> ********************************************************************************
>> InsideOut10 s.r.l.
>> P.IVA: IT-11381771002
>> Fax: +39 0110708239
>> ---
>> LinkedIn: http://it.linkedin.com/in/riccitelli
>> Twitter: ziodave
>> ---
>> Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
>>
>> ********************************************************************************
>>
>>
>
>
> --
> David Riccitelli
>
>
> ********************************************************************************
> InsideOut10 s.r.l.
> P.IVA: IT-11381771002
> Fax: +39 0110708239
> ---
> LinkedIn: http://it.linkedin.com/in/riccitelli
> Twitter: ziodave
> ---
> Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
>
> ********************************************************************************
>
>


-- 
David Riccitelli

********************************************************************************
InsideOut10 s.r.l.
P.IVA: IT-11381771002
Fax: +39 0110708239
---
LinkedIn: http://it.linkedin.com/in/riccitelli
Twitter: ziodave
---
Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
********************************************************************************

[STANBOL-697] Re: exception using enhancer

Posted by David Riccitelli <da...@insideout.io>.
Rupert,

I think the issue is line SparqlQueryUtils.java:448 [1]:
 queryString.append(" . \n");

It adds a dot even though the constraint is the last in the set.

I am attaching a possible fix, can you please review it?

Thanks,
David


[1]
http://svn.apache.org/repos/asf/incubator/stanbol/trunk/entityhub/query/clerezza/src/main/java/org/apache/stanbol/entityhub/query/clerezza/SparqlQueryUtils.java

On Sun, Jul 22, 2012 at 3:18 PM, David Riccitelli <da...@insideout.io>wrote:

> I also created a bug report here:
> https://issues.apache.org/jira/browse/STANBOL-697
>
> BR
> David
>
>
> On Sun, Jul 22, 2012 at 2:49 PM, David Riccitelli <da...@insideout.io>wrote:
>
>> Thanks Rupert,
>>
>> I am digging into, the issue is probably located here:
>>  org.apache.stanbol.entityhub.query.clerezza.SparqlQueryUtils
>> (.addFieldConstraint).
>>
>> Let me know ...
>>
>> David
>>
>>
>> On Sun, Jul 22, 2012 at 2:37 PM, Rupert Westenthaler <
>> rupert.westenthaler@gmail.com> wrote:
>>
>>> Hi David,
>>>
>>> this is clearly a Bug in the SPARQL query generation as it looks like
>>> a closing '}' is missing in the generated query.
>>>
>>> Thanks for reporting. I will have a look into what is causing this.
>>>
>>> best
>>> Rupert
>>>
>>> On Sat, Jul 21, 2012 at 7:52 PM, David Riccitelli <da...@insideout.io>
>>> wrote:
>>> > I am getting an error in Stanbol (r1364045) using the enhancer web UI
>>> with
>>> > the entityhub referenced site configuration for dbpedia with caching
>>> > strategy to Never or Used.
>>> >
>>> > Attached a screenshot of the error and the exception.
>>> >
>>> > Am I doing something wrong?
>>> >
>>> > BR,
>>> > David
>>> >
>>> >
>>> > --
>>> > David Riccitelli
>>> >
>>> >
>>> ********************************************************************************
>>> > InsideOut10 s.r.l.
>>> > P.IVA: IT-11381771002
>>> > Fax: +39 0110708239
>>> > ---
>>> > LinkedIn: http://it.linkedin.com/in/riccitelli
>>> > Twitter: ziodave
>>> > ---
>>> > Layar Partner Network
>>> >
>>> ********************************************************************************
>>> >
>>>
>>>
>>>
>>> --
>>> | Rupert Westenthaler             rupert.westenthaler@gmail.com
>>> | Bodenlehenstraße 11                             ++43-699-11108907
>>> | A-5500 Bischofshofen
>>>
>>
>>
>>
>> --
>> David Riccitelli
>>
>>
>> ********************************************************************************
>> InsideOut10 s.r.l.
>> P.IVA: IT-11381771002
>> Fax: +39 0110708239
>> ---
>> LinkedIn: http://it.linkedin.com/in/riccitelli
>> Twitter: ziodave
>> ---
>> Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
>>
>> ********************************************************************************
>>
>>
>
>
> --
> David Riccitelli
>
>
> ********************************************************************************
> InsideOut10 s.r.l.
> P.IVA: IT-11381771002
> Fax: +39 0110708239
> ---
> LinkedIn: http://it.linkedin.com/in/riccitelli
> Twitter: ziodave
> ---
> Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
>
> ********************************************************************************
>
>


-- 
David Riccitelli

********************************************************************************
InsideOut10 s.r.l.
P.IVA: IT-11381771002
Fax: +39 0110708239
---
LinkedIn: http://it.linkedin.com/in/riccitelli
Twitter: ziodave
---
Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
********************************************************************************

Re: exception using enhancer

Posted by David Riccitelli <da...@insideout.io>.
I also created a bug report here:
https://issues.apache.org/jira/browse/STANBOL-697

BR
David

On Sun, Jul 22, 2012 at 2:49 PM, David Riccitelli <da...@insideout.io>wrote:

> Thanks Rupert,
>
> I am digging into, the issue is probably located here:
>  org.apache.stanbol.entityhub.query.clerezza.SparqlQueryUtils
> (.addFieldConstraint).
>
> Let me know ...
>
> David
>
>
> On Sun, Jul 22, 2012 at 2:37 PM, Rupert Westenthaler <
> rupert.westenthaler@gmail.com> wrote:
>
>> Hi David,
>>
>> this is clearly a Bug in the SPARQL query generation as it looks like
>> a closing '}' is missing in the generated query.
>>
>> Thanks for reporting. I will have a look into what is causing this.
>>
>> best
>> Rupert
>>
>> On Sat, Jul 21, 2012 at 7:52 PM, David Riccitelli <da...@insideout.io>
>> wrote:
>> > I am getting an error in Stanbol (r1364045) using the enhancer web UI
>> with
>> > the entityhub referenced site configuration for dbpedia with caching
>> > strategy to Never or Used.
>> >
>> > Attached a screenshot of the error and the exception.
>> >
>> > Am I doing something wrong?
>> >
>> > BR,
>> > David
>> >
>> >
>> > --
>> > David Riccitelli
>> >
>> >
>> ********************************************************************************
>> > InsideOut10 s.r.l.
>> > P.IVA: IT-11381771002
>> > Fax: +39 0110708239
>> > ---
>> > LinkedIn: http://it.linkedin.com/in/riccitelli
>> > Twitter: ziodave
>> > ---
>> > Layar Partner Network
>> >
>> ********************************************************************************
>> >
>>
>>
>>
>> --
>> | Rupert Westenthaler             rupert.westenthaler@gmail.com
>> | Bodenlehenstraße 11                             ++43-699-11108907
>> | A-5500 Bischofshofen
>>
>
>
>
> --
> David Riccitelli
>
>
> ********************************************************************************
> InsideOut10 s.r.l.
> P.IVA: IT-11381771002
> Fax: +39 0110708239
> ---
> LinkedIn: http://it.linkedin.com/in/riccitelli
> Twitter: ziodave
> ---
> Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
>
> ********************************************************************************
>
>


-- 
David Riccitelli

********************************************************************************
InsideOut10 s.r.l.
P.IVA: IT-11381771002
Fax: +39 0110708239
---
LinkedIn: http://it.linkedin.com/in/riccitelli
Twitter: ziodave
---
Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
********************************************************************************

Re: exception using enhancer

Posted by David Riccitelli <da...@insideout.io>.
Thanks Rupert,

I am digging into, the issue is probably located here:
 org.apache.stanbol.entityhub.query.clerezza.SparqlQueryUtils
(.addFieldConstraint).

Let me know ...

David

On Sun, Jul 22, 2012 at 2:37 PM, Rupert Westenthaler <
rupert.westenthaler@gmail.com> wrote:

> Hi David,
>
> this is clearly a Bug in the SPARQL query generation as it looks like
> a closing '}' is missing in the generated query.
>
> Thanks for reporting. I will have a look into what is causing this.
>
> best
> Rupert
>
> On Sat, Jul 21, 2012 at 7:52 PM, David Riccitelli <da...@insideout.io>
> wrote:
> > I am getting an error in Stanbol (r1364045) using the enhancer web UI
> with
> > the entityhub referenced site configuration for dbpedia with caching
> > strategy to Never or Used.
> >
> > Attached a screenshot of the error and the exception.
> >
> > Am I doing something wrong?
> >
> > BR,
> > David
> >
> >
> > --
> > David Riccitelli
> >
> >
> ********************************************************************************
> > InsideOut10 s.r.l.
> > P.IVA: IT-11381771002
> > Fax: +39 0110708239
> > ---
> > LinkedIn: http://it.linkedin.com/in/riccitelli
> > Twitter: ziodave
> > ---
> > Layar Partner Network
> >
> ********************************************************************************
> >
>
>
>
> --
> | Rupert Westenthaler             rupert.westenthaler@gmail.com
> | Bodenlehenstraße 11                             ++43-699-11108907
> | A-5500 Bischofshofen
>



-- 
David Riccitelli

********************************************************************************
InsideOut10 s.r.l.
P.IVA: IT-11381771002
Fax: +39 0110708239
---
LinkedIn: http://it.linkedin.com/in/riccitelli
Twitter: ziodave
---
Layar Partner Network<http://www.layar.com/publishing/developers/list/?page=1&country=&city=&keyword=insideout10&lpn=1>
********************************************************************************

Re: exception using enhancer

Posted by Rupert Westenthaler <ru...@gmail.com>.
Hi David,

this is clearly a Bug in the SPARQL query generation as it looks like
a closing '}' is missing in the generated query.

Thanks for reporting. I will have a look into what is causing this.

best
Rupert

On Sat, Jul 21, 2012 at 7:52 PM, David Riccitelli <da...@insideout.io> wrote:
> I am getting an error in Stanbol (r1364045) using the enhancer web UI with
> the entityhub referenced site configuration for dbpedia with caching
> strategy to Never or Used.
>
> Attached a screenshot of the error and the exception.
>
> Am I doing something wrong?
>
> BR,
> David
>
>
> --
> David Riccitelli
>
> ********************************************************************************
> InsideOut10 s.r.l.
> P.IVA: IT-11381771002
> Fax: +39 0110708239
> ---
> LinkedIn: http://it.linkedin.com/in/riccitelli
> Twitter: ziodave
> ---
> Layar Partner Network
> ********************************************************************************
>



-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen