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" < [email protected]> wrote: > On Sun, Jul 22, 2012 at 7:50 PM, David Riccitelli <[email protected]> > 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 <[email protected] > >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 < > >> [email protected]> 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 <[email protected]> > >>> 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 > >>> > <[email protected]> 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 [email protected] > >>> >> | 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 [email protected] > >>> | 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 [email protected] > | Bodenlehenstraße 11 ++43-699-11108907 > | A-5500 Bischofshofen >
