Hi Ghislain, You probably want to add a database parameter, pointing to the content database you’d like to query. Or use a rest-api instance linked to that content database directly, running on a different port. App-services (which runs on 8000) is linked to the Documents database, which out of the box does not have triple index enabled.
Kind regards, Geert From: <[email protected]<mailto:[email protected]>> on behalf of Ghislain Atemezing-Pro <[email protected]<mailto:[email protected]>> Reply-To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Friday, March 17, 2017 at 6:39 PM To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Subject: [MarkLogic Dev General] Error 500 when queryinq with Curl Hi all? I am trying to run a SPARQL query using Curl in my endpoint. I am doing the following: curl --anyauth -u user:password -H "Content-type: application/sparql-query" -H "Accept: application/sparql-results+xml" --data-binary '@./q1.rq' http://localhost:8000/v1/graphs/sparql But I receive back a 500 errors as described below: <error-response xmlns="http://marklogic.com/xdmp/error"> <status-code>500</status-code> <status>Internal Server Error</status> <message-code>INTERNAL ERROR</message-code> <message>XDMP-TRPLIDXNOTFOUND: xdmp:security-assert("http://marklogic.com/xdmp/privileges/rest-reader", "execute"), let $rule := conf:get-sparql-protocol-rule() let $params := rest:process-request($rule) let $headers := eput:get-request-headers() let $method := eput:get-request-method($headers) let $env := map:map() let $params := local:validate-params($rule, $env, $params) let $body := switch ($method) case "GET" return text { fn:head((map:get($params, "query"), map:get($params, "update"))) } case "POST" return xdmp:get-request-body(eput:get-content-format($headers, $params))/node() default return fn:error((), "REST-UNSUPPORTEDMETHOD", $method) let $result := semmod:sparql-query($headers, $params, $body) let $response := if ($result instance of xs:string and $result = ("EMPTY-CONSTRUCT", "EMPTY-DESCRIBE")) then semmod:empty-construct($headers, $params, local:sparql-callback#2) else if ($result instance of xs:string and $result eq "EMPTY-SELECT") then semmod:empty-select($headers, $params, local:sparql-callback#2) else semmod:results-payload($headers, $params, $result, local:sparql-callback#2) return if ($response instance of node() and $response/self::semmod:malformed-query) then (xdmp:set-response-code(400, "Malformed Query"), $response) else $response -- Triple index not enabled . See the MarkLogic server error log for further detail.</message> </error-response> The same query works just fine in the qconsole interface. What Am I missing here? Thanks for any help or pointer. Best, Ghislain -- -------------------------------------------- Ghislain A. Atemezing, Ph.D R&D Engineer @ Mondeca, Paris, France Labs: http://labs.mondeca.com Tel: +33 (0)1 4111 3034 Web: www.mondeca.com<http://www.mondeca.com> Twitter: @gatemezing About Me: http://atemezing.org
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
