Holger,
I'm a little stuck in the middle here. The response from the API
owner is reasonable:
As for the Content-Encoding, the API follows the standard practice of
returning gzipped content when the client says it can accept it, and
uncompressed content when the client sends in an "Accept-Encoding" header
saying it can't.
You can see it for yourself using the standard "curl" utility via the
command line. When the Accept-Encoding header doesn't specify gzip, the
response does not include the "Content-Encoding: gzip" header:
curl --head http://ohana-api-demo.herokuapp.com/api/locations -H
Accept-Encoding:identity
I don't know much Java, but you generally want to be using a standard tool
that can parse JSON and that can set headers like "Accept Encoding" and
"User-Agent".
I think HttpClient might be the tool to use for you:
http://hc.apache.org/httpclient-3.x/tutorial.html
I don't really want to contemplate creating my own custom SPARQLMotion
module just to have it behave properly. I'm not sure why your java library
is supplying a URL class that issues a header (apparently) that says it will
accept gzip, and then not be able to handle a gzip response.
- Steve
Steven R. Ray, Ph.D.
Distinguished Research Fellow
Carnegie Mellon University
NASA Research Park
Building 23 (MS 23-11)
P.O. Box 1
Moffett Field, CA 94305-0001
Email: [email protected]
Phone: (650) 587-3780
Cell: (202) 316-6481
Skype: steverayconsulting
10yr-logo-sm
From: [email protected]
[mailto:[email protected]] On Behalf Of Holger Knublauch
Sent: Tuesday, April 22, 2014 8:27 PM
To: [email protected]
Subject: Re: [topbraid-users] http code 500 problem when using Module
"Import text from URL"
This module doesn't do anything special. Here is the basic Java code of this
module for your information:
URL url = new URL(urlString);
InputStream is = url.openStream();
So it just uses the default mechanism that Java has built into the URL
class. I am not sure what request header the given URL expects.
Holger
On 4/23/2014 13:24, Steve Ray wrote:
Hmm. Does the SPARQLMotion module issue an Accept-Encoding value of "gzip,
deflate" in the request header? Or said another way, is there a way to
modify the request header generated by the module?
- Steve
Steven R. Ray, Ph.D.
Distinguished Research Fellow
Carnegie Mellon University
NASA Research Park
Building 23 (MS 23-11)
P.O. Box 1
Moffett Field, CA 94305-0001
Email: [email protected]
Phone: (650) 587-3780
Cell: (202) 316-6481
Skype: steverayconsulting
10yr-logo-sm
From: [email protected]
[mailto:[email protected]] On Behalf Of Holger Knublauch
Sent: Tuesday, April 22, 2014 5:04 PM
To: [email protected]
Subject: Re: [topbraid-users] http code 500 problem when using Module
"Import text from URL"
Looking at the server response header, it seems like the JSON is returned
with content-encoding of gzip. Could this be changed to be delivered as
normal text? Web Browsers seem to unzip this automatically but SPARQLMotion
will not.
Holger
On 4/23/2014 9:56, Steve Ray (CMU) wrote:
Question: Why is it that I get a Code 500 error when trying to retrieve text
from http://ohana-api-demo.herokuapp.com/api/locations within a SPARQLMotion
script, when using that same URL in a browser works just fine?
This is a script that I use with other sources of json data just fine, so I
don't think it's the "fault" of TBC. But do you think it could be a timeout
problem or something? Is there any setting I can change? Any other ideas?
The script works when I copy the data to a local file and use
<file:///\\%5C%5C%5C%5Clocalhost%5CData%5CWork%5CTopBraid%5COntology%5Cproje
cts%5Csc.r20130211%5CScripts%5CInput%5COhanaLocations.txt>
file://localhost/Data/Work/TopBraid/Ontology/projects/sc.r20130211/Scripts/I
nput/OhanaLocations.txt
to retrieve it.
- Steve
Steven R. Ray, Ph.D.
Distinguished Research Fellow
Carnegie Mellon University
NASA Research Park
Building 23 (MS 23-11)
P.O. Box 1
Moffett Field, CA 94305-0001
Email: [email protected]
Phone: (650) 587-3780
Cell: (202) 316-6481
Skype: steverayconsulting
10yr-logo-sm
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise
Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid
Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
For more options, visit https://groups.google.com/d/optout.
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise
Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid
Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
For more options, visit https://groups.google.com/d/optout.
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise
Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid
Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
For more options, visit https://groups.google.com/d/optout.
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise
Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid
Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
For more options, visit https://groups.google.com/d/optout.
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary
Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight,
SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.