Ticket #1173 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Offer a DCat representation for packages in the API

Reported by: amercader Owned by: amercader
Priority: major Milestone: pdeu-1
Component: pdeu Keywords:
Cc: adria.mercader@… Repository: ckan
Theme: none

Description

/api/rest/package/foo.rdf should return a DCat representation of the package. To create it, we will use the functions in ckanext-rdf.

Change History

comment:1 Changed 3 years ago by pudo

I propose we do a bit of frameworkiness here: set up a two-part content type registry and refactor the API controller to use it.

The idea would be to do the following things:

  1. Create a registry mapping format extensions to mime types: RepresentationRegistry?.add_format('json', 'application/json')
  2. Create a registry of (mime types, entity types) -> converter functions that yield an appropriate representation of the entity.
  3. Hook this into the _finish method of the API controller based on Accept: handling
  4. Add support for /api/rest/ENTITY/NAME.{format} and /ENTITY/NAME.{format} to routing, use registry from (1) to rewrite accept headers.
  5. Register converters in load_environment or via IConfigurable plugins
  6. Document

What do you think?

comment:2 Changed 3 years ago by amercader

  • Cc adria.mercader@… added

comment:3 Changed 3 years ago by pudo

  • Status changed from new to closed
  • Resolution set to fixed

Now available in ckanext-rdf and linked to from WUI.

Note: See TracTickets for help on using tickets.