"sending query…" seems stalled

107 views
Skip to first unread message

Melanie Courtot

unread,
Mar 8, 2013, 5:20:03 PM3/8/13
to sgvi...@googlegroups.com
Hi all,

I am just starting to use sgvizler, and my requests seem to be stalled at "sending query..."

Trying to see what went wrong:
(1) downloading the latest svgizler.html file and running it locally works fine
(2) updating that file (removing commented section, removing query form...) works fine
(3) If I update the query on the file in (2) to be something generic such as SELECT DISTINCT ?type WHERE { ?thing a ?type .} ORDER BY ?type LIMIT 10 works fine
(4) If I change the endpoint to point towards my local Sesame things go wrong. The firebug console tells me the request is sent, and there doesn't seem to be any response back. See attached screenshot. Copying the GET parameter in my browser downloads a json response. (I tried asking for json and xml - same result.)
(5) trying to run the same query (same file) and just update the endpoint to online ones to check if I have a problem with my local server, I can't get past the "sending query" point. I tried

'endpoint': "http://cell.ctde.net:8080/openrdf-sesame/repositories/CL", (OWLIM)
'endpoint': "http://sparql.obo.neurocommons.org/sparql", (Virtuoso)
'endpoint': "http://sparql.hegroup.org/sparql/", (Virtuoso)

to check if the error was linked to a specific family of triplestore (I tried asking for JSON or XML) and nothing goes through.

(6) If after testing the above I use again the "original" example endpoint ( 'endpoint': "http://sws.ifi.uio.no/sparql/world",) things work fine again.

The above endpoints are all different types, managed by different groups of people, on different machines and the same html file was working yesterday (of course :)) against my local Sesame.

It seems like I am missing something very basic, but at this stage I just have no idea. Any suggestion would be greatly appreciated!

Thanks,
Melanie

ps: I am attaching the HTML test file in case it helps - you can uncomment the various endpoint URIs if you want to try.

test.html
Screen Shot 2013-03-08 at 1.38.46 PM.png

"Martin G. Skjæveland"

unread,
Mar 9, 2013, 5:31:48 AM3/9/13
to sgvi...@googlegroups.com
Hi Melanie,

thanks for your detailed report and the attachment. I have managed to
make some things work, see below.

On 08/03/13 23:20, Melanie Courtot wrote:
> Hi all,
>
> I am just starting to use sgvizler, and my requests seem to be stalled at "sending query..."

Don't pay too much attention to these short feedback messages. The
logging/feedback needs to be improved.
The results are returned as a file it seems. The response header says:

attachment; filename=query-result.srx

which I see is the same as in your screen shot. I have not seen this
before, so this needs more attention. If anyone on the list can shed
some light on this, please do. My initial thoughts are to have the
endpoint return the results in a different format by adding/changing
some URL parameters, or have the jQuery function which receives the
result interpret also such responses.

> 'endpoint': "http://sparql.obo.neurocommons.org/sparql", (Virtuoso)

This works if you set the output format to jsonp:

'endpoint_output': 'jsonp'

Note that the URL in test.html is wrong, is should say, I guess,

// 'endpoint': "http://sparql.obo.neurocommons.org/sparql",

and not

// 'endpoint': "http://sparql.obo.neurocommons.org/",


> 'endpoint': "http://sparql.hegroup.org/sparql/", (Virtuoso)

This also works if you set the output format to jsonp.

jsonp is a way to include external javascript responses into the page,
"tricking" some security measures for javascript. I see I must update
the comment to also say that jsonp is a legal format! These is a little
to read about it here:

http://code.google.com/p/sgvizler/wiki/Compatibility or

http://2012.eswc-conferences.org/sites/default/files/eswc2012_submission_303.pdf

Martin

Melanie Courtot

unread,
Mar 11, 2013, 1:07:54 PM3/11/13
to sgvi...@googlegroups.com
Hi Martin,

Thanks for the reply and trying out the various endpoints on your side.
Please see inline.

On 2013-03-09, at 2:31 AM, Martin G. Skjæveland wrote:

