Skip to content

Content Negotiation for Works and People (.ttl, .jsonld, .json)

jkim-ru edited this page Jan 8, 2018 · 2 revisions

Works

Hyrax uses content negotiation to provide different formats for their works, giving users the choice of microdata, .ttl, .json, and .jsonld.

  • Example link to a work, where 1eea5c0a-4fdd-4a2b-9e43-5786c925ded8 can be replaced with a different work id and microdata is embedded in the source

    http://localhost:3000/concern/vdc/resources/1eea5c0a-4fdd-4a2b-9e43-5786c925ded8?locale=en
    
  • Example content negotiation for .ttl version (?locale=en has been replaced with a .ttl)

    http://localhost:3000/concern/vdc/resources/1eea5c0a-4fdd-4a2b-9e43-5786c925ded8.json
    
  • Example content negotiation for .json version (?locale=en has been replaced with a .json)

    http://localhost:3000/concern/vdc/resources/1eea5c0a-4fdd-4a2b-9e43-5786c925ded8.json
    
  • Example content negotiation for .jsonld version (?locale=en has been replaced with a .jsonld)

    http://localhost:3000/concern/vdc/resources/1eea5c0a-4fdd-4a2b-9e43-5786c925ded8.jsonld
    

Person

Content negotiation was implemented in a crude manner for Users/People as well, but only for .ttl and .jsonld.

  • Example link to a User profile (sync'ed to a Fedora Person object)

    http://localhost:3000/users/<user-identifier>?locale=en
    
  • Example content negotiation for .ttl version

    http://localhost:3000/users/<user-identifier>.ttl
    
  • Example content negotiation for .jsonld version

    http://localhost:3000/users/<user-identifier>.jsonld