Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How we combined CKAN with WordPress for opendata.swiss

How we combined CKAN with WordPress for opendata.swiss

Stefan Oderbolz

October 04, 2016

More Decks by Stefan Oderbolz

Other Decks in Technology


  1. How we combined CKAN
    with WordPress
    Stefan Oderbolz
    CKANCon 2016
    4th October 2016

    View Slide

  2. View Slide

  3. Requirements
    ● Use CKAN for the data catalogue
    ○ DCAT-AP Switzerland metadata standard
    ○ Multilingual content
    ● Arbitrary pages (FAQ, About, Blog)
    ○ Multilingual content
    ● Manageable forms (Contact, surveys etc.)
    ● Harvesting of data in DCAT-AP Switzerland format
    ● ...

    View Slide

  4. Solution: let’s combine CKAN with WordPress
    ● Loosly coupled: they call each others APIs
    ● We use Apache as a proxy
    ○ WordPress runs on port 80
    ○ CKAN runs on port 8080
    ○ Specific routes are proxied on WordPress
    ● User management only on WordPress

    View Slide

  5. View Slide

  6. View Slide

  7. Goal: one administration interface
    ● Our WordPress plugin (soon Open Source!) let’s us manage CKAN entities:
    ○ Datasets
    ○ Groups
    ○ Organizations
    ○ Harvester
    ● We save all data in WordPress and make API calls to “sync” them to CKAN
    ● Form has some usability issues
    ○ Too long, no possibility to collapse
    ○ Save button is on the top

    View Slide

  8. Intermezzo: What is DCAT-AP?
    ● DCAT = Data Catalog vocabulary
    ○ Vocabulary to describe catalogs, dataset and distributions
    ● AP = Application profile
    ○ Ruleset of mandatory, optional or conditional fields
    ● E.g. “DCAT-AP for data portals in Europe” (DCAT-AP EU) is a standard for
    public sector data in Europe
    ● DCAT-AP Switzerland is compatible to DCAT-AP EU, but has some additional
    fields or fields that are currently not used
    More Information: http://handbook.opendata.swiss/en/library/ch-dcat-ap

    View Slide

  9. View Slide

  10. View Slide

  11. DCAT-AP XML Import/Export
    ● Easy transfer from test system to production
    ● Reference implementation for data owners, transition to DCAT-AP XML

    View Slide

  12. Harvester Dashboard
    ● Manage harvesters from
    ● Start, stop & clear harvester
    ● Indicator of status
    ● Check the error log of
    previous jobs

    View Slide

  13. View Slide

  14. View Slide

  15. APIs are key
    ● To exchange data between the two systems we use APIs on both sides
    ● CKAN
    ○ Standard API calls for CRUD operations on all entities
    ○ Custom API calls where needed (e.g. dataset count total + per group, to have only one call)
    ● WordPress
    ○ Expose WordPress entities as custom API (e.g. “Application”)
    ○ To increase performance we save some API responses for 10 minutes in Redis (e.g. Dataset
    count on frontpage)

    View Slide

  16. @odi

    View Slide