> Hi Melanie,
>
> thanks for your detailed report and the attachment. I have managed to make some things work, see below.
>
> On 08/03/13 23:20, Melanie Courtot wrote:
>> Hi all,
>>
>> I am just starting to use sgvizler, and my requests seem to be stalled at "sending query..."
>
> Don't pay too much attention to these short feedback messages. The logging/feedback needs to be improved.
>
>> 'endpoint': "http://cell.ctde.net:8080/openrdf-sesame/repositories/CL", (OWLIM)
>
> The results are returned as a file it seems. The response header says:
>
> attachment; filename=query-result.srx
>
> which I see is the same as in your screen shot. I have not seen this before, so this needs more attention. If anyone on the list can shed some light on this, please do. My initial thoughts are to have the endpoint return the results in a different format by adding/changing some URL parameters, or have the jQuery function which receives the result interpret also such responses.

I did see that and wondered if it may cause the issue. When I copy/paste the query that is passed as parameter from the console, I did also notice that the extra parameter
// This string is appended the 'endpoint' variable and the query to it again to give a link to the "raw" query results.
'endpoint_query_url': "?output=text&query=",

is not present. I thought maybe this specific parameter is not supported by Sesame, and therefore ignored. If I add it "manually" it still returns an attachment. (I also tried output=json, format=text to mimick virtuoso, no success)

The part that bothers me is that the day before the queries were working fine against the same server, and as far as I know nothing has been updated nor parameter changed. (It is locally installed on my machine, and was not even restarted in between)

>
>> 'endpoint': "http://sparql.obo.neurocommons.org/sparql", (Virtuoso)
>
> This works if you set the output format to jsonp:
>
> 'endpoint_output': 'jsonp'
>
> Note that the URL in test.html is wrong, is should say, I guess,
>
> // 'endpoint': "http://sparql.obo.neurocommons.org/sparql",
>
> and not
>
> // 'endpoint': "http://sparql.obo.neurocommons.org/",
>
>
>> 'endpoint': "http://sparql.hegroup.org/sparql/", (Virtuoso)
>
> This also works if you set the output format to jsonp.
>
> jsonp is a way to include external javascript responses into the page, "tricking" some security measures for javascript. I see I must update the comment to also say that jsonp is a legal format! These is a little to read about it here:
>
> http://code.google.com/p/sgvizler/wiki/Compatibility or
> http://2012.eswc-conferences.org/sites/default/files/eswc2012_submission_303.pdf

Ok - it seems support for jsonp is in the works for Sesame and should be out fairly soon. If I can't find any solution I'll either wait or switch triplestore - I am just testing locally, so not a big deal (though it seems a bit of a shame)

Thanks,
Melanie


>
> Martin
>
> --
> --
> To post to this group, send email to sgvi...@googlegroups.com
> Group homepage: http://groups.google.com/group/sgvizler
> Project homepage: http://code.google.com/p/sgvizler/
>
> --- You received this message because you are subscribed to the Google Groups "Sgvizler" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sgvizler+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

"Martin G. Skjæveland"

unread,
Mar 11, 2013, 2:57:13 PM3/11/13
to sgvi...@googlegroups.com
On 11/03/13 18:07, Melanie Courtot wrote:
> I did see that and wondered if it may cause the issue. When I copy/paste the query that is passed as parameter from the console, I did also notice that the extra parameter
> // This string is appended the 'endpoint' variable and the query to it again to give a link to the "raw" query results.
> 'endpoint_query_url': "?output=text&query=",
>
> is not present. I thought maybe this specific parameter is not supported by Sesame, and therefore ignored. If I add it "manually" it still returns an attachment. (I also tried output=json, format=text to mimick virtuoso, no success)

The value of this parameter/variable is not used when querying the
endpoint for sgvizler visualization, but when an error message is given
to the user. Then a link to the "raw" results are given using this
variable, so that the user can check that the results are as expected.
This parameter is apparently badly explained, others have misunderstood
it before. I added it because Joseki, which I had installed locally when
I started writing sgvizler, has this feature.

