From: Alexander S. <ale...@gm...> - 2010-03-27 09:10:25
|
Hi Rob, Sorry, I didn't notice it replaces parameters starting from the longest one. But nevertheless there could be some conflicts. I think the best solution would be to use regexp like this: String.Format(@"\s{0}\s", parameterName). Regards, Alexander 2010/3/25 <dot...@li...> > Send Dotnetrdf-develop mailing list submissions to > dot...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/dotnetrdf-develop > or, via email, send a message with subject or body 'help' to > dot...@li... > > You can reach the person managing the list at > dot...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Dotnetrdf-develop digest..." > > > Today's Topics: > > 1. Re: SparqlParameterizedString parameters bug (Rob Vesse) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 24 Mar 2010 13:58:49 -0700 > From: "Rob Vesse" <rv...@do...> > Subject: Re: [dotNetRDF-develop] SparqlParameterizedString parameters > bug > To: "dotNetRDF Developer Discussion and Feature Request" > <dot...@li...> > Message-ID: <42331e35$36525672$43c91c49$@com> > Content-Type: text/plain; charset="us-ascii" > > Hi Alexander > > If you've set all the parameters then this shouldn't happen since it > replaces parameters starting from the longest parameter name BUT if @graph1 > / @graph2 haven't been set then they will be partially replaced since those > parameters will be inserted first. > > Problem is that it's quite hard to determine what exactly is a parameter > since there's always the chance that you might have something like a email > address in the query or a language tag on a literal which could clash with > a parameter name > > Not really sure what if anything can be done to address this, could do some > kind of regexp based replace and restrict parameter names to a specific set > of characters (alphanumerics, hyphens and underscores?) if you think that'd > be more useful? > > Rob > > ---------------------------------------- > From: "Alexander Sidorov" <ale...@gm...> > Sent: Tuesday, March 23, 2010 2:39 AM > To: dot...@li... > Subject: [dotNetRDF-develop] SparqlParameterizedString parameters bug > > Hello! > > Current parameter replacing by it's value implementation in > SparqlParamterizedString is a bit incorrect. The wrong thing is that it > doesn't check whether found parameter string is a whole parameter or a part > of another parameter. Example: > > > We have "@graph", "@graph1" and "@graph2" parameters. We set "@graph" > parameter value first - "@graph1" and "@graph2" will be partly replaced > too. > > > Regards, > Alexander > > > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > > ------------------------------ > > _______________________________________________ > Dotnetrdf-develop mailing list > Dot...@li... > https://lists.sourceforge.net/lists/listinfo/dotnetrdf-develop > > > End of Dotnetrdf-develop Digest, Vol 4, Issue 9 > *********************************************** > |
From: Rob V. <rv...@do...> - 2010-03-29 13:25:45
|
Hi Alexander As of revision 687 this is now (hopefully) fixed, parameter names are limited to those composed of alphanumeric characters and underscores, attempting to use parameter names that don't conform to this results in a FormatException when you try and set the value for the parameter. Parameter replacement is now based on regular expression replacement similar to your suggestion so in your example of having @graph, @graph1 and @graph2 if you've set @graph but not the others only @graph should now get replaced when you call the ToString() method. Hope this resolves the issue for you Thanks, Rob From: Alexander Sidorov [mailto:ale...@gm...] Sent: 27 March 2010 09:10 To: dot...@li... Subject: Re: [dotNetRDF-develop] Dotnetrdf-develop Digest, Vol 4, Issue 9 Hi Rob, Sorry, I didn't notice it replaces parameters starting from the longest one. But nevertheless there could be some conflicts. I think the best solution would be to use regexp like this: String.Format(@"\s{0}\s", parameterName). Regards, Alexander 2010/3/25 <dot...@li...> Send Dotnetrdf-develop mailing list submissions to dot...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/dotnetrdf-develop or, via email, send a message with subject or body 'help' to dot...@li... You can reach the person managing the list at dot...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Dotnetrdf-develop digest..." Today's Topics: 1. Re: SparqlParameterizedString parameters bug (Rob Vesse) ---------------------------------------------------------------------- Message: 1 Date: Wed, 24 Mar 2010 13:58:49 -0700 From: "Rob Vesse" <rv...@do...> Subject: Re: [dotNetRDF-develop] SparqlParameterizedString parameters bug To: "dotNetRDF Developer Discussion and Feature Request" <dot...@li...> Message-ID: <42331e35$36525672$43c91c49$@com> Content-Type: text/plain; charset="us-ascii" Hi Alexander If you've set all the parameters then this shouldn't happen since it replaces parameters starting from the longest parameter name BUT if @graph1 / @graph2 haven't been set then they will be partially replaced since those parameters will be inserted first. Problem is that it's quite hard to determine what exactly is a parameter since there's always the chance that you might have something like a email address in the query or a language tag on a literal which could clash with a parameter name Not really sure what if anything can be done to address this, could do some kind of regexp based replace and restrict parameter names to a specific set of characters (alphanumerics, hyphens and underscores?) if you think that'd be more useful? Rob ---------------------------------------- From: "Alexander Sidorov" <ale...@gm...> Sent: Tuesday, March 23, 2010 2:39 AM To: dot...@li... Subject: [dotNetRDF-develop] SparqlParameterizedString parameters bug Hello! Current parameter replacing by it's value implementation in SparqlParamterizedString is a bit incorrect. The wrong thing is that it doesn't check whether found parameter string is a whole parameter or a part of another parameter. Example: We have "@graph", "@graph1" and "@graph2" parameters. We set "@graph" parameter value first - "@graph1" and "@graph2" will be partly replaced too. Regards, Alexander -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ ---------------------------------------------------------------------------- -- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ------------------------------ _______________________________________________ Dotnetrdf-develop mailing list Dot...@li... https://lists.sourceforge.net/lists/listinfo/dotnetrdf-develop End of Dotnetrdf-develop Digest, Vol 4, Issue 9 *********************************************** |