@@ -51,6 +51,22 @@ describe('sparql query tests', function () {
5151 } , done ) ;
5252 } ) ;
5353
54+ it ( 'should run SPARQL ASK query' , function ( done ) {
55+ this . timeout ( 10000 ) ;
56+ var myQuery = "PREFIX foaf: <http://xmlns.com/foaf/0.1/>" +
57+ "PREFIX ppl: <http://people.org/>" +
58+ "ASK WHERE { ?s foaf:knows ppl:person3 }" ;
59+ db . graphs . sparql ( {
60+ defaultGraphs : 'http://marklogic.com/semantics#default-graph' ,
61+ contentType : 'application/json' ,
62+ query : myQuery
63+ } ) .
64+ result ( function ( response ) {
65+ console . log ( JSON . stringify ( response ) ) ;
66+ response . boolean . should . equal ( true ) ;
67+ done ( ) ;
68+ } ) ;
69+ } ) ;
5470
5571 it ( 'should run SPARQL select query ' , function ( done ) {
5672 this . timeout ( 10000 ) ;
@@ -132,24 +148,7 @@ describe('sparql query tests', function () {
132148 } ) ;
133149
134150
135- //TODO: Update after issue #208 is fixed
136151
137- it ( 'should run SPARQL ASK query' , function ( done ) {
138- this . timeout ( 10000 ) ;
139- var myQuery = "PREFIX foaf: <http://xmlns.com/foaf/0.1/>" +
140- "PREFIX ppl: <http://people.org/>" +
141- "ASK WHERE {GRAPH ?g { ?s foaf:knows ppl:person3 }}" ;
142- db . graphs . sparql ( {
143- contentType : 'application/json' ,
144- query : myQuery ,
145- defaultGraphs : 'http://marklogic.com/semantics#default-graph'
146- } ) .
147- result ( function ( response ) {
148- console . log ( response ) ;
149- response . boolean . should . equal ( true ) ;
150- done ( ) ;
151- } ) ;
152- } ) ;
153152
154153 it ( 'should run SPARQL ASK query return false' , function ( done ) {
155154 this . timeout ( 10000 ) ;
@@ -301,7 +300,7 @@ describe('sparql query tests', function () {
301300 });
302301 });
303302
304- */
303+
305304 it('should delete the graph', function (done) {
306305 this.timeout(10000);
307306 db.graphs.remove().
@@ -310,7 +309,7 @@ describe('sparql query tests', function () {
310309 done();
311310 }, done);
312311 });
313-
312+ */
314313
315314 it ( 'should write the graph' , function ( done ) {
316315 this . timeout ( 10000 ) ;
0 commit comments