> The part that bothers me is that the day before the queries were working fine against the same server, and as far as I know nothing has been updated nor parameter changed. (It is locally installed on my machine, and was not even restarted in between)

Strange, but difficult for me to help here. What do could do is try to
run the endpoint on localhost:80 or serve the html pages on the port
that the endpoint runs on. Or setup some proxy that translates the
requests between the ports. What will get you out of CORS trouble.

I remember testing a PHP proxy script, that worked fine. I don't have it
now, but a search gave me, e.g.,


https://github.com/cowboy/php-simple-proxy/blob/master/ba-simple-proxy.php

which looks promising, but I have not tested it.

> Ok - it seems support for jsonp is in the works for Sesame and should be out fairly soon. If I can't find any solution I'll either wait or switch triplestore - I am just testing locally, so not a big deal (though it seems a bit of a shame)

Yes, I looked around and found this, and include it for others:

http://www.openrdf.org/issues/browse/SES-1019

Please report back if there are news.

Thanks,
Martin

Melanie Courtot

unread,
Mar 11, 2013, 3:19:28 PM3/11/13
to sgvi...@googlegroups.com
Hi Martin,

So I looked around a bit more, and one of my colleague suggested that maybe my browser was not handling the type properly. I had installed firefox/firebug to test out when I started having trouble, so I went back to Safari.

In Firefox, I get only attachments as return, which causes the issue.
In Safari, I am able to view results in a gTable - sMap and gMap don't work. I am getting a collection of states and number of occurrence (e.g., "http://sws.ifi.uio.no/d2rq/resource/District/USA/Arizona" 2
"http://sws.ifi.uio.no/d2rq/resource/District/USA/California" 29) that I was trying to visualize on a map. I don't have the geo coordinates for the states, so I was using sMap to query the google api. This used to work (but for one point stubbornly in India) but now tells me "no data points to show on map" (which is why I looked into getting debugging info and switch to firefox which caused another issue)

In short:
- it seems it is a browser issue. Possibly depending on your OS as well, I found this http://www.openrdf.org/forum/mvnforum/viewthread?thread=1643
- I need to find a way to get states to show up - probably by modifying the info in the triplestore so that I add some comment specifying the string to use to query.

Thanks for following-up!
Melanie

"Martin G. Skjæveland"

unread,
Mar 12, 2013, 5:07:38 AM3/12/13
to sgvi...@googlegroups.com
On 11/03/13 20:19, Melanie Courtot wrote:
> Hi Martin,
>
> So I looked around a bit more, and one of my colleague suggested that maybe my browser was not handling the type properly. I had installed firefox/firebug to test out when I started having trouble, so I went back to Safari.
>
> In Firefox, I get only attachments as return, which causes the issue.
> In Safari, I am able to view results in a gTable - sMap and gMap don't work. I am getting a collection of states and number of occurrence (e.g., "http://sws.ifi.uio.no/d2rq/resource/District/USA/Arizona" 2
> "http://sws.ifi.uio.no/d2rq/resource/District/USA/California" 29) that I was trying to visualize on a map. I don't have the geo coordinates for the states, so I was using sMap to query the google api. This used to work (but for one point stubbornly in India) but now tells me "no data points to show on map" (which is why I looked into getting debugging info and switch to firefox which caused another issue)
>
> In short:
> - it seems it is a browser issue. Possibly depending on your OS as well, I found this http://www.openrdf.org/forum/mvnforum/viewthread?thread=1643

There are quite a few parameters one can set on jQuery's ajax calls. I
have setup a 0.6 version of Sgvizler at

http://folk.uio.no/martige/what/20130312 [1]

with the attachment you sent adopted to fit 0.6.

Starting on line 2125 (*) in sgvizler.js you'll find the following which
you can experiment with, index.html and sgvizler.js is all you need to
download from [1]. I have added some parameters from the trunk version [2].

