Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect handling of content negotiation header #1

Open
micheldumontier opened this issue Jun 13, 2014 · 8 comments
Open

Incorrect handling of content negotiation header #1

micheldumontier opened this issue Jun 13, 2014 · 8 comments
Labels

Comments

@micheldumontier
Copy link
Member

It looks like whatever libraries are being used to handle the content-negotiation at the Bio2RDF end are not dealing with these complex (but valid!) request headers.

curl -H 'Accept: application/rdf+xml, application/xml; q=0.8, text/xml; q=0.7, application/rss+xml; q=0.3, /; q=0.2' --dump-header -http://bio2rdf.org/hgnc_vocabulary:approved-name
HTTP/1.1 404 Not Found
Date: Fri, 13 Jun 2014 08:02:39 GMT
Server: Jetty(8.1.12.v20130726)
Content-Length: 0

$ curl -H 'Accept: application/rdf+xml' --dump-header -http://bio2rdf.org/hgnc_vocabulary:approved-name
HTTP/1.1 200 OK
Date: Fri, 13 Jun 2014 08:03:11 GMT
Server: Jetty(8.1.12.v20130726)
Content-Type: application/rdf+xml
Content-Length: 1720

@vemonet

@ansell
Copy link

ansell commented Jun 19, 2014

The previous version webapp passed the following test-case, including the Accept header that Michel mentions above and other major browsers common headers:

https://github.com/ansell/queryall/blob/develop/content-negotiation/src/test/java/org/queryall/negotiation/test/QueryallContentNegotiatorTest.java

@vemonet
Copy link
Member

vemonet commented Jun 19, 2014

Issue fixed on http://beta.bio2rdf.org/

curl -i -H 'Accept: application/rdf+xml, application/xml; q=0.8, text/xml; q=0.7, application/rss+xml; q=0.3, /; q=0.2' http://beta.bio2rdf.org/hgnc_vocabulary:approved-name

HTTP/1.1 200 OK
Date: Thu, 19 Jun 2014 21:01:18 GMT
Server: Jetty(8.1.14.v20131031)
Content-Type: application/rdf+xml
Content-Length: 1593

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:j.0="http://bio2rdf.org/hgnc_vocabulary:"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:void="http://rdfs.org/ns/void#"
    xmlns:ns5="http://bio2rdf.org/bio2rdf_vocabulary:"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > 
  <rdf:Description rdf:about="http://bio2rdf.org/hgnc_vocabulary:approved-name">
    <ns5:uri rdf:datatype="http://www.w3.org/2001/XMLSchema#string">http://bio2rdf.org/hgnc_vocabulary:approved-name</ns5:uri>
    <dc:identifier>hgnc_vocabulary:approved-name</dc:identifier>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
    <rdfs:label xml:lang="en">approved name [hgnc_vocabulary:approved-name]</rdfs:label>
    <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">approved name [hgnc_vocabulary:approved-name]</rdfs:label>
    <ns5:namespace rdf:datatype="http://www.w3.org/2001/XMLSchema#string">hgnc_vocabulary</ns5:namespace>
    <dcterms:title xml:lang="en">approved name</dcterms:title>
    <rdf:type rdf:resource="http://bio2rdf.org/hgnc_vocabulary:Resource"/>
    <ns5:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">approved-name</ns5:identifier>
    <dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">hgnc_vocabulary:approved-name</dcterms:identifier>
    <void:inDataset rdf:resource="http://bio2rdf.org/hgnc_resource:bio2rdf.dataset.hgnc.R3"/>
  </rdf:Description>
</rdf:RDF>

The service will return result for those MIME types :

  • application/rdf+xml
  • text/rdf+n3 (application/rdf+n3, application/n3, text/n3 )
  • text/turtle
  • text/plain
  • text/html

(the json-ld will come when the REST service will handle that)

Let me know if you find some issues with this or if I can deploy it on bio2rdf.org !

@micheldumontier

@micheldumontier
Copy link
Member Author

Great! go ahead and deploy on bio2rdf.org

@micheldumontier
Copy link
Member Author

Hi. We need to support other content-types:
application/x-ntriples
application/x-nquads
application/x-trig

possible?

@vemonet
Copy link
Member

vemonet commented Aug 5, 2014

I'll take a look when the datahub update will be done

@ansell
Copy link

ansell commented Aug 5, 2014

Standardising on application/n-triples (RDF-1.1 N-Triples) and application/trig (RDF-1.1 TriG) and application/n-quads (RDF-1.1 N-Quads) would also be useful if the underlying RDF library actually outputs them.

@vemonet
Copy link
Member

vemonet commented Aug 6, 2014

We are using Jena library to generate the RDF in different formats

@vemonet vemonet removed their assignment May 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants