Uploaded image for project: 'Fedora Repository Project'
  1. Fedora Repository Project
  2. FCREPO-1887

Fedora4 Rest API GET Method "Accept-Post" header does not list all allowed supported RDF formats

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Fedora 4.4.0, Fedora 4.5.0
    • Fix Version/s: Fedora 4.7.1
    • Component/s: f4-core, f4-ldp
    • Labels:
    • Environment:
      Unix, Linux, OSX
    • Roadmap Theme:
      Services: CRUD
    • Sprint:
      Sprint 2016 - 17

      Description

      Response headers for a direct GET rest end point call (root resource) list the following RDF formats in the Accept-Post header
      ..
      Accept-Post: text/turtle,text/rdf+n3,text/n3,application/rdf+xml,application/n-triples,multipart/form-data,application/sparql-update
      ..

      But POST method allows also application/ld+json (not listed in the previous header) as valid rdf format source for new Resources:

      example (tested on 4.4.x and 4.5.0) to reproduce:
      $ curl -XGET http://localhost:8080/rest -v

      outputs (trimmed, only headers)

      • Connected to localhost (::1) port 8080 (#0)
        > GET /rest HTTP/1.1
        > User-Agent: curl/7.38.0
        > Host: localhost:8080
        > Accept: /
        >
        < HTTP/1.1 200 OK
        < Date: Thu, 04 Feb 2016 17:54:57 GMT
        < Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
        < Link: <http://www.w3.org/ns/ldp#Container>;rel="type"
        < Link: <http://www.w3.org/ns/ldp#BasicContainer>;rel="type"
        < Accept-Patch: application/sparql-update
        < Accept-Post: text/turtle,text/rdf+n3,text/n3,application/rdf+xml,application/n-triples,multipart/form-data,application/sparql-update
        < Allow: MOVE,COPY,DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS
        < Preference-Applied: return=representation
        < Vary: Prefer
        < Vary: Accept, Range, Accept-Encoding, Accept-Language
        < Content-Type: text/turtle
        < Content-Length: 2327
      • Server Jetty(9.2.3.v20140905) is not blacklisted
        < Server: Jetty(9.2.3.v20140905)

      Now create a new resources using POST using application/ld+json which is not listed.

      $ curl -XPOST -H "Content-Type: application/ld+json" -H "Slug:testjsonld" --data-binary "@jsonld.txt" -v http://localhost:8080/rest/

      jsonld.txt file content (body)
      [
      {
      "@id": "http://localhost:8080/rest/testjsonld",
      "@type": [
      "http://www.w3.org/ns/ldp#RDFSource",
      "http://www.w3.org/ns/ldp#Container"
      ],
      "http://purl.org/dc/elements/1.1/title": [

      { "@value": "json ld test" }

      ]
      }
      ]

      Response (resource created):

      • Connected to localhost (::1) port 8080 (#0)
        > POST /rest/ HTTP/1.1
        > User-Agent: curl/7.38.0
        > Host: localhost:8080
        > Accept: /
        > Content-Type: application/ld+json
        > Slug:testjsonld2
        > Content-Length: 276
        >
      • upload completely sent off: 276 out of 276 bytes
        < HTTP/1.1 201 Created
        < Date: Thu, 04 Feb 2016 17:26:24 GMT
        < ETag: "6654d7f2f741be93df0f265571ab9e1bcadbd21c"
        < Last-Modified: Thu, 04 Feb 2016 17:26:24 GMT
        < Location: http://localhost:8080/rest/testjsonld
        < Content-Type: text/plain
        < Content-Length: 38
      • Server Jetty(9.2.3.v20140905) is not blacklisted
        < Server: Jetty(9.2.3.v20140905)
        <
      • Connection #0 to host localhost left intact
        http://localhost:8080/rest/testjsonld

      Are there other rdf formats also available that can be used and are not listed? I guess json-ld is the only one.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dpinokrayon Diego Pino Navarro
                Reporter:
                dpinokrayon Diego Pino Navarro
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: