[Developers] RDF Service

Aseem Mohanty aseem at metaweb.com
Sat Nov 29 05:58:09 UTC 2008


Hi Rodolfo.

Per the RFC: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html you 
need to specify the complete mime-type, which in this is probably of the 
form application/rdf+xml.

OTOH we should probably be generating a 406 
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html sec. 10.4.7) for 
requests with malformed Accept headers.

I have filed a bug for this issue available at: 
https://bugs.freebase.com/browse/SW-10

Thanks for catching this.

Aseem

Rodolfo Stecher wrote:
> Dear all,
> I am trying to access from Java the RDF service
> 
> So, I e.g. create a URL:
> 
> URL rdfURL = new URL("http://rdf.freebase.com/rdf/type.lang");
> URLConnection rdfConn = rdfURL.openConnection ();			
> 
> //setting the type of results I want to receive as specified in:
> http://rdf.freebase.com/
> rdfConn.addRequestProperty("Accept", "RDF/XML");
> 
> InputStreamReader rdfiSR = new InputStreamReader(rdfConn.getInputStream());
> 
> Then I get, regardless of the value (N3, RDF/XML or Turtle) of the Accept
> parameter, the following exception:
> 
> Server returned HTTP response code: 500 for URL:
> http://rdf.freebase.com/rdf/type.lang
> 
> When I remove the specification of the Accept parameter, then I get the
> response in readable format, e.g.:
> 
> @prefix fb: http://rdf.freebase.com/ns/.@prefix rdf:
> http://www.w3.org/1999/02/22-rdf-syntax-ns#.@prefix rdfs:
> http://www.w3.org/2000/01/rdf-schema#.@prefix xml:
> http://www.w3.org/XML/1998/namespace. <http://rdf.freebase.com/ns/type.lang>
> a <http://rdf.freebase.com/ns/type.type>;
> <http://rdf.freebase.com/ns/freebase.documented_object.documentation>
> <http://rdf.freebase.com/ns/guid.9202a8c04000641f80000000042b11e2>;
> <http://rdf.freebase.com/ns/freebase.documented_object.tip> "the type of
> which all languages are instances";
> <http://rdf.freebase.com/ns/type.object.key> [
> <http://rdf.freebase.com/ns/type.key.namespace> fb:type;
> <http://rdf.freebase.com/ns/type.value.value> "lang"];
> <http://rdf.freebase.com/ns/type.object.name> "Language";
> <http://rdf.freebase.com/ns/type.object.permission>
> <http://rdf.freebase.com/ns/boot.root_permission>;
> <http://rdf.freebase.com/ns/type.type.default_property> "id";
> <http://rdf.freebase.com/ns/type.type.domain> fb:type;
> <http://rdf.freebase.com/ns/type.type.expected_by> .....
> 
> 
> So, I guess I am specifying wrongly the HTTP "Accept" parameter, or that
> this option is not working properly, could you please help me out?
> 
> Thanks a lot,
> Rodolfo
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers


More information about the Developers mailing list