1

When I query the SPARQL endpoint for marklogic, I am trying to specify the optimize option:

/v1/graphs/sparql?options=optimize%3D2

This results in a 400 error: REST-INVALIDPARAM: (err:FOER0000) Invalid parameter: No configured options: optimize=2"

What is the correct syntax to specify this and other options?

Related: How can I optimize a SPARQL query that returns optional properties?

Community
  • 1
  • 1
RMorrisey
  • 7,637
  • 9
  • 53
  • 71

1 Answers1

3

See reference for GET /v1/graphs/sparql. There is an "optimize" parameter you can specify. For example:

/v1/graphs/sparql?optimize=2

The "options" parameter accepts the name of persisted query options.

Sam Mefford
  • 2,465
  • 10
  • 15
  • Thanks! I was able to get this to work with the SPARQL REST endpoint. Do you know if there is also a way to specify this param when using the Query Console tool? – RMorrisey Apr 26 '17 at 21:04
  • 1
    Do you mean calling the REST endpoint from Query Console? Or using XQuery? Or using Javascript? Or SPARQL? If XQuery, see the http://docs.marklogic.com/sem:sparql docs. In particular, the third argument which accepts a sequence of strings, one of which can be "optimize=2". – Sam Mefford May 04 '17 at 23:41