Hi Guys Sorry for asking one last dumb question

Is ParameterizedSparqlString the preferred way to do variable bindings in
all scenarios?

I ask because I'm not sure if there are performance gains to be had using
the query.setValuesDataBlock or QueryExecutionFactory.create(query, dataset,
initialBinding) methods when the query is not going against a sparql
service.

Thanks once again.
Phil



On Thu, Aug 22, 2013 at 5:42 PM, Joshua TAYLOR <[email protected]>wrote:

> > On 8/22/13 9:19 AM, "Phil Ashworth" <[email protected]> wrote:
> >
> >>Hi Guys
> >>I noticed the documentation states*
> >>"
> >>QuerySolutionMap initialBinding = new
> >>QuerySolutionMap();initialBinding.add("name", personResource);qe =
> >>QueryExecutionFactory.create(query, dataset, initialBinding);*
> >>
> >>* *
> >>
> >>*This is often much simpler than the string equivalent since you don't
> >>have
> >>to escape quotes in literals. (Beware that this doesn't work for
> >>sparqlService, which is a great shame. It would be nice to spend some
> time
> >>remedying that.) "*
> >>
> >>I'm actually in the situation that I would like to bind variables for a
> >>sparqlService.
>
> On Thu, Aug 22, 2013 at 12:27 PM, Rob Vesse <[email protected]> wrote:
> > See ParamaterizedSparqlString -
> >
> http://jena.apache.org/documentation/query/parameterized-sparql-strings.htm
> > l
>
> In addition to the documentation, there are some code samples floating
> around the web, too.
>
> This stack overflow answer has code demonstrating the use of a
> parameterized SPARQL string:
>
> http://stackoverflow.com/questions/16737653/get-latitude-and-longitude-of-a-place-dbpedia
>
> Additionally, if you need more than one set of bindings, there's an
> not-too-old (about 3 weeks) about programmatically constructing a
> VALUES block for query here (which doesn't use a
> ParameterizedSparqlString):
>
> http://mail-archives.apache.org/mod_mbox/jena-users/201308.mbox/%3cca+q4jnn9vce94x2mmepuhnwjsj4kxeksrtuwf8n43jsc37c...@mail.gmail.com%3E
>
> //JT
>
> --
> Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
>

Reply via email to