promise = $.ajax({
url: endpointURL(),
data: {
// See
http://stackoverflow.com/questions/10784271/load-srj-files-with-jquerys-ajax-or-getjson
queryLn: 'SPARQL',
query: prefixesSPARQL() + query(),
output: (myEndpointOutput === qfJSONP) ? qfJSON : myEndpointOutput,
limit: 'none',
infer: 'true',
Accept: 'application/sparql-results+json'

},
dataType: myEndpointOutput
//,
// See http://api.jquery.com/jQuery.ajax/, just below the list of
parameters.
//beforeSend: function (xhr) {
// xhr.overrideMimeType("application/sparql-results+json;
charset=UTF-8");
//}
});

(*) 2125 may seem a lot, but there are many comments and whitespacing.
Here is a short explanation of how the source code is organized if you
want to work on the trunk source:
https://groups.google.com/forum/?fromgroups=#!topic/sgvizler/Ocv2fzFZpsE
[2] http://code.google.com/p/sgvizler/source/browse/trunk/src/Query.js#443

> - I need to find a way to get states to show up - probably by modifying the info in the triplestore so that I add some comment specifying the string to use to query.

If I understand you correctly, you should be able to do this with the
names of the states, see


https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart
and

http://sgvizler.googlecode.com/svn/release/0.5/example/exWorld1.html

Thanks,
Martin

Melanie Courtot

unread,
Mar 12, 2013, 7:40:52 PM3/12/13
to sgvi...@googlegroups.com
Thanks Martin,

>
>> - I need to find a way to get states to show up - probably by modifying the info in the triplestore so that I add some comment specifying the string to use to query.
>
> If I understand you correctly, you should be able to do this with the names of the states, see
>
> https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart and
>
> http://sgvizler.googlecode.com/svn/release/0.5/example/exWorld1.html

So after much digging and trying around.... I was using the URIs (e.g. http://sws.ifi.uio.no/d2rq/resource/District/USA/Arizona) as parameter for the query, and it seems Google didn't like this.
I extracted the relevant subset from http://sws.ifi.uio.no/ont/world.owl, and loaded that locally into my triplestore to be able to query for labels.

Also, it appears that you can't get GeoChart to work with US states and another country at the same time as mentioned at https://groups.google.com/forum/?fromgroups=#!topic/google-visualization-api/ciE-vItjDEQ
You can indeed get the states by using the options 'region': 'US', 'resolution': 'provinces' - I was however unable to pass that to Svgizler. I produced the attached HTML file that queries directly for US states labels from http://sws.ifi.uio.no/ont/world.owl.

You can see that the gTable is fine (I have all counts as one, but that shouldn't matter for the graph). gGeoMap is ok too - though I need to find options to allow zoom in - but gGeoChart still displays the world map. Compare with geoChart.html that uses directly the Google API and displays only the US map and states.

In the testState.html file you will see that I tried and set the options for the chart to 'gGeoChart': {
'region': 'US',
'resolution': 'provinces'
},

as per https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart

Thanks for the help!
Melanie



testState.html
geoChart.html

"Martin G. Skjæveland"

unread,
Mar 13, 2013, 4:32:14 PM3/13/13
to sgvi...@googlegroups.com
Hi Melanie,

It turns out you've discovered a mysterious bug. (well, aren't they all
stupid and mysterious.) When drawing sgvizler charts in containers the
data-sgvizler-query attribure is mandatory (and it says so in the wiki).
The reason that your div is drawn, even though it has no such attribute,
is that the element id of the div in our html file is used by the query
form interface (which you have removed from the html example file). Of
course, there is no way you could know about this. Sorry about that.

This form runs the default query on load. So if using 0.5, use a
different element id than "sgvzlr_gchart" (I'll fix this soon, I hope).
The form id does not pick up default values in the same manner as other
chart, I think.

If you change the element id of the chart, then you'll see that it is no
longer drawn. Put the query into the data-sgvizler-query attribute, then
it works. You can also put chart options in the
data-sgvizler-chart-options attribute. See

http://folk.uio.no/martige/what/20130313/testState3.html

for an example.

http://folk.uio.no/martige/what/20130313/testState2.html

contains the same example using sgvizler 0.6.

Thanks,
Martin
Reply all
Reply to author
Forward
0 